from telethon.tl.mtproto_request import MTProtoRequest


class MessageActionChannelMigrateFrom(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction"""

    # Telegram's constructor ID (and unique identifier) for this class
    constructor_id = 0xb055eaee

    def __init__(self, title, chat_id):
        """
        :param title: Telegram type: «string».
        :param chat_id: Telegram type: «int».
        """
        super().__init__()

        self.title = title
        self.chat_id = chat_id

    def on_send(self, writer):
        writer.write_int(MessageActionChannelMigrateFrom.constructor_id, signed=False)
        writer.tgwrite_string(self.title)
        writer.write_int(self.chat_id)

    @staticmethod
    def empty():
        """Returns an "empty" instance (all attributes are None)"""
        return MessageActionChannelMigrateFrom(None, None)

    def on_response(self, reader):
        self.title = reader.tgread_string()
        self.chat_id = reader.read_int()

    def __repr__(self):
        return 'messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction'

    def __str__(self):
        return '(messageActionChannelMigrateFrom (ID: 0xb055eaee) = (title={}, chat_id={}))'.format(str(self.title), str(self.chat_id))
