from ...tl.tlobject import TLObject


class InputFileBig(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile"""

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

    def __init__(self, id, parts, name):
        """
        :param id: Telegram type: "long".
        :param parts: Telegram type: "int".
        :param name: Telegram type: "string".

        Constructor for InputFile: Instance of either InputFile, InputFileBig.
        """
        super().__init__()

        self.id = id
        self.parts = parts
        self.name = name

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

    def on_send(self, writer):
        writer.write_int(InputFileBig.constructor_id, signed=False)
        writer.write_long(self.id)
        writer.write_int(self.parts)
        writer.tgwrite_string(self.name)

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

    def on_response(self, reader):
        self.id = reader.read_long()
        self.parts = reader.read_int()
        self.name = reader.tgread_string()

    def __repr__(self):
        return 'inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile'

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

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