# Google Cloud Config V1 Client - Class Preview (1.8.0)

1.8.0 (latest) 1.7.2 1.6.1 1.5.0 1.4.1 1.3.0 1.2.1 1.1.0 1.0.1 0.5.2 0.2.0 0.1.3 Reference documentation and code samples for the Google Cloud Config V1 Client class Preview.

A preview represents a set of actions Infra Manager would perform
to move the resources towards the desired state as specified in the
configuration.

Generated from protobuf message `google.cloud.config.v1.Preview`

## Namespace

Google \\ Cloud \\ Config \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ terraform_blueprint` | `https://docs.cloud.google.com/php/docs/reference/cloud-config/latest/V1.TerraformBlueprint` The terraform blueprint to preview. |
| `↳ name` | `string` Identifier. Resource name of the preview. Resource name can be user provided or server generated ID if unspecified. Format: `projects/{project}/locations/{location}/previews/{preview}` |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Time the preview was created. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. User-defined labels for the preview. |
| `↳ state` | `int` Output only. Current state of the preview. |
| `↳ deployment` | `string` Optional. Optional deployment reference. If specified, the preview will be performed using the provided deployment's current state and use any relevant fields from the deployment unless explicitly specified in the preview create request. |
| `↳ preview_mode` | `int` Optional. Current mode of preview. |
| `↳ service_account` | `string` Required. User-specified Service Account (SA) credentials to be used when previewing resources. Format: `projects/{projectID}/serviceAccounts/{serviceAccount}` |
| `↳ artifacts_gcs_bucket` | `string` Optional. User-defined location of Cloud Build logs, artifacts, and in Google Cloud Storage. Format: `gs://{bucket}/{folder}` A default bucket will be bootstrapped if the field is not set or empty Default Bucket Format: `gs://<project number>-<region>-blueprint-config` Constraints: - The bucket needs to be in the same project as the deployment - The path cannot be within the path of `gcs_source` If omitted and deployment resource ref provided has artifacts_gcs_bucket defined, that artifact bucket is used. |
| `↳ worker_pool` | `string` Optional. The user-specified Worker Pool resource in which the Cloud Build job will execute. Format projects/{project}/locations/{location}/workerPools/{workerPoolId} If this field is unspecified, the default Cloud Build worker pool will be used. If omitted and deployment resource ref provided has worker_pool defined, that worker pool is used. |
| `↳ error_code` | `int` Output only. Code describing any errors that may have occurred. |
| `↳ error_status` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` Output only. Additional information regarding the current state. |
| `↳ build` | `string` Output only. Cloud Build instance UUID associated with this preview. |
| `↳ tf_errors` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-config/latest/V1.TerraformError>` Output only. Summary of errors encountered during Terraform preview. It has a size limit of 10, i.e. only top 10 errors will be summarized here. |
| `↳ error_logs` | `string` Output only. Link to tf-error.ndjson file, which contains the full list of the errors encountered during a Terraform preview. Format: `gs://{bucket}/{object}`. |
| `↳ preview_artifacts` | `https://docs.cloud.google.com/php/docs/reference/cloud-config/latest/V1.PreviewArtifacts` Output only. Artifacts from preview. |
| `↳ logs` | `string` Output only. Location of preview logs in `gs://{bucket}/{object}` format. |
| `↳ tf_version` | `string` Output only. The current Terraform version set on the preview. It is in the format of "Major.Minor.Patch", for example, "1.3.10". |
| `↳ tf_version_constraint` | `string` Optional. The user-specified Terraform version constraint. Example: "=1.3.10". |
| `↳ annotations` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. Arbitrary key-value metadata storage e.g. to help client tools identify preview during automation. See <https://google.aip.dev/148#annotations> for details on format and size limitations. |
| `↳ provider_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-config/latest/V1.ProviderConfig` Optional. This field specifies the provider configurations. |

### getTerraformBlueprint

The terraform blueprint to preview.

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

### hasTerraformBlueprint

### setTerraformBlueprint

The terraform blueprint to preview.

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

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

### getName

Identifier. Resource name of the preview. Resource name can be user
provided or server generated ID if unspecified. Format:
`projects/{project}/locations/{location}/previews/{preview}`

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

### setName

Identifier. Resource name of the preview. Resource name can be user
provided or server generated ID if unspecified. Format:
`projects/{project}/locations/{location}/previews/{preview}`

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

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

### getCreateTime

Output only. Time the preview was created.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. Time the preview was created.

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

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

### getLabels

Optional. User-defined labels for the preview.

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

### setLabels

Optional. User-defined labels for the preview.

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

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

### getState

Output only. Current state of the preview.

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

### setState

Output only. Current state of the preview.

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

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

### getDeployment

Optional. Optional deployment reference. If specified, the preview will be
performed using the provided deployment's current state and use any
relevant fields from the deployment unless explicitly specified in the
preview create request.

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

### setDeployment

Optional. Optional deployment reference. If specified, the preview will be
performed using the provided deployment's current state and use any
relevant fields from the deployment unless explicitly specified in the
preview create request.

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

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

