from ....tl.mtproto_request import MTProtoRequest


class DifferenceTooLong(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    updates.differenceTooLong#4afe8f6d pts:int = updates.Difference"""

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

    def __init__(self, pts):
        """
        :param pts: Telegram type: «int».

        Constructor for updates.Difference: Instance of either DifferenceEmpty, Difference, DifferenceSlice, DifferenceTooLong.
        """
        super().__init__()

        self.pts = pts

    def on_send(self, writer):
        writer.write_int(DifferenceTooLong.constructor_id, signed=False)
        writer.write_int(self.pts)

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

    def on_response(self, reader):
        self.pts = reader.read_int()

    def __repr__(self):
        return 'updates.differenceTooLong#4afe8f6d pts:int = updates.Difference'

    def __str__(self):
        return '(updates.differenceTooLong (ID: 0x4afe8f6d) = (pts={}))'.format(str(self.pts))
