public static final class Constraint.Builder extends 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 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's policy adminstrator to fit the needs of the organzation 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.ConstraintgetAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofmergeFrompublic static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder clear()
clear in interface Message.Builderclear in interface MessageLite.Builderclear in class GeneratedMessageV3.Builder<Constraint.Builder>public Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface Message.BuildergetDescriptorForType in interface MessageOrBuildergetDescriptorForType in class GeneratedMessageV3.Builder<Constraint.Builder>public Constraint getDefaultInstanceForType()
getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilderpublic Constraint build()
build in interface Message.Builderbuild in interface MessageLite.Builderpublic Constraint buildPartial()
buildPartial in interface Message.BuilderbuildPartial in interface MessageLite.Builderpublic Constraint.Builder clone()
clone in interface Message.Builderclone in interface MessageLite.Builderclone in class GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder setField(Descriptors.FieldDescriptor field, Object value)
setField in interface Message.BuildersetField in class GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder clearField(Descriptors.FieldDescriptor field)
clearField in interface Message.BuilderclearField in class GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder clearOneof(Descriptors.OneofDescriptor oneof)
clearOneof in interface Message.BuilderclearOneof in class GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface Message.BuildersetRepeatedField in class GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface Message.BuilderaddRepeatedField in class GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder mergeFrom(Message other)
mergeFrom in interface Message.BuildermergeFrom in class AbstractMessage.Builder<Constraint.Builder>public Constraint.Builder mergeFrom(Constraint other)
public final boolean isInitialized()
isInitialized in interface MessageLiteOrBuilderisInitialized in class GeneratedMessageV3.Builder<Constraint.Builder>public Constraint.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface Message.BuildermergeFrom in interface MessageLite.BuildermergeFrom in class 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 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(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 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(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 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(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 '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 '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 '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 '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 '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 final Constraint.Builder setUnknownFields(UnknownFieldSet unknownFields)
setUnknownFields in interface Message.BuildersetUnknownFields in class GeneratedMessageV3.Builder<Constraint.Builder>public final Constraint.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
mergeUnknownFields in interface Message.BuildermergeUnknownFields in class GeneratedMessageV3.Builder<Constraint.Builder>Copyright © 2021 Google LLC. All rights reserved.