from ....tl.tlobject import TLObject


class GetArchivedStickersRequest(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    messages.getArchivedStickers#57f17692 flags:# masks:flags.0?true offset_id:long limit:int = messages.ArchivedStickers"""

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

    def __init__(self, offset_id, limit, masks=None):
        """
        :param masks: Telegram type: "true".
        :param offset_id: Telegram type: "long".
        :param limit: Telegram type: "int".

        :returns messages.ArchivedStickers: Instance of ArchivedStickers.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.masks = masks
        self.offset_id = offset_id
        self.limit = limit

    def to_dict(self):
        return {
            'masks': self.masks,
            'offset_id': self.offset_id,
            'limit': self.limit,
        }

    def on_send(self, writer):
        writer.write_int(GetArchivedStickersRequest.constructor_id, signed=False)
        # Calculate the flags. This equals to those flag arguments which are NOT None
        flags = 0
        flags |= (1 << 0) if self.masks else 0
        writer.write_int(flags)

        writer.write_long(self.offset_id)
        writer.write_int(self.limit)

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

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

    def __repr__(self):
        return 'messages.getArchivedStickers#57f17692 flags:# masks:flags.0?true offset_id:long limit:int = messages.ArchivedStickers'

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

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