Class ResourceFilter.Builder (0.1.0)

public static final class ResourceFilter.Builder extends GeneratedMessage.Builder<ResourceFilter.Builder> implements ResourceFilterOrBuilder

Resource filter for an evaluation defining the scope of resources to be evaluated.

Protobuf type google.cloud.workloadmanager.v1.ResourceFilter

Static Methods

getDescriptor()

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

Methods

addAllResourceIdPatterns(Iterable<String> values)

public ResourceFilter.Builder addAllResourceIdPatterns(Iterable<String> values)

The pattern to filter resources by their id For example, a pattern of ".prod-cluster." will match all resources that contain "prod-cluster" in their ID.

repeated string resource_id_patterns = 2;

Parameter
Name Description
values Iterable<String>

The resourceIdPatterns to add.

Returns
Type Description
ResourceFilter.Builder

This builder for chaining.

addAllScopes(Iterable<String> values)

public ResourceFilter.Builder addAllScopes(Iterable<String> values)

The scopes of evaluation resource. Format:

  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}

repeated string scopes = 1;

Parameter
Name Description
values Iterable<String>

The scopes to add.

Returns
Type Description
ResourceFilter.Builder

This builder for chaining.

addResourceIdPatterns(String value)

public ResourceFilter.Builder addResourceIdPatterns(String value)

The pattern to filter resources by their id For example, a pattern of ".prod-cluster." will match all resources that contain "prod-cluster" in their ID.

repeated string resource_id_patterns = 2;

Parameter
Name Description
value String

The resourceIdPatterns to add.

Returns
Type Description
ResourceFilter.Builder

This builder for chaining.

addResourceIdPatternsBytes(ByteString value)

public ResourceFilter.Builder addResourceIdPatternsBytes(ByteString value)

The pattern to filter resources by their id For example, a pattern of ".prod-cluster." will match all resources that contain "prod-cluster" in their ID.

repeated string resource_id_patterns = 2;

Parameter
Name Description
value ByteString

The bytes of the resourceIdPatterns to add.

Returns
Type Description
ResourceFilter.Builder

This builder for chaining.

addScopes(String value)

public ResourceFilter.Builder addScopes(String value)

The scopes of evaluation resource. Format:

  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}

repeated string scopes = 1;

Parameter
Name Description
value String

The scopes to add.

Returns
Type Description
ResourceFilter.Builder

This builder for chaining.

addScopesBytes(ByteString value)

public ResourceFilter.Builder addScopesBytes(ByteString value)

The scopes of evaluation resource. Format:

  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}

repeated string scopes = 1;

Parameter
Name Description
value ByteString

The bytes of the scopes to add.

Returns
Type Description
ResourceFilter.Builder

This builder for chaining.

build()

public ResourceFilter build()
Returns
Type Description
ResourceFilter

buildPartial()

public ResourceFilter buildPartial()
Returns
Type Description
ResourceFilter

clear()

public ResourceFilter.Builder clear()
Returns
Type Description
ResourceFilter.Builder
Overrides

clearGceInstanceFilter()

public ResourceFilter.Builder clearGceInstanceFilter()

Filter compute engine resources.

.google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;

Returns
Type Description
ResourceFilter.Builder

clearInclusionLabels()

public ResourceFilter.Builder clearInclusionLabels()
Returns
Type Description
ResourceFilter.Builder

clearResourceIdPatterns()

public ResourceFilter.Builder clearResourceIdPatterns()

The pattern to filter resources by their id For example, a pattern of ".prod-cluster." will match all resources that contain "prod-cluster" in their ID.

repeated string resource_id_patterns = 2;

Returns
Type Description
ResourceFilter.Builder

This builder for chaining.

clearScopes()

public ResourceFilter.Builder clearScopes()

The scopes of evaluation resource. Format:

  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}

repeated string scopes = 1;

Returns
Type Description
ResourceFilter.Builder

This builder for chaining.

containsInclusionLabels(String key)

public boolean containsInclusionLabels(String key)

Labels to filter resources by. Each key-value pair in the map must exist on the resource for it to be included (e.g. VM instance labels). For example, specifying { "env": "prod", "database": "nosql" } will only include resources that have labels env=prod and database=nosql.

