Class DataAccessControlServiceClient (0.2.0)

GitHub RepositoryProduct Reference

Service Description: DataAccessControlService exposes resources and endpoints related to data access control.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   DataAccessLabel dataAccessLabel = DataAccessLabel.newBuilder().build();
   String dataAccessLabelId = "dataAccessLabelId1775298977";
   DataAccessLabel response =
       dataAccessControlServiceClient.createDataAccessLabel(
           parent, dataAccessLabel, dataAccessLabelId);
 }
 

Note: close() needs to be called on the DataAccessControlServiceClient 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

CreateDataAccessLabel

Creates a data access label. Data access labels are applied to incoming event data and selected in data access scopes (another resource), and only users with scopes containing the label can see data with that label. Currently, the data access label resource only includes custom labels, which are labels that correspond to UDM queries over event data.

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

  • createDataAccessLabel(CreateDataAccessLabelRequest request)

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

  • createDataAccessLabel(InstanceName parent, DataAccessLabel dataAccessLabel, String dataAccessLabelId)

  • createDataAccessLabel(String parent, DataAccessLabel dataAccessLabel, String dataAccessLabelId)

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

  • createDataAccessLabelCallable()

GetDataAccessLabel

Gets a data access label.

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

  • getDataAccessLabel(GetDataAccessLabelRequest request)

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

  • getDataAccessLabel(DataAccessLabelName name)

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

  • getDataAccessLabelCallable()

ListDataAccessLabels

Lists all data access labels for the customer.

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

  • listDataAccessLabels(ListDataAccessLabelsRequest request)

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

  • listDataAccessLabels(InstanceName parent)

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

  • listDataAccessLabelsPagedCallable()

  • listDataAccessLabelsCallable()

UpdateDataAccessLabel

Updates a data access label.

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

  • updateDataAccessLabel(UpdateDataAccessLabelRequest request)

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

  • updateDataAccessLabel(DataAccessLabel dataAccessLabel, FieldMask updateMask)

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

  • updateDataAccessLabelCallable()

DeleteDataAccessLabel

Deletes a data access label. When a label is deleted, new data that enters in the system will not receive the label, but the label will not be removed from old data that still refers to it.

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

  • deleteDataAccessLabel(DeleteDataAccessLabelRequest request)

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

  • deleteDataAccessLabel(DataAccessLabelName name)

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

  • deleteDataAccessLabelCallable()

CreateDataAccessScope

Creates a data access scope. Data access scope is a combination of allowed and denied labels attached to a permission group. If a scope has allowed labels A and B and denied labels C and D, then the group of people attached to the scope will have permissions to see all events labeled with A or B (or both) and not labeled with either C or D.

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

  • createDataAccessScope(CreateDataAccessScopeRequest request)

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

  • createDataAccessScope(InstanceName parent, DataAccessScope dataAccessScope, String dataAccessScopeId)

  • createDataAccessScope(String parent, DataAccessScope dataAccessScope, String dataAccessScopeId)

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

  • createDataAccessScopeCallable()

GetDataAccessScope

Retrieves an existing data access scope.

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

  • getDataAccessScope(GetDataAccessScopeRequest request)

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

  • getDataAccessScope(DataAccessScopeName name)

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

  • getDataAccessScopeCallable()

ListDataAccessScopes

Lists all existing data access scopes for the customer.

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

  • listDataAccessScopes(ListDataAccessScopesRequest request)

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

  • listDataAccessScopes(InstanceName parent)

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

  • listDataAccessScopesPagedCallable()

  • listDataAccessScopesCallable()

UpdateDataAccessScope

Updates a data access scope.

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

  • updateDataAccessScope(UpdateDataAccessScopeRequest request)

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

  • updateDataAccessScope(DataAccessScope dataAccessScope, FieldMask updateMask)

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

  • updateDataAccessScopeCallable()

DeleteDataAccessScope

Deletes a data access scope.

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

  • deleteDataAccessScope(DeleteDataAccessScopeRequest request)

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

  • deleteDataAccessScope(DataAccessScopeName name)

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

  • deleteDataAccessScopeCallable()

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 DataAccessControlServiceSettings 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
 DataAccessControlServiceSettings dataAccessControlServiceSettings =
     DataAccessControlServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create(dataAccessControlServiceSettings);
 

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
 DataAccessControlServiceSettings dataAccessControlServiceSettings =
     DataAccessControlServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create(dataAccessControlServiceSettings);
 

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
 DataAccessControlServiceSettings dataAccessControlServiceSettings =
     DataAccessControlServiceSettings.newHttpJsonBuilder().build();
 DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create(dataAccessControlServiceSettings);
 

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

Inheritance

java.lang.Object > DataAccessControlServiceClient

Static Methods

create()

public static final DataAccessControlServiceClient create()

Constructs an instance of DataAccessControlServiceClient with default settings.

Returns
Type Description
DataAccessControlServiceClient
Exceptions
Type Description
IOException

create(DataAccessControlServiceSettings settings)

public static final DataAccessControlServiceClient create(DataAccessControlServiceSettings settings)

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

create(DataAccessControlServiceStub stub)

public static final DataAccessControlServiceClient create(DataAccessControlServiceStub stub)

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

Parameter
Name Description
stub DataAccessControlServiceStub
Returns
Type Description
DataAccessControlServiceClient

Constructors

DataAccessControlServiceClient(DataAccessControlServiceSettings settings)

protected DataAccessControlServiceClient(DataAccessControlServiceSettings settings)

Constructs an instance of DataAccessControlServiceClient, 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 DataAccessControlServiceSettings

DataAccessControlServiceClient(DataAccessControlServiceStub stub)

protected DataAccessControlServiceClient(DataAccessControlServiceStub stub)
Parameter
Name Description
stub DataAccessControlServiceStub

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

createDataAccessLabel(CreateDataAccessLabelRequest request)

public final DataAccessLabel createDataAccessLabel(CreateDataAccessLabelRequest request)

Creates a data access label. Data access labels are applied to incoming event data and selected in data access scopes (another resource), and only users with scopes containing the label can see data with that label. Currently, the data access label resource only includes custom labels, which are labels that correspond to UDM queries over event data.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   CreateDataAccessLabelRequest request =
       CreateDataAccessLabelRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setDataAccessLabel(DataAccessLabel.newBuilder().build())
           .setDataAccessLabelId("dataAccessLabelId1775298977")
           .build();
   DataAccessLabel response = dataAccessControlServiceClient.createDataAccessLabel(request);
 }
 
Parameter
Name Description
request CreateDataAccessLabelRequest

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

Returns
Type Description
DataAccessLabel

createDataAccessLabel(InstanceName parent, DataAccessLabel dataAccessLabel, String dataAccessLabelId)

public final DataAccessLabel createDataAccessLabel(InstanceName parent, DataAccessLabel dataAccessLabel, String dataAccessLabelId)

Creates a data access label. Data access labels are applied to incoming event data and selected in data access scopes (another resource), and only users with scopes containing the label can see data with that label. Currently, the data access label resource only includes custom labels, which are labels that correspond to UDM queries over event data.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   DataAccessLabel dataAccessLabel = DataAccessLabel.newBuilder().build();
   String dataAccessLabelId = "dataAccessLabelId1775298977";
   DataAccessLabel response =
       dataAccessControlServiceClient.createDataAccessLabel(
           parent, dataAccessLabel, dataAccessLabelId);
 }
 
Parameters
Name Description
parent InstanceName

Required. The parent resource where this Data Access Label will be created. Format: projects/{project}/locations/{location}/instances/{instance}

dataAccessLabel DataAccessLabel

Required. Data access label to create.

dataAccessLabelId String

Required. The ID to use for the data access label, which will become the label's display name and the final component of the label's resource name. The maximum number of characters should be 63. Regex pattern is as per AIP: https://google.aip.dev/122#resource-id-segments

Returns
Type Description
DataAccessLabel

createDataAccessLabel(String parent, DataAccessLabel dataAccessLabel, String dataAccessLabelId)

public final DataAccessLabel createDataAccessLabel(String parent, DataAccessLabel dataAccessLabel, String dataAccessLabelId)

