All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.dataplex.v1.DataScanServiceClient Maven / Gradle / Ivy

Go to download

Cloud Dataplex provides intelligent data fabric that enables organizations to centrally manage, monitor, and govern their data across data lakes, data warehouses, and data marts with consistent controls, providing access to trusted data and powering analytics at scale.

There is a newer version: 1.49.0
Show newest version
/*
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.dataplex.v1;

import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.dataplex.v1.stub.DataScanServiceStub;
import com.google.cloud.dataplex.v1.stub.DataScanServiceStubSettings;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * Service Description: DataScanService manages DataScan resources which can be configured to run
 * various types of data scanning workload and generate enriched metadata (e.g. Data Profile, Data
 * Quality) for the data source.
 *
 * 

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: * *

{@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);
 * }
 * }
* *

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: * *

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

See the individual methods for example code. * *

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

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

To customize credentials: * *

{@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
 * DataScanServiceSettings dataScanServiceSettings =
 *     DataScanServiceSettings.newBuilder()
 *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
 *         .build();
 * DataScanServiceClient dataScanServiceClient =
 *     DataScanServiceClient.create(dataScanServiceSettings);
 * }
* *

To customize the endpoint: * *

{@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
 * 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: * *

{@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
 * DataScanServiceSettings dataScanServiceSettings =
 *     DataScanServiceSettings.newHttpJsonBuilder().build();
 * DataScanServiceClient dataScanServiceClient =
 *     DataScanServiceClient.create(dataScanServiceSettings);
 * }
* *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class DataScanServiceClient implements BackgroundResource { private final DataScanServiceSettings settings; private final DataScanServiceStub stub; private final OperationsClient httpJsonOperationsClient; private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of DataScanServiceClient with default settings. */ public static final DataScanServiceClient create() throws IOException { return create(DataScanServiceSettings.newBuilder().build()); } /** * Constructs an instance of DataScanServiceClient, using the given settings. The channels are * created based on the settings passed in, or defaults for any settings that are not set. */ public static final DataScanServiceClient create(DataScanServiceSettings settings) throws IOException { return new DataScanServiceClient(settings); } /** * Constructs an instance of DataScanServiceClient, using the given stub for making calls. This is * for advanced usage - prefer using create(DataScanServiceSettings). */ public static final DataScanServiceClient create(DataScanServiceStub stub) { return new DataScanServiceClient(stub); } /** * Constructs an instance of DataScanServiceClient, 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. */ protected DataScanServiceClient(DataScanServiceSettings settings) throws IOException { this.settings = settings; this.stub = ((DataScanServiceStubSettings) settings.getStubSettings()).createStub(); this.operationsClient = com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } protected DataScanServiceClient(DataScanServiceStub stub) { this.settings = null; this.stub = stub; this.operationsClient = com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final DataScanServiceSettings getSettings() { return settings; } public DataScanServiceStub getStub() { return stub; } /** * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } /** * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ @BetaApi public final OperationsClient getHttpJsonOperationsClient() { return httpJsonOperationsClient; } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a DataScan resource. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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. * @param dataScan Required. DataScan resource. * @param dataScanId Required. DataScan identifier. *
    *
  • Must contain only lowercase letters, numbers and hyphens. *
  • Must start with a letter. *
  • Must end with a number or a letter. *
  • Must be between 1-63 characters. *
  • Must be unique within the customer project / location. *
* * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createDataScanAsync( LocationName parent, DataScan dataScan, String dataScanId) { CreateDataScanRequest request = CreateDataScanRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setDataScan(dataScan) .setDataScanId(dataScanId) .build(); return createDataScanAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a DataScan resource. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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. * @param dataScan Required. DataScan resource. * @param dataScanId Required. DataScan identifier. *
    *
  • Must contain only lowercase letters, numbers and hyphens. *
  • Must start with a letter. *
  • Must end with a number or a letter. *
  • Must be between 1-63 characters. *
  • Must be unique within the customer project / location. *
* * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createDataScanAsync( String parent, DataScan dataScan, String dataScanId) { CreateDataScanRequest request = CreateDataScanRequest.newBuilder() .setParent(parent) .setDataScan(dataScan) .setDataScanId(dataScanId) .build(); return createDataScanAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a DataScan resource. * *

Sample code: * *

{@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();
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createDataScanAsync( CreateDataScanRequest request) { return createDataScanOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a DataScan resource. * *

Sample code: * *

{@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 future =
   *       dataScanServiceClient.createDataScanOperationCallable().futureCall(request);
   *   // Do something.
   *   DataScan response = future.get();
   * }
   * }
*/ public final OperationCallable createDataScanOperationCallable() { return stub.createDataScanOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a DataScan resource. * *

Sample code: * *

{@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 future =
   *       dataScanServiceClient.createDataScanCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable createDataScanCallable() { return stub.createDataScanCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates a DataScan resource. * *

Sample code: * *

{@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();
   * }
   * }
* * @param dataScan Required. DataScan resource to be updated. *

Only fields specified in `update_mask` are updated. * @param updateMask Required. Mask of fields to update. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture updateDataScanAsync( DataScan dataScan, FieldMask updateMask) { UpdateDataScanRequest request = UpdateDataScanRequest.newBuilder().setDataScan(dataScan).setUpdateMask(updateMask).build(); return updateDataScanAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates a DataScan resource. * *

Sample code: * *

{@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();
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture updateDataScanAsync( UpdateDataScanRequest request) { return updateDataScanOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates a DataScan resource. * *

Sample code: * *

{@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 future =
   *       dataScanServiceClient.updateDataScanOperationCallable().futureCall(request);
   *   // Do something.
   *   DataScan response = future.get();
   * }
   * }
*/ public final OperationCallable updateDataScanOperationCallable() { return stub.updateDataScanOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates a DataScan resource. * *

Sample code: * *

{@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 future =
   *       dataScanServiceClient.updateDataScanCallable().futureCall(request);
   *   // Do something.
   *   Operation response = future.get();
   * }
   * }
*/ public final UnaryCallable updateDataScanCallable() { return stub.updateDataScanCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a DataScan resource. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteDataScanAsync(DataScanName name) { DeleteDataScanRequest request = DeleteDataScanRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return deleteDataScanAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a DataScan resource. * *

Sample code: * *

{@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();
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteDataScanAsync(String name) { DeleteDataScanRequest request = DeleteDataScanRequest.newBuilder().setName(name).build(); return deleteDataScanAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a DataScan resource. * *

Sample code: * *

{@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();
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteDataScanAsync( DeleteDataScanRequest request) { return deleteDataScanOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a DataScan resource. * *

Sample code: * *

{@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 future =
   *       dataScanServiceClient.deleteDataScanOperationCallable().futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final OperationCallable deleteDataScanOperationCallable() { return stub.deleteDataScanOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a DataScan resource. * *

Sample code: * *

{@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 future =
   *       dataScanServiceClient.deleteDataScanCallable().futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final UnaryCallable deleteDataScanCallable() { return stub.deleteDataScanCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a DataScan resource. * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final DataScan getDataScan(DataScanName name) { GetDataScanRequest request = GetDataScanRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getDataScan(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a DataScan resource. * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final DataScan getDataScan(String name) { GetDataScanRequest request = GetDataScanRequest.newBuilder().setName(name).build(); return getDataScan(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a DataScan resource. * *

Sample code: * *

{@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);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final DataScan getDataScan(GetDataScanRequest request) { return getDataScanCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a DataScan resource. * *

Sample code: * *

{@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 future = dataScanServiceClient.getDataScanCallable().futureCall(request);
   *   // Do something.
   *   DataScan response = future.get();
   * }
   * }
*/ public final UnaryCallable getDataScanCallable() { return stub.getDataScanCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists DataScans. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListDataScansPagedResponse listDataScans(LocationName parent) { ListDataScansRequest request = ListDataScansRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listDataScans(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists DataScans. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListDataScansPagedResponse listDataScans(String parent) { ListDataScansRequest request = ListDataScansRequest.newBuilder().setParent(parent).build(); return listDataScans(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists DataScans. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListDataScansPagedResponse listDataScans(ListDataScansRequest request) { return listDataScansPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists DataScans. * *

Sample code: * *

{@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 future =
   *       dataScanServiceClient.listDataScansPagedCallable().futureCall(request);
   *   // Do something.
   *   for (DataScan element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listDataScansPagedCallable() { return stub.listDataScansPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists DataScans. * *

Sample code: * *

{@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 UnaryCallable listDataScansCallable() { return stub.listDataScansCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Runs an on-demand execution of a DataScan * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final RunDataScanResponse runDataScan(DataScanName name) { RunDataScanRequest request = RunDataScanRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return runDataScan(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Runs an on-demand execution of a DataScan * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final RunDataScanResponse runDataScan(String name) { RunDataScanRequest request = RunDataScanRequest.newBuilder().setName(name).build(); return runDataScan(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Runs an on-demand execution of a DataScan * *

Sample code: * *

{@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);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final RunDataScanResponse runDataScan(RunDataScanRequest request) { return runDataScanCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Runs an on-demand execution of a DataScan * *

Sample code: * *

{@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 future =
   *       dataScanServiceClient.runDataScanCallable().futureCall(request);
   *   // Do something.
   *   RunDataScanResponse response = future.get();
   * }
   * }
*/ public final UnaryCallable runDataScanCallable() { return stub.runDataScanCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a DataScanJob resource. * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final DataScanJob getDataScanJob(DataScanJobName name) { GetDataScanJobRequest request = GetDataScanJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getDataScanJob(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a DataScanJob resource. * *

Sample code: * *

{@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);
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final DataScanJob getDataScanJob(String name) { GetDataScanJobRequest request = GetDataScanJobRequest.newBuilder().setName(name).build(); return getDataScanJob(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a DataScanJob resource. * *

Sample code: * *

{@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);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final DataScanJob getDataScanJob(GetDataScanJobRequest request) { return getDataScanJobCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a DataScanJob resource. * *

Sample code: * *

{@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 future =
   *       dataScanServiceClient.getDataScanJobCallable().futureCall(request);
   *   // Do something.
   *   DataScanJob response = future.get();
   * }
   * }
*/ public final UnaryCallable getDataScanJobCallable() { return stub.getDataScanJobCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists DataScanJobs under the given DataScan. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListDataScanJobsPagedResponse listDataScanJobs(DataScanName parent) { ListDataScanJobsRequest request = ListDataScanJobsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listDataScanJobs(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists DataScanJobs under the given DataScan. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListDataScanJobsPagedResponse listDataScanJobs(String parent) { ListDataScanJobsRequest request = ListDataScanJobsRequest.newBuilder().setParent(parent).build(); return listDataScanJobs(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists DataScanJobs under the given DataScan. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListDataScanJobsPagedResponse listDataScanJobs(ListDataScanJobsRequest request) { return listDataScanJobsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists DataScanJobs under the given DataScan. * *

Sample code: * *

{@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 future =
   *       dataScanServiceClient.listDataScanJobsPagedCallable().futureCall(request);
   *   // Do something.
   *   for (DataScanJob element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listDataScanJobsPagedCallable() { return stub.listDataScanJobsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists DataScanJobs under the given DataScan. * *

Sample code: * *

{@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 UnaryCallable listDataScanJobsCallable() { return stub.listDataScanJobsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. * *

Sample code: * *

{@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);
   *   }
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { return listLocationsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. * *

Sample code: * *

{@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 future =
   *       dataScanServiceClient.listLocationsPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Location element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listLocationsPagedCallable() { return stub.listLocationsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. * *

Sample code: * *

{@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 UnaryCallable listLocationsCallable() { return stub.listLocationsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets information about a location. * *

Sample code: * *

{@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);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Location getLocation(GetLocationRequest request) { return getLocationCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets information about a location. * *

Sample code: * *

{@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 future = dataScanServiceClient.getLocationCallable().futureCall(request);
   *   // Do something.
   *   Location response = future.get();
   * }
   * }
*/ public final UnaryCallable getLocationCallable() { return stub.getLocationCallable(); } @Override public final void close() { stub.close(); } @Override public void shutdown() { stub.shutdown(); } @Override public boolean isShutdown() { return stub.isShutdown(); } @Override public boolean isTerminated() { return stub.isTerminated(); } @Override public void shutdownNow() { stub.shutdownNow(); } @Override public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return stub.awaitTermination(duration, unit); } public static class ListDataScansPagedResponse extends AbstractPagedListResponse< ListDataScansRequest, ListDataScansResponse, DataScan, ListDataScansPage, ListDataScansFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListDataScansPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListDataScansPagedResponse(input), MoreExecutors.directExecutor()); } private ListDataScansPagedResponse(ListDataScansPage page) { super(page, ListDataScansFixedSizeCollection.createEmptyCollection()); } } public static class ListDataScansPage extends AbstractPage< ListDataScansRequest, ListDataScansResponse, DataScan, ListDataScansPage> { private ListDataScansPage( PageContext context, ListDataScansResponse response) { super(context, response); } private static ListDataScansPage createEmptyPage() { return new ListDataScansPage(null, null); } @Override protected ListDataScansPage createPage( PageContext context, ListDataScansResponse response) { return new ListDataScansPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListDataScansFixedSizeCollection extends AbstractFixedSizeCollection< ListDataScansRequest, ListDataScansResponse, DataScan, ListDataScansPage, ListDataScansFixedSizeCollection> { private ListDataScansFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } private static ListDataScansFixedSizeCollection createEmptyCollection() { return new ListDataScansFixedSizeCollection(null, 0); } @Override protected ListDataScansFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListDataScansFixedSizeCollection(pages, collectionSize); } } public static class ListDataScanJobsPagedResponse extends AbstractPagedListResponse< ListDataScanJobsRequest, ListDataScanJobsResponse, DataScanJob, ListDataScanJobsPage, ListDataScanJobsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListDataScanJobsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListDataScanJobsPagedResponse(input), MoreExecutors.directExecutor()); } private ListDataScanJobsPagedResponse(ListDataScanJobsPage page) { super(page, ListDataScanJobsFixedSizeCollection.createEmptyCollection()); } } public static class ListDataScanJobsPage extends AbstractPage< ListDataScanJobsRequest, ListDataScanJobsResponse, DataScanJob, ListDataScanJobsPage> { private ListDataScanJobsPage( PageContext context, ListDataScanJobsResponse response) { super(context, response); } private static ListDataScanJobsPage createEmptyPage() { return new ListDataScanJobsPage(null, null); } @Override protected ListDataScanJobsPage createPage( PageContext context, ListDataScanJobsResponse response) { return new ListDataScanJobsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListDataScanJobsFixedSizeCollection extends AbstractFixedSizeCollection< ListDataScanJobsRequest, ListDataScanJobsResponse, DataScanJob, ListDataScanJobsPage, ListDataScanJobsFixedSizeCollection> { private ListDataScanJobsFixedSizeCollection( List pages, int collectionSize) { super(pages, collectionSize); } private static ListDataScanJobsFixedSizeCollection createEmptyCollection() { return new ListDataScanJobsFixedSizeCollection(null, 0); } @Override protected ListDataScanJobsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListDataScanJobsFixedSizeCollection(pages, collectionSize); } } public static class ListLocationsPagedResponse extends AbstractPagedListResponse< ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage, ListLocationsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListLocationsPagedResponse(input), MoreExecutors.directExecutor()); } private ListLocationsPagedResponse(ListLocationsPage page) { super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); } } public static class ListLocationsPage extends AbstractPage< ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { private ListLocationsPage( PageContext context, ListLocationsResponse response) { super(context, response); } private static ListLocationsPage createEmptyPage() { return new ListLocationsPage(null, null); } @Override protected ListLocationsPage createPage( PageContext context, ListLocationsResponse response) { return new ListLocationsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListLocationsFixedSizeCollection extends AbstractFixedSizeCollection< ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage, ListLocationsFixedSizeCollection> { private ListLocationsFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } private static ListLocationsFixedSizeCollection createEmptyCollection() { return new ListLocationsFixedSizeCollection(null, 0); } @Override protected ListLocationsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListLocationsFixedSizeCollection(pages, collectionSize); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy