"""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
from ...utils import get_input_peer, get_input_channel, get_input_user, get_input_media
import os
import struct


class DestroyAuthKeyRequest(TLObject):
    CONSTRUCTOR_ID = 0xd1435160
    SUBCLASS_OF_ID = 0x8291e68e

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

    def to_dict(self, recursive=True):
        return {}

    def to_bytes(self):
        return b''.join((
            b'`QC\xd1',
        ))

    @staticmethod
    def empty():
        return DestroyAuthKeyRequest()

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

    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 int session_id:

        :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, recursive=True):
        return {
            'session_id': self.session_id,
        }

    def to_bytes(self):
        return b''.join((
            b'&!Q\xe7',
            struct.pack('<q', self.session_id),
        ))

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

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

    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 int num:

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

        self.num = num

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

    def to_bytes(self):
        return b''.join((
            b'\x04\xbd!\xb9',
            struct.pack('<i', self.num),
        ))

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

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

    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 int api_id:
        :param str device_model:
        :param str system_version:
        :param str app_version:
        :param str system_lang_code:
        :param str lang_pack:
        :param str lang_code:
        :param TLObject query:

        :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, recursive=True):
        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()) if recursive else self.query,
        }

    def to_bytes(self):
        return b''.join((
            b'\xa6\x1dH\xc7',
            struct.pack('<i', self.api_id),
            TLObject.serialize_bytes(self.device_model),
            TLObject.serialize_bytes(self.system_version),
            TLObject.serialize_bytes(self.app_version),
            TLObject.serialize_bytes(self.system_lang_code),
            TLObject.serialize_bytes(self.lang_pack),
            TLObject.serialize_bytes(self.lang_code),
            self.query.to_bytes(),
        ))

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

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

    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 int msg_id:
        :param TLObject query:

        :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, recursive=True):
        return {
            'msg_id': self.msg_id,
            'query': (None if self.query is None else self.query.to_dict()) if recursive else self.query,
        }

    def to_bytes(self):
        return b''.join((
            b'-7\x9f\xcb',
            struct.pack('<q', self.msg_id),
            self.query.to_bytes(),
        ))

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

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

    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 list[int] msg_ids:
        :param TLObject query:

        :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, recursive=True):
        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()) if recursive else self.query,
        }

    def to_bytes(self):
        return b''.join((
            b'\xf0\xb4\xc4=',
            b'\x15\xc4\xb5\x1c',struct.pack('<i', len(self.msg_ids)),b''.join(struct.pack('<q', x) for x in self.msg_ids),
            self.query.to_bytes(),
        ))

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

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

    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 int layer:
        :param TLObject query:

        :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, recursive=True):
        return {
            'layer': self.layer,
            'query': (None if self.query is None else self.query.to_dict()) if recursive else self.query,
        }

    def to_bytes(self):
        return b''.join((
            b'\r\r\x9b\xda',
            struct.pack('<i', self.layer),
            self.query.to_bytes(),
        ))

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

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

    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 TLObject query:

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

        self.query = query

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

    def to_bytes(self):
        return b''.join((
            b'\xb7Y\x94\xbf',
            self.query.to_bytes(),
        ))

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

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

    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 int ping_id:

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

        self.ping_id = ping_id

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

    def to_bytes(self):
        return b''.join((
            b'\xecw\xbez',
            struct.pack('<q', self.ping_id),
        ))

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

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

    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 int ping_id:
        :param int disconnect_delay:

        :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, recursive=True):
        return {
            'ping_id': self.ping_id,
            'disconnect_delay': self.disconnect_delay,
        }

    def to_bytes(self):
        return b''.join((
            b'\x8c{B\xf3',
            struct.pack('<q', self.ping_id),
            struct.pack('<i', self.disconnect_delay),
        ))

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

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

    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 int nonce:
        :param int server_nonce:
        :param bytes p:
        :param bytes q:
        :param int public_key_fingerprint:
        :param bytes encrypted_data:

        :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, recursive=True):
        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 to_bytes(self):
        return b''.join((
            b'\xbe\xe4\x12\xd7',
            self.nonce.to_bytes(16, 'little', signed=True),
            self.server_nonce.to_bytes(16, 'little', signed=True),
            TLObject.serialize_bytes(self.p),
            TLObject.serialize_bytes(self.q),
            struct.pack('<q', self.public_key_fingerprint),
            TLObject.serialize_bytes(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 __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 int nonce:

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

        self.nonce = nonce

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

    def to_bytes(self):
        return b''.join((
            b'x\x97F`',
            self.nonce.to_bytes(16, 'little', signed=True),
        ))

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

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

    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 int req_msg_id:

        :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, recursive=True):
        return {
            'req_msg_id': self.req_msg_id,
        }

    def to_bytes(self):
        return b''.join((
            b'@\xa7\xe4X',
            struct.pack('<q', self.req_msg_id),
        ))

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

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

    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 int nonce:
        :param int server_nonce:
        :param bytes encrypted_data:

        :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, recursive=True):
        return {
            'nonce': self.nonce,
            'server_nonce': self.server_nonce,
            'encrypted_data': self.encrypted_data,
        }

    def to_bytes(self):
        return b''.join((
            b'\x1f_\x04\xf5',
            self.nonce.to_bytes(16, 'little', signed=True),
            self.server_nonce.to_bytes(16, 'little', signed=True),
            TLObject.serialize_bytes(self.encrypted_data),
        ))

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

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

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

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