Creates a data access label. Data access labels are applied to incoming event data and selected in data access scopes (another resource), and only users with scopes containing the label can see data with that label. Currently, the data access label resource only includes custom labels, which are labels that correspond to UDM queries over event data.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   DataAccessLabel dataAccessLabel = DataAccessLabel.newBuilder().build();
   String dataAccessLabelId = "dataAccessLabelId1775298977";
   DataAccessLabel response =
       dataAccessControlServiceClient.createDataAccessLabel(
           parent, dataAccessLabel, dataAccessLabelId);
 }
 
Parameters
Name Description
parent String

Required. The parent resource where this Data Access Label will be created. Format: projects/{project}/locations/{location}/instances/{instance}

dataAccessLabel DataAccessLabel

Required. Data access label to create.

dataAccessLabelId String

Required. The ID to use for the data access label, which will become the label's display name and the final component of the label's resource name. The maximum number of characters should be 63. Regex pattern is as per AIP: https://google.aip.dev/122#resource-id-segments

Returns
Type Description
DataAccessLabel

createDataAccessLabelCallable()

public final UnaryCallable<CreateDataAccessLabelRequest,DataAccessLabel> createDataAccessLabelCallable()

Creates a data access label. Data access labels are applied to incoming event data and selected in data access scopes (another resource), and only users with scopes containing the label can see data with that label. Currently, the data access label resource only includes custom labels, which are labels that correspond to UDM queries over event data.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   CreateDataAccessLabelRequest request =
       CreateDataAccessLabelRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setDataAccessLabel(DataAccessLabel.newBuilder().build())
           .setDataAccessLabelId("dataAccessLabelId1775298977")
           .build();
   ApiFuture<DataAccessLabel> future =
       dataAccessControlServiceClient.createDataAccessLabelCallable().futureCall(request);
   // Do something.
   DataAccessLabel response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateDataAccessLabelRequest,DataAccessLabel>

createDataAccessScope(CreateDataAccessScopeRequest request)

public final DataAccessScope createDataAccessScope(CreateDataAccessScopeRequest request)

Creates a data access scope. Data access scope is a combination of allowed and denied labels attached to a permission group. If a scope has allowed labels A and B and denied labels C and D, then the group of people attached to the scope will have permissions to see all events labeled with A or B (or both) and not labeled with either C or D.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   CreateDataAccessScopeRequest request =
       CreateDataAccessScopeRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setDataAccessScope(DataAccessScope.newBuilder().build())
           .setDataAccessScopeId("dataAccessScopeId-532524799")
           .build();
   DataAccessScope response = dataAccessControlServiceClient.createDataAccessScope(request);
 }
 
Parameter
Name Description
request CreateDataAccessScopeRequest

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

Returns
Type Description
DataAccessScope

createDataAccessScope(InstanceName parent, DataAccessScope dataAccessScope, String dataAccessScopeId)

public final DataAccessScope createDataAccessScope(InstanceName parent, DataAccessScope dataAccessScope, String dataAccessScopeId)

Creates a data access scope. Data access scope is a combination of allowed and denied labels attached to a permission group. If a scope has allowed labels A and B and denied labels C and D, then the group of people attached to the scope will have permissions to see all events labeled with A or B (or both) and not labeled with either C or D.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   DataAccessScope dataAccessScope = DataAccessScope.newBuilder().build();
   String dataAccessScopeId = "dataAccessScopeId-532524799";
   DataAccessScope response =
       dataAccessControlServiceClient.createDataAccessScope(
           parent, dataAccessScope, dataAccessScopeId);
 }
 
Parameters
Name Description
parent InstanceName

Required. The parent resource where this Data Access Scope will be created. Format: projects/{project}/locations/{location}/instances/{instance}

dataAccessScope DataAccessScope

Required. Data access scope to create.

dataAccessScopeId String

Required. The user provided scope id which will become the last part of the name of the scope resource. Needs to be compliant with https://google.aip.dev/122

Returns
Type Description
DataAccessScope

createDataAccessScope(String parent, DataAccessScope dataAccessScope, String dataAccessScopeId)

public final DataAccessScope createDataAccessScope(String parent, DataAccessScope dataAccessScope, String dataAccessScopeId)

Creates a data access scope. Data access scope is a combination of allowed and denied labels attached to a permission group. If a scope has allowed labels A and B and denied labels C and D, then the group of people attached to the scope will have permissions to see all events labeled with A or B (or both) and not labeled with either C or D.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   DataAccessScope dataAccessScope = DataAccessScope.newBuilder().build();
   String dataAccessScopeId = "dataAccessScopeId-532524799";
   DataAccessScope response =
       dataAccessControlServiceClient.createDataAccessScope(
           parent, dataAccessScope, dataAccessScopeId);
 }
 
Parameters
Name Description
parent String

Required. The parent resource where this Data Access Scope will be created. Format: projects/{project}/locations/{location}/instances/{instance}

dataAccessScope DataAccessScope

Required. Data access scope to create.

dataAccessScopeId String

Required. The user provided scope id which will become the last part of the name of the scope resource. Needs to be compliant with https://google.aip.dev/122

Returns
Type Description
DataAccessScope

createDataAccessScopeCallable()

public final UnaryCallable<CreateDataAccessScopeRequest,DataAccessScope> createDataAccessScopeCallable()

Creates a data access scope. Data access scope is a combination of allowed and denied labels attached to a permission group. If a scope has allowed labels A and B and denied labels C and D, then the group of people attached to the scope will have permissions to see all events labeled with A or B (or both) and not labeled with either C or D.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   CreateDataAccessScopeRequest request =
       CreateDataAccessScopeRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setDataAccessScope(DataAccessScope.newBuilder().build())
           .setDataAccessScopeId("dataAccessScopeId-532524799")
           .build();
   ApiFuture<DataAccessScope> future =
       dataAccessControlServiceClient.createDataAccessScopeCallable().futureCall(request);
   // Do something.
   DataAccessScope response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateDataAccessScopeRequest,DataAccessScope>

deleteDataAccessLabel(DataAccessLabelName name)

public final void deleteDataAccessLabel(DataAccessLabelName name)

Deletes a data access label. When a label is deleted, new data that enters in the system will not receive the label, but the label will not be removed from old data that still refers to it.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   DataAccessLabelName name =
       DataAccessLabelName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_LABEL]");
   dataAccessControlServiceClient.deleteDataAccessLabel(name);
 }
 
Parameter
Name Description
name DataAccessLabelName

Required. The ID of the data access label to delete. Format: projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label}

deleteDataAccessLabel(DeleteDataAccessLabelRequest request)

public final void deleteDataAccessLabel(DeleteDataAccessLabelRequest request)

Deletes a data access label. When a label is deleted, new data that enters in the system will not receive the label, but the label will not be removed from old data that still refers to it.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   DeleteDataAccessLabelRequest request =
       DeleteDataAccessLabelRequest.newBuilder()
           .setName(
               DataAccessLabelName.of(
                       "[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_LABEL]")
                   .toString())
           .build();
   dataAccessControlServiceClient.deleteDataAccessLabel(request);
 }
 
Parameter
Name Description
request DeleteDataAccessLabelRequest

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

deleteDataAccessLabel(String name)

public final void deleteDataAccessLabel(String name)

Deletes a data access label. When a label is deleted, new data that enters in the system will not receive the label, but the label will not be removed from old data that still refers to it.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   String name =
       DataAccessLabelName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_LABEL]")
           .toString();
   dataAccessControlServiceClient.deleteDataAccessLabel(name);
 }
 
Parameter
Name Description
name String

Required. The ID of the data access label to delete. Format: projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label}

deleteDataAccessLabelCallable()

public final UnaryCallable<DeleteDataAccessLabelRequest,Empty> deleteDataAccessLabelCallable()

Deletes a data access label. When a label is deleted, new data that enters in the system will not receive the label, but the label will not be removed from old data that still refers to it.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   DeleteDataAccessLabelRequest request =
       DeleteDataAccessLabelRequest.newBuilder()
           .setName(
               DataAccessLabelName.of(
                       "[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_LABEL]")
                   .toString())
           .build();
   ApiFuture<Empty> future =
       dataAccessControlServiceClient.deleteDataAccessLabelCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteDataAccessLabelRequest,Empty>

