from ....tl.tlobject import TLObject


class CdnFileReuploadNeeded(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    upload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile"""

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

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

        Constructor for upload.CdnFile: Instance of either CdnFileReuploadNeeded, CdnFile.
        """
        super().__init__()

        self.request_token = request_token

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

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

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

    def on_response(self, reader):
        self.request_token = reader.tgread_bytes()

    def __repr__(self):
        return 'upload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile'

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

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