Class PolicyTagManagerClient (1.6.2)

public class PolicyTagManagerClient implements BackgroundResource

Service Description: Policy Tag Manager API service allows you to manage your policy tags and taxonomies.

Policy tags are used to tag BigQuery columns and apply additional access control policies. A taxonomy is a hierarchical grouping of policy tags that classify data along a common axis.

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:


 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().

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

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

See the individual methods for example code.

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

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

To customize credentials:


 PolicyTagManagerSettings policyTagManagerSettings =
     PolicyTagManagerSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 PolicyTagManagerClient policyTagManagerClient =
     PolicyTagManagerClient.create(policyTagManagerSettings);
 

To customize the endpoint:


 PolicyTagManagerSettings policyTagManagerSettings =
     PolicyTagManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
 PolicyTagManagerClient policyTagManagerClient =
     PolicyTagManagerClient.create(policyTagManagerSettings);
 

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

Inheritance

java.lang.Object > PolicyTagManagerClient

Implements

BackgroundResource

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
NameDescription
settingsPolicyTagManagerSettings

PolicyTagManagerClient(PolicyTagManagerStub stub)

protected PolicyTagManagerClient(PolicyTagManagerStub stub)
Parameter
NameDescription
stubPolicyTagManagerStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

create()

public static final PolicyTagManagerClient create()

Constructs an instance of PolicyTagManagerClient with default settings.

Returns
TypeDescription
PolicyTagManagerClient
Exceptions
TypeDescription
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
NameDescription
settingsPolicyTagManagerSettings
Returns
TypeDescription
PolicyTagManagerClient
Exceptions
TypeDescription
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
NameDescription
stubPolicyTagManagerStub
Returns
TypeDescription
PolicyTagManagerClient

createPolicyTag(CreatePolicyTagRequest request)

public final PolicyTag createPolicyTag(CreatePolicyTagRequest request)

Creates a policy tag in a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   CreatePolicyTagRequest request =
       CreatePolicyTagRequest.newBuilder()
           .setParent(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .setPolicyTag(PolicyTag.newBuilder().build())
           .build();
   PolicyTag response = policyTagManagerClient.createPolicyTag(request);
 }
 
Parameter
NameDescription
requestCreatePolicyTagRequest

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

Returns
TypeDescription
PolicyTag

createPolicyTag(TaxonomyName parent, PolicyTag policyTag)

public final PolicyTag createPolicyTag(TaxonomyName parent, PolicyTag policyTag)

Creates a policy tag in a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
   PolicyTag policyTag = PolicyTag.newBuilder().build();
   PolicyTag response = policyTagManagerClient.createPolicyTag(parent, policyTag);
 }
 
Parameters
NameDescription
parentTaxonomyName

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

policyTagPolicyTag

The policy tag to create.

Returns
TypeDescription
PolicyTag

createPolicyTag(String parent, PolicyTag policyTag)

public final PolicyTag createPolicyTag(String parent, PolicyTag policyTag)

Creates a policy tag in a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String parent =
       PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]").toString();
   PolicyTag policyTag = PolicyTag.newBuilder().build();
   PolicyTag response = policyTagManagerClient.createPolicyTag(parent, policyTag);
 }
 
Parameters
NameDescription
parentString

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

policyTagPolicyTag

The policy tag to create.

Returns
TypeDescription
PolicyTag

createPolicyTagCallable()

public final UnaryCallable<CreatePolicyTagRequest,PolicyTag> createPolicyTagCallable()

Creates a policy tag in a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   CreatePolicyTagRequest request =
       CreatePolicyTagRequest.newBuilder()
           .setParent(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .setPolicyTag(PolicyTag.newBuilder().build())
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<CreatePolicyTagRequest,PolicyTag>

createTaxonomy(CreateTaxonomyRequest request)

public final Taxonomy createTaxonomy(CreateTaxonomyRequest request)

Creates a taxonomy in a specified project.

The taxonomy is initially empty, that is, it doesn't contain policy tags.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   CreateTaxonomyRequest request =
       CreateTaxonomyRequest.newBuilder()
           .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .setTaxonomy(Taxonomy.newBuilder().build())
           .build();
   Taxonomy response = policyTagManagerClient.createTaxonomy(request);
 }
 