deleteDataAccessScope(DataAccessScopeName name)

public final void deleteDataAccessScope(DataAccessScopeName name)

Deletes a data access scope.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   DataAccessScopeName name =
       DataAccessScopeName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_SCOPE]");
   dataAccessControlServiceClient.deleteDataAccessScope(name);
 }
 
Parameter
Name Description
name DataAccessScopeName

Required. The ID of the data access scope to delete. Format: projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope}

deleteDataAccessScope(DeleteDataAccessScopeRequest request)

public final void deleteDataAccessScope(DeleteDataAccessScopeRequest request)

Deletes a data access scope.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   DeleteDataAccessScopeRequest request =
       DeleteDataAccessScopeRequest.newBuilder()
           .setName(
               DataAccessScopeName.of(
                       "[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_SCOPE]")
                   .toString())
           .build();
   dataAccessControlServiceClient.deleteDataAccessScope(request);
 }
 
Parameter
Name Description
request DeleteDataAccessScopeRequest

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

deleteDataAccessScope(String name)

public final void deleteDataAccessScope(String name)

Deletes a data access scope.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   String name =
       DataAccessScopeName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_SCOPE]")
           .toString();
   dataAccessControlServiceClient.deleteDataAccessScope(name);
 }
 
Parameter
Name Description
name String

Required. The ID of the data access scope to delete. Format: projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope}

deleteDataAccessScopeCallable()

public final UnaryCallable<DeleteDataAccessScopeRequest,Empty> deleteDataAccessScopeCallable()

Deletes a data access scope.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   DeleteDataAccessScopeRequest request =
       DeleteDataAccessScopeRequest.newBuilder()
           .setName(
               DataAccessScopeName.of(
                       "[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_SCOPE]")
                   .toString())
           .build();
   ApiFuture<Empty> future =
       dataAccessControlServiceClient.deleteDataAccessScopeCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteDataAccessScopeRequest,Empty>

getDataAccessLabel(DataAccessLabelName name)

public final DataAccessLabel getDataAccessLabel(DataAccessLabelName name)

Gets a data access label.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   DataAccessLabelName name =
       DataAccessLabelName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_LABEL]");
   DataAccessLabel response = dataAccessControlServiceClient.getDataAccessLabel(name);
 }
 
Parameter
Name Description
name DataAccessLabelName

Required. The ID of the data access label to retrieve. Format: projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label}

Returns
Type Description
DataAccessLabel

getDataAccessLabel(GetDataAccessLabelRequest request)

public final DataAccessLabel getDataAccessLabel(GetDataAccessLabelRequest request)

Gets a data access label.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   GetDataAccessLabelRequest request =
       GetDataAccessLabelRequest.newBuilder()
           .setName(
               DataAccessLabelName.of(
                       "[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_LABEL]")
                   .toString())
           .build();
   DataAccessLabel response = dataAccessControlServiceClient.getDataAccessLabel(request);
 }
 
Parameter
Name Description
request GetDataAccessLabelRequest

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

Returns
Type Description
DataAccessLabel

getDataAccessLabel(String name)

public final DataAccessLabel getDataAccessLabel(String name)

Gets a data access label.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   String name =
       DataAccessLabelName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_LABEL]")
           .toString();
   DataAccessLabel response = dataAccessControlServiceClient.getDataAccessLabel(name);
 }
 
Parameter
Name Description
name String

Required. The ID of the data access label to retrieve. Format: projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label}

Returns
Type Description
DataAccessLabel

getDataAccessLabelCallable()

public final UnaryCallable<GetDataAccessLabelRequest,DataAccessLabel> getDataAccessLabelCallable()

Gets a data access label.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   GetDataAccessLabelRequest request =
       GetDataAccessLabelRequest.newBuilder()
           .setName(
               DataAccessLabelName.of(
                       "[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_LABEL]")
                   .toString())
           .build();
   ApiFuture<DataAccessLabel> future =
       dataAccessControlServiceClient.getDataAccessLabelCallable().futureCall(request);
   // Do something.
   DataAccessLabel response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetDataAccessLabelRequest,DataAccessLabel>

