from ...tl.mtproto_request import MTProtoRequest


class RpcAnswerDropped(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    rpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer"""

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

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

        Constructor for RpcDropAnswer: Instance of either RpcAnswerUnknown, RpcAnswerDroppedRunning, RpcAnswerDropped.
        """
        super().__init__()

        self.msg_id = msg_id
        self.seq_no = seq_no
        self.bytes = bytes

    def on_send(self, writer):
        writer.write_int(RpcAnswerDropped.constructor_id, signed=False)
        writer.write_long(self.msg_id)
        writer.write_int(self.seq_no)
        writer.write_int(self.bytes)

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

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

    def __repr__(self):
        return 'rpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer'

    def __str__(self):
        return '(rpc_answer_dropped (ID: 0xa43ad8b7) = (msg_id={}, seq_no={}, bytes={}))'.format(str(self.msg_id), str(self.seq_no), str(self.bytes))
