#
# Autogenerated by Thrift Compiler (0.5.0-en-exported)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#

require 'thrift'
require 'types_types'
require 'errors_types'


module Evernote
  module EDAM
    module UserStore
      #  This structure is used to provide publicly-available user information
#  about a particular account.
# <dl>
#  <dt>userId:</dt>
#    <dd>
#    The unique numeric user identifier for the user account.
#    </dd>
#  <dt>shardId:</dt>
#    <dd>
#    DEPRECATED - Client applications should have no need to use this field.
#    </dd>
#  <dt>privilege:</dt>
#    <dd>
#    The privilege level of the account, to determine whether
#    this is a Premium or Free account.
#    </dd>
#  <dt>noteStoreUrl:</dt>
#    <dd>
#    This field will contain the full URL that clients should use to make
#    NoteStore requests to the server shard that contains that user's data.
#    I.e. this is the URL that should be used to create the Thrift HTTP client
#    transport to send messages to the NoteStore service for the account.
#    </dd>
#  <dt>webApiUrlPrefix:</dt>
#    <dd>
#    This field will contain the initial part of the URLs that should be used
#    to make requests to Evernote's thin client "web API", which provide
#    optimized operations for clients that aren't capable of manipulating
#    the full contents of accounts via the full Thrift data model. Clients
#    should concatenate the relative path for the various servlets onto the
#    end of this string to construct the full URL, as documented on our
#    developer web site.
#    </dd>
#  </dl>
      class PublicUserInfo
        include ::Thrift::Struct, ::Thrift::Struct_Union
        USERID = 1
        SHARDID = 2
        PRIVILEGE = 3
        USERNAME = 4
        NOTESTOREURL = 5
        WEBAPIURLPREFIX = 6

        FIELDS = {
          USERID => {:type => ::Thrift::Types::I32, :name => 'userId'},
          SHARDID => {:type => ::Thrift::Types::STRING, :name => 'shardId'},
          PRIVILEGE => {:type => ::Thrift::Types::I32, :name => 'privilege', :optional => true, :enum_class => ::Evernote::EDAM::Type::PrivilegeLevel},
          USERNAME => {:type => ::Thrift::Types::STRING, :name => 'username', :optional => true},
          NOTESTOREURL => {:type => ::Thrift::Types::STRING, :name => 'noteStoreUrl', :optional => true},
          WEBAPIURLPREFIX => {:type => ::Thrift::Types::STRING, :name => 'webApiUrlPrefix', :optional => true}
        }

        def struct_fields; FIELDS; end

        def validate
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field userId is unset!') unless @userId
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field shardId is unset!') unless @shardId
          unless @privilege.nil? || ::Evernote::EDAM::Type::PrivilegeLevel::VALID_VALUES.include?(@privilege)
            raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field privilege!')
          end
        end

        ::Thrift::Struct.generate_accessors self
      end

      #  When an authentication (or re-authentication) is performed, this structure
