#
# Autogenerated by Thrift Compiler (0.13.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
#  options string: py
#

from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive import fix_spec

import sys

from thrift.transport import TTransport
all_structs = []


class ErrorCode(object):
    INTERNAL_ERROR = 0
    ILLEGAL_ARGUMENT = 1
    VERIFICATION_FAILED = 2
    NOT_FOUND = 3
    RETRY_LATER = 4
    HUMAN_VERIFICATION_REQUIRED = 5
    INVALID_CONTEXT = 100
    APP_UPGRADE_REQUIRED = 101

    _VALUES_TO_NAMES = {
        0: "INTERNAL_ERROR",
        1: "ILLEGAL_ARGUMENT",
        2: "VERIFICATION_FAILED",
        3: "NOT_FOUND",
        4: "RETRY_LATER",
        5: "HUMAN_VERIFICATION_REQUIRED",
        100: "INVALID_CONTEXT",
        101: "APP_UPGRADE_REQUIRED",
    }

    _NAMES_TO_VALUES = {
        "INTERNAL_ERROR": 0,
        "ILLEGAL_ARGUMENT": 1,
        "VERIFICATION_FAILED": 2,
        "NOT_FOUND": 3,
        "RETRY_LATER": 4,
        "HUMAN_VERIFICATION_REQUIRED": 5,
        "INVALID_CONTEXT": 100,
        "APP_UPGRADE_REQUIRED": 101,
    }


class AccountVerifMethod(object):
    UNKNOWN = 0
    SKIP = 1
    PASSWORD = 2
    WEB_BASED = 3

    _VALUES_TO_NAMES = {
        0: "UNKNOWN",
        1: "SKIP",
        2: "PASSWORD",
        3: "WEB_BASED",
    }

    _NAMES_TO_VALUES = {
        "UNKNOWN": 0,
        "SKIP": 1,
        "PASSWORD": 2,
        "WEB_BASED": 3,
    }


class AccountIdentifierType(object):
    UNKNOWN = 0
    PHONE_NUMBER = 1
    EMAIL = 2

    _VALUES_TO_NAMES = {
        0: "UNKNOWN",
        1: "PHONE_NUMBER",
        2: "EMAIL",
    }

    _NAMES_TO_VALUES = {
        "UNKNOWN": 0,
        "PHONE_NUMBER": 1,
        "EMAIL": 2,
    }


class PhoneVerifMethod(object):
    UNKNOWN = 0
    UNAVAILABLE = 1
    SMS = 2
    TTS = 3

    _VALUES_TO_NAMES = {
        0: "UNKNOWN",
        1: "UNAVAILABLE",
        2: "SMS",
        3: "TTS",
    }

    _NAMES_TO_VALUES = {
        "UNKNOWN": 0,
        "UNAVAILABLE": 1,
        "SMS": 2,
        "TTS": 3,
    }


class EncryptionKeyVersion(object):
    UNKNOWN = 0
    V1 = 1

    _VALUES_TO_NAMES = {
        0: "UNKNOWN",
        1: "V1",
    }

    _NAMES_TO_VALUES = {
        "UNKNOWN": 0,
        "V1": 1,
    }


class SecondAuthMethod(object):
    UNKNOWN = 0
    SKIP = 1
    WEB_BASED = 2

    _VALUES_TO_NAMES = {
        0: "UNKNOWN",
        1: "SKIP",
        2: "WEB_BASED",
    }

    _NAMES_TO_VALUES = {
        "UNKNOWN": 0,
        "SKIP": 1,
        "WEB_BASED": 2,
    }


