# Google Cloud OsConfig V1 Client - Class OSPolicyResourceCompliance (2.2.3)

2.2.3 (latest) 2.2.2 2.1.0 2.0.5 1.3.5 1.2.2 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud OsConfig V1 Client class OSPolicyResourceCompliance.

Compliance data for an OS policy resource.

Generated from protobuf message `google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance`

## Namespace

Google \\ Cloud \\ OsConfig \\ V1 \\ OSPolicyAssignmentReport \\ OSPolicyCompliance

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ os_policy_resource_id` | `string` The ID of the OS policy resource. |
| `↳ config_steps` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep>` Ordered list of configuration completed by the agent for the OS policy resource. |
| `↳ compliance_state` | `int` The compliance state of the resource. |
| `↳ compliance_state_reason` | `string` A reason for the resource to be in the given compliance state. This field is always populated when `compliance_state` is `UNKNOWN`. The following values are supported when `compliance_state == UNKNOWN` \* \* `execution-errors`: Errors were encountered by the agent while executing the resource and the compliance state couldn't be determined. \* \* `execution-skipped-by-agent`: Resource execution was skipped by the agent because errors were encountered while executing prior resources in the OS policy. \* \* `os-policy-execution-attempt-failed`: The execution of the OS policy containing this resource failed and the compliance state couldn't be determined. |
| `↳ exec_resource_output` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput` ExecResource specific output. |

### getOsPolicyResourceId

The ID of the OS policy resource.

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

### setOsPolicyResourceId

The ID of the OS policy resource.

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

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

### getConfigSteps

Ordered list of configuration completed by the agent for the OS policy
resource.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep>` |   |

### setConfigSteps

Ordered list of configuration completed by the agent for the OS policy
resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep>` |

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

### getComplianceState

The compliance state of the resource.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ComplianceState](https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState). |

### setComplianceState

The compliance state of the resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ComplianceState](https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState). |

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

### getComplianceStateReason

A reason for the resource to be in the given compliance state.

This field is always populated when `compliance_state` is `UNKNOWN`.
The following values are supported when `compliance_state == UNKNOWN`

- `execution-errors`: Errors were encountered by the agent while executing the resource and the compliance state couldn't be determined.
- `execution-skipped-by-agent`: Resource execution was skipped by the agent because errors were encountered while executing prior resources in the OS policy.
- `os-policy-execution-attempt-failed`: The execution of the OS policy containing this resource failed and the compliance state couldn't be determined.

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

### setComplianceStateReason

A reason for the resource to be in the given compliance state.

This field is always populated when `compliance_state` is `UNKNOWN`.
The following values are supported when `compliance_state == UNKNOWN`

- `execution-errors`: Errors were encountered by the agent while executing the resource and the compliance state couldn't be determined.
- `execution-skipped-by-agent`: Resource execution was skipped by the agent because errors were encountered while executing prior resources in the OS policy.
- `os-policy-execution-attempt-failed`: The execution of the OS policy containing this resource failed and the compliance state couldn't be determined.

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

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

### getExecResourceOutput

ExecResource specific output.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput|null` |   |

### hasExecResourceOutput

### setExecResourceOutput

ExecResource specific output.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput` |

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

### getOutput

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