public final class CustomConstraint extends com.google.protobuf.GeneratedMessageV3 implements CustomConstraintOrBuilder
A custom constraint defined by customers which can *only* be applied to the given resource types and organization. By creating a custom constraint, customers can apply policies of this custom constraint. *Creating a custom constraint itself does NOT apply any policy enforcement*.Protobuf type
google.cloud.orgpolicy.v2.CustomConstraint| Modifier and Type | Class and Description |
|---|---|
static class |
CustomConstraint.ActionType
Allow or deny type.
|
static class |
CustomConstraint.Builder
A custom constraint defined by customers which can *only* be applied to the
given resource types and organization.
|
static class |
CustomConstraint.MethodType
The operation for which this constraint will be applied.
|
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 |
ACTION_TYPE_FIELD_NUMBER |
static int |
CONDITION_FIELD_NUMBER |
static int |
DESCRIPTION_FIELD_NUMBER |
static int |
DISPLAY_NAME_FIELD_NUMBER |
static int |
METHOD_TYPES_FIELD_NUMBER |
static int |
NAME_FIELD_NUMBER |
static int |
RESOURCE_TYPES_FIELD_NUMBER |
static int |
UPDATE_TIME_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
CustomConstraint.ActionType |
getActionType()
Allow or deny type.
|
int |
getActionTypeValue()
Allow or deny type.
|
String |
getCondition()
Org policy condition/expression.
|
com.google.protobuf.ByteString |
getConditionBytes()
Org policy condition/expression.
|
static CustomConstraint |
getDefaultInstance() |
CustomConstraint |
getDefaultInstanceForType() |
String |
getDescription()
Detailed information about this custom policy constraint.
|
com.google.protobuf.ByteString |
getDescriptionBytes()
Detailed information about this custom policy constraint.
|
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
String |
getDisplayName()
One line display name for the UI.
|
com.google.protobuf.ByteString |
getDisplayNameBytes()
One line display name for the UI.
|
CustomConstraint.MethodType |
getMethodTypes(int index)
All the operations being applied for this constraint.
|
int |
getMethodTypesCount()
All the operations being applied for this constraint.
|
List<CustomConstraint.MethodType> |
getMethodTypesList()
All the operations being applied for this constraint.
|
int |
getMethodTypesValue(int index)
All the operations being applied for this constraint.
|
List<Integer> |
getMethodTypesValueList()
All the operations being applied for this constraint.
|
String |
getName()
Immutable.
|
com.google.protobuf.ByteString |
getNameBytes()
Immutable.
|
com.google.protobuf.Parser<CustomConstraint> |
getParserForType() |
String |
getResourceTypes(int index)
Immutable.
|
com.google.protobuf.ByteString |
getResourceTypesBytes(int index)
Immutable.
|
int |
getResourceTypesCount()
Immutable.
|
com.google.protobuf.ProtocolStringList |
getResourceTypesList()
Immutable.
|
int |
getSerializedSize() |
com.google.protobuf.Timestamp |
getUpdateTime()
Output only.
|
com.google.protobuf.TimestampOrBuilder |
getUpdateTimeOrBuilder()
Output only.
|
int |
hashCode() |
boolean |
hasUpdateTime()
Output only.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static CustomConstraint.Builder |
newBuilder() |
static CustomConstraint.Builder |
newBuilder(CustomConstraint prototype) |
CustomConstraint.Builder |
newBuilderForType() |
protected CustomConstraint.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static CustomConstraint |
parseDelimitedFrom(InputStream input) |
static CustomConstraint |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static CustomConstraint |
parseFrom(byte[] data) |
static CustomConstraint |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static CustomConstraint |
parseFrom(ByteBuffer data) |
static CustomConstraint |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static CustomConstraint |
parseFrom(com.google.protobuf.ByteString data) |
static CustomConstraint |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static CustomConstraint |
parseFrom(com.google.protobuf.CodedInputStream input) |
static CustomConstraint |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static CustomConstraint |
parseFrom(InputStream input) |
static CustomConstraint |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<CustomConstraint> |
parser() |
CustomConstraint.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 RESOURCE_TYPES_FIELD_NUMBER
public static final int METHOD_TYPES_FIELD_NUMBER
public static final int CONDITION_FIELD_NUMBER
public static final int ACTION_TYPE_FIELD_NUMBER
public static final int DISPLAY_NAME_FIELD_NUMBER
public static final int DESCRIPTION_FIELD_NUMBER
public static final int UPDATE_TIME_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 String getName()
Immutable. Name of the constraint. This is unique within the organization.
Format of the name should be
* `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
The max length is 70 characters and the minimum length is 1. Note that the
prefix `organizations/{organization_id}/customConstraints/` is not counted.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];getName in interface CustomConstraintOrBuilderpublic com.google.protobuf.ByteString getNameBytes()
Immutable. Name of the constraint. This is unique within the organization.
Format of the name should be
* `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
The max length is 70 characters and the minimum length is 1. Note that the
prefix `organizations/{organization_id}/customConstraints/` is not counted.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];getNameBytes in interface CustomConstraintOrBuilderpublic com.google.protobuf.ProtocolStringList getResourceTypesList()
Immutable. The resource instance type on which this policy applies. Format will be of the form : `<canonical service name>/<type>` Example: * `compute.googleapis.com/Instance`.
repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE];getResourceTypesList in interface CustomConstraintOrBuilderpublic int getResourceTypesCount()
Immutable. The resource instance type on which this policy applies. Format will be of the form : `<canonical service name>/<type>` Example: * `compute.googleapis.com/Instance`.
repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE];getResourceTypesCount in interface CustomConstraintOrBuilderpublic String getResourceTypes(int index)
Immutable. The resource instance type on which this policy applies. Format will be of the form : `<canonical service name>/<type>` Example: * `compute.googleapis.com/Instance`.
repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE];getResourceTypes in interface CustomConstraintOrBuilderindex - The index of the element to return.public com.google.protobuf.ByteString getResourceTypesBytes(int index)
Immutable. The resource instance type on which this policy applies. Format will be of the form : `<canonical service name>/<type>` Example: * `compute.googleapis.com/Instance`.
repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE];getResourceTypesBytes in interface CustomConstraintOrBuilderindex - The index of the value to return.public List<CustomConstraint.MethodType> getMethodTypesList()
All the operations being applied for this constraint.
repeated .google.cloud.orgpolicy.v2.CustomConstraint.MethodType method_types = 3;getMethodTypesList in interface CustomConstraintOrBuilderpublic int getMethodTypesCount()
All the operations being applied for this constraint.
repeated .google.cloud.orgpolicy.v2.CustomConstraint.MethodType method_types = 3;getMethodTypesCount in interface CustomConstraintOrBuilderpublic CustomConstraint.MethodType getMethodTypes(int index)
All the operations being applied for this constraint.
repeated .google.cloud.orgpolicy.v2.CustomConstraint.MethodType method_types = 3;getMethodTypes in interface CustomConstraintOrBuilderindex - The index of the element to return.public List<Integer> getMethodTypesValueList()
All the operations being applied for this constraint.
repeated .google.cloud.orgpolicy.v2.CustomConstraint.MethodType method_types = 3;getMethodTypesValueList in interface CustomConstraintOrBuilderpublic int getMethodTypesValue(int index)
All the operations being applied for this constraint.
repeated .google.cloud.orgpolicy.v2.CustomConstraint.MethodType method_types = 3;getMethodTypesValue in interface CustomConstraintOrBuilderindex - The index of the value to return.public String getCondition()
Org policy condition/expression. For example:
`resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
`resource.management.auto_upgrade == true`
The max length of the condition is 1000 characters.
string condition = 4;getCondition in interface CustomConstraintOrBuilderpublic com.google.protobuf.ByteString getConditionBytes()
Org policy condition/expression. For example:
`resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
`resource.management.auto_upgrade == true`
The max length of the condition is 1000 characters.
string condition = 4;getConditionBytes in interface CustomConstraintOrBuilderpublic int getActionTypeValue()
Allow or deny type.
.google.cloud.orgpolicy.v2.CustomConstraint.ActionType action_type = 5;getActionTypeValue in interface CustomConstraintOrBuilderpublic CustomConstraint.ActionType getActionType()
Allow or deny type.
.google.cloud.orgpolicy.v2.CustomConstraint.ActionType action_type = 5;getActionType in interface CustomConstraintOrBuilderpublic String getDisplayName()
One line display name for the UI. The max length of the display_name is 200 characters.
string display_name = 6;getDisplayName in interface CustomConstraintOrBuilderpublic com.google.protobuf.ByteString getDisplayNameBytes()
One line display name for the UI. The max length of the display_name is 200 characters.
string display_name = 6;getDisplayNameBytes in interface CustomConstraintOrBuilderpublic String getDescription()
Detailed information about this custom policy constraint. The max length of the description is 2000 characters.
string description = 7;getDescription in interface CustomConstraintOrBuilderpublic com.google.protobuf.ByteString getDescriptionBytes()
Detailed information about this custom policy constraint. The max length of the description is 2000 characters.
string description = 7;getDescriptionBytes in interface CustomConstraintOrBuilderpublic boolean hasUpdateTime()
Output only. The last time this custom constraint was updated. This represents the last time that the `CreateCustomConstraint` or `UpdateCustomConstraint` RPC was called
.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
hasUpdateTime in interface CustomConstraintOrBuilderpublic com.google.protobuf.Timestamp getUpdateTime()
Output only. The last time this custom constraint was updated. This represents the last time that the `CreateCustomConstraint` or `UpdateCustomConstraint` RPC was called
.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
getUpdateTime in interface CustomConstraintOrBuilderpublic com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder()
Output only. The last time this custom constraint was updated. This represents the last time that the `CreateCustomConstraint` or `UpdateCustomConstraint` RPC was called
.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
getUpdateTimeOrBuilder in interface CustomConstraintOrBuilderpublic 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 CustomConstraint parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static CustomConstraint parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static CustomConstraint parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static CustomConstraint parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static CustomConstraint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static CustomConstraint parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static CustomConstraint parseFrom(InputStream input) throws IOException
IOExceptionpublic static CustomConstraint parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static CustomConstraint parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static CustomConstraint parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static CustomConstraint parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static CustomConstraint parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic CustomConstraint.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static CustomConstraint.Builder newBuilder()
public static CustomConstraint.Builder newBuilder(CustomConstraint prototype)
public CustomConstraint.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected CustomConstraint.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static CustomConstraint getDefaultInstance()
public static com.google.protobuf.Parser<CustomConstraint> parser()
public com.google.protobuf.Parser<CustomConstraint> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public CustomConstraint getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2024 Google LLC. All rights reserved.