getDataAccessScope(DataAccessScopeName name)

public final DataAccessScope getDataAccessScope(DataAccessScopeName name)

Retrieves an existing data access scope.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   DataAccessScopeName name =
       DataAccessScopeName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_SCOPE]");
   DataAccessScope response = dataAccessControlServiceClient.getDataAccessScope(name);
 }
 
Parameter
Name Description
name DataAccessScopeName

Required. The ID of the data access scope to retrieve. Format: projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope}

Returns
Type Description
DataAccessScope

getDataAccessScope(GetDataAccessScopeRequest request)

public final DataAccessScope getDataAccessScope(GetDataAccessScopeRequest request)

Retrieves an existing data access scope.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   GetDataAccessScopeRequest request =
       GetDataAccessScopeRequest.newBuilder()
           .setName(
               DataAccessScopeName.of(
                       "[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_SCOPE]")
                   .toString())
           .build();
   DataAccessScope response = dataAccessControlServiceClient.getDataAccessScope(request);
 }
 
Parameter
Name Description
request GetDataAccessScopeRequest

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

Returns
Type Description
DataAccessScope

getDataAccessScope(String name)

public final DataAccessScope getDataAccessScope(String name)

Retrieves an existing data access scope.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   String name =
       DataAccessScopeName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_SCOPE]")
           .toString();
   DataAccessScope response = dataAccessControlServiceClient.getDataAccessScope(name);
 }
 
Parameter
Name Description
name String

Required. The ID of the data access scope to retrieve. Format: projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope}

Returns
Type Description
DataAccessScope

getDataAccessScopeCallable()

public final UnaryCallable<GetDataAccessScopeRequest,DataAccessScope> getDataAccessScopeCallable()

Retrieves an existing data access scope.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   GetDataAccessScopeRequest request =
       GetDataAccessScopeRequest.newBuilder()
           .setName(
               DataAccessScopeName.of(
                       "[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DATA_ACCESS_SCOPE]")
                   .toString())
           .build();
   ApiFuture<DataAccessScope> future =
       dataAccessControlServiceClient.getDataAccessScopeCallable().futureCall(request);
   // Do something.
   DataAccessScope response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetDataAccessScopeRequest,DataAccessScope>

getSettings()

public final DataAccessControlServiceSettings getSettings()
Returns
Type Description
DataAccessControlServiceSettings

getStub()

public DataAccessControlServiceStub getStub()
Returns
Type Description
DataAccessControlServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listDataAccessLabels(InstanceName parent)

public final DataAccessControlServiceClient.ListDataAccessLabelsPagedResponse listDataAccessLabels(InstanceName parent)

