# Class TagHoldsClient (1.95.0)

1.95.0 (latest) 1.93.0 1.90.0 1.89.0 1.87.0 1.85.0 1.84.0 1.82.0 1.80.0 1.78.0 1.77.0 1.76.0 1.75.0 1.74.0 1.72.0 1.70.0 1.69.0 1.66.0 1.65.0 1.64.0 1.62.0 1.61.0 1.60.0 1.59.0 1.58.0 1.57.0 1.56.0 1.55.0 1.54.0 1.53.0 1.51.0 1.50.0 1.49.0 1.48.0 1.47.0 1.46.0 1.45.0 1.44.0 1.43.0 1.42.0 1.41.0 1.39.0 1.38.0 1.37.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.26.0 1.25.0 1.24.0 1.23.0 1.22.0 1.21.0 1.20.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.0 1.14.0 1.13.0 1.11.0 1.10.0 1.9.0 1.8.0 1.7.0 1.6.0 1.5.6 1.4.0 1.3.2 1.2.12

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagHoldsClient.java) | [Product Reference](https://cloud.google.com/resource-manager) |

Service Description: Allow users to create and manage TagHolds for TagValues. TagHolds represent
the use of a Tag Value that is not captured by TagBindings but should still block TagValue
deletion (such as a reference in a policy condition). This service provides isolated failure
domains by cloud location so that TagHolds can be managed in the same location as their usage.

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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       TagValueName parent = TagValueName.of("[TAG_VALUE]");
       TagHold tagHold = TagHold.newBuilder().build();
       TagHold response = tagHoldsClient.createTagHoldAsync(parent, tagHold).get();
     }
     
Note: close() needs to be called on the TagHoldsClient object to clean up resources such as
threads. In the example above, try-with-resources is used, which automatically calls close().

| Method | Description | Method Variants |
|---|---|---|
| CreateTagHold | Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createTagHoldAsync(CreateTagHoldRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - createTagHoldAsync(TagValueName parent, TagHold tagHold) - createTagHoldAsync(String parent, TagHold tagHold) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createTagHoldOperationCallable() - createTagHoldCallable() |
| DeleteTagHold | Deletes a TagHold. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteTagHoldAsync(DeleteTagHoldRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - deleteTagHoldAsync(TagHoldName name) - deleteTagHoldAsync(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteTagHoldOperationCallable() - deleteTagHoldCallable() |
| ListTagHolds | Lists TagHolds under a TagValue. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listTagHolds(ListTagHoldsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listTagHolds(TagValueName parent) - listTagHolds(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listTagHoldsPagedCallable() - listTagHoldsCallable() |
[Methods]

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 TagHoldsSettings 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
     TagHoldsSettings tagHoldsSettings =
         TagHoldsSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     TagHoldsClient tagHoldsClient = TagHoldsClient.create(tagHoldsSettings);
     
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
     TagHoldsSettings tagHoldsSettings =
         TagHoldsSettings.newBuilder().setEndpoint(myEndpoint).build();
     TagHoldsClient tagHoldsClient = TagHoldsClient.create(tagHoldsSettings);
     
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
     TagHoldsSettings tagHoldsSettings = TagHoldsSettings.newHttpJsonBuilder().build();
     TagHoldsClient tagHoldsClient = TagHoldsClient.create(tagHoldsSettings);
     
Please refer to the GitHub repository's samples for more quickstart code snippets.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> TagHoldsClient

## Static Methods

### create()

    public static final TagHoldsClient create()

Constructs an instance of TagHoldsClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHoldsClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(TagHoldsSettings settings)

    public static final TagHoldsClient create(TagHoldsSettings settings)

Constructs an instance of TagHoldsClient, using the given settings. The channels are created
based on the settings passed in, or defaults for any settings that are not set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHoldsSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHoldsClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(TagHoldsStub stub)

    public static final TagHoldsClient create(TagHoldsStub stub)

Constructs an instance of TagHoldsClient, using the given stub for making calls. This is for
advanced usage - prefer using create(TagHoldsSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.stub.TagHoldsStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHoldsClient` |   |

## Constructors

### TagHoldsClient(TagHoldsSettings settings)

    protected TagHoldsClient(TagHoldsSettings settings)

Constructs an instance of TagHoldsClient, 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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHoldsSettings` |

### TagHoldsClient(TagHoldsStub stub)

    protected TagHoldsClient(TagHoldsStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.stub.TagHoldsStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### close()

    public final void close()

### createTagHoldAsync(CreateTagHoldRequest request)

    public final OperationFuture<TagHold,CreateTagHoldMetadata> createTagHoldAsync(CreateTagHoldRequest request)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists
under the same 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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       CreateTagHoldRequest request =
           CreateTagHoldRequest.newBuilder()
               .setParent(TagValueName.of("[TAG_VALUE]").toString())
               .setTagHold(TagHold.newBuilder().build())
               .setValidateOnly(true)
               .build();
       TagHold response = tagHoldsClient.createTagHoldAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.CreateTagHoldRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHold,https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.CreateTagHoldMetadata>` |   |

### createTagHoldAsync(TagValueName parent, TagHold tagHold)

    public final OperationFuture<TagHold,CreateTagHoldMetadata> createTagHoldAsync(TagValueName parent, TagHold tagHold)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists
under the same 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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       TagValueName parent = TagValueName.of("[TAG_VALUE]");
       TagHold tagHold = TagHold.newBuilder().build();
       TagHold response = tagHoldsClient.createTagHoldAsync(parent, tagHold).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagValueName` Required. The resource name of the TagHold's parent TagValue. Must be of the form: `tagValues/{tag-value-id}`. |
| `tagHold` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHold` Required. The TagHold to be created. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHold,https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.CreateTagHoldMetadata>` |   |

### createTagHoldAsync(String parent, TagHold tagHold)

    public final OperationFuture<TagHold,CreateTagHoldMetadata> createTagHoldAsync(String parent, TagHold tagHold)

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists
under the same 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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       String parent = TagValueName.of("[TAG_VALUE]").toString();
       TagHold tagHold = TagHold.newBuilder().build();
       TagHold response = tagHoldsClient.createTagHoldAsync(parent, tagHold).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the TagHold's parent TagValue. Must be of the form: `tagValues/{tag-value-id}`. |
| `tagHold` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHold` Required. The TagHold to be created. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHold,https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.CreateTagHoldMetadata>` |   |

### createTagHoldCallable()

    public final UnaryCallable<CreateTagHoldRequest,Operation> createTagHoldCallable()

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists
under the same 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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       CreateTagHoldRequest request =
           CreateTagHoldRequest.newBuilder()
               .setParent(TagValueName.of("[TAG_VALUE]").toString())
               .setTagHold(TagHold.newBuilder().build())
               .setValidateOnly(true)
               .build();
       ApiFuture<Operation> future = tagHoldsClient.createTagHoldCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.CreateTagHoldRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### createTagHoldOperationCallable()

    public final OperationCallable<CreateTagHoldRequest,TagHold,CreateTagHoldMetadata> createTagHoldOperationCallable()

Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists
under the same 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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       CreateTagHoldRequest request =
           CreateTagHoldRequest.newBuilder()
               .setParent(TagValueName.of("[TAG_VALUE]").toString())
               .setTagHold(TagHold.newBuilder().build())
               .setValidateOnly(true)
               .build();
       OperationFuture<TagHold, CreateTagHoldMetadata> future =
           tagHoldsClient.createTagHoldOperationCallable().futureCall(request);
       // Do something.
       TagHold response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.CreateTagHoldRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHold,https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.CreateTagHoldMetadata>` |   |

### deleteTagHoldAsync(DeleteTagHoldRequest request)

    public final OperationFuture<Empty,DeleteTagHoldMetadata> deleteTagHoldAsync(DeleteTagHoldRequest request)

Deletes a TagHold.

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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       DeleteTagHoldRequest request =
           DeleteTagHoldRequest.newBuilder()
               .setName(TagHoldName.of("[TAG_VALUE]", "[TAG_HOLD]").toString())
               .setValidateOnly(true)
               .build();
       tagHoldsClient.deleteTagHoldAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.DeleteTagHoldRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.DeleteTagHoldMetadata>` |   |

### deleteTagHoldAsync(TagHoldName name)

    public final OperationFuture<Empty,DeleteTagHoldMetadata> deleteTagHoldAsync(TagHoldName name)

Deletes a TagHold.

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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       TagHoldName name = TagHoldName.of("[TAG_VALUE]", "[TAG_HOLD]");
       tagHoldsClient.deleteTagHoldAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHoldName` Required. The resource name of the TagHold to delete. Must be of the form: `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.DeleteTagHoldMetadata>` |   |

### deleteTagHoldAsync(String name)

    public final OperationFuture<Empty,DeleteTagHoldMetadata> deleteTagHoldAsync(String name)

Deletes a TagHold.

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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       String name = TagHoldName.of("[TAG_VALUE]", "[TAG_HOLD]").toString();
       tagHoldsClient.deleteTagHoldAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the TagHold to delete. Must be of the form: `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.DeleteTagHoldMetadata>` |   |

### deleteTagHoldCallable()

    public final UnaryCallable<DeleteTagHoldRequest,Operation> deleteTagHoldCallable()

Deletes a TagHold.

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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       DeleteTagHoldRequest request =
           DeleteTagHoldRequest.newBuilder()
               .setName(TagHoldName.of("[TAG_VALUE]", "[TAG_HOLD]").toString())
               .setValidateOnly(true)
               .build();
       ApiFuture<Operation> future = tagHoldsClient.deleteTagHoldCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.DeleteTagHoldRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### deleteTagHoldOperationCallable()

    public final OperationCallable<DeleteTagHoldRequest,Empty,DeleteTagHoldMetadata> deleteTagHoldOperationCallable()

Deletes a TagHold.

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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       DeleteTagHoldRequest request =
           DeleteTagHoldRequest.newBuilder()
               .setName(TagHoldName.of("[TAG_VALUE]", "[TAG_HOLD]").toString())
               .setValidateOnly(true)
               .build();
       OperationFuture<Empty, DeleteTagHoldMetadata> future =
           tagHoldsClient.deleteTagHoldOperationCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.DeleteTagHoldRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.DeleteTagHoldMetadata>` |   |

### getHttpJsonOperationsClient()

    public final OperationsClient getHttpJsonOperationsClient()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.httpjson.longrunning.OperationsClient.html` |   |

### getOperationsClient()

    public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.OperationsClient.html` |   |

### getSettings()

    public final TagHoldsSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHoldsSettings` |   |

### getStub()

    public TagHoldsStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.stub.TagHoldsStub` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### listTagHolds(ListTagHoldsRequest request)

    public final TagHoldsClient.ListTagHoldsPagedResponse listTagHolds(ListTagHoldsRequest request)

Lists TagHolds under a 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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       ListTagHoldsRequest request =
           ListTagHoldsRequest.newBuilder()
               .setParent(TagValueName.of("[TAG_VALUE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .build();
       for (TagHold element : tagHoldsClient.listTagHolds(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.ListTagHoldsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHoldsClient.ListTagHoldsPagedResponse` |   |

### listTagHolds(TagValueName parent)

    public final TagHoldsClient.ListTagHoldsPagedResponse listTagHolds(TagValueName parent)

Lists TagHolds under a 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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       TagValueName parent = TagValueName.of("[TAG_VALUE]");
       for (TagHold element : tagHoldsClient.listTagHolds(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagValueName` Required. The resource name of the parent TagValue. Must be of the form: `tagValues/{tag-value-id}`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHoldsClient.ListTagHoldsPagedResponse` |   |

### listTagHolds(String parent)

    public final TagHoldsClient.ListTagHoldsPagedResponse listTagHolds(String parent)

Lists TagHolds under a 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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       String parent = TagValueName.of("[TAG_VALUE]").toString();
       for (TagHold element : tagHoldsClient.listTagHolds(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the parent TagValue. Must be of the form: `tagValues/{tag-value-id}`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHoldsClient.ListTagHoldsPagedResponse` |   |

### listTagHoldsCallable()

    public final UnaryCallable<ListTagHoldsRequest,ListTagHoldsResponse> listTagHoldsCallable()

Lists TagHolds under a 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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       ListTagHoldsRequest request =
           ListTagHoldsRequest.newBuilder()
               .setParent(TagValueName.of("[TAG_VALUE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .build();
       while (true) {
         ListTagHoldsResponse response = tagHoldsClient.listTagHoldsCallable().call(request);
         for (TagHold element : response.getTagHoldsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.ListTagHoldsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.ListTagHoldsResponse>` |   |

### listTagHoldsPagedCallable()

    public final UnaryCallable<ListTagHoldsRequest,TagHoldsClient.ListTagHoldsPagedResponse> listTagHoldsPagedCallable()

Lists TagHolds under a 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 (TagHoldsClient tagHoldsClient = TagHoldsClient.create()) {
       ListTagHoldsRequest request =
           ListTagHoldsRequest.newBuilder()
               .setParent(TagValueName.of("[TAG_VALUE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .build();
       ApiFuture<TagHold> future = tagHoldsClient.listTagHoldsPagedCallable().futureCall(request);
       // Do something.
       for (TagHold element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.ListTagHoldsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-resourcemanager/latest/com.google.cloud.resourcemanager.v3.TagHoldsClient.ListTagHoldsPagedResponse>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()