"""File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLObject
from . import contest, auth, account, users, contacts, messages, updates, photos, upload, help, channels, bots, payments, stickers, phone, langpack


class DestroyAuthKeyRequest(TLObject):
    constructor_id = 0xd1435160
    subclass_of_id = 0x8291e68e

    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(DestroyAuthKeyRequest.constructor_id, signed=False)

    @staticmethod
    def empty():
        return DestroyAuthKeyRequest()

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

    def __repr__(self):
        return 'destroy_auth_key#d1435160 = DestroyAuthKeyRes'

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

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



class DestroySessionRequest(TLObject):
    constructor_id = 0xe7512126
    subclass_of_id = 0xaf0ce7bd

    def __init__(self, session_id):
        """
        :param session_id: Telegram type: "long".

        :returns DestroySessionRes: Instance of either DestroySessionOk, DestroySessionNone.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.session_id = session_id

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

    def on_send(self, writer):
        writer.write_int(DestroySessionRequest.constructor_id, signed=False)
        writer.write_long(self.session_id)

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

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

    def __repr__(self):
        return 'destroy_session#e7512126 session_id:long = DestroySessionRes'

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

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



class GetFutureSaltsRequest(TLObject):
    constructor_id = 0xb921bd04
    subclass_of_id = 0x1090f517

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

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

        self.num = num

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

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

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

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

    def __repr__(self):
        return 'get_future_salts#b921bd04 num:int = FutureSalts'

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

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



class InitConnectionRequest(TLObject):
    constructor_id = 0xc7481da6
    subclass_of_id = 0xb7b2364b

    def __init__(self, api_id, device_model, system_version, app_version, system_lang_code, lang_pack, lang_code, query):
        """
        :param api_id: Telegram type: "int".
        :param device_model: Telegram type: "string".
        :param system_version: Telegram type: "string".
        :param app_version: Telegram type: "string".
        :param system_lang_code: Telegram type: "string".
        :param lang_pack: Telegram type: "string".
        :param lang_code: Telegram type: "string".
        :param query: Telegram type: "X". Must be another TLObject request.

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

        self.api_id = api_id
        self.device_model = device_model
        self.system_version = system_version
        self.app_version = app_version
        self.system_lang_code = system_lang_code
        self.lang_pack = lang_pack
        self.lang_code = lang_code
        self.query = query

    def to_dict(self):
        return {
            'api_id': self.api_id,
            'device_model': self.device_model,
            'system_version': self.system_version,
            'app_version': self.app_version,
            'system_lang_code': self.system_lang_code,
            'lang_pack': self.lang_pack,
            'lang_code': self.lang_code,
            'query': None if self.query is None else self.query.to_dict(),
        }

    def on_send(self, writer):
        writer.write_int(InitConnectionRequest.constructor_id, signed=False)
        writer.write_int(self.api_id)
        writer.tgwrite_string(self.device_model)
        writer.tgwrite_string(self.system_version)
        writer.tgwrite_string(self.app_version)
        writer.tgwrite_string(self.system_lang_code)
        writer.tgwrite_string(self.lang_pack)
        writer.tgwrite_string(self.lang_code)
        self.query.on_send(writer)

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

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

    def __repr__(self):
        return 'initConnection#c7481da6 {X:Type} api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string query:!X = X'

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

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



class InvokeAfterMsgRequest(TLObject):
    constructor_id = 0xcb9f372d
    subclass_of_id = 0xb7b2364b

    def __init__(self, msg_id, query):
        """
        :param msg_id: Telegram type: "long".
        :param query: Telegram type: "X". Must be another TLObject request.

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

        self.msg_id = msg_id
        self.query = query

    def to_dict(self):
        return {
            'msg_id': self.msg_id,
            'query': None if self.query is None else self.query.to_dict(),
        }

    def on_send(self, writer):
        writer.write_int(InvokeAfterMsgRequest.constructor_id, signed=False)
        writer.write_long(self.msg_id)
        self.query.on_send(writer)

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

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

    def __repr__(self):
        return 'invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X'

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

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



class InvokeAfterMsgsRequest(TLObject):
    constructor_id = 0x3dc4b4f0
    subclass_of_id = 0xb7b2364b

    def __init__(self, msg_ids, query):
        """
        :param msg_ids: Telegram type: "long". Must be a list.
        :param query: Telegram type: "X". Must be another TLObject request.

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

        self.msg_ids = msg_ids
        self.query = query

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

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

        self.query.on_send(writer)

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

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

    def __repr__(self):
        return 'invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X'

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

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



class InvokeWithLayerRequest(TLObject):
    constructor_id = 0xda9b0d0d
    subclass_of_id = 0xb7b2364b

    def __init__(self, layer, query):
        """
        :param layer: Telegram type: "int".
        :param query: Telegram type: "X". Must be another TLObject request.

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

        self.layer = layer
        self.query = query

    def to_dict(self):
        return {
            'layer': self.layer,
            'query': None if self.query is None else self.query.to_dict(),
        }

    def on_send(self, writer):
        writer.write_int(InvokeWithLayerRequest.constructor_id, signed=False)
        writer.write_int(self.layer)
        self.query.on_send(writer)

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

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

    def __repr__(self):
        return 'invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X'

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

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



