/*
 * Copyright (c) 2015 by Evernote Corporation, All rights reserved.
 *
 * Use of the source code and binary libraries included in this package
 * is permitted under the following terms:
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */

#import <Foundation/Foundation.h>

#import "ENTProtocol.h"
#import "ENTException.h"
#import "FATObject.h"
#import "EDAMTypes.h"
#import "EDAMErrors.h"

#import "EDAMUserStore.h"

@implementation EDAMPublicUserInfo

+ (NSString *) structName {
  return @"PublicUserInfo";
}

+ (NSArray *) structFields {
  static NSArray *structFields = nil;
  if (structFields == nil)
  {
    structFields = @[
        [FATField fieldWithIndex:1 type:TType_I32 optional:NO name:@"userId"],
        [FATField fieldWithIndex:2 type:TType_STRING optional:NO name:@"shardId"],
        [FATField fieldWithIndex:3 type:TType_I32 optional:YES name:@"privilege"],
        [FATField fieldWithIndex:4 type:TType_STRING optional:YES name:@"username"],
        [FATField fieldWithIndex:5 type:TType_STRING optional:YES name:@"noteStoreUrl"],
        [FATField fieldWithIndex:6 type:TType_STRING optional:YES name:@"webApiUrlPrefix"],
    ];
  }
  return structFields;
}

@end

@implementation EDAMUserUrls

+ (NSString *) structName {
  return @"UserUrls";
}

+ (NSArray *) structFields {
  static NSArray *structFields = nil;
  if (structFields == nil)
  {
    structFields = @[
        [FATField fieldWithIndex:1 type:TType_STRING optional:YES name:@"noteStoreUrl"],
        [FATField fieldWithIndex:2 type:TType_STRING optional:YES name:@"webApiUrlPrefix"],
        [FATField fieldWithIndex:3 type:TType_STRING optional:YES name:@"userStoreUrl"],
        [FATField fieldWithIndex:4 type:TType_STRING optional:YES name:@"utilityUrl"],
        [FATField fieldWithIndex:5 type:TType_STRING optional:YES name:@"messageStoreUrl"],
        [FATField fieldWithIndex:6 type:TType_STRING optional:YES name:@"userWebSocketUrl"],
    ];
  }
  return structFields;
}

@end

@implementation EDAMAuthenticationResult

+ (NSString *) structName {
  return @"AuthenticationResult";
}

+ (NSArray *) structFields {
  static NSArray *structFields = nil;
  if (structFields == nil)
  {
    structFields = @[
        [FATField fieldWithIndex:1 type:TType_I64 optional:NO name:@"currentTime"],
        [FATField fieldWithIndex:2 type:TType_STRING optional:NO name:@"authenticationToken"],
        [FATField fieldWithIndex:3 type:TType_I64 optional:NO name:@"expiration"],
        [FATField fieldWithIndex:4 type:TType_STRUCT optional:YES name:@"user" valueType:TType_STRUCT valueClass:[EDAMUser class]],
        [FATField fieldWithIndex:5 type:TType_STRUCT optional:YES name:@"publicUserInfo" valueType:TType_STRUCT valueClass:[EDAMPublicUserInfo class]],
        [FATField fieldWithIndex:6 type:TType_STRING optional:YES name:@"noteStoreUrl"],
        [FATField fieldWithIndex:7 type:TType_STRING optional:YES name:@"webApiUrlPrefix"],
        [FATField fieldWithIndex:8 type:TType_BOOL optional:YES name:@"secondFactorRequired"],
        [FATField fieldWithIndex:9 type:TType_STRING optional:YES name:@"secondFactorDeliveryHint"],
        [FATField fieldWithIndex:10 type:TType_STRUCT optional:YES name:@"urls" valueType:TType_STRUCT valueClass:[EDAMUserUrls class]],
    ];
  }
  return structFields;
}

@end

@implementation EDAMBootstrapSettings

+ (NSString *) structName {
  return @"BootstrapSettings";
}