Lists all data access labels for the customer.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   for (DataAccessLabel element :
       dataAccessControlServiceClient.listDataAccessLabels(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent InstanceName

Required. The parent resource where this data access label will be created. Format: projects/{project}/locations/{location}/instances/{instance}

Returns
Type Description
DataAccessControlServiceClient.ListDataAccessLabelsPagedResponse

listDataAccessLabels(ListDataAccessLabelsRequest request)

public final DataAccessControlServiceClient.ListDataAccessLabelsPagedResponse listDataAccessLabels(ListDataAccessLabelsRequest request)

Lists all data access labels for the customer.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   ListDataAccessLabelsRequest request =
       ListDataAccessLabelsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   for (DataAccessLabel element :
       dataAccessControlServiceClient.listDataAccessLabels(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListDataAccessLabelsRequest

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

Returns
Type Description
DataAccessControlServiceClient.ListDataAccessLabelsPagedResponse

listDataAccessLabels(String parent)

public final DataAccessControlServiceClient.ListDataAccessLabelsPagedResponse listDataAccessLabels(String parent)

Lists all data access labels for the customer.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   for (DataAccessLabel element :
       dataAccessControlServiceClient.listDataAccessLabels(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent resource where this data access label will be created. Format: projects/{project}/locations/{location}/instances/{instance}

Returns
Type Description
DataAccessControlServiceClient.ListDataAccessLabelsPagedResponse

listDataAccessLabelsCallable()

public final UnaryCallable<ListDataAccessLabelsRequest,ListDataAccessLabelsResponse> listDataAccessLabelsCallable()

Lists all data access labels for the customer.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   ListDataAccessLabelsRequest request =
       ListDataAccessLabelsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   while (true) {
     ListDataAccessLabelsResponse response =
         dataAccessControlServiceClient.listDataAccessLabelsCallable().call(request);
     for (DataAccessLabel element : response.getDataAccessLabelsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListDataAccessLabelsRequest,ListDataAccessLabelsResponse>

listDataAccessLabelsPagedCallable()

public final UnaryCallable<ListDataAccessLabelsRequest,DataAccessControlServiceClient.ListDataAccessLabelsPagedResponse> listDataAccessLabelsPagedCallable()

Lists all data access labels for the customer.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   ListDataAccessLabelsRequest request =
       ListDataAccessLabelsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<DataAccessLabel> future =
       dataAccessControlServiceClient.listDataAccessLabelsPagedCallable().futureCall(request);
   // Do something.
   for (DataAccessLabel element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListDataAccessLabelsRequest,ListDataAccessLabelsPagedResponse>

listDataAccessScopes(InstanceName parent)

public final DataAccessControlServiceClient.ListDataAccessScopesPagedResponse listDataAccessScopes(InstanceName parent)

Lists all existing data access scopes for the customer.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   for (DataAccessScope element :
       dataAccessControlServiceClient.listDataAccessScopes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent InstanceName

Required. The parent resource where this data access scope will be created. Format: projects/{project}/locations/{location}/instances/{instance}

Returns
Type Description
DataAccessControlServiceClient.ListDataAccessScopesPagedResponse

listDataAccessScopes(ListDataAccessScopesRequest request)

public final DataAccessControlServiceClient.ListDataAccessScopesPagedResponse listDataAccessScopes(ListDataAccessScopesRequest request)

Lists all existing data access scopes for the customer.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   ListDataAccessScopesRequest request =
       ListDataAccessScopesRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   for (DataAccessScope element :
       dataAccessControlServiceClient.listDataAccessScopes(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListDataAccessScopesRequest

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

Returns
Type Description
DataAccessControlServiceClient.ListDataAccessScopesPagedResponse

listDataAccessScopes(String parent)

public final DataAccessControlServiceClient.ListDataAccessScopesPagedResponse listDataAccessScopes(String parent)

Lists all existing data access scopes for the customer.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   for (DataAccessScope element :
       dataAccessControlServiceClient.listDataAccessScopes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent resource where this data access scope will be created. Format: projects/{project}/locations/{location}/instances/{instance}

Returns
Type Description
DataAccessControlServiceClient.ListDataAccessScopesPagedResponse

listDataAccessScopesCallable()

public final UnaryCallable<ListDataAccessScopesRequest,ListDataAccessScopesResponse> listDataAccessScopesCallable()

Lists all existing data access scopes for the customer.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   ListDataAccessScopesRequest request =
       ListDataAccessScopesRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   while (true) {
     ListDataAccessScopesResponse response =
         dataAccessControlServiceClient.listDataAccessScopesCallable().call(request);
     for (DataAccessScope element : response.getDataAccessScopesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListDataAccessScopesRequest,ListDataAccessScopesResponse>

listDataAccessScopesPagedCallable()

public final UnaryCallable<ListDataAccessScopesRequest,DataAccessControlServiceClient.ListDataAccessScopesPagedResponse> listDataAccessScopesPagedCallable()

Lists all existing data access scopes for the customer.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   ListDataAccessScopesRequest request =
       ListDataAccessScopesRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<DataAccessScope> future =
       dataAccessControlServiceClient.listDataAccessScopesPagedCallable().futureCall(request);
   // Do something.
   for (DataAccessScope element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListDataAccessScopesRequest,ListDataAccessScopesPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateDataAccessLabel(DataAccessLabel dataAccessLabel, FieldMask updateMask)

public final DataAccessLabel updateDataAccessLabel(DataAccessLabel dataAccessLabel, FieldMask updateMask)

Updates a data access label.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   DataAccessLabel dataAccessLabel = DataAccessLabel.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   DataAccessLabel response =
       dataAccessControlServiceClient.updateDataAccessLabel(dataAccessLabel, updateMask);
 }
 
Parameters
Name Description
dataAccessLabel DataAccessLabel

Required. The data access label to update.

The label's name field is used to identify the label to update. Format: projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label}

updateMask FieldMask

The list of fields to update. If not included, all fields with a non-empty value will be overwritten. Currently, only the description and definition fields are supported for update; an update call that attempts to update any other fields will return INVALID_ARGUMENT.

Returns
Type Description
DataAccessLabel

updateDataAccessLabel(UpdateDataAccessLabelRequest request)

public final DataAccessLabel updateDataAccessLabel(UpdateDataAccessLabelRequest request)

Updates a data access label.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   UpdateDataAccessLabelRequest request =
       UpdateDataAccessLabelRequest.newBuilder()
           .setDataAccessLabel(DataAccessLabel.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   DataAccessLabel response = dataAccessControlServiceClient.updateDataAccessLabel(request);
 }
 
Parameter
Name Description
request UpdateDataAccessLabelRequest

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

Returns
Type Description
DataAccessLabel

updateDataAccessLabelCallable()

public final UnaryCallable<UpdateDataAccessLabelRequest,DataAccessLabel> updateDataAccessLabelCallable()

Updates a data access label.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   UpdateDataAccessLabelRequest request =
       UpdateDataAccessLabelRequest.newBuilder()
           .setDataAccessLabel(DataAccessLabel.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<DataAccessLabel> future =
       dataAccessControlServiceClient.updateDataAccessLabelCallable().futureCall(request);
   // Do something.
   DataAccessLabel response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateDataAccessLabelRequest,DataAccessLabel>

updateDataAccessScope(DataAccessScope dataAccessScope, FieldMask updateMask)

public final DataAccessScope updateDataAccessScope(DataAccessScope dataAccessScope, FieldMask updateMask)

Updates a data access scope.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   DataAccessScope dataAccessScope = DataAccessScope.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   DataAccessScope response =
       dataAccessControlServiceClient.updateDataAccessScope(dataAccessScope, updateMask);
 }
 
Parameters
Name Description
dataAccessScope DataAccessScope

Required. The data access scope to update.

The scope's name field is used to identify the scope to update. Format: projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope}

updateMask FieldMask

The list of fields to update. If not included, all fields with a non-empty value will be overwritten. Currently, only the description, the allowed and denied labels list fields are supported for update; an update call that attempts to update any other fields will return INVALID_ARGUMENT.

Returns
Type Description
DataAccessScope

updateDataAccessScope(UpdateDataAccessScopeRequest request)

public final DataAccessScope updateDataAccessScope(UpdateDataAccessScopeRequest request)

Updates a data access scope.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   UpdateDataAccessScopeRequest request =
       UpdateDataAccessScopeRequest.newBuilder()
           .setDataAccessScope(DataAccessScope.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   DataAccessScope response = dataAccessControlServiceClient.updateDataAccessScope(request);
 }
 
Parameter
Name Description
request UpdateDataAccessScopeRequest

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

Returns
Type Description
DataAccessScope

updateDataAccessScopeCallable()

public final UnaryCallable<UpdateDataAccessScopeRequest,DataAccessScope> updateDataAccessScopeCallable()

Updates a data access scope.

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 (DataAccessControlServiceClient dataAccessControlServiceClient =
     DataAccessControlServiceClient.create()) {
   UpdateDataAccessScopeRequest request =
       UpdateDataAccessScopeRequest.newBuilder()
           .setDataAccessScope(DataAccessScope.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<DataAccessScope> future =
       dataAccessControlServiceClient.updateDataAccessScopeCallable().futureCall(request);
   // Do something.
   DataAccessScope response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateDataAccessScopeRequest,DataAccessScope>