from telethon.tl.mtproto_request import MTProtoRequest


class InputEncryptedChat(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat"""

    # Telegram's constructor ID (and unique identifier) for this class
    constructor_id = 0xf141b5e1

    def __init__(self, chat_id, access_hash):
        """
        :param chat_id: Telegram type: «int».
        :param access_hash: Telegram type: «long».
        """
        super().__init__()

        self.chat_id = chat_id
        self.access_hash = access_hash

    def on_send(self, writer):
        writer.write_int(InputEncryptedChat.constructor_id, signed=False)
        writer.write_int(self.chat_id)
        writer.write_long(self.access_hash)

    @staticmethod
    def empty():
        """Returns an "empty" instance (all attributes are None)"""
        return InputEncryptedChat(None, None)

    def on_response(self, reader):
        self.chat_id = reader.read_int()
        self.access_hash = reader.read_long()

    def __repr__(self):
        return 'inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat'

    def __str__(self):
        return '(inputEncryptedChat (ID: 0xf141b5e1) = (chat_id={}, access_hash={}))'.format(str(self.chat_id), str(self.access_hash))
