Class CancelTaskResponse

java.lang.Object
org.a2aproject.sdk.jsonrpc.common.wrappers.A2AResponse<Task>
org.a2aproject.sdk.jsonrpc.common.wrappers.CancelTaskResponse
All Implemented Interfaces:
A2AMessage

public final class CancelTaskResponse extends A2AResponse<Task>
JSON-RPC response for task cancellation requests.

This response contains the updated Task object after cancellation, typically showing TaskState.TASK_STATE_CANCELED status if the cancellation was successful.

If the task cannot be canceled (e.g., already completed) or is not found, the error field will contain a A2AError such as TaskNotCancelableError or TaskNotFoundError.

See Also:
  • Constructor Details

    • CancelTaskResponse

      public CancelTaskResponse(String jsonrpc, Object id, Task result, A2AError error)
      Constructs a CancelTaskResponse with full parameters.
      Parameters:
      jsonrpc - the JSON-RPC version
      id - the request ID
      result - the task result
      error - the error if any
    • CancelTaskResponse

      public CancelTaskResponse(Object id, A2AError error)
      Constructs a CancelTaskResponse with an error.
      Parameters:
      id - the request ID
      error - the error
    • CancelTaskResponse

      public CancelTaskResponse(Object id, Task result)
      Constructs a CancelTaskResponse with a successful result.
      Parameters:
      id - the request ID
      result - the task result