from ...tl.mtproto_request import MTProtoRequest


class ChannelAdminLogEventActionChangeAbout(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    channelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction"""

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

    def __init__(self, prev_value, new_value):
        """
        :param prev_value: Telegram type: "string".
        :param new_value: Telegram type: "string".

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

        self.prev_value = prev_value
        self.new_value = new_value

    def to_dict(self):
        return {
            'prev_value': self.prev_value,
            'new_value': self.new_value,
        }

    def on_send(self, writer):
        writer.write_int(ChannelAdminLogEventActionChangeAbout.constructor_id, signed=False)
        writer.tgwrite_string(self.prev_value)
        writer.tgwrite_string(self.new_value)

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

    def on_response(self, reader):
        self.prev_value = reader.tgread_string()
        self.new_value = reader.tgread_string()

    def __repr__(self):
        return 'channelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction'

    def __str__(self):
        return '(channelAdminLogEventActionChangeAbout (ID: 0x55188a2e) = (prev_value={}, new_value={}))'.format(str(self.prev_value), str(self.new_value))
