Class CancelTaskResponse
java.lang.Object
org.a2aproject.sdk.jsonrpc.common.wrappers.A2AResponse<Task>
org.a2aproject.sdk.jsonrpc.common.wrappers.CancelTaskResponse
- All Implemented Interfaces:
A2AMessage
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.
-
Field Summary
Fields inherited from class org.a2aproject.sdk.jsonrpc.common.wrappers.A2AResponse
error, id, jsonrpc, resultFields inherited from interface org.a2aproject.sdk.jsonrpc.common.wrappers.A2AMessage
JSONRPC_VERSION -
Constructor Summary
ConstructorsConstructorDescriptionCancelTaskResponse(Object id, A2AError error) Constructs a CancelTaskResponse with an error.CancelTaskResponse(Object id, Task result) Constructs a CancelTaskResponse with a successful result.CancelTaskResponse(String jsonrpc, Object id, Task result, A2AError error) Constructs a CancelTaskResponse with full parameters. -
Method Summary
Methods inherited from class org.a2aproject.sdk.jsonrpc.common.wrappers.A2AResponse
getError, getId, getJsonrpc, getResult
-
Constructor Details
-
CancelTaskResponse
Constructs a CancelTaskResponse with full parameters.- Parameters:
jsonrpc- the JSON-RPC versionid- the request IDresult- the task resulterror- the error if any
-
CancelTaskResponse
Constructs a CancelTaskResponse with an error.- Parameters:
id- the request IDerror- the error
-
CancelTaskResponse
Constructs a CancelTaskResponse with a successful result.- Parameters:
id- the request IDresult- the task result
-