class AuthException(TException):
    """
    Attributes:
     - code
     - alertMessage
     - webAuthDetails

    """


    def __init__(self, code=None, alertMessage=None, webAuthDetails=None,):
        self.code = code
        self.alertMessage = alertMessage
        self.webAuthDetails = webAuthDetails

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.code = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.alertMessage = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.STRUCT:
                    self.webAuthDetails = WebAuthDetails()
                    self.webAuthDetails.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('AuthException')
        if self.code is not None:
            oprot.writeFieldBegin('code', TType.I32, 1)
            oprot.writeI32(self.code)
            oprot.writeFieldEnd()
        if self.alertMessage is not None:
            oprot.writeFieldBegin('alertMessage', TType.STRING, 2)
            oprot.writeString(self.alertMessage.encode('utf-8') if sys.version_info[0] == 2 else self.alertMessage)
            oprot.writeFieldEnd()
        if self.webAuthDetails is not None:
            oprot.writeFieldBegin('webAuthDetails', TType.STRUCT, 11)
            self.webAuthDetails.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __str__(self):
        return repr(self)

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class OpenSessionRequest(object):
    """
    Attributes:
     - metaData

    """


    def __init__(self, metaData=None,):
        self.metaData = metaData

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.MAP:
                    self.metaData = {}
                    (_ktype1, _vtype2, _size0) = iprot.readMapBegin()
                    for _i4 in range(_size0):
                        _key5 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val6 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.metaData[_key5] = _val6
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('OpenSessionRequest')
        if self.metaData is not None:
            oprot.writeFieldBegin('metaData', TType.MAP, 1)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metaData))
            for kiter7, viter8 in self.metaData.items():
                oprot.writeString(kiter7.encode('utf-8') if sys.version_info[0] == 2 else kiter7)
                oprot.writeString(viter8.encode('utf-8') if sys.version_info[0] == 2 else viter8)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class GetAcctVerifMethodResponse(object):
    """
    Attributes:
     - availableMethod
     - sameAccountFromAuthFactor

    """


    def __init__(self, availableMethod=None, sameAccountFromAuthFactor=None,):
        self.availableMethod = availableMethod
        self.sameAccountFromAuthFactor = sameAccountFromAuthFactor

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.availableMethod = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.sameAccountFromAuthFactor = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('GetAcctVerifMethodResponse')
        if self.availableMethod is not None:
            oprot.writeFieldBegin('availableMethod', TType.I32, 1)
            oprot.writeI32(self.availableMethod)
            oprot.writeFieldEnd()
        if self.sameAccountFromAuthFactor is not None:
            oprot.writeFieldBegin('sameAccountFromAuthFactor', TType.BOOL, 2)
            oprot.writeBool(self.sameAccountFromAuthFactor)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class AccountIdentifier(object):
    """
    Attributes:
     - type
     - identifier
     - countryCode

    """


    def __init__(self, type=None, identifier=None, countryCode=None,):
        self.type = type
        self.identifier = identifier
        self.countryCode = countryCode

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.type = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.identifier = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.STRING:
                    self.countryCode = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('AccountIdentifier')
        if self.type is not None:
            oprot.writeFieldBegin('type', TType.I32, 1)
            oprot.writeI32(self.type)
            oprot.writeFieldEnd()
        if self.identifier is not None:
            oprot.writeFieldBegin('identifier', TType.STRING, 2)
            oprot.writeString(self.identifier.encode('utf-8') if sys.version_info[0] == 2 else self.identifier)
            oprot.writeFieldEnd()
        if self.countryCode is not None:
            oprot.writeFieldBegin('countryCode', TType.STRING, 11)
            oprot.writeString(self.countryCode.encode('utf-8') if sys.version_info[0] == 2 else self.countryCode)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class RegisterPrimaryResponse(object):
    """
    Attributes:
     - authToken

    """


    def __init__(self, authToken=None,):
        self.authToken = authToken

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.authToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('RegisterPrimaryResponse')
        if self.authToken is not None:
            oprot.writeFieldBegin('authToken', TType.STRING, 1)
            oprot.writeString(self.authToken.encode('utf-8') if sys.version_info[0] == 2 else self.authToken)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class MigratePrimaryResponse(object):
    """
    Attributes:
     - authToken

    """


    def __init__(self, authToken=None,):
        self.authToken = authToken

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.authToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('MigratePrimaryResponse')
        if self.authToken is not None:
            oprot.writeFieldBegin('authToken', TType.STRING, 1)
            oprot.writeString(self.authToken.encode('utf-8') if sys.version_info[0] == 2 else self.authToken)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class GetPhoneVerifMethodResponse(object):
    """
    Attributes:
     - availableMethods
     - prettifiedPhoneNumber

    """


    def __init__(self, availableMethods=None, prettifiedPhoneNumber=None,):
        self.availableMethods = availableMethods
        self.prettifiedPhoneNumber = prettifiedPhoneNumber

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.LIST:
                    self.availableMethods = []
                    (_etype12, _size9) = iprot.readListBegin()
                    for _i13 in range(_size9):
                        _elem14 = iprot.readI32()
                        self.availableMethods.append(_elem14)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.prettifiedPhoneNumber = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('GetPhoneVerifMethodResponse')
        if self.availableMethods is not None:
            oprot.writeFieldBegin('availableMethods', TType.LIST, 1)
            oprot.writeListBegin(TType.I32, len(self.availableMethods))
            for iter15 in self.availableMethods:
                oprot.writeI32(iter15)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.prettifiedPhoneNumber is not None:
            oprot.writeFieldBegin('prettifiedPhoneNumber', TType.STRING, 3)
            oprot.writeString(self.prettifiedPhoneNumber.encode('utf-8') if sys.version_info[0] == 2 else self.prettifiedPhoneNumber)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class Device(object):
    """
    Attributes:
     - udid
     - deviceModel

    """


    def __init__(self, udid=None, deviceModel=None,):
        self.udid = udid
        self.deviceModel = deviceModel

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.udid = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.deviceModel = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('Device')
        if self.udid is not None:
            oprot.writeFieldBegin('udid', TType.STRING, 1)
            oprot.writeString(self.udid.encode('utf-8') if sys.version_info[0] == 2 else self.udid)
            oprot.writeFieldEnd()
        if self.deviceModel is not None:
            oprot.writeFieldBegin('deviceModel', TType.STRING, 2)
            oprot.writeString(self.deviceModel.encode('utf-8') if sys.version_info[0] == 2 else self.deviceModel)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class UserPhoneNumber(object):
    """
    Attributes:
     - phoneNumber
     - countryCode

    """


    def __init__(self, phoneNumber=None, countryCode=None,):
        self.phoneNumber = phoneNumber
        self.countryCode = countryCode

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.phoneNumber = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.countryCode = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('UserPhoneNumber')
        if self.phoneNumber is not None:
            oprot.writeFieldBegin('phoneNumber', TType.STRING, 1)
            oprot.writeString(self.phoneNumber.encode('utf-8') if sys.version_info[0] == 2 else self.phoneNumber)
            oprot.writeFieldEnd()
        if self.countryCode is not None:
            oprot.writeFieldBegin('countryCode', TType.STRING, 2)
            oprot.writeString(self.countryCode.encode('utf-8') if sys.version_info[0] == 2 else self.countryCode)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class UserProfile(object):
    """
    Attributes:
     - displayName
     - profileImageUrl

    """


    def __init__(self, displayName=None, profileImageUrl=None,):
        self.displayName = displayName
        self.profileImageUrl = profileImageUrl

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.displayName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.profileImageUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('UserProfile')
        if self.displayName is not None:
            oprot.writeFieldBegin('displayName', TType.STRING, 1)
            oprot.writeString(self.displayName.encode('utf-8') if sys.version_info[0] == 2 else self.displayName)
            oprot.writeFieldEnd()
        if self.profileImageUrl is not None:
            oprot.writeFieldBegin('profileImageUrl', TType.STRING, 2)
            oprot.writeString(self.profileImageUrl.encode('utf-8') if sys.version_info[0] == 2 else self.profileImageUrl)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class VerifyPhoneResponse(object):
    """
    Attributes:
     - accountExist
     - sameUdidFromAccount
     - userProfile

    """


    def __init__(self, accountExist=None, sameUdidFromAccount=None, userProfile=None,):
        self.accountExist = accountExist
        self.sameUdidFromAccount = sameUdidFromAccount
        self.userProfile = userProfile

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 2:
                if ftype == TType.BOOL:
                    self.accountExist = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.sameUdidFromAccount = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.STRUCT:
                    self.userProfile = UserProfile()
                    self.userProfile.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('VerifyPhoneResponse')
        if self.accountExist is not None:
            oprot.writeFieldBegin('accountExist', TType.BOOL, 2)
            oprot.writeBool(self.accountExist)
            oprot.writeFieldEnd()
        if self.sameUdidFromAccount is not None:
            oprot.writeFieldBegin('sameUdidFromAccount', TType.BOOL, 3)
            oprot.writeBool(self.sameUdidFromAccount)
            oprot.writeFieldEnd()
        if self.userProfile is not None:
            oprot.writeFieldBegin('userProfile', TType.STRUCT, 11)
            self.userProfile.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class VerifyAccountUsingPwdResponse(object):
    """
    Attributes:
     - userProfile

    """


    def __init__(self, userProfile=None,):
        self.userProfile = userProfile

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 2:
                if ftype == TType.STRUCT:
                    self.userProfile = UserProfile()
                    self.userProfile.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('VerifyAccountUsingPwdResponse')
        if self.userProfile is not None:
            oprot.writeFieldBegin('userProfile', TType.STRUCT, 2)
            self.userProfile.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class EncryptedPassword(object):
    """
    Attributes:
     - encryptionKeyVersion
     - cipherText

    """


    def __init__(self, encryptionKeyVersion=None, cipherText=None,):
        self.encryptionKeyVersion = encryptionKeyVersion
        self.cipherText = cipherText

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.encryptionKeyVersion = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.cipherText = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('EncryptedPassword')
        if self.encryptionKeyVersion is not None:
            oprot.writeFieldBegin('encryptionKeyVersion', TType.I32, 1)
            oprot.writeI32(self.encryptionKeyVersion)
            oprot.writeFieldEnd()
        if self.cipherText is not None:
            oprot.writeFieldBegin('cipherText', TType.STRING, 2)
            oprot.writeString(self.cipherText.encode('utf-8') if sys.version_info[0] == 2 else self.cipherText)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class ValidateProfileResponse(object):


    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('ValidateProfileResponse')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class GetUserProfileResponse(object):
    """
    Attributes:
     - userProfile

    """


    def __init__(self, userProfile=None,):
        self.userProfile = userProfile

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.userProfile = UserProfile()
                    self.userProfile.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('GetUserProfileResponse')
        if self.userProfile is not None:
            oprot.writeFieldBegin('userProfile', TType.STRUCT, 1)
            self.userProfile.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class WebAuthDetails(object):
    """
    Attributes:
     - baseUrl
     - token

    """


    def __init__(self, baseUrl=None, token=None,):
        self.baseUrl = baseUrl
        self.token = token

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.baseUrl = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.token = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('WebAuthDetails')
        if self.baseUrl is not None:
            oprot.writeFieldBegin('baseUrl', TType.STRING, 1)
            oprot.writeString(self.baseUrl.encode('utf-8') if sys.version_info[0] == 2 else self.baseUrl)
            oprot.writeFieldEnd()
        if self.token is not None:
            oprot.writeFieldBegin('token', TType.STRING, 2)
            oprot.writeString(self.token.encode('utf-8') if sys.version_info[0] == 2 else self.token)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class IssueWebAuthDetailsForAcctVerifResponse(object):
    """
    Attributes:
     - webAuthDetails

    """


    def __init__(self, webAuthDetails=None,):
        self.webAuthDetails = webAuthDetails

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.webAuthDetails = WebAuthDetails()
                    self.webAuthDetails.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('IssueWebAuthDetailsForAcctVerifResponse')
        if self.webAuthDetails is not None:
            oprot.writeFieldBegin('webAuthDetails', TType.STRUCT, 1)
            self.webAuthDetails.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class IssueWebAuthDetailsForSecondAuthResponse(object):
    """
    Attributes:
     - webAuthDetails

    """


    def __init__(self, webAuthDetails=None,):
        self.webAuthDetails = webAuthDetails

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.webAuthDetails = WebAuthDetails()
                    self.webAuthDetails.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('IssueWebAuthDetailsForSecondAuthResponse')
        if self.webAuthDetails is not None:
            oprot.writeFieldBegin('webAuthDetails', TType.STRUCT, 1)
            self.webAuthDetails.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class ExchangeEncryptionKeyResponse(object):
    """
    Attributes:
     - publicKey
     - nonce

    """


    def __init__(self, publicKey=None, nonce=None,):
        self.publicKey = publicKey
        self.nonce = nonce

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.publicKey = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.nonce = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('ExchangeEncryptionKeyResponse')
        if self.publicKey is not None:
            oprot.writeFieldBegin('publicKey', TType.STRING, 1)
            oprot.writeString(self.publicKey.encode('utf-8') if sys.version_info[0] == 2 else self.publicKey)
            oprot.writeFieldEnd()
        if self.nonce is not None:
            oprot.writeFieldBegin('nonce', TType.STRING, 2)
            oprot.writeString(self.nonce.encode('utf-8') if sys.version_info[0] == 2 else self.nonce)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class ExchangeEncryptionKeyRequest(object):
    """
    Attributes:
     - authKeyVersion
     - publicKey
     - nonce

    """


    def __init__(self, authKeyVersion=None, publicKey=None, nonce=None,):
        self.authKeyVersion = authKeyVersion
        self.publicKey = publicKey
        self.nonce = nonce

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.authKeyVersion = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.publicKey = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.nonce = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('ExchangeEncryptionKeyRequest')
        if self.authKeyVersion is not None:
            oprot.writeFieldBegin('authKeyVersion', TType.I32, 1)
            oprot.writeI32(self.authKeyVersion)
            oprot.writeFieldEnd()
        if self.publicKey is not None:
            oprot.writeFieldBegin('publicKey', TType.STRING, 2)
            oprot.writeString(self.publicKey.encode('utf-8') if sys.version_info[0] == 2 else self.publicKey)
            oprot.writeFieldEnd()
        if self.nonce is not None:
            oprot.writeFieldBegin('nonce', TType.STRING, 3)
            oprot.writeString(self.nonce.encode('utf-8') if sys.version_info[0] == 2 else self.nonce)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class SetPasswordResponse(object):


    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('SetPasswordResponse')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class SendPinCodeForPhoneResponse(object):
    """
    Attributes:
     - availableMethods

    """


    def __init__(self, availableMethods=None,):
        self.availableMethods = availableMethods

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.LIST:
                    self.availableMethods = []
                    (_etype19, _size16) = iprot.readListBegin()
                    for _i20 in range(_size16):
                        _elem21 = iprot.readI32()
                        self.availableMethods.append(_elem21)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('SendPinCodeForPhoneResponse')
        if self.availableMethods is not None:
            oprot.writeFieldBegin('availableMethods', TType.LIST, 1)
            oprot.writeListBegin(TType.I32, len(self.availableMethods))
            for iter22 in self.availableMethods:
                oprot.writeI32(iter22)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class GetSecondAuthMethodResponse(object):
    """
    Attributes:
     - secondAuthMethod

    """


    def __init__(self, secondAuthMethod=None,):
        self.secondAuthMethod = secondAuthMethod

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.secondAuthMethod = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('GetSecondAuthMethodResponse')
        if self.secondAuthMethod is not None:
            oprot.writeFieldBegin('secondAuthMethod', TType.I32, 1)
            oprot.writeI32(self.secondAuthMethod)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)
