# REST Resource: services.tenancyUnits

- [Resource: TenancyUnit](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#TenancyUnit)
  - [JSON representation](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#TenancyUnit.SCHEMA_REPRESENTATION)
- [TenantResource](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#TenantResource)
  - [JSON representation](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#TenantResource.SCHEMA_REPRESENTATION)
- [Status](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#Status)
- [Methods](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#METHODS_SUMMARY)

## Resource: TenancyUnit

Representation of a tenancy unit.

| JSON representation ||
|---|---|
| ``` { "name": string, "service": string, "consumer": string, "createTime": string, "tenantResources": [ { object (`https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#TenantResource`) } ] } ``` |

| Fields ||
|---|---|
| `name` | `string` Globally unique identifier of this tenancy unit "services/{service}/{collection id}/{resource id}/tenancyUnits/{unit}" |
| `service` | `string` Output only. Google Cloud API name of the managed service owning this tenancy unit. For example 'serviceconsumermanagement.googleapis.com'. |
| `consumer` | `string` Cloud resource name of the consumer of this service. For example 'projects/123456'. Note: This field is used in responses only. Any value specified here in a request is ignored. |
| `createTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` The time this tenancy unit was created. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: `"2014-10-02T15:01:23.045123456Z"`. Note: This field is used in responses only. Any value specified here in a request is ignored. |
| `tenantResources[]` | ``object (`https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#TenantResource`)`` Resources constituting the tenancy unit. There can be at most 512 tenant resources in a tenancy unit. |

## TenantResource

Resource constituting the TenancyUnit.

| JSON representation ||
|---|---|
| ``` { "tag": string, "resource": string, "status": enum (`https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#Status`) } ``` |

| Fields ||
|---|---|
| `tag` | `string` Unique per single tenancy unit. |
| `resource` | `string` Identifier of the tenant resource. For cloud projects, it is in the form 'projects/{number}'. For example 'projects/123456'. Note: This field is used in responses only. Any value specified here in a request is ignored. |
| `status` | ``enum (`https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#Status`)`` Status of tenant resource. |

## Status

The status of tenant resources.

| Enums ||
|---|---|
| `STATUS_UNSPECIFIED` | Unspecified status is the default unset value. |
| `PENDING_CREATE` | Creation of the tenant resource is ongoing. |
| `ACTIVE` | Active resource. |
| `PENDING_DELETE` | Deletion of the resource is ongoing. |
| `FAILED` | Tenant resource creation or deletion has failed. |
| `DELETED` | Tenant resource has been deleted. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/addProject` | Add a new tenant project to the tenancy unit. |
| ### `https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/applyProjectConfig` | Apply a configuration to an existing tenant project. |
| ### `https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/attachProject` | Attach an existing project to the tenancy unit as a new tenant resource. |
| ### `https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/create` | Creates a tenancy unit with no tenant resources. |
| ### `https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/delete` | Delete a tenancy unit. |
| ### `https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/deleteProject` | Deletes the specified project resource identified by a tenant resource tag. |
| ### `https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/list` | Find the tenancy unit for a managed service and service consumer. |
| ### `https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/removeProject` | Removes the specified project resource identified by a tenant resource tag. |
| ### `https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits/undeleteProject` | Attempts to undelete a previously deleted tenant project. |