public static final class Constraint.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder> implements ConstraintOrBuilder
A constraint describes a way to restrict resource's configuration. For example, you could enforce a constraint that controls which Google Cloud services can be activated across an organization, or whether a Compute Engine instance can have serial port connections established. Constraints can be configured by the organization policy administrator to fit the needs of the organization by setting a policy that includes constraints at different locations in the organization's resource hierarchy. Policies are inherited down the resource hierarchy from higher levels, but can also be overridden. For details about the inheritance rules please read about [`policies`][google.cloud.OrgPolicy.v2.Policy]. Constraints have a default behavior determined by the `constraint_default` field, which is the enforcement behavior that is used in the absence of a policy being defined or inherited for the resource in question.Protobuf type
google.cloud.orgpolicy.v2.Constraint| Modifier and Type | Method and Description |
|---|---|
Constraint.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
Constraint |
build() |
Constraint |
buildPartial() |
Constraint.Builder |
clear() |
Constraint.Builder |
clearBooleanConstraint()
Defines this constraint as being a BooleanConstraint.
|
Constraint.Builder |
clearConstraintDefault()
The evaluation behavior of this constraint in the absence of a policy.
|
Constraint.Builder |
clearConstraintType() |
Constraint.Builder |
clearDescription()
Detailed description of what this constraint controls as well as how and
where it is enforced.
|
Constraint.Builder |
clearDisplayName()
The human readable name.
|
Constraint.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
Constraint.Builder |
clearListConstraint()
Defines this constraint as being a ListConstraint.
|
Constraint.Builder |
clearName()
Immutable.
|
Constraint.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
Constraint.Builder |
clearSupportsDryRun()
Shows if dry run is supported for this constraint or not.
|
Constraint.Builder |
clone() |
Constraint.BooleanConstraint |
getBooleanConstraint()
Defines this constraint as being a BooleanConstraint.
|
Constraint.BooleanConstraint.Builder |
getBooleanConstraintBuilder()
Defines this constraint as being a BooleanConstraint.
|
Constraint.BooleanConstraintOrBuilder |
getBooleanConstraintOrBuilder()
Defines this constraint as being a BooleanConstraint.
|
Constraint.ConstraintDefault |
getConstraintDefault()
The evaluation behavior of this constraint in the absence of a policy.
|
int |
getConstraintDefaultValue()
The evaluation behavior of this constraint in the absence of a policy.
|
Constraint.ConstraintTypeCase |
getConstraintTypeCase() |
Constraint |
getDefaultInstanceForType() |
String |
getDescription()
Detailed description of what this constraint controls as well as how and
where it is enforced.
|
com.google.protobuf.ByteString |
getDescriptionBytes()
Detailed description of what this constraint controls as well as how and
where it is enforced.
|
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
String |
getDisplayName()
The human readable name.
|
com.google.protobuf.ByteString |
getDisplayNameBytes()
The human readable name.
|
Constraint.ListConstraint |
getListConstraint()
Defines this constraint as being a ListConstraint.
|
Constraint.ListConstraint.Builder |
getListConstraintBuilder()
Defines this constraint as being a ListConstraint.
|
Constraint.ListConstraintOrBuilder |
getListConstraintOrBuilder()
Defines this constraint as being a ListConstraint.
|
String |
getName()
Immutable.
|
com.google.protobuf.ByteString |
getNameBytes()
Immutable.
|
boolean |
getSupportsDryRun()
Shows if dry run is supported for this constraint or not.
|
boolean |
hasBooleanConstraint()
Defines this constraint as being a BooleanConstraint.
|
boolean |
hasListConstraint()
Defines this constraint as being a ListConstraint.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
Constraint.Builder |
mergeBooleanConstraint(Constraint.BooleanConstraint value)
Defines this constraint as being a BooleanConstraint.
|
Constraint.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
Constraint.Builder |
mergeFrom(Constraint other) |
Constraint.Builder |
mergeFrom(com.google.protobuf.Message other) |
Constraint.Builder |
mergeListConstraint(Constraint.ListConstraint value)
Defines this constraint as being a ListConstraint.
|
Constraint.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
Constraint.Builder |
setBooleanConstraint(Constraint.BooleanConstraint.Builder builderForValue)
Defines this constraint as being a BooleanConstraint.
|
Constraint.Builder |
setBooleanConstraint(Constraint.BooleanConstraint value)
Defines this constraint as being a BooleanConstraint.
|
Constraint.Builder |
setConstraintDefault(Constraint.ConstraintDefault value)
The evaluation behavior of this constraint in the absence of a policy.
|
Constraint.Builder |
setConstraintDefaultValue(int value)
The evaluation behavior of this constraint in the absence of a policy.
|
Constraint.Builder |
setDescription(String value)
Detailed description of what this constraint controls as well as how and
where it is enforced.
|
Constraint.Builder |
setDescriptionBytes(com.google.protobuf.ByteString value)
Detailed description of what this constraint controls as well as how and
where it is enforced.
|
Constraint.Builder |
setDisplayName(String value)
The human readable name.
|
Constraint.Builder |
setDisplayNameBytes(com.google.protobuf.ByteString value)
The human readable name.
|
Constraint.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
Constraint.Builder |
setListConstraint(Constraint.ListConstraint.Builder builderForValue)
Defines this constraint as being a ListConstraint.
|
Constraint.Builder |
setListConstraint(Constraint.ListConstraint value)
Defines this constraint as being a ListConstraint.
|
Constraint.Builder |
setName(String value)
Immutable.
|
Constraint.Builder |
setNameBytes(com.google.protobuf.ByteString value)
Immutable.
|
Constraint.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
Constraint.Builder |
setSupportsDryRun(boolean value)
Shows if dry run is supported for this constraint or not.
|
Constraint.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>public Constraint getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic Constraint build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic Constraint buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic Constraint.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<Constraint.Builder>public Constraint.Builder mergeFrom(Constraint other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<Constraint.Builder>IOExceptionpublic Constraint.ConstraintTypeCase getConstraintTypeCase()
getConstraintTypeCase in interface ConstraintOrBuilderpublic Constraint.Builder clearConstraintType()
public String getName()
Immutable. The resource name of the constraint. Must be in one of
the following forms:
* `projects/{project_number}/constraints/{constraint_name}`
* `folders/{folder_id}/constraints/{constraint_name}`
* `organizations/{organization_id}/constraints/{constraint_name}`
For example, "/projects/123/constraints/compute.disableSerialPortAccess".
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];getName in interface ConstraintOrBuilderpublic com.google.protobuf.ByteString getNameBytes()
Immutable. The resource name of the constraint. Must be in one of
the following forms:
* `projects/{project_number}/constraints/{constraint_name}`
* `folders/{folder_id}/constraints/{constraint_name}`
* `organizations/{organization_id}/constraints/{constraint_name}`
For example, "/projects/123/constraints/compute.disableSerialPortAccess".
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];getNameBytes in interface ConstraintOrBuilderpublic Constraint.Builder setName(String value)
Immutable. The resource name of the constraint. Must be in one of
the following forms:
* `projects/{project_number}/constraints/{constraint_name}`
* `folders/{folder_id}/constraints/{constraint_name}`
* `organizations/{organization_id}/constraints/{constraint_name}`
For example, "/projects/123/constraints/compute.disableSerialPortAccess".
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];value - The name to set.public Constraint.Builder clearName()
Immutable. The resource name of the constraint. Must be in one of
the following forms:
* `projects/{project_number}/constraints/{constraint_name}`
* `folders/{folder_id}/constraints/{constraint_name}`
* `organizations/{organization_id}/constraints/{constraint_name}`
For example, "/projects/123/constraints/compute.disableSerialPortAccess".
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];public Constraint.Builder setNameBytes(com.google.protobuf.ByteString value)
Immutable. The resource name of the constraint. Must be in one of
the following forms:
* `projects/{project_number}/constraints/{constraint_name}`
* `folders/{folder_id}/constraints/{constraint_name}`
* `organizations/{organization_id}/constraints/{constraint_name}`
For example, "/projects/123/constraints/compute.disableSerialPortAccess".
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];value - The bytes for name to set.public String getDisplayName()
The human readable name. Mutable.
string display_name = 2;getDisplayName in interface ConstraintOrBuilderpublic com.google.protobuf.ByteString getDisplayNameBytes()
The human readable name. Mutable.
string display_name = 2;getDisplayNameBytes in interface ConstraintOrBuilderpublic Constraint.Builder setDisplayName(String value)
The human readable name. Mutable.
string display_name = 2;value - The displayName to set.public Constraint.Builder clearDisplayName()
The human readable name. Mutable.
string display_name = 2;public Constraint.Builder setDisplayNameBytes(com.google.protobuf.ByteString value)
The human readable name. Mutable.
string display_name = 2;value - The bytes for displayName to set.public String getDescription()
Detailed description of what this constraint controls as well as how and where it is enforced. Mutable.
string description = 3;getDescription in interface ConstraintOrBuilderpublic com.google.protobuf.ByteString getDescriptionBytes()
Detailed description of what this constraint controls as well as how and where it is enforced. Mutable.
string description = 3;getDescriptionBytes in interface ConstraintOrBuilderpublic Constraint.Builder setDescription(String value)
Detailed description of what this constraint controls as well as how and where it is enforced. Mutable.
string description = 3;value - The description to set.public Constraint.Builder clearDescription()
Detailed description of what this constraint controls as well as how and where it is enforced. Mutable.
string description = 3;public Constraint.Builder setDescriptionBytes(com.google.protobuf.ByteString value)
Detailed description of what this constraint controls as well as how and where it is enforced. Mutable.
string description = 3;value - The bytes for description to set.public int getConstraintDefaultValue()
The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;getConstraintDefaultValue in interface ConstraintOrBuilderpublic Constraint.Builder setConstraintDefaultValue(int value)
The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;value - The enum numeric value on the wire for constraintDefault to set.public Constraint.ConstraintDefault getConstraintDefault()
The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;getConstraintDefault in interface ConstraintOrBuilderpublic Constraint.Builder setConstraintDefault(Constraint.ConstraintDefault value)
The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;value - The constraintDefault to set.public Constraint.Builder clearConstraintDefault()
The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;public boolean hasListConstraint()
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;hasListConstraint in interface ConstraintOrBuilderpublic Constraint.ListConstraint getListConstraint()
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;getListConstraint in interface ConstraintOrBuilderpublic Constraint.Builder setListConstraint(Constraint.ListConstraint value)
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;public Constraint.Builder setListConstraint(Constraint.ListConstraint.Builder builderForValue)
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;public Constraint.Builder mergeListConstraint(Constraint.ListConstraint value)
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;public Constraint.Builder clearListConstraint()
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;public Constraint.ListConstraint.Builder getListConstraintBuilder()
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;public Constraint.ListConstraintOrBuilder getListConstraintOrBuilder()
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;getListConstraintOrBuilder in interface ConstraintOrBuilderpublic boolean hasBooleanConstraint()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;hasBooleanConstraint in interface ConstraintOrBuilderpublic Constraint.BooleanConstraint getBooleanConstraint()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;getBooleanConstraint in interface ConstraintOrBuilderpublic Constraint.Builder setBooleanConstraint(Constraint.BooleanConstraint value)
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;public Constraint.Builder setBooleanConstraint(Constraint.BooleanConstraint.Builder builderForValue)
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;public Constraint.Builder mergeBooleanConstraint(Constraint.BooleanConstraint value)
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;public Constraint.Builder clearBooleanConstraint()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;public Constraint.BooleanConstraint.Builder getBooleanConstraintBuilder()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;public Constraint.BooleanConstraintOrBuilder getBooleanConstraintOrBuilder()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;getBooleanConstraintOrBuilder in interface ConstraintOrBuilderpublic boolean getSupportsDryRun()
Shows if dry run is supported for this constraint or not.
bool supports_dry_run = 7;getSupportsDryRun in interface ConstraintOrBuilderpublic Constraint.Builder setSupportsDryRun(boolean value)
Shows if dry run is supported for this constraint or not.
bool supports_dry_run = 7;value - The supportsDryRun to set.public Constraint.Builder clearSupportsDryRun()
Shows if dry run is supported for this constraint or not.
bool supports_dry_run = 7;public final Constraint.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>public final Constraint.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Constraint.Builder>Copyright © 2024 Google LLC. All rights reserved.