from ...tl.tlobject import TLObject


class InputEncryptedFile(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile"""

    # Telegram's constructor (U)ID for this class
    constructor_id = 0x5a17b5e5
    # Also the ID of its resulting type for fast checks
    subclass_of_id = 0x8574c27a

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

        Constructor for InputEncryptedFile: Instance of either InputEncryptedFileEmpty, InputEncryptedFileUploaded, InputEncryptedFile, InputEncryptedFileBigUploaded.
        """
        super().__init__()

        self.id = id
        self.access_hash = access_hash

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

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

    @staticmethod
    def empty():
        """Returns an "empty" instance (attributes=None)"""
        return InputEncryptedFile(None, None)

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

    def __repr__(self):
        return 'inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile'

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

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