+ (NSArray *) structFields {
  static NSArray *structFields = nil;
  if (structFields == nil)
  {
    structFields = @[
        [FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"serviceHost"],
        [FATField fieldWithIndex:2 type:TType_STRING optional:NO name:@"marketingUrl"],
        [FATField fieldWithIndex:3 type:TType_STRING optional:NO name:@"supportUrl"],
        [FATField fieldWithIndex:4 type:TType_STRING optional:NO name:@"accountEmailDomain"],
        [FATField fieldWithIndex:14 type:TType_STRING optional:YES name:@"cardscanUrl"],
        [FATField fieldWithIndex:15 type:TType_STRING optional:YES name:@"announcementsUrl"],
        [FATField fieldWithIndex:5 type:TType_BOOL optional:YES name:@"enableFacebookSharing"],
        [FATField fieldWithIndex:6 type:TType_BOOL optional:YES name:@"enableGiftSubscriptions"],
        [FATField fieldWithIndex:7 type:TType_BOOL optional:YES name:@"enableSupportTickets"],
        [FATField fieldWithIndex:8 type:TType_BOOL optional:YES name:@"enableSharedNotebooks"],
        [FATField fieldWithIndex:9 type:TType_BOOL optional:YES name:@"enableSingleNoteSharing"],
        [FATField fieldWithIndex:10 type:TType_BOOL optional:YES name:@"enableSponsoredAccounts"],
        [FATField fieldWithIndex:11 type:TType_BOOL optional:YES name:@"enableTwitterSharing"],
        [FATField fieldWithIndex:12 type:TType_BOOL optional:YES name:@"enableLinkedInSharing"],
        [FATField fieldWithIndex:13 type:TType_BOOL optional:YES name:@"enablePublicNotebooks"],
        [FATField fieldWithIndex:16 type:TType_BOOL optional:YES name:@"enableGoogle"],
    ];
  }
  return structFields;
}

@end

@implementation EDAMBootstrapProfile

+ (NSString *) structName {
  return @"BootstrapProfile";
}

+ (NSArray *) structFields {
  static NSArray *structFields = nil;
  if (structFields == nil)
  {
    structFields = @[
        [FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"name"],
        [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"settings" valueType:TType_STRUCT valueClass:[EDAMBootstrapSettings class]],
    ];
  }
  return structFields;
}

@end

@implementation EDAMBootstrapInfo

+ (NSString *) structName {
  return @"BootstrapInfo";
}

+ (NSArray *) structFields {
  static NSArray *structFields = nil;
  if (structFields == nil)
  {
    structFields = @[
        [FATField fieldWithIndex:1 type:TType_LIST optional:NO name:@"profiles" valueType:TType_STRUCT valueClass:[EDAMBootstrapProfile class]],
    ];
  }
  return structFields;
}

@end

@implementation EDAMPushNotificationCredentials

+ (NSString *) structName {
  return @"PushNotificationCredentials";
}

+ (NSArray *) structFields {
  static NSArray *structFields = nil;
  if (structFields == nil)
  {
    structFields = @[
        [FATField fieldWithIndex:1 type:TType_BINARY optional:NO name:@"iosDeviceToken"],
        [FATField fieldWithIndex:2 type:TType_STRING optional:NO name:@"gcmRegistrationId"],
    ];
  }
  return structFields;
}

@end

@implementation EDAMRegisterForSyncPushNotificationsResult

+ (NSString *) structName {
  return @"RegisterForSyncPushNotificationsResult";
}

+ (NSArray *) structFields {
  static NSArray *structFields = nil;
  if (structFields == nil)
  {
    structFields = @[
        [FATField fieldWithIndex:1 type:TType_BINARY optional:YES name:@"sharedSecret"],
    ];
  }
  return structFields;
}

@end

static int16_t EDAMEDAM_VERSION_MAJOR = 1;
static int16_t EDAMEDAM_VERSION_MINOR = 28;

@implementation EDAMUserStoreConstants
+ (int16_t) EDAM_VERSION_MAJOR{
  return EDAMEDAM_VERSION_MAJOR;
}
+ (int16_t) EDAM_VERSION_MINOR{
  return EDAMEDAM_VERSION_MINOR;
}
@end

@implementation EDAMUserStoreClient
{
  id <ENTProtocol> _inProtocol;
  id <ENTProtocol> _outProtocol;
}
- (id) initWithProtocol: (id <ENTProtocol>) protocol
{
  return [self initWithInProtocol: protocol outProtocol: protocol];
}

- (id) initWithInProtocol: (id <ENTProtocol>) anInProtocol outProtocol: (id <ENTProtocol>) anOutProtocol
{
  self = [super init];
  if (self != nil)  {
    _inProtocol = anInProtocol;
    _outProtocol = anOutProtocol;
  }
  return self;
}

- (BOOL) checkVersion: (NSString *) clientName edamVersionMajor: (int16_t) edamVersionMajor edamVersionMinor: (int16_t) edamVersionMinor
{
  [ENTProtocolUtil sendMessage:@"checkVersion"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"clientName"], clientName, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:2 type:TType_I16 optional:NO name:@"edamVersionMajor"], @(edamVersionMajor), nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:3 type:TType_I16 optional:NO name:@"edamVersionMinor"], @(edamVersionMinor), nil],
                            ]];
  return [[ENTProtocolUtil readMessage:@"checkVersion"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_BOOL optional:NO name:@"success"],
                              ]] boolValue];
}

- (EDAMBootstrapInfo *) getBootstrapInfo: (NSString *) locale
{
  [ENTProtocolUtil sendMessage:@"getBootstrapInfo"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"locale"], locale, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"getBootstrapInfo"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRUCT optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMBootstrapInfo class]],
                              ]];
}

