#
# Autogenerated by Thrift Compiler (0.7.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
require 5.6.0;
use strict;
use warnings;
use Thrift;

use Net::Evernote::Simple::EDAMUserStore::Types;

# HELPER FUNCTIONS AND STRUCTURES

package Net::Evernote::Simple::EDAMUserStore::UserStore_checkVersion_args;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_checkVersion_args->mk_accessors( qw( clientName edamVersionMajor edamVersionMinor ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{clientName} = undef;
  $self->{edamVersionMajor} = 1;
  $self->{edamVersionMinor} = 21;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{clientName}) {
      $self->{clientName} = $vals->{clientName};
    }
    if (defined $vals->{edamVersionMajor}) {
      $self->{edamVersionMajor} = $vals->{edamVersionMajor};
    }
    if (defined $vals->{edamVersionMinor}) {
      $self->{edamVersionMinor} = $vals->{edamVersionMinor};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_checkVersion_args';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^1$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{clientName});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^2$/ && do{      if ($ftype == TType::I16) {
        $xfer += $input->readI16(\$self->{edamVersionMajor});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^3$/ && do{      if ($ftype == TType::I16) {
        $xfer += $input->readI16(\$self->{edamVersionMinor});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_checkVersion_args');
  if (defined $self->{clientName}) {
    $xfer += $output->writeFieldBegin('clientName', TType::STRING, 1);
    $xfer += $output->writeString($self->{clientName});
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{edamVersionMajor}) {
    $xfer += $output->writeFieldBegin('edamVersionMajor', TType::I16, 2);
    $xfer += $output->writeI16($self->{edamVersionMajor});
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{edamVersionMinor}) {
    $xfer += $output->writeFieldBegin('edamVersionMinor', TType::I16, 3);
    $xfer += $output->writeI16($self->{edamVersionMinor});
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_checkVersion_result;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_checkVersion_result->mk_accessors( qw( success ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{success} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{success}) {
      $self->{success} = $vals->{success};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_checkVersion_result';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^0$/ && do{      if ($ftype == TType::BOOL) {
        $xfer += $input->readBool(\$self->{success});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_checkVersion_result');
  if (defined $self->{success}) {
    $xfer += $output->writeFieldBegin('success', TType::BOOL, 0);
    $xfer += $output->writeBool($self->{success});
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_getBootstrapInfo_args;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_getBootstrapInfo_args->mk_accessors( qw( locale ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{locale} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{locale}) {
      $self->{locale} = $vals->{locale};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_getBootstrapInfo_args';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^1$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{locale});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_getBootstrapInfo_args');
  if (defined $self->{locale}) {
    $xfer += $output->writeFieldBegin('locale', TType::STRING, 1);
    $xfer += $output->writeString($self->{locale});
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_getBootstrapInfo_result;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_getBootstrapInfo_result->mk_accessors( qw( success ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{success} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{success}) {
      $self->{success} = $vals->{success};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_getBootstrapInfo_result';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^0$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{success} = Net::Evernote::Simple::EDAMUserStore::BootstrapInfo->new();
        $xfer += $self->{success}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_getBootstrapInfo_result');
  if (defined $self->{success}) {
    $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
    $xfer += $self->{success}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_authenticate_args;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_authenticate_args->mk_accessors( qw( username password consumerKey consumerSecret ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{username} = undef;
  $self->{password} = undef;
  $self->{consumerKey} = undef;
  $self->{consumerSecret} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{username}) {
      $self->{username} = $vals->{username};
    }
    if (defined $vals->{password}) {
      $self->{password} = $vals->{password};
    }
    if (defined $vals->{consumerKey}) {
      $self->{consumerKey} = $vals->{consumerKey};
    }
    if (defined $vals->{consumerSecret}) {
      $self->{consumerSecret} = $vals->{consumerSecret};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_authenticate_args';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^1$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{username});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^2$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{password});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^3$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{consumerKey});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^4$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{consumerSecret});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_authenticate_args');
  if (defined $self->{username}) {
    $xfer += $output->writeFieldBegin('username', TType::STRING, 1);
    $xfer += $output->writeString($self->{username});
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{password}) {
    $xfer += $output->writeFieldBegin('password', TType::STRING, 2);
    $xfer += $output->writeString($self->{password});
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{consumerKey}) {
    $xfer += $output->writeFieldBegin('consumerKey', TType::STRING, 3);
    $xfer += $output->writeString($self->{consumerKey});
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{consumerSecret}) {
    $xfer += $output->writeFieldBegin('consumerSecret', TType::STRING, 4);
    $xfer += $output->writeString($self->{consumerSecret});
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_authenticate_result;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_authenticate_result->mk_accessors( qw( success ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{success} = undef;
  $self->{userException} = undef;
  $self->{systemException} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{success}) {
      $self->{success} = $vals->{success};
    }
    if (defined $vals->{userException}) {
      $self->{userException} = $vals->{userException};
    }
    if (defined $vals->{systemException}) {
      $self->{systemException} = $vals->{systemException};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_authenticate_result';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^0$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{success} = Net::Evernote::Simple::EDAMUserStore::AuthenticationResult->new();
        $xfer += $self->{success}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^1$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{userException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException->new();
        $xfer += $self->{userException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^2$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{systemException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException->new();
        $xfer += $self->{systemException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_authenticate_result');
  if (defined $self->{success}) {
    $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
    $xfer += $self->{success}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{userException}) {
    $xfer += $output->writeFieldBegin('userException', TType::STRUCT, 1);
    $xfer += $self->{userException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{systemException}) {
    $xfer += $output->writeFieldBegin('systemException', TType::STRUCT, 2);
    $xfer += $self->{systemException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_refreshAuthentication_args;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_refreshAuthentication_args->mk_accessors( qw( authenticationToken ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{authenticationToken} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{authenticationToken}) {
      $self->{authenticationToken} = $vals->{authenticationToken};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_refreshAuthentication_args';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^1$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{authenticationToken});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_refreshAuthentication_args');
  if (defined $self->{authenticationToken}) {
    $xfer += $output->writeFieldBegin('authenticationToken', TType::STRING, 1);
    $xfer += $output->writeString($self->{authenticationToken});
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_refreshAuthentication_result;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_refreshAuthentication_result->mk_accessors( qw( success ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{success} = undef;
  $self->{userException} = undef;
  $self->{systemException} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{success}) {
      $self->{success} = $vals->{success};
    }
    if (defined $vals->{userException}) {
      $self->{userException} = $vals->{userException};
    }
    if (defined $vals->{systemException}) {
      $self->{systemException} = $vals->{systemException};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_refreshAuthentication_result';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^0$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{success} = Net::Evernote::Simple::EDAMUserStore::AuthenticationResult->new();
        $xfer += $self->{success}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^1$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{userException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException->new();
        $xfer += $self->{userException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^2$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{systemException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException->new();
        $xfer += $self->{systemException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_refreshAuthentication_result');
  if (defined $self->{success}) {
    $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
    $xfer += $self->{success}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{userException}) {
    $xfer += $output->writeFieldBegin('userException', TType::STRUCT, 1);
    $xfer += $self->{userException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{systemException}) {
    $xfer += $output->writeFieldBegin('systemException', TType::STRUCT, 2);
    $xfer += $self->{systemException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_getUser_args;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_getUser_args->mk_accessors( qw( authenticationToken ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{authenticationToken} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{authenticationToken}) {
      $self->{authenticationToken} = $vals->{authenticationToken};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_getUser_args';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^1$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{authenticationToken});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_getUser_args');
  if (defined $self->{authenticationToken}) {
    $xfer += $output->writeFieldBegin('authenticationToken', TType::STRING, 1);
    $xfer += $output->writeString($self->{authenticationToken});
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_getUser_result;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_getUser_result->mk_accessors( qw( success ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{success} = undef;
  $self->{userException} = undef;
  $self->{systemException} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{success}) {
      $self->{success} = $vals->{success};
    }
    if (defined $vals->{userException}) {
      $self->{userException} = $vals->{userException};
    }
    if (defined $vals->{systemException}) {
      $self->{systemException} = $vals->{systemException};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_getUser_result';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^0$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{success} = Net::Evernote::Simple::EDAMTypes::User->new();
        $xfer += $self->{success}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^1$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{userException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException->new();
        $xfer += $self->{userException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^2$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{systemException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException->new();
        $xfer += $self->{systemException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_getUser_result');
  if (defined $self->{success}) {
    $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
    $xfer += $self->{success}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{userException}) {
    $xfer += $output->writeFieldBegin('userException', TType::STRUCT, 1);
    $xfer += $self->{userException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{systemException}) {
    $xfer += $output->writeFieldBegin('systemException', TType::STRUCT, 2);
    $xfer += $self->{systemException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_getPublicUserInfo_args;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_getPublicUserInfo_args->mk_accessors( qw( username ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{username} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{username}) {
      $self->{username} = $vals->{username};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_getPublicUserInfo_args';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^1$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{username});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_getPublicUserInfo_args');
  if (defined $self->{username}) {
    $xfer += $output->writeFieldBegin('username', TType::STRING, 1);
    $xfer += $output->writeString($self->{username});
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_getPublicUserInfo_result;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_getPublicUserInfo_result->mk_accessors( qw( success ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{success} = undef;
  $self->{notFoundException} = undef;
  $self->{systemException} = undef;
  $self->{userException} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{success}) {
      $self->{success} = $vals->{success};
    }
    if (defined $vals->{notFoundException}) {
      $self->{notFoundException} = $vals->{notFoundException};
    }
    if (defined $vals->{systemException}) {
      $self->{systemException} = $vals->{systemException};
    }
    if (defined $vals->{userException}) {
      $self->{userException} = $vals->{userException};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_getPublicUserInfo_result';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^0$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{success} = Net::Evernote::Simple::EDAMUserStore::PublicUserInfo->new();
        $xfer += $self->{success}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^1$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{notFoundException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMNotFoundException->new();
        $xfer += $self->{notFoundException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^2$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{systemException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException->new();
        $xfer += $self->{systemException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^3$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{userException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException->new();
        $xfer += $self->{userException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_getPublicUserInfo_result');
  if (defined $self->{success}) {
    $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
    $xfer += $self->{success}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{notFoundException}) {
    $xfer += $output->writeFieldBegin('notFoundException', TType::STRUCT, 1);
    $xfer += $self->{notFoundException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{systemException}) {
    $xfer += $output->writeFieldBegin('systemException', TType::STRUCT, 2);
    $xfer += $self->{systemException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{userException}) {
    $xfer += $output->writeFieldBegin('userException', TType::STRUCT, 3);
    $xfer += $self->{userException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_getPremiumInfo_args;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_getPremiumInfo_args->mk_accessors( qw( authenticationToken ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{authenticationToken} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{authenticationToken}) {
      $self->{authenticationToken} = $vals->{authenticationToken};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_getPremiumInfo_args';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^1$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{authenticationToken});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_getPremiumInfo_args');
  if (defined $self->{authenticationToken}) {
    $xfer += $output->writeFieldBegin('authenticationToken', TType::STRING, 1);
    $xfer += $output->writeString($self->{authenticationToken});
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_getPremiumInfo_result;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_getPremiumInfo_result->mk_accessors( qw( success ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{success} = undef;
  $self->{userException} = undef;
  $self->{systemException} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{success}) {
      $self->{success} = $vals->{success};
    }
    if (defined $vals->{userException}) {
      $self->{userException} = $vals->{userException};
    }
    if (defined $vals->{systemException}) {
      $self->{systemException} = $vals->{systemException};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_getPremiumInfo_result';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^0$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{success} = Net::Evernote::Simple::EDAMUserStore::PremiumInfo->new();
        $xfer += $self->{success}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^1$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{userException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException->new();
        $xfer += $self->{userException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^2$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{systemException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException->new();
        $xfer += $self->{systemException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_getPremiumInfo_result');
  if (defined $self->{success}) {
    $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
    $xfer += $self->{success}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{userException}) {
    $xfer += $output->writeFieldBegin('userException', TType::STRUCT, 1);
    $xfer += $self->{userException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{systemException}) {
    $xfer += $output->writeFieldBegin('systemException', TType::STRUCT, 2);
    $xfer += $self->{systemException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_getNoteStoreUrl_args;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_getNoteStoreUrl_args->mk_accessors( qw( authenticationToken ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{authenticationToken} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{authenticationToken}) {
      $self->{authenticationToken} = $vals->{authenticationToken};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_getNoteStoreUrl_args';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^1$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{authenticationToken});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_getNoteStoreUrl_args');
  if (defined $self->{authenticationToken}) {
    $xfer += $output->writeFieldBegin('authenticationToken', TType::STRING, 1);
    $xfer += $output->writeString($self->{authenticationToken});
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStore_getNoteStoreUrl_result;
use base qw(Class::Accessor);
Net::Evernote::Simple::EDAMUserStore::UserStore_getNoteStoreUrl_result->mk_accessors( qw( success ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{success} = undef;
  $self->{userException} = undef;
  $self->{systemException} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{success}) {
      $self->{success} = $vals->{success};
    }
    if (defined $vals->{userException}) {
      $self->{userException} = $vals->{userException};
    }
    if (defined $vals->{systemException}) {
      $self->{systemException} = $vals->{systemException};
    }
  }
  return bless ($self, $classname);
}

sub getName {
  return 'UserStore_getNoteStoreUrl_result';
}

sub read {
  my ($self, $input) = @_;
  my $xfer  = 0;
  my $fname;
  my $ftype = 0;
  my $fid   = 0;
  $xfer += $input->readStructBegin(\$fname);
  while (1) 
  {
    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
    if ($ftype == TType::STOP) {
      last;
    }
    SWITCH: for($fid)
    {
      /^0$/ && do{      if ($ftype == TType::STRING) {
        $xfer += $input->readString(\$self->{success});
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^1$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{userException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException->new();
        $xfer += $self->{userException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
      /^2$/ && do{      if ($ftype == TType::STRUCT) {
        $self->{systemException} = Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException->new();
        $xfer += $self->{systemException}->read($input);
      } else {
        $xfer += $input->skip($ftype);
      }
      last; };
        $xfer += $input->skip($ftype);
    }
    $xfer += $input->readFieldEnd();
  }
  $xfer += $input->readStructEnd();
  return $xfer;
}

sub write {
  my ($self, $output) = @_;
  my $xfer   = 0;
  $xfer += $output->writeStructBegin('UserStore_getNoteStoreUrl_result');
  if (defined $self->{success}) {
    $xfer += $output->writeFieldBegin('success', TType::STRING, 0);
    $xfer += $output->writeString($self->{success});
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{userException}) {
    $xfer += $output->writeFieldBegin('userException', TType::STRUCT, 1);
    $xfer += $self->{userException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{systemException}) {
    $xfer += $output->writeFieldBegin('systemException', TType::STRUCT, 2);
    $xfer += $self->{systemException}->write($output);
    $xfer += $output->writeFieldEnd();
  }
  $xfer += $output->writeFieldStop();
  $xfer += $output->writeStructEnd();
  return $xfer;
}

package Net::Evernote::Simple::EDAMUserStore::UserStoreIf;

use strict;


sub checkVersion{
  my $self = shift;
  my $clientName = shift;
  my $edamVersionMajor = shift;
  my $edamVersionMinor = shift;

  die 'implement interface';
}

sub getBootstrapInfo{
  my $self = shift;
  my $locale = shift;

  die 'implement interface';
}

sub authenticate{
  my $self = shift;
  my $username = shift;
  my $password = shift;
  my $consumerKey = shift;
  my $consumerSecret = shift;

  die 'implement interface';
}

sub refreshAuthentication{
  my $self = shift;
  my $authenticationToken = shift;

  die 'implement interface';
}

sub getUser{
  my $self = shift;
  my $authenticationToken = shift;

  die 'implement interface';
}

sub getPublicUserInfo{
  my $self = shift;
  my $username = shift;

  die 'implement interface';
}

sub getPremiumInfo{
  my $self = shift;
  my $authenticationToken = shift;

  die 'implement interface';
}

sub getNoteStoreUrl{
  my $self = shift;
  my $authenticationToken = shift;

  die 'implement interface';
}

package Net::Evernote::Simple::EDAMUserStore::UserStoreRest;

use strict;


sub new {
  my ($classname, $impl) = @_;
  my $self     ={ impl => $impl };

  return bless($self,$classname);
}

sub checkVersion{
  my ($self, $request) = @_;

  my $clientName = ($request->{'clientName'}) ? $request->{'clientName'} : undef;
  my $edamVersionMajor = ($request->{'edamVersionMajor'}) ? $request->{'edamVersionMajor'} : undef;
  my $edamVersionMinor = ($request->{'edamVersionMinor'}) ? $request->{'edamVersionMinor'} : undef;
  return $self->{impl}->checkVersion($clientName, $edamVersionMajor, $edamVersionMinor);
}

sub getBootstrapInfo{
  my ($self, $request) = @_;

  my $locale = ($request->{'locale'}) ? $request->{'locale'} : undef;
  return $self->{impl}->getBootstrapInfo($locale);
}

sub authenticate{
  my ($self, $request) = @_;

  my $username = ($request->{'username'}) ? $request->{'username'} : undef;
  my $password = ($request->{'password'}) ? $request->{'password'} : undef;
  my $consumerKey = ($request->{'consumerKey'}) ? $request->{'consumerKey'} : undef;
  my $consumerSecret = ($request->{'consumerSecret'}) ? $request->{'consumerSecret'} : undef;
  return $self->{impl}->authenticate($username, $password, $consumerKey, $consumerSecret);
}

sub refreshAuthentication{
  my ($self, $request) = @_;

  my $authenticationToken = ($request->{'authenticationToken'}) ? $request->{'authenticationToken'} : undef;
  return $self->{impl}->refreshAuthentication($authenticationToken);
}

sub getUser{
  my ($self, $request) = @_;

  my $authenticationToken = ($request->{'authenticationToken'}) ? $request->{'authenticationToken'} : undef;
  return $self->{impl}->getUser($authenticationToken);
}

sub getPublicUserInfo{
  my ($self, $request) = @_;

  my $username = ($request->{'username'}) ? $request->{'username'} : undef;
  return $self->{impl}->getPublicUserInfo($username);
}

sub getPremiumInfo{
  my ($self, $request) = @_;

  my $authenticationToken = ($request->{'authenticationToken'}) ? $request->{'authenticationToken'} : undef;
  return $self->{impl}->getPremiumInfo($authenticationToken);
}

sub getNoteStoreUrl{
  my ($self, $request) = @_;

  my $authenticationToken = ($request->{'authenticationToken'}) ? $request->{'authenticationToken'} : undef;
  return $self->{impl}->getNoteStoreUrl($authenticationToken);
}

package Net::Evernote::Simple::EDAMUserStore::UserStoreClient;


use base qw(Net::Evernote::Simple::EDAMUserStore::UserStoreIf);
sub new {
  my ($classname, $input, $output) = @_;
  my $self      = {};
  $self->{input}  = $input;
  $self->{output} = defined $output ? $output : $input;
  $self->{seqid}  = 0;
  return bless($self,$classname);
}

sub checkVersion{
  my $self = shift;
  my $clientName = shift;
  my $edamVersionMajor = shift;
  my $edamVersionMinor = shift;

    $self->send_checkVersion($clientName, $edamVersionMajor, $edamVersionMinor);
  return $self->recv_checkVersion();
}

sub send_checkVersion{
  my $self = shift;
  my $clientName = shift;
  my $edamVersionMajor = shift;
  my $edamVersionMinor = shift;

  $self->{output}->writeMessageBegin('checkVersion', TMessageType::CALL, $self->{seqid});
  my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_checkVersion_args->new();
  $args->{clientName} = $clientName;
  $args->{edamVersionMajor} = $edamVersionMajor;
  $args->{edamVersionMinor} = $edamVersionMinor;
  $args->write($self->{output});
  $self->{output}->writeMessageEnd();
  $self->{output}->getTransport()->flush();
}

sub recv_checkVersion{
  my $self = shift;

  my $rseqid = 0;
  my $fname;
  my $mtype = 0;

  $self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid);
  if ($mtype == TMessageType::EXCEPTION) {
    my $x = TApplicationException->new();
    $x->read($self->{input});
    $self->{input}->readMessageEnd();
    die $x;
  }
  my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_checkVersion_result->new();
  $result->read($self->{input});
  $self->{input}->readMessageEnd();

  if (defined $result->{success} ) {
    return $result->{success};
  }
  die "checkVersion failed: unknown result";
}
sub getBootstrapInfo{
  my $self = shift;
  my $locale = shift;

    $self->send_getBootstrapInfo($locale);
  return $self->recv_getBootstrapInfo();
}

sub send_getBootstrapInfo{
  my $self = shift;
  my $locale = shift;

  $self->{output}->writeMessageBegin('getBootstrapInfo', TMessageType::CALL, $self->{seqid});
  my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_getBootstrapInfo_args->new();
  $args->{locale} = $locale;
  $args->write($self->{output});
  $self->{output}->writeMessageEnd();
  $self->{output}->getTransport()->flush();
}

sub recv_getBootstrapInfo{
  my $self = shift;

  my $rseqid = 0;
  my $fname;
  my $mtype = 0;

  $self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid);
  if ($mtype == TMessageType::EXCEPTION) {
    my $x = TApplicationException->new();
    $x->read($self->{input});
    $self->{input}->readMessageEnd();
    die $x;
  }
  my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_getBootstrapInfo_result->new();
  $result->read($self->{input});
  $self->{input}->readMessageEnd();

  if (defined $result->{success} ) {
    return $result->{success};
  }
  die "getBootstrapInfo failed: unknown result";
}
sub authenticate{
  my $self = shift;
  my $username = shift;
  my $password = shift;
  my $consumerKey = shift;
  my $consumerSecret = shift;

    $self->send_authenticate($username, $password, $consumerKey, $consumerSecret);
  return $self->recv_authenticate();
}

sub send_authenticate{
  my $self = shift;
  my $username = shift;
  my $password = shift;
  my $consumerKey = shift;
  my $consumerSecret = shift;

  $self->{output}->writeMessageBegin('authenticate', TMessageType::CALL, $self->{seqid});
  my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_authenticate_args->new();
  $args->{username} = $username;
  $args->{password} = $password;
  $args->{consumerKey} = $consumerKey;
  $args->{consumerSecret} = $consumerSecret;
  $args->write($self->{output});
  $self->{output}->writeMessageEnd();
  $self->{output}->getTransport()->flush();
}

sub recv_authenticate{
  my $self = shift;

  my $rseqid = 0;
  my $fname;
  my $mtype = 0;

  $self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid);
  if ($mtype == TMessageType::EXCEPTION) {
    my $x = TApplicationException->new();
    $x->read($self->{input});
    $self->{input}->readMessageEnd();
    die $x;
  }
  my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_authenticate_result->new();
  $result->read($self->{input});
  $self->{input}->readMessageEnd();

  if (defined $result->{success} ) {
    return $result->{success};
  }
  if (defined $result->{userException}) {
    die $result->{userException};
  }
  if (defined $result->{systemException}) {
    die $result->{systemException};
  }
  die "authenticate failed: unknown result";
}
sub refreshAuthentication{
  my $self = shift;
  my $authenticationToken = shift;

    $self->send_refreshAuthentication($authenticationToken);
  return $self->recv_refreshAuthentication();
}

sub send_refreshAuthentication{
  my $self = shift;
  my $authenticationToken = shift;

  $self->{output}->writeMessageBegin('refreshAuthentication', TMessageType::CALL, $self->{seqid});
  my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_refreshAuthentication_args->new();
  $args->{authenticationToken} = $authenticationToken;
  $args->write($self->{output});
  $self->{output}->writeMessageEnd();
  $self->{output}->getTransport()->flush();
}

sub recv_refreshAuthentication{
  my $self = shift;

  my $rseqid = 0;
  my $fname;
  my $mtype = 0;

  $self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid);
  if ($mtype == TMessageType::EXCEPTION) {
    my $x = TApplicationException->new();
    $x->read($self->{input});
    $self->{input}->readMessageEnd();
    die $x;
  }
  my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_refreshAuthentication_result->new();
  $result->read($self->{input});
  $self->{input}->readMessageEnd();

  if (defined $result->{success} ) {
    return $result->{success};
  }
  if (defined $result->{userException}) {
    die $result->{userException};
  }
  if (defined $result->{systemException}) {
    die $result->{systemException};
  }
  die "refreshAuthentication failed: unknown result";
}
sub getUser{
  my $self = shift;
  my $authenticationToken = shift;

    $self->send_getUser($authenticationToken);
  return $self->recv_getUser();
}

sub send_getUser{
  my $self = shift;
  my $authenticationToken = shift;

  $self->{output}->writeMessageBegin('getUser', TMessageType::CALL, $self->{seqid});
  my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_getUser_args->new();
  $args->{authenticationToken} = $authenticationToken;
  $args->write($self->{output});
  $self->{output}->writeMessageEnd();
  $self->{output}->getTransport()->flush();
}

sub recv_getUser{
  my $self = shift;

  my $rseqid = 0;
  my $fname;
  my $mtype = 0;

  $self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid);
  if ($mtype == TMessageType::EXCEPTION) {
    my $x = TApplicationException->new();
    $x->read($self->{input});
    $self->{input}->readMessageEnd();
    die $x;
  }
  my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_getUser_result->new();
  $result->read($self->{input});
  $self->{input}->readMessageEnd();

  if (defined $result->{success} ) {
    return $result->{success};
  }
  if (defined $result->{userException}) {
    die $result->{userException};
  }
  if (defined $result->{systemException}) {
    die $result->{systemException};
  }
  die "getUser failed: unknown result";
}
sub getPublicUserInfo{
  my $self = shift;
  my $username = shift;

    $self->send_getPublicUserInfo($username);
  return $self->recv_getPublicUserInfo();
}

sub send_getPublicUserInfo{
  my $self = shift;
  my $username = shift;

  $self->{output}->writeMessageBegin('getPublicUserInfo', TMessageType::CALL, $self->{seqid});
  my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_getPublicUserInfo_args->new();
  $args->{username} = $username;
  $args->write($self->{output});
  $self->{output}->writeMessageEnd();
  $self->{output}->getTransport()->flush();
}

sub recv_getPublicUserInfo{
  my $self = shift;

  my $rseqid = 0;
  my $fname;
  my $mtype = 0;

  $self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid);
  if ($mtype == TMessageType::EXCEPTION) {
    my $x = TApplicationException->new();
    $x->read($self->{input});
    $self->{input}->readMessageEnd();
    die $x;
  }
  my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_getPublicUserInfo_result->new();
  $result->read($self->{input});
  $self->{input}->readMessageEnd();

  if (defined $result->{success} ) {
    return $result->{success};
  }
  if (defined $result->{notFoundException}) {
    die $result->{notFoundException};
  }
  if (defined $result->{systemException}) {
    die $result->{systemException};
  }
  if (defined $result->{userException}) {
    die $result->{userException};
  }
  die "getPublicUserInfo failed: unknown result";
}
sub getPremiumInfo{
  my $self = shift;
  my $authenticationToken = shift;

    $self->send_getPremiumInfo($authenticationToken);
  return $self->recv_getPremiumInfo();
}

sub send_getPremiumInfo{
  my $self = shift;
  my $authenticationToken = shift;

  $self->{output}->writeMessageBegin('getPremiumInfo', TMessageType::CALL, $self->{seqid});
  my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_getPremiumInfo_args->new();
  $args->{authenticationToken} = $authenticationToken;
  $args->write($self->{output});
  $self->{output}->writeMessageEnd();
  $self->{output}->getTransport()->flush();
}

sub recv_getPremiumInfo{
  my $self = shift;

  my $rseqid = 0;
  my $fname;
  my $mtype = 0;

  $self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid);
  if ($mtype == TMessageType::EXCEPTION) {
    my $x = TApplicationException->new();
    $x->read($self->{input});
    $self->{input}->readMessageEnd();
    die $x;
  }
  my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_getPremiumInfo_result->new();
  $result->read($self->{input});
  $self->{input}->readMessageEnd();

  if (defined $result->{success} ) {
    return $result->{success};
  }
  if (defined $result->{userException}) {
    die $result->{userException};
  }
  if (defined $result->{systemException}) {
    die $result->{systemException};
  }
  die "getPremiumInfo failed: unknown result";
}
sub getNoteStoreUrl{
  my $self = shift;
  my $authenticationToken = shift;

    $self->send_getNoteStoreUrl($authenticationToken);
  return $self->recv_getNoteStoreUrl();
}

sub send_getNoteStoreUrl{
  my $self = shift;
  my $authenticationToken = shift;

  $self->{output}->writeMessageBegin('getNoteStoreUrl', TMessageType::CALL, $self->{seqid});
  my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_getNoteStoreUrl_args->new();
  $args->{authenticationToken} = $authenticationToken;
  $args->write($self->{output});
  $self->{output}->writeMessageEnd();
  $self->{output}->getTransport()->flush();
}

sub recv_getNoteStoreUrl{
  my $self = shift;

  my $rseqid = 0;
  my $fname;
  my $mtype = 0;

  $self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid);
  if ($mtype == TMessageType::EXCEPTION) {
    my $x = TApplicationException->new();
    $x->read($self->{input});
    $self->{input}->readMessageEnd();
    die $x;
  }
  my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_getNoteStoreUrl_result->new();
  $result->read($self->{input});
  $self->{input}->readMessageEnd();

  if (defined $result->{success} ) {
    return $result->{success};
  }
  if (defined $result->{userException}) {
    die $result->{userException};
  }
  if (defined $result->{systemException}) {
    die $result->{systemException};
  }
  die "getNoteStoreUrl failed: unknown result";
}
package Net::Evernote::Simple::EDAMUserStore::UserStoreProcessor;

use strict;


sub new {
    my ($classname, $handler) = @_;
    my $self      = {};
    $self->{handler} = $handler;
    return bless ($self, $classname);
}

sub process {
    my ($self, $input, $output) = @_;
    my $rseqid = 0;
    my $fname  = undef;
    my $mtype  = 0;

    $input->readMessageBegin(\$fname, \$mtype, \$rseqid);
    my $methodname = 'process_'.$fname;
    if (!$self->can($methodname)) {
      $input->skip(TType::STRUCT);
      $input->readMessageEnd();
      my $x = TApplicationException->new('Function '.$fname.' not implemented.', TApplicationException::UNKNOWN_METHOD);
      $output->writeMessageBegin($fname, TMessageType::EXCEPTION, $rseqid);
      $x->write($output);
      $output->writeMessageEnd();
      $output->getTransport()->flush();
      return;
    }
    $self->$methodname($rseqid, $input, $output);
    return 1;
}

sub process_checkVersion {
    my ($self, $seqid, $input, $output) = @_;
    my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_checkVersion_args->new();
    $args->read($input);
    $input->readMessageEnd();
    my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_checkVersion_result->new();
    $result->{success} = $self->{handler}->checkVersion($args->clientName, $args->edamVersionMajor, $args->edamVersionMinor);
    $output->writeMessageBegin('checkVersion', TMessageType::REPLY, $seqid);
    $result->write($output);
    $output->writeMessageEnd();
    $output->getTransport()->flush();
}

sub process_getBootstrapInfo {
    my ($self, $seqid, $input, $output) = @_;
    my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_getBootstrapInfo_args->new();
    $args->read($input);
    $input->readMessageEnd();
    my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_getBootstrapInfo_result->new();
    $result->{success} = $self->{handler}->getBootstrapInfo($args->locale);
    $output->writeMessageBegin('getBootstrapInfo', TMessageType::REPLY, $seqid);
    $result->write($output);
    $output->writeMessageEnd();
    $output->getTransport()->flush();
}

sub process_authenticate {
    my ($self, $seqid, $input, $output) = @_;
    my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_authenticate_args->new();
    $args->read($input);
    $input->readMessageEnd();
    my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_authenticate_result->new();
    eval {
      $result->{success} = $self->{handler}->authenticate($args->username, $args->password, $args->consumerKey, $args->consumerSecret);
    }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException') ){ 
      $result->{userException} = $@;
        }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException') ){ 
      $result->{systemException} = $@;
    }
    $output->writeMessageBegin('authenticate', TMessageType::REPLY, $seqid);
    $result->write($output);
    $output->writeMessageEnd();
    $output->getTransport()->flush();
}

sub process_refreshAuthentication {
    my ($self, $seqid, $input, $output) = @_;
    my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_refreshAuthentication_args->new();
    $args->read($input);
    $input->readMessageEnd();
    my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_refreshAuthentication_result->new();
    eval {
      $result->{success} = $self->{handler}->refreshAuthentication($args->authenticationToken);
    }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException') ){ 
      $result->{userException} = $@;
        }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException') ){ 
      $result->{systemException} = $@;
    }
    $output->writeMessageBegin('refreshAuthentication', TMessageType::REPLY, $seqid);
    $result->write($output);
    $output->writeMessageEnd();
    $output->getTransport()->flush();
}

sub process_getUser {
    my ($self, $seqid, $input, $output) = @_;
    my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_getUser_args->new();
    $args->read($input);
    $input->readMessageEnd();
    my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_getUser_result->new();
    eval {
      $result->{success} = $self->{handler}->getUser($args->authenticationToken);
    }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException') ){ 
      $result->{userException} = $@;
        }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException') ){ 
      $result->{systemException} = $@;
    }
    $output->writeMessageBegin('getUser', TMessageType::REPLY, $seqid);
    $result->write($output);
    $output->writeMessageEnd();
    $output->getTransport()->flush();
}

sub process_getPublicUserInfo {
    my ($self, $seqid, $input, $output) = @_;
    my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_getPublicUserInfo_args->new();
    $args->read($input);
    $input->readMessageEnd();
    my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_getPublicUserInfo_result->new();
    eval {
      $result->{success} = $self->{handler}->getPublicUserInfo($args->username);
    }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMNotFoundException') ){ 
      $result->{notFoundException} = $@;
        }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException') ){ 
      $result->{systemException} = $@;
        }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException') ){ 
      $result->{userException} = $@;
    }
    $output->writeMessageBegin('getPublicUserInfo', TMessageType::REPLY, $seqid);
    $result->write($output);
    $output->writeMessageEnd();
    $output->getTransport()->flush();
}

sub process_getPremiumInfo {
    my ($self, $seqid, $input, $output) = @_;
    my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_getPremiumInfo_args->new();
    $args->read($input);
    $input->readMessageEnd();
    my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_getPremiumInfo_result->new();
    eval {
      $result->{success} = $self->{handler}->getPremiumInfo($args->authenticationToken);
    }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException') ){ 
      $result->{userException} = $@;
        }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException') ){ 
      $result->{systemException} = $@;
    }
    $output->writeMessageBegin('getPremiumInfo', TMessageType::REPLY, $seqid);
    $result->write($output);
    $output->writeMessageEnd();
    $output->getTransport()->flush();
}

sub process_getNoteStoreUrl {
    my ($self, $seqid, $input, $output) = @_;
    my $args = Net::Evernote::Simple::EDAMUserStore::UserStore_getNoteStoreUrl_args->new();
    $args->read($input);
    $input->readMessageEnd();
    my $result = Net::Evernote::Simple::EDAMUserStore::UserStore_getNoteStoreUrl_result->new();
    eval {
      $result->{success} = $self->{handler}->getNoteStoreUrl($args->authenticationToken);
    }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMUserException') ){ 
      $result->{userException} = $@;
        }; if( UNIVERSAL::isa($@,'Net::Evernote::Simple::EDAMErrors::Net::Evernote::Simple::EDAMSystemException') ){ 
      $result->{systemException} = $@;
    }
    $output->writeMessageBegin('getNoteStoreUrl', TMessageType::REPLY, $seqid);
    $result->write($output);
    $output->writeMessageEnd();
    $output->getTransport()->flush();
}

1;
