# Google Cloud Asset V1 Client - Class PolicyInfo (2.3.3)

2.3.3 (latest) 2.3.2 2.2.3 2.1.3 2.0.1 1.16.4 1.14.1 1.13.2 1.12.2 1.11.3 1.10.2 1.9.2 Reference documentation and code samples for the Google Cloud Asset V1 Client class PolicyInfo.

The IAM policy and its attached resource.

Generated from protobuf message `google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo`

## Namespace

Google \\ Cloud \\ Asset \\ V1 \\ BatchGetEffectiveIamPoliciesResponse \\ EffectiveIamPolicy

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ attached_resource` | `string` The full resource name the [policy](https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo#_Google_Cloud_Asset_V1_BatchGetEffectiveIamPoliciesResponse_EffectiveIamPolicy_PolicyInfo__getPolicy__) is directly attached to. |
| `↳ policy` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html` The IAM policy that's directly attached to the [attached_resource](https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo#_Google_Cloud_Asset_V1_BatchGetEffectiveIamPoliciesResponse_EffectiveIamPolicy_PolicyInfo__getAttachedResource__). |

### getAttachedResource

The full resource name the
[policy](https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo#_Google_Cloud_Asset_V1_BatchGetEffectiveIamPoliciesResponse_EffectiveIamPolicy_PolicyInfo__getPolicy__)
is directly attached to.

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

### setAttachedResource

The full resource name the
[policy](https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo#_Google_Cloud_Asset_V1_BatchGetEffectiveIamPoliciesResponse_EffectiveIamPolicy_PolicyInfo__getPolicy__)
is directly attached to.

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

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

### getPolicy

The IAM policy that's directly attached to the
[attached_resource](https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo#_Google_Cloud_Asset_V1_BatchGetEffectiveIamPoliciesResponse_EffectiveIamPolicy_PolicyInfo__getAttachedResource__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html|null` |   |

### hasPolicy

### clearPolicy

### setPolicy

The IAM policy that's directly attached to the
[attached_resource](https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo#_Google_Cloud_Asset_V1_BatchGetEffectiveIamPoliciesResponse_EffectiveIamPolicy_PolicyInfo__getAttachedResource__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html` |

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