from ....tl.tlobject import TLObject


class GetChatsRequest(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    messages.getChats#3c6aa187 id:Vector<int> = messages.Chats"""

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

    def __init__(self, id):
        """
        :param id: Telegram type: "int". Must be a list.

        :returns messages.Chats: Instance of either Chats, ChatsSlice.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.id = id

    def to_dict(self):
        return {
            'id': [] if self.id is None else self.id[:],
        }

    def on_send(self, writer):
        writer.write_int(GetChatsRequest.constructor_id, signed=False)
        writer.write_int(0x1cb5c415, signed=False)  # Vector's constructor ID
        writer.write_int(len(self.id))
        for _x in self.id:
            writer.write_int(_x)

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

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

    def __repr__(self):
        return 'messages.getChats#3c6aa187 id:Vector<int> = messages.Chats'

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

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