#  provides the result to the client.
# <dl>
#  <dt>currentTime:</dt>
#    <dd>
#    The server-side date and time when this result was
#    generated.
#    </dd>
#  <dt>authenticationToken:</dt>
#    <dd>
#    Holds an opaque, ASCII-encoded token that can be
#    used by the client to perform actions on a NoteStore.
#    </dd>
#  <dt>expiration:</dt>
#    <dd>
#    Holds the server-side date and time when the
#    authentication token will expire.
#    This time can be compared to "currentTime" to produce an expiration
#    time that can be reconciled with the client's local clock.
#    </dd>
#  <dt>user:</dt>
#    <dd>
#    Holds the information about the account which was
#    authenticated if this was a full authentication.  May be absent if this
#    particular authentication did not require user information.
#    </dd>
#  <dt>publicUserInfo:</dt>
#    <dd>
#    If this authentication result was achieved without full permissions to
#    access the full User structure, this field may be set to give back
#    a more limited public set of data.
#    </dd>
#  <dt>noteStoreUrl:</dt>
#    <dd>
#    This field will contain the full URL that clients should use to make
#    NoteStore requests to the server shard that contains that user's data.
#    I.e. this is the URL that should be used to create the Thrift HTTP client
#    transport to send messages to the NoteStore service for the account.
#    </dd>
#  <dt>webApiUrlPrefix:</dt>
#    <dd>
#    This field will contain the initial part of the URLs that should be used
#    to make requests to Evernote's thin client "web API", which provide
#    optimized operations for clients that aren't capable of manipulating
#    the full contents of accounts via the full Thrift data model. Clients
#    should concatenate the relative path for the various servlets onto the
#    end of this string to construct the full URL, as documented on our
#    developer web site.
#    </dd>
#  <dt>secondFactorRequired:</dt>
#    <dd>
#    If set to true, this field indicates that the user has enabled two-factor
#    authentication and must enter their second factor in order to complete
#    authentication. In this case the value of authenticationResult will be
#    a short-lived authentication token that may only be used to make a
#    subsequent call to completeTwoFactorAuthentication.
#    </dd>
#  <dt>secondFactorDeliveryHint:</dt>
#    <dd>
#    When secondFactorRequired is set to true, this field may contain a string
#    describing the second factor delivery method that the user has configured.
#    This will typically be an obfuscated mobile device number, such as
#    "(xxx) xxx-x095". This string can be displayed to the user to remind them
#    how to obtain the required second factor.
#    TODO do we need to differentiate between SMS and voice delivery?
#    </dd>
#  </dl>
      class AuthenticationResult
        include ::Thrift::Struct, ::Thrift::Struct_Union
        CURRENTTIME = 1
        AUTHENTICATIONTOKEN = 2
        EXPIRATION = 3
        USER = 4
        PUBLICUSERINFO = 5
        NOTESTOREURL = 6
        WEBAPIURLPREFIX = 7
        SECONDFACTORREQUIRED = 8
        SECONDFACTORDELIVERYHINT = 9

        FIELDS = {
          CURRENTTIME => {:type => ::Thrift::Types::I64, :name => 'currentTime'},
          AUTHENTICATIONTOKEN => {:type => ::Thrift::Types::STRING, :name => 'authenticationToken'},
          EXPIRATION => {:type => ::Thrift::Types::I64, :name => 'expiration'},
          USER => {:type => ::Thrift::Types::STRUCT, :name => 'user', :class => ::Evernote::EDAM::Type::User, :optional => true},
          PUBLICUSERINFO => {:type => ::Thrift::Types::STRUCT, :name => 'publicUserInfo', :class => ::Evernote::EDAM::UserStore::PublicUserInfo, :optional => true},
          NOTESTOREURL => {:type => ::Thrift::Types::STRING, :name => 'noteStoreUrl', :optional => true},
          WEBAPIURLPREFIX => {:type => ::Thrift::Types::STRING, :name => 'webApiUrlPrefix', :optional => true},
          SECONDFACTORREQUIRED => {:type => ::Thrift::Types::BOOL, :name => 'secondFactorRequired', :optional => true},
          SECONDFACTORDELIVERYHINT => {:type => ::Thrift::Types::STRING, :name => 'secondFactorDeliveryHint', :optional => true}
        }

        def struct_fields; FIELDS; end

        def validate
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field currentTime is unset!') unless @currentTime
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field authenticationToken is unset!') unless @authenticationToken
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field expiration is unset!') unless @expiration
        end

        ::Thrift::Struct.generate_accessors self
      end

      #  This structure describes a collection of bootstrap settings.
