io.enterpriseai.resources.A2aClient
Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/A2aClient.java. Back to the Java SDK reference index.
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Class A2aClient
Agent to agent messaging.
Constructor A2aClient
A2aClient(Transport transport)
Creates the client on the shared transport; EnterpriseAIClient builds it and exposes it through the accessor of the same name.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
transport | Transport | yes | Transport shared by the sub-clients of one client. |
A2aClient.inbox
Page<JsonNode> inbox(String recipient)
Read an A2A inbox. Returns the A2A messages addressed to recipient, oldest first, each with verified (the HMAC-SHA256 signature of the envelope matches the tenant key). Reading marks the returned messages as read. One page only (next_cursor is always null).
Route: /v1/a2a/inbox (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
recipient | String | yes | Party whose inbox is read: agent:<name> or run:<id> (at least 3 characters). |
Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).
Raises: the typed errors of the transport (Errors).
A2aClient.inbox
Page<JsonNode> inbox(String recipient, Map<String, ?> query)
Read an A2A inbox. Returns the A2A messages addressed to recipient, oldest first, each with verified (the HMAC-SHA256 signature of the envelope matches the tenant key). Reading marks the returned messages as read. One page only (next_cursor is always null).
Route: /v1/a2a/inbox (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
recipient | String | yes | Party whose inbox is read: agent:<name> or run:<id> (at least 3 characters). | |
query | Map<String, ?> | yes | Query string parameters of the route. |
Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).
Raises: the typed errors of the transport (Errors).
A2aClient.send
JsonNode send(Object body)
Send an A2A message. Sends a signed agent to agent message (envelope a2a.v1, HMAC-SHA256 signature per tenant). Needs tenant_admin, developer or agent. Steps: 1. to and from are resolved: agent:<name> or run:<id> (400 invalid_request otherwise). Without from, the sender is the calling principal. 2. A run: sender must be a run created by the caller (or the caller is tenant_admin, else 403 forbidden) and not finished (409 run_finished). 3. The policy agent.a2a.send is evaluated and the payload is screened as untrusted content; a prompt injection is refused with prompt_injection_blocked after the security event is recorded. 4. The envelope is stored in the recipient inbox and audited as a2a.send.
Route: /v1/a2a/messages (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
body | Object | yes | Recipient, message type, payload and optional conversation threading. |
Returns: JsonNode. Decoded JSON answer of the operation "Send an A2A message".
Raises: the typed errors of the transport (Errors).
A2aClient.send
JsonNode send(Object body, RequestOptions options)
Send an A2A message. Sends a signed agent to agent message (envelope a2a.v1, HMAC-SHA256 signature per tenant). Needs tenant_admin, developer or agent. Steps: 1. to and from are resolved: agent:<name> or run:<id> (400 invalid_request otherwise). Without from, the sender is the calling principal. 2. A run: sender must be a run created by the caller (or the caller is tenant_admin, else 403 forbidden) and not finished (409 run_finished). 3. The policy agent.a2a.send is evaluated and the payload is screened as untrusted content; a prompt injection is refused with prompt_injection_blocked after the security event is recorded. 4. The envelope is stored in the recipient inbox and audited as a2a.send.
Route: /v1/a2a/messages (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
body | Object | yes | Recipient, message type, payload and optional conversation threading. | |
options | RequestOptions | yes | Per call options (idempotency key, traceparent, headers, abort signal). |
Returns: JsonNode. Decoded JSON answer of the operation "Send an A2A message".
Raises: the typed errors of the transport (Errors).