- (EDAMAuthenticationResult *) authenticate: (NSString *) username password: (NSString *) password consumerKey: (NSString *) consumerKey consumerSecret: (NSString *) consumerSecret supportsTwoFactor: (BOOL) supportsTwoFactor
{
  [ENTProtocolUtil sendMessage:@"authenticate"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"username"], username, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:2 type:TType_STRING optional:NO name:@"password"], password, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:3 type:TType_STRING optional:NO name:@"consumerKey"], consumerKey, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:4 type:TType_STRING optional:NO name:@"consumerSecret"], consumerSecret, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:5 type:TType_BOOL optional:NO name:@"supportsTwoFactor"], @(supportsTwoFactor), nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"authenticate"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRUCT optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMAuthenticationResult class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (EDAMAuthenticationResult *) authenticateLongSession: (NSString *) username password: (NSString *) password consumerKey: (NSString *) consumerKey consumerSecret: (NSString *) consumerSecret deviceIdentifier: (NSString *) deviceIdentifier deviceDescription: (NSString *) deviceDescription supportsTwoFactor: (BOOL) supportsTwoFactor
{
  [ENTProtocolUtil sendMessage:@"authenticateLongSession"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"username"], username, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:2 type:TType_STRING optional:NO name:@"password"], password, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:3 type:TType_STRING optional:NO name:@"consumerKey"], consumerKey, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:4 type:TType_STRING optional:NO name:@"consumerSecret"], consumerSecret, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:5 type:TType_STRING optional:NO name:@"deviceIdentifier"], deviceIdentifier, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:6 type:TType_STRING optional:NO name:@"deviceDescription"], deviceDescription, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:7 type:TType_BOOL optional:NO name:@"supportsTwoFactor"], @(supportsTwoFactor), nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"authenticateLongSession"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRUCT optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMAuthenticationResult class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (EDAMAuthenticationResult *) completeTwoFactorAuthentication: (NSString *) authenticationToken oneTimeCode: (NSString *) oneTimeCode deviceIdentifier: (NSString *) deviceIdentifier deviceDescription: (NSString *) deviceDescription
{
  [ENTProtocolUtil sendMessage:@"completeTwoFactorAuthentication"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:2 type:TType_STRING optional:NO name:@"oneTimeCode"], oneTimeCode, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:3 type:TType_STRING optional:NO name:@"deviceIdentifier"], deviceIdentifier, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:4 type:TType_STRING optional:NO name:@"deviceDescription"], deviceDescription, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"completeTwoFactorAuthentication"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRUCT optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMAuthenticationResult class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (void) revokeLongSession: (NSString *) authenticationToken
{
  [ENTProtocolUtil sendMessage:@"revokeLongSession"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                            ]];
  [ENTProtocolUtil readMessage:@"revokeLongSession"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (EDAMAuthenticationResult *) authenticateToBusiness: (NSString *) authenticationToken
{
  [ENTProtocolUtil sendMessage:@"authenticateToBusiness"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"authenticateToBusiness"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRUCT optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMAuthenticationResult class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (EDAMAuthenticationResult *) refreshAuthentication: (NSString *) authenticationToken
{
  [ENTProtocolUtil sendMessage:@"refreshAuthentication"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"refreshAuthentication"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRUCT optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMAuthenticationResult class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (EDAMUser *) getUser: (NSString *) authenticationToken
{
  [ENTProtocolUtil sendMessage:@"getUser"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"getUser"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRUCT optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMUser class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (EDAMPublicUserInfo *) getPublicUserInfo: (NSString *) username
{
  [ENTProtocolUtil sendMessage:@"getPublicUserInfo"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"username"], username, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"getPublicUserInfo"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRUCT optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMPublicUserInfo class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"notFoundException" valueType:TType_STRUCT valueClass:[EDAMNotFoundException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              [FATField fieldWithIndex:3 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              ]];
}

- (EDAMPremiumInfo *) getPremiumInfo: (NSString *) authenticationToken
{
  [ENTProtocolUtil sendMessage:@"getPremiumInfo"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"getPremiumInfo"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRUCT optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMPremiumInfo class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (NSString *) getNoteStoreUrl: (NSString *) authenticationToken
{
  [ENTProtocolUtil sendMessage:@"getNoteStoreUrl"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"getNoteStoreUrl"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRING optional:NO name:@"success"],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (EDAMUserUrls *) getUserUrls: (NSString *) authenticationToken
{
  [ENTProtocolUtil sendMessage:@"getUserUrls"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"getUserUrls"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRUCT optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMUserUrls class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (void) inviteToBusiness: (NSString *) authenticationToken emailAddress: (NSString *) emailAddress
{
  [ENTProtocolUtil sendMessage:@"inviteToBusiness"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:2 type:TType_STRING optional:NO name:@"emailAddress"], emailAddress, nil],
                            ]];
  [ENTProtocolUtil readMessage:@"inviteToBusiness"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (void) removeFromBusiness: (NSString *) authenticationToken emailAddress: (NSString *) emailAddress
{
  [ENTProtocolUtil sendMessage:@"removeFromBusiness"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:2 type:TType_STRING optional:NO name:@"emailAddress"], emailAddress, nil],
                            ]];
  [ENTProtocolUtil readMessage:@"removeFromBusiness"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              [FATField fieldWithIndex:3 type:TType_STRUCT optional:NO name:@"notFoundException" valueType:TType_STRUCT valueClass:[EDAMNotFoundException class]],
                              ]];
}

- (void) updateBusinessUserIdentifier: (NSString *) authenticationToken oldEmailAddress: (NSString *) oldEmailAddress newEmailAddress: (NSString *) newEmailAddress
{
  [ENTProtocolUtil sendMessage:@"updateBusinessUserIdentifier"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:2 type:TType_STRING optional:NO name:@"oldEmailAddress"], oldEmailAddress, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:3 type:TType_STRING optional:NO name:@"newEmailAddress"], newEmailAddress, nil],
                            ]];
  [ENTProtocolUtil readMessage:@"updateBusinessUserIdentifier"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              [FATField fieldWithIndex:3 type:TType_STRUCT optional:NO name:@"notFoundException" valueType:TType_STRUCT valueClass:[EDAMNotFoundException class]],
                              ]];
}

- (NSArray *) listBusinessUsers: (NSString *) authenticationToken
{
  [ENTProtocolUtil sendMessage:@"listBusinessUsers"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"listBusinessUsers"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_LIST optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMUserProfile class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (NSArray *) listBusinessInvitations: (NSString *) authenticationToken includeRequestedInvitations: (BOOL) includeRequestedInvitations
{
  [ENTProtocolUtil sendMessage:@"listBusinessInvitations"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:2 type:TType_BOOL optional:NO name:@"includeRequestedInvitations"], @(includeRequestedInvitations), nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"listBusinessInvitations"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_LIST optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMBusinessInvitation class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              ]];
}

- (EDAMRegisterForSyncPushNotificationsResult *) registerForSyncPushNotifications: (NSString *) authenticationToken credentials: (EDAMPushNotificationCredentials *) credentials
{
  [ENTProtocolUtil sendMessage:@"registerForSyncPushNotifications"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"credentials" valueType:TType_STRUCT valueClass:[EDAMPushNotificationCredentials class]], credentials, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"registerForSyncPushNotifications"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRUCT optional:NO name:@"success" valueType:TType_STRUCT valueClass:[EDAMRegisterForSyncPushNotificationsResult class]],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              [FATField fieldWithIndex:3 type:TType_STRUCT optional:NO name:@"notFoundException" valueType:TType_STRUCT valueClass:[EDAMNotFoundException class]],
                              ]];
}

