Class OrgPolicyViolationsPreview (0.49.0)

public final class OrgPolicyViolationsPreview extends GeneratedMessageV3 implements OrgPolicyViolationsPreviewOrBuilder

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.

Protobuf type google.cloud.policysimulator.v1.OrgPolicyViolationsPreview

Static Fields

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

CUSTOM_CONSTRAINTS_FIELD_NUMBER

public static final int CUSTOM_CONSTRAINTS_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

OVERLAY_FIELD_NUMBER

public static final int OVERLAY_FIELD_NUMBER
Field Value
Type Description
int

RESOURCE_COUNTS_FIELD_NUMBER

public static final int RESOURCE_COUNTS_FIELD_NUMBER
Field Value
Type Description
int

STATE_FIELD_NUMBER

public static final int STATE_FIELD_NUMBER
Field Value
Type Description
int

VIOLATIONS_COUNT_FIELD_NUMBER

public static final int VIOLATIONS_COUNT_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static OrgPolicyViolationsPreview getDefaultInstance()
Returns
Type Description
OrgPolicyViolationsPreview

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static OrgPolicyViolationsPreview.Builder newBuilder()
Returns
Type Description
OrgPolicyViolationsPreview.Builder

newBuilder(OrgPolicyViolationsPreview prototype)

public static OrgPolicyViolationsPreview.Builder newBuilder(OrgPolicyViolationsPreview prototype)
Parameter
Name Description
prototype OrgPolicyViolationsPreview
Returns
Type Description
OrgPolicyViolationsPreview.Builder

parseDelimitedFrom(InputStream input)

public static OrgPolicyViolationsPreview parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static OrgPolicyViolationsPreview parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static OrgPolicyViolationsPreview parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static OrgPolicyViolationsPreview parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static OrgPolicyViolationsPreview parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static OrgPolicyViolationsPreview parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static OrgPolicyViolationsPreview parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static OrgPolicyViolationsPreview parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static OrgPolicyViolationsPreview parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static OrgPolicyViolationsPreview parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static OrgPolicyViolationsPreview parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static OrgPolicyViolationsPreview parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OrgPolicyViolationsPreview
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<OrgPolicyViolationsPreview> parser()
Returns
Type Description
Parser<OrgPolicyViolationsPreview>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCreateTime()

public Timestamp getCreateTime()

Output only. Time when this OrgPolicyViolationsPreview was created.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Time when this OrgPolicyViolationsPreview was created.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getCustomConstraints(int index)

public String getCustomConstraints(int index)

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

repeated string custom_constraints = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The customConstraints at the given index.

getCustomConstraintsBytes(int index)

public ByteString getCustomConstraintsBytes(int index)

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

repeated string custom_constraints = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the customConstraints at the given index.

getCustomConstraintsCount()

public int getCustomConstraintsCount()

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

repeated string custom_constraints = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
Type Description
int

The count of customConstraints.

getCustomConstraintsList()

public ProtocolStringList getCustomConstraintsList()

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

repeated string custom_constraints = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
Type Description
ProtocolStringList

A list containing the customConstraints.

getDefaultInstanceForType()

public OrgPolicyViolationsPreview getDefaultInstanceForType()
Returns
Type Description
OrgPolicyViolationsPreview

getName()

public String getName()

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

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

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

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for name.

getOverlay()

public OrgPolicyOverlay getOverlay()

Required. The proposed changes we are previewing violations for.

.google.cloud.policysimulator.v1.OrgPolicyOverlay overlay = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OrgPolicyOverlay

The overlay.

getOverlayOrBuilder()

public OrgPolicyOverlayOrBuilder getOverlayOrBuilder()

Required. The proposed changes we are previewing violations for.

.google.cloud.policysimulator.v1.OrgPolicyOverlay overlay = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OrgPolicyOverlayOrBuilder

getParserForType()

public Parser<OrgPolicyViolationsPreview> getParserForType()
Returns
Type Description
Parser<OrgPolicyViolationsPreview>
Overrides

getResourceCounts()

public OrgPolicyViolationsPreview.ResourceCounts getResourceCounts()

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

.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview.ResourceCounts resource_counts = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
OrgPolicyViolationsPreview.ResourceCounts

The resourceCounts.

getResourceCountsOrBuilder()

public OrgPolicyViolationsPreview.ResourceCountsOrBuilder getResourceCountsOrBuilder()

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

.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview.ResourceCounts resource_counts = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
OrgPolicyViolationsPreview.ResourceCountsOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getState()

public PreviewState getState()

Output only. The state of the OrgPolicyViolationsPreview.

.google.cloud.policysimulator.v1.PreviewState state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
PreviewState

The state.

getStateValue()

public int getStateValue()

Output only. The state of the OrgPolicyViolationsPreview.

.google.cloud.policysimulator.v1.PreviewState state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for state.

getViolationsCount()

public int getViolationsCount()

Output only. The number of [OrgPolicyViolations][] in this OrgPolicyViolationsPreview. This count may differ from resource_summary.noncompliant_count because each 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.

int32 violations_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The violationsCount.

hasCreateTime()

public boolean hasCreateTime()

Output only. Time when this OrgPolicyViolationsPreview was created.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

hasOverlay()

public boolean hasOverlay()

Required. The proposed changes we are previewing violations for.

.google.cloud.policysimulator.v1.OrgPolicyOverlay overlay = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the overlay field is set.

hasResourceCounts()

public boolean hasResourceCounts()

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

.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview.ResourceCounts resource_counts = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the resourceCounts field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public OrgPolicyViolationsPreview.Builder newBuilderForType()
Returns
Type Description
OrgPolicyViolationsPreview.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected OrgPolicyViolationsPreview.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
OrgPolicyViolationsPreview.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public OrgPolicyViolationsPreview.Builder toBuilder()
Returns
Type Description
OrgPolicyViolationsPreview.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException