Skip to main content

io.enterpriseai.resources.BusinessUnitsClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/BusinessUnitsClient.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 BusinessUnitsClient​

Business units of an organization, optionally nested (tenant hierarchy, ADR-0156).

Constructor BusinessUnitsClient​

BusinessUnitsClient(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.

BusinessUnitsClient.create​

JsonNode create(Object body)

Create a business unit. Creates a business unit in an organization, optionally under a parent unit of the same organization (422 invalid_hierarchy otherwise). Needs tenant_admin. A slug already used answers 409 conflict. Writes the audit event business_unit.create.

Route: /v1/business-units (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesOrganization, parent, slug, name and description of the unit.

Returns: JsonNode. Decoded JSON answer of the operation "Create a business unit".

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

BusinessUnitsClient.create​

JsonNode create(Object body, RequestOptions options)

Create a business unit. Creates a business unit in an organization, optionally under a parent unit of the same organization (422 invalid_hierarchy otherwise). Needs tenant_admin. A slug already used answers 409 conflict. Writes the audit event business_unit.create.

Route: /v1/business-units (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesOrganization, parent, slug, name and description of the unit.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Create a business unit".

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

BusinessUnitsClient.list​

Page<JsonNode> list()

List the business units. Lists the business units of the tenant, paginated, optionally filtered by organization or by parent unit. Open to any member of the tenant.

Route: /v1/business-units (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).

BusinessUnitsClient.list​

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

List the business units. Lists the business units of the tenant, paginated, optionally filtered by organization or by parent unit. Open to any member of the tenant.

Route: /v1/business-units (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).

BusinessUnitsClient.update​

JsonNode update(String businessUnitId, Object body)

Update a business unit. Changes the name, description, status (active or archived) or metadata of a business unit. Its organization and parent cannot change. Needs tenant_admin. Send expected_version to detect a concurrent change (409 version_conflict). Writes the audit event business_unit.update.

Route: /v1/business-units/{business_unit_id} (PATCH).

NameTypeDefaultRequiredDescription
businessUnitIdStringyesIdentifier (UUID) of the business unit.
bodyObjectyesFields to change; omitted fields keep their value.

Returns: JsonNode. Decoded JSON answer of the operation "Update a business unit".

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

BusinessUnitsClient.update​

JsonNode update(String businessUnitId, Object body, RequestOptions options)

Update a business unit. Changes the name, description, status (active or archived) or metadata of a business unit. Its organization and parent cannot change. Needs tenant_admin. Send expected_version to detect a concurrent change (409 version_conflict). Writes the audit event business_unit.update.

Route: /v1/business-units/{business_unit_id} (PATCH).

NameTypeDefaultRequiredDescription
businessUnitIdStringyesIdentifier (UUID) of the business unit.
bodyObjectyesFields to change; omitted fields keep their value.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Update a business unit".

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