Skip to content

Commit

Permalink
feat: [dataplex] added new Dataplex APIs and new features for existin…
Browse files Browse the repository at this point in the history
…g APIs (e.g. DataScans) (#9402)

- [ ] Regenerate this pull request now.

docs: updated comments for multiple Dataplex APIs

PiperOrigin-RevId: 528906555

Source-Link: https://github.com/googleapis/googleapis/commit/b7429bc412e8764672e57133726b64b0b8969b83

Source-Link: https://github.com/googleapis/googleapis-gen/commit/5ddd68c27c1342ae88263259b709569a70dfb3cc
Copy-Tag: eyJwIjoiamF2YS1kYXRhcGxleC8uT3dsQm90LnlhbWwiLCJoIjoiNWRkZDY4YzI3YzEzNDJhZTg4MjYzMjU5YjcwOTU2OWE3MGRmYjNjYyJ9
  • Loading branch information
gcf-owl-bot[bot] authored May 9, 2023
1 parent 78e1e17 commit b7c785a
Show file tree
Hide file tree
Showing 79 changed files with 6,959 additions and 1,842 deletions.
4 changes: 2 additions & 2 deletions java-dataplex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.11.0</version>
<version>26.13.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-dataplex.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-dataplex/1.12.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-dataplex/1.14.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ public final OperationFuture<DataScan, OperationMetadata> createDataScanAsync(
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setDataScan(DataScan.newBuilder().build())
* .setDataScanId("dataScanId1260787906")
* .setValidateOnly(true)
* .build();
* DataScan response = dataScanServiceClient.createDataScanAsync(request).get();
* }
Expand Down Expand Up @@ -356,6 +357,7 @@ public final OperationFuture<DataScan, OperationMetadata> createDataScanAsync(
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setDataScan(DataScan.newBuilder().build())
* .setDataScanId("dataScanId1260787906")
* .setValidateOnly(true)
* .build();
* OperationFuture<DataScan, OperationMetadata> future =
* dataScanServiceClient.createDataScanOperationCallable().futureCall(request);
Expand Down Expand Up @@ -387,6 +389,7 @@ public final OperationFuture<DataScan, OperationMetadata> createDataScanAsync(
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setDataScan(DataScan.newBuilder().build())
* .setDataScanId("dataScanId1260787906")
* .setValidateOnly(true)
* .build();
* ApiFuture<Operation> future =
* dataScanServiceClient.createDataScanCallable().futureCall(request);
Expand Down Expand Up @@ -447,6 +450,7 @@ public final OperationFuture<DataScan, OperationMetadata> updateDataScanAsync(
* UpdateDataScanRequest.newBuilder()
* .setDataScan(DataScan.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .setValidateOnly(true)
* .build();
* DataScan response = dataScanServiceClient.updateDataScanAsync(request).get();
* }
Expand Down Expand Up @@ -477,6 +481,7 @@ public final OperationFuture<DataScan, OperationMetadata> updateDataScanAsync(
* UpdateDataScanRequest.newBuilder()
* .setDataScan(DataScan.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .setValidateOnly(true)
* .build();
* OperationFuture<DataScan, OperationMetadata> future =
* dataScanServiceClient.updateDataScanOperationCallable().futureCall(request);
Expand Down Expand Up @@ -507,6 +512,7 @@ public final OperationFuture<DataScan, OperationMetadata> updateDataScanAsync(
* UpdateDataScanRequest.newBuilder()
* .setDataScan(DataScan.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .setValidateOnly(true)
* .build();
* ApiFuture<Operation> future =
* dataScanServiceClient.updateDataScanCallable().futureCall(request);
Expand Down Expand Up @@ -1087,7 +1093,7 @@ public final UnaryCallable<RunDataScanRequest, RunDataScanResponse> runDataScanC
* }</pre>
*
* @param name Required. The resource name of the DataScanJob:
* `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}/dataScanJobs/{data_scan_job_id}`
* `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}/jobs/{data_scan_job_id}`
* where `project` refers to a &#42;project_id&#42; or &#42;project_number&#42; and
* `location_id` refers to a GCP region.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
Expand Down Expand Up @@ -1117,7 +1123,7 @@ public final DataScanJob getDataScanJob(DataScanJobName name) {
* }</pre>
*
* @param name Required. The resource name of the DataScanJob:
* `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}/dataScanJobs/{data_scan_job_id}`
* `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}/jobs/{data_scan_job_id}`
* where `project` refers to a &#42;project_id&#42; or &#42;project_number&#42; and
* `location_id` refers to a GCP region.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3761,6 +3761,117 @@ public final UnaryCallable<ListJobsRequest, ListJobsResponse> listJobsCallable()
return stub.listJobsCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Run an on demand execution of a Task.
*
* <p>Sample code:
*
* <pre>{@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 (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) {
* TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]");
* RunTaskResponse response = dataplexServiceClient.runTask(name);
* }
* }</pre>
*
* @param name Required. The resource name of the task:
* `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final RunTaskResponse runTask(TaskName name) {
RunTaskRequest request =
RunTaskRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return runTask(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Run an on demand execution of a Task.
*
* <p>Sample code:
*
* <pre>{@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 (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) {
* String name = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString();
* RunTaskResponse response = dataplexServiceClient.runTask(name);
* }
* }</pre>
*
* @param name Required. The resource name of the task:
* `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final RunTaskResponse runTask(String name) {
RunTaskRequest request = RunTaskRequest.newBuilder().setName(name).build();
return runTask(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Run an on demand execution of a Task.
*
* <p>Sample code:
*
* <pre>{@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 (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) {
* RunTaskRequest request =
* RunTaskRequest.newBuilder()
* .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString())
* .build();
* RunTaskResponse response = dataplexServiceClient.runTask(request);
* }
* }</pre>
*
* @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 RunTaskResponse runTask(RunTaskRequest request) {
return runTaskCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Run an on demand execution of a Task.
*
* <p>Sample code:
*
* <pre>{@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 (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) {
* RunTaskRequest request =
* RunTaskRequest.newBuilder()
* .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString())
* .build();
* ApiFuture<RunTaskResponse> future =
* dataplexServiceClient.runTaskCallable().futureCall(request);
* // Do something.
* RunTaskResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<RunTaskRequest, RunTaskResponse> runTaskCallable() {
return stub.runTaskCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Get job resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ public UnaryCallSettings<GetTaskRequest, Task> getTaskSettings() {
return ((DataplexServiceStubSettings) getStubSettings()).listJobsSettings();
}

/** Returns the object with the settings used for calls to runTask. */
public UnaryCallSettings<RunTaskRequest, RunTaskResponse> runTaskSettings() {
return ((DataplexServiceStubSettings) getStubSettings()).runTaskSettings();
}

/** Returns the object with the settings used for calls to getJob. */
public UnaryCallSettings<GetJobRequest, Job> getJobSettings() {
return ((DataplexServiceStubSettings) getStubSettings()).getJobSettings();
Expand Down Expand Up @@ -685,6 +690,11 @@ public UnaryCallSettings.Builder<GetTaskRequest, Task> getTaskSettings() {
return getStubSettingsBuilder().listJobsSettings();
}

/** Returns the builder for the settings used for calls to runTask. */
public UnaryCallSettings.Builder<RunTaskRequest, RunTaskResponse> runTaskSettings() {
return getStubSettingsBuilder().runTaskSettings();
}

/** Returns the builder for the settings used for calls to getJob. */
public UnaryCallSettings.Builder<GetJobRequest, Job> getJobSettings() {
return getStubSettingsBuilder().getJobSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@
"ListZones": {
"methods": ["listZones", "listZones", "listZones", "listZonesPagedCallable", "listZonesCallable"]
},
"RunTask": {
"methods": ["runTask", "runTask", "runTask", "runTaskCallable"]
},
"UpdateAsset": {
"methods": ["updateAssetAsync", "updateAssetAsync", "updateAssetOperationCallable", "updateAssetCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
import com.google.cloud.dataplex.v1.ListZonesRequest;
import com.google.cloud.dataplex.v1.ListZonesResponse;
import com.google.cloud.dataplex.v1.OperationMetadata;
import com.google.cloud.dataplex.v1.RunTaskRequest;
import com.google.cloud.dataplex.v1.RunTaskResponse;
import com.google.cloud.dataplex.v1.Task;
import com.google.cloud.dataplex.v1.UpdateAssetRequest;
import com.google.cloud.dataplex.v1.UpdateEnvironmentRequest;
Expand Down Expand Up @@ -295,6 +297,10 @@ public UnaryCallable<ListJobsRequest, ListJobsResponse> listJobsCallable() {
throw new UnsupportedOperationException("Not implemented: listJobsCallable()");
}

public UnaryCallable<RunTaskRequest, RunTaskResponse> runTaskCallable() {
throw new UnsupportedOperationException("Not implemented: runTaskCallable()");
}

public UnaryCallable<GetJobRequest, Job> getJobCallable() {
throw new UnsupportedOperationException("Not implemented: getJobCallable()");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
import com.google.cloud.dataplex.v1.ListZonesRequest;
import com.google.cloud.dataplex.v1.ListZonesResponse;
import com.google.cloud.dataplex.v1.OperationMetadata;
import com.google.cloud.dataplex.v1.RunTaskRequest;
import com.google.cloud.dataplex.v1.RunTaskResponse;
import com.google.cloud.dataplex.v1.Session;
import com.google.cloud.dataplex.v1.Task;
import com.google.cloud.dataplex.v1.UpdateAssetRequest;
Expand Down Expand Up @@ -223,6 +225,7 @@ public class DataplexServiceStubSettings extends StubSettings<DataplexServiceStu
private final UnaryCallSettings<GetTaskRequest, Task> getTaskSettings;
private final PagedCallSettings<ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
listJobsSettings;
private final UnaryCallSettings<RunTaskRequest, RunTaskResponse> runTaskSettings;
private final UnaryCallSettings<GetJobRequest, Job> getJobSettings;
private final UnaryCallSettings<CancelJobRequest, Empty> cancelJobSettings;
private final UnaryCallSettings<CreateEnvironmentRequest, Operation> createEnvironmentSettings;
Expand Down Expand Up @@ -1043,6 +1046,11 @@ public UnaryCallSettings<GetTaskRequest, Task> getTaskSettings() {
return listJobsSettings;
}

/** Returns the object with the settings used for calls to runTask. */
public UnaryCallSettings<RunTaskRequest, RunTaskResponse> runTaskSettings() {
return runTaskSettings;
}

/** Returns the object with the settings used for calls to getJob. */
public UnaryCallSettings<GetJobRequest, Job> getJobSettings() {
return getJobSettings;
Expand Down Expand Up @@ -1257,6 +1265,7 @@ protected DataplexServiceStubSettings(Builder settingsBuilder) throws IOExceptio
listTasksSettings = settingsBuilder.listTasksSettings().build();
getTaskSettings = settingsBuilder.getTaskSettings().build();
listJobsSettings = settingsBuilder.listJobsSettings().build();
runTaskSettings = settingsBuilder.runTaskSettings().build();
getJobSettings = settingsBuilder.getJobSettings().build();
cancelJobSettings = settingsBuilder.cancelJobSettings().build();
createEnvironmentSettings = settingsBuilder.createEnvironmentSettings().build();
Expand Down Expand Up @@ -1342,6 +1351,7 @@ public static class Builder extends StubSettings.Builder<DataplexServiceStubSett
private final PagedCallSettings.Builder<
ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
listJobsSettings;
private final UnaryCallSettings.Builder<RunTaskRequest, RunTaskResponse> runTaskSettings;
private final UnaryCallSettings.Builder<GetJobRequest, Job> getJobSettings;
private final UnaryCallSettings.Builder<CancelJobRequest, Empty> cancelJobSettings;
private final UnaryCallSettings.Builder<CreateEnvironmentRequest, Operation>
Expand Down Expand Up @@ -1471,6 +1481,7 @@ protected Builder(ClientContext clientContext) {
listTasksSettings = PagedCallSettings.newBuilder(LIST_TASKS_PAGE_STR_FACT);
getTaskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listJobsSettings = PagedCallSettings.newBuilder(LIST_JOBS_PAGE_STR_FACT);
runTaskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
cancelJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createEnvironmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
Expand Down Expand Up @@ -1511,6 +1522,7 @@ protected Builder(ClientContext clientContext) {
listTasksSettings,
getTaskSettings,
listJobsSettings,
runTaskSettings,
getJobSettings,
cancelJobSettings,
createEnvironmentSettings,
Expand Down Expand Up @@ -1563,6 +1575,7 @@ protected Builder(DataplexServiceStubSettings settings) {
listTasksSettings = settings.listTasksSettings.toBuilder();
getTaskSettings = settings.getTaskSettings.toBuilder();
listJobsSettings = settings.listJobsSettings.toBuilder();
runTaskSettings = settings.runTaskSettings.toBuilder();
getJobSettings = settings.getJobSettings.toBuilder();
cancelJobSettings = settings.cancelJobSettings.toBuilder();
createEnvironmentSettings = settings.createEnvironmentSettings.toBuilder();
Expand Down Expand Up @@ -1603,6 +1616,7 @@ protected Builder(DataplexServiceStubSettings settings) {
listTasksSettings,
getTaskSettings,
listJobsSettings,
runTaskSettings,
getJobSettings,
cancelJobSettings,
createEnvironmentSettings,
Expand Down Expand Up @@ -1762,6 +1776,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));

builder
.runTaskSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.getJobSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
Expand Down Expand Up @@ -2399,6 +2418,11 @@ public UnaryCallSettings.Builder<GetTaskRequest, Task> getTaskSettings() {
return listJobsSettings;
}

/** Returns the builder for the settings used for calls to runTask. */
public UnaryCallSettings.Builder<RunTaskRequest, RunTaskResponse> runTaskSettings() {
return runTaskSettings;
}

/** Returns the builder for the settings used for calls to getJob. */
public UnaryCallSettings.Builder<GetJobRequest, Job> getJobSettings() {
return getJobSettings;
Expand Down
Loading

0 comments on commit b7c785a

Please sign in to comment.