all_structs.append(AuthException)
AuthException.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'code', None, None, ),  # 1
    (2, TType.STRING, 'alertMessage', 'UTF8', None, ),  # 2
    None,  # 3
    None,  # 4
    None,  # 5
    None,  # 6
    None,  # 7
    None,  # 8
    None,  # 9
    None,  # 10
    (11, TType.STRUCT, 'webAuthDetails', [WebAuthDetails, None], None, ),  # 11
)
all_structs.append(OpenSessionRequest)
OpenSessionRequest.thrift_spec = (
    None,  # 0
    (1, TType.MAP, 'metaData', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 1
)
all_structs.append(GetAcctVerifMethodResponse)
GetAcctVerifMethodResponse.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'availableMethod', None, None, ),  # 1
    (2, TType.BOOL, 'sameAccountFromAuthFactor', None, None, ),  # 2
)
all_structs.append(AccountIdentifier)
AccountIdentifier.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'type', None, None, ),  # 1
    (2, TType.STRING, 'identifier', 'UTF8', None, ),  # 2
    None,  # 3
    None,  # 4
    None,  # 5
    None,  # 6
    None,  # 7
    None,  # 8
    None,  # 9
    None,  # 10
    (11, TType.STRING, 'countryCode', 'UTF8', None, ),  # 11
)
all_structs.append(RegisterPrimaryResponse)
RegisterPrimaryResponse.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'authToken', 'UTF8', None, ),  # 1
)
all_structs.append(MigratePrimaryResponse)
MigratePrimaryResponse.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'authToken', 'UTF8', None, ),  # 1
)
all_structs.append(GetPhoneVerifMethodResponse)
GetPhoneVerifMethodResponse.thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'availableMethods', (TType.I32, None, False), None, ),  # 1
    None,  # 2
    (3, TType.STRING, 'prettifiedPhoneNumber', 'UTF8', None, ),  # 3
)
all_structs.append(Device)
Device.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'udid', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'deviceModel', 'UTF8', None, ),  # 2
)
all_structs.append(UserPhoneNumber)
UserPhoneNumber.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'phoneNumber', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'countryCode', 'UTF8', None, ),  # 2
)
all_structs.append(UserProfile)
UserProfile.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'displayName', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'profileImageUrl', 'UTF8', None, ),  # 2
)
all_structs.append(VerifyPhoneResponse)
VerifyPhoneResponse.thrift_spec = (
    None,  # 0
    None,  # 1
    (2, TType.BOOL, 'accountExist', None, None, ),  # 2
    (3, TType.BOOL, 'sameUdidFromAccount', None, None, ),  # 3
    None,  # 4
    None,  # 5
    None,  # 6
    None,  # 7
    None,  # 8
    None,  # 9
    None,  # 10
    (11, TType.STRUCT, 'userProfile', [UserProfile, None], None, ),  # 11
)
all_structs.append(VerifyAccountUsingPwdResponse)
VerifyAccountUsingPwdResponse.thrift_spec = (
    None,  # 0
    None,  # 1
    (2, TType.STRUCT, 'userProfile', [UserProfile, None], None, ),  # 2
)
all_structs.append(EncryptedPassword)
EncryptedPassword.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'encryptionKeyVersion', None, None, ),  # 1
    (2, TType.STRING, 'cipherText', 'UTF8', None, ),  # 2
)
all_structs.append(ValidateProfileResponse)
ValidateProfileResponse.thrift_spec = (
)
all_structs.append(GetUserProfileResponse)
GetUserProfileResponse.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'userProfile', [UserProfile, None], None, ),  # 1
)
all_structs.append(WebAuthDetails)
WebAuthDetails.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'baseUrl', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'token', 'UTF8', None, ),  # 2
)
all_structs.append(IssueWebAuthDetailsForAcctVerifResponse)
IssueWebAuthDetailsForAcctVerifResponse.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'webAuthDetails', [WebAuthDetails, None], None, ),  # 1
)
all_structs.append(IssueWebAuthDetailsForSecondAuthResponse)
IssueWebAuthDetailsForSecondAuthResponse.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'webAuthDetails', [WebAuthDetails, None], None, ),  # 1
)
all_structs.append(ExchangeEncryptionKeyResponse)
ExchangeEncryptionKeyResponse.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'publicKey', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'nonce', 'UTF8', None, ),  # 2
)
all_structs.append(ExchangeEncryptionKeyRequest)
ExchangeEncryptionKeyRequest.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'authKeyVersion', None, None, ),  # 1
    (2, TType.STRING, 'publicKey', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'nonce', 'UTF8', None, ),  # 3
)
all_structs.append(SetPasswordResponse)
SetPasswordResponse.thrift_spec = (
)
all_structs.append(SendPinCodeForPhoneResponse)
SendPinCodeForPhoneResponse.thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'availableMethods', (TType.I32, None, False), None, ),  # 1
)
all_structs.append(GetSecondAuthMethodResponse)
GetSecondAuthMethodResponse.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'secondAuthMethod', None, None, ),  # 1
)
fix_spec(all_structs)
del all_structs
