from ....tl.mtproto_request import MTProtoRequest


class AffectedMessages(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages"""

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

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

        Constructor for messages.AffectedMessages: Instance of AffectedMessages.
        """
        super().__init__()

        self.pts = pts
        self.pts_count = pts_count

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

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

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

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

    def __repr__(self):
        return 'messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages'

    def __str__(self):
        return '(messages.affectedMessages (ID: 0x84d19185) = (pts={}, pts_count={}))'.format(str(self.pts), str(self.pts_count))
