from telethon.tl.mtproto_request import MTProtoRequest


class MsgsStateInfo(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    msgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo"""

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

    def __init__(self, req_msg_id, info):
        """
        :param req_msg_id: Telegram type: «long».
        :param info: Telegram type: «string».
        """
        super().__init__()

        self.req_msg_id = req_msg_id
        self.info = info

    def on_send(self, writer):
        writer.write_int(MsgsStateInfo.constructor_id, signed=False)
        writer.write_long(self.req_msg_id)
        writer.tgwrite_string(self.info)

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

    def on_response(self, reader):
        self.req_msg_id = reader.read_long()
        self.info = reader.tgread_string()

    def __repr__(self):
        return 'msgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo'

    def __str__(self):
        return '(msgs_state_info (ID: 0x4deb57d) = (req_msg_id={}, info={}))'.format(str(self.req_msg_id), str(self.info))
