# Google Cloud OsConfig V1 Client - Class PatchDeployment (2.2.3)

2.2.3 (latest) 2.2.2 2.1.0 2.0.5 1.3.5 1.2.2 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud OsConfig V1 Client class PatchDeployment.

Patch deployments are configurations that individual patch jobs use to
complete a patch. These configurations include instance filter, package
repository settings, and a schedule. For more information about creating and
managing patch deployments, see [Scheduling patch
jobs](https://cloud.google.com/compute/docs/os-patch-management/schedule-patch-jobs).

Generated from protobuf message `google.cloud.osconfig.v1.PatchDeployment`

## Namespace

Google \\ Cloud \\ OsConfig \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Unique name for the patch deployment resource in a project. The patch deployment name is in the form: `projects/{project_id}/patchDeployments/{patch_deployment_id}`. This field is ignored when you create a new patch deployment. |
| `↳ description` | `string` Optional. Description of the patch deployment. Length of the description is limited to 1024 characters. |
| `↳ instance_filter` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.PatchInstanceFilter` Required. VM instances to patch. |
| `↳ patch_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.PatchConfig` Optional. Patch configuration that is applied. |
| `↳ duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Optional. Duration of the patch. After the duration ends, the patch times out. |
| `↳ one_time_schedule` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OneTimeSchedule` Required. Schedule a one-time execution. |
| `↳ recurring_schedule` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.RecurringSchedule` Required. Schedule recurring executions. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Time the patch deployment was created. Timestamp is in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Time the patch deployment was last updated. Timestamp is in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. |
| `↳ last_execute_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The last time a patch job was started by this deployment. Timestamp is in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. |
| `↳ rollout` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.PatchRollout` Optional. Rollout strategy of the patch job. |
| `↳ state` | `int` Output only. Current state of the patch deployment. |

### getName

Unique name for the patch deployment resource in a project. The patch
deployment name is in the form:
`projects/{project_id}/patchDeployments/{patch_deployment_id}`.

This field is ignored when you create a new patch deployment.

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

### setName

Unique name for the patch deployment resource in a project. The patch
deployment name is in the form:
`projects/{project_id}/patchDeployments/{patch_deployment_id}`.

This field is ignored when you create a new patch deployment.

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

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

### getDescription

Optional. Description of the patch deployment. Length of the description is
limited to 1024 characters.

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

### setDescription

Optional. Description of the patch deployment. Length of the description is
limited to 1024 characters.

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

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

### getInstanceFilter

Required. VM instances to patch.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.PatchInstanceFilter|null` |   |

### hasInstanceFilter

### clearInstanceFilter

### setInstanceFilter

Required. VM instances to patch.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.PatchInstanceFilter` |

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

### getPatchConfig

Optional. Patch configuration that is applied.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.PatchConfig|null` |   |

### hasPatchConfig

### clearPatchConfig

### setPatchConfig

Optional. Patch configuration that is applied.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.PatchConfig` |

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

### getDuration

Optional. Duration of the patch. After the duration ends, the patch times
out.

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

### hasDuration

### clearDuration

### setDuration

Optional. Duration of the patch. After the duration ends, the patch times
out.

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

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

### getOneTimeSchedule

Required. Schedule a one-time execution.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OneTimeSchedule|null` |   |

### hasOneTimeSchedule

### setOneTimeSchedule

Required. Schedule a one-time execution.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OneTimeSchedule` |

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

### getRecurringSchedule

Required. Schedule recurring executions.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.RecurringSchedule|null` |   |

### hasRecurringSchedule

### setRecurringSchedule

Required. Schedule recurring executions.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.RecurringSchedule` |

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

### getCreateTime

Output only. Time the patch deployment was created. Timestamp is in
[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. Time the patch deployment was created. Timestamp is in
[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.

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

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

### getUpdateTime

Output only. Time the patch deployment was last updated. Timestamp is in
[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. Time the patch deployment was last updated. Timestamp is in
[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.

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

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

### getLastExecuteTime

Output only. The last time a patch job was started by this deployment.

Timestamp is in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text
format.

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

### hasLastExecuteTime

### clearLastExecuteTime

### setLastExecuteTime

Output only. The last time a patch job was started by this deployment.

Timestamp is in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text
format.

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

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

### getRollout

Optional. Rollout strategy of the patch job.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.PatchRollout|null` |   |

### hasRollout

### clearRollout

### setRollout

Optional. Rollout strategy of the patch job.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.PatchRollout` |

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

### getState

Output only. Current state of the patch deployment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.PatchDeployment.State). |

### setState

Output only. Current state of the patch deployment.

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

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

### getSchedule

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