from ....tl.mtproto_request import MTProtoRequest


class ChangeStickerPositionRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    stickers.changeStickerPosition#4ed705ca sticker:InputDocument position:int = Bool"""

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

    def __init__(self, sticker, position):
        """
        :param sticker: Telegram type: "InputDocument".
        :param position: Telegram type: "int".

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.sticker = sticker
        self.position = position

    def to_dict(self):
        return {
            'sticker': None if self.sticker is None else self.sticker.to_dict(),
            'position': self.position,
        }

    def on_send(self, writer):
        writer.write_int(ChangeStickerPositionRequest.constructor_id, signed=False)
        self.sticker.on_send(writer)
        writer.write_int(self.position)

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

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

    def __repr__(self):
        return 'stickers.changeStickerPosition#4ed705ca sticker:InputDocument position:int = Bool'

    def __str__(self):
        return '(stickers.changeStickerPosition (ID: 0x4ed705ca) = (sticker={}, position={}))'.format(str(self.sticker), str(self.position))
