# Google Cloud Assured Workloads V1 Client - Class Workload (1.1.3)

1.1.3 (latest) 1.1.2 1.0.5 0.11.5 0.10.2 0.9.1 0.8.3 0.7.3 Reference documentation and code samples for the Google Cloud Assured Workloads V1 Client class Workload.

A Workload object for managing highly regulated workloads of cloud
customers.

Generated from protobuf message `google.cloud.assuredworkloads.v1.Workload`

## Namespace

Google \\ Cloud \\ AssuredWorkloads \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Optional. The resource name of the workload. Format: organizations/{organization}/locations/{location}/workloads/{workload} Read-only. |
| `↳ display_name` | `string` Required. The user-assigned display name of the Workload. When present it must be between 4 to 30 characters. Allowed characters are: lowercase and uppercase letters, numbers, hyphen, and spaces. Example: My Workload |
| `↳ resources` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.ResourceInfo>` Output only. The resources associated with this workload. These resources will be created when creating the workload. If any of the projects already exist, the workload creation will fail. Always read only. |
| `↳ compliance_regime` | `int` Required. Immutable. Compliance Regime associated with this workload. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Immutable. The Workload creation timestamp. |
| `↳ billing_account` | `string` Optional. The billing account used for the resources which are direct children of workload. This billing account is initially associated with the resources created as part of Workload creation. After the initial creation of these resources, the customer can change the assigned billing account. The resource name has the form `billingAccounts/{billing_account_id}`. For example, `billingAccounts/012345-567890-ABCDEF`. |
| `↳ etag` | `string` Optional. ETag of the workload, it is calculated on the basis of the Workload contents. It will be used in Update \& Delete operations. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. Labels applied to the workload. |
| `↳ provisioned_resources_parent` | `string` Input only. The parent resource for the resources managed by this Assured Workload. May be either empty or a folder resource which is a child of the Workload parent. If not specified all resources are created under the parent organization. Format: folders/{folder_id} |
| `↳ kms_settings` | `Workload\KMSSettings` Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS CMEK key is provisioned. This field is deprecated as of Feb 28, 2022. In order to create a Keyring, callers should specify, ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. |
| `↳ resource_settings` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.ResourceSettings>` Input only. Resource properties that are used to customize workload resources. These properties (such as custom project id) will be used to create workload resources if possible. This field is optional. |
| `↳ kaj_enrollment_state` | `int` Output only. Represents the KAJ enrollment state of the given workload. |
| `↳ enable_sovereign_controls` | `bool` Optional. Indicates the sovereignty status of the given workload. Currently meant to be used by Europe/Canada customers. |
| `↳ saa_enrollment_response` | `https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.SaaEnrollmentResponse` Output only. Represents the SAA enrollment response of the given workload. SAA enrollment response is queried during GetWorkload call. In failure cases, user friendly error message is shown in SAA details page. |
| `↳ compliant_but_disallowed_services` | `string[]` Output only. Urls for services which are compliant for this Assured Workload, but which are currently disallowed by the ResourceUsageRestriction org policy. Invoke RestrictAllowedResources endpoint to allow your project developers to use these services in their environment." |
| `↳ partner` | `int` Optional. Compliance Regime associated with this workload. |

### getName

Optional. The resource name of the workload.

Format:
organizations/{organization}/locations/{location}/workloads/{workload}
Read-only.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Optional. The resource name of the workload.

Format:
organizations/{organization}/locations/{location}/workloads/{workload}
Read-only.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDisplayName

Required. The user-assigned display name of the Workload.

When present it must be between 4 to 30 characters.
Allowed characters are: lowercase and uppercase letters, numbers,
hyphen, and spaces.
Example: My Workload

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDisplayName

Required. The user-assigned display name of the Workload.

When present it must be between 4 to 30 characters.
Allowed characters are: lowercase and uppercase letters, numbers,
hyphen, and spaces.
Example: My Workload

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResources

Output only. The resources associated with this workload.

