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.
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.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
transport | Transport | yes | Transport 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).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
body | Object | yes | Organization, 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).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
body | Object | yes | Organization, parent, slug, name and description of the unit. | |
options | RequestOptions | yes | Per 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).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
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).
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).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
businessUnitId | String | yes | Identifier (UUID) of the business unit. | |
body | Object | yes | Fields 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).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
businessUnitId | String | yes | Identifier (UUID) of the business unit. | |
body | Object | yes | Fields to change; omitted fields keep their value. | |
options | RequestOptions | yes | Per 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).