io.enterpriseai.Transport
Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/Transport.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 Transport
HTTP layer shared by every resource client: authentication and tenancy headers, Accept-Language, W3C traceparent, Idempotency-Key, retries with exponential backoff honoring Retry-After, error envelope mapping and pagination.
Transport.baseUrl
URI baseUrl()
Control Plane base URL, validated, without trailing slash.
This element takes no parameter.
Returns: URI. The base URI.
Transport.bytes
byte[] bytes(String method, String template, Object body, RequestOptions o, String... params)
Binary call (audio, exports).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
method | String | yes | HTTP method, such as GET or POST; a POST gets an Idempotency-Key. | |
template | String | yes | Path template such as /v1/runs/{run_id}; the {name} placeholders are filled in order from params. | |
body | Object | yes | Request body, serialized as JSON. | |
o | RequestOptions | yes | Per call options (idempotency key, traceparent, headers). | |
params | String... | yes | Extra fields merged into the request. |
Returns: byte[]. The full response body as bytes.
Transport.environment
String environment()
Environment set on the builder.
This element takes no parameter.
Returns: String. The environment, or null.
Transport.exchange
Response<JsonNode> exchange(String method, String template, Object body, Map<String, ?> query, RequestOptions o, String... params)
JSON call returning the response with headers.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
method | String | yes | HTTP method, such as GET or POST; a POST gets an Idempotency-Key. | |
template | String | yes | Path template such as /v1/runs/{run_id}; the {name} placeholders are filled in order from params. | |
body | Object | yes | Request body, serialized as JSON. | |
query | Map<String, ?> | yes | Query string parameters of the route. | |
o | RequestOptions | yes | Per call options (idempotency key, traceparent, headers). | |
params | String... | yes | Extra fields merged into the request. |
Returns: Response<JsonNode>. A Response: Raw response: status, headers and body.
Transport.json
JsonNode json(String method, String template, Object body, Map<String, ?> query, RequestOptions o, String... params)
JSON call returning the parsed body (NullNode for empty bodies such as 204).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
method | String | yes | HTTP method, such as GET or POST; a POST gets an Idempotency-Key. | |
template | String | yes | Path template such as /v1/runs/{run_id}; the {name} placeholders are filled in order from params. | |
body | Object | yes | Request body, serialized as JSON. | |
query | Map<String, ?> | yes | Query string parameters of the route. | |
o | RequestOptions | yes | Per call options (idempotency key, traceparent, headers). | |
params | String... | yes | Extra fields merged into the request. |
Returns: JsonNode. The parsed body, NullNode when empty.
Transport.locale
Locale locale()
Message language of the client.
This element takes no parameter.
Returns: Locale. The Locale of the client.
Transport.page
Page<JsonNode> page(String template, Map<String, ?> query, String... params)
Cursor paginated GET.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
template | String | yes | Path template such as /v1/runs/{run_id}; the {name} placeholders are filled in order from params. | |
query | Map<String, ?> | yes | Query string parameters of the route. | |
params | String... | yes | Extra fields merged into the request. |
Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).
Transport.project
String project()
Project slug set on the builder.
This element takes no parameter.
Returns: String. The project slug, or null.
Transport.send
Response<InputStream> send(String method, String path, Map<String, ?> query, Object body, RequestOptions o, String accept)
Sends one request with retries.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
method | String | yes | HTTP method, such as GET or POST; a POST gets an Idempotency-Key. | |
path | String | yes | Path already expanded, relative to the base URL. | |
query | Map<String, ?> | yes | Query string parameters of the route. | |
body | Object | yes | Request body, serialized as JSON. | |
o | RequestOptions | yes | Per call options (idempotency key, traceparent, headers). | |
accept | String | yes | Accept header value |
Returns: Response<InputStream>. the successful response; the caller owns and must close the body stream
Raises: EaiException.
Transport.sse
SseStream sse(String method, String template, Object body, RequestOptions o, String... params)
SSE call: the returned stream must be closed.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
method | String | yes | HTTP method, such as GET or POST; a POST gets an Idempotency-Key. | |
template | String | yes | Path template such as /v1/runs/{run_id}; the {name} placeholders are filled in order from params. | |
body | Object | yes | Request body, serialized as JSON. | |
o | RequestOptions | yes | Per call options (idempotency key, traceparent, headers). | |
params | String... | yes | Extra fields merged into the request. |
Returns: SseStream. A SseStream: Blocking Server-Sent Events reader. Use it with try-with-resources, as an Iterator, a Stream or a reactive Flow.Publisher. A data: [DONE] event ends the stream.
Transport.tenant
String tenant()
Tenant slug set on the builder.
This element takes no parameter.
Returns: String. The tenant slug, or null.
Transport.toString
String toString()
Never prints the API key or the token.
This element takes no parameter.
Returns: String. The base URL with the API key and the token masked.
Transport.websocket
CompletableFuture<WebSocket> websocket(String template, WebSocket.Listener listener, String... params)
Opens a WebSocket on template (http(s) base URL mapped to ws(s)) with the auth headers.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
template | String | yes | Path template such as /v1/runs/{run_id}; the {name} placeholders are filled in order from params. | |
listener | WebSocket.Listener | yes | WebSocket.Listener that receives the frames. | |
params | String... | yes | Extra fields merged into the request. |
Returns: CompletableFuture<WebSocket>. A CompletableFuture completed with the open WebSocket.
Model Transport.Response
Raw response: status, headers and body.
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
status | int | yes | HTTP status of the response. |
headers | HttpHeaders | yes | Headers of the event, string values. The trace context is added. |
body | T | yes | Body of the response: byte stream, parsed JsonNode or other depending on the call. |
Response.header
String header(String name)
Reads a header of the response.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
name | String | yes | Name of the header, case insensitive. |
Returns: String. The first value of the header, or null when absent.