# Google Cloud Org Policy V2 Client - Class AlternatePolicySpec (1.3.3)

1.3.3 (latest) 1.3.2 1.2.2 1.1.3 1.0.0 0.7.0 0.6.5 0.5.3 0.4.2 0.3.7 Reference documentation and code samples for the Google Cloud Org Policy V2 Client class AlternatePolicySpec.

Similar to PolicySpec but with an extra 'launch' field for launch reference.

The PolicySpec here is specific for dry-run.

Generated from protobuf message `google.cloud.orgpolicy.v2.AlternatePolicySpec`

## Namespace

Google \\ Cloud \\ OrgPolicy \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ launch` | `string` Reference to the launch that will be used while audit logging and to control the launch. Should be set only in the alternate policy. |
| `↳ spec` | `https://docs.cloud.google.com/php/docs/reference/cloud-org-policy/latest/V2.PolicySpec` Specify constraint for configurations of Google Cloud resources. |

### getLaunch

Reference to the launch that will be used while audit logging and to
control the launch.

Should be set only in the alternate policy.

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

### setLaunch

Reference to the launch that will be used while audit logging and to
control the launch.

Should be set only in the alternate policy.

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

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

### getSpec

Specify constraint for configurations of Google Cloud resources.

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

### hasSpec

### clearSpec

### setSpec

Specify constraint for configurations of Google Cloud resources.

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

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