Parameter
NameDescription
requestCreateTaxonomyRequest

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

Returns
TypeDescription
Taxonomy

createTaxonomy(LocationName parent, Taxonomy taxonomy)

public final Taxonomy createTaxonomy(LocationName parent, Taxonomy taxonomy)

Creates a taxonomy in a specified project.

The taxonomy is initially empty, that is, it doesn't contain policy tags.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Taxonomy taxonomy = Taxonomy.newBuilder().build();
   Taxonomy response = policyTagManagerClient.createTaxonomy(parent, taxonomy);
 }
 
Parameters
NameDescription
parentLocationName

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

taxonomyTaxonomy

The taxonomy to create.

Returns
TypeDescription
Taxonomy

createTaxonomy(String parent, Taxonomy taxonomy)

public final Taxonomy createTaxonomy(String parent, Taxonomy taxonomy)

Creates a taxonomy in a specified project.

The taxonomy is initially empty, that is, it doesn't contain policy tags.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString();
   Taxonomy taxonomy = Taxonomy.newBuilder().build();
   Taxonomy response = policyTagManagerClient.createTaxonomy(parent, taxonomy);
 }
 
Parameters
NameDescription
parentString

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

taxonomyTaxonomy

The taxonomy to create.

Returns
TypeDescription
Taxonomy

createTaxonomyCallable()

public final UnaryCallable<CreateTaxonomyRequest,Taxonomy> createTaxonomyCallable()

Creates a taxonomy in a specified project.

The taxonomy is initially empty, that is, it doesn't contain policy tags.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   CreateTaxonomyRequest request =
       CreateTaxonomyRequest.newBuilder()
           .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .setTaxonomy(Taxonomy.newBuilder().build())
           .build();
   ApiFuture<Taxonomy> future =
       policyTagManagerClient.createTaxonomyCallable().futureCall(request);
   // Do something.
   Taxonomy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateTaxonomyRequest,Taxonomy>

deletePolicyTag(DeletePolicyTagRequest request)

public final void deletePolicyTag(DeletePolicyTagRequest request)

Deletes a policy tag together with the following:

  • All of its descendant policy tags, if any
  • Policies associated with the policy tag and its descendants
  • References from BigQuery table schema of the policy tag and its descendants

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   DeletePolicyTagRequest request =
       DeletePolicyTagRequest.newBuilder()
           .setName(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .build();
   policyTagManagerClient.deletePolicyTag(request);
 }
 
Parameter
NameDescription
requestDeletePolicyTagRequest

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 together with the following:

  • All of its descendant policy tags, if any
  • Policies associated with the policy tag and its descendants
  • References from BigQuery table schema of the policy tag and its descendants

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   PolicyTagName name =
       PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
   policyTagManagerClient.deletePolicyTag(name);
 }
 
Parameter
NameDescription
namePolicyTagName

Required. Resource name of the policy tag to delete.

Note: All of its descendant policy tags are also deleted.

deletePolicyTag(String name)

public final void deletePolicyTag(String name)

Deletes a policy tag together with the following:

  • All of its descendant policy tags, if any
  • Policies associated with the policy tag and its descendants
  • References from BigQuery table schema of the policy tag and its descendants

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String name =
       PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]").toString();
   policyTagManagerClient.deletePolicyTag(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the policy tag to delete.

Note: All of its descendant policy tags are also deleted.

deletePolicyTagCallable()

public final UnaryCallable<DeletePolicyTagRequest,Empty> deletePolicyTagCallable()

Deletes a policy tag together with the following:

  • All of its descendant policy tags, if any
  • Policies associated with the policy tag and its descendants
  • References from BigQuery table schema of the policy tag and its descendants

Sample code:


 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
TypeDescription
UnaryCallable<DeletePolicyTagRequest,Empty>

deleteTaxonomy(DeleteTaxonomyRequest request)

public final void deleteTaxonomy(DeleteTaxonomyRequest request)

Deletes a taxonomy, including all policy tags in this taxonomy, their associated policies, and the policy tags references from BigQuery columns.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   DeleteTaxonomyRequest request =
       DeleteTaxonomyRequest.newBuilder()
           .setName(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .build();
   policyTagManagerClient.deleteTaxonomy(request);
 }
 
Parameter
NameDescription
requestDeleteTaxonomyRequest

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

deleteTaxonomy(TaxonomyName name)

public final void deleteTaxonomy(TaxonomyName name)

Deletes a taxonomy, including all policy tags in this taxonomy, their associated policies, and the policy tags references from BigQuery columns.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
   policyTagManagerClient.deleteTaxonomy(name);
 }
 
Parameter
NameDescription
nameTaxonomyName

Required. Resource name of the taxonomy to delete.

Note: All policy tags in this taxonomy are also deleted.

deleteTaxonomy(String name)

public final void deleteTaxonomy(String name)

Deletes a taxonomy, including all policy tags in this taxonomy, their associated policies, and the policy tags references from BigQuery columns.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString();
   policyTagManagerClient.deleteTaxonomy(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the taxonomy to delete.

Note: All policy tags in this taxonomy are also deleted.

deleteTaxonomyCallable()

public final UnaryCallable<DeleteTaxonomyRequest,Empty> deleteTaxonomyCallable()

Deletes a taxonomy, including all policy tags in this taxonomy, their associated policies, and the policy tags references from BigQuery columns.

Sample code:


 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
TypeDescription
UnaryCallable<DeleteTaxonomyRequest,Empty>

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

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

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   Policy response = policyTagManagerClient.getIamPolicy(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.GetIamPolicyRequest

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

Returns
TypeDescription
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

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

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   ApiFuture<Policy> future = policyTagManagerClient.getIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
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:


 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
NameDescription
requestGetPolicyTagRequest

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

Returns
TypeDescription
PolicyTag

getPolicyTag(PolicyTagName name)

public final PolicyTag getPolicyTag(PolicyTagName name)

Gets a policy tag.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   PolicyTagName name =
       PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]");
   PolicyTag response = policyTagManagerClient.getPolicyTag(name);
 }
 
Parameter
NameDescription
namePolicyTagName

Required. Resource name of the policy tag.

Returns
TypeDescription
PolicyTag

getPolicyTag(String name)

public final PolicyTag getPolicyTag(String name)

