# Google Cloud Config V1 Client - Class Resource (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 Resource.

Resource represents a Google Cloud Platform resource actuated by IM.

Resources are child resources of Revisions.

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

## Namespace

Google \\ Cloud \\ Config \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Output only. Resource name. Format: `projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}` |
| `↳ terraform_info` | `https://docs.cloud.google.com/php/docs/reference/cloud-config/latest/V1.ResourceTerraformInfo` Output only. Terraform-specific info if this resource was created using Terraform. |
| `↳ cai_assets` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI ID). CAI type format follows <https://cloud.google.com/asset-inventory/docs/supported-asset-types> |
| `↳ intent` | `int` Output only. Intent of the resource. |
| `↳ state` | `int` Output only. Current state of the resource. |

### getName

Output only. Resource name.

Format:
`projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}`

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

### setName

Output only. Resource name.

Format:
`projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}`

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

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

### getTerraformInfo

Output only. Terraform-specific info if this resource was created using
Terraform.

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

### hasTerraformInfo

### clearTerraformInfo

### setTerraformInfo

Output only. Terraform-specific info if this resource was created using
Terraform.

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

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

### getCaiAssets

Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI
ID). CAI type format follows
<https://cloud.google.com/asset-inventory/docs/supported-asset-types>

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

### setCaiAssets

Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI
ID). CAI type format follows
<https://cloud.google.com/asset-inventory/docs/supported-asset-types>

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

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

### getIntent

Output only. Intent of the resource.

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

### setIntent

Output only. Intent of the resource.

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

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

### getState

Output only. Current state of the resource.

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

### setState

Output only. Current state of the resource.

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

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