map<string, string> inclusion_labels = 3;

Parameter
Name Description
key String
Returns
Type Description
boolean

getDefaultInstanceForType()

public ResourceFilter getDefaultInstanceForType()
Returns
Type Description
ResourceFilter

getDescriptorForType()

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

getGceInstanceFilter()

public GceInstanceFilter getGceInstanceFilter()

Filter compute engine resources.

.google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;

Returns
Type Description
GceInstanceFilter

The gceInstanceFilter.

getGceInstanceFilterBuilder()

public GceInstanceFilter.Builder getGceInstanceFilterBuilder()

Filter compute engine resources.

.google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;

Returns
Type Description
GceInstanceFilter.Builder

getGceInstanceFilterOrBuilder()

public GceInstanceFilterOrBuilder getGceInstanceFilterOrBuilder()

Filter compute engine resources.

.google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;

Returns
Type Description
GceInstanceFilterOrBuilder

getInclusionLabels() (deprecated)

public Map<String,String> getInclusionLabels()
Returns
Type Description
Map<String,String>

getInclusionLabelsCount()

public int getInclusionLabelsCount()

Labels to filter resources by. Each key-value pair in the map must exist on the resource for it to be included (e.g. VM instance labels). For example, specifying { "env": "prod", "database": "nosql" } will only include resources that have labels env=prod and database=nosql.

map<string, string> inclusion_labels = 3;

Returns
Type Description
int

getInclusionLabelsMap()

public Map<String,String> getInclusionLabelsMap()

Labels to filter resources by. Each key-value pair in the map must exist on the resource for it to be included (e.g. VM instance labels). For example, specifying { "env": "prod", "database": "nosql" } will only include resources that have labels env=prod and database=nosql.

map<string, string> inclusion_labels = 3;

Returns
Type Description
Map<String,String>

getInclusionLabelsOrDefault(String key, String defaultValue)

public String getInclusionLabelsOrDefault(String key, String defaultValue)

Labels to filter resources by. Each key-value pair in the map must exist on the resource for it to be included (e.g. VM instance labels). For example, specifying { "env": "prod", "database": "nosql" } will only include resources that have labels env=prod and database=nosql.

map<string, string> inclusion_labels = 3;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getInclusionLabelsOrThrow(String key)

public String getInclusionLabelsOrThrow(String key)

Labels to filter resources by. Each key-value pair in the map must exist on the resource for it to be included (e.g. VM instance labels). For example, specifying { "env": "prod", "database": "nosql" } will only include resources that have labels env=prod and database=nosql.

map<string, string> inclusion_labels = 3;

Parameter
Name Description
key String
Returns
Type Description
String

getMutableInclusionLabels() (deprecated)

public Map<String,String> getMutableInclusionLabels()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getResourceIdPatterns(int index)

public String getResourceIdPatterns(int index)

The pattern to filter resources by their id For example, a pattern of ".prod-cluster." will match all resources that contain "prod-cluster" in their ID.

repeated string resource_id_patterns = 2;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The resourceIdPatterns at the given index.

getResourceIdPatternsBytes(int index)

public ByteString getResourceIdPatternsBytes(int index)

The pattern to filter resources by their id For example, a pattern of ".prod-cluster." will match all resources that contain "prod-cluster" in their ID.

repeated string resource_id_patterns = 2;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the resourceIdPatterns at the given index.

getResourceIdPatternsCount()

public int getResourceIdPatternsCount()

The pattern to filter resources by their id For example, a pattern of ".prod-cluster." will match all resources that contain "prod-cluster" in their ID.

repeated string resource_id_patterns = 2;

Returns
Type Description
int

The count of resourceIdPatterns.

getResourceIdPatternsList()

public ProtocolStringList getResourceIdPatternsList()

The pattern to filter resources by their id For example, a pattern of ".prod-cluster." will match all resources that contain "prod-cluster" in their ID.

repeated string resource_id_patterns = 2;

Returns
Type Description
ProtocolStringList

A list containing the resourceIdPatterns.

getScopes(int index)

