io.enterpriseai.resources.EventsClient
Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/EventsClient.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 EventsClient
Event publishing (NATS).
Constructor EventsClient
EventsClient(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. |
EventsClient.publish
JsonNode publish(Object body)
Publish an event. Publishes an event (202): on NATS JetStream when configured, else in the platform outbox. The current W3C trace context is added to the headers. Every trigger whose subject and filter match starts a run of its agent (idempotent per event and trigger); the answer lists them in triggered, with skipped and an error code when a run could not start. Needs tenant_admin, developer or agent. 422 invalid_subject. Audited as event.publish.
Route: /v1/events/publish (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
body | Object | yes | Subject, payload and headers of the event. |
Returns: JsonNode. Decoded JSON answer of the operation "Publish an event".
Raises: the typed errors of the transport (Errors).
EventsClient.publish
JsonNode publish(Object body, RequestOptions options)
Publish an event. Publishes an event (202): on NATS JetStream when configured, else in the platform outbox. The current W3C trace context is added to the headers. Every trigger whose subject and filter match starts a run of its agent (idempotent per event and trigger); the answer lists them in triggered, with skipped and an error code when a run could not start. Needs tenant_admin, developer or agent. 422 invalid_subject. Audited as event.publish.
Route: /v1/events/publish (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
body | Object | yes | Subject, payload and headers of the event. | |
options | RequestOptions | yes | Per call options (idempotency key, traceparent, headers, abort signal). |
Returns: JsonNode. Decoded JSON answer of the operation "Publish an event".
Raises: the typed errors of the transport (Errors).