### getPreviewMode

Optional. Current mode of preview.

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

### setPreviewMode

Optional. Current mode of preview.

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

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

### getServiceAccount

Required. User-specified Service Account (SA) credentials to be used when
previewing resources.

Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`

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

### setServiceAccount

Required. User-specified Service Account (SA) credentials to be used when
previewing resources.

Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`

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

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

### getArtifactsGcsBucket

Optional. User-defined location of Cloud Build logs, artifacts, and
in Google Cloud Storage.

Format: `gs://{bucket}/{folder}`
A default bucket will be bootstrapped if the field is not set or empty
Default Bucket Format: `gs://<project number>-<region>-blueprint-config`
Constraints:

- The bucket needs to be in the same project as the deployment
- The path cannot be within the path of `gcs_source` If omitted and deployment resource ref provided has artifacts_gcs_bucket defined, that artifact bucket is used.

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

### hasArtifactsGcsBucket

### clearArtifactsGcsBucket

### setArtifactsGcsBucket

Optional. User-defined location of Cloud Build logs, artifacts, and
in Google Cloud Storage.

Format: `gs://{bucket}/{folder}`
A default bucket will be bootstrapped if the field is not set or empty
Default Bucket Format: `gs://<project number>-<region>-blueprint-config`
Constraints:

- The bucket needs to be in the same project as the deployment
- The path cannot be within the path of `gcs_source` If omitted and deployment resource ref provided has artifacts_gcs_bucket defined, that artifact bucket is used.

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

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

### getWorkerPool

Optional. The user-specified Worker Pool resource in which the Cloud Build
job will execute. Format
projects/{project}/locations/{location}/workerPools/{workerPoolId} If this
field is unspecified, the default Cloud Build worker pool will be used. If
omitted and deployment resource ref provided has worker_pool defined, that
worker pool is used.

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

### hasWorkerPool

### clearWorkerPool

### setWorkerPool

Optional. The user-specified Worker Pool resource in which the Cloud Build
job will execute. Format
projects/{project}/locations/{location}/workerPools/{workerPoolId} If this
field is unspecified, the default Cloud Build worker pool will be used. If
omitted and deployment resource ref provided has worker_pool defined, that
worker pool is used.

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

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

### getErrorCode

Output only. Code describing any errors that may have occurred.

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

### setErrorCode

Output only. Code describing any errors that may have occurred.

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

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

### getErrorStatus

Output only. Additional information regarding the current state.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html|null` |   |

### hasErrorStatus

### clearErrorStatus

### setErrorStatus

Output only. Additional information regarding the current state.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` |

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

### getBuild

Output only. Cloud Build instance UUID associated with this preview.

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

### setBuild

Output only. Cloud Build instance UUID associated with this preview.

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

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

### getTfErrors

Output only. Summary of errors encountered during Terraform preview.

It has a size limit of 10, i.e. only top 10 errors will be summarized here.

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

### setTfErrors

Output only. Summary of errors encountered during Terraform preview.

It has a size limit of 10, i.e. only top 10 errors will be summarized here.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-config/latest/V1.TerraformError>` |

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

### getErrorLogs

Output only. Link to tf-error.ndjson file, which contains the full list of
the errors encountered during a Terraform preview.

Format: `gs://{bucket}/{object}`.

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

### setErrorLogs

Output only. Link to tf-error.ndjson file, which contains the full list of
the errors encountered during a Terraform preview.

Format: `gs://{bucket}/{object}`.

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

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

### getPreviewArtifacts

Output only. Artifacts from preview.

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

### hasPreviewArtifacts

### clearPreviewArtifacts

### setPreviewArtifacts

Output only. Artifacts from preview.

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

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

### getLogs

Output only. Location of preview logs in `gs://{bucket}/{object}` format.

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

### setLogs

Output only. Location of preview logs in `gs://{bucket}/{object}` format.

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

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

### getTfVersion

Output only. The current Terraform version set on the preview.

It is in the format of "Major.Minor.Patch", for example, "1.3.10".

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

### setTfVersion

Output only. The current Terraform version set on the preview.

It is in the format of "Major.Minor.Patch", for example, "1.3.10".

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

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

### getTfVersionConstraint

Optional. The user-specified Terraform version constraint.

Example: "=1.3.10".

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

### hasTfVersionConstraint

### clearTfVersionConstraint

### setTfVersionConstraint

Optional. The user-specified Terraform version constraint.

Example: "=1.3.10".

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

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

### getAnnotations

Optional. Arbitrary key-value metadata storage e.g. to help client tools
identify preview during automation. See
<https://google.aip.dev/148#annotations> for details on format and size
limitations.

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

### setAnnotations

Optional. Arbitrary key-value metadata storage e.g. to help client tools
identify preview during automation. See
<https://google.aip.dev/148#annotations> for details on format and size
limitations.

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

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

### getProviderConfig

Optional. This field specifies the provider configurations.

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

### hasProviderConfig

### clearProviderConfig

### setProviderConfig

Optional. This field specifies the provider configurations.

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

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

### getBlueprint

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