public String getScopes(int index)

The scopes of evaluation resource. Format:

  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}

repeated string scopes = 1;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The scopes at the given index.

getScopesBytes(int index)

public ByteString getScopesBytes(int index)

The scopes of evaluation resource. Format:

  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}

repeated string scopes = 1;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the scopes at the given index.

getScopesCount()

public int getScopesCount()

The scopes of evaluation resource. Format:

  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}

repeated string scopes = 1;

Returns
Type Description
int

The count of scopes.

getScopesList()

public ProtocolStringList getScopesList()

The scopes of evaluation resource. Format:

  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}

repeated string scopes = 1;

Returns
Type Description
ProtocolStringList

A list containing the scopes.

hasGceInstanceFilter()

public boolean hasGceInstanceFilter()

Filter compute engine resources.

.google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;

Returns
Type Description
boolean

Whether the gceInstanceFilter field is set.

internalGetFieldAccessorTable()

protected GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(ResourceFilter other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeGceInstanceFilter(GceInstanceFilter value)

public ResourceFilter.Builder mergeGceInstanceFilter(GceInstanceFilter value)

Filter compute engine resources.

.google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;

Parameter
Name Description
value GceInstanceFilter
Returns
Type Description
ResourceFilter.Builder

putAllInclusionLabels(Map<String,String> values)

public ResourceFilter.Builder putAllInclusionLabels(Map<String,String> values)

Labels to filter resources by. Each key-value pair in the map must exist on the resource for it to be included (e.g. VM instance labels). For example, specifying { "env": "prod", "database": "nosql" } will only include resources that have labels env=prod and database=nosql.

map<string, string> inclusion_labels = 3;

Parameter
Name Description
values Map<String,String>
Returns
Type Description
ResourceFilter.Builder

putInclusionLabels(String key, String value)

public ResourceFilter.Builder putInclusionLabels(String key, String value)

Labels to filter resources by. Each key-value pair in the map must exist on the resource for it to be included (e.g. VM instance labels). For example, specifying { "env": "prod", "database": "nosql" } will only include resources that have labels env=prod and database=nosql.

map<string, string> inclusion_labels = 3;

Parameters
Name Description
key String
value String
Returns
Type Description
ResourceFilter.Builder

removeInclusionLabels(String key)

public ResourceFilter.Builder removeInclusionLabels(String key)

Labels to filter resources by. Each key-value pair in the map must exist on the resource for it to be included (e.g. VM instance labels). For example, specifying { "env": "prod", "database": "nosql" } will only include resources that have labels env=prod and database=nosql.

map<string, string> inclusion_labels = 3;

Parameter
Name Description
key String
Returns
Type Description
ResourceFilter.Builder

setGceInstanceFilter(GceInstanceFilter value)

public ResourceFilter.Builder setGceInstanceFilter(GceInstanceFilter value)

Filter compute engine resources.

.google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;

Parameter
Name Description
value GceInstanceFilter
Returns
Type Description
ResourceFilter.Builder

setGceInstanceFilter(GceInstanceFilter.Builder builderForValue)

public ResourceFilter.Builder setGceInstanceFilter(GceInstanceFilter.Builder builderForValue)

Filter compute engine resources.

.google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;

Parameter
Name Description
builderForValue GceInstanceFilter.Builder
Returns
Type Description
ResourceFilter.Builder

setResourceIdPatterns(int index, String value)

public ResourceFilter.Builder setResourceIdPatterns(int index, String value)

The pattern to filter resources by their id For example, a pattern of ".prod-cluster." will match all resources that contain "prod-cluster" in their ID.

repeated string resource_id_patterns = 2;

Parameters
Name Description
index int

The index to set the value at.

value String

The resourceIdPatterns to set.

Returns
Type Description
ResourceFilter.Builder

This builder for chaining.

setScopes(int index, String value)

public ResourceFilter.Builder setScopes(int index, String value)

The scopes of evaluation resource. Format:

  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}

repeated string scopes = 1;

Parameters
Name Description
index int

The index to set the value at.

value String

The scopes to set.

Returns
Type Description
ResourceFilter.Builder

This builder for chaining.