# Google Cloud OS Config v1alpha API - Class InstanceOSPoliciesCompliance.Types.OSPolicyCompliance (2.0.0-alpha07)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.0.0-alpha07 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types.OSPolicyCompliance)
- [2.0.0-alpha06](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/2.0.0-alpha06/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types.OSPolicyCompliance)
- [1.0.0-alpha04](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/1.0.0-alpha04/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types.OSPolicyCompliance)

    [Obsolete]
    public sealed class InstanceOSPoliciesCompliance.Types.OSPolicyCompliance : IMessage<InstanceOSPoliciesCompliance.Types.OSPolicyCompliance>, IEquatable<InstanceOSPoliciesCompliance.Types.OSPolicyCompliance>, IDeepCloneable<InstanceOSPoliciesCompliance.Types.OSPolicyCompliance>, IBufferMessage, IMessage

Reference documentation and code samples for the Google Cloud OS Config v1alpha API class InstanceOSPoliciesCompliance.Types.OSPolicyCompliance.

Compliance data for an OS policy

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> InstanceOSPoliciesCompliance.Types.OSPolicyCompliance

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[InstanceOSPoliciesCompliance](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types)[OSPolicyCompliance](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types.OSPolicyCompliance), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[InstanceOSPoliciesCompliance](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types)[OSPolicyCompliance](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types.OSPolicyCompliance), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[InstanceOSPoliciesCompliance](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types)[OSPolicyCompliance](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types.OSPolicyCompliance), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.OsConfig.V1Alpha](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha)

## Assembly

Google.Cloud.OsConfig.V1Alpha.dll

## Constructors

### OSPolicyCompliance()

    public OSPolicyCompliance()

### OSPolicyCompliance(OSPolicyCompliance)

    public OSPolicyCompliance(InstanceOSPoliciesCompliance.Types.OSPolicyCompliance other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliancehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types.OSPolicyCompliance` |

## Properties

### OsPolicyAssignment

    public string OsPolicyAssignment { get; set; }

Reference to the `OSPolicyAssignment` API resource that the `OSPolicy`
belongs to.

Format:
`projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}`

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### OsPolicyAssignmentAsOSPolicyAssignmentName

    [Obsolete]
    public OSPolicyAssignmentName OsPolicyAssignmentAsOSPolicyAssignmentName { get; set; }

[OSPolicyAssignmentName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicyAssignmentName)-typed view over the [OsPolicyAssignment](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types.OSPolicyCompliance#Google_Cloud_OsConfig_V1Alpha_InstanceOSPoliciesCompliance_Types_OSPolicyCompliance_OsPolicyAssignment) resource
name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicyAssignmentName` |   |

### OsPolicyId

    public string OsPolicyId { get; set; }

The OS policy id

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### OsPolicyResourceCompliances

    [Obsolete]
    public RepeatedField<OSPolicyResourceCompliance> OsPolicyResourceCompliances { get; }

Compliance data for each `OSPolicyResource` that is applied to the
VM.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicyResourceCompliance` |   |

### State

    public OSPolicyComplianceState State { get; set; }

Compliance state of the OS policy.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicyComplianceState` |   |