Class Constraint.CustomConstraintDefinition.Builder (2.62.0)

public static final class Constraint.CustomConstraintDefinition.Builder extends GeneratedMessageV3.Builder<Constraint.CustomConstraintDefinition.Builder> implements Constraint.CustomConstraintDefinitionOrBuilder

Custom constraint definition. Defines this as a managed constraint.

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

Static Methods

getDescriptor()

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

Methods

addAllMethodTypes(Iterable<? extends Constraint.CustomConstraintDefinition.MethodType> values)

public Constraint.CustomConstraintDefinition.Builder addAllMethodTypes(Iterable<? extends Constraint.CustomConstraintDefinition.MethodType> values)

All the operations being applied for this constraint.

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

Parameter
Name Description
values Iterable<? extends com.google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType>

The methodTypes to add.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

addAllMethodTypesValue(Iterable<Integer> values)

public Constraint.CustomConstraintDefinition.Builder addAllMethodTypesValue(Iterable<Integer> values)

All the operations being applied for this constraint.

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

Parameter
Name Description
values Iterable<Integer>

The enum numeric values on the wire for methodTypes to add.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

addAllResourceTypes(Iterable<String> values)

public Constraint.CustomConstraintDefinition.Builder addAllResourceTypes(Iterable<String> values)

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
values Iterable<String>

The resourceTypes to add.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

addMethodTypes(Constraint.CustomConstraintDefinition.MethodType value)

public Constraint.CustomConstraintDefinition.Builder addMethodTypes(Constraint.CustomConstraintDefinition.MethodType value)

All the operations being applied for this constraint.

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

Parameter
Name Description
value Constraint.CustomConstraintDefinition.MethodType

The methodTypes to add.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

addMethodTypesValue(int value)

public Constraint.CustomConstraintDefinition.Builder addMethodTypesValue(int value)

All the operations being applied for this constraint.

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

Parameter
Name Description
value int

The enum numeric value on the wire for methodTypes to add.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Constraint.CustomConstraintDefinition.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides

addResourceTypes(String value)

public Constraint.CustomConstraintDefinition.Builder addResourceTypes(String value)

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
value String

The resourceTypes to add.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

addResourceTypesBytes(ByteString value)

public Constraint.CustomConstraintDefinition.Builder addResourceTypesBytes(ByteString value)

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
value ByteString

The bytes of the resourceTypes to add.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

build()

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

buildPartial()

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

clear()

public Constraint.CustomConstraintDefinition.Builder clear()
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides

clearActionType()

public Constraint.CustomConstraintDefinition.Builder clearActionType()

Allow or deny type.

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

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

clearCondition()

public Constraint.CustomConstraintDefinition.Builder clearCondition()

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
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Constraint.CustomConstraintDefinition.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides

clearMethodTypes()

public Constraint.CustomConstraintDefinition.Builder clearMethodTypes()

All the operations being applied for this constraint.

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

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Constraint.CustomConstraintDefinition.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides

clearParameters()

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

clearResourceTypes()

public Constraint.CustomConstraintDefinition.Builder clearResourceTypes()

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
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

clone()

public Constraint.CustomConstraintDefinition.Builder clone()
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides

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

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

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

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.

getMutableParameters() (deprecated)

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

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,Parameter>

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

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.

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.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Constraint.CustomConstraintDefinition other)

public Constraint.CustomConstraintDefinition.Builder mergeFrom(Constraint.CustomConstraintDefinition other)
Parameter
Name Description
other Constraint.CustomConstraintDefinition
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Constraint.CustomConstraintDefinition.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Constraint.CustomConstraintDefinition.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Constraint.CustomConstraintDefinition.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides

putAllParameters(Map<String,Constraint.CustomConstraintDefinition.Parameter> values)

public Constraint.CustomConstraintDefinition.Builder putAllParameters(Map<String,Constraint.CustomConstraintDefinition.Parameter> values)

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
values Map<String,Parameter>
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

putParameters(String key, Constraint.CustomConstraintDefinition.Parameter value)

public Constraint.CustomConstraintDefinition.Builder putParameters(String key, Constraint.CustomConstraintDefinition.Parameter value)

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
value Constraint.CustomConstraintDefinition.Parameter
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

putParametersBuilderIfAbsent(String key)

public Constraint.CustomConstraintDefinition.Parameter.Builder putParametersBuilderIfAbsent(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.Builder

removeParameters(String key)

public Constraint.CustomConstraintDefinition.Builder removeParameters(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.Builder

setActionType(Constraint.CustomConstraintDefinition.ActionType value)

public Constraint.CustomConstraintDefinition.Builder setActionType(Constraint.CustomConstraintDefinition.ActionType value)

Allow or deny type.

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

Parameter
Name Description
value Constraint.CustomConstraintDefinition.ActionType

The actionType to set.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

setActionTypeValue(int value)

public Constraint.CustomConstraintDefinition.Builder setActionTypeValue(int value)

Allow or deny type.

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

Parameter
Name Description
value int

The enum numeric value on the wire for actionType to set.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

setCondition(String value)

public Constraint.CustomConstraintDefinition.Builder setCondition(String value)

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;

Parameter
Name Description
value String

The condition to set.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

setConditionBytes(ByteString value)

public Constraint.CustomConstraintDefinition.Builder setConditionBytes(ByteString value)

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;

Parameter
Name Description
value ByteString

The bytes for condition to set.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Constraint.CustomConstraintDefinition.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides

setMethodTypes(int index, Constraint.CustomConstraintDefinition.MethodType value)

public Constraint.CustomConstraintDefinition.Builder setMethodTypes(int index, Constraint.CustomConstraintDefinition.MethodType value)

All the operations being applied for this constraint.

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

Parameters
Name Description
index int

The index to set the value at.

value Constraint.CustomConstraintDefinition.MethodType

The methodTypes to set.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

setMethodTypesValue(int index, int value)

public Constraint.CustomConstraintDefinition.Builder setMethodTypesValue(int index, int value)

All the operations being applied for this constraint.

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

Parameters
Name Description
index int

The index to set the value at.

value int

The enum numeric value on the wire for methodTypes to set.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Constraint.CustomConstraintDefinition.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides

setResourceTypes(int index, String value)

public Constraint.CustomConstraintDefinition.Builder setResourceTypes(int index, String value)

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;

Parameters
Name Description
index int

The index to set the value at.

value String

The resourceTypes to set.

Returns
Type Description
Constraint.CustomConstraintDefinition.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Constraint.CustomConstraintDefinition.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Constraint.CustomConstraintDefinition.Builder
Overrides