from telethon.tl.mtproto_request import MTProtoRequest


class EncryptedFile(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile"""

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

    def __init__(self, id, access_hash, size, dc_id, key_fingerprint):
        """
        :param id: Telegram type: «long».
        :param access_hash: Telegram type: «long».
        :param size: Telegram type: «int».
        :param dc_id: Telegram type: «int».
        :param key_fingerprint: Telegram type: «int».
        """
        super().__init__()

        self.id = id
        self.access_hash = access_hash
        self.size = size
        self.dc_id = dc_id
        self.key_fingerprint = key_fingerprint

    def on_send(self, writer):
        writer.write_int(EncryptedFile.constructor_id, signed=False)
        writer.write_long(self.id)
        writer.write_long(self.access_hash)
        writer.write_int(self.size)
        writer.write_int(self.dc_id)
        writer.write_int(self.key_fingerprint)

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

    def on_response(self, reader):
        self.id = reader.read_long()
        self.access_hash = reader.read_long()
        self.size = reader.read_int()
        self.dc_id = reader.read_int()
        self.key_fingerprint = reader.read_int()

    def __repr__(self):
        return 'encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile'

    def __str__(self):
        return '(encryptedFile (ID: 0x4a70994c) = (id={}, access_hash={}, size={}, dc_id={}, key_fingerprint={}))'.format(str(self.id), str(self.access_hash), str(self.size), str(self.dc_id), str(self.key_fingerprint))
