Class PolicyTagManagerClient (1.49.0)

GitHub RepositoryProduct Reference

Service Description: The policy tag manager API service allows clients to manage their taxonomies and policy tags.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Taxonomy taxonomy = Taxonomy.newBuilder().build();
   Taxonomy response = policyTagManagerClient.createTaxonomy(parent, taxonomy);
 }
 

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

Methods
Method Description Method Variants

CreateTaxonomy

Creates a taxonomy in the specified project.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createTaxonomy(CreateTaxonomyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createTaxonomy(LocationName parent, Taxonomy taxonomy)

  • createTaxonomy(String parent, Taxonomy taxonomy)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createTaxonomyCallable()

DeleteTaxonomy

Deletes a taxonomy. This operation will also delete all policy tags in this taxonomy along with their associated policies.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteTaxonomy(DeleteTaxonomyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteTaxonomy(TaxonomyName name)

  • deleteTaxonomy(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.

  • deleteTaxonomyCallable()

UpdateTaxonomy

Updates a taxonomy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateTaxonomy(UpdateTaxonomyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateTaxonomy(Taxonomy taxonomy)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateTaxonomyCallable()

ListTaxonomies

Lists all taxonomies in a project in a particular location that the caller has permission to view.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listTaxonomies(ListTaxonomiesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listTaxonomies(LocationName parent)

  • listTaxonomies(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.

  • listTaxonomiesPagedCallable()

  • listTaxonomiesCallable()

GetTaxonomy

Gets a taxonomy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getTaxonomy(GetTaxonomyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getTaxonomy(TaxonomyName name)

  • getTaxonomy(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.

  • getTaxonomyCallable()

CreatePolicyTag

Creates a policy tag in the specified taxonomy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createPolicyTag(CreatePolicyTagRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createPolicyTag(TaxonomyName parent, PolicyTag policyTag)

  • createPolicyTag(String parent, PolicyTag policyTag)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createPolicyTagCallable()

DeletePolicyTag

Deletes a policy tag. Also deletes all of its descendant policy tags.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deletePolicyTag(DeletePolicyTagRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deletePolicyTag(PolicyTagName name)

  • deletePolicyTag(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.

  • deletePolicyTagCallable()

UpdatePolicyTag

Updates a policy tag.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updatePolicyTag(UpdatePolicyTagRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updatePolicyTag(PolicyTag policyTag)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updatePolicyTagCallable()

ListPolicyTags

Lists all policy tags in a taxonomy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listPolicyTags(ListPolicyTagsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listPolicyTags(TaxonomyName parent)

  • listPolicyTags(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.

  • listPolicyTagsPagedCallable()

  • listPolicyTagsCallable()

GetPolicyTag

Gets a policy tag.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getPolicyTag(GetPolicyTagRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getPolicyTag(PolicyTagName name)

  • getPolicyTag(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.

  • getPolicyTagCallable()

GetIamPolicy

Gets the IAM policy for a taxonomy or a policy tag.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getIamPolicy(GetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIamPolicyCallable()

SetIamPolicy

Sets the IAM policy for a taxonomy or a policy tag.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setIamPolicy(SetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setIamPolicyCallable()

TestIamPermissions

Returns the permissions that a caller has on the specified taxonomy or policy tag.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • testIamPermissions(TestIamPermissionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

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 PolicyTagManagerSettings 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
 PolicyTagManagerSettings policyTagManagerSettings =
     PolicyTagManagerSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 PolicyTagManagerClient policyTagManagerClient =
     PolicyTagManagerClient.create(policyTagManagerSettings);
 

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
 PolicyTagManagerSettings policyTagManagerSettings =
     PolicyTagManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
 PolicyTagManagerClient policyTagManagerClient =
     PolicyTagManagerClient.create(policyTagManagerSettings);
 

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
 PolicyTagManagerSettings policyTagManagerSettings =
     PolicyTagManagerSettings.newHttpJsonBuilder().build();
 PolicyTagManagerClient policyTagManagerClient =
     PolicyTagManagerClient.create(policyTagManagerSettings);
 

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

Inheritance

java.lang.Object > PolicyTagManagerClient

Static Methods

create()

public static final PolicyTagManagerClient create()

Constructs an instance of PolicyTagManagerClient with default settings.

Returns
Type Description
PolicyTagManagerClient
Exceptions
Type Description
IOException

create(PolicyTagManagerSettings settings)

public static final PolicyTagManagerClient create(PolicyTagManagerSettings settings)

Constructs an instance of PolicyTagManagerClient, 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 PolicyTagManagerSettings
Returns
Type Description
PolicyTagManagerClient
Exceptions
Type Description
IOException

create(PolicyTagManagerStub stub)

public static final PolicyTagManagerClient create(PolicyTagManagerStub stub)

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

Parameter
Name Description
stub PolicyTagManagerStub
Returns
Type Description
PolicyTagManagerClient

Constructors

PolicyTagManagerClient(PolicyTagManagerSettings settings)

protected PolicyTagManagerClient(PolicyTagManagerSettings settings)

Constructs an instance of PolicyTagManagerClient, 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 PolicyTagManagerSettings

PolicyTagManagerClient(PolicyTagManagerStub stub)

protected PolicyTagManagerClient(PolicyTagManagerStub stub)
Parameter
Name Description
stub PolicyTagManagerStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createPolicyTag(CreatePolicyTagRequest request)

public final PolicyTag createPolicyTag(CreatePolicyTagRequest request)

Creates a policy tag in the specified taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   CreatePolicyTagRequest request =
       CreatePolicyTagRequest.newBuilder()
           .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .setPolicyTag(PolicyTag.newBuilder().build())
           .build();
   PolicyTag response = policyTagManagerClient.createPolicyTag(request);
 }
 
Parameter
Name Description
request CreatePolicyTagRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
PolicyTag

createPolicyTag(TaxonomyName parent, PolicyTag policyTag)

public final PolicyTag createPolicyTag(TaxonomyName parent, PolicyTag policyTag)

Creates a policy tag in the specified taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
   PolicyTag policyTag = PolicyTag.newBuilder().build();
   PolicyTag response = policyTagManagerClient.createPolicyTag(parent, policyTag);
 }
 
Parameters
Name Description
parent TaxonomyName

Required. Resource name of the taxonomy that the policy tag will belong to.

policyTag PolicyTag

The policy tag to be created.

Returns
Type Description
PolicyTag

createPolicyTag(String parent, PolicyTag policyTag)

public final PolicyTag createPolicyTag(String parent, PolicyTag policyTag)

Creates a policy tag in the specified taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString();
   PolicyTag policyTag = PolicyTag.newBuilder().build();
   PolicyTag response = policyTagManagerClient.createPolicyTag(parent, policyTag);
 }
 
Parameters
Name Description
parent String

Required. Resource name of the taxonomy that the policy tag will belong to.

policyTag PolicyTag

The policy tag to be created.

Returns
Type Description
PolicyTag

createPolicyTagCallable()

public final UnaryCallable<CreatePolicyTagRequest,PolicyTag> createPolicyTagCallable()

Creates a policy tag in the specified taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   CreatePolicyTagRequest request =
       CreatePolicyTagRequest.newBuilder()
           .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .setPolicyTag(PolicyTag.newBuilder().build())
           .build();
   ApiFuture<PolicyTag> future =
       policyTagManagerClient.createPolicyTagCallable().futureCall(request);
   // Do something.
   PolicyTag response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreatePolicyTagRequest,PolicyTag>

createTaxonomy(CreateTaxonomyRequest request)

public final Taxonomy createTaxonomy(CreateTaxonomyRequest request)

Creates a taxonomy in the specified project.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   CreateTaxonomyRequest request =
       CreateTaxonomyRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTaxonomy(Taxonomy.newBuilder().build())
           .build();
   Taxonomy response = policyTagManagerClient.createTaxonomy(request);
 }
 
Parameter
Name Description
request CreateTaxonomyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Taxonomy

createTaxonomy(LocationName parent, Taxonomy taxonomy)

public final Taxonomy createTaxonomy(LocationName parent, Taxonomy taxonomy)

Creates a taxonomy in the specified project.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Taxonomy taxonomy = Taxonomy.newBuilder().build();
   Taxonomy response = policyTagManagerClient.createTaxonomy(parent, taxonomy);
 }
 
Parameters
Name Description
parent LocationName

Required. Resource name of the project that the taxonomy will belong to.

taxonomy Taxonomy

The taxonomy to be created.

Returns
Type Description
Taxonomy

createTaxonomy(String parent, Taxonomy taxonomy)

public final Taxonomy createTaxonomy(String parent, Taxonomy taxonomy)

Creates a taxonomy in the specified project.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Taxonomy taxonomy = Taxonomy.newBuilder().build();
   Taxonomy response = policyTagManagerClient.createTaxonomy(parent, taxonomy);
 }
 
Parameters
Name Description
parent String

Required. Resource name of the project that the taxonomy will belong to.

taxonomy Taxonomy

The taxonomy to be created.

Returns
Type Description
Taxonomy

createTaxonomyCallable()

public final UnaryCallable<CreateTaxonomyRequest,Taxonomy> createTaxonomyCallable()

Creates a taxonomy in the specified project.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   CreateTaxonomyRequest request =
       CreateTaxonomyRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTaxonomy(Taxonomy.newBuilder().build())
           .build();
   ApiFuture<Taxonomy> future =
       policyTagManagerClient.createTaxonomyCallable().futureCall(request);
   // Do something.
   Taxonomy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateTaxonomyRequest,Taxonomy>

deletePolicyTag(DeletePolicyTagRequest request)

public final void deletePolicyTag(DeletePolicyTagRequest request)

Deletes a policy tag. Also deletes all of its descendant policy tags.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   DeletePolicyTagRequest request =
       DeletePolicyTagRequest.newBuilder()
           .setName(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .build();
   policyTagManagerClient.deletePolicyTag(request);
 }
 
Parameter
Name Description
request DeletePolicyTagRequest

The request object containing all of the parameters for the API call.

deletePolicyTag(PolicyTagName name)

public final void deletePolicyTag(PolicyTagName name)

Deletes a policy tag. Also deletes all of its descendant policy tags.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   PolicyTagName name =
       PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
   policyTagManagerClient.deletePolicyTag(name);
 }
 
Parameter
Name Description
name PolicyTagName

Required. Resource name of the policy tag to be deleted. All of its descendant policy tags will also be deleted.

deletePolicyTag(String name)

public final void deletePolicyTag(String name)

Deletes a policy tag. Also deletes all of its descendant policy tags.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String name =
       PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]").toString();
   policyTagManagerClient.deletePolicyTag(name);
 }
 
Parameter
Name Description
name String

Required. Resource name of the policy tag to be deleted. All of its descendant policy tags will also be deleted.

deletePolicyTagCallable()

public final UnaryCallable<DeletePolicyTagRequest,Empty> deletePolicyTagCallable()

Deletes a policy tag. Also deletes all of its descendant policy tags.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   DeletePolicyTagRequest request =
       DeletePolicyTagRequest.newBuilder()
           .setName(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .build();
   ApiFuture<Empty> future =
       policyTagManagerClient.deletePolicyTagCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeletePolicyTagRequest,Empty>

deleteTaxonomy(DeleteTaxonomyRequest request)

public final void deleteTaxonomy(DeleteTaxonomyRequest request)

Deletes a taxonomy. This operation will also delete all policy tags in this taxonomy along with their associated policies.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   DeleteTaxonomyRequest request =
       DeleteTaxonomyRequest.newBuilder()
           .setName(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .build();
   policyTagManagerClient.deleteTaxonomy(request);
 }
 
Parameter
Name Description
request DeleteTaxonomyRequest

The request object containing all of the parameters for the API call.

deleteTaxonomy(TaxonomyName name)

public final void deleteTaxonomy(TaxonomyName name)

Deletes a taxonomy. This operation will also delete all policy tags in this taxonomy along with their associated policies.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
   policyTagManagerClient.deleteTaxonomy(name);
 }
 
Parameter
Name Description
name TaxonomyName

Required. Resource name of the taxonomy to be deleted. All policy tags in this taxonomy will also be deleted.

deleteTaxonomy(String name)

public final void deleteTaxonomy(String name)

Deletes a taxonomy. This operation will also delete all policy tags in this taxonomy along with their associated policies.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString();
   policyTagManagerClient.deleteTaxonomy(name);
 }
 
Parameter
Name Description
name String

Required. Resource name of the taxonomy to be deleted. All policy tags in this taxonomy will also be deleted.

deleteTaxonomyCallable()

public final UnaryCallable<DeleteTaxonomyRequest,Empty> deleteTaxonomyCallable()

Deletes a taxonomy. This operation will also delete all policy tags in this taxonomy along with their associated policies.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   DeleteTaxonomyRequest request =
       DeleteTaxonomyRequest.newBuilder()
           .setName(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .build();
   ApiFuture<Empty> future = policyTagManagerClient.deleteTaxonomyCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteTaxonomyRequest,Empty>

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the IAM policy for a taxonomy or a policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   Policy response = policyTagManagerClient.getIamPolicy(request);
 }
 
Parameter
Name Description
request com.google.iam.v1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the IAM policy for a taxonomy or a policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   ApiFuture<Policy> future = policyTagManagerClient.getIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

getPolicyTag(GetPolicyTagRequest request)

public final PolicyTag getPolicyTag(GetPolicyTagRequest request)

Gets a policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   GetPolicyTagRequest request =
       GetPolicyTagRequest.newBuilder()
           .setName(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .build();
   PolicyTag response = policyTagManagerClient.getPolicyTag(request);
 }
 
Parameter
Name Description
request GetPolicyTagRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
PolicyTag

getPolicyTag(PolicyTagName name)

public final PolicyTag getPolicyTag(PolicyTagName name)

Gets a policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   PolicyTagName name =
       PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
   PolicyTag response = policyTagManagerClient.getPolicyTag(name);
 }
 
Parameter
Name Description
name PolicyTagName

Required. Resource name of the requested policy tag.

Returns
Type Description
PolicyTag

getPolicyTag(String name)

public final PolicyTag getPolicyTag(String name)

Gets a policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String name =
       PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]").toString();
   PolicyTag response = policyTagManagerClient.getPolicyTag(name);
 }
 
Parameter
Name Description
name String

Required. Resource name of the requested policy tag.

Returns
Type Description
PolicyTag

getPolicyTagCallable()

public final UnaryCallable<GetPolicyTagRequest,PolicyTag> getPolicyTagCallable()

Gets a policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   GetPolicyTagRequest request =
       GetPolicyTagRequest.newBuilder()
           .setName(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .build();
   ApiFuture<PolicyTag> future =
       policyTagManagerClient.getPolicyTagCallable().futureCall(request);
   // Do something.
   PolicyTag response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetPolicyTagRequest,PolicyTag>

getSettings()

public final PolicyTagManagerSettings getSettings()
Returns
Type Description
PolicyTagManagerSettings

getStub()

public PolicyTagManagerStub getStub()
Returns
Type Description
PolicyTagManagerStub

getTaxonomy(GetTaxonomyRequest request)

public final Taxonomy getTaxonomy(GetTaxonomyRequest request)

Gets a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   GetTaxonomyRequest request =
       GetTaxonomyRequest.newBuilder()
           .setName(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .build();
   Taxonomy response = policyTagManagerClient.getTaxonomy(request);
 }
 
Parameter
Name Description
request GetTaxonomyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Taxonomy

getTaxonomy(TaxonomyName name)

public final Taxonomy getTaxonomy(TaxonomyName name)

Gets a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
   Taxonomy response = policyTagManagerClient.getTaxonomy(name);
 }
 
Parameter
Name Description
name TaxonomyName

Required. Resource name of the requested taxonomy.

Returns
Type Description
Taxonomy

getTaxonomy(String name)

public final Taxonomy getTaxonomy(String name)

Gets a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString();
   Taxonomy response = policyTagManagerClient.getTaxonomy(name);
 }
 
Parameter
Name Description
name String

Required. Resource name of the requested taxonomy.

Returns
Type Description
Taxonomy

getTaxonomyCallable()

public final UnaryCallable<GetTaxonomyRequest,Taxonomy> getTaxonomyCallable()

Gets a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   GetTaxonomyRequest request =
       GetTaxonomyRequest.newBuilder()
           .setName(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .build();
   ApiFuture<Taxonomy> future = policyTagManagerClient.getTaxonomyCallable().futureCall(request);
   // Do something.
   Taxonomy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetTaxonomyRequest,Taxonomy>

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listPolicyTags(ListPolicyTagsRequest request)

public final PolicyTagManagerClient.ListPolicyTagsPagedResponse listPolicyTags(ListPolicyTagsRequest request)

Lists all policy tags in a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListPolicyTagsRequest request =
       ListPolicyTagsRequest.newBuilder()
           .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (PolicyTag element : policyTagManagerClient.listPolicyTags(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListPolicyTagsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
PolicyTagManagerClient.ListPolicyTagsPagedResponse

listPolicyTags(TaxonomyName parent)

public final PolicyTagManagerClient.ListPolicyTagsPagedResponse listPolicyTags(TaxonomyName parent)

Lists all policy tags in a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
   for (PolicyTag element : policyTagManagerClient.listPolicyTags(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent TaxonomyName

Required. Resource name of the taxonomy to list the policy tags of.

Returns
Type Description
PolicyTagManagerClient.ListPolicyTagsPagedResponse

listPolicyTags(String parent)

public final PolicyTagManagerClient.ListPolicyTagsPagedResponse listPolicyTags(String parent)

Lists all policy tags in a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString();
   for (PolicyTag element : policyTagManagerClient.listPolicyTags(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. Resource name of the taxonomy to list the policy tags of.

Returns
Type Description
PolicyTagManagerClient.ListPolicyTagsPagedResponse

listPolicyTagsCallable()

public final UnaryCallable<ListPolicyTagsRequest,ListPolicyTagsResponse> listPolicyTagsCallable()

Lists all policy tags in a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListPolicyTagsRequest request =
       ListPolicyTagsRequest.newBuilder()
           .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListPolicyTagsResponse response =
         policyTagManagerClient.listPolicyTagsCallable().call(request);
     for (PolicyTag element : response.getPolicyTagsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListPolicyTagsRequest,ListPolicyTagsResponse>

listPolicyTagsPagedCallable()

public final UnaryCallable<ListPolicyTagsRequest,PolicyTagManagerClient.ListPolicyTagsPagedResponse> listPolicyTagsPagedCallable()

Lists all policy tags in a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListPolicyTagsRequest request =
       ListPolicyTagsRequest.newBuilder()
           .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<PolicyTag> future =
       policyTagManagerClient.listPolicyTagsPagedCallable().futureCall(request);
   // Do something.
   for (PolicyTag element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListPolicyTagsRequest,ListPolicyTagsPagedResponse>

listTaxonomies(ListTaxonomiesRequest request)

public final PolicyTagManagerClient.ListTaxonomiesPagedResponse listTaxonomies(ListTaxonomiesRequest request)

Lists all taxonomies in a project in a particular location that the caller has permission to view.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListTaxonomiesRequest request =
       ListTaxonomiesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   for (Taxonomy element : policyTagManagerClient.listTaxonomies(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListTaxonomiesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
PolicyTagManagerClient.ListTaxonomiesPagedResponse

listTaxonomies(LocationName parent)

public final PolicyTagManagerClient.ListTaxonomiesPagedResponse listTaxonomies(LocationName parent)

Lists all taxonomies in a project in a particular location that the caller has permission to view.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Taxonomy element : policyTagManagerClient.listTaxonomies(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. Resource name of the project to list the taxonomies of.

Returns
Type Description
PolicyTagManagerClient.ListTaxonomiesPagedResponse

listTaxonomies(String parent)

public final PolicyTagManagerClient.ListTaxonomiesPagedResponse listTaxonomies(String parent)

Lists all taxonomies in a project in a particular location that the caller has permission to view.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Taxonomy element : policyTagManagerClient.listTaxonomies(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. Resource name of the project to list the taxonomies of.

Returns
Type Description
PolicyTagManagerClient.ListTaxonomiesPagedResponse

listTaxonomiesCallable()

public final UnaryCallable<ListTaxonomiesRequest,ListTaxonomiesResponse> listTaxonomiesCallable()

Lists all taxonomies in a project in a particular location that the caller has permission to view.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListTaxonomiesRequest request =
       ListTaxonomiesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   while (true) {
     ListTaxonomiesResponse response =
         policyTagManagerClient.listTaxonomiesCallable().call(request);
     for (Taxonomy element : response.getTaxonomiesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListTaxonomiesRequest,ListTaxonomiesResponse>

listTaxonomiesPagedCallable()

public final UnaryCallable<ListTaxonomiesRequest,PolicyTagManagerClient.ListTaxonomiesPagedResponse> listTaxonomiesPagedCallable()

Lists all taxonomies in a project in a particular location that the caller has permission to view.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListTaxonomiesRequest request =
       ListTaxonomiesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<Taxonomy> future =
       policyTagManagerClient.listTaxonomiesPagedCallable().futureCall(request);
   // Do something.
   for (Taxonomy element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListTaxonomiesRequest,ListTaxonomiesPagedResponse>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

Sets the IAM policy for a taxonomy or a policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Policy response = policyTagManagerClient.setIamPolicy(request);
 }
 
Parameter
Name Description
request com.google.iam.v1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Sets the IAM policy for a taxonomy or a policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Policy> future = policyTagManagerClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

Returns the permissions that a caller has on the specified taxonomy or policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   TestIamPermissionsResponse response = policyTagManagerClient.testIamPermissions(request);
 }
 
Parameter
Name Description
request com.google.iam.v1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

Returns the permissions that a caller has on the specified taxonomy or policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   ApiFuture<TestIamPermissionsResponse> future =
       policyTagManagerClient.testIamPermissionsCallable().futureCall(request);
   // Do something.
   TestIamPermissionsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

updatePolicyTag(PolicyTag policyTag)

public final PolicyTag updatePolicyTag(PolicyTag policyTag)

Updates a policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   PolicyTag policyTag = PolicyTag.newBuilder().build();
   PolicyTag response = policyTagManagerClient.updatePolicyTag(policyTag);
 }
 
Parameter
Name Description
policyTag PolicyTag

The policy tag to update. Only the description, display_name, and parent_policy_tag fields can be updated.

Returns
Type Description
PolicyTag

updatePolicyTag(UpdatePolicyTagRequest request)

public final PolicyTag updatePolicyTag(UpdatePolicyTagRequest request)

Updates a policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   UpdatePolicyTagRequest request =
       UpdatePolicyTagRequest.newBuilder()
           .setPolicyTag(PolicyTag.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   PolicyTag response = policyTagManagerClient.updatePolicyTag(request);
 }
 
Parameter
Name Description
request UpdatePolicyTagRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
PolicyTag

updatePolicyTagCallable()

public final UnaryCallable<UpdatePolicyTagRequest,PolicyTag> updatePolicyTagCallable()

Updates a policy tag.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   UpdatePolicyTagRequest request =
       UpdatePolicyTagRequest.newBuilder()
           .setPolicyTag(PolicyTag.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<PolicyTag> future =
       policyTagManagerClient.updatePolicyTagCallable().futureCall(request);
   // Do something.
   PolicyTag response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdatePolicyTagRequest,PolicyTag>

updateTaxonomy(Taxonomy taxonomy)

public final Taxonomy updateTaxonomy(Taxonomy taxonomy)

Updates a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   Taxonomy taxonomy = Taxonomy.newBuilder().build();
   Taxonomy response = policyTagManagerClient.updateTaxonomy(taxonomy);
 }
 
Parameter
Name Description
taxonomy Taxonomy

The taxonomy to update. Only description, display_name, and activated policy types can be updated.

Returns
Type Description
Taxonomy

updateTaxonomy(UpdateTaxonomyRequest request)

public final Taxonomy updateTaxonomy(UpdateTaxonomyRequest request)

Updates a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   UpdateTaxonomyRequest request =
       UpdateTaxonomyRequest.newBuilder()
           .setTaxonomy(Taxonomy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Taxonomy response = policyTagManagerClient.updateTaxonomy(request);
 }
 
Parameter
Name Description
request UpdateTaxonomyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Taxonomy

updateTaxonomyCallable()

public final UnaryCallable<UpdateTaxonomyRequest,Taxonomy> updateTaxonomyCallable()

Updates a taxonomy.

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 (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   UpdateTaxonomyRequest request =
       UpdateTaxonomyRequest.newBuilder()
           .setTaxonomy(Taxonomy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Taxonomy> future =
       policyTagManagerClient.updateTaxonomyCallable().futureCall(request);
   // Do something.
   Taxonomy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateTaxonomyRequest,Taxonomy>