from ....tl.tlobject import TLObject


class ReuploadCdnFileRequest(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    upload.reuploadCdnFile#1af91c09 file_token:bytes request_token:bytes = Vector<CdnFileHash>"""

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

    def __init__(self, file_token, request_token):
        """
        :param file_token: Telegram type: "bytes".
        :param request_token: Telegram type: "bytes".

        :returns Vector<CdnFileHash>: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.file_token = file_token
        self.request_token = request_token

    def to_dict(self):
        return {
            'file_token': self.file_token,
            'request_token': self.request_token,
        }

    def on_send(self, writer):
        writer.write_int(ReuploadCdnFileRequest.constructor_id, signed=False)
        writer.tgwrite_bytes(self.file_token)
        writer.tgwrite_bytes(self.request_token)

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

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

    def __repr__(self):
        return 'upload.reuploadCdnFile#1af91c09 file_token:bytes request_token:bytes = Vector<CdnFileHash>'

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

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