# <dl>
#  <dt>serviceHost:</dt>
#    <dd>
#    The hostname and optional port for composing Evernote web service URLs.
#    This URL can be used to access the UserStore and related services,
#    but must not be used to compose the NoteStore URL. Client applications
#    must handle serviceHost values that include only the hostname
#    (e.g. www.evernote.com) or both the hostname and port (e.g. www.evernote.com:8080).
#    If no port is specified, or if port 443 is specified, client applications must
#    use the scheme "https" when composing URLs. Otherwise, a client must use the
#    scheme "http".
#  </dd>
#  <dt>marketingUrl:</dt>
#    <dd>
#    The URL stem for the Evernote corporate marketing website, e.g. http://www.evernote.com.
#    This stem can be used to compose website URLs. For example, the URL of the Evernote
#    Trunk is composed by appending "/about/trunk/" to the value of marketingUrl.
#    </dd>
#  <dt>supportUrl:</dt>
#    <dd>
#    The full URL for the Evernote customer support website, e.g. https://support.evernote.com.
#    </dd>
#  <dt>accountEmailDomain:</dt>
#    <dd>
#    The domain used for an Evernote user's incoming email address, which allows notes to
#    be emailed into an account. E.g. m.evernote.com.
#    </dd>
#  <dt>enableFacebookSharing:</dt>
#    <dd>
#    Whether the client application should enable sharing of notes on Facebook.
#    </dd>
#  <dt>enableGiftSubscriptions:</dt>
#    <dd>
#    Whether the client application should enable gift subscriptions.
#    </dd>
#  <dt>enableSupportTickets:</dt>
#    <dd>
#    Whether the client application should enable in-client creation of support tickets.
#    </dd>
#  <dt>enableSharedNotebooks:</dt>
#    <dd>
#    Whether the client application should enable shared notebooks.
#    </dd>
#  <dt>enableSingleNoteSharing:</dt>
#    <dd>
#    Whether the client application should enable single note sharing.
#    </dd>
#  <dt>enableSponsoredAccounts:</dt>
#    <dd>
#    Whether the client application should enable sponsored accounts.
#    </dd>
#  <dt>enableTwitterSharing:</dt>
#    <dd>
#    Whether the client application should enable sharing of notes on Twitter.
#    </dd>
#  </dl>
      class BootstrapSettings
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SERVICEHOST = 1
        MARKETINGURL = 2
        SUPPORTURL = 3
        ACCOUNTEMAILDOMAIN = 4
        ENABLEFACEBOOKSHARING = 5
        ENABLEGIFTSUBSCRIPTIONS = 6
        ENABLESUPPORTTICKETS = 7
        ENABLESHAREDNOTEBOOKS = 8
        ENABLESINGLENOTESHARING = 9
        ENABLESPONSOREDACCOUNTS = 10
        ENABLETWITTERSHARING = 11
        ENABLELINKEDINSHARING = 12
        ENABLEPUBLICNOTEBOOKS = 13

        FIELDS = {
          SERVICEHOST => {:type => ::Thrift::Types::STRING, :name => 'serviceHost'},
          MARKETINGURL => {:type => ::Thrift::Types::STRING, :name => 'marketingUrl'},
          SUPPORTURL => {:type => ::Thrift::Types::STRING, :name => 'supportUrl'},
          ACCOUNTEMAILDOMAIN => {:type => ::Thrift::Types::STRING, :name => 'accountEmailDomain'},
          ENABLEFACEBOOKSHARING => {:type => ::Thrift::Types::BOOL, :name => 'enableFacebookSharing', :optional => true},
          ENABLEGIFTSUBSCRIPTIONS => {:type => ::Thrift::Types::BOOL, :name => 'enableGiftSubscriptions', :optional => true},
          ENABLESUPPORTTICKETS => {:type => ::Thrift::Types::BOOL, :name => 'enableSupportTickets', :optional => true},
          ENABLESHAREDNOTEBOOKS => {:type => ::Thrift::Types::BOOL, :name => 'enableSharedNotebooks', :optional => true},
          ENABLESINGLENOTESHARING => {:type => ::Thrift::Types::BOOL, :name => 'enableSingleNoteSharing', :optional => true},
          ENABLESPONSOREDACCOUNTS => {:type => ::Thrift::Types::BOOL, :name => 'enableSponsoredAccounts', :optional => true},
          ENABLETWITTERSHARING => {:type => ::Thrift::Types::BOOL, :name => 'enableTwitterSharing', :optional => true},
          ENABLELINKEDINSHARING => {:type => ::Thrift::Types::BOOL, :name => 'enableLinkedInSharing', :optional => true},
          ENABLEPUBLICNOTEBOOKS => {:type => ::Thrift::Types::BOOL, :name => 'enablePublicNotebooks', :optional => true}
        }

        def struct_fields; FIELDS; end

        def validate
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field serviceHost is unset!') unless @serviceHost
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field marketingUrl is unset!') unless @marketingUrl
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field supportUrl is unset!') unless @supportUrl
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field accountEmailDomain is unset!') unless @accountEmailDomain
        end

        ::Thrift::Struct.generate_accessors self
      end

      #  This structure describes a collection of bootstrap settings.
# <dl>
#  <dt>name:</dt>
#    <dd>
#    The unique name of the profile, which is guaranteed to remain consistent across
#    calls to getBootstrapInfo.
#    </dd>
#  <dt>settings:</dt>
#    <dd>
#    The settings for this profile.
#    </dd>
#  </dl>
      class BootstrapProfile
        include ::Thrift::Struct, ::Thrift::Struct_Union
        NAME = 1
        SETTINGS = 2

        FIELDS = {
          NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
          SETTINGS => {:type => ::Thrift::Types::STRUCT, :name => 'settings', :class => ::Evernote::EDAM::UserStore::BootstrapSettings}
        }

        def struct_fields; FIELDS; end

        def validate
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field settings is unset!') unless @settings
        end

        ::Thrift::Struct.generate_accessors self
      end

      #  This structure describes a collection of bootstrap profiles.
# <dl>
#  <dt>profiles:</dt>
#    <dd>
#    List of one or more bootstrap profiles, in descending
#    preference order.
#    </dd>
#  </dl>
      class BootstrapInfo
        include ::Thrift::Struct, ::Thrift::Struct_Union
        PROFILES = 1

        FIELDS = {
          PROFILES => {:type => ::Thrift::Types::LIST, :name => 'profiles', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Evernote::EDAM::UserStore::BootstrapProfile}}
        }

        def struct_fields; FIELDS; end

        def validate
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field profiles is unset!') unless @profiles
        end

        ::Thrift::Struct.generate_accessors self
      end

    end
  end
end
