from ...tl.tlobject import TLObject


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

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

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

        Constructor for MessageAction: Instance of either MessageActionEmpty, MessageActionChatCreate, MessageActionChatEditTitle, MessageActionChatEditPhoto, MessageActionChatDeletePhoto, MessageActionChatAddUser, MessageActionChatDeleteUser, MessageActionChatJoinedByLink, MessageActionChannelCreate, MessageActionChatMigrateTo, MessageActionChannelMigrateFrom, MessageActionPinMessage, MessageActionHistoryClear, MessageActionGameScore, MessageActionPaymentSentMe, MessageActionPaymentSent, MessageActionPhoneCall, MessageActionScreenshotTaken.
        """
        super().__init__()

        self.title = title
        self.chat_id = chat_id

    def to_dict(self):
        return {
            'title': self.title,
            'chat_id': self.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 (attributes=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 TLObject.pretty_format(self)

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