Class Constraint.CustomConstraintDefinition (2.62.0)

public static final class Constraint.CustomConstraintDefinition extends GeneratedMessageV3 implements Constraint.CustomConstraintDefinitionOrBuilder

Custom constraint definition. Defines this as a managed constraint.

Protobuf type google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition

Inheritance

Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > Constraint.CustomConstraintDefinition

Static Fields

ACTION_TYPE_FIELD_NUMBER

public static final int ACTION_TYPE_FIELD_NUMBER
Field Value
Type Description
int

CONDITION_FIELD_NUMBER

public static final int CONDITION_FIELD_NUMBER
Field Value
Type Description
int

METHOD_TYPES_FIELD_NUMBER

public static final int METHOD_TYPES_FIELD_NUMBER
Field Value
Type Description
int

PARAMETERS_FIELD_NUMBER

public static final int PARAMETERS_FIELD_NUMBER
Field Value
Type Description
int

RESOURCE_TYPES_FIELD_NUMBER

public static final int RESOURCE_TYPES_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Constraint.CustomConstraintDefinition getDefaultInstance()
Returns
Type Description
Constraint.CustomConstraintDefinition

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Constraint.CustomConstraintDefinition.Builder newBuilder()
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

newBuilder(Constraint.CustomConstraintDefinition prototype)

public static Constraint.CustomConstraintDefinition.Builder newBuilder(Constraint.CustomConstraintDefinition prototype)
Parameter
Name Description
prototype Constraint.CustomConstraintDefinition
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

parseDelimitedFrom(InputStream input)

public static Constraint.CustomConstraintDefinition parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Constraint.CustomConstraintDefinition parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Constraint.CustomConstraintDefinition parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Constraint.CustomConstraintDefinition parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Constraint.CustomConstraintDefinition parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Constraint.CustomConstraintDefinition parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Constraint.CustomConstraintDefinition parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Constraint.CustomConstraintDefinition parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Constraint.CustomConstraintDefinition parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Constraint.CustomConstraintDefinition parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Constraint.CustomConstraintDefinition parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Constraint.CustomConstraintDefinition parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Constraint.CustomConstraintDefinition
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Constraint.CustomConstraintDefinition> parser()
Returns
Type Description
Parser<CustomConstraintDefinition>

Methods

containsParameters(String key)

public boolean containsParameters(String key)

Stores the structure of Parameters used by the constraint condition. The key of map represents the name of the parameter.

map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getActionType()

public Constraint.CustomConstraintDefinition.ActionType getActionType()

Allow or deny type.

.google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.ActionType action_type = 4;

Returns
Type Description
Constraint.CustomConstraintDefinition.ActionType

The actionType.

getActionTypeValue()

public int getActionTypeValue()

Allow or deny type.

.google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.ActionType action_type = 4;

Returns
Type Description
int

The enum numeric value on the wire for actionType.

getCondition()

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 = 3;

Returns
Type Description
String

The condition.

getConditionBytes()

public 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 = 3;

Returns
Type Description
ByteString

The bytes for condition.

getDefaultInstanceForType()

public Constraint.CustomConstraintDefinition getDefaultInstanceForType()
Returns
Type Description
Constraint.CustomConstraintDefinition

getMethodTypes(int index)

public Constraint.CustomConstraintDefinition.MethodType getMethodTypes(int index)

All the operations being applied for this constraint.

repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
Constraint.CustomConstraintDefinition.MethodType

The methodTypes at the given index.

getMethodTypesCount()

public int getMethodTypesCount()

All the operations being applied for this constraint.

repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;

Returns
Type Description
int

The count of methodTypes.

getMethodTypesList()

public List<Constraint.CustomConstraintDefinition.MethodType> getMethodTypesList()

All the operations being applied for this constraint.

repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;

Returns
Type Description
List<MethodType>

A list containing the methodTypes.

getMethodTypesValue(int index)

public int getMethodTypesValue(int index)

All the operations being applied for this constraint.

repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
int

The enum numeric value on the wire of methodTypes at the given index.

getMethodTypesValueList()

public List<Integer> getMethodTypesValueList()

All the operations being applied for this constraint.

repeated .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType method_types = 2;

Returns
Type Description
List<Integer>

A list containing the enum numeric values on the wire for methodTypes.

getParameters() (deprecated)

public Map<String,Constraint.CustomConstraintDefinition.Parameter> getParameters()

Use #getParametersMap() instead.

Returns
Type Description
Map<String,Parameter>

getParametersCount()

public int getParametersCount()

Stores the structure of Parameters used by the constraint condition. The key of map represents the name of the parameter.

map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;

Returns
Type Description
int

getParametersMap()

public Map<String,Constraint.CustomConstraintDefinition.Parameter> getParametersMap()

Stores the structure of Parameters used by the constraint condition. The key of map represents the name of the parameter.

map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;

Returns
Type Description
Map<String,Parameter>

getParametersOrDefault(String key, Constraint.CustomConstraintDefinition.Parameter defaultValue)

public Constraint.CustomConstraintDefinition.Parameter getParametersOrDefault(String key, Constraint.CustomConstraintDefinition.Parameter defaultValue)

Stores the structure of Parameters used by the constraint condition. The key of map represents the name of the parameter.

map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;

Parameters
Name Description
key String
defaultValue Constraint.CustomConstraintDefinition.Parameter
Returns
Type Description
Constraint.CustomConstraintDefinition.Parameter

getParametersOrThrow(String key)

public Constraint.CustomConstraintDefinition.Parameter getParametersOrThrow(String key)

Stores the structure of Parameters used by the constraint condition. The key of map represents the name of the parameter.

map<string, .google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.Parameter> parameters = 5;

Parameter
Name Description
key String
Returns
Type Description
Constraint.CustomConstraintDefinition.Parameter

getParserForType()

public Parser<Constraint.CustomConstraintDefinition> getParserForType()
Returns
Type Description
Parser<CustomConstraintDefinition>
Overrides

getResourceTypes(int index)

public String getResourceTypes(int index)

The resource instance type on which this policy applies. Format will be of the form : <service name>/<type> Example:

  • compute.googleapis.com/Instance.

repeated string resource_types = 1;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The resourceTypes at the given index.

getResourceTypesBytes(int index)

public ByteString getResourceTypesBytes(int index)

The resource instance type on which this policy applies. Format will be of the form : <service name>/<type> Example:

  • compute.googleapis.com/Instance.

repeated string resource_types = 1;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the resourceTypes at the given index.

getResourceTypesCount()

public int getResourceTypesCount()

The resource instance type on which this policy applies. Format will be of the form : <service name>/<type> Example:

  • compute.googleapis.com/Instance.

repeated string resource_types = 1;

Returns
Type Description
int

The count of resourceTypes.

getResourceTypesList()

public ProtocolStringList getResourceTypesList()

The resource instance type on which this policy applies. Format will be of the form : <service name>/<type> Example:

  • compute.googleapis.com/Instance.

repeated string resource_types = 1;

Returns
Type Description
ProtocolStringList

A list containing the resourceTypes.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Constraint.CustomConstraintDefinition.Builder newBuilderForType()
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Constraint.CustomConstraintDefinition.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Constraint.CustomConstraintDefinition.Builder toBuilder()
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException