# Google Cloud Assured Workloads V1beta1 Client - Class CreateWorkloadRequest (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

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Cloud Assured Workloads V1beta1 Client class CreateWorkloadRequest.

Request for creating a workload.

Generated from protobuf message `google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest`

## Namespace

Google \\ Cloud \\ AssuredWorkloads \\ V1beta1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The resource name of the new Workload's parent. Must be of the form `organizations/{org_id}/locations/{location_id}`. |
| `↳ workload` | `https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1beta1.Workload` Required. Assured Workload to create |
| `↳ external_id` | `string` Optional. A identifier associated with the workload and underlying projects which allows for the break down of billing costs for a workload. The value provided for the identifier will add a label to the workload and contained projects with the identifier as the value. |

### getParent

Required. The resource name of the new Workload's parent.

Must be of the form `organizations/{org_id}/locations/{location_id}`.

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

### setParent

Required. The resource name of the new Workload's parent.

Must be of the form `organizations/{org_id}/locations/{location_id}`.

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

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

### getWorkload

Required. Assured Workload to create

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

### hasWorkload

### clearWorkload

### setWorkload

Required. Assured Workload to create

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

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

### getExternalId

Optional. A identifier associated with the workload and underlying projects which
allows for the break down of billing costs for a workload. The value
provided for the identifier will add a label to the workload and contained
projects with the identifier as the value.

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

### setExternalId

Optional. A identifier associated with the workload and underlying projects which
allows for the break down of billing costs for a workload. The value
provided for the identifier will add a label to the workload and contained
projects with the identifier as the value.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The resource name of the new Workload's parent. Must be of the form `organizations/{org_id}/locations/{location_id}`. Please see AssuredWorkloadsServiceClient::locationName() for help formatting this field. |
| `workload` | `https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1beta1.Workload` Required. Assured Workload to create |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-assured-workloads/latest/V1beta1.CreateWorkloadRequest` |   |