Skip to main content

tenancy_hierarchy.go (package eai)

Source: sdks/go/tenancy_hierarchy.go. Back to the Go 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 OrganizationsService​

OrganizationsService groups the endpoints of: Organizations of the tenant (tenant hierarchy, ADR-0156).

OrganizationsService.Create​

Create(ctx context.Context, body any, opts ...CallOption) (json.RawMessage, error)

Create an organization. Creates an organization in the tenant. Needs tenant_admin. A slug already used answers 409 conflict. Writes the audit event organization.create.

Route: /v1/organizations (POST).

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
bodyanyyesSlug, name, description and metadata of the organization.
opts...CallOptionnoPer call options (query, idempotency key, traceparent, headers).

Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Create an organization". The error is a typed error of the SDK, nil on success.

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

OrganizationsService.List​

List(ctx context.Context, opts ...CallOption) (*Page, error)

List the organizations. Lists the organizations of the tenant, paginated. Open to any member of the tenant.

Route: /v1/organizations (GET).

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
opts...CallOptionnoPer call options (query, idempotency key, traceparent, headers).

Returns: (*Page, error). A Page: Page is one page of a cursor paginated collection {"items": [...], "next_cursor": "..."|null}. The error is a typed error of the SDK, nil on success.

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

OrganizationsService.Update​

Update(ctx context.Context, organizationID string, body any, opts ...CallOption) (json.RawMessage, error)

Update an organization. Changes the name, description, status (active or archived) or metadata of an organization. Needs tenant_admin. Send expected_version to detect a concurrent change (409 version_conflict). Writes the audit event organization.update.

Route: /v1/organizations/{organization_id} (PATCH).

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
organizationIDstringyesIdentifier (UUID) of the organization.
bodyanyyesFields to change; omitted fields keep their value.
opts...CallOptionnoPer call options (query, idempotency key, traceparent, headers).

Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Update an organization". The error is a typed error of the SDK, nil on success.

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

Class BusinessUnitsService​

BusinessUnitsService groups the endpoints of: Business units of an organization (tenant hierarchy, ADR-0156).

BusinessUnitsService.Create​

Create(ctx context.Context, body any, opts ...CallOption) (json.RawMessage, error)

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
ctxcontext.ContextyesContext of the call: cancellation and deadline.
bodyanyyesOrganization, parent, slug, name and description of the unit.
opts...CallOptionnoPer call options (query, idempotency key, traceparent, headers).

Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Create a business unit". The error is a typed error of the SDK, nil on success.

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

BusinessUnitsService.List​

List(ctx context.Context, opts ...CallOption) (*Page, error)

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
ctxcontext.ContextyesContext of the call: cancellation and deadline.
opts...CallOptionnoPer call options (query, idempotency key, traceparent, headers).

Returns: (*Page, error). A Page: Page is one page of a cursor paginated collection {"items": [...], "next_cursor": "..."|null}. The error is a typed error of the SDK, nil on success.

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

BusinessUnitsService.Update​

Update(ctx context.Context, businessUnitID string, body any, opts ...CallOption) (json.RawMessage, error)

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
ctxcontext.ContextyesContext of the call: cancellation and deadline.
businessUnitIDstringyesIdentifier (UUID) of the business unit.
bodyanyyesFields to change; omitted fields keep their value.
opts...CallOptionnoPer call options (query, idempotency key, traceparent, headers).

Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Update a business unit". The error is a typed error of the SDK, nil on success.

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