from telethon.tl.mtproto_request import MTProtoRequest


class RpcDropAnswerRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    rpc_drop_answer#58e4a740 req_msg_id:long = RpcDropAnswer"""

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

    def __init__(self, req_msg_id):
        """
        :param req_msg_id: Telegram type: «long».
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.req_msg_id = req_msg_id

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

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

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'rpc_drop_answer#58e4a740 req_msg_id:long = RpcDropAnswer'

    def __str__(self):
        return '(rpc_drop_answer (ID: 0x58e4a740) = (req_msg_id={}))'.format(str(self.req_msg_id))
