Package com.google.cloud.orgpolicy.v2
Class Constraint.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Constraint.Builder>
com.google.cloud.orgpolicy.v2.Constraint.Builder
- All Implemented Interfaces:
ConstraintOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- Constraint
public static final class Constraint.Builder
extends com.google.protobuf.GeneratedMessage.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, see [`Policy`][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-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()Defines this constraint as being a boolean constraint.The evaluation behavior of this constraint in the absence of a policy.Detailed description of what this constraint controls as well as how and where it is enforced.The human readable name.Managed constraint and canned constraint sometimes can have equivalents.Defines this constraint as being a list constraint.Immutable.Shows if dry run is supported for this constraint or not.Shows if simulation is supported for this constraint or not.Defines this constraint as being a boolean constraint.Defines this constraint as being a boolean constraint.Defines this constraint as being a boolean constraint.The evaluation behavior of this constraint in the absence of a policy.intThe evaluation behavior of this constraint in the absence of a policy.Detailed description of what this constraint controls as well as how and where it is enforced.com.google.protobuf.ByteStringDetailed description of what this constraint controls as well as how and where it is enforced.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorThe human readable name.com.google.protobuf.ByteStringThe human readable name.Managed constraint and canned constraint sometimes can have equivalents.com.google.protobuf.ByteStringManaged constraint and canned constraint sometimes can have equivalents.Defines this constraint as being a list constraint.Defines this constraint as being a list constraint.Defines this constraint as being a list constraint.getName()Immutable.com.google.protobuf.ByteStringImmutable.booleanShows if dry run is supported for this constraint or not.booleanShows if simulation is supported for this constraint or not.booleanDefines this constraint as being a boolean constraint.booleanDefines this constraint as being a list constraint.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanDefines this constraint as being a boolean constraint.mergeFrom(Constraint other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) Defines this constraint as being a list constraint.Defines this constraint as being a boolean constraint.setBooleanConstraint(Constraint.BooleanConstraint.Builder builderForValue) Defines this constraint as being a boolean constraint.The evaluation behavior of this constraint in the absence of a policy.setConstraintDefaultValue(int value) The evaluation behavior of this constraint in the absence of a policy.setDescription(String value) Detailed description of what this constraint controls as well as how and where it is enforced.setDescriptionBytes(com.google.protobuf.ByteString value) Detailed description of what this constraint controls as well as how and where it is enforced.setDisplayName(String value) The human readable name.setDisplayNameBytes(com.google.protobuf.ByteString value) The human readable name.setEquivalentConstraint(String value) Managed constraint and canned constraint sometimes can have equivalents.setEquivalentConstraintBytes(com.google.protobuf.ByteString value) Managed constraint and canned constraint sometimes can have equivalents.Defines this constraint as being a list constraint.setListConstraint(Constraint.ListConstraint.Builder builderForValue) Defines this constraint as being a list constraint.Immutable.setNameBytes(com.google.protobuf.ByteString value) Immutable.setSupportsDryRun(boolean value) Shows if dry run is supported for this constraint or not.setSupportsSimulation(boolean value) Shows if simulation is supported for this constraint or not.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<Constraint.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<Constraint.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<Constraint.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Constraint.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<Constraint.Builder>
-
mergeFrom
public Constraint.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Constraint.Builder>- Throws:
IOException
-
getConstraintTypeCase
- Specified by:
getConstraintTypeCasein interfaceConstraintOrBuilder
-
clearConstraintType
-
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];- Specified by:
getNamein interfaceConstraintOrBuilder- Returns:
- The name.
-
getNameBytes
public 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];- Specified by:
getNameBytesin interfaceConstraintOrBuilder- Returns:
- The bytes for name.
-
setName
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];- Parameters:
value- The name to set.- Returns:
- This builder for chaining.
-
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];- Returns:
- This builder for chaining.
-
setNameBytes
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];- Parameters:
value- The bytes for name to set.- Returns:
- This builder for chaining.
-
getDisplayName
The human readable name. Mutable.
string display_name = 2;- Specified by:
getDisplayNamein interfaceConstraintOrBuilder- Returns:
- The displayName.
-
getDisplayNameBytes
public com.google.protobuf.ByteString getDisplayNameBytes()The human readable name. Mutable.
string display_name = 2;- Specified by:
getDisplayNameBytesin interfaceConstraintOrBuilder- Returns:
- The bytes for displayName.
-
setDisplayName
The human readable name. Mutable.
string display_name = 2;- Parameters:
value- The displayName to set.- Returns:
- This builder for chaining.
-
clearDisplayName
The human readable name. Mutable.
string display_name = 2;- Returns:
- This builder for chaining.
-
setDisplayNameBytes
The human readable name. Mutable.
string display_name = 2;- Parameters:
value- The bytes for displayName to set.- Returns:
- This builder for chaining.
-
getDescription
Detailed description of what this constraint controls as well as how and where it is enforced. Mutable.
string description = 3;- Specified by:
getDescriptionin interfaceConstraintOrBuilder- Returns:
- The description.
-
getDescriptionBytes
public 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;- Specified by:
getDescriptionBytesin interfaceConstraintOrBuilder- Returns:
- The bytes for description.
-
setDescription
Detailed description of what this constraint controls as well as how and where it is enforced. Mutable.
string description = 3;- Parameters:
value- The description to set.- Returns:
- This builder for chaining.
-
clearDescription
Detailed description of what this constraint controls as well as how and where it is enforced. Mutable.
string description = 3;- Returns:
- This builder for chaining.
-
setDescriptionBytes
Detailed description of what this constraint controls as well as how and where it is enforced. Mutable.
string description = 3;- Parameters:
value- The bytes for description to set.- Returns:
- This builder for chaining.
-
getConstraintDefaultValue
public int getConstraintDefaultValue()The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;- Specified by:
getConstraintDefaultValuein interfaceConstraintOrBuilder- Returns:
- The enum numeric value on the wire for constraintDefault.
-
setConstraintDefaultValue
The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;- Parameters:
value- The enum numeric value on the wire for constraintDefault to set.- Returns:
- This builder for chaining.
-
getConstraintDefault
The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;- Specified by:
getConstraintDefaultin interfaceConstraintOrBuilder- Returns:
- The constraintDefault.
-
setConstraintDefault
The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;- Parameters:
value- The constraintDefault to set.- Returns:
- This builder for chaining.
-
clearConstraintDefault
The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;- Returns:
- This builder for chaining.
-
hasListConstraint
public boolean hasListConstraint()Defines this constraint as being a list constraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;- Specified by:
hasListConstraintin interfaceConstraintOrBuilder- Returns:
- Whether the listConstraint field is set.
-
getListConstraint
Defines this constraint as being a list constraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;- Specified by:
getListConstraintin interfaceConstraintOrBuilder- Returns:
- The listConstraint.
-
setListConstraint
Defines this constraint as being a list constraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5; -
setListConstraint
Defines this constraint as being a list constraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5; -
mergeListConstraint
Defines this constraint as being a list constraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5; -
clearListConstraint
Defines this constraint as being a list constraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5; -
getListConstraintBuilder
Defines this constraint as being a list constraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5; -
getListConstraintOrBuilder
Defines this constraint as being a list constraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;- Specified by:
getListConstraintOrBuilderin interfaceConstraintOrBuilder
-
hasBooleanConstraint
public boolean hasBooleanConstraint()Defines this constraint as being a boolean constraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;- Specified by:
hasBooleanConstraintin interfaceConstraintOrBuilder- Returns:
- Whether the booleanConstraint field is set.
-
getBooleanConstraint
Defines this constraint as being a boolean constraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;- Specified by:
getBooleanConstraintin interfaceConstraintOrBuilder- Returns:
- The booleanConstraint.
-
setBooleanConstraint
Defines this constraint as being a boolean constraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6; -
setBooleanConstraint
public Constraint.Builder setBooleanConstraint(Constraint.BooleanConstraint.Builder builderForValue) Defines this constraint as being a boolean constraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6; -
mergeBooleanConstraint
Defines this constraint as being a boolean constraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6; -
clearBooleanConstraint
Defines this constraint as being a boolean constraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6; -
getBooleanConstraintBuilder
Defines this constraint as being a boolean constraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6; -
getBooleanConstraintOrBuilder
Defines this constraint as being a boolean constraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;- Specified by:
getBooleanConstraintOrBuilderin interfaceConstraintOrBuilder
-
getSupportsDryRun
public boolean getSupportsDryRun()Shows if dry run is supported for this constraint or not.
bool supports_dry_run = 7;- Specified by:
getSupportsDryRunin interfaceConstraintOrBuilder- Returns:
- The supportsDryRun.
-
setSupportsDryRun
Shows if dry run is supported for this constraint or not.
bool supports_dry_run = 7;- Parameters:
value- The supportsDryRun to set.- Returns:
- This builder for chaining.
-
clearSupportsDryRun
Shows if dry run is supported for this constraint or not.
bool supports_dry_run = 7;- Returns:
- This builder for chaining.
-
getEquivalentConstraint
Managed constraint and canned constraint sometimes can have equivalents. This field is used to store the equivalent constraint name.
string equivalent_constraint = 8;- Specified by:
getEquivalentConstraintin interfaceConstraintOrBuilder- Returns:
- The equivalentConstraint.
-
getEquivalentConstraintBytes
public com.google.protobuf.ByteString getEquivalentConstraintBytes()Managed constraint and canned constraint sometimes can have equivalents. This field is used to store the equivalent constraint name.
string equivalent_constraint = 8;- Specified by:
getEquivalentConstraintBytesin interfaceConstraintOrBuilder- Returns:
- The bytes for equivalentConstraint.
-
setEquivalentConstraint
Managed constraint and canned constraint sometimes can have equivalents. This field is used to store the equivalent constraint name.
string equivalent_constraint = 8;- Parameters:
value- The equivalentConstraint to set.- Returns:
- This builder for chaining.
-
clearEquivalentConstraint
Managed constraint and canned constraint sometimes can have equivalents. This field is used to store the equivalent constraint name.
string equivalent_constraint = 8;- Returns:
- This builder for chaining.
-
setEquivalentConstraintBytes
Managed constraint and canned constraint sometimes can have equivalents. This field is used to store the equivalent constraint name.
string equivalent_constraint = 8;- Parameters:
value- The bytes for equivalentConstraint to set.- Returns:
- This builder for chaining.
-
getSupportsSimulation
public boolean getSupportsSimulation()Shows if simulation is supported for this constraint or not.
bool supports_simulation = 9;- Specified by:
getSupportsSimulationin interfaceConstraintOrBuilder- Returns:
- The supportsSimulation.
-
setSupportsSimulation
Shows if simulation is supported for this constraint or not.
bool supports_simulation = 9;- Parameters:
value- The supportsSimulation to set.- Returns:
- This builder for chaining.
-
clearSupportsSimulation
Shows if simulation is supported for this constraint or not.
bool supports_simulation = 9;- Returns:
- This builder for chaining.
-