- (void) unregisterForSyncPushNotifications: (NSString *) authenticationToken
{
  [ENTProtocolUtil sendMessage:@"unregisterForSyncPushNotifications"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                            ]];
  [ENTProtocolUtil readMessage:@"unregisterForSyncPushNotifications"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              [FATField fieldWithIndex:3 type:TType_STRUCT optional:NO name:@"notFoundException" valueType:TType_STRUCT valueClass:[EDAMNotFoundException class]],
                              ]];
}

- (NSString *) createSessionAuthenticationToken: (NSString *) authenticationToken
{
  [ENTProtocolUtil sendMessage:@"createSessionAuthenticationToken"
                  toProtocol:_outProtocol
                withArgPairs:@[
                               [NSArray arrayWithObjects:[FATField fieldWithIndex:1 type:TType_STRING optional:NO name:@"authenticationToken"], authenticationToken, nil],
                            ]];
  return [ENTProtocolUtil readMessage:@"createSessionAuthenticationToken"
                fromProtocol:_inProtocol
           withResponseTypes:@[
                              [FATField fieldWithIndex:0 type:TType_STRING optional:NO name:@"success"],
                              [FATField fieldWithIndex:1 type:TType_STRUCT optional:NO name:@"userException" valueType:TType_STRUCT valueClass:[EDAMUserException class]],
                              [FATField fieldWithIndex:2 type:TType_STRUCT optional:NO name:@"systemException" valueType:TType_STRUCT valueClass:[EDAMSystemException class]],
                              [FATField fieldWithIndex:3 type:TType_STRUCT optional:NO name:@"notFoundException" valueType:TType_STRUCT valueClass:[EDAMNotFoundException class]],
                              ]];
}

@end

