# Google Cloud Iam V2 Client - Class UpdatePolicyRequest (1.3.0)

1.3.0 (latest) 1.2.2 1.1.1 1.0.3 0.5.5 0.4.2 0.3.1 0.2.0 0.1.7 Reference documentation and code samples for the Google Cloud Iam V2 Client class UpdatePolicyRequest.

Request message for `UpdatePolicy`.

Generated from protobuf message `google.iam.v2.UpdatePolicyRequest`

## Namespace

Google \\ Cloud \\ Iam \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-iam/latest/V2.Policy` Required. The policy to update. To prevent conflicting updates, the `etag` value must match the value that is stored in IAM. If the `etag` values do not match, the request fails with a `409` error code and `ABORTED` status. |

### getPolicy

Required. The policy to update.

To prevent conflicting updates, the `etag` value must match the value that
is stored in IAM. If the `etag` values do not match, the request fails with
a `409` error code and `ABORTED` status.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-iam/latest/V2.Policy|null` |   |

### hasPolicy

### clearPolicy

### setPolicy

Required. The policy to update.

To prevent conflicting updates, the `etag` value must match the value that
is stored in IAM. If the `etag` values do not match, the request fails with
a `409` error code and `ABORTED` status.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-iam/latest/V2.Policy` |

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