from ...tl.tlobject import TLObject


class MsgNewDetailedInfo(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    msg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo"""

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

    def __init__(self, answer_msg_id, bytes, status):
        """
        :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.answer_msg_id = answer_msg_id
        self.bytes = bytes
        self.status = status

    def to_dict(self):
        return {
            'answer_msg_id': self.answer_msg_id,
            'bytes': self.bytes,
            'status': self.status,
        }

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

    @staticmethod
    def empty():
        """Returns an "empty" instance (attributes=None)"""
        return MsgNewDetailedInfo(None, None, None)

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

    def __repr__(self):
        return 'msg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo'

    def __str__(self):
        return TLObject.pretty_format(self)

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