Class PolicySpec.PolicyRule.StringValues.Builder (2.9.0)

public static final class PolicySpec.PolicyRule.StringValues.Builder extends GeneratedMessageV3.Builder<PolicySpec.PolicyRule.StringValues.Builder> implements PolicySpec.PolicyRule.StringValuesOrBuilder

A message that holds specific allowed and denied values. This message can define specific values and subtrees of Cloud Resource Manager resource hierarchy (Organizations, Folders, Projects) that are allowed or denied. This is achieved by using the under: and optional is: prefixes. The under: prefix is used to denote resource subtree values. The is: prefix is used to denote specific values, and is required only if the value contains a ":". Values prefixed with "is:" are treated the same as values with no prefix. Ancestry subtrees must be in one of the following formats:

  • "projects/<project-id>", e.g. "projects/tokyo-rain-123"
  • "folders/<folder-id>", e.g. "folders/1234"
  • "organizations/<organization-id>", e.g. "organizations/1234" The supports_under field of the associated Constraint defines whether ancestry prefixes can be used.

Protobuf type google.cloud.orgpolicy.v2.PolicySpec.PolicyRule.StringValues

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllAllowedValues(Iterable<String> values)

public PolicySpec.PolicyRule.StringValues.Builder addAllAllowedValues(Iterable<String> values)

List of values allowed at this resource.

repeated string allowed_values = 1;

Parameter
NameDescription
valuesIterable<String>

The allowedValues to add.

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

This builder for chaining.

addAllDeniedValues(Iterable<String> values)

public PolicySpec.PolicyRule.StringValues.Builder addAllDeniedValues(Iterable<String> values)

List of values denied at this resource.

repeated string denied_values = 2;

Parameter
NameDescription
valuesIterable<String>

The deniedValues to add.

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

This builder for chaining.

addAllowedValues(String value)

public PolicySpec.PolicyRule.StringValues.Builder addAllowedValues(String value)

List of values allowed at this resource.

repeated string allowed_values = 1;

Parameter
NameDescription
valueString

The allowedValues to add.

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

This builder for chaining.

addAllowedValuesBytes(ByteString value)

public PolicySpec.PolicyRule.StringValues.Builder addAllowedValuesBytes(ByteString value)

List of values allowed at this resource.

repeated string allowed_values = 1;

Parameter
NameDescription
valueByteString

The bytes of the allowedValues to add.

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

This builder for chaining.

addDeniedValues(String value)

public PolicySpec.PolicyRule.StringValues.Builder addDeniedValues(String value)

List of values denied at this resource.

repeated string denied_values = 2;

Parameter
NameDescription
valueString

The deniedValues to add.

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

This builder for chaining.

addDeniedValuesBytes(ByteString value)

public PolicySpec.PolicyRule.StringValues.Builder addDeniedValuesBytes(ByteString value)

List of values denied at this resource.

repeated string denied_values = 2;

Parameter
NameDescription
valueByteString

The bytes of the deniedValues to add.

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public PolicySpec.PolicyRule.StringValues.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder
Overrides

build()

public PolicySpec.PolicyRule.StringValues build()
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues

buildPartial()

public PolicySpec.PolicyRule.StringValues buildPartial()
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues

clear()

public PolicySpec.PolicyRule.StringValues.Builder clear()
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder
Overrides

clearAllowedValues()

public PolicySpec.PolicyRule.StringValues.Builder clearAllowedValues()

List of values allowed at this resource.

repeated string allowed_values = 1;

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

This builder for chaining.

clearDeniedValues()

public PolicySpec.PolicyRule.StringValues.Builder clearDeniedValues()

List of values denied at this resource.

repeated string denied_values = 2;

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public PolicySpec.PolicyRule.StringValues.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public PolicySpec.PolicyRule.StringValues.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder
Overrides

clone()

public PolicySpec.PolicyRule.StringValues.Builder clone()
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder
Overrides

getAllowedValues(int index)

public String getAllowedValues(int index)

List of values allowed at this resource.

repeated string allowed_values = 1;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The allowedValues at the given index.

getAllowedValuesBytes(int index)

public ByteString getAllowedValuesBytes(int index)

List of values allowed at this resource.

repeated string allowed_values = 1;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the allowedValues at the given index.

getAllowedValuesCount()

public int getAllowedValuesCount()

List of values allowed at this resource.

repeated string allowed_values = 1;

Returns
TypeDescription
int

The count of allowedValues.

getAllowedValuesList()

public ProtocolStringList getAllowedValuesList()

List of values allowed at this resource.

repeated string allowed_values = 1;

Returns
TypeDescription
ProtocolStringList

A list containing the allowedValues.

getDefaultInstanceForType()

public PolicySpec.PolicyRule.StringValues getDefaultInstanceForType()
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues

getDeniedValues(int index)

public String getDeniedValues(int index)

List of values denied at this resource.

repeated string denied_values = 2;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The deniedValues at the given index.

getDeniedValuesBytes(int index)

public ByteString getDeniedValuesBytes(int index)

List of values denied at this resource.

repeated string denied_values = 2;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the deniedValues at the given index.

getDeniedValuesCount()

public int getDeniedValuesCount()

List of values denied at this resource.

repeated string denied_values = 2;

Returns
TypeDescription
int

The count of deniedValues.

getDeniedValuesList()

public ProtocolStringList getDeniedValuesList()

List of values denied at this resource.

repeated string denied_values = 2;

Returns
TypeDescription
ProtocolStringList

A list containing the deniedValues.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(PolicySpec.PolicyRule.StringValues other)

public PolicySpec.PolicyRule.StringValues.Builder mergeFrom(PolicySpec.PolicyRule.StringValues other)
Parameter
NameDescription
otherPolicySpec.PolicyRule.StringValues
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public PolicySpec.PolicyRule.StringValues.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public PolicySpec.PolicyRule.StringValues.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PolicySpec.PolicyRule.StringValues.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder
Overrides

setAllowedValues(int index, String value)

public PolicySpec.PolicyRule.StringValues.Builder setAllowedValues(int index, String value)

List of values allowed at this resource.

repeated string allowed_values = 1;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The allowedValues to set.

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

This builder for chaining.

setDeniedValues(int index, String value)

public PolicySpec.PolicyRule.StringValues.Builder setDeniedValues(int index, String value)

List of values denied at this resource.

repeated string denied_values = 2;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The deniedValues to set.

Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public PolicySpec.PolicyRule.StringValues.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder
Overrides

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

public PolicySpec.PolicyRule.StringValues.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final PolicySpec.PolicyRule.StringValues.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PolicySpec.PolicyRule.StringValues.Builder
Overrides