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

This organization policy message is a modified version of the one defined in
the Organization Policy system. This message contains several fields defined
in the original organization policy with some new fields for analysis
purpose.

Generated from protobuf message `google.cloud.asset.v1.AnalyzerOrgPolicy`

## Namespace

Google \\ Cloud \\ Asset \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ attached_resource` | `string` The [full resource name](https://cloud.google.com/asset-inventory/docs/resource-name-format) of an organization/folder/project resource where this organization policy is set. Notice that some type of constraints are defined with default policy. This field will be empty for them. |
| `↳ applied_resource` | `string` The [full resource name](https://cloud.google.com/asset-inventory/docs/resource-name-format) of an organization/folder/project resource where this organization policy applies to. For any user defined org policies, this field has the same value as the \[attached_resource\] field. Only for default policy, this field has the different value. |
| `↳ rules` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.AnalyzerOrgPolicy.Rule>` List of rules for this organization policy. |
| `↳ inherit_from_parent` | `bool` If `inherit_from_parent` is true, Rules set higher up in the hierarchy (up to the closest root) are inherited and present in the effective policy. If it is false, then no rules are inherited, and this policy becomes the effective root for evaluation. |
| `↳ reset` | `bool` Ignores policies set above this resource and restores the default behavior of the constraint at this resource. This field can be set in policies for either list or boolean constraints. If set, `rules` must be empty and `inherit_from_parent` must be set to false. |

### getAttachedResource

The [full resource name](https://cloud.google.com/asset-inventory/docs/resource-name-format) of
an organization/folder/project resource where this organization policy is
set.

Notice that some type of constraints are defined with default policy. This
field will be empty for them.

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

### setAttachedResource

The [full resource name](https://cloud.google.com/asset-inventory/docs/resource-name-format) of
an organization/folder/project resource where this organization policy is
set.

Notice that some type of constraints are defined with default policy. This
field will be empty for them.

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

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

### getAppliedResource

The [full resource name](https://cloud.google.com/asset-inventory/docs/resource-name-format) of
an organization/folder/project resource where this organization policy
applies to.

For any user defined org policies, this field has the same value as
the \[attached_resource\] field. Only for default policy, this field has
the different value.

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

### setAppliedResource

The [full resource name](https://cloud.google.com/asset-inventory/docs/resource-name-format) of
an organization/folder/project resource where this organization policy
applies to.

For any user defined org policies, this field has the same value as
the \[attached_resource\] field. Only for default policy, this field has
the different value.

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

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

### getRules

List of rules for this organization policy.

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

### setRules

List of rules for this organization policy.

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

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

### getInheritFromParent

If `inherit_from_parent` is true, Rules set higher up in the
hierarchy (up to the closest root) are inherited and present in the
effective policy. If it is false, then no rules are inherited, and this
policy becomes the effective root for evaluation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setInheritFromParent

If `inherit_from_parent` is true, Rules set higher up in the
hierarchy (up to the closest root) are inherited and present in the
effective policy. If it is false, then no rules are inherited, and this
policy becomes the effective root for evaluation.

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

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

### getReset

Ignores policies set above this resource and restores the default behavior
of the constraint at this resource.

This field can be set in policies for either list or boolean
constraints. If set, `rules` must be empty and `inherit_from_parent`
must be set to false.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setReset

Ignores policies set above this resource and restores the default behavior
of the constraint at this resource.

This field can be set in policies for either list or boolean
constraints. If set, `rules` must be empty and `inherit_from_parent`
must be set to false.

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

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