Skip to main content

io.enterpriseai.resources.ApprovalsClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/ApprovalsClient.java. Back to the Java SDK reference index.

note

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 ApprovalsClient​

Human approvals with separation of duties.

Constructor ApprovalsClient​

ApprovalsClient(Transport transport)

Creates the client on the shared transport; EnterpriseAIClient builds it and exposes it through the accessor of the same name.

NameTypeDefaultRequiredDescription
transportTransportyesTransport shared by the sub-clients of one client.

ApprovalsClient.cancel​

JsonNode cancel(String id, Object body)

Cancel an approval request. Withdraws a pending request. Allowed to its requester, a tenant_admin or a security_officer (403 forbidden otherwise, the refusal being audited). The request ends cancelled and its subject reacts as to a refusal: a waiting run fails (approval_cancelled), a pending break glass grant or mandate is rejected. A request that is no longer pending answers 409 approval_closed. Writes the audit event approval.cancel with the reason. The answer carries run_state when a run is attached.

Route: /v1/approvals/{approval_id}/cancel (POST).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the approval request.
bodyObjectyesReason of the cancellation.

Returns: JsonNode. Decoded JSON answer of the operation "Cancel an approval request".

Raises: the typed errors of the transport (Errors).

ApprovalsClient.cancel​

JsonNode cancel(String id, Object body, RequestOptions options)

Cancel an approval request. Withdraws a pending request. Allowed to its requester, a tenant_admin or a security_officer (403 forbidden otherwise, the refusal being audited). The request ends cancelled and its subject reacts as to a refusal: a waiting run fails (approval_cancelled), a pending break glass grant or mandate is rejected. A request that is no longer pending answers 409 approval_closed. Writes the audit event approval.cancel with the reason. The answer carries run_state when a run is attached.

Route: /v1/approvals/{approval_id}/cancel (POST).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the approval request.
bodyObjectyesReason of the cancellation.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Cancel an approval request".

Raises: the typed errors of the transport (Errors).

ApprovalsClient.create​

JsonNode create(Object body)

Request an approval. Creates a pending approval request. Needs tenant_admin, developer, agent, security_officer or finops.

Route: /v1/approvals (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesAction, resource, quorum, approvers and expiry of the request.

Returns: JsonNode. Decoded JSON answer of the operation "Request an approval".

Raises: the typed errors of the transport (Errors).

ApprovalsClient.create​

JsonNode create(Object body, RequestOptions options)

Request an approval. Creates a pending approval request. Needs tenant_admin, developer, agent, security_officer or finops.

Route: /v1/approvals (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesAction, resource, quorum, approvers and expiry of the request.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Request an approval".

Raises: the typed errors of the transport (Errors).

ApprovalsClient.decide​

JsonNode decide(String id, Object body)

Approve or reject a request. Records the decision of the caller on a pending request.

Route: /v1/approvals/{approval_id}/decide (POST).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the approval request.
bodyObjectyesDecision and optional comment.

Returns: JsonNode. Decoded JSON answer of the operation "Approve or reject a request".

Raises: the typed errors of the transport (Errors).

ApprovalsClient.decide​

JsonNode decide(String id, Object body, RequestOptions options)

Approve or reject a request. Records the decision of the caller on a pending request.

Route: /v1/approvals/{approval_id}/decide (POST).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the approval request.
bodyObjectyesDecision and optional comment.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Approve or reject a request".

Raises: the typed errors of the transport (Errors).

ApprovalsClient.get​

JsonNode get(String id)

Get an approval request. Returns one approval request with its decisions (approver, decision, comment, date) and approvals_count. A pending request past its expiry is marked expired and its waiting run is failed. Open to any member of the tenant. Answers 404 approval_not_found.

Route: /v1/approvals/{approval_id} (GET).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the approval request.

Returns: JsonNode. Decoded JSON answer of the operation "Get an approval request".

Raises: the typed errors of the transport (Errors).

ApprovalsClient.list​

Page<JsonNode> list()

List the approval requests. Lists the approval requests of the tenant, newest first, paginated, optionally filtered by status. Pending requests past their expiry are marked expired first. Each item carries its decisions and approvals_count. Open to any member of the tenant.

Route: /v1/approvals (GET).

This element takes no parameter.

Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).

Raises: the typed errors of the transport (Errors).

ApprovalsClient.list​

Page<JsonNode> list(Map<String, ?> query)

List the approval requests. Lists the approval requests of the tenant, newest first, paginated, optionally filtered by status. Pending requests past their expiry are marked expired first. Each item carries its decisions and approvals_count. Open to any member of the tenant.

Route: /v1/approvals (GET).

NameTypeDefaultRequiredDescription
queryMap<String, ?>yesQuery 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).