These resources will be created when creating the workload.
If any of the projects already exist, the workload creation will fail.
Always read only.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.ResourceInfo>` |   |

### setResources

Output only. The resources associated with this workload.

These resources will be created when creating the workload.
If any of the projects already exist, the workload creation will fail.
Always read only.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.ResourceInfo>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getComplianceRegime

Required. Immutable. Compliance Regime associated with this workload.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ComplianceRegime](https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.ComplianceRegime). |

### setComplianceRegime

Required. Immutable. Compliance Regime associated with this workload.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ComplianceRegime](https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.ComplianceRegime). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreateTime

Output only. Immutable. The Workload creation timestamp.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. Immutable. The Workload creation timestamp.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBillingAccount

Optional. The billing account used for the resources which are
direct children of workload. This billing account is initially associated
with the resources created as part of Workload creation.

After the initial creation of these resources, the customer can change
the assigned billing account.
The resource name has the form
`billingAccounts/{billing_account_id}`. For example,
`billingAccounts/012345-567890-ABCDEF`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setBillingAccount

Optional. The billing account used for the resources which are
direct children of workload. This billing account is initially associated
with the resources created as part of Workload creation.

After the initial creation of these resources, the customer can change
the assigned billing account.
The resource name has the form
`billingAccounts/{billing_account_id}`. For example,
`billingAccounts/012345-567890-ABCDEF`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEtag

Optional. ETag of the workload, it is calculated on the basis
of the Workload contents. It will be used in Update \& Delete operations.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setEtag

Optional. ETag of the workload, it is calculated on the basis
of the Workload contents. It will be used in Update \& Delete operations.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLabels

Optional. Labels applied to the workload.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Optional. Labels applied to the workload.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getProvisionedResourcesParent

Input only. The parent resource for the resources managed by this Assured Workload. May
be either empty or a folder resource which is a child of the
Workload parent. If not specified all resources are created under the
parent organization.

Format:
folders/{folder_id}

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setProvisionedResourcesParent

Input only. The parent resource for the resources managed by this Assured Workload. May
be either empty or a folder resource which is a child of the
Workload parent. If not specified all resources are created under the
parent organization.

Format:
folders/{folder_id}

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getKmsSettings

Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
CMEK key is provisioned.

This field is deprecated as of Feb 28, 2022.
In order to create a Keyring, callers should specify,
ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Workload\KMSSettings|null` |   |

### hasKmsSettings

### clearKmsSettings

### setKmsSettings

Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
CMEK key is provisioned.

This field is deprecated as of Feb 28, 2022.
In order to create a Keyring, callers should specify,
ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Workload\KMSSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResourceSettings

Input only. Resource properties that are used to customize workload resources.

These properties (such as custom project id) will be used to create
workload resources if possible. This field is optional.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.ResourceSettings>` |   |

### setResourceSettings

Input only. Resource properties that are used to customize workload resources.

These properties (such as custom project id) will be used to create
workload resources if possible. This field is optional.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.ResourceSettings>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getKajEnrollmentState

Output only. Represents the KAJ enrollment state of the given workload.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [KajEnrollmentState](https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.KajEnrollmentState). |

### setKajEnrollmentState

Output only. Represents the KAJ enrollment state of the given workload.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [KajEnrollmentState](https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.KajEnrollmentState). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEnableSovereignControls

Optional. Indicates the sovereignty status of the given workload.

Currently meant to be used by Europe/Canada customers.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setEnableSovereignControls

Optional. Indicates the sovereignty status of the given workload.

Currently meant to be used by Europe/Canada customers.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSaaEnrollmentResponse

Output only. Represents the SAA enrollment response of the given workload.

SAA enrollment response is queried during GetWorkload call.
In failure cases, user friendly error message is shown in SAA details page.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.SaaEnrollmentResponse|null` |   |

### hasSaaEnrollmentResponse

### clearSaaEnrollmentResponse

### setSaaEnrollmentResponse

Output only. Represents the SAA enrollment response of the given workload.

SAA enrollment response is queried during GetWorkload call.
In failure cases, user friendly error message is shown in SAA details page.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.SaaEnrollmentResponse` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCompliantButDisallowedServices

Output only. Urls for services which are compliant for this Assured Workload, but which
are currently disallowed by the ResourceUsageRestriction org policy.

Invoke RestrictAllowedResources endpoint to allow your project developers
to use these services in their environment."

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setCompliantButDisallowedServices

Output only. Urls for services which are compliant for this Assured Workload, but which
are currently disallowed by the ResourceUsageRestriction org policy.

Invoke RestrictAllowedResources endpoint to allow your project developers
to use these services in their environment."

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPartner

Optional. Compliance Regime associated with this workload.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Partner](https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.Partner). |

### setPartner

Optional. Compliance Regime associated with this workload.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Partner](https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1.Workload.Partner). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |