from ...tl.mtproto_request import MTProtoRequest


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

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

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

        Constructor for MsgsStateInfo: Instance of MsgsStateInfo.
        """
        super().__init__()

        self.req_msg_id = req_msg_id
        self.info = info

    def to_dict(self):
        return {
            'req_msg_id': self.req_msg_id,
            'info': self.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 (attributes=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))