Gets a policy tag.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String name =
       PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]").toString();
   PolicyTag response = policyTagManagerClient.getPolicyTag(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the policy tag.

Returns
TypeDescription
PolicyTag

getPolicyTagCallable()

public final UnaryCallable<GetPolicyTagRequest,PolicyTag> getPolicyTagCallable()

Gets a policy tag.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   GetPolicyTagRequest request =
       GetPolicyTagRequest.newBuilder()
           .setName(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<GetPolicyTagRequest,PolicyTag>

getSettings()

public final PolicyTagManagerSettings getSettings()
Returns
TypeDescription
PolicyTagManagerSettings

getStub()

public PolicyTagManagerStub getStub()
Returns
TypeDescription
PolicyTagManagerStub

getTaxonomy(GetTaxonomyRequest request)

public final Taxonomy getTaxonomy(GetTaxonomyRequest request)

Gets a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   GetTaxonomyRequest request =
       GetTaxonomyRequest.newBuilder()
           .setName(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .build();
   Taxonomy response = policyTagManagerClient.getTaxonomy(request);
 }
 
Parameter
NameDescription
requestGetTaxonomyRequest

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

Returns
TypeDescription
Taxonomy

getTaxonomy(TaxonomyName name)

public final Taxonomy getTaxonomy(TaxonomyName name)

Gets a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TaxonomyName name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
   Taxonomy response = policyTagManagerClient.getTaxonomy(name);
 }
 
Parameter
NameDescription
nameTaxonomyName

Required. Resource name of the taxonomy to get.

Returns
TypeDescription
Taxonomy

getTaxonomy(String name)

public final Taxonomy getTaxonomy(String name)

Gets a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String name = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString();
   Taxonomy response = policyTagManagerClient.getTaxonomy(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the taxonomy to get.

Returns
TypeDescription
Taxonomy

getTaxonomyCallable()

public final UnaryCallable<GetTaxonomyRequest,Taxonomy> getTaxonomyCallable()

Gets a taxonomy.

Sample code:


 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
TypeDescription
UnaryCallable<GetTaxonomyRequest,Taxonomy>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listPolicyTags(ListPolicyTagsRequest request)

public final PolicyTagManagerClient.ListPolicyTagsPagedResponse listPolicyTags(ListPolicyTagsRequest request)

Lists all policy tags in a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListPolicyTagsRequest request =
       ListPolicyTagsRequest.newBuilder()
           .setParent(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (PolicyTag element : policyTagManagerClient.listPolicyTags(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListPolicyTagsRequest

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

Returns
TypeDescription
PolicyTagManagerClient.ListPolicyTagsPagedResponse

listPolicyTags(TaxonomyName parent)

public final PolicyTagManagerClient.ListPolicyTagsPagedResponse listPolicyTags(TaxonomyName parent)

Lists all policy tags in a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TaxonomyName parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]");
   for (PolicyTag element : policyTagManagerClient.listPolicyTags(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentTaxonomyName

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

Returns
TypeDescription
PolicyTagManagerClient.ListPolicyTagsPagedResponse

listPolicyTags(String parent)

public final PolicyTagManagerClient.ListPolicyTagsPagedResponse listPolicyTags(String parent)

Lists all policy tags in a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String parent =
       PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]").toString();
   for (PolicyTag element : policyTagManagerClient.listPolicyTags(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

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

Returns
TypeDescription
PolicyTagManagerClient.ListPolicyTagsPagedResponse

listPolicyTagsCallable()

public final UnaryCallable<ListPolicyTagsRequest,ListPolicyTagsResponse> listPolicyTagsCallable()

Lists all policy tags in a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListPolicyTagsRequest request =
       ListPolicyTagsRequest.newBuilder()
           .setParent(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListPolicyTagsResponse response =
         policyTagManagerClient.listPolicyTagsCallable().call(request);
     for (PolicyTag element : response.getResponsesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListPolicyTagsRequest,ListPolicyTagsResponse>

listPolicyTagsPagedCallable()

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

Lists all policy tags in a taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListPolicyTagsRequest request =
       ListPolicyTagsRequest.newBuilder()
           .setParent(
               PolicyTagName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]", "[POLICY_TAG]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<ListPolicyTagsRequest,ListPolicyTagsPagedResponse>

listTaxonomies(ListTaxonomiesRequest request)

public final PolicyTagManagerClient.ListTaxonomiesPagedResponse listTaxonomies(ListTaxonomiesRequest request)

Lists all taxonomies in a project in a particular location that you have a permission to view.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListTaxonomiesRequest request =
       ListTaxonomiesRequest.newBuilder()
           .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Taxonomy element : policyTagManagerClient.listTaxonomies(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListTaxonomiesRequest

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

Returns
TypeDescription
PolicyTagManagerClient.ListTaxonomiesPagedResponse

listTaxonomies(LocationName parent)

public final PolicyTagManagerClient.ListTaxonomiesPagedResponse listTaxonomies(LocationName parent)

Lists all taxonomies in a project in a particular location that you have a permission to view.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Taxonomy element : policyTagManagerClient.listTaxonomies(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

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

Returns
TypeDescription
PolicyTagManagerClient.ListTaxonomiesPagedResponse

listTaxonomies(String parent)

public final PolicyTagManagerClient.ListTaxonomiesPagedResponse listTaxonomies(String parent)

Lists all taxonomies in a project in a particular location that you have a permission to view.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   String parent = TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString();
   for (Taxonomy element : policyTagManagerClient.listTaxonomies(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

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

Returns
TypeDescription
PolicyTagManagerClient.ListTaxonomiesPagedResponse

listTaxonomiesCallable()

public final UnaryCallable<ListTaxonomiesRequest,ListTaxonomiesResponse> listTaxonomiesCallable()

Lists all taxonomies in a project in a particular location that you have a permission to view.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListTaxonomiesRequest request =
       ListTaxonomiesRequest.newBuilder()
           .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListTaxonomiesResponse response =
         policyTagManagerClient.listTaxonomiesCallable().call(request);
     for (Taxonomy element : response.getResponsesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListTaxonomiesRequest,ListTaxonomiesResponse>

listTaxonomiesPagedCallable()

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

Lists all taxonomies in a project in a particular location that you have a permission to view.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   ListTaxonomiesRequest request =
       ListTaxonomiesRequest.newBuilder()
           .setParent(TaxonomyName.of("[PROJECT]", "[LOCATION]", "[TAXONOMY]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Taxonomy> future =
       policyTagManagerClient.listTaxonomiesPagedCallable().futureCall(request);
   // Do something.
   for (Taxonomy element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListTaxonomiesRequest,ListTaxonomiesPagedResponse>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

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

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .setPolicy(Policy.newBuilder().build())
           .build();
   Policy response = policyTagManagerClient.setIamPolicy(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.SetIamPolicyRequest

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

Returns
TypeDescription
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

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

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .setPolicy(Policy.newBuilder().build())
           .build();
   ApiFuture<Policy> future = policyTagManagerClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
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 your permissions on a specified policy tag or taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   TestIamPermissionsResponse response = policyTagManagerClient.testIamPermissions(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.TestIamPermissionsRequest

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

Returns
TypeDescription
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

Returns your permissions on a specified policy tag or taxonomy.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

updatePolicyTag(PolicyTag policyTag)

public final PolicyTag updatePolicyTag(PolicyTag policyTag)

Updates a policy tag, including its display name, description, and parent policy tag.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   PolicyTag policyTag = PolicyTag.newBuilder().build();
   PolicyTag response = policyTagManagerClient.updatePolicyTag(policyTag);
 }
 
Parameter
NameDescription
policyTagPolicyTag

The policy tag to update. You can update only its description, display name, and parent policy tag fields.

Returns
TypeDescription
PolicyTag

updatePolicyTag(UpdatePolicyTagRequest request)

public final PolicyTag updatePolicyTag(UpdatePolicyTagRequest request)

Updates a policy tag, including its display name, description, and parent policy tag.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   UpdatePolicyTagRequest request =
       UpdatePolicyTagRequest.newBuilder()
           .setPolicyTag(PolicyTag.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   PolicyTag response = policyTagManagerClient.updatePolicyTag(request);
 }
 
Parameter
NameDescription
requestUpdatePolicyTagRequest

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

Returns
TypeDescription
PolicyTag

updatePolicyTagCallable()

public final UnaryCallable<UpdatePolicyTagRequest,PolicyTag> updatePolicyTagCallable()

Updates a policy tag, including its display name, description, and parent policy tag.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   UpdatePolicyTagRequest request =
       UpdatePolicyTagRequest.newBuilder()
           .setPolicyTag(PolicyTag.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<UpdatePolicyTagRequest,PolicyTag>

updateTaxonomy(Taxonomy taxonomy)

public final Taxonomy updateTaxonomy(Taxonomy taxonomy)

Updates a taxonomy, including its display name, description, and activated policy types.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   Taxonomy taxonomy = Taxonomy.newBuilder().build();
   Taxonomy response = policyTagManagerClient.updateTaxonomy(taxonomy);
 }
 
Parameter
NameDescription
taxonomyTaxonomy

The taxonomy to update. You can update only its description, display name, and activated policy types.

Returns
TypeDescription
Taxonomy

updateTaxonomy(UpdateTaxonomyRequest request)

public final Taxonomy updateTaxonomy(UpdateTaxonomyRequest request)

Updates a taxonomy, including its display name, description, and activated policy types.

Sample code:


 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) {
   UpdateTaxonomyRequest request =
       UpdateTaxonomyRequest.newBuilder()
           .setTaxonomy(Taxonomy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Taxonomy response = policyTagManagerClient.updateTaxonomy(request);
 }
 
Parameter
NameDescription
requestUpdateTaxonomyRequest

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

Returns
TypeDescription
Taxonomy

updateTaxonomyCallable()

public final UnaryCallable<UpdateTaxonomyRequest,Taxonomy> updateTaxonomyCallable()

Updates a taxonomy, including its display name, description, and activated policy types.

Sample code:


 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
TypeDescription
UnaryCallable<UpdateTaxonomyRequest,Taxonomy>