Class TagValuesClient

  • All Implemented Interfaces:
    com.google.api.gax.core.BackgroundResource, AutoCloseable

    @Generated("by gapic-generator-java")
    public class TagValuesClient
    extends Object
    implements com.google.api.gax.core.BackgroundResource
    Service Description: Allow users to create and manage tag values.

    This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
       TagValueName name = TagValueName.of("[TAG_VALUE]");
       TagValue response = tagValuesClient.getTagValue(name);
     }
     

    Note: close() needs to be called on the TagValuesClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

    The surface of this class includes several types of Java methods for each of the API's methods:

    1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
    2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
    3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

    See the individual methods for example code.

    Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

    This class can be customized by passing in a custom instance of TagValuesSettings to create(). For example:

    To customize credentials:

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     TagValuesSettings tagValuesSettings =
         TagValuesSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     TagValuesClient tagValuesClient = TagValuesClient.create(tagValuesSettings);
     

    To customize the endpoint:

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     TagValuesSettings tagValuesSettings =
         TagValuesSettings.newBuilder().setEndpoint(myEndpoint).build();
     TagValuesClient tagValuesClient = TagValuesClient.create(tagValuesSettings);
     

    To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:

    
     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     TagValuesSettings tagValuesSettings = TagValuesSettings.newHttpJsonBuilder().build();
     TagValuesClient tagValuesClient = TagValuesClient.create(tagValuesSettings);
     

    Please refer to the GitHub repository's samples for more quickstart code snippets.

    • Constructor Detail

      • TagValuesClient

        protected TagValuesClient​(TagValuesSettings settings)
                           throws IOException
        Constructs an instance of TagValuesClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
        Throws:
        IOException
      • TagValuesClient

        protected TagValuesClient​(TagValuesStub stub)
    • Method Detail

      • create

        public static final TagValuesClient create​(TagValuesSettings settings)
                                            throws IOException
        Constructs an instance of TagValuesClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
        Throws:
        IOException
      • create

        public static final TagValuesClient create​(TagValuesStub stub)
        Constructs an instance of TagValuesClient, using the given stub for making calls. This is for advanced usage - prefer using create(TagValuesSettings).
      • getOperationsClient

        public final com.google.longrunning.OperationsClient getOperationsClient()
        Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
      • getHttpJsonOperationsClient

        @BetaApi
        public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
        Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
      • listTagValues

        public final TagValuesClient.ListTagValuesPagedResponse listTagValues​(com.google.api.resourcenames.ResourceName parent)
        Lists all TagValues for a specific TagKey.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           ResourceName parent = FolderName.of("[FOLDER]");
           for (TagValue element : tagValuesClient.listTagValues(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTagValues

        public final TagValuesClient.ListTagValuesPagedResponse listTagValues​(String parent)
        Lists all TagValues for a specific TagKey.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           String parent = FolderName.of("[FOLDER]").toString();
           for (TagValue element : tagValuesClient.listTagValues(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTagValues

        public final TagValuesClient.ListTagValuesPagedResponse listTagValues​(ListTagValuesRequest request)
        Lists all TagValues for a specific TagKey.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           ListTagValuesRequest request =
               ListTagValuesRequest.newBuilder()
                   .setParent(FolderName.of("[FOLDER]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (TagValue element : tagValuesClient.listTagValues(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTagValuesPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListTagValuesRequest,​TagValuesClient.ListTagValuesPagedResponse> listTagValuesPagedCallable()
        Lists all TagValues for a specific TagKey.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           ListTagValuesRequest request =
               ListTagValuesRequest.newBuilder()
                   .setParent(FolderName.of("[FOLDER]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<TagValue> future = tagValuesClient.listTagValuesPagedCallable().futureCall(request);
           // Do something.
           for (TagValue element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listTagValuesCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListTagValuesRequest,​ListTagValuesResponse> listTagValuesCallable()
        Lists all TagValues for a specific TagKey.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           ListTagValuesRequest request =
               ListTagValuesRequest.newBuilder()
                   .setParent(FolderName.of("[FOLDER]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListTagValuesResponse response = tagValuesClient.listTagValuesCallable().call(request);
             for (TagValue element : response.getTagValuesList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • getTagValue

        public final TagValue getTagValue​(TagValueName name)
        Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the value does not exist or the user does not have permission to view it.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           TagValueName name = TagValueName.of("[TAG_VALUE]");
           TagValue response = tagValuesClient.getTagValue(name);
         }
         
        Parameters:
        name - Required. Resource name for TagValue to be fetched in the format `tagValues/456`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTagValue

        public final TagValue getTagValue​(String name)
        Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the value does not exist or the user does not have permission to view it.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           String name = TagValueName.of("[TAG_VALUE]").toString();
           TagValue response = tagValuesClient.getTagValue(name);
         }
         
        Parameters:
        name - Required. Resource name for TagValue to be fetched in the format `tagValues/456`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTagValue

        public final TagValue getTagValue​(GetTagValueRequest request)
        Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the value does not exist or the user does not have permission to view it.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           GetTagValueRequest request =
               GetTagValueRequest.newBuilder()
                   .setName(TagValueName.of("[TAG_VALUE]").toString())
                   .build();
           TagValue response = tagValuesClient.getTagValue(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTagValueCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetTagValueRequest,​TagValue> getTagValueCallable()
        Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the value does not exist or the user does not have permission to view it.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           GetTagValueRequest request =
               GetTagValueRequest.newBuilder()
                   .setName(TagValueName.of("[TAG_VALUE]").toString())
                   .build();
           ApiFuture<TagValue> future = tagValuesClient.getTagValueCallable().futureCall(request);
           // Do something.
           TagValue response = future.get();
         }
         
      • getNamespacedTagValue

        public final TagValue getNamespacedTagValue​(TagValueName name)
        Retrieves a TagValue by its namespaced name. This method will return `PERMISSION_DENIED` if the value does not exist or the user does not have permission to view it.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           TagValueName name = TagValueName.of("[TAG_VALUE]");
           TagValue response = tagValuesClient.getNamespacedTagValue(name);
         }
         
        Parameters:
        name - Required. A namespaced tag value name in the following format:

        `{parentId}/{tagKeyShort}/{tagValueShort}`

        Examples: - `42/foo/abc` for a value with short name "abc" under the key with short name "foo" under the organization with ID 42 - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with short name "bar" under the project with ID "r2-d2"

        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getNamespacedTagValue

        public final TagValue getNamespacedTagValue​(String name)
        Retrieves a TagValue by its namespaced name. This method will return `PERMISSION_DENIED` if the value does not exist or the user does not have permission to view it.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           String name = TagValueName.of("[TAG_VALUE]").toString();
           TagValue response = tagValuesClient.getNamespacedTagValue(name);
         }
         
        Parameters:
        name - Required. A namespaced tag value name in the following format:

        `{parentId}/{tagKeyShort}/{tagValueShort}`

        Examples: - `42/foo/abc` for a value with short name "abc" under the key with short name "foo" under the organization with ID 42 - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with short name "bar" under the project with ID "r2-d2"

        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getNamespacedTagValue

        public final TagValue getNamespacedTagValue​(GetNamespacedTagValueRequest request)
        Retrieves a TagValue by its namespaced name. This method will return `PERMISSION_DENIED` if the value does not exist or the user does not have permission to view it.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           GetNamespacedTagValueRequest request =
               GetNamespacedTagValueRequest.newBuilder()
                   .setName(TagValueName.of("[TAG_VALUE]").toString())
                   .build();
           TagValue response = tagValuesClient.getNamespacedTagValue(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getNamespacedTagValueCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetNamespacedTagValueRequest,​TagValue> getNamespacedTagValueCallable()
        Retrieves a TagValue by its namespaced name. This method will return `PERMISSION_DENIED` if the value does not exist or the user does not have permission to view it.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           GetNamespacedTagValueRequest request =
               GetNamespacedTagValueRequest.newBuilder()
                   .setName(TagValueName.of("[TAG_VALUE]").toString())
                   .build();
           ApiFuture<TagValue> future =
               tagValuesClient.getNamespacedTagValueCallable().futureCall(request);
           // Do something.
           TagValue response = future.get();
         }
         
      • createTagValueAsync

        public final com.google.api.gax.longrunning.OperationFuture<TagValue,​CreateTagValueMetadata> createTagValueAsync​(TagValue tagValue)
        Creates a TagValue as a child of the specified TagKey. If a another request with the same parameters is sent while the original request is in process the second request will receive an error. A maximum of 1000 TagValues can exist under a TagKey at any given time.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           TagValue tagValue = TagValue.newBuilder().build();
           TagValue response = tagValuesClient.createTagValueAsync(tagValue).get();
         }
         
        Parameters:
        tagValue - Required. The TagValue to be created. Only fields `short_name`, `description`, and `parent` are considered during the creation request.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createTagValueAsync

        public final com.google.api.gax.longrunning.OperationFuture<TagValue,​CreateTagValueMetadata> createTagValueAsync​(CreateTagValueRequest request)
        Creates a TagValue as a child of the specified TagKey. If a another request with the same parameters is sent while the original request is in process the second request will receive an error. A maximum of 1000 TagValues can exist under a TagKey at any given time.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           CreateTagValueRequest request =
               CreateTagValueRequest.newBuilder()
                   .setTagValue(TagValue.newBuilder().build())
                   .setValidateOnly(true)
                   .build();
           TagValue response = tagValuesClient.createTagValueAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createTagValueOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<CreateTagValueRequest,​TagValue,​CreateTagValueMetadata> createTagValueOperationCallable()
        Creates a TagValue as a child of the specified TagKey. If a another request with the same parameters is sent while the original request is in process the second request will receive an error. A maximum of 1000 TagValues can exist under a TagKey at any given time.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           CreateTagValueRequest request =
               CreateTagValueRequest.newBuilder()
                   .setTagValue(TagValue.newBuilder().build())
                   .setValidateOnly(true)
                   .build();
           OperationFuture<TagValue, CreateTagValueMetadata> future =
               tagValuesClient.createTagValueOperationCallable().futureCall(request);
           // Do something.
           TagValue response = future.get();
         }
         
      • createTagValueCallable

        public final com.google.api.gax.rpc.UnaryCallable<CreateTagValueRequest,​com.google.longrunning.Operation> createTagValueCallable()
        Creates a TagValue as a child of the specified TagKey. If a another request with the same parameters is sent while the original request is in process the second request will receive an error. A maximum of 1000 TagValues can exist under a TagKey at any given time.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           CreateTagValueRequest request =
               CreateTagValueRequest.newBuilder()
                   .setTagValue(TagValue.newBuilder().build())
                   .setValidateOnly(true)
                   .build();
           ApiFuture<Operation> future = tagValuesClient.createTagValueCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • updateTagValueAsync

        public final com.google.api.gax.longrunning.OperationFuture<TagValue,​UpdateTagValueMetadata> updateTagValueAsync​(TagValue tagValue,
                                                                                                                               com.google.protobuf.FieldMask updateMask)
        Updates the attributes of the TagValue resource.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           TagValue tagValue = TagValue.newBuilder().build();
           FieldMask updateMask = FieldMask.newBuilder().build();
           TagValue response = tagValuesClient.updateTagValueAsync(tagValue, updateMask).get();
         }
         
        Parameters:
        tagValue - Required. The new definition of the TagValue. Only fields `description` and `etag` fields can be updated by this request. If the `etag` field is nonempty, it must match the `etag` field of the existing ControlGroup. Otherwise, `ABORTED` will be returned.
        updateMask - Optional. Fields to be updated.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateTagValueAsync

        public final com.google.api.gax.longrunning.OperationFuture<TagValue,​UpdateTagValueMetadata> updateTagValueAsync​(UpdateTagValueRequest request)
        Updates the attributes of the TagValue resource.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           UpdateTagValueRequest request =
               UpdateTagValueRequest.newBuilder()
                   .setTagValue(TagValue.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setValidateOnly(true)
                   .build();
           TagValue response = tagValuesClient.updateTagValueAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateTagValueOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<UpdateTagValueRequest,​TagValue,​UpdateTagValueMetadata> updateTagValueOperationCallable()
        Updates the attributes of the TagValue resource.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           UpdateTagValueRequest request =
               UpdateTagValueRequest.newBuilder()
                   .setTagValue(TagValue.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setValidateOnly(true)
                   .build();
           OperationFuture<TagValue, UpdateTagValueMetadata> future =
               tagValuesClient.updateTagValueOperationCallable().futureCall(request);
           // Do something.
           TagValue response = future.get();
         }
         
      • updateTagValueCallable

        public final com.google.api.gax.rpc.UnaryCallable<UpdateTagValueRequest,​com.google.longrunning.Operation> updateTagValueCallable()
        Updates the attributes of the TagValue resource.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           UpdateTagValueRequest request =
               UpdateTagValueRequest.newBuilder()
                   .setTagValue(TagValue.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setValidateOnly(true)
                   .build();
           ApiFuture<Operation> future = tagValuesClient.updateTagValueCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • deleteTagValueAsync

        public final com.google.api.gax.longrunning.OperationFuture<TagValue,​DeleteTagValueMetadata> deleteTagValueAsync​(TagValueName name)
        Deletes a TagValue. The TagValue cannot have any bindings when it is deleted.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           TagValueName name = TagValueName.of("[TAG_VALUE]");
           TagValue response = tagValuesClient.deleteTagValueAsync(name).get();
         }
         
        Parameters:
        name - Required. Resource name for TagValue to be deleted in the format tagValues/456.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTagValueAsync

        public final com.google.api.gax.longrunning.OperationFuture<TagValue,​DeleteTagValueMetadata> deleteTagValueAsync​(String name)
        Deletes a TagValue. The TagValue cannot have any bindings when it is deleted.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           String name = TagValueName.of("[TAG_VALUE]").toString();
           TagValue response = tagValuesClient.deleteTagValueAsync(name).get();
         }
         
        Parameters:
        name - Required. Resource name for TagValue to be deleted in the format tagValues/456.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTagValueAsync

        public final com.google.api.gax.longrunning.OperationFuture<TagValue,​DeleteTagValueMetadata> deleteTagValueAsync​(DeleteTagValueRequest request)
        Deletes a TagValue. The TagValue cannot have any bindings when it is deleted.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           DeleteTagValueRequest request =
               DeleteTagValueRequest.newBuilder()
                   .setName(TagValueName.of("[TAG_VALUE]").toString())
                   .setValidateOnly(true)
                   .setEtag("etag3123477")
                   .build();
           TagValue response = tagValuesClient.deleteTagValueAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTagValueOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<DeleteTagValueRequest,​TagValue,​DeleteTagValueMetadata> deleteTagValueOperationCallable()
        Deletes a TagValue. The TagValue cannot have any bindings when it is deleted.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           DeleteTagValueRequest request =
               DeleteTagValueRequest.newBuilder()
                   .setName(TagValueName.of("[TAG_VALUE]").toString())
                   .setValidateOnly(true)
                   .setEtag("etag3123477")
                   .build();
           OperationFuture<TagValue, DeleteTagValueMetadata> future =
               tagValuesClient.deleteTagValueOperationCallable().futureCall(request);
           // Do something.
           TagValue response = future.get();
         }
         
      • deleteTagValueCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteTagValueRequest,​com.google.longrunning.Operation> deleteTagValueCallable()
        Deletes a TagValue. The TagValue cannot have any bindings when it is deleted.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           DeleteTagValueRequest request =
               DeleteTagValueRequest.newBuilder()
                   .setName(TagValueName.of("[TAG_VALUE]").toString())
                   .setValidateOnly(true)
                   .setEtag("etag3123477")
                   .build();
           ApiFuture<Operation> future = tagValuesClient.deleteTagValueCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • getIamPolicy

        public final com.google.iam.v1.Policy getIamPolicy​(com.google.api.resourcenames.ResourceName resource)
        Gets the access control policy for a TagValue. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`. The caller must have the `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on the identified TagValue to get the access control policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           ResourceName resource = TagValueName.of("[TAG_VALUE]");
           Policy response = tagValuesClient.getIamPolicy(resource);
         }
         
        Parameters:
        resource - REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getIamPolicy

        public final com.google.iam.v1.Policy getIamPolicy​(String resource)
        Gets the access control policy for a TagValue. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`. The caller must have the `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on the identified TagValue to get the access control policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           String resource = FolderName.of("[FOLDER]").toString();
           Policy response = tagValuesClient.getIamPolicy(resource);
         }
         
        Parameters:
        resource - REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getIamPolicy

        public final com.google.iam.v1.Policy getIamPolicy​(com.google.iam.v1.GetIamPolicyRequest request)
        Gets the access control policy for a TagValue. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`. The caller must have the `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on the identified TagValue to get the access control policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           GetIamPolicyRequest request =
               GetIamPolicyRequest.newBuilder()
                   .setResource(TagValueName.of("[TAG_VALUE]").toString())
                   .setOptions(GetPolicyOptions.newBuilder().build())
                   .build();
           Policy response = tagValuesClient.getIamPolicy(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getIamPolicyCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,​com.google.iam.v1.Policy> getIamPolicyCallable()
        Gets the access control policy for a TagValue. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`. The caller must have the `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on the identified TagValue to get the access control policy.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           GetIamPolicyRequest request =
               GetIamPolicyRequest.newBuilder()
                   .setResource(TagValueName.of("[TAG_VALUE]").toString())
                   .setOptions(GetPolicyOptions.newBuilder().build())
                   .build();
           ApiFuture<Policy> future = tagValuesClient.getIamPolicyCallable().futureCall(request);
           // Do something.
           Policy response = future.get();
         }
         
      • setIamPolicy

        public final com.google.iam.v1.Policy setIamPolicy​(com.google.api.resourcenames.ResourceName resource,
                                                           com.google.iam.v1.Policy policy)
        Sets the access control policy on a TagValue, replacing any existing policy. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`. The caller must have `resourcemanager.tagValues.setIamPolicy` permission on the identified tagValue.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           ResourceName resource = TagValueName.of("[TAG_VALUE]");
           Policy policy = Policy.newBuilder().build();
           Policy response = tagValuesClient.setIamPolicy(resource, policy);
         }
         
        Parameters:
        resource - REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
        policy - REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • setIamPolicy

        public final com.google.iam.v1.Policy setIamPolicy​(String resource,
                                                           com.google.iam.v1.Policy policy)
        Sets the access control policy on a TagValue, replacing any existing policy. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`. The caller must have `resourcemanager.tagValues.setIamPolicy` permission on the identified tagValue.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           String resource = FolderName.of("[FOLDER]").toString();
           Policy policy = Policy.newBuilder().build();
           Policy response = tagValuesClient.setIamPolicy(resource, policy);
         }
         
        Parameters:
        resource - REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
        policy - REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • setIamPolicy

        public final com.google.iam.v1.Policy setIamPolicy​(com.google.iam.v1.SetIamPolicyRequest request)
        Sets the access control policy on a TagValue, replacing any existing policy. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`. The caller must have `resourcemanager.tagValues.setIamPolicy` permission on the identified tagValue.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           SetIamPolicyRequest request =
               SetIamPolicyRequest.newBuilder()
                   .setResource(TagValueName.of("[TAG_VALUE]").toString())
                   .setPolicy(Policy.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           Policy response = tagValuesClient.setIamPolicy(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • setIamPolicyCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,​com.google.iam.v1.Policy> setIamPolicyCallable()
        Sets the access control policy on a TagValue, replacing any existing policy. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`. The caller must have `resourcemanager.tagValues.setIamPolicy` permission on the identified tagValue.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           SetIamPolicyRequest request =
               SetIamPolicyRequest.newBuilder()
                   .setResource(TagValueName.of("[TAG_VALUE]").toString())
                   .setPolicy(Policy.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           ApiFuture<Policy> future = tagValuesClient.setIamPolicyCallable().futureCall(request);
           // Do something.
           Policy response = future.get();
         }
         
      • testIamPermissions

        public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions​(com.google.api.resourcenames.ResourceName resource,
                                                                                     List<String> permissions)
        Returns permissions that a caller has on the specified TagValue. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`.

        There are no permissions required for making this API call.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           ResourceName resource = TagValueName.of("[TAG_VALUE]");
           List<String> permissions = new ArrayList<>();
           TestIamPermissionsResponse response =
               tagValuesClient.testIamPermissions(resource, permissions);
         }
         
        Parameters:
        resource - REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
        permissions - The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • testIamPermissions

        public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions​(String resource,
                                                                                     List<String> permissions)
        Returns permissions that a caller has on the specified TagValue. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`.

        There are no permissions required for making this API call.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           String resource = FolderName.of("[FOLDER]").toString();
           List<String> permissions = new ArrayList<>();
           TestIamPermissionsResponse response =
               tagValuesClient.testIamPermissions(resource, permissions);
         }
         
        Parameters:
        resource - REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
        permissions - The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • testIamPermissions

        public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions​(com.google.iam.v1.TestIamPermissionsRequest request)
        Returns permissions that a caller has on the specified TagValue. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`.

        There are no permissions required for making this API call.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           TestIamPermissionsRequest request =
               TestIamPermissionsRequest.newBuilder()
                   .setResource(TagValueName.of("[TAG_VALUE]").toString())
                   .addAllPermissions(new ArrayList<String>())
                   .build();
           TestIamPermissionsResponse response = tagValuesClient.testIamPermissions(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • testIamPermissionsCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,​com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
        Returns permissions that a caller has on the specified TagValue. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`.

        There are no permissions required for making this API call.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
           TestIamPermissionsRequest request =
               TestIamPermissionsRequest.newBuilder()
                   .setResource(TagValueName.of("[TAG_VALUE]").toString())
                   .addAllPermissions(new ArrayList<String>())
                   .build();
           ApiFuture<TestIamPermissionsResponse> future =
               tagValuesClient.testIamPermissionsCallable().futureCall(request);
           // Do something.
           TestIamPermissionsResponse response = future.get();
         }
         
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface com.google.api.gax.core.BackgroundResource
      • isShutdown

        public boolean isShutdown()
        Specified by:
        isShutdown in interface com.google.api.gax.core.BackgroundResource
      • isTerminated

        public boolean isTerminated()
        Specified by:
        isTerminated in interface com.google.api.gax.core.BackgroundResource
      • shutdownNow

        public void shutdownNow()
        Specified by:
        shutdownNow in interface com.google.api.gax.core.BackgroundResource