Skip to main content

io.enterpriseai.resources.ProjectsClient

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

Projects and their environments.

Constructor ProjectsClient​

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

ProjectsClient.create​

JsonNode create(Object body)

Create a project. Creates a project in the tenant of the caller. Needs tenant_admin.

Route: /v1/projects (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesSlug, name, settings, environments and attachment of the project.

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

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

ProjectsClient.create​

JsonNode create(Object body, RequestOptions options)

Create a project. Creates a project in the tenant of the caller. Needs tenant_admin.

Route: /v1/projects (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesSlug, name, settings, environments and attachment of the project.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

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

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

ProjectsClient.createEnvironment​

JsonNode createEnvironment(String id, Object body)

Create an environment. Adds an environment (dev, test, staging or prod) to the project. Needs tenant_admin and the relation editor on the project. An environment that already exists answers 409 conflict. Writes the audit event environment.create.

Route: /v1/projects/{project_id}/environments (POST).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the project.
bodyObjectyesName and settings of the environment.

Returns: JsonNode. Decoded JSON answer of the operation "Create an environment".

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

ProjectsClient.createEnvironment​

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

Create an environment. Adds an environment (dev, test, staging or prod) to the project. Needs tenant_admin and the relation editor on the project. An environment that already exists answers 409 conflict. Writes the audit event environment.create.

Route: /v1/projects/{project_id}/environments (POST).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the project.
bodyObjectyesName and settings of the environment.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Create an environment".

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

ProjectsClient.delete​

void delete(String id)

Delete a project. Deletes the project and its environments. Needs tenant_admin and the relation owner on the project (403 relation_required). Objects that still reference the project may block the deletion (409 conflict). Writes the audit event project.delete. Answers 204.

Route: /v1/projects/{project_id} (DELETE).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the project.

Returns: void.

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

ProjectsClient.get​

JsonNode get(String id)

Get a project. Returns the project with its environments. Needs the relation viewer on the project (403 relation_required, audited). Answers 404 not_found for an unknown project.

Route: /v1/projects/{project_id} (GET).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the project.

Returns: JsonNode. Decoded JSON answer of the operation "Get a project".

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

ProjectsClient.list​

Page<JsonNode> list()

List the projects. Lists the projects of the tenant ordered by slug, paginated, optionally filtered by organization or business unit. Open to any member of the tenant.

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

ProjectsClient.list​

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

List the projects. Lists the projects of the tenant ordered by slug, paginated, optionally filtered by organization or business unit. Open to any member of the tenant.

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

ProjectsClient.listEnvironments​

Page<JsonNode> listEnvironments(String id)

List the environments of a project. Lists the environments of the project, ordered by name. Needs the relation viewer on the project. Not paginated: next_cursor is always null.

Route: /v1/projects/{project_id}/environments (GET).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the project.

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

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

ProjectsClient.update​

JsonNode update(String id, Object body)

Update a project. Changes the name, description, settings, metadata or attachment of a project. Sending organization_id or business_unit_id as null detaches the project. The unit must belong to the organization (422 invalid_hierarchy). Needs tenant_admin and the relation editor on the project. Send expected_version to detect a concurrent change (409 version_conflict). Writes the audit event project.update.

Route: /v1/projects/{project_id} (PATCH).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the project.
bodyObjectyesFields to change; omitted fields keep their value.

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

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

ProjectsClient.update​

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

Update a project. Changes the name, description, settings, metadata or attachment of a project. Sending organization_id or business_unit_id as null detaches the project. The unit must belong to the organization (422 invalid_hierarchy). Needs tenant_admin and the relation editor on the project. Send expected_version to detect a concurrent change (409 version_conflict). Writes the audit event project.update.

Route: /v1/projects/{project_id} (PATCH).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the project.
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 project".

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