from ....tl.tlobject import TLObject


class ReceivedQueueRequest(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>"""

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

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

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

        self.max_qts = max_qts

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

    def on_send(self, writer):
        writer.write_int(ReceivedQueueRequest.constructor_id, signed=False)
        writer.write_int(self.max_qts)

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

    def on_response(self, reader):
        reader.read_int()  # Vector id
        count = reader.read_long()
        self.result = [reader.read_long() for _ in range(count)]

    def __repr__(self):
        return 'messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>'

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

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