public final class Constraint extends 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 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
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 |
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.FieldAccessorTable, GeneratedMessageV3.UnusedPrivateParameter
AbstractMessageLite.InternalOneOfEnum
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 |
alwaysUseFieldBuilders, unknownFields
memoizedSize
memoizedHashCode
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, 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, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
toByteArray, toByteString, writeDelimitedTo, writeTo
public 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(GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance
in class GeneratedMessageV3
public final UnknownFieldSet getUnknownFields()
getUnknownFields
in interface MessageOrBuilder
getUnknownFields
in class GeneratedMessageV3
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3
public Constraint.ConstraintTypeCase getConstraintTypeCase()
getConstraintTypeCase
in interface ConstraintOrBuilder
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 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 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 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.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 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.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.BooleanConstraintOrBuilder getBooleanConstraintOrBuilder()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;
getBooleanConstraintOrBuilder
in interface ConstraintOrBuilder
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3
public void writeTo(CodedOutputStream output) throws IOException
writeTo
in interface MessageLite
writeTo
in class GeneratedMessageV3
IOException
public int getSerializedSize()
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessageV3
public boolean equals(Object obj)
equals
in interface Message
equals
in class AbstractMessage
public int hashCode()
hashCode
in interface Message
hashCode
in class AbstractMessage
public static Constraint parseFrom(ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Constraint parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Constraint parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Constraint parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Constraint parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Constraint parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Constraint parseFrom(InputStream input) throws IOException
IOException
public static Constraint parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Constraint parseDelimitedFrom(InputStream input) throws IOException
IOException
public static Constraint parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Constraint parseFrom(CodedInputStream input) throws IOException
IOException
public static Constraint parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public Constraint.Builder newBuilderForType()
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static Constraint.Builder newBuilder()
public static Constraint.Builder newBuilder(Constraint prototype)
public Constraint.Builder toBuilder()
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected Constraint.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class GeneratedMessageV3
public static Constraint getDefaultInstance()
public static Parser<Constraint> parser()
public Parser<Constraint> getParserForType()
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessageV3
public Constraint getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
Copyright © 2021 Google LLC. All rights reserved.