from ...tl.mtproto_request import MTProtoRequest


class MsgDetailedInfo(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    msg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo"""

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

    def __init__(self, msg_id, answer_msg_id, bytes, status):
        """
        :param msg_id: Telegram type: «long».
        :param answer_msg_id: Telegram type: «long».
        :param bytes: Telegram type: «int».
        :param status: Telegram type: «int».

        Constructor for MsgDetailedInfo: Instance of either MsgDetailedInfo, MsgNewDetailedInfo.
        """
        super().__init__()

        self.msg_id = msg_id
        self.answer_msg_id = answer_msg_id
        self.bytes = bytes
        self.status = status

    def on_send(self, writer):
        writer.write_int(MsgDetailedInfo.constructor_id, signed=False)
        writer.write_long(self.msg_id)
        writer.write_long(self.answer_msg_id)
        writer.write_int(self.bytes)
        writer.write_int(self.status)

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

    def on_response(self, reader):
        self.msg_id = reader.read_long()
        self.answer_msg_id = reader.read_long()
        self.bytes = reader.read_int()
        self.status = reader.read_int()

    def __repr__(self):
        return 'msg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo'

    def __str__(self):
        return '(msg_detailed_info (ID: 0x276d3ec6) = (msg_id={}, answer_msg_id={}, bytes={}, status={}))'.format(str(self.msg_id), str(self.answer_msg_id), str(self.bytes), str(self.status))
