Package com.google.cloud.orgpolicy.v2
Class Constraint
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.orgpolicy.v2.Constraint
- All Implemented Interfaces:
ConstraintOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
@Generated
public final class Constraint
extends com.google.protobuf.GeneratedMessage
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- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA constraint type is enforced or not enforced, which is configured in the [`PolicyRule`][google.cloud.orgpolicy.v2.PolicySpec.PolicyRule].static interfacestatic final classA constraint describes a way to restrict resource's configuration.static enumSpecifies the default behavior in the absence of any policy for the constraint.static enumstatic final classCustom constraint definition.static interfacestatic final classA constraint type that allows or disallows a list of string values, which are configured in the [`PolicyRule`][google.cloud.orgpolicy.v2.PolicySpec.PolicyRule].static interfaceNested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T extends Object>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, loggedPre22TypeNames, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanDefines 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.static ConstraintDetailed 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.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.getName()Immutable.com.google.protobuf.ByteStringImmutable.com.google.protobuf.Parser<Constraint>intbooleanShows 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.inthashCode()booleanDefines this constraint as being a list constraint.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanstatic Constraint.Builderstatic Constraint.BuildernewBuilder(Constraint prototype) protected Constraint.BuildernewBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) static ConstraintparseDelimitedFrom(InputStream input) static ConstraintparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static ConstraintparseFrom(byte[] data) static ConstraintparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static ConstraintparseFrom(com.google.protobuf.ByteString data) static ConstraintparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static ConstraintparseFrom(com.google.protobuf.CodedInputStream input) static ConstraintparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static ConstraintparseFrom(InputStream input) static ConstraintparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static ConstraintparseFrom(ByteBuffer data) static ConstraintparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<Constraint>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER- See Also:
-
DISPLAY_NAME_FIELD_NUMBER
public static final int DISPLAY_NAME_FIELD_NUMBER- See Also:
-
DESCRIPTION_FIELD_NUMBER
public static final int DESCRIPTION_FIELD_NUMBER- See Also:
-
CONSTRAINT_DEFAULT_FIELD_NUMBER
public static final int CONSTRAINT_DEFAULT_FIELD_NUMBER- See Also:
-
LIST_CONSTRAINT_FIELD_NUMBER
public static final int LIST_CONSTRAINT_FIELD_NUMBER- See Also:
-
BOOLEAN_CONSTRAINT_FIELD_NUMBER
public static final int BOOLEAN_CONSTRAINT_FIELD_NUMBER- See Also:
-
SUPPORTS_DRY_RUN_FIELD_NUMBER
public static final int SUPPORTS_DRY_RUN_FIELD_NUMBER- See Also:
-
EQUIVALENT_CONSTRAINT_FIELD_NUMBER
public static final int EQUIVALENT_CONSTRAINT_FIELD_NUMBER- See Also:
-
SUPPORTS_SIMULATION_FIELD_NUMBER
public static final int SUPPORTS_SIMULATION_FIELD_NUMBER- See Also:
-
-
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
-
getConstraintTypeCase
- Specified by:
getConstraintTypeCasein interfaceConstraintOrBuilder
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static Constraint parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Constraint parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Constraint parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Constraint parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Constraint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Constraint parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Constraint parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static Constraint parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Constraint parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected Constraint.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-