@Generated(value="by gapic-generator-java") public class DataScanServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
DataScanName name = DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]");
DataScan response = dataScanServiceClient.getDataScan(name);
}
Note: close() needs to be called on the DataScanServiceClient 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:
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 DataScanServiceSettings 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
DataScanServiceSettings dataScanServiceSettings =
DataScanServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DataScanServiceClient dataScanServiceClient =
DataScanServiceClient.create(dataScanServiceSettings);
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
DataScanServiceSettings dataScanServiceSettings =
DataScanServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DataScanServiceClient dataScanServiceClient =
DataScanServiceClient.create(dataScanServiceSettings);
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
DataScanServiceSettings dataScanServiceSettings =
DataScanServiceSettings.newHttpJsonBuilder().build();
DataScanServiceClient dataScanServiceClient =
DataScanServiceClient.create(dataScanServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
DataScanServiceClient.ListDataScanJobsFixedSizeCollection |
static class |
DataScanServiceClient.ListDataScanJobsPage |
static class |
DataScanServiceClient.ListDataScanJobsPagedResponse |
static class |
DataScanServiceClient.ListDataScansFixedSizeCollection |
static class |
DataScanServiceClient.ListDataScansPage |
static class |
DataScanServiceClient.ListDataScansPagedResponse |
static class |
DataScanServiceClient.ListLocationsFixedSizeCollection |
static class |
DataScanServiceClient.ListLocationsPage |
static class |
DataScanServiceClient.ListLocationsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
DataScanServiceClient(DataScanServiceSettings settings)
Constructs an instance of DataScanServiceClient, using the given settings.
|
protected |
DataScanServiceClient(DataScanServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static DataScanServiceClient |
create()
Constructs an instance of DataScanServiceClient with default settings.
|
static DataScanServiceClient |
create(DataScanServiceSettings settings)
Constructs an instance of DataScanServiceClient, using the given settings.
|
static DataScanServiceClient |
create(DataScanServiceStub stub)
Constructs an instance of DataScanServiceClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<DataScan,OperationMetadata> |
createDataScanAsync(CreateDataScanRequest request)
Creates a DataScan resource.
|
com.google.api.gax.longrunning.OperationFuture<DataScan,OperationMetadata> |
createDataScanAsync(LocationName parent,
DataScan dataScan,
String dataScanId)
Creates a DataScan resource.
|
com.google.api.gax.longrunning.OperationFuture<DataScan,OperationMetadata> |
createDataScanAsync(String parent,
DataScan dataScan,
String dataScanId)
Creates a DataScan resource.
|
com.google.api.gax.rpc.UnaryCallable<CreateDataScanRequest,com.google.longrunning.Operation> |
createDataScanCallable()
Creates a DataScan resource.
|
com.google.api.gax.rpc.OperationCallable<CreateDataScanRequest,DataScan,OperationMetadata> |
createDataScanOperationCallable()
Creates a DataScan resource.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteDataScanAsync(DataScanName name)
Deletes a DataScan resource.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteDataScanAsync(DeleteDataScanRequest request)
Deletes a DataScan resource.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteDataScanAsync(String name)
Deletes a DataScan resource.
|
com.google.api.gax.rpc.UnaryCallable<DeleteDataScanRequest,com.google.longrunning.Operation> |
deleteDataScanCallable()
Deletes a DataScan resource.
|
com.google.api.gax.rpc.OperationCallable<DeleteDataScanRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteDataScanOperationCallable()
Deletes a DataScan resource.
|
DataScan |
getDataScan(DataScanName name)
Gets a DataScan resource.
|
DataScan |
getDataScan(GetDataScanRequest request)
Gets a DataScan resource.
|
DataScan |
getDataScan(String name)
Gets a DataScan resource.
|
com.google.api.gax.rpc.UnaryCallable<GetDataScanRequest,DataScan> |
getDataScanCallable()
Gets a DataScan resource.
|
DataScanJob |
getDataScanJob(DataScanJobName name)
Gets a DataScanJob resource.
|
DataScanJob |
getDataScanJob(GetDataScanJobRequest request)
Gets a DataScanJob resource.
|
DataScanJob |
getDataScanJob(String name)
Gets a DataScanJob resource.
|
com.google.api.gax.rpc.UnaryCallable<GetDataScanJobRequest,DataScanJob> |
getDataScanJobCallable()
Gets a DataScanJob resource.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
com.google.cloud.location.Location |
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
DataScanServiceSettings |
getSettings() |
DataScanServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
DataScanServiceClient.ListDataScanJobsPagedResponse |
listDataScanJobs(DataScanName parent)
Lists DataScanJobs under the given DataScan.
|
DataScanServiceClient.ListDataScanJobsPagedResponse |
listDataScanJobs(ListDataScanJobsRequest request)
Lists DataScanJobs under the given DataScan.
|
DataScanServiceClient.ListDataScanJobsPagedResponse |
listDataScanJobs(String parent)
Lists DataScanJobs under the given DataScan.
|
com.google.api.gax.rpc.UnaryCallable<ListDataScanJobsRequest,ListDataScanJobsResponse> |
listDataScanJobsCallable()
Lists DataScanJobs under the given DataScan.
|
com.google.api.gax.rpc.UnaryCallable<ListDataScanJobsRequest,DataScanServiceClient.ListDataScanJobsPagedResponse> |
listDataScanJobsPagedCallable()
Lists DataScanJobs under the given DataScan.
|
DataScanServiceClient.ListDataScansPagedResponse |
listDataScans(ListDataScansRequest request)
Lists DataScans.
|
DataScanServiceClient.ListDataScansPagedResponse |
listDataScans(LocationName parent)
Lists DataScans.
|
DataScanServiceClient.ListDataScansPagedResponse |
listDataScans(String parent)
Lists DataScans.
|
com.google.api.gax.rpc.UnaryCallable<ListDataScansRequest,ListDataScansResponse> |
listDataScansCallable()
Lists DataScans.
|
com.google.api.gax.rpc.UnaryCallable<ListDataScansRequest,DataScanServiceClient.ListDataScansPagedResponse> |
listDataScansPagedCallable()
Lists DataScans.
|
DataScanServiceClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,DataScanServiceClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
RunDataScanResponse |
runDataScan(DataScanName name)
Runs an on-demand execution of a DataScan
|
RunDataScanResponse |
runDataScan(RunDataScanRequest request)
Runs an on-demand execution of a DataScan
|
RunDataScanResponse |
runDataScan(String name)
Runs an on-demand execution of a DataScan
|
com.google.api.gax.rpc.UnaryCallable<RunDataScanRequest,RunDataScanResponse> |
runDataScanCallable()
Runs an on-demand execution of a DataScan
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<DataScan,OperationMetadata> |
updateDataScanAsync(DataScan dataScan,
com.google.protobuf.FieldMask updateMask)
Updates a DataScan resource.
|
com.google.api.gax.longrunning.OperationFuture<DataScan,OperationMetadata> |
updateDataScanAsync(UpdateDataScanRequest request)
Updates a DataScan resource.
|
com.google.api.gax.rpc.UnaryCallable<UpdateDataScanRequest,com.google.longrunning.Operation> |
updateDataScanCallable()
Updates a DataScan resource.
|
com.google.api.gax.rpc.OperationCallable<UpdateDataScanRequest,DataScan,OperationMetadata> |
updateDataScanOperationCallable()
Updates a DataScan resource.
|
protected DataScanServiceClient(DataScanServiceSettings settings) throws IOException
IOExceptionprotected DataScanServiceClient(DataScanServiceStub stub)
public static final DataScanServiceClient create() throws IOException
IOExceptionpublic static final DataScanServiceClient create(DataScanServiceSettings settings) throws IOException
IOExceptionpublic static final DataScanServiceClient create(DataScanServiceStub stub)
public final DataScanServiceSettings getSettings()
public DataScanServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final com.google.api.gax.longrunning.OperationFuture<DataScan,OperationMetadata> createDataScanAsync(LocationName parent, DataScan dataScan, String dataScanId)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
DataScan dataScan = DataScan.newBuilder().build();
String dataScanId = "dataScanId1260787906";
DataScan response =
dataScanServiceClient.createDataScanAsync(parent, dataScan, dataScanId).get();
}
parent - Required. The resource name of the parent location:
`projects/{project}/locations/{location_id}` where `project` refers to a
*project_id* or *project_number* and `location_id` refers to a GCP region.dataScan - Required. DataScan resource.dataScanId - Required. DataScan identifier.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<DataScan,OperationMetadata> createDataScanAsync(String parent, DataScan dataScan, String dataScanId)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
DataScan dataScan = DataScan.newBuilder().build();
String dataScanId = "dataScanId1260787906";
DataScan response =
dataScanServiceClient.createDataScanAsync(parent, dataScan, dataScanId).get();
}
parent - Required. The resource name of the parent location:
`projects/{project}/locations/{location_id}` where `project` refers to a
*project_id* or *project_number* and `location_id` refers to a GCP region.dataScan - Required. DataScan resource.dataScanId - Required. DataScan identifier.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<DataScan,OperationMetadata> createDataScanAsync(CreateDataScanRequest request)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
CreateDataScanRequest request =
CreateDataScanRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDataScan(DataScan.newBuilder().build())
.setDataScanId("dataScanId1260787906")
.setValidateOnly(true)
.build();
DataScan response = dataScanServiceClient.createDataScanAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateDataScanRequest,DataScan,OperationMetadata> createDataScanOperationCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
CreateDataScanRequest request =
CreateDataScanRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDataScan(DataScan.newBuilder().build())
.setDataScanId("dataScanId1260787906")
.setValidateOnly(true)
.build();
OperationFuture<DataScan, OperationMetadata> future =
dataScanServiceClient.createDataScanOperationCallable().futureCall(request);
// Do something.
DataScan response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateDataScanRequest,com.google.longrunning.Operation> createDataScanCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
CreateDataScanRequest request =
CreateDataScanRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDataScan(DataScan.newBuilder().build())
.setDataScanId("dataScanId1260787906")
.setValidateOnly(true)
.build();
ApiFuture<Operation> future =
dataScanServiceClient.createDataScanCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<DataScan,OperationMetadata> updateDataScanAsync(DataScan dataScan, com.google.protobuf.FieldMask updateMask)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
DataScan dataScan = DataScan.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
DataScan response = dataScanServiceClient.updateDataScanAsync(dataScan, updateMask).get();
}
dataScan - Required. DataScan resource to be updated.
Only fields specified in `update_mask` are updated.
updateMask - Required. Mask of fields to update.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<DataScan,OperationMetadata> updateDataScanAsync(UpdateDataScanRequest request)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
UpdateDataScanRequest request =
UpdateDataScanRequest.newBuilder()
.setDataScan(DataScan.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.build();
DataScan response = dataScanServiceClient.updateDataScanAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateDataScanRequest,DataScan,OperationMetadata> updateDataScanOperationCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
UpdateDataScanRequest request =
UpdateDataScanRequest.newBuilder()
.setDataScan(DataScan.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.build();
OperationFuture<DataScan, OperationMetadata> future =
dataScanServiceClient.updateDataScanOperationCallable().futureCall(request);
// Do something.
DataScan response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateDataScanRequest,com.google.longrunning.Operation> updateDataScanCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
UpdateDataScanRequest request =
UpdateDataScanRequest.newBuilder()
.setDataScan(DataScan.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.build();
ApiFuture<Operation> future =
dataScanServiceClient.updateDataScanCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDataScanAsync(DataScanName name)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
DataScanName name = DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]");
dataScanServiceClient.deleteDataScanAsync(name).get();
}
name - Required. The resource name of the dataScan:
`projects/{project}/locations/{location_id}/dataScans/{data_scan_id}` where `project`
refers to a *project_id* or *project_number* and `location_id` refers to a
GCP region.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDataScanAsync(String name)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
String name = DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString();
dataScanServiceClient.deleteDataScanAsync(name).get();
}
name - Required. The resource name of the dataScan:
`projects/{project}/locations/{location_id}/dataScans/{data_scan_id}` where `project`
refers to a *project_id* or *project_number* and `location_id` refers to a
GCP region.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDataScanAsync(DeleteDataScanRequest request)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
DeleteDataScanRequest request =
DeleteDataScanRequest.newBuilder()
.setName(DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString())
.build();
dataScanServiceClient.deleteDataScanAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteDataScanRequest,com.google.protobuf.Empty,OperationMetadata> deleteDataScanOperationCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
DeleteDataScanRequest request =
DeleteDataScanRequest.newBuilder()
.setName(DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
dataScanServiceClient.deleteDataScanOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteDataScanRequest,com.google.longrunning.Operation> deleteDataScanCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
DeleteDataScanRequest request =
DeleteDataScanRequest.newBuilder()
.setName(DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString())
.build();
ApiFuture<Operation> future =
dataScanServiceClient.deleteDataScanCallable().futureCall(request);
// Do something.
future.get();
}
public final DataScan getDataScan(DataScanName name)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
DataScanName name = DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]");
DataScan response = dataScanServiceClient.getDataScan(name);
}
name - Required. The resource name of the dataScan:
`projects/{project}/locations/{location_id}/dataScans/{data_scan_id}` where `project`
refers to a *project_id* or *project_number* and `location_id` refers to a
GCP region.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataScan getDataScan(String name)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
String name = DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString();
DataScan response = dataScanServiceClient.getDataScan(name);
}
name - Required. The resource name of the dataScan:
`projects/{project}/locations/{location_id}/dataScans/{data_scan_id}` where `project`
refers to a *project_id* or *project_number* and `location_id` refers to a
GCP region.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataScan getDataScan(GetDataScanRequest request)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
GetDataScanRequest request =
GetDataScanRequest.newBuilder()
.setName(DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString())
.build();
DataScan response = dataScanServiceClient.getDataScan(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDataScanRequest,DataScan> getDataScanCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
GetDataScanRequest request =
GetDataScanRequest.newBuilder()
.setName(DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString())
.build();
ApiFuture<DataScan> future = dataScanServiceClient.getDataScanCallable().futureCall(request);
// Do something.
DataScan response = future.get();
}
public final DataScanServiceClient.ListDataScansPagedResponse listDataScans(LocationName parent)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (DataScan element : dataScanServiceClient.listDataScans(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the parent location:
`projects/{project}/locations/{location_id}` where `project` refers to a
*project_id* or *project_number* and `location_id` refers to a GCP region.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataScanServiceClient.ListDataScansPagedResponse listDataScans(String parent)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (DataScan element : dataScanServiceClient.listDataScans(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the parent location:
`projects/{project}/locations/{location_id}` where `project` refers to a
*project_id* or *project_number* and `location_id` refers to a GCP region.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataScanServiceClient.ListDataScansPagedResponse listDataScans(ListDataScansRequest request)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
ListDataScansRequest request =
ListDataScansRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (DataScan element : dataScanServiceClient.listDataScans(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDataScansRequest,DataScanServiceClient.ListDataScansPagedResponse> listDataScansPagedCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
ListDataScansRequest request =
ListDataScansRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<DataScan> future =
dataScanServiceClient.listDataScansPagedCallable().futureCall(request);
// Do something.
for (DataScan element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDataScansRequest,ListDataScansResponse> listDataScansCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
ListDataScansRequest request =
ListDataScansRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListDataScansResponse response =
dataScanServiceClient.listDataScansCallable().call(request);
for (DataScan element : response.getDataScansList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final RunDataScanResponse runDataScan(DataScanName name)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
DataScanName name = DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]");
RunDataScanResponse response = dataScanServiceClient.runDataScan(name);
}
name - Required. The resource name of the DataScan:
`projects/{project}/locations/{location_id}/dataScans/{data_scan_id}`. where `project`
refers to a *project_id* or *project_number* and `location_id` refers to a
GCP region.
Only **OnDemand** data scans are allowed.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final RunDataScanResponse runDataScan(String name)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
String name = DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString();
RunDataScanResponse response = dataScanServiceClient.runDataScan(name);
}
name - Required. The resource name of the DataScan:
`projects/{project}/locations/{location_id}/dataScans/{data_scan_id}`. where `project`
refers to a *project_id* or *project_number* and `location_id` refers to a
GCP region.
Only **OnDemand** data scans are allowed.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final RunDataScanResponse runDataScan(RunDataScanRequest request)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
RunDataScanRequest request =
RunDataScanRequest.newBuilder()
.setName(DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString())
.build();
RunDataScanResponse response = dataScanServiceClient.runDataScan(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<RunDataScanRequest,RunDataScanResponse> runDataScanCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
RunDataScanRequest request =
RunDataScanRequest.newBuilder()
.setName(DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString())
.build();
ApiFuture<RunDataScanResponse> future =
dataScanServiceClient.runDataScanCallable().futureCall(request);
// Do something.
RunDataScanResponse response = future.get();
}
public final DataScanJob getDataScanJob(DataScanJobName name)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
DataScanJobName name = DataScanJobName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]", "[JOB]");
DataScanJob response = dataScanServiceClient.getDataScanJob(name);
}
name - Required. The resource name of the DataScanJob:
`projects/{project}/locations/{location_id}/dataScans/{data_scan_id}/jobs/{data_scan_job_id}`
where `project` refers to a *project_id* or *project_number* and
`location_id` refers to a GCP region.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataScanJob getDataScanJob(String name)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
String name = DataScanJobName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]", "[JOB]").toString();
DataScanJob response = dataScanServiceClient.getDataScanJob(name);
}
name - Required. The resource name of the DataScanJob:
`projects/{project}/locations/{location_id}/dataScans/{data_scan_id}/jobs/{data_scan_job_id}`
where `project` refers to a *project_id* or *project_number* and
`location_id` refers to a GCP region.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataScanJob getDataScanJob(GetDataScanJobRequest request)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
GetDataScanJobRequest request =
GetDataScanJobRequest.newBuilder()
.setName(
DataScanJobName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]", "[JOB]").toString())
.build();
DataScanJob response = dataScanServiceClient.getDataScanJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDataScanJobRequest,DataScanJob> getDataScanJobCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
GetDataScanJobRequest request =
GetDataScanJobRequest.newBuilder()
.setName(
DataScanJobName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]", "[JOB]").toString())
.build();
ApiFuture<DataScanJob> future =
dataScanServiceClient.getDataScanJobCallable().futureCall(request);
// Do something.
DataScanJob response = future.get();
}
public final DataScanServiceClient.ListDataScanJobsPagedResponse listDataScanJobs(DataScanName parent)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
DataScanName parent = DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]");
for (DataScanJob element : dataScanServiceClient.listDataScanJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the parent environment:
`projects/{project}/locations/{location_id}/dataScans/{data_scan_id}` where `project`
refers to a *project_id* or *project_number* and `location_id` refers to a
GCP region.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataScanServiceClient.ListDataScanJobsPagedResponse listDataScanJobs(String parent)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
String parent = DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString();
for (DataScanJob element : dataScanServiceClient.listDataScanJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the parent environment:
`projects/{project}/locations/{location_id}/dataScans/{data_scan_id}` where `project`
refers to a *project_id* or *project_number* and `location_id` refers to a
GCP region.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataScanServiceClient.ListDataScanJobsPagedResponse listDataScanJobs(ListDataScanJobsRequest request)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
ListDataScanJobsRequest request =
ListDataScanJobsRequest.newBuilder()
.setParent(DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (DataScanJob element : dataScanServiceClient.listDataScanJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDataScanJobsRequest,DataScanServiceClient.ListDataScanJobsPagedResponse> listDataScanJobsPagedCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
ListDataScanJobsRequest request =
ListDataScanJobsRequest.newBuilder()
.setParent(DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<DataScanJob> future =
dataScanServiceClient.listDataScanJobsPagedCallable().futureCall(request);
// Do something.
for (DataScanJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDataScanJobsRequest,ListDataScanJobsResponse> listDataScanJobsCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
ListDataScanJobsRequest request =
ListDataScanJobsRequest.newBuilder()
.setParent(DataScanName.of("[PROJECT]", "[LOCATION]", "[DATASCAN]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListDataScanJobsResponse response =
dataScanServiceClient.listDataScanJobsCallable().call(request);
for (DataScanJob element : response.getDataScanJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final DataScanServiceClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : dataScanServiceClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,DataScanServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
dataScanServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
dataScanServiceClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = dataScanServiceClient.getLocation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
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 (DataScanServiceClient dataScanServiceClient = DataScanServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = dataScanServiceClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2023 Google LLC. All rights reserved.