Class ResourceFilter.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<ResourceFilter.Builder>
com.google.cloud.workloadmanager.v1.ResourceFilter.Builder
All Implemented Interfaces:
ResourceFilterOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
ResourceFilter

public static final class ResourceFilter.Builder extends com.google.protobuf.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
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<ResourceFilter.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<ResourceFilter.Builder>
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<ResourceFilter.Builder>
    • clear

      public ResourceFilter.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<ResourceFilter.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<ResourceFilter.Builder>
    • getDefaultInstanceForType

      public ResourceFilter getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public ResourceFilter build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public ResourceFilter buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public ResourceFilter.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ResourceFilter.Builder>
    • mergeFrom

      public ResourceFilter.Builder mergeFrom(ResourceFilter other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<ResourceFilter.Builder>
    • mergeFrom

      public ResourceFilter.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ResourceFilter.Builder>
      Throws:
      IOException
    • getScopesList

      public com.google.protobuf.ProtocolStringList getScopesList()
       The scopes of evaluation resource.
       Format:
       * `projects/{project_id}`
       * `folders/{folder_id}`
       * `organizations/{organization_id}`
       
      repeated string scopes = 1;
      Specified by:
      getScopesList in interface ResourceFilterOrBuilder
      Returns:
      A list containing the scopes.
    • getScopesCount

      public int getScopesCount()
       The scopes of evaluation resource.
       Format:
       * `projects/{project_id}`
       * `folders/{folder_id}`
       * `organizations/{organization_id}`
       
      repeated string scopes = 1;
      Specified by:
      getScopesCount in interface ResourceFilterOrBuilder
      Returns:
      The count of scopes.
    • getScopes

      public String getScopes(int index)
       The scopes of evaluation resource.
       Format:
       * `projects/{project_id}`
       * `folders/{folder_id}`
       * `organizations/{organization_id}`
       
      repeated string scopes = 1;
      Specified by:
      getScopes in interface ResourceFilterOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The scopes at the given index.
    • getScopesBytes

      public com.google.protobuf.ByteString getScopesBytes(int index)
       The scopes of evaluation resource.
       Format:
       * `projects/{project_id}`
       * `folders/{folder_id}`
       * `organizations/{organization_id}`
       
      repeated string scopes = 1;
      Specified by:
      getScopesBytes in interface ResourceFilterOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the scopes at the given index.
    • setScopes

      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:
      index - The index to set the value at.
      value - The scopes to set.
      Returns:
      This builder for chaining.
    • addScopes

      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;
      Parameters:
      value - The scopes to add.
      Returns:
      This builder for chaining.
    • addAllScopes

      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;
      Parameters:
      values - The scopes to add.
      Returns:
      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:
      This builder for chaining.
    • addScopesBytes

      public ResourceFilter.Builder addScopesBytes(com.google.protobuf.ByteString value)
       The scopes of evaluation resource.
       Format:
       * `projects/{project_id}`
       * `folders/{folder_id}`
       * `organizations/{organization_id}`
       
      repeated string scopes = 1;
      Parameters:
      value - The bytes of the scopes to add.
      Returns:
      This builder for chaining.
    • getResourceIdPatternsList

      public com.google.protobuf.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;
      Specified by:
      getResourceIdPatternsList in interface ResourceFilterOrBuilder
      Returns:
      A list containing the resourceIdPatterns.
    • 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;
      Specified by:
      getResourceIdPatternsCount in interface ResourceFilterOrBuilder
      Returns:
      The count of resourceIdPatterns.
    • getResourceIdPatterns

      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;
      Specified by:
      getResourceIdPatterns in interface ResourceFilterOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The resourceIdPatterns at the given index.
    • getResourceIdPatternsBytes

      public com.google.protobuf.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;
      Specified by:
      getResourceIdPatternsBytes in interface ResourceFilterOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the resourceIdPatterns at the given index.
    • setResourceIdPatterns

      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:
      index - The index to set the value at.
      value - The resourceIdPatterns to set.
      Returns:
      This builder for chaining.
    • addResourceIdPatterns

      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;
      Parameters:
      value - The resourceIdPatterns to add.
      Returns:
      This builder for chaining.
    • addAllResourceIdPatterns

      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;
      Parameters:
      values - The resourceIdPatterns to add.
      Returns:
      This builder for chaining.
    • 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:
      This builder for chaining.
    • addResourceIdPatternsBytes

      public ResourceFilter.Builder addResourceIdPatternsBytes(com.google.protobuf.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;
      Parameters:
      value - The bytes of the resourceIdPatterns to add.
      Returns:
      This builder for chaining.
    • getInclusionLabelsCount

      public int getInclusionLabelsCount()
      Description copied from interface: ResourceFilterOrBuilder
       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;
      Specified by:
      getInclusionLabelsCount in interface ResourceFilterOrBuilder
    • containsInclusionLabels

      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;
      Specified by:
      containsInclusionLabels in interface ResourceFilterOrBuilder
    • getInclusionLabels

      @Deprecated public Map<String,String> getInclusionLabels()
      Deprecated.
      Specified by:
      getInclusionLabels in interface ResourceFilterOrBuilder
    • 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;
      Specified by:
      getInclusionLabelsMap in interface ResourceFilterOrBuilder
    • getInclusionLabelsOrDefault

      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;
      Specified by:
      getInclusionLabelsOrDefault in interface ResourceFilterOrBuilder
    • getInclusionLabelsOrThrow

      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;
      Specified by:
      getInclusionLabelsOrThrow in interface ResourceFilterOrBuilder
    • clearInclusionLabels

      public ResourceFilter.Builder clearInclusionLabels()
    • removeInclusionLabels

      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;
    • getMutableInclusionLabels

      @Deprecated public Map<String,String> getMutableInclusionLabels()
      Deprecated.
      Use alternate mutation accessors instead.
    • putInclusionLabels

      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;
    • putAllInclusionLabels

      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;
    • hasGceInstanceFilter

      public boolean hasGceInstanceFilter()
       Filter compute engine resources.
       
      .google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;
      Specified by:
      hasGceInstanceFilter in interface ResourceFilterOrBuilder
      Returns:
      Whether the gceInstanceFilter field is set.
    • getGceInstanceFilter

      public GceInstanceFilter getGceInstanceFilter()
       Filter compute engine resources.
       
      .google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;
      Specified by:
      getGceInstanceFilter in interface ResourceFilterOrBuilder
      Returns:
      The gceInstanceFilter.
    • setGceInstanceFilter

      public ResourceFilter.Builder setGceInstanceFilter(GceInstanceFilter value)
       Filter compute engine resources.
       
      .google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;
    • setGceInstanceFilter

      public ResourceFilter.Builder setGceInstanceFilter(GceInstanceFilter.Builder builderForValue)
       Filter compute engine resources.
       
      .google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;
    • mergeGceInstanceFilter

      public ResourceFilter.Builder mergeGceInstanceFilter(GceInstanceFilter value)
       Filter compute engine resources.
       
      .google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;
    • clearGceInstanceFilter

      public ResourceFilter.Builder clearGceInstanceFilter()
       Filter compute engine resources.
       
      .google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;
    • getGceInstanceFilterBuilder

      public GceInstanceFilter.Builder getGceInstanceFilterBuilder()
       Filter compute engine resources.
       
      .google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;
    • getGceInstanceFilterOrBuilder

      public GceInstanceFilterOrBuilder getGceInstanceFilterOrBuilder()
       Filter compute engine resources.
       
      .google.cloud.workloadmanager.v1.GceInstanceFilter gce_instance_filter = 4;
      Specified by:
      getGceInstanceFilterOrBuilder in interface ResourceFilterOrBuilder