public final class Constraint extends com.google.protobuf.GeneratedMessageV3 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 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 | Class and Description |
|---|---|
static class |
Constraint.BooleanConstraint
A `Constraint` that is either enforced or not.
|
static interface |
Constraint.BooleanConstraintOrBuilder |
static class |
Constraint.Builder
A `constraint` describes a way to restrict resource's configuration.
|
static class |
Constraint.ConstraintDefault
Specifies the default behavior in the absence of any `Policy` for the
`Constraint`.
|
static class |
Constraint.ConstraintTypeCase |
static class |
Constraint.ListConstraint
A `Constraint` that allows or disallows a list of string values, which are
configured by an Organization's policy administrator with a `Policy`.
|
static interface |
Constraint.ListConstraintOrBuilder |
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
BOOLEAN_CONSTRAINT_FIELD_NUMBER |
static int |
CONSTRAINT_DEFAULT_FIELD_NUMBER |
static int |
DESCRIPTION_FIELD_NUMBER |
static int |
DISPLAY_NAME_FIELD_NUMBER |
static int |
LIST_CONSTRAINT_FIELD_NUMBER |
static int |
NAME_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Constraint.BooleanConstraint |
getBooleanConstraint()
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 'Policy'.
|
int |
getConstraintDefaultValue()
The evaluation behavior of this constraint in the absence of 'Policy'.
|
Constraint.ConstraintTypeCase |
getConstraintTypeCase() |
static Constraint |
getDefaultInstance() |
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() |
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.ListConstraintOrBuilder |
getListConstraintOrBuilder()
Defines this constraint as being a ListConstraint.
|
String |
getName()
Immutable.
|
com.google.protobuf.ByteString |
getNameBytes()
Immutable.
|
com.google.protobuf.Parser<Constraint> |
getParserForType() |
int |
getSerializedSize() |
boolean |
hasBooleanConstraint()
Defines this constraint as being a BooleanConstraint.
|
int |
hashCode() |
boolean |
hasListConstraint()
Defines this constraint as being a ListConstraint.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static Constraint.Builder |
newBuilder() |
static Constraint.Builder |
newBuilder(Constraint prototype) |
Constraint.Builder |
newBuilderForType() |
protected Constraint.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static Constraint |
parseDelimitedFrom(InputStream input) |
static Constraint |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Constraint |
parseFrom(byte[] data) |
static Constraint |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Constraint |
parseFrom(ByteBuffer data) |
static Constraint |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Constraint |
parseFrom(com.google.protobuf.ByteString data) |
static Constraint |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Constraint |
parseFrom(com.google.protobuf.CodedInputStream input) |
static Constraint |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Constraint |
parseFrom(InputStream input) |
static Constraint |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<Constraint> |
parser() |
Constraint.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
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, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int NAME_FIELD_NUMBER
public static final int DISPLAY_NAME_FIELD_NUMBER
public static final int DESCRIPTION_FIELD_NUMBER
public static final int CONSTRAINT_DEFAULT_FIELD_NUMBER
public static final int LIST_CONSTRAINT_FIELD_NUMBER
public static final int BOOLEAN_CONSTRAINT_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public Constraint.ConstraintTypeCase getConstraintTypeCase()
getConstraintTypeCase in interface ConstraintOrBuilderpublic 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 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 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 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.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 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.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.BooleanConstraintOrBuilder getBooleanConstraintOrBuilder()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;getBooleanConstraintOrBuilder in interface ConstraintOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static Constraint parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Constraint parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Constraint parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Constraint parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Constraint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Constraint parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Constraint parseFrom(InputStream input) throws IOException
IOExceptionpublic static Constraint parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static Constraint parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static Constraint parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static Constraint parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static Constraint parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic Constraint.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static Constraint.Builder newBuilder()
public static Constraint.Builder newBuilder(Constraint prototype)
public Constraint.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected Constraint.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static Constraint getDefaultInstance()
public static com.google.protobuf.Parser<Constraint> parser()
public com.google.protobuf.Parser<Constraint> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public Constraint getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2023 Google LLC. All rights reserved.