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.Constraint
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
mergeFrom
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3.Builder<Constraint.Builder>
public Constraint.Builder clear()
clear
in interface Message.Builder
clear
in interface MessageLite.Builder
clear
in class GeneratedMessageV3.Builder<Constraint.Builder>
public Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface Message.Builder
getDescriptorForType
in interface MessageOrBuilder
getDescriptorForType
in class GeneratedMessageV3.Builder<Constraint.Builder>
public Constraint getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
public Constraint build()
build
in interface Message.Builder
build
in interface MessageLite.Builder
public Constraint buildPartial()
buildPartial
in interface Message.Builder
buildPartial
in interface MessageLite.Builder
public Constraint.Builder clone()
clone
in interface Message.Builder
clone
in interface MessageLite.Builder
clone
in class GeneratedMessageV3.Builder<Constraint.Builder>
public Constraint.Builder setField(Descriptors.FieldDescriptor field, Object value)
setField
in interface Message.Builder
setField
in class GeneratedMessageV3.Builder<Constraint.Builder>
public Constraint.Builder clearField(Descriptors.FieldDescriptor field)
clearField
in interface Message.Builder
clearField
in class GeneratedMessageV3.Builder<Constraint.Builder>
public Constraint.Builder clearOneof(Descriptors.OneofDescriptor oneof)
clearOneof
in interface Message.Builder
clearOneof
in class GeneratedMessageV3.Builder<Constraint.Builder>
public Constraint.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField
in interface Message.Builder
setRepeatedField
in class GeneratedMessageV3.Builder<Constraint.Builder>
public Constraint.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
addRepeatedField
in interface Message.Builder
addRepeatedField
in class GeneratedMessageV3.Builder<Constraint.Builder>
public Constraint.Builder mergeFrom(Message other)
mergeFrom
in interface Message.Builder
mergeFrom
in class AbstractMessage.Builder<Constraint.Builder>
public Constraint.Builder mergeFrom(Constraint other)
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3.Builder<Constraint.Builder>
public Constraint.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom
in interface Message.Builder
mergeFrom
in interface MessageLite.Builder
mergeFrom
in class AbstractMessage.Builder<Constraint.Builder>
IOException
public Constraint.ConstraintTypeCase getConstraintTypeCase()
getConstraintTypeCase
in interface ConstraintOrBuilder
public 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 ConstraintOrBuilder
public 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 ConstraintOrBuilder
public 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 ConstraintOrBuilder
public ByteString getDisplayNameBytes()
The human readable name. Mutable.
string display_name = 2;
getDisplayNameBytes
in interface ConstraintOrBuilder
public 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 ConstraintOrBuilder
public 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 ConstraintOrBuilder
public 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 ConstraintOrBuilder
public 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 ConstraintOrBuilder
public 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 ConstraintOrBuilder
public Constraint.ListConstraint getListConstraint()
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;
getListConstraint
in interface ConstraintOrBuilder
public 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 ConstraintOrBuilder
public boolean hasBooleanConstraint()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;
hasBooleanConstraint
in interface ConstraintOrBuilder
public Constraint.BooleanConstraint getBooleanConstraint()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;
getBooleanConstraint
in interface ConstraintOrBuilder
public 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 ConstraintOrBuilder
public final Constraint.Builder setUnknownFields(UnknownFieldSet unknownFields)
setUnknownFields
in interface Message.Builder
setUnknownFields
in class GeneratedMessageV3.Builder<Constraint.Builder>
public final Constraint.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
mergeUnknownFields
in interface Message.Builder
mergeUnknownFields
in class GeneratedMessageV3.Builder<Constraint.Builder>
Copyright © 2021 Google LLC. All rights reserved.