"""File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLObject


class BindTempAuthKeyRequest(TLObject):
    constructor_id = 0xcdd42a05
    subclass_of_id = 0xf5b399ac

    def __init__(self, perm_auth_key_id, nonce, expires_at, encrypted_message):
        """
        :param perm_auth_key_id: Telegram type: "long".
        :param nonce: Telegram type: "long".
        :param expires_at: Telegram type: "date".
        :param encrypted_message: Telegram type: "bytes".

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.perm_auth_key_id = perm_auth_key_id
        self.nonce = nonce
        self.expires_at = expires_at
        self.encrypted_message = encrypted_message

    def to_dict(self):
        return {
            'perm_auth_key_id': self.perm_auth_key_id,
            'nonce': self.nonce,
            'expires_at': self.expires_at,
            'encrypted_message': self.encrypted_message,
        }

    def on_send(self, writer):
        writer.write_int(BindTempAuthKeyRequest.constructor_id, signed=False)
        writer.write_long(self.perm_auth_key_id)
        writer.write_long(self.nonce)
        writer.tgwrite_date(self.expires_at)
        writer.tgwrite_bytes(self.encrypted_message)

    @staticmethod
    def empty():
        return BindTempAuthKeyRequest(None, None, None, None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class CancelCodeRequest(TLObject):
    constructor_id = 0x1f040578
    subclass_of_id = 0xf5b399ac

    def __init__(self, phone_number, phone_code_hash):
        """
        :param phone_number: Telegram type: "string".
        :param phone_code_hash: Telegram type: "string".

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.phone_number = phone_number
        self.phone_code_hash = phone_code_hash

    def to_dict(self):
        return {
            'phone_number': self.phone_number,
            'phone_code_hash': self.phone_code_hash,
        }

    def on_send(self, writer):
        writer.write_int(CancelCodeRequest.constructor_id, signed=False)
        writer.tgwrite_string(self.phone_number)
        writer.tgwrite_string(self.phone_code_hash)

    @staticmethod
    def empty():
        return CancelCodeRequest(None, None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class CheckPasswordRequest(TLObject):
    constructor_id = 0xa63011e
    subclass_of_id = 0xb9e04e39

    def __init__(self, password_hash):
        """
        :param password_hash: Telegram type: "bytes".

        :returns auth.Authorization: Instance of Authorization.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.password_hash = password_hash

    def to_dict(self):
        return {
            'password_hash': self.password_hash,
        }

    def on_send(self, writer):
        writer.write_int(CheckPasswordRequest.constructor_id, signed=False)
        writer.tgwrite_bytes(self.password_hash)

    @staticmethod
    def empty():
        return CheckPasswordRequest(None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.checkPassword#0a63011e password_hash:bytes = auth.Authorization'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class CheckPhoneRequest(TLObject):
    constructor_id = 0x6fe51dfb
    subclass_of_id = 0x99a3d765

    def __init__(self, phone_number):
        """
        :param phone_number: Telegram type: "string".

        :returns auth.CheckedPhone: Instance of CheckedPhone.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.phone_number = phone_number

    def to_dict(self):
        return {
            'phone_number': self.phone_number,
        }

    def on_send(self, writer):
        writer.write_int(CheckPhoneRequest.constructor_id, signed=False)
        writer.tgwrite_string(self.phone_number)

    @staticmethod
    def empty():
        return CheckPhoneRequest(None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class DropTempAuthKeysRequest(TLObject):
    constructor_id = 0x8e48a188
    subclass_of_id = 0xf5b399ac

    def __init__(self, except_auth_keys):
        """
        :param except_auth_keys: Telegram type: "long". Must be a list.

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.except_auth_keys = except_auth_keys

    def to_dict(self):
        return {
            'except_auth_keys': [] if self.except_auth_keys is None else self.except_auth_keys[:],
        }

    def on_send(self, writer):
        writer.write_int(DropTempAuthKeysRequest.constructor_id, signed=False)
        writer.write_int(0x1cb5c415, signed=False)  # Vector's constructor ID
        writer.write_int(len(self.except_auth_keys))
        for _x in self.except_auth_keys:
            writer.write_long(_x)

    @staticmethod
    def empty():
        return DropTempAuthKeysRequest(None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class ExportAuthorizationRequest(TLObject):
    constructor_id = 0xe5bfffcd
    subclass_of_id = 0x5fd1ec51

    def __init__(self, dc_id):
        """
        :param dc_id: Telegram type: "int".

        :returns auth.ExportedAuthorization: Instance of ExportedAuthorization.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.dc_id = dc_id

    def to_dict(self):
        return {
            'dc_id': self.dc_id,
        }

    def on_send(self, writer):
        writer.write_int(ExportAuthorizationRequest.constructor_id, signed=False)
        writer.write_int(self.dc_id)

    @staticmethod
    def empty():
        return ExportAuthorizationRequest(None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class ImportAuthorizationRequest(TLObject):
    constructor_id = 0xe3ef9613
    subclass_of_id = 0xb9e04e39

    def __init__(self, id, bytes):
        """
        :param id: Telegram type: "int".
        :param bytes: Telegram type: "bytes".

        :returns auth.Authorization: Instance of Authorization.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.id = id
        self.bytes = bytes

    def to_dict(self):
        return {
            'id': self.id,
            'bytes': self.bytes,
        }

    def on_send(self, writer):
        writer.write_int(ImportAuthorizationRequest.constructor_id, signed=False)
        writer.write_int(self.id)
        writer.tgwrite_bytes(self.bytes)

    @staticmethod
    def empty():
        return ImportAuthorizationRequest(None, None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class ImportBotAuthorizationRequest(TLObject):
    constructor_id = 0x67a3ff2c
    subclass_of_id = 0xb9e04e39

    def __init__(self, flags, api_id, api_hash, bot_auth_token):
        """
        :param flags: Telegram type: "int".
        :param api_id: Telegram type: "int".
        :param api_hash: Telegram type: "string".
        :param bot_auth_token: Telegram type: "string".

        :returns auth.Authorization: Instance of Authorization.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.flags = flags
        self.api_id = api_id
        self.api_hash = api_hash
        self.bot_auth_token = bot_auth_token

    def to_dict(self):
        return {
            'flags': self.flags,
            'api_id': self.api_id,
            'api_hash': self.api_hash,
            'bot_auth_token': self.bot_auth_token,
        }

    def on_send(self, writer):
        writer.write_int(ImportBotAuthorizationRequest.constructor_id, signed=False)
        writer.write_int(self.flags)
        writer.write_int(self.api_id)
        writer.tgwrite_string(self.api_hash)
        writer.tgwrite_string(self.bot_auth_token)

    @staticmethod
    def empty():
        return ImportBotAuthorizationRequest(None, None, None, None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class LogOutRequest(TLObject):
    constructor_id = 0x5717da40
    subclass_of_id = 0xf5b399ac

    def __init__(self):
        super().__init__()
        self.result = None
        self.content_related = True

    @staticmethod
    def to_dict():
        return {}

    def on_send(self, writer):
        writer.write_int(LogOutRequest.constructor_id, signed=False)

    @staticmethod
    def empty():
        return LogOutRequest()

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.logOut#5717da40 = Bool'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class RecoverPasswordRequest(TLObject):
    constructor_id = 0x4ea56e92
    subclass_of_id = 0xb9e04e39

    def __init__(self, code):
        """
        :param code: Telegram type: "string".

        :returns auth.Authorization: Instance of Authorization.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.code = code

    def to_dict(self):
        return {
            'code': self.code,
        }

    def on_send(self, writer):
        writer.write_int(RecoverPasswordRequest.constructor_id, signed=False)
        writer.tgwrite_string(self.code)

    @staticmethod
    def empty():
        return RecoverPasswordRequest(None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.recoverPassword#4ea56e92 code:string = auth.Authorization'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class RequestPasswordRecoveryRequest(TLObject):
    constructor_id = 0xd897bc66
    subclass_of_id = 0xfa72d43a

    def __init__(self):
        super().__init__()
        self.result = None
        self.content_related = True

    @staticmethod
    def to_dict():
        return {}

    def on_send(self, writer):
        writer.write_int(RequestPasswordRecoveryRequest.constructor_id, signed=False)

    @staticmethod
    def empty():
        return RequestPasswordRecoveryRequest()

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class ResendCodeRequest(TLObject):
    constructor_id = 0x3ef1a9bf
    subclass_of_id = 0x6ce87081

    def __init__(self, phone_number, phone_code_hash):
        """
        :param phone_number: Telegram type: "string".
        :param phone_code_hash: Telegram type: "string".

        :returns auth.SentCode: Instance of SentCode.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.phone_number = phone_number
        self.phone_code_hash = phone_code_hash

    def to_dict(self):
        return {
            'phone_number': self.phone_number,
            'phone_code_hash': self.phone_code_hash,
        }

    def on_send(self, writer):
        writer.write_int(ResendCodeRequest.constructor_id, signed=False)
        writer.tgwrite_string(self.phone_number)
        writer.tgwrite_string(self.phone_code_hash)

    @staticmethod
    def empty():
        return ResendCodeRequest(None, None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class ResetAuthorizationsRequest(TLObject):
    constructor_id = 0x9fab0d1a
    subclass_of_id = 0xf5b399ac

    def __init__(self):
        super().__init__()
        self.result = None
        self.content_related = True

    @staticmethod
    def to_dict():
        return {}

    def on_send(self, writer):
        writer.write_int(ResetAuthorizationsRequest.constructor_id, signed=False)

    @staticmethod
    def empty():
        return ResetAuthorizationsRequest()

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.resetAuthorizations#9fab0d1a = Bool'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class SendCodeRequest(TLObject):
    constructor_id = 0x86aef0ec
    subclass_of_id = 0x6ce87081

    def __init__(self, phone_number, api_id, api_hash, allow_flashcall=None, current_number=None):
        """
        :param allow_flashcall: Telegram type: "true".
        :param phone_number: Telegram type: "string".
        :param current_number: Telegram type: "Bool".
        :param api_id: Telegram type: "int".
        :param api_hash: Telegram type: "string".

        :returns auth.SentCode: Instance of SentCode.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.allow_flashcall = allow_flashcall
        self.phone_number = phone_number
        self.current_number = current_number
        self.api_id = api_id
        self.api_hash = api_hash

    def to_dict(self):
        return {
            'allow_flashcall': self.allow_flashcall,
            'phone_number': self.phone_number,
            'current_number': self.current_number,
            'api_id': self.api_id,
            'api_hash': self.api_hash,
        }

    def on_send(self, writer):
        writer.write_int(SendCodeRequest.constructor_id, signed=False)
        flags = 0
        flags |= (1 << 0) if self.allow_flashcall else 0
        flags |= (1 << 0) if self.current_number else 0
        writer.write_int(flags)

        writer.tgwrite_string(self.phone_number)
        if self.current_number:
            writer.tgwrite_bool(self.current_number)

        writer.write_int(self.api_id)
        writer.tgwrite_string(self.api_hash)

    @staticmethod
    def empty():
        return SendCodeRequest(None, None, None, None, None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.sendCode#86aef0ec flags:# allow_flashcall:flags.0?true phone_number:string current_number:flags.0?Bool api_id:int api_hash:string = auth.SentCode'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class SendInvitesRequest(TLObject):
    constructor_id = 0x771c1d97
    subclass_of_id = 0xf5b399ac

    def __init__(self, phone_numbers, message):
        """
        :param phone_numbers: Telegram type: "string". Must be a list.
        :param message: Telegram type: "string".

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.phone_numbers = phone_numbers
        self.message = message

    def to_dict(self):
        return {
            'phone_numbers': [] if self.phone_numbers is None else self.phone_numbers[:],
            'message': self.message,
        }

    def on_send(self, writer):
        writer.write_int(SendInvitesRequest.constructor_id, signed=False)
        writer.write_int(0x1cb5c415, signed=False)  # Vector's constructor ID
        writer.write_int(len(self.phone_numbers))
        for _x in self.phone_numbers:
            writer.tgwrite_string(_x)

        writer.tgwrite_string(self.message)

    @staticmethod
    def empty():
        return SendInvitesRequest(None, None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class SignInRequest(TLObject):
    constructor_id = 0xbcd51581
    subclass_of_id = 0xb9e04e39

    def __init__(self, phone_number, phone_code_hash, phone_code):
        """
        :param phone_number: Telegram type: "string".
        :param phone_code_hash: Telegram type: "string".
        :param phone_code: Telegram type: "string".

        :returns auth.Authorization: Instance of Authorization.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.phone_number = phone_number
        self.phone_code_hash = phone_code_hash
        self.phone_code = phone_code

    def to_dict(self):
        return {
            'phone_number': self.phone_number,
            'phone_code_hash': self.phone_code_hash,
            'phone_code': self.phone_code,
        }

    def on_send(self, writer):
        writer.write_int(SignInRequest.constructor_id, signed=False)
        writer.tgwrite_string(self.phone_number)
        writer.tgwrite_string(self.phone_code_hash)
        writer.tgwrite_string(self.phone_code)

    @staticmethod
    def empty():
        return SignInRequest(None, None, None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class SignUpRequest(TLObject):
    constructor_id = 0x1b067634
    subclass_of_id = 0xb9e04e39

    def __init__(self, phone_number, phone_code_hash, phone_code, first_name, last_name):
        """
        :param phone_number: Telegram type: "string".
        :param phone_code_hash: Telegram type: "string".
        :param phone_code: Telegram type: "string".
        :param first_name: Telegram type: "string".
        :param last_name: Telegram type: "string".

        :returns auth.Authorization: Instance of Authorization.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.phone_number = phone_number
        self.phone_code_hash = phone_code_hash
        self.phone_code = phone_code
        self.first_name = first_name
        self.last_name = last_name

    def to_dict(self):
        return {
            'phone_number': self.phone_number,
            'phone_code_hash': self.phone_code_hash,
            'phone_code': self.phone_code,
            'first_name': self.first_name,
            'last_name': self.last_name,
        }

    def on_send(self, writer):
        writer.write_int(SignUpRequest.constructor_id, signed=False)
        writer.tgwrite_string(self.phone_number)
        writer.tgwrite_string(self.phone_code_hash)
        writer.tgwrite_string(self.phone_code)
        writer.tgwrite_string(self.first_name)
        writer.tgwrite_string(self.last_name)

    @staticmethod
    def empty():
        return SignUpRequest(None, None, None, None, None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)

