1.4.0 (latest) 1.3.0 1.2.0 1.1.0 1.0.0

    public sealed class OrgPolicyViolationsPreview : IMessage<OrgPolicyViolationsPreview>, IEquatable<OrgPolicyViolationsPreview>, IDeepCloneable<OrgPolicyViolationsPreview>, IBufferMessage, IMessage

Reference documentation and code samples for the Policy Simulator v1 API class OrgPolicyViolationsPreview.

OrgPolicyViolationsPreview is a resource providing a preview of the
violations that will exist if an OrgPolicy change is made.

The list of violations are modeled as child resources and retrieved via a
\[ListOrgPolicyViolations\]\[\] API call. There are potentially more
\[OrgPolicyViolations\]\[\] than could fit in an embedded field. Thus, the use of
a child resource instead of a field.

## Inheritance

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

## Implements

[IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.md.txt)[OrgPolicyViolationsPreview](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.OrgPolicyViolationsPreview.md.txt), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[OrgPolicyViolationsPreview](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.OrgPolicyViolationsPreview.md.txt), [IDeepCloneable](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.md.txt)[OrgPolicyViolationsPreview](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.OrgPolicyViolationsPreview.md.txt), [IBufferMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.md.txt), [IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.md.txt)

## 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.PolicySimulator.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.md.txt)

## Assembly

Google.Cloud.PolicySimulator.V1.dll

## Constructors

### OrgPolicyViolationsPreview()

    public OrgPolicyViolationsPreview()

### OrgPolicyViolationsPreview(OrgPolicyViolationsPreview)

    public OrgPolicyViolationsPreview(OrgPolicyViolationsPreview other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `OrgPolicyViolationsPreview` |

## Properties

### CreateTime

    public Timestamp CreateTime { get; set; }

Output only. Time when this `OrgPolicyViolationsPreview` was created.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `Timestamp` |   |

### CustomConstraints

    public RepeatedField<string> CustomConstraints { get; }

Output only. The names of the constraints against which all
`OrgPolicyViolations` were evaluated.

If `OrgPolicyOverlay` only contains `PolicyOverlay` then it contains
the name of the configured custom constraint, applicable to the specified
policies. Otherwise it contains the name of the constraint specified in
`CustomConstraintOverlay`.

Format:
`organizations/{organization_id}/customConstraints/{custom_constraint_id}`

Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `RepeatedFieldstring` |   |

### CustomConstraintsAsCustomConstraintNames

    public ResourceNameList<CustomConstraintName> CustomConstraintsAsCustomConstraintNames { get; }

[CustomConstraintName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OrgPolicy.V2/latest/Google.Cloud.OrgPolicy.V2.CustomConstraintName.md.txt)-typed view over the [CustomConstraints](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.OrgPolicyViolationsPreview.md.txt#Google_Cloud_PolicySimulator_V1_OrgPolicyViolationsPreview_CustomConstraints) resource name
property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `ResourceNameListCustomConstraintName` |   |

### Name

    public string Name { get; set; }

Output only. The resource name of the `OrgPolicyViolationsPreview`. It has
the following format:

`organizations/{organization}/locations/{location}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreview}`

Example:
`organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/506a5f7f`

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### OrgPolicyViolationsPreviewName

    public OrgPolicyViolationsPreviewName OrgPolicyViolationsPreviewName { get; set; }

[OrgPolicyViolationsPreviewName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.OrgPolicyViolationsPreviewName.md.txt)-typed view over the [Name](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.OrgPolicyViolationsPreview.md.txt#Google_Cloud_PolicySimulator_V1_OrgPolicyViolationsPreview_Name) resource name
property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `OrgPolicyViolationsPreviewName` |   |

### Overlay

    public OrgPolicyOverlay Overlay { get; set; }

Required. The proposed changes we are previewing violations for.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `OrgPolicyOverlay` |   |

### ResourceCounts

    public OrgPolicyViolationsPreview.Types.ResourceCounts ResourceCounts { get; set; }

Output only. A summary of the state of all resources scanned for compliance
with the changed OrgPolicy.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `OrgPolicyViolationsPreviewTypesResourceCounts` |   |

### State

    public PreviewState State { get; set; }

Output only. The state of the `OrgPolicyViolationsPreview`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `PreviewState` |   |

### ViolationsCount

    public int ViolationsCount { get; set; }

Output only. The number of \[OrgPolicyViolations\]\[\] in this
`OrgPolicyViolationsPreview`. This count may differ from
`resource_summary.noncompliant_count` because each
\[OrgPolicyViolation\]\[google.cloud.policysimulator.v1.OrgPolicyViolation\] is
specific to a resource **and** constraint. If there are multiple
constraints being evaluated (i.e. multiple policies in the overlay), a
single resource may violate multiple constraints.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `int` |   |