from ....tl.tlobject import TLObject


class InstallStickerSetRequest(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    messages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult"""

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

    def __init__(self, stickerset, archived):
        """
        :param stickerset: Telegram type: "InputStickerSet".
        :param archived: Telegram type: "Bool".

        :returns messages.StickerSetInstallResult: Instance of either StickerSetInstallResultSuccess, StickerSetInstallResultArchive.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.stickerset = stickerset
        self.archived = archived

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

    def on_send(self, writer):
        writer.write_int(InstallStickerSetRequest.constructor_id, signed=False)
        self.stickerset.on_send(writer)
        writer.tgwrite_bool(self.archived)

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

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

    def __repr__(self):
        return 'messages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult'

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

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