class InvokeWithoutUpdatesRequest(TLObject):
    constructor_id = 0xbf9459b7
    subclass_of_id = 0xb7b2364b

    def __init__(self, query):
        """
        :param query: Telegram type: "X". Must be another TLObject request.

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

        self.query = query

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

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

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

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

    def __repr__(self):
        return 'invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X'

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

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



class PingRequest(TLObject):
    constructor_id = 0x7abe77ec
    subclass_of_id = 0x816aee71

    def __init__(self, ping_id):
        """
        :param ping_id: Telegram type: "long".

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

        self.ping_id = ping_id

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

    def on_send(self, writer):
        writer.write_int(PingRequest.constructor_id, signed=False)
        writer.write_long(self.ping_id)

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

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

    def __repr__(self):
        return 'ping#7abe77ec ping_id:long = Pong'

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

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



class PingDelayDisconnectRequest(TLObject):
    constructor_id = 0xf3427b8c
    subclass_of_id = 0x816aee71

    def __init__(self, ping_id, disconnect_delay):
        """
        :param ping_id: Telegram type: "long".
        :param disconnect_delay: Telegram type: "int".

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

        self.ping_id = ping_id
        self.disconnect_delay = disconnect_delay

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

    def on_send(self, writer):
        writer.write_int(PingDelayDisconnectRequest.constructor_id, signed=False)
        writer.write_long(self.ping_id)
        writer.write_int(self.disconnect_delay)

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

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

    def __repr__(self):
        return 'ping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong'

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

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



class ReqDHParamsRequest(TLObject):
    constructor_id = 0xd712e4be
    subclass_of_id = 0xa6188d9e

    def __init__(self, nonce, server_nonce, p, q, public_key_fingerprint, encrypted_data):
        """
        :param nonce: Telegram type: "int128".
        :param server_nonce: Telegram type: "int128".
        :param p: Telegram type: "string".
        :param q: Telegram type: "string".
        :param public_key_fingerprint: Telegram type: "long".
        :param encrypted_data: Telegram type: "string".

        :returns Server_DH_Params: Instance of either ServerDHParamsFail, ServerDHParamsOk.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.nonce = nonce
        self.server_nonce = server_nonce
        self.p = p
        self.q = q
        self.public_key_fingerprint = public_key_fingerprint
        self.encrypted_data = encrypted_data

    def to_dict(self):
        return {
            'nonce': self.nonce,
            'server_nonce': self.server_nonce,
            'p': self.p,
            'q': self.q,
            'public_key_fingerprint': self.public_key_fingerprint,
            'encrypted_data': self.encrypted_data,
        }

    def on_send(self, writer):
        writer.write_int(ReqDHParamsRequest.constructor_id, signed=False)
        writer.write_large_int(self.nonce, bits=128)
        writer.write_large_int(self.server_nonce, bits=128)
        writer.tgwrite_string(self.p)
        writer.tgwrite_string(self.q)
        writer.write_long(self.public_key_fingerprint)
        writer.tgwrite_string(self.encrypted_data)

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

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

    def __repr__(self):
        return 'req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params'

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

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



class ReqPqRequest(TLObject):
    constructor_id = 0x60469778
    subclass_of_id = 0x786986b8

    def __init__(self, nonce):
        """
        :param nonce: Telegram type: "int128".

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

        self.nonce = nonce

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

    def on_send(self, writer):
        writer.write_int(ReqPqRequest.constructor_id, signed=False)
        writer.write_large_int(self.nonce, bits=128)

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

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

    def __repr__(self):
        return 'req_pq#60469778 nonce:int128 = ResPQ'

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

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



class RpcDropAnswerRequest(TLObject):
    constructor_id = 0x58e4a740
    subclass_of_id = 0x4bca7570

    def __init__(self, req_msg_id):
        """
        :param req_msg_id: Telegram type: "long".

        :returns RpcDropAnswer: Instance of either RpcAnswerUnknown, RpcAnswerDroppedRunning, RpcAnswerDropped.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.req_msg_id = req_msg_id

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

    def on_send(self, writer):
        writer.write_int(RpcDropAnswerRequest.constructor_id, signed=False)
        writer.write_long(self.req_msg_id)

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

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

    def __repr__(self):
        return 'rpc_drop_answer#58e4a740 req_msg_id:long = RpcDropAnswer'

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

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



class SetClientDHParamsRequest(TLObject):
    constructor_id = 0xf5045f1f
    subclass_of_id = 0x55dd6cdb

    def __init__(self, nonce, server_nonce, encrypted_data):
        """
        :param nonce: Telegram type: "int128".
        :param server_nonce: Telegram type: "int128".
        :param encrypted_data: Telegram type: "string".

        :returns Set_client_DH_params_answer: Instance of either DhGenOk, DhGenRetry, DhGenFail.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.nonce = nonce
        self.server_nonce = server_nonce
        self.encrypted_data = encrypted_data

    def to_dict(self):
        return {
            'nonce': self.nonce,
            'server_nonce': self.server_nonce,
            'encrypted_data': self.encrypted_data,
        }

    def on_send(self, writer):
        writer.write_int(SetClientDHParamsRequest.constructor_id, signed=False)
        writer.write_large_int(self.nonce, bits=128)
        writer.write_large_int(self.server_nonce, bits=128)
        writer.tgwrite_string(self.encrypted_data)

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

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

    def __repr__(self):
        return 'set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer'

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

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

