from ...tl.tlobject import TLObject


class ChannelAdminLogEventActionUpdatePinned(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    channelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction"""

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

    def __init__(self, message):
        """
        :param message: Telegram type: "Message".

        Constructor for ChannelAdminLogEventAction: Instance of either ChannelAdminLogEventActionChangeTitle, ChannelAdminLogEventActionChangeAbout, ChannelAdminLogEventActionChangeUsername, ChannelAdminLogEventActionChangePhoto, ChannelAdminLogEventActionToggleInvites, ChannelAdminLogEventActionToggleSignatures, ChannelAdminLogEventActionUpdatePinned, ChannelAdminLogEventActionEditMessage, ChannelAdminLogEventActionDeleteMessage, ChannelAdminLogEventActionParticipantJoin, ChannelAdminLogEventActionParticipantLeave, ChannelAdminLogEventActionParticipantInvite, ChannelAdminLogEventActionParticipantToggleBan, ChannelAdminLogEventActionParticipantToggleAdmin.
        """
        super().__init__()

        self.message = message

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

    def on_send(self, writer):
        writer.write_int(ChannelAdminLogEventActionUpdatePinned.constructor_id, signed=False)
        self.message.on_send(writer)

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

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

    def __repr__(self):
        return 'channelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction'

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

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