diff --git a/google-cloud-dataplex/pom.xml b/google-cloud-dataplex/pom.xml index 428c90c..0b9da1d 100644 --- a/google-cloud-dataplex/pom.xml +++ b/google-cloud-dataplex/pom.xml @@ -41,7 +41,18 @@ com.google.api.grpc proto-google-common-protos - + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + grpc-google-iam-v1 + + + com.google.api.grpc + proto-google-iam-v1 + com.google.api.grpc proto-google-cloud-dataplex-v1 @@ -58,6 +69,10 @@ com.google.api gax-grpc + + com.google.api + gax-httpjson + org.threeten threetenbp @@ -77,12 +92,24 @@ test + + com.google.api + gax + testlib + test + com.google.api gax-grpc testlib test + + com.google.api + gax-httpjson + testlib + test + diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/ContentServiceClient.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/ContentServiceClient.java index 461dcb4..42f3350 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/ContentServiceClient.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/ContentServiceClient.java @@ -24,9 +24,19 @@ import com.google.api.gax.paging.AbstractPagedListResponse; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; import com.google.cloud.dataplex.v1.stub.ContentServiceStub; import com.google.cloud.dataplex.v1.stub.ContentServiceStubSettings; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; @@ -99,6 +109,20 @@ * ContentServiceClient contentServiceClient = ContentServiceClient.create(contentServiceSettings); * } * + *

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 for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ContentServiceSettings contentServiceSettings =
+ *     ContentServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             ContentServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * ContentServiceClient contentServiceClient = ContentServiceClient.create(contentServiceSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") @@ -537,6 +561,257 @@ public final UnaryCallable getContentCallable() { return stub.getContentCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a contentitem resource. A `NOT_FOUND` error is returned if + * the resource does not exist. An empty policy is returned if the resource exists but does not + * have a policy set on it. + * + *

Caller must have Google IAM `dataplex.content.getIamPolicy` permission on the resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   ResourceName resource = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]");
+   *   Policy response = contentServiceClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(ResourceName resource) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a contentitem resource. A `NOT_FOUND` error is returned if + * the resource does not exist. An empty policy is returned if the resource exists but does not + * have a policy set on it. + * + *

Caller must have Google IAM `dataplex.content.getIamPolicy` permission on the resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   String resource =
+   *       AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString();
+   *   Policy response = contentServiceClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a contentitem resource. A `NOT_FOUND` error is returned if + * the resource does not exist. An empty policy is returned if the resource exists but does not + * have a policy set on it. + * + *

Caller must have Google IAM `dataplex.content.getIamPolicy` permission on the resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = contentServiceClient.getIamPolicy(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 Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a contentitem resource. A `NOT_FOUND` error is returned if + * the resource does not exist. An empty policy is returned if the resource exists but does not + * have a policy set on it. + * + *

Caller must have Google IAM `dataplex.content.getIamPolicy` permission on the resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = contentServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified contentitem resource. Replaces any existing + * policy. + * + *

Caller must have Google IAM `dataplex.content.setIamPolicy` permission on the resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = contentServiceClient.setIamPolicy(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 Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified contentitem resource. Replaces any existing + * policy. + * + *

Caller must have Google IAM `dataplex.content.setIamPolicy` permission on the resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = contentServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the caller's permissions on a resource. If the resource does not exist, an empty set of + * permissions is returned (a `NOT_FOUND` error is not returned). + * + *

A caller is not required to have Google IAM permission to make this request. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = contentServiceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the caller's permissions on a resource. If the resource does not exist, an empty set of + * permissions is returned (a `NOT_FOUND` error is not returned). + * + *

A caller is not required to have Google IAM permission to make this request. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       contentServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List content. @@ -689,6 +964,146 @@ public final UnaryCallable listContentC return stub.listContentCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : contentServiceClient.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 for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       contentServiceClient.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 for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = contentServiceClient.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 for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = contentServiceClient.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 for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = contentServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + @Override public final void close() { stub.close(); @@ -791,4 +1206,80 @@ protected ListContentFixedSizeCollection createCollection( return new ListContentFixedSizeCollection(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); + } + } } diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/ContentServiceSettings.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/ContentServiceSettings.java index 0664bc9..0272cbc 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/ContentServiceSettings.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/ContentServiceSettings.java @@ -17,12 +17,14 @@ package com.google.cloud.dataplex.v1; import static com.google.cloud.dataplex.v1.ContentServiceClient.ListContentPagedResponse; +import static com.google.cloud.dataplex.v1.ContentServiceClient.ListLocationsPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -30,6 +32,15 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.dataplex.v1.stub.ContentServiceStubSettings; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; @@ -92,12 +103,39 @@ public UnaryCallSettings getContentSettings() { return ((ContentServiceStubSettings) getStubSettings()).getContentSettings(); } + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ContentServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ContentServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ContentServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + /** Returns the object with the settings used for calls to listContent. */ public PagedCallSettings listContentSettings() { return ((ContentServiceStubSettings) getStubSettings()).listContentSettings(); } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ContentServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ContentServiceStubSettings) getStubSettings()).getLocationSettings(); + } + public static final ContentServiceSettings create(ContentServiceStubSettings stub) throws IOException { return new ContentServiceSettings.Builder(stub.toBuilder()).build(); @@ -123,11 +161,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return ContentServiceStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return ContentServiceStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ContentServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return ContentServiceStubSettings.defaultTransportChannelProvider(); } @@ -137,11 +182,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return ContentServiceStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -179,6 +230,11 @@ private static Builder createDefault() { return new Builder(ContentServiceStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(ContentServiceStubSettings.newHttpJsonBuilder()); + } + public ContentServiceStubSettings.Builder getStubSettingsBuilder() { return ((ContentServiceStubSettings.Builder) getStubSettings()); } @@ -215,6 +271,22 @@ public UnaryCallSettings.Builder getContentSettings( return getStubSettingsBuilder().getContentSettings(); } + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + /** Returns the builder for the settings used for calls to listContent. */ public PagedCallSettings.Builder< ListContentRequest, ListContentResponse, ListContentPagedResponse> @@ -222,6 +294,18 @@ public UnaryCallSettings.Builder getContentSettings( return getStubSettingsBuilder().listContentSettings(); } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + @Override public ContentServiceSettings build() throws IOException { return new ContentServiceSettings(this); diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceClient.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceClient.java index 8d27263..169044f 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceClient.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceClient.java @@ -18,7 +18,9 @@ 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; @@ -28,9 +30,12 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dataplex.v1.stub.DataplexServiceStub; import com.google.cloud.dataplex.v1.stub.DataplexServiceStubSettings; +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.longrunning.OperationsClient; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; @@ -41,7 +46,7 @@ // AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Dataplex service provides data lakes as a service. The primary resources - * offered by this service are Lakes, Zones and Assets which collectively allow a data adminstrator + * offered by this service are Lakes, Zones and Assets which collectively allow a data administrator * to organize, manage, secure and catalog data across their organization located across cloud * projects in a variety of storage systems including Cloud Storage and BigQuery. * @@ -108,13 +113,29 @@ * DataplexServiceClient.create(dataplexServiceSettings); * } * + *

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 for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * DataplexServiceSettings dataplexServiceSettings =
+ *     DataplexServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             DataplexServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * DataplexServiceClient dataplexServiceClient =
+ *     DataplexServiceClient.create(dataplexServiceSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class DataplexServiceClient implements BackgroundResource { private final DataplexServiceSettings settings; private final DataplexServiceStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of DataplexServiceClient with default settings. */ public static final DataplexServiceClient create() throws IOException { @@ -146,13 +167,17 @@ public static final DataplexServiceClient create(DataplexServiceStub stub) { protected DataplexServiceClient(DataplexServiceSettings settings) throws IOException { this.settings = settings; this.stub = ((DataplexServiceStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } protected DataplexServiceClient(DataplexServiceStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final DataplexServiceSettings getSettings() { @@ -167,10 +192,19 @@ public DataplexServiceStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + 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 lake resource. @@ -464,7 +498,7 @@ public final UnaryCallable updateLakeCallable() { * } * * @param name Required. The resource name of the lake: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteLakeAsync(LakeName name) { @@ -490,7 +524,7 @@ public final OperationFuture deleteLakeAsync(LakeName * } * * @param name Required. The resource name of the lake: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteLakeAsync(String name) { @@ -846,7 +880,7 @@ public final UnaryCallable getLakeCallable() { * } * * @param parent Required. The resource name of the parent lake: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListLakeActionsPagedResponse listLakeActions(LakeName parent) { @@ -875,7 +909,7 @@ public final ListLakeActionsPagedResponse listLakeActions(LakeName parent) { * } * * @param parent Required. The resource name of the parent lake: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListLakeActionsPagedResponse listLakeActions(String parent) { @@ -1803,7 +1837,7 @@ public final ListZoneActionsPagedResponse listZoneActions(ListZoneActionsRequest * } * * @param parent Required. The resource name of the parent zone: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}` + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. * @param asset Required. Asset resource. * @param assetId Required. Asset identifier. This ID will be used to generate names such as table * names when publishing metadata to Hive Metastore and BigQuery. @@ -1846,7 +1880,7 @@ public final OperationFuture createAssetAsync( * } * * @param parent Required. The resource name of the parent zone: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}` + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. * @param asset Required. Asset resource. * @param assetId Required. Asset identifier. This ID will be used to generate names such as table * names when publishing metadata to Hive Metastore and BigQuery. @@ -3155,7 +3189,7 @@ public final UnaryCallable listTasksCallabl * } * * @param name Required. The resource name of the task: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}` + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Task getTask(TaskName name) { @@ -3180,7 +3214,7 @@ public final Task getTask(TaskName name) { * } * * @param name Required. The resource name of the task: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}` + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Task getTask(String name) { @@ -3601,7 +3635,7 @@ public final UnaryCallable cancelJobCallable() { * } * * @param parent Required. The resource name of the parent lake: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id} + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. * @param environment Required. Environment resource. * @param environmentId Required. Environment identifier. *

    @@ -3644,7 +3678,7 @@ public final OperationFuture createEnvironmentAs * } * * @param parent Required. The resource name of the parent lake: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id} + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. * @param environment Required. Environment resource. * @param environmentId Required. Environment identifier. *
      @@ -3887,7 +3921,7 @@ public final UnaryCallable updateEnvironmen * } * * @param name Required. The resource name of the environment: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}` + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteEnvironmentAsync( @@ -3917,7 +3951,7 @@ public final OperationFuture deleteEnvironmentAsync( * } * * @param name Required. The resource name of the environment: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}` + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture deleteEnvironmentAsync(String name) { @@ -4029,7 +4063,7 @@ public final UnaryCallable deleteEnvironmen * } * * @param parent Required. The resource name of the parent lake: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id} + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListEnvironmentsPagedResponse listEnvironments(LakeName parent) { @@ -4058,7 +4092,7 @@ public final ListEnvironmentsPagedResponse listEnvironments(LakeName parent) { * } * * @param parent Required. The resource name of the parent lake: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id} + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListEnvironmentsPagedResponse listEnvironments(String parent) { @@ -4186,7 +4220,7 @@ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequ * } * * @param name Required. The resource name of the environment: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id} + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Environment getEnvironment(EnvironmentName name) { @@ -4212,7 +4246,7 @@ public final Environment getEnvironment(EnvironmentName name) { * } * * @param name Required. The resource name of the environment: - * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id} + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Environment getEnvironment(String name) { @@ -4293,7 +4327,7 @@ public final UnaryCallable getEnvironmentCal * } * * @param parent Required. The resource name of the parent environment: - * projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id} + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListSessionsPagedResponse listSessions(EnvironmentName parent) { @@ -4323,7 +4357,7 @@ public final ListSessionsPagedResponse listSessions(EnvironmentName parent) { * } * * @param parent Required. The resource name of the parent environment: - * projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id} + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListSessionsPagedResponse listSessions(String parent) { @@ -4348,6 +4382,7 @@ public final ListSessionsPagedResponse listSessions(String parent) { * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") * .build(); * for (Session element : dataplexServiceClient.listSessions(request).iterateAll()) { * // doThingsWith(element); @@ -4379,6 +4414,7 @@ public final ListSessionsPagedResponse listSessions(ListSessionsRequest request) * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") * .build(); * ApiFuture future = * dataplexServiceClient.listSessionsPagedCallable().futureCall(request); @@ -4411,6 +4447,7 @@ public final ListSessionsPagedResponse listSessions(ListSessionsRequest request) * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") * .build(); * while (true) { * ListSessionsResponse response = dataplexServiceClient.listSessionsCallable().call(request); @@ -4431,6 +4468,147 @@ public final UnaryCallable listSessio return stub.listSessionsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

      Sample code: + * + *

      {@code
      +   * // This snippet has been automatically generated for illustrative purposes only.
      +   * // It may require modifications to work in your environment.
      +   * try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) {
      +   *   ListLocationsRequest request =
      +   *       ListLocationsRequest.newBuilder()
      +   *           .setName("name3373707")
      +   *           .setFilter("filter-1274492040")
      +   *           .setPageSize(883849137)
      +   *           .setPageToken("pageToken873572522")
      +   *           .build();
      +   *   for (Location element : dataplexServiceClient.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 for illustrative purposes only.
      +   * // It may require modifications to work in your environment.
      +   * try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) {
      +   *   ListLocationsRequest request =
      +   *       ListLocationsRequest.newBuilder()
      +   *           .setName("name3373707")
      +   *           .setFilter("filter-1274492040")
      +   *           .setPageSize(883849137)
      +   *           .setPageToken("pageToken873572522")
      +   *           .build();
      +   *   ApiFuture future =
      +   *       dataplexServiceClient.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 for illustrative purposes only.
      +   * // It may require modifications to work in your environment.
      +   * try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) {
      +   *   ListLocationsRequest request =
      +   *       ListLocationsRequest.newBuilder()
      +   *           .setName("name3373707")
      +   *           .setFilter("filter-1274492040")
      +   *           .setPageSize(883849137)
      +   *           .setPageToken("pageToken873572522")
      +   *           .build();
      +   *   while (true) {
      +   *     ListLocationsResponse response =
      +   *         dataplexServiceClient.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 for illustrative purposes only.
      +   * // It may require modifications to work in your environment.
      +   * try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) {
      +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
      +   *   Location response = dataplexServiceClient.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 for illustrative purposes only.
      +   * // It may require modifications to work in your environment.
      +   * try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) {
      +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
      +   *   ApiFuture future = dataplexServiceClient.getLocationCallable().futureCall(request);
      +   *   // Do something.
      +   *   Location response = future.get();
      +   * }
      +   * }
      + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + @Override public final void close() { stub.close(); @@ -5174,4 +5352,80 @@ protected ListSessionsFixedSizeCollection createCollection( return new ListSessionsFixedSizeCollection(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); + } + } } diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceSettings.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceSettings.java index 30ef821..fce8ede 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceSettings.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceSettings.java @@ -22,6 +22,7 @@ import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListJobsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakeActionsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakesPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLocationsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListSessionsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListTasksPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListZoneActionsPagedResponse; @@ -32,6 +33,7 @@ import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -40,6 +42,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.dataplex.v1.stub.DataplexServiceStubSettings; +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.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -347,6 +353,17 @@ public UnaryCallSettings getEnvironmentSetti return ((DataplexServiceStubSettings) getStubSettings()).listSessionsSettings(); } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((DataplexServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((DataplexServiceStubSettings) getStubSettings()).getLocationSettings(); + } + public static final DataplexServiceSettings create(DataplexServiceStubSettings stub) throws IOException { return new DataplexServiceSettings.Builder(stub.toBuilder()).build(); @@ -372,11 +389,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return DataplexServiceStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return DataplexServiceStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return DataplexServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return DataplexServiceStubSettings.defaultTransportChannelProvider(); } @@ -386,11 +410,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return DataplexServiceStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -428,6 +458,11 @@ private static Builder createDefault() { return new Builder(DataplexServiceStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(DataplexServiceStubSettings.newHttpJsonBuilder()); + } + public DataplexServiceStubSettings.Builder getStubSettingsBuilder() { return ((DataplexServiceStubSettings.Builder) getStubSettings()); } @@ -712,6 +747,18 @@ public UnaryCallSettings.Builder getEnvironm return getStubSettingsBuilder().listSessionsSettings(); } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + @Override public DataplexServiceSettings build() throws IOException { return new DataplexServiceSettings(this); diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/MetadataServiceClient.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/MetadataServiceClient.java index 4164f06..ef68faa 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/MetadataServiceClient.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/MetadataServiceClient.java @@ -26,6 +26,10 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dataplex.v1.stub.MetadataServiceStub; import com.google.cloud.dataplex.v1.stub.MetadataServiceStubSettings; +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.protobuf.Empty; import java.io.IOException; @@ -102,6 +106,21 @@ * MetadataServiceClient.create(metadataServiceSettings); * } * + *

      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 for illustrative purposes only.
      + * // It may require modifications to work in your environment.
      + * MetadataServiceSettings metadataServiceSettings =
      + *     MetadataServiceSettings.newBuilder()
      + *         .setTransportChannelProvider(
      + *             MetadataServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
      + *         .build();
      + * MetadataServiceClient metadataServiceClient =
      + *     MetadataServiceClient.create(metadataServiceSettings);
      + * }
      + * *

      Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") @@ -1179,6 +1198,147 @@ public final ListPartitionsPagedResponse listPartitions(ListPartitionsRequest re return stub.listPartitionsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

      Sample code: + * + *

      {@code
      +   * // This snippet has been automatically generated for illustrative purposes only.
      +   * // It may require modifications to work in your environment.
      +   * try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
      +   *   ListLocationsRequest request =
      +   *       ListLocationsRequest.newBuilder()
      +   *           .setName("name3373707")
      +   *           .setFilter("filter-1274492040")
      +   *           .setPageSize(883849137)
      +   *           .setPageToken("pageToken873572522")
      +   *           .build();
      +   *   for (Location element : metadataServiceClient.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 for illustrative purposes only.
      +   * // It may require modifications to work in your environment.
      +   * try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
      +   *   ListLocationsRequest request =
      +   *       ListLocationsRequest.newBuilder()
      +   *           .setName("name3373707")
      +   *           .setFilter("filter-1274492040")
      +   *           .setPageSize(883849137)
      +   *           .setPageToken("pageToken873572522")
      +   *           .build();
      +   *   ApiFuture future =
      +   *       metadataServiceClient.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 for illustrative purposes only.
      +   * // It may require modifications to work in your environment.
      +   * try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
      +   *   ListLocationsRequest request =
      +   *       ListLocationsRequest.newBuilder()
      +   *           .setName("name3373707")
      +   *           .setFilter("filter-1274492040")
      +   *           .setPageSize(883849137)
      +   *           .setPageToken("pageToken873572522")
      +   *           .build();
      +   *   while (true) {
      +   *     ListLocationsResponse response =
      +   *         metadataServiceClient.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 for illustrative purposes only.
      +   * // It may require modifications to work in your environment.
      +   * try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
      +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
      +   *   Location response = metadataServiceClient.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 for illustrative purposes only.
      +   * // It may require modifications to work in your environment.
      +   * try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) {
      +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
      +   *   ApiFuture future = metadataServiceClient.getLocationCallable().futureCall(request);
      +   *   // Do something.
      +   *   Location response = future.get();
      +   * }
      +   * }
      + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + @Override public final void close() { stub.close(); @@ -1359,4 +1519,80 @@ protected ListPartitionsFixedSizeCollection createCollection( return new ListPartitionsFixedSizeCollection(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); + } + } } diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/MetadataServiceSettings.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/MetadataServiceSettings.java index fd99b36..2c12a81 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/MetadataServiceSettings.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/MetadataServiceSettings.java @@ -17,6 +17,7 @@ package com.google.cloud.dataplex.v1; import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListEntitiesPagedResponse; +import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListLocationsPagedResponse; import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListPartitionsPagedResponse; import com.google.api.core.ApiFunction; @@ -24,6 +25,7 @@ import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -31,6 +33,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.dataplex.v1.stub.MetadataServiceStubSettings; +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.protobuf.Empty; import java.io.IOException; import java.util.List; @@ -121,6 +127,17 @@ public UnaryCallSettings getPartitionSettings() return ((MetadataServiceStubSettings) getStubSettings()).listPartitionsSettings(); } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((MetadataServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((MetadataServiceStubSettings) getStubSettings()).getLocationSettings(); + } + public static final MetadataServiceSettings create(MetadataServiceStubSettings stub) throws IOException { return new MetadataServiceSettings.Builder(stub.toBuilder()).build(); @@ -146,11 +163,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return MetadataServiceStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return MetadataServiceStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return MetadataServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return MetadataServiceStubSettings.defaultTransportChannelProvider(); } @@ -160,11 +184,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return MetadataServiceStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -202,6 +232,11 @@ private static Builder createDefault() { return new Builder(MetadataServiceStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(MetadataServiceStubSettings.newHttpJsonBuilder()); + } + public MetadataServiceStubSettings.Builder getStubSettingsBuilder() { return ((MetadataServiceStubSettings.Builder) getStubSettings()); } @@ -267,6 +302,18 @@ public UnaryCallSettings.Builder getPartitionSet return getStubSettingsBuilder().listPartitionsSettings(); } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + @Override public MetadataServiceSettings build() throws IOException { return new MetadataServiceSettings(this); diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/gapic_metadata.json b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/gapic_metadata.json index 87f63b6..828829d 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/gapic_metadata.json +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/gapic_metadata.json @@ -19,9 +19,24 @@ "GetContent": { "methods": ["getContent", "getContent", "getContent", "getContentCallable"] }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "ListContent": { "methods": ["listContent", "listContent", "listContent", "listContentPagedCallable", "listContentCallable"] }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, "UpdateContent": { "methods": ["updateContent", "updateContent", "updateContentCallable"] } @@ -49,12 +64,18 @@ "GetEntity": { "methods": ["getEntity", "getEntity", "getEntity", "getEntityCallable"] }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "GetPartition": { "methods": ["getPartition", "getPartition", "getPartition", "getPartitionCallable"] }, "ListEntities": { "methods": ["listEntities", "listEntities", "listEntities", "listEntitiesPagedCallable", "listEntitiesCallable"] }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, "ListPartitions": { "methods": ["listPartitions", "listPartitions", "listPartitions", "listPartitionsPagedCallable", "listPartitionsCallable"] }, @@ -115,6 +136,9 @@ "GetLake": { "methods": ["getLake", "getLake", "getLake", "getLakeCallable"] }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "GetTask": { "methods": ["getTask", "getTask", "getTask", "getTaskCallable"] }, @@ -139,6 +163,9 @@ "ListLakes": { "methods": ["listLakes", "listLakes", "listLakes", "listLakesPagedCallable", "listLakesCallable"] }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, "ListSessions": { "methods": ["listSessions", "listSessions", "listSessions", "listSessionsPagedCallable", "listSessionsCallable"] }, diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/package-info.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/package-info.java index 0b97101..8f99587 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/package-info.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/package-info.java @@ -55,7 +55,7 @@ *

      ======================= DataplexServiceClient ======================= * *

      Service Description: Dataplex service provides data lakes as a service. The primary resources - * offered by this service are Lakes, Zones and Assets which collectively allow a data adminstrator + * offered by this service are Lakes, Zones and Assets which collectively allow a data administrator * to organize, manage, secure and catalog data across their organization located across cloud * projects in a variety of storage systems including Cloud Storage and BigQuery. * diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/ContentServiceStub.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/ContentServiceStub.java index 0889b8a..dbb318a 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/ContentServiceStub.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/ContentServiceStub.java @@ -17,6 +17,7 @@ package com.google.cloud.dataplex.v1.stub; import static com.google.cloud.dataplex.v1.ContentServiceClient.ListContentPagedResponse; +import static com.google.cloud.dataplex.v1.ContentServiceClient.ListLocationsPagedResponse; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; @@ -27,6 +28,15 @@ import com.google.cloud.dataplex.v1.ListContentRequest; import com.google.cloud.dataplex.v1.ListContentResponse; import com.google.cloud.dataplex.v1.UpdateContentRequest; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; import javax.annotation.Generated; @@ -55,6 +65,19 @@ public UnaryCallable getContentCallable() { throw new UnsupportedOperationException("Not implemented: getContentCallable()"); } + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + public UnaryCallable listContentPagedCallable() { throw new UnsupportedOperationException("Not implemented: listContentPagedCallable()"); } @@ -63,6 +86,19 @@ public UnaryCallable listContentCallabl throw new UnsupportedOperationException("Not implemented: listContentCallable()"); } + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/ContentServiceStubSettings.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/ContentServiceStubSettings.java index 50b7ede..0771ee3 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/ContentServiceStubSettings.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/ContentServiceStubSettings.java @@ -17,6 +17,7 @@ package com.google.cloud.dataplex.v1.stub; import static com.google.cloud.dataplex.v1.ContentServiceClient.ListContentPagedResponse; +import static com.google.cloud.dataplex.v1.ContentServiceClient.ListLocationsPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; @@ -27,6 +28,9 @@ import com.google.api.gax.grpc.GaxGrpcProperties; import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; @@ -47,14 +51,24 @@ import com.google.cloud.dataplex.v1.ListContentRequest; import com.google.cloud.dataplex.v1.ListContentResponse; import com.google.cloud.dataplex.v1.UpdateContentRequest; +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.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; import javax.annotation.Generated; +import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -100,8 +114,16 @@ public class ContentServiceStubSettings extends StubSettings updateContentSettings; private final UnaryCallSettings deleteContentSettings; private final UnaryCallSettings getContentSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; private final PagedCallSettings listContentSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; private static final PagedListDescriptor LIST_CONTENT_PAGE_STR_DESC = @@ -139,6 +161,42 @@ public Iterable extractResources(ListContentResponse payload) { } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListContentRequest, ListContentResponse, ListContentPagedResponse> LIST_CONTENT_PAGE_STR_FACT = @@ -156,6 +214,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to createContent. */ public UnaryCallSettings createContentSettings() { return createContentSettings; @@ -176,18 +251,50 @@ public UnaryCallSettings getContentSettings() { return getContentSettings; } + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + /** Returns the object with the settings used for calls to listContent. */ public PagedCallSettings listContentSettings() { return listContentSettings; } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + public ContentServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcContentServiceStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonContentServiceStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -220,18 +327,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(ContentServiceStubSettings.class)) @@ -239,11 +353,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ContentServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ContentServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -261,7 +394,12 @@ protected ContentServiceStubSettings(Builder settingsBuilder) throws IOException updateContentSettings = settingsBuilder.updateContentSettings().build(); deleteContentSettings = settingsBuilder.deleteContentSettings().build(); getContentSettings = settingsBuilder.getContentSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); listContentSettings = settingsBuilder.listContentSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); } /** Builder for ContentServiceStubSettings. */ @@ -271,15 +409,31 @@ public static class Builder extends StubSettings.Builder updateContentSettings; private final UnaryCallSettings.Builder deleteContentSettings; private final UnaryCallSettings.Builder getContentSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; private final PagedCallSettings.Builder< ListContentRequest, ListContentResponse, ListContentPagedResponse> listContentSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; static { ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "no_retry_8_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_4_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_5_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -289,6 +443,36 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder(); RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_8_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_4_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_5_params", settings); settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); definitions.put("no_retry_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); @@ -305,7 +489,12 @@ protected Builder(ClientContext clientContext) { updateContentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteContentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getContentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listContentSettings = PagedCallSettings.newBuilder(LIST_CONTENT_PAGE_STR_FACT); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -313,7 +502,12 @@ protected Builder(ClientContext clientContext) { updateContentSettings, deleteContentSettings, getContentSettings, - listContentSettings); + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings, + listContentSettings, + listLocationsSettings, + getLocationSettings); initDefaults(this); } @@ -324,7 +518,12 @@ protected Builder(ContentServiceStubSettings settings) { updateContentSettings = settings.updateContentSettings.toBuilder(); deleteContentSettings = settings.deleteContentSettings.toBuilder(); getContentSettings = settings.getContentSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); listContentSettings = settings.listContentSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -332,7 +531,12 @@ protected Builder(ContentServiceStubSettings settings) { updateContentSettings, deleteContentSettings, getContentSettings, - listContentSettings); + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings, + listContentSettings, + listLocationsSettings, + getLocationSettings); } private static Builder createDefault() { @@ -348,29 +552,67 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .createContentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_8_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_8_params")); builder .updateContentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_8_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_8_params")); builder .deleteContentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_8_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_8_params")); builder .getContentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_8_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_8_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")); + + builder + .listContentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); + + builder + .listLocationsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder - .listContentSettings() + .getLocationSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); @@ -412,6 +654,22 @@ public UnaryCallSettings.Builder getContentSettings( return getContentSettings; } + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + /** Returns the builder for the settings used for calls to listContent. */ public PagedCallSettings.Builder< ListContentRequest, ListContentResponse, ListContentPagedResponse> @@ -419,6 +677,18 @@ public UnaryCallSettings.Builder getContentSettings( return listContentSettings; } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + @Override public ContentServiceStubSettings build() throws IOException { return new ContentServiceStubSettings(this); diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/DataplexServiceStub.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/DataplexServiceStub.java index 1a3a49f..be8f550 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/DataplexServiceStub.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/DataplexServiceStub.java @@ -22,6 +22,7 @@ import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListJobsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakeActionsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakesPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLocationsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListSessionsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListTasksPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListZoneActionsPagedResponse; @@ -77,6 +78,10 @@ import com.google.cloud.dataplex.v1.UpdateTaskRequest; import com.google.cloud.dataplex.v1.UpdateZoneRequest; import com.google.cloud.dataplex.v1.Zone; +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.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; @@ -92,7 +97,11 @@ public abstract class DataplexServiceStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public OperationCallable @@ -346,6 +355,19 @@ public UnaryCallable listSessionsCall throw new UnsupportedOperationException("Not implemented: listSessionsCallable()"); } + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/DataplexServiceStubSettings.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/DataplexServiceStubSettings.java index 96f8204..3a12835 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/DataplexServiceStubSettings.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/DataplexServiceStubSettings.java @@ -22,6 +22,7 @@ import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListJobsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakeActionsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakesPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLocationsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListSessionsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListTasksPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListZoneActionsPagedResponse; @@ -37,6 +38,9 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -102,6 +106,10 @@ import com.google.cloud.dataplex.v1.UpdateTaskRequest; import com.google.cloud.dataplex.v1.UpdateZoneRequest; import com.google.cloud.dataplex.v1.Zone; +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.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -230,6 +238,10 @@ public class DataplexServiceStubSettings extends StubSettings listSessionsSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; private static final PagedListDescriptor LIST_LAKES_PAGE_STR_DESC = @@ -601,6 +613,42 @@ public Iterable extractResources(ListSessionsResponse payload) { } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListLakesRequest, ListLakesResponse, ListLakesPagedResponse> LIST_LAKES_PAGE_STR_FACT = @@ -772,6 +820,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to createLake. */ public UnaryCallSettings createLakeSettings() { return createLakeSettings; @@ -1036,12 +1101,28 @@ public UnaryCallSettings getEnvironmentSetti return listSessionsSettings; } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + public DataplexServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcDataplexServiceStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonDataplexServiceStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -1074,18 +1155,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(DataplexServiceStubSettings.class)) @@ -1093,11 +1181,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DataplexServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DataplexServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -1161,6 +1268,8 @@ protected DataplexServiceStubSettings(Builder settingsBuilder) throws IOExceptio listEnvironmentsSettings = settingsBuilder.listEnvironmentsSettings().build(); getEnvironmentSettings = settingsBuilder.getEnvironmentSettings().build(); listSessionsSettings = settingsBuilder.listSessionsSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); } /** Builder for DataplexServiceStubSettings. */ @@ -1254,6 +1363,10 @@ public static class Builder extends StubSettings.Builder listSessionsSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -1261,7 +1374,7 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "no_retry_4_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_6_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "retry_policy_1_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); @@ -1284,7 +1397,7 @@ public static class Builder extends StubSettings.Builder>of( @@ -1400,7 +1515,9 @@ protected Builder(ClientContext clientContext) { deleteEnvironmentSettings, listEnvironmentsSettings, getEnvironmentSettings, - listSessionsSettings); + listSessionsSettings, + listLocationsSettings, + getLocationSettings); initDefaults(this); } @@ -1454,6 +1571,8 @@ protected Builder(DataplexServiceStubSettings settings) { listEnvironmentsSettings = settings.listEnvironmentsSettings.toBuilder(); getEnvironmentSettings = settings.getEnvironmentSettings.toBuilder(); listSessionsSettings = settings.listSessionsSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -1488,7 +1607,9 @@ protected Builder(DataplexServiceStubSettings settings) { deleteEnvironmentSettings, listEnvironmentsSettings, getEnvironmentSettings, - listSessionsSettings); + listSessionsSettings, + listLocationsSettings, + getLocationSettings); } private static Builder createDefault() { @@ -1504,21 +1625,34 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .createLakeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .updateLakeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .deleteLakeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .listLakesSettings() @@ -1537,18 +1671,18 @@ private static Builder initDefaults(Builder builder) { builder .createZoneSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .updateZoneSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .deleteZoneSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .listZonesSettings() @@ -1567,18 +1701,18 @@ private static Builder initDefaults(Builder builder) { builder .createAssetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .updateAssetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .deleteAssetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .listAssetsSettings() @@ -1597,18 +1731,18 @@ private static Builder initDefaults(Builder builder) { builder .createTaskSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .updateTaskSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .deleteTaskSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .listTasksSettings() @@ -1632,36 +1766,46 @@ private static Builder initDefaults(Builder builder) { builder .cancelJobSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .createEnvironmentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .updateEnvironmentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .deleteEnvironmentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .listEnvironmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getEnvironmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listSessionsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder - .getEnvironmentSettings() + .listLocationsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder - .listSessionsSettings() + .getLocationSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); @@ -1669,8 +1813,8 @@ private static Builder initDefaults(Builder builder) { .createLakeOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Lake.class)) .setMetadataTransformer( @@ -1691,8 +1835,8 @@ private static Builder initDefaults(Builder builder) { .updateLakeOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Lake.class)) .setMetadataTransformer( @@ -1713,8 +1857,8 @@ private static Builder initDefaults(Builder builder) { .deleteLakeOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1736,8 +1880,8 @@ private static Builder initDefaults(Builder builder) { .createZoneOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Zone.class)) .setMetadataTransformer( @@ -1758,8 +1902,8 @@ private static Builder initDefaults(Builder builder) { .updateZoneOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Zone.class)) .setMetadataTransformer( @@ -1780,8 +1924,8 @@ private static Builder initDefaults(Builder builder) { .deleteZoneOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1803,8 +1947,8 @@ private static Builder initDefaults(Builder builder) { .createAssetOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Asset.class)) @@ -1826,8 +1970,8 @@ private static Builder initDefaults(Builder builder) { .updateAssetOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Asset.class)) @@ -1849,8 +1993,8 @@ private static Builder initDefaults(Builder builder) { .deleteAssetOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1872,8 +2016,8 @@ private static Builder initDefaults(Builder builder) { .createTaskOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Task.class)) .setMetadataTransformer( @@ -1894,8 +2038,8 @@ private static Builder initDefaults(Builder builder) { .updateTaskOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Task.class)) .setMetadataTransformer( @@ -1916,8 +2060,8 @@ private static Builder initDefaults(Builder builder) { .deleteTaskOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1940,8 +2084,8 @@ private static Builder initDefaults(Builder builder) { .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Environment.class)) @@ -1964,8 +2108,8 @@ private static Builder initDefaults(Builder builder) { .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Environment.class)) @@ -1988,8 +2132,8 @@ private static Builder initDefaults(Builder builder) { .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -2323,6 +2467,18 @@ public UnaryCallSettings.Builder getEnvironm return listSessionsSettings; } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + @Override public DataplexServiceStubSettings build() throws IOException { return new DataplexServiceStubSettings(this); diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcContentServiceStub.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcContentServiceStub.java index 520755c..0b7fd2e 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcContentServiceStub.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcContentServiceStub.java @@ -17,6 +17,7 @@ package com.google.cloud.dataplex.v1.stub; import static com.google.cloud.dataplex.v1.ContentServiceClient.ListContentPagedResponse; +import static com.google.cloud.dataplex.v1.ContentServiceClient.ListLocationsPagedResponse; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; @@ -31,7 +32,16 @@ import com.google.cloud.dataplex.v1.ListContentRequest; import com.google.cloud.dataplex.v1.ListContentResponse; import com.google.cloud.dataplex.v1.UpdateContentRequest; +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.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; @@ -84,6 +94,33 @@ public class GrpcContentServiceStub extends ContentServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Content.getDefaultInstance())) .build(); + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dataplex.v1.ContentService/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dataplex.v1.ContentService/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dataplex.v1.ContentService/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor listContentMethodDescriptor = MethodDescriptor.newBuilder() @@ -94,13 +131,40 @@ public class GrpcContentServiceStub extends ContentServiceStub { ProtoUtils.marshaller(ListContentResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + private final UnaryCallable createContentCallable; private final UnaryCallable updateContentCallable; private final UnaryCallable deleteContentCallable; private final UnaryCallable getContentCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; private final UnaryCallable listContentCallable; private final UnaryCallable listContentPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -186,6 +250,37 @@ protected GrpcContentServiceStub( return params.build(); }) .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); GrpcCallSettings listContentTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listContentMethodDescriptor) @@ -196,6 +291,26 @@ protected GrpcContentServiceStub( return params.build(); }) .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); this.createContentCallable = callableFactory.createUnaryCallable( @@ -209,12 +324,32 @@ protected GrpcContentServiceStub( this.getContentCallable = callableFactory.createUnaryCallable( getContentTransportSettings, settings.getContentSettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); this.listContentCallable = callableFactory.createUnaryCallable( listContentTransportSettings, settings.listContentSettings(), clientContext); this.listContentPagedCallable = callableFactory.createPagedCallable( listContentTransportSettings, settings.listContentSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -244,6 +379,22 @@ public UnaryCallable getContentCallable() { return getContentCallable; } + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + @Override public UnaryCallable listContentCallable() { return listContentCallable; @@ -254,6 +405,22 @@ public UnaryCallable listContentPa return listContentPagedCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcDataplexServiceStub.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcDataplexServiceStub.java index 6cec306..8c0c4e6 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcDataplexServiceStub.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcDataplexServiceStub.java @@ -22,6 +22,7 @@ import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListJobsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakeActionsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakesPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLocationsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListSessionsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListTasksPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListZoneActionsPagedResponse; @@ -81,6 +82,10 @@ import com.google.cloud.dataplex.v1.UpdateTaskRequest; import com.google.cloud.dataplex.v1.UpdateZoneRequest; import com.google.cloud.dataplex.v1.Zone; +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.collect.ImmutableMap; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; @@ -382,6 +387,25 @@ public class GrpcDataplexServiceStub extends DataplexServiceStub { ProtoUtils.marshaller(ListSessionsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + private final UnaryCallable createLakeCallable; private final OperationCallable createLakeOperationCallable; @@ -461,6 +485,10 @@ public class GrpcDataplexServiceStub extends DataplexServiceStub { private final UnaryCallable listSessionsCallable; private final UnaryCallable listSessionsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -829,6 +857,26 @@ protected GrpcDataplexServiceStub( return params.build(); }) .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); this.createLakeCallable = callableFactory.createUnaryCallable( @@ -1052,6 +1100,15 @@ protected GrpcDataplexServiceStub( this.listSessionsPagedCallable = callableFactory.createPagedCallable( listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -1366,6 +1423,22 @@ public UnaryCallable listSession return listSessionsPagedCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcMetadataServiceStub.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcMetadataServiceStub.java index 3f0dc47..b98f482 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcMetadataServiceStub.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/GrpcMetadataServiceStub.java @@ -17,6 +17,7 @@ package com.google.cloud.dataplex.v1.stub; import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListEntitiesPagedResponse; +import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListLocationsPagedResponse; import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListPartitionsPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -38,6 +39,10 @@ import com.google.cloud.dataplex.v1.ListPartitionsResponse; import com.google.cloud.dataplex.v1.Partition; import com.google.cloud.dataplex.v1.UpdateEntityRequest; +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.collect.ImmutableMap; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; @@ -137,6 +142,25 @@ public class GrpcMetadataServiceStub extends MetadataServiceStub { ProtoUtils.marshaller(ListPartitionsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + private final UnaryCallable createEntityCallable; private final UnaryCallable updateEntityCallable; private final UnaryCallable deleteEntityCallable; @@ -150,6 +174,10 @@ public class GrpcMetadataServiceStub extends MetadataServiceStub { private final UnaryCallable listPartitionsCallable; private final UnaryCallable listPartitionsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -286,6 +314,26 @@ protected GrpcMetadataServiceStub( return params.build(); }) .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); this.createEntityCallable = callableFactory.createUnaryCallable( @@ -320,6 +368,15 @@ protected GrpcMetadataServiceStub( this.listPartitionsPagedCallable = callableFactory.createPagedCallable( listPartitionsTransportSettings, settings.listPartitionsSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -385,6 +442,22 @@ public UnaryCallable listPartitio return listPartitionsPagedCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonContentServiceCallableFactory.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonContentServiceCallableFactory.java new file mode 100644 index 0000000..1557d73 --- /dev/null +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonContentServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the ContentService service API. + * + *

      This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonContentServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonContentServiceStub.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonContentServiceStub.java new file mode 100644 index 0000000..58e3e3f --- /dev/null +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonContentServiceStub.java @@ -0,0 +1,700 @@ +/* + * Copyright 2022 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.stub; + +import static com.google.cloud.dataplex.v1.ContentServiceClient.ListContentPagedResponse; +import static com.google.cloud.dataplex.v1.ContentServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.CreateContentRequest; +import com.google.cloud.dataplex.v1.DeleteContentRequest; +import com.google.cloud.dataplex.v1.GetContentRequest; +import com.google.cloud.dataplex.v1.ListContentRequest; +import com.google.cloud.dataplex.v1.ListContentResponse; +import com.google.cloud.dataplex.v1.UpdateContentRequest; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the ContentService service API. + * + *

      This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonContentServiceStub extends ContentServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createContentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.ContentService/CreateContent") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1/{parent=projects/*/locations/*/lakes/*}/content") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("content", request.getContent())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Content.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateContentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.ContentService/UpdateContent") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{content.name=projects/*/locations/*/lakes/*/contentitems/**}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "content.name", request.getContent().getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{content.name=projects/*/locations/*/lakes/*/content/**}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("content", request.getContent())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Content.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteContentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.ContentService/DeleteContent") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1/{name=projects/*/locations/*/lakes/*/content/**}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getContentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.ContentService/GetContent") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1/{name=projects/*/locations/*/lakes/*/content/**}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "view", request.getView()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Content.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.ContentService/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "options", request.getOptions()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.ContentService/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.ContentService/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listContentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.ContentService/ListContent") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1/{parent=projects/*/locations/*/lakes/*}/content") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListContentResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createContentCallable; + private final UnaryCallable updateContentCallable; + private final UnaryCallable deleteContentCallable; + private final UnaryCallable getContentCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + private final UnaryCallable listContentCallable; + private final UnaryCallable + listContentPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonContentServiceStub create(ContentServiceStubSettings settings) + throws IOException { + return new HttpJsonContentServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonContentServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonContentServiceStub( + ContentServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonContentServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonContentServiceStub( + ContentServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonContentServiceStub, 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 HttpJsonContentServiceStub( + ContentServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonContentServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonContentServiceStub, 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 HttpJsonContentServiceStub( + ContentServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createContentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createContentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateContentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateContentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteContentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteContentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getContentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getContentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listContentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listContentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createContentCallable = + callableFactory.createUnaryCallable( + createContentTransportSettings, settings.createContentSettings(), clientContext); + this.updateContentCallable = + callableFactory.createUnaryCallable( + updateContentTransportSettings, settings.updateContentSettings(), clientContext); + this.deleteContentCallable = + callableFactory.createUnaryCallable( + deleteContentTransportSettings, settings.deleteContentSettings(), clientContext); + this.getContentCallable = + callableFactory.createUnaryCallable( + getContentTransportSettings, settings.getContentSettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + this.listContentCallable = + callableFactory.createUnaryCallable( + listContentTransportSettings, settings.listContentSettings(), clientContext); + this.listContentPagedCallable = + callableFactory.createPagedCallable( + listContentTransportSettings, settings.listContentSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createContentMethodDescriptor); + methodDescriptors.add(updateContentMethodDescriptor); + methodDescriptors.add(deleteContentMethodDescriptor); + methodDescriptors.add(getContentMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + methodDescriptors.add(listContentMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createContentCallable() { + return createContentCallable; + } + + @Override + public UnaryCallable updateContentCallable() { + return updateContentCallable; + } + + @Override + public UnaryCallable deleteContentCallable() { + return deleteContentCallable; + } + + @Override + public UnaryCallable getContentCallable() { + return getContentCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public UnaryCallable listContentCallable() { + return listContentCallable; + } + + @Override + public UnaryCallable listContentPagedCallable() { + return listContentPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonDataplexServiceCallableFactory.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonDataplexServiceCallableFactory.java new file mode 100644 index 0000000..f51a0fc --- /dev/null +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonDataplexServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the DataplexService service API. + * + *

      This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonDataplexServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonDataplexServiceStub.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonDataplexServiceStub.java new file mode 100644 index 0000000..27d3dfd --- /dev/null +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonDataplexServiceStub.java @@ -0,0 +1,2316 @@ +/* + * Copyright 2022 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.stub; + +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListAssetActionsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListAssetsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListEnvironmentsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListJobsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakeActionsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakesPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListSessionsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListTasksPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListZoneActionsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListZonesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.CancelJobRequest; +import com.google.cloud.dataplex.v1.CreateAssetRequest; +import com.google.cloud.dataplex.v1.CreateEnvironmentRequest; +import com.google.cloud.dataplex.v1.CreateLakeRequest; +import com.google.cloud.dataplex.v1.CreateTaskRequest; +import com.google.cloud.dataplex.v1.CreateZoneRequest; +import com.google.cloud.dataplex.v1.DeleteAssetRequest; +import com.google.cloud.dataplex.v1.DeleteEnvironmentRequest; +import com.google.cloud.dataplex.v1.DeleteLakeRequest; +import com.google.cloud.dataplex.v1.DeleteTaskRequest; +import com.google.cloud.dataplex.v1.DeleteZoneRequest; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.GetAssetRequest; +import com.google.cloud.dataplex.v1.GetEnvironmentRequest; +import com.google.cloud.dataplex.v1.GetJobRequest; +import com.google.cloud.dataplex.v1.GetLakeRequest; +import com.google.cloud.dataplex.v1.GetTaskRequest; +import com.google.cloud.dataplex.v1.GetZoneRequest; +import com.google.cloud.dataplex.v1.Job; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.ListActionsResponse; +import com.google.cloud.dataplex.v1.ListAssetActionsRequest; +import com.google.cloud.dataplex.v1.ListAssetsRequest; +import com.google.cloud.dataplex.v1.ListAssetsResponse; +import com.google.cloud.dataplex.v1.ListEnvironmentsRequest; +import com.google.cloud.dataplex.v1.ListEnvironmentsResponse; +import com.google.cloud.dataplex.v1.ListJobsRequest; +import com.google.cloud.dataplex.v1.ListJobsResponse; +import com.google.cloud.dataplex.v1.ListLakeActionsRequest; +import com.google.cloud.dataplex.v1.ListLakesRequest; +import com.google.cloud.dataplex.v1.ListLakesResponse; +import com.google.cloud.dataplex.v1.ListSessionsRequest; +import com.google.cloud.dataplex.v1.ListSessionsResponse; +import com.google.cloud.dataplex.v1.ListTasksRequest; +import com.google.cloud.dataplex.v1.ListTasksResponse; +import com.google.cloud.dataplex.v1.ListZoneActionsRequest; +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.Task; +import com.google.cloud.dataplex.v1.UpdateAssetRequest; +import com.google.cloud.dataplex.v1.UpdateEnvironmentRequest; +import com.google.cloud.dataplex.v1.UpdateLakeRequest; +import com.google.cloud.dataplex.v1.UpdateTaskRequest; +import com.google.cloud.dataplex.v1.UpdateZoneRequest; +import com.google.cloud.dataplex.v1.Zone; +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.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the DataplexService service API. + * + *

      This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonDataplexServiceStub extends DataplexServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Task.getDescriptor()) + .add(Zone.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(Environment.getDescriptor()) + .add(Lake.getDescriptor()) + .add(Asset.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + createLakeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/CreateLake") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/lakes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "lakeId", request.getLakeId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> ProtoRestSerializer.create().toBody("lake", request.getLake())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateLakeRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateLakeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/UpdateLake") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{lake.name=projects/*/locations/*/lakes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "lake.name", request.getLake().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> ProtoRestSerializer.create().toBody("lake", request.getLake())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateLakeRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteLakeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/DeleteLake") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteLakeRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listLakesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/ListLakes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/lakes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLakesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getLakeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/GetLake") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Lake.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLakeActionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/ListLakeActions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*}/actions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListActionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createZoneMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/CreateZone") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*}/zones", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "zoneId", request.getZoneId()); + return fields; + }) + .setRequestBodyExtractor( + request -> ProtoRestSerializer.create().toBody("zone", request.getZone())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateZoneRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateZoneMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/UpdateZone") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{zone.name=projects/*/locations/*/lakes/*/zones/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "zone.name", request.getZone().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> ProtoRestSerializer.create().toBody("zone", request.getZone())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateZoneRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteZoneMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/DeleteZone") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/zones/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteZoneRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listZonesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/ListZones") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*}/zones", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListZonesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getZoneMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/GetZone") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/zones/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Zone.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listZoneActionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/ListZoneActions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/actions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListActionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createAssetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/CreateAsset") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/assets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "assetId", request.getAssetId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("asset", request.getAsset())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateAssetRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateAssetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/UpdateAsset") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{asset.name=projects/*/locations/*/lakes/*/zones/*/assets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "asset.name", request.getAsset().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("asset", request.getAsset())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateAssetRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteAssetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/DeleteAsset") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/zones/*/assets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteAssetRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listAssetsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/ListAssets") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/assets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListAssetsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getAssetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/GetAsset") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/zones/*/assets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Asset.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listAssetActionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/ListAssetActions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/assets/*}/actions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListActionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createTaskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/CreateTask") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*}/tasks", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "taskId", request.getTaskId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> ProtoRestSerializer.create().toBody("task", request.getTask())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateTaskRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateTaskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/UpdateTask") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{task.name=projects/*/locations/*/lakes/*/tasks/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "task.name", request.getTask().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> ProtoRestSerializer.create().toBody("task", request.getTask())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateTaskRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteTaskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/DeleteTask") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/tasks/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteTaskRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listTasksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/ListTasks") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*}/tasks", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListTasksResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getTaskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/GetTask") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/tasks/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Task.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listJobsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/ListJobs") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*/tasks/*}/jobs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListJobsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getJobMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/GetJob") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/tasks/*/jobs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Job.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor cancelJobMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/CancelJob") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/tasks/*/jobs/*}:cancel", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createEnvironmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/CreateEnvironment") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*}/environments", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "environmentId", request.getEnvironmentId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("environment", request.getEnvironment())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateEnvironmentRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateEnvironmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/UpdateEnvironment") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{environment.name=projects/*/locations/*/lakes/*/environments/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "environment.name", request.getEnvironment().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("environment", request.getEnvironment())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateEnvironmentRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteEnvironmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/DeleteEnvironment") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/environments/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteEnvironmentRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listEnvironmentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/ListEnvironments") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*}/environments", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListEnvironmentsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getEnvironmentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/GetEnvironment") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/environments/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Environment.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listSessionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.DataplexService/ListSessions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*/environments/*}/sessions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSessionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createLakeCallable; + private final OperationCallable + createLakeOperationCallable; + private final UnaryCallable updateLakeCallable; + private final OperationCallable + updateLakeOperationCallable; + private final UnaryCallable deleteLakeCallable; + private final OperationCallable + deleteLakeOperationCallable; + private final UnaryCallable listLakesCallable; + private final UnaryCallable listLakesPagedCallable; + private final UnaryCallable getLakeCallable; + private final UnaryCallable listLakeActionsCallable; + private final UnaryCallable + listLakeActionsPagedCallable; + private final UnaryCallable createZoneCallable; + private final OperationCallable + createZoneOperationCallable; + private final UnaryCallable updateZoneCallable; + private final OperationCallable + updateZoneOperationCallable; + private final UnaryCallable deleteZoneCallable; + private final OperationCallable + deleteZoneOperationCallable; + private final UnaryCallable listZonesCallable; + private final UnaryCallable listZonesPagedCallable; + private final UnaryCallable getZoneCallable; + private final UnaryCallable listZoneActionsCallable; + private final UnaryCallable + listZoneActionsPagedCallable; + private final UnaryCallable createAssetCallable; + private final OperationCallable + createAssetOperationCallable; + private final UnaryCallable updateAssetCallable; + private final OperationCallable + updateAssetOperationCallable; + private final UnaryCallable deleteAssetCallable; + private final OperationCallable + deleteAssetOperationCallable; + private final UnaryCallable listAssetsCallable; + private final UnaryCallable listAssetsPagedCallable; + private final UnaryCallable getAssetCallable; + private final UnaryCallable + listAssetActionsCallable; + private final UnaryCallable + listAssetActionsPagedCallable; + private final UnaryCallable createTaskCallable; + private final OperationCallable + createTaskOperationCallable; + private final UnaryCallable updateTaskCallable; + private final OperationCallable + updateTaskOperationCallable; + private final UnaryCallable deleteTaskCallable; + private final OperationCallable + deleteTaskOperationCallable; + private final UnaryCallable listTasksCallable; + private final UnaryCallable listTasksPagedCallable; + private final UnaryCallable getTaskCallable; + private final UnaryCallable listJobsCallable; + private final UnaryCallable listJobsPagedCallable; + private final UnaryCallable getJobCallable; + private final UnaryCallable cancelJobCallable; + private final UnaryCallable createEnvironmentCallable; + private final OperationCallable + createEnvironmentOperationCallable; + private final UnaryCallable updateEnvironmentCallable; + private final OperationCallable + updateEnvironmentOperationCallable; + private final UnaryCallable deleteEnvironmentCallable; + private final OperationCallable + deleteEnvironmentOperationCallable; + private final UnaryCallable + listEnvironmentsCallable; + private final UnaryCallable + listEnvironmentsPagedCallable; + private final UnaryCallable getEnvironmentCallable; + private final UnaryCallable listSessionsCallable; + private final UnaryCallable + listSessionsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonDataplexServiceStub create(DataplexServiceStubSettings settings) + throws IOException { + return new HttpJsonDataplexServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonDataplexServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonDataplexServiceStub( + DataplexServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonDataplexServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDataplexServiceStub( + DataplexServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonDataplexServiceStub, 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 HttpJsonDataplexServiceStub( + DataplexServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonDataplexServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonDataplexServiceStub, 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 HttpJsonDataplexServiceStub( + DataplexServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings createLakeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createLakeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateLakeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateLakeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteLakeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteLakeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listLakesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLakesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLakeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLakeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLakeActionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLakeActionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createZoneTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createZoneMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateZoneTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateZoneMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteZoneTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteZoneMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listZonesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listZonesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getZoneTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getZoneMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listZoneActionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listZoneActionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createAssetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createAssetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateAssetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateAssetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteAssetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteAssetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listAssetsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listAssetsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getAssetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAssetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listAssetActionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listAssetActionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createTaskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createTaskMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateTaskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateTaskMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteTaskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTaskMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listTasksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTasksMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getTaskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTaskMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listJobsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listJobsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getJobTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getJobMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings cancelJobTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(cancelJobMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createEnvironmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createEnvironmentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateEnvironmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateEnvironmentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteEnvironmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteEnvironmentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listEnvironmentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listEnvironmentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getEnvironmentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEnvironmentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listSessionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createLakeCallable = + callableFactory.createUnaryCallable( + createLakeTransportSettings, settings.createLakeSettings(), clientContext); + this.createLakeOperationCallable = + callableFactory.createOperationCallable( + createLakeTransportSettings, + settings.createLakeOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateLakeCallable = + callableFactory.createUnaryCallable( + updateLakeTransportSettings, settings.updateLakeSettings(), clientContext); + this.updateLakeOperationCallable = + callableFactory.createOperationCallable( + updateLakeTransportSettings, + settings.updateLakeOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteLakeCallable = + callableFactory.createUnaryCallable( + deleteLakeTransportSettings, settings.deleteLakeSettings(), clientContext); + this.deleteLakeOperationCallable = + callableFactory.createOperationCallable( + deleteLakeTransportSettings, + settings.deleteLakeOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listLakesCallable = + callableFactory.createUnaryCallable( + listLakesTransportSettings, settings.listLakesSettings(), clientContext); + this.listLakesPagedCallable = + callableFactory.createPagedCallable( + listLakesTransportSettings, settings.listLakesSettings(), clientContext); + this.getLakeCallable = + callableFactory.createUnaryCallable( + getLakeTransportSettings, settings.getLakeSettings(), clientContext); + this.listLakeActionsCallable = + callableFactory.createUnaryCallable( + listLakeActionsTransportSettings, settings.listLakeActionsSettings(), clientContext); + this.listLakeActionsPagedCallable = + callableFactory.createPagedCallable( + listLakeActionsTransportSettings, settings.listLakeActionsSettings(), clientContext); + this.createZoneCallable = + callableFactory.createUnaryCallable( + createZoneTransportSettings, settings.createZoneSettings(), clientContext); + this.createZoneOperationCallable = + callableFactory.createOperationCallable( + createZoneTransportSettings, + settings.createZoneOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateZoneCallable = + callableFactory.createUnaryCallable( + updateZoneTransportSettings, settings.updateZoneSettings(), clientContext); + this.updateZoneOperationCallable = + callableFactory.createOperationCallable( + updateZoneTransportSettings, + settings.updateZoneOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteZoneCallable = + callableFactory.createUnaryCallable( + deleteZoneTransportSettings, settings.deleteZoneSettings(), clientContext); + this.deleteZoneOperationCallable = + callableFactory.createOperationCallable( + deleteZoneTransportSettings, + settings.deleteZoneOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listZonesCallable = + callableFactory.createUnaryCallable( + listZonesTransportSettings, settings.listZonesSettings(), clientContext); + this.listZonesPagedCallable = + callableFactory.createPagedCallable( + listZonesTransportSettings, settings.listZonesSettings(), clientContext); + this.getZoneCallable = + callableFactory.createUnaryCallable( + getZoneTransportSettings, settings.getZoneSettings(), clientContext); + this.listZoneActionsCallable = + callableFactory.createUnaryCallable( + listZoneActionsTransportSettings, settings.listZoneActionsSettings(), clientContext); + this.listZoneActionsPagedCallable = + callableFactory.createPagedCallable( + listZoneActionsTransportSettings, settings.listZoneActionsSettings(), clientContext); + this.createAssetCallable = + callableFactory.createUnaryCallable( + createAssetTransportSettings, settings.createAssetSettings(), clientContext); + this.createAssetOperationCallable = + callableFactory.createOperationCallable( + createAssetTransportSettings, + settings.createAssetOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateAssetCallable = + callableFactory.createUnaryCallable( + updateAssetTransportSettings, settings.updateAssetSettings(), clientContext); + this.updateAssetOperationCallable = + callableFactory.createOperationCallable( + updateAssetTransportSettings, + settings.updateAssetOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteAssetCallable = + callableFactory.createUnaryCallable( + deleteAssetTransportSettings, settings.deleteAssetSettings(), clientContext); + this.deleteAssetOperationCallable = + callableFactory.createOperationCallable( + deleteAssetTransportSettings, + settings.deleteAssetOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listAssetsCallable = + callableFactory.createUnaryCallable( + listAssetsTransportSettings, settings.listAssetsSettings(), clientContext); + this.listAssetsPagedCallable = + callableFactory.createPagedCallable( + listAssetsTransportSettings, settings.listAssetsSettings(), clientContext); + this.getAssetCallable = + callableFactory.createUnaryCallable( + getAssetTransportSettings, settings.getAssetSettings(), clientContext); + this.listAssetActionsCallable = + callableFactory.createUnaryCallable( + listAssetActionsTransportSettings, settings.listAssetActionsSettings(), clientContext); + this.listAssetActionsPagedCallable = + callableFactory.createPagedCallable( + listAssetActionsTransportSettings, settings.listAssetActionsSettings(), clientContext); + this.createTaskCallable = + callableFactory.createUnaryCallable( + createTaskTransportSettings, settings.createTaskSettings(), clientContext); + this.createTaskOperationCallable = + callableFactory.createOperationCallable( + createTaskTransportSettings, + settings.createTaskOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateTaskCallable = + callableFactory.createUnaryCallable( + updateTaskTransportSettings, settings.updateTaskSettings(), clientContext); + this.updateTaskOperationCallable = + callableFactory.createOperationCallable( + updateTaskTransportSettings, + settings.updateTaskOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteTaskCallable = + callableFactory.createUnaryCallable( + deleteTaskTransportSettings, settings.deleteTaskSettings(), clientContext); + this.deleteTaskOperationCallable = + callableFactory.createOperationCallable( + deleteTaskTransportSettings, + settings.deleteTaskOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listTasksCallable = + callableFactory.createUnaryCallable( + listTasksTransportSettings, settings.listTasksSettings(), clientContext); + this.listTasksPagedCallable = + callableFactory.createPagedCallable( + listTasksTransportSettings, settings.listTasksSettings(), clientContext); + this.getTaskCallable = + callableFactory.createUnaryCallable( + getTaskTransportSettings, settings.getTaskSettings(), clientContext); + this.listJobsCallable = + callableFactory.createUnaryCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + this.listJobsPagedCallable = + callableFactory.createPagedCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + this.getJobCallable = + callableFactory.createUnaryCallable( + getJobTransportSettings, settings.getJobSettings(), clientContext); + this.cancelJobCallable = + callableFactory.createUnaryCallable( + cancelJobTransportSettings, settings.cancelJobSettings(), clientContext); + this.createEnvironmentCallable = + callableFactory.createUnaryCallable( + createEnvironmentTransportSettings, + settings.createEnvironmentSettings(), + clientContext); + this.createEnvironmentOperationCallable = + callableFactory.createOperationCallable( + createEnvironmentTransportSettings, + settings.createEnvironmentOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateEnvironmentCallable = + callableFactory.createUnaryCallable( + updateEnvironmentTransportSettings, + settings.updateEnvironmentSettings(), + clientContext); + this.updateEnvironmentOperationCallable = + callableFactory.createOperationCallable( + updateEnvironmentTransportSettings, + settings.updateEnvironmentOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteEnvironmentCallable = + callableFactory.createUnaryCallable( + deleteEnvironmentTransportSettings, + settings.deleteEnvironmentSettings(), + clientContext); + this.deleteEnvironmentOperationCallable = + callableFactory.createOperationCallable( + deleteEnvironmentTransportSettings, + settings.deleteEnvironmentOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listEnvironmentsCallable = + callableFactory.createUnaryCallable( + listEnvironmentsTransportSettings, settings.listEnvironmentsSettings(), clientContext); + this.listEnvironmentsPagedCallable = + callableFactory.createPagedCallable( + listEnvironmentsTransportSettings, settings.listEnvironmentsSettings(), clientContext); + this.getEnvironmentCallable = + callableFactory.createUnaryCallable( + getEnvironmentTransportSettings, settings.getEnvironmentSettings(), clientContext); + this.listSessionsCallable = + callableFactory.createUnaryCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listSessionsPagedCallable = + callableFactory.createPagedCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createLakeMethodDescriptor); + methodDescriptors.add(updateLakeMethodDescriptor); + methodDescriptors.add(deleteLakeMethodDescriptor); + methodDescriptors.add(listLakesMethodDescriptor); + methodDescriptors.add(getLakeMethodDescriptor); + methodDescriptors.add(listLakeActionsMethodDescriptor); + methodDescriptors.add(createZoneMethodDescriptor); + methodDescriptors.add(updateZoneMethodDescriptor); + methodDescriptors.add(deleteZoneMethodDescriptor); + methodDescriptors.add(listZonesMethodDescriptor); + methodDescriptors.add(getZoneMethodDescriptor); + methodDescriptors.add(listZoneActionsMethodDescriptor); + methodDescriptors.add(createAssetMethodDescriptor); + methodDescriptors.add(updateAssetMethodDescriptor); + methodDescriptors.add(deleteAssetMethodDescriptor); + methodDescriptors.add(listAssetsMethodDescriptor); + methodDescriptors.add(getAssetMethodDescriptor); + methodDescriptors.add(listAssetActionsMethodDescriptor); + methodDescriptors.add(createTaskMethodDescriptor); + methodDescriptors.add(updateTaskMethodDescriptor); + methodDescriptors.add(deleteTaskMethodDescriptor); + methodDescriptors.add(listTasksMethodDescriptor); + methodDescriptors.add(getTaskMethodDescriptor); + methodDescriptors.add(listJobsMethodDescriptor); + methodDescriptors.add(getJobMethodDescriptor); + methodDescriptors.add(cancelJobMethodDescriptor); + methodDescriptors.add(createEnvironmentMethodDescriptor); + methodDescriptors.add(updateEnvironmentMethodDescriptor); + methodDescriptors.add(deleteEnvironmentMethodDescriptor); + methodDescriptors.add(listEnvironmentsMethodDescriptor); + methodDescriptors.add(getEnvironmentMethodDescriptor); + methodDescriptors.add(listSessionsMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createLakeCallable() { + return createLakeCallable; + } + + @Override + public OperationCallable + createLakeOperationCallable() { + return createLakeOperationCallable; + } + + @Override + public UnaryCallable updateLakeCallable() { + return updateLakeCallable; + } + + @Override + public OperationCallable + updateLakeOperationCallable() { + return updateLakeOperationCallable; + } + + @Override + public UnaryCallable deleteLakeCallable() { + return deleteLakeCallable; + } + + @Override + public OperationCallable + deleteLakeOperationCallable() { + return deleteLakeOperationCallable; + } + + @Override + public UnaryCallable listLakesCallable() { + return listLakesCallable; + } + + @Override + public UnaryCallable listLakesPagedCallable() { + return listLakesPagedCallable; + } + + @Override + public UnaryCallable getLakeCallable() { + return getLakeCallable; + } + + @Override + public UnaryCallable listLakeActionsCallable() { + return listLakeActionsCallable; + } + + @Override + public UnaryCallable + listLakeActionsPagedCallable() { + return listLakeActionsPagedCallable; + } + + @Override + public UnaryCallable createZoneCallable() { + return createZoneCallable; + } + + @Override + public OperationCallable + createZoneOperationCallable() { + return createZoneOperationCallable; + } + + @Override + public UnaryCallable updateZoneCallable() { + return updateZoneCallable; + } + + @Override + public OperationCallable + updateZoneOperationCallable() { + return updateZoneOperationCallable; + } + + @Override + public UnaryCallable deleteZoneCallable() { + return deleteZoneCallable; + } + + @Override + public OperationCallable + deleteZoneOperationCallable() { + return deleteZoneOperationCallable; + } + + @Override + public UnaryCallable listZonesCallable() { + return listZonesCallable; + } + + @Override + public UnaryCallable listZonesPagedCallable() { + return listZonesPagedCallable; + } + + @Override + public UnaryCallable getZoneCallable() { + return getZoneCallable; + } + + @Override + public UnaryCallable listZoneActionsCallable() { + return listZoneActionsCallable; + } + + @Override + public UnaryCallable + listZoneActionsPagedCallable() { + return listZoneActionsPagedCallable; + } + + @Override + public UnaryCallable createAssetCallable() { + return createAssetCallable; + } + + @Override + public OperationCallable + createAssetOperationCallable() { + return createAssetOperationCallable; + } + + @Override + public UnaryCallable updateAssetCallable() { + return updateAssetCallable; + } + + @Override + public OperationCallable + updateAssetOperationCallable() { + return updateAssetOperationCallable; + } + + @Override + public UnaryCallable deleteAssetCallable() { + return deleteAssetCallable; + } + + @Override + public OperationCallable + deleteAssetOperationCallable() { + return deleteAssetOperationCallable; + } + + @Override + public UnaryCallable listAssetsCallable() { + return listAssetsCallable; + } + + @Override + public UnaryCallable listAssetsPagedCallable() { + return listAssetsPagedCallable; + } + + @Override + public UnaryCallable getAssetCallable() { + return getAssetCallable; + } + + @Override + public UnaryCallable listAssetActionsCallable() { + return listAssetActionsCallable; + } + + @Override + public UnaryCallable + listAssetActionsPagedCallable() { + return listAssetActionsPagedCallable; + } + + @Override + public UnaryCallable createTaskCallable() { + return createTaskCallable; + } + + @Override + public OperationCallable + createTaskOperationCallable() { + return createTaskOperationCallable; + } + + @Override + public UnaryCallable updateTaskCallable() { + return updateTaskCallable; + } + + @Override + public OperationCallable + updateTaskOperationCallable() { + return updateTaskOperationCallable; + } + + @Override + public UnaryCallable deleteTaskCallable() { + return deleteTaskCallable; + } + + @Override + public OperationCallable + deleteTaskOperationCallable() { + return deleteTaskOperationCallable; + } + + @Override + public UnaryCallable listTasksCallable() { + return listTasksCallable; + } + + @Override + public UnaryCallable listTasksPagedCallable() { + return listTasksPagedCallable; + } + + @Override + public UnaryCallable getTaskCallable() { + return getTaskCallable; + } + + @Override + public UnaryCallable listJobsCallable() { + return listJobsCallable; + } + + @Override + public UnaryCallable listJobsPagedCallable() { + return listJobsPagedCallable; + } + + @Override + public UnaryCallable getJobCallable() { + return getJobCallable; + } + + @Override + public UnaryCallable cancelJobCallable() { + return cancelJobCallable; + } + + @Override + public UnaryCallable createEnvironmentCallable() { + return createEnvironmentCallable; + } + + @Override + public OperationCallable + createEnvironmentOperationCallable() { + return createEnvironmentOperationCallable; + } + + @Override + public UnaryCallable updateEnvironmentCallable() { + return updateEnvironmentCallable; + } + + @Override + public OperationCallable + updateEnvironmentOperationCallable() { + return updateEnvironmentOperationCallable; + } + + @Override + public UnaryCallable deleteEnvironmentCallable() { + return deleteEnvironmentCallable; + } + + @Override + public OperationCallable + deleteEnvironmentOperationCallable() { + return deleteEnvironmentOperationCallable; + } + + @Override + public UnaryCallable + listEnvironmentsCallable() { + return listEnvironmentsCallable; + } + + @Override + public UnaryCallable + listEnvironmentsPagedCallable() { + return listEnvironmentsPagedCallable; + } + + @Override + public UnaryCallable getEnvironmentCallable() { + return getEnvironmentCallable; + } + + @Override + public UnaryCallable listSessionsCallable() { + return listSessionsCallable; + } + + @Override + public UnaryCallable listSessionsPagedCallable() { + return listSessionsPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonMetadataServiceCallableFactory.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonMetadataServiceCallableFactory.java new file mode 100644 index 0000000..f347834 --- /dev/null +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonMetadataServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the MetadataService service API. + * + *

      This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonMetadataServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonMetadataServiceStub.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonMetadataServiceStub.java new file mode 100644 index 0000000..b11bd86 --- /dev/null +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/HttpJsonMetadataServiceStub.java @@ -0,0 +1,748 @@ +/* + * Copyright 2022 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.stub; + +import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListEntitiesPagedResponse; +import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListPartitionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dataplex.v1.CreateEntityRequest; +import com.google.cloud.dataplex.v1.CreatePartitionRequest; +import com.google.cloud.dataplex.v1.DeleteEntityRequest; +import com.google.cloud.dataplex.v1.DeletePartitionRequest; +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.GetEntityRequest; +import com.google.cloud.dataplex.v1.GetPartitionRequest; +import com.google.cloud.dataplex.v1.ListEntitiesRequest; +import com.google.cloud.dataplex.v1.ListEntitiesResponse; +import com.google.cloud.dataplex.v1.ListPartitionsRequest; +import com.google.cloud.dataplex.v1.ListPartitionsResponse; +import com.google.cloud.dataplex.v1.Partition; +import com.google.cloud.dataplex.v1.UpdateEntityRequest; +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.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the MetadataService service API. + * + *

      This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonMetadataServiceStub extends MetadataServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createEntityMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.MetadataService/CreateEntity") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/entities", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("entity", request.getEntity())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Entity.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateEntityMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.MetadataService/UpdateEntity") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{entity.name=projects/*/locations/*/lakes/*/zones/*/entities/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "entity.name", request.getEntity().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("entity", request.getEntity())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Entity.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteEntityMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.MetadataService/DeleteEntity") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getEntityMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.MetadataService/GetEntity") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "view", request.getView()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Entity.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listEntitiesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.MetadataService/ListEntities") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/entities", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "view", request.getView()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListEntitiesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createPartitionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.MetadataService/CreatePartition") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/entities/*}/partitions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("partition", request.getPartition())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Partition.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deletePartitionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.MetadataService/DeletePartition") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*/partitions/**}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getPartitionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.MetadataService/GetPartition") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*/partitions/**}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Partition.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listPartitionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataplex.v1.MetadataService/ListPartitions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/entities/*}/partitions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListPartitionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createEntityCallable; + private final UnaryCallable updateEntityCallable; + private final UnaryCallable deleteEntityCallable; + private final UnaryCallable getEntityCallable; + private final UnaryCallable listEntitiesCallable; + private final UnaryCallable + listEntitiesPagedCallable; + private final UnaryCallable createPartitionCallable; + private final UnaryCallable deletePartitionCallable; + private final UnaryCallable getPartitionCallable; + private final UnaryCallable listPartitionsCallable; + private final UnaryCallable + listPartitionsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonMetadataServiceStub create(MetadataServiceStubSettings settings) + throws IOException { + return new HttpJsonMetadataServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonMetadataServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonMetadataServiceStub( + MetadataServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonMetadataServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMetadataServiceStub( + MetadataServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonMetadataServiceStub, 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 HttpJsonMetadataServiceStub( + MetadataServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonMetadataServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonMetadataServiceStub, 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 HttpJsonMetadataServiceStub( + MetadataServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createEntityTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createEntityMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateEntityTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateEntityMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteEntityTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteEntityMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getEntityTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEntityMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listEntitiesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listEntitiesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createPartitionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createPartitionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deletePartitionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deletePartitionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getPartitionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPartitionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listPartitionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listPartitionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createEntityCallable = + callableFactory.createUnaryCallable( + createEntityTransportSettings, settings.createEntitySettings(), clientContext); + this.updateEntityCallable = + callableFactory.createUnaryCallable( + updateEntityTransportSettings, settings.updateEntitySettings(), clientContext); + this.deleteEntityCallable = + callableFactory.createUnaryCallable( + deleteEntityTransportSettings, settings.deleteEntitySettings(), clientContext); + this.getEntityCallable = + callableFactory.createUnaryCallable( + getEntityTransportSettings, settings.getEntitySettings(), clientContext); + this.listEntitiesCallable = + callableFactory.createUnaryCallable( + listEntitiesTransportSettings, settings.listEntitiesSettings(), clientContext); + this.listEntitiesPagedCallable = + callableFactory.createPagedCallable( + listEntitiesTransportSettings, settings.listEntitiesSettings(), clientContext); + this.createPartitionCallable = + callableFactory.createUnaryCallable( + createPartitionTransportSettings, settings.createPartitionSettings(), clientContext); + this.deletePartitionCallable = + callableFactory.createUnaryCallable( + deletePartitionTransportSettings, settings.deletePartitionSettings(), clientContext); + this.getPartitionCallable = + callableFactory.createUnaryCallable( + getPartitionTransportSettings, settings.getPartitionSettings(), clientContext); + this.listPartitionsCallable = + callableFactory.createUnaryCallable( + listPartitionsTransportSettings, settings.listPartitionsSettings(), clientContext); + this.listPartitionsPagedCallable = + callableFactory.createPagedCallable( + listPartitionsTransportSettings, settings.listPartitionsSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createEntityMethodDescriptor); + methodDescriptors.add(updateEntityMethodDescriptor); + methodDescriptors.add(deleteEntityMethodDescriptor); + methodDescriptors.add(getEntityMethodDescriptor); + methodDescriptors.add(listEntitiesMethodDescriptor); + methodDescriptors.add(createPartitionMethodDescriptor); + methodDescriptors.add(deletePartitionMethodDescriptor); + methodDescriptors.add(getPartitionMethodDescriptor); + methodDescriptors.add(listPartitionsMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createEntityCallable() { + return createEntityCallable; + } + + @Override + public UnaryCallable updateEntityCallable() { + return updateEntityCallable; + } + + @Override + public UnaryCallable deleteEntityCallable() { + return deleteEntityCallable; + } + + @Override + public UnaryCallable getEntityCallable() { + return getEntityCallable; + } + + @Override + public UnaryCallable listEntitiesCallable() { + return listEntitiesCallable; + } + + @Override + public UnaryCallable listEntitiesPagedCallable() { + return listEntitiesPagedCallable; + } + + @Override + public UnaryCallable createPartitionCallable() { + return createPartitionCallable; + } + + @Override + public UnaryCallable deletePartitionCallable() { + return deletePartitionCallable; + } + + @Override + public UnaryCallable getPartitionCallable() { + return getPartitionCallable; + } + + @Override + public UnaryCallable listPartitionsCallable() { + return listPartitionsCallable; + } + + @Override + public UnaryCallable + listPartitionsPagedCallable() { + return listPartitionsPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/MetadataServiceStub.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/MetadataServiceStub.java index 589165d..d8374fc 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/MetadataServiceStub.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/MetadataServiceStub.java @@ -17,6 +17,7 @@ package com.google.cloud.dataplex.v1.stub; import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListEntitiesPagedResponse; +import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListLocationsPagedResponse; import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListPartitionsPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -34,6 +35,10 @@ import com.google.cloud.dataplex.v1.ListPartitionsResponse; import com.google.cloud.dataplex.v1.Partition; import com.google.cloud.dataplex.v1.UpdateEntityRequest; +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.protobuf.Empty; import javax.annotation.Generated; @@ -91,6 +96,19 @@ public UnaryCallable listPartitio throw new UnsupportedOperationException("Not implemented: listPartitionsCallable()"); } + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/MetadataServiceStubSettings.java b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/MetadataServiceStubSettings.java index e2e5000..52c0945 100644 --- a/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/MetadataServiceStubSettings.java +++ b/google-cloud-dataplex/src/main/java/com/google/cloud/dataplex/v1/stub/MetadataServiceStubSettings.java @@ -17,6 +17,7 @@ package com.google.cloud.dataplex.v1.stub; import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListEntitiesPagedResponse; +import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListLocationsPagedResponse; import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListPartitionsPagedResponse; import com.google.api.core.ApiFunction; @@ -28,6 +29,9 @@ import com.google.api.gax.grpc.GaxGrpcProperties; import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; @@ -54,6 +58,10 @@ import com.google.cloud.dataplex.v1.ListPartitionsResponse; import com.google.cloud.dataplex.v1.Partition; import com.google.cloud.dataplex.v1.UpdateEntityRequest; +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.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -117,6 +125,10 @@ public class MetadataServiceStubSettings extends StubSettings listPartitionsSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; private static final PagedListDescriptor LIST_ENTITIES_PAGE_STR_DESC = @@ -191,6 +203,42 @@ public Iterable extractResources(ListPartitionsResponse payload) { } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListEntitiesRequest, ListEntitiesResponse, ListEntitiesPagedResponse> LIST_ENTITIES_PAGE_STR_FACT = @@ -225,6 +273,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to createEntity. */ public UnaryCallSettings createEntitySettings() { return createEntitySettings; @@ -273,12 +338,28 @@ public UnaryCallSettings getPartitionSettings() return listPartitionsSettings; } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + public MetadataServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcMetadataServiceStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonMetadataServiceStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -311,18 +392,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(MetadataServiceStubSettings.class)) @@ -330,11 +418,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(MetadataServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MetadataServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -357,6 +464,8 @@ protected MetadataServiceStubSettings(Builder settingsBuilder) throws IOExceptio deletePartitionSettings = settingsBuilder.deletePartitionSettings().build(); getPartitionSettings = settingsBuilder.getPartitionSettings().build(); listPartitionsSettings = settingsBuilder.listPartitionsSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); } /** Builder for MetadataServiceStubSettings. */ @@ -376,6 +485,10 @@ public static class Builder extends StubSettings.Builder listPartitionsSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -383,13 +496,14 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "no_retry_5_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_7_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "retry_policy_2_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); definitions.put( "retry_policy_3_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -405,7 +519,7 @@ public static class Builder extends StubSettings.Builder>of( @@ -458,7 +576,9 @@ protected Builder(ClientContext clientContext) { createPartitionSettings, deletePartitionSettings, getPartitionSettings, - listPartitionsSettings); + listPartitionsSettings, + listLocationsSettings, + getLocationSettings); initDefaults(this); } @@ -474,6 +594,8 @@ protected Builder(MetadataServiceStubSettings settings) { deletePartitionSettings = settings.deletePartitionSettings.toBuilder(); getPartitionSettings = settings.getPartitionSettings.toBuilder(); listPartitionsSettings = settings.listPartitionsSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -485,7 +607,9 @@ protected Builder(MetadataServiceStubSettings settings) { createPartitionSettings, deletePartitionSettings, getPartitionSettings, - listPartitionsSettings); + listPartitionsSettings, + listLocationsSettings, + getLocationSettings); } private static Builder createDefault() { @@ -501,21 +625,34 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .createEntitySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); builder .updateEntitySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); builder .deleteEntitySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); builder .getEntitySettings() @@ -529,13 +666,13 @@ private static Builder initDefaults(Builder builder) { builder .createPartitionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); builder .deletePartitionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); builder .getPartitionSettings() @@ -547,6 +684,16 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + return builder; } @@ -614,6 +761,18 @@ public UnaryCallSettings.Builder getPartitionSet return listPartitionsSettings; } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + @Override public MetadataServiceStubSettings build() throws IOException { return new MetadataServiceStubSettings(this); diff --git a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/ContentServiceClientHttpJsonTest.java b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/ContentServiceClientHttpJsonTest.java new file mode 100644 index 0000000..2c46575 --- /dev/null +++ b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/ContentServiceClientHttpJsonTest.java @@ -0,0 +1,877 @@ +/* + * Copyright 2022 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 static com.google.cloud.dataplex.v1.ContentServiceClient.ListContentPagedResponse; +import static com.google.cloud.dataplex.v1.ContentServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.dataplex.v1.stub.HttpJsonContentServiceStub; +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.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class ContentServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static ContentServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonContentServiceStub.getMethodDescriptors(), + ContentServiceSettings.getDefaultEndpoint()); + ContentServiceSettings settings = + ContentServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ContentServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ContentServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createContentTest() throws Exception { + Content expectedResponse = + Content.newBuilder() + .setName(ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setUid("uid115792") + .setPath("path3433509") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Content content = Content.newBuilder().build(); + + Content actualResponse = client.createContent(parent, content); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createContentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Content content = Content.newBuilder().build(); + client.createContent(parent, content); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createContentTest2() throws Exception { + Content expectedResponse = + Content.newBuilder() + .setName(ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setUid("uid115792") + .setPath("path3433509") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + Content content = Content.newBuilder().build(); + + Content actualResponse = client.createContent(parent, content); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createContentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + Content content = Content.newBuilder().build(); + client.createContent(parent, content); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateContentTest() throws Exception { + Content expectedResponse = + Content.newBuilder() + .setName(ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setUid("uid115792") + .setPath("path3433509") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + Content content = + Content.newBuilder() + .setName(ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setUid("uid115792") + .setPath("path3433509") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Content actualResponse = client.updateContent(content, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateContentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Content content = + Content.newBuilder() + .setName(ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setUid("uid115792") + .setPath("path3433509") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateContent(content, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteContentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ContentName name = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"); + + client.deleteContent(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteContentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ContentName name = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"); + client.deleteContent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteContentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1021/locations/location-1021/lakes/lake-1021/contentitems/contentitem-1021"; + + client.deleteContent(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteContentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1021/locations/location-1021/lakes/lake-1021/contentitems/contentitem-1021"; + client.deleteContent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getContentTest() throws Exception { + Content expectedResponse = + Content.newBuilder() + .setName(ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setUid("uid115792") + .setPath("path3433509") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + ContentName name = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"); + + Content actualResponse = client.getContent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getContentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ContentName name = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"); + client.getContent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getContentTest2() throws Exception { + Content expectedResponse = + Content.newBuilder() + .setName(ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setUid("uid115792") + .setPath("path3433509") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1021/locations/location-1021/lakes/lake-1021/contentitems/contentitem-1021"; + + Content actualResponse = client.getContent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getContentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1021/locations/location-1021/lakes/lake-1021/contentitems/contentitem-1021"; + client.getContent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + ResourceName resource = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ResourceName resource = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"); + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + String resource = + "projects/project-374/locations/location-374/lakes/lake-374/contentitems/contentitem-374"; + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String resource = + "projects/project-374/locations/location-374/lakes/lake-374/contentitems/contentitem-374"; + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listContentTest() throws Exception { + Content responsesElement = Content.newBuilder().build(); + ListContentResponse expectedResponse = + ListContentResponse.newBuilder() + .setNextPageToken("") + .addAllContent(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + + ListContentPagedResponse pagedListResponse = client.listContent(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getContentList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listContentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + client.listContent(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listContentTest2() throws Exception { + Content responsesElement = Content.newBuilder().build(); + ListContentResponse expectedResponse = + ListContentResponse.newBuilder() + .setNextPageToken("") + .addAllContent(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + + ListContentPagedResponse pagedListResponse = client.listContent(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getContentList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listContentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + client.listContent(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/ContentServiceClientTest.java b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/ContentServiceClientTest.java index 0277266..b3dbe7f 100644 --- a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/ContentServiceClientTest.java +++ b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/ContentServiceClientTest.java @@ -17,6 +17,7 @@ package com.google.cloud.dataplex.v1; import static com.google.cloud.dataplex.v1.ContentServiceClient.ListContentPagedResponse; +import static com.google.cloud.dataplex.v1.ContentServiceClient.ListLocationsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; @@ -25,13 +26,28 @@ import com.google.api.gax.grpc.testing.MockServiceHelper; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.resourcenames.ResourceName; +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.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -47,6 +63,8 @@ @Generated("by gapic-generator-java") public class ContentServiceClientTest { private static MockContentService mockContentService; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; private ContentServiceClient client; @@ -54,9 +72,12 @@ public class ContentServiceClientTest { @BeforeClass public static void startStaticServer() { mockContentService = new MockContentService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockContentService)); + UUID.randomUUID().toString(), + Arrays.asList(mockContentService, mockLocations, mockIAMPolicy)); mockServiceHelper.start(); } @@ -379,6 +400,190 @@ public void getContentExceptionTest2() throws Exception { } } + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockContentService.addResponse(expectedResponse); + + ResourceName resource = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockContentService.addException(exception); + + try { + ResourceName resource = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"); + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockContentService.addResponse(expectedResponse); + + String resource = "resource-341064690"; + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockContentService.addException(exception); + + try { + String resource = "resource-341064690"; + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockContentService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockContentService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockContentService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockContentService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listContentTest() throws Exception { Content responsesElement = Content.newBuilder().build(); @@ -466,4 +671,105 @@ public void listContentExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/DataplexServiceClientHttpJsonTest.java b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/DataplexServiceClientHttpJsonTest.java new file mode 100644 index 0000000..be3d2c5 --- /dev/null +++ b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/DataplexServiceClientHttpJsonTest.java @@ -0,0 +1,3518 @@ +/* + * Copyright 2022 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 static com.google.cloud.dataplex.v1.DataplexServiceClient.ListAssetActionsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListAssetsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListEnvironmentsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListJobsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakeActionsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakesPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListSessionsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListTasksPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListZoneActionsPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListZonesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.dataplex.v1.stub.HttpJsonDataplexServiceStub; +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.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class DataplexServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static DataplexServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonDataplexServiceStub.getMethodDescriptors(), + DataplexServiceSettings.getDefaultEndpoint()); + DataplexServiceSettings settings = + DataplexServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + DataplexServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DataplexServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createLakeTest() throws Exception { + Lake expectedResponse = + Lake.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setServiceAccount("serviceAccount1079137720") + .setMetastore(Lake.Metastore.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .setMetastoreStatus(Lake.MetastoreStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createLakeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Lake lake = Lake.newBuilder().build(); + String lakeId = "lakeId-1110150390"; + + Lake actualResponse = client.createLakeAsync(parent, lake, lakeId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createLakeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Lake lake = Lake.newBuilder().build(); + String lakeId = "lakeId-1110150390"; + client.createLakeAsync(parent, lake, lakeId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createLakeTest2() throws Exception { + Lake expectedResponse = + Lake.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setServiceAccount("serviceAccount1079137720") + .setMetastore(Lake.Metastore.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .setMetastoreStatus(Lake.MetastoreStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createLakeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Lake lake = Lake.newBuilder().build(); + String lakeId = "lakeId-1110150390"; + + Lake actualResponse = client.createLakeAsync(parent, lake, lakeId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createLakeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Lake lake = Lake.newBuilder().build(); + String lakeId = "lakeId-1110150390"; + client.createLakeAsync(parent, lake, lakeId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateLakeTest() throws Exception { + Lake expectedResponse = + Lake.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setServiceAccount("serviceAccount1079137720") + .setMetastore(Lake.Metastore.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .setMetastoreStatus(Lake.MetastoreStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateLakeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Lake lake = + Lake.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setServiceAccount("serviceAccount1079137720") + .setMetastore(Lake.Metastore.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .setMetastoreStatus(Lake.MetastoreStatus.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Lake actualResponse = client.updateLakeAsync(lake, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateLakeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Lake lake = + Lake.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setServiceAccount("serviceAccount1079137720") + .setMetastore(Lake.Metastore.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .setMetastoreStatus(Lake.MetastoreStatus.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateLakeAsync(lake, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteLakeTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteLakeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LakeName name = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + + client.deleteLakeAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteLakeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LakeName name = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + client.deleteLakeAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteLakeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteLakeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-2822/locations/location-2822/lakes/lake-2822"; + + client.deleteLakeAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteLakeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2822/locations/location-2822/lakes/lake-2822"; + client.deleteLakeAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listLakesTest() throws Exception { + Lake responsesElement = Lake.newBuilder().build(); + ListLakesResponse expectedResponse = + ListLakesResponse.newBuilder() + .setNextPageToken("") + .addAllLakes(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListLakesPagedResponse pagedListResponse = client.listLakes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLakesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLakesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listLakes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLakesTest2() throws Exception { + Lake responsesElement = Lake.newBuilder().build(); + ListLakesResponse expectedResponse = + ListLakesResponse.newBuilder() + .setNextPageToken("") + .addAllLakes(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListLakesPagedResponse pagedListResponse = client.listLakes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLakesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLakesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listLakes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLakeTest() throws Exception { + Lake expectedResponse = + Lake.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setServiceAccount("serviceAccount1079137720") + .setMetastore(Lake.Metastore.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .setMetastoreStatus(Lake.MetastoreStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LakeName name = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + + Lake actualResponse = client.getLake(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLakeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LakeName name = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + client.getLake(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLakeTest2() throws Exception { + Lake expectedResponse = + Lake.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setServiceAccount("serviceAccount1079137720") + .setMetastore(Lake.Metastore.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .setMetastoreStatus(Lake.MetastoreStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-2822/locations/location-2822/lakes/lake-2822"; + + Lake actualResponse = client.getLake(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLakeExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2822/locations/location-2822/lakes/lake-2822"; + client.getLake(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLakeActionsTest() throws Exception { + Action responsesElement = Action.newBuilder().build(); + ListActionsResponse expectedResponse = + ListActionsResponse.newBuilder() + .setNextPageToken("") + .addAllActions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + + ListLakeActionsPagedResponse pagedListResponse = client.listLakeActions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getActionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLakeActionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + client.listLakeActions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLakeActionsTest2() throws Exception { + Action responsesElement = Action.newBuilder().build(); + ListActionsResponse expectedResponse = + ListActionsResponse.newBuilder() + .setNextPageToken("") + .addAllActions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + + ListLakeActionsPagedResponse pagedListResponse = client.listLakeActions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getActionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLakeActionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + client.listLakeActions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createZoneTest() throws Exception { + Zone expectedResponse = + Zone.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setDiscoverySpec(Zone.DiscoverySpec.newBuilder().build()) + .setResourceSpec(Zone.ResourceSpec.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createZoneTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Zone zone = Zone.newBuilder().build(); + String zoneId = "zoneId-696323609"; + + Zone actualResponse = client.createZoneAsync(parent, zone, zoneId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createZoneExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Zone zone = Zone.newBuilder().build(); + String zoneId = "zoneId-696323609"; + client.createZoneAsync(parent, zone, zoneId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createZoneTest2() throws Exception { + Zone expectedResponse = + Zone.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setDiscoverySpec(Zone.DiscoverySpec.newBuilder().build()) + .setResourceSpec(Zone.ResourceSpec.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createZoneTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + Zone zone = Zone.newBuilder().build(); + String zoneId = "zoneId-696323609"; + + Zone actualResponse = client.createZoneAsync(parent, zone, zoneId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createZoneExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + Zone zone = Zone.newBuilder().build(); + String zoneId = "zoneId-696323609"; + client.createZoneAsync(parent, zone, zoneId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateZoneTest() throws Exception { + Zone expectedResponse = + Zone.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setDiscoverySpec(Zone.DiscoverySpec.newBuilder().build()) + .setResourceSpec(Zone.ResourceSpec.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateZoneTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Zone zone = + Zone.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setDiscoverySpec(Zone.DiscoverySpec.newBuilder().build()) + .setResourceSpec(Zone.ResourceSpec.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Zone actualResponse = client.updateZoneAsync(zone, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateZoneExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Zone zone = + Zone.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setDiscoverySpec(Zone.DiscoverySpec.newBuilder().build()) + .setResourceSpec(Zone.ResourceSpec.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateZoneAsync(zone, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteZoneTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteZoneTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ZoneName name = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + + client.deleteZoneAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteZoneExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName name = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + client.deleteZoneAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteZoneTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteZoneTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-8147/locations/location-8147/lakes/lake-8147/zones/zone-8147"; + + client.deleteZoneAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteZoneExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8147/locations/location-8147/lakes/lake-8147/zones/zone-8147"; + client.deleteZoneAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listZonesTest() throws Exception { + Zone responsesElement = Zone.newBuilder().build(); + ListZonesResponse expectedResponse = + ListZonesResponse.newBuilder() + .setNextPageToken("") + .addAllZones(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + + ListZonesPagedResponse pagedListResponse = client.listZones(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getZonesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listZonesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + client.listZones(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listZonesTest2() throws Exception { + Zone responsesElement = Zone.newBuilder().build(); + ListZonesResponse expectedResponse = + ListZonesResponse.newBuilder() + .setNextPageToken("") + .addAllZones(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + + ListZonesPagedResponse pagedListResponse = client.listZones(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getZonesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listZonesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + client.listZones(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getZoneTest() throws Exception { + Zone expectedResponse = + Zone.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setDiscoverySpec(Zone.DiscoverySpec.newBuilder().build()) + .setResourceSpec(Zone.ResourceSpec.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName name = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + + Zone actualResponse = client.getZone(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getZoneExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName name = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + client.getZone(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getZoneTest2() throws Exception { + Zone expectedResponse = + Zone.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setDiscoverySpec(Zone.DiscoverySpec.newBuilder().build()) + .setResourceSpec(Zone.ResourceSpec.newBuilder().build()) + .setAssetStatus(AssetStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-8147/locations/location-8147/lakes/lake-8147/zones/zone-8147"; + + Zone actualResponse = client.getZone(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getZoneExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8147/locations/location-8147/lakes/lake-8147/zones/zone-8147"; + client.getZone(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listZoneActionsTest() throws Exception { + Action responsesElement = Action.newBuilder().build(); + ListActionsResponse expectedResponse = + ListActionsResponse.newBuilder() + .setNextPageToken("") + .addAllActions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + + ListZoneActionsPagedResponse pagedListResponse = client.listZoneActions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getActionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listZoneActionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + client.listZoneActions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listZoneActionsTest2() throws Exception { + Action responsesElement = Action.newBuilder().build(); + ListActionsResponse expectedResponse = + ListActionsResponse.newBuilder() + .setNextPageToken("") + .addAllActions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-4052/locations/location-4052/lakes/lake-4052/zones/zone-4052"; + + ListZoneActionsPagedResponse pagedListResponse = client.listZoneActions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getActionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listZoneActionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-4052/locations/location-4052/lakes/lake-4052/zones/zone-4052"; + client.listZoneActions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAssetTest() throws Exception { + Asset expectedResponse = + Asset.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setResourceSpec(Asset.ResourceSpec.newBuilder().build()) + .setResourceStatus(Asset.ResourceStatus.newBuilder().build()) + .setSecurityStatus(Asset.SecurityStatus.newBuilder().build()) + .setDiscoverySpec(Asset.DiscoverySpec.newBuilder().build()) + .setDiscoveryStatus(Asset.DiscoveryStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAssetTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + Asset asset = Asset.newBuilder().build(); + String assetId = "assetId-704776149"; + + Asset actualResponse = client.createAssetAsync(parent, asset, assetId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createAssetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + Asset asset = Asset.newBuilder().build(); + String assetId = "assetId-704776149"; + client.createAssetAsync(parent, asset, assetId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createAssetTest2() throws Exception { + Asset expectedResponse = + Asset.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setResourceSpec(Asset.ResourceSpec.newBuilder().build()) + .setResourceStatus(Asset.ResourceStatus.newBuilder().build()) + .setSecurityStatus(Asset.SecurityStatus.newBuilder().build()) + .setDiscoverySpec(Asset.DiscoverySpec.newBuilder().build()) + .setDiscoveryStatus(Asset.DiscoveryStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAssetTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-4052/locations/location-4052/lakes/lake-4052/zones/zone-4052"; + Asset asset = Asset.newBuilder().build(); + String assetId = "assetId-704776149"; + + Asset actualResponse = client.createAssetAsync(parent, asset, assetId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createAssetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-4052/locations/location-4052/lakes/lake-4052/zones/zone-4052"; + Asset asset = Asset.newBuilder().build(); + String assetId = "assetId-704776149"; + client.createAssetAsync(parent, asset, assetId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateAssetTest() throws Exception { + Asset expectedResponse = + Asset.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setResourceSpec(Asset.ResourceSpec.newBuilder().build()) + .setResourceStatus(Asset.ResourceStatus.newBuilder().build()) + .setSecurityStatus(Asset.SecurityStatus.newBuilder().build()) + .setDiscoverySpec(Asset.DiscoverySpec.newBuilder().build()) + .setDiscoveryStatus(Asset.DiscoveryStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateAssetTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Asset asset = + Asset.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setResourceSpec(Asset.ResourceSpec.newBuilder().build()) + .setResourceStatus(Asset.ResourceStatus.newBuilder().build()) + .setSecurityStatus(Asset.SecurityStatus.newBuilder().build()) + .setDiscoverySpec(Asset.DiscoverySpec.newBuilder().build()) + .setDiscoveryStatus(Asset.DiscoveryStatus.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Asset actualResponse = client.updateAssetAsync(asset, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateAssetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Asset asset = + Asset.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setResourceSpec(Asset.ResourceSpec.newBuilder().build()) + .setResourceStatus(Asset.ResourceStatus.newBuilder().build()) + .setSecurityStatus(Asset.SecurityStatus.newBuilder().build()) + .setDiscoverySpec(Asset.DiscoverySpec.newBuilder().build()) + .setDiscoveryStatus(Asset.DiscoveryStatus.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateAssetAsync(asset, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteAssetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteAssetTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + AssetName name = AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]"); + + client.deleteAssetAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteAssetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AssetName name = AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]"); + client.deleteAssetAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteAssetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteAssetTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-6864/locations/location-6864/lakes/lake-6864/zones/zone-6864/assets/asset-6864"; + + client.deleteAssetAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteAssetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6864/locations/location-6864/lakes/lake-6864/zones/zone-6864/assets/asset-6864"; + client.deleteAssetAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listAssetsTest() throws Exception { + Asset responsesElement = Asset.newBuilder().build(); + ListAssetsResponse expectedResponse = + ListAssetsResponse.newBuilder() + .setNextPageToken("") + .addAllAssets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + + ListAssetsPagedResponse pagedListResponse = client.listAssets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAssetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAssetsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + client.listAssets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAssetsTest2() throws Exception { + Asset responsesElement = Asset.newBuilder().build(); + ListAssetsResponse expectedResponse = + ListAssetsResponse.newBuilder() + .setNextPageToken("") + .addAllAssets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-4052/locations/location-4052/lakes/lake-4052/zones/zone-4052"; + + ListAssetsPagedResponse pagedListResponse = client.listAssets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAssetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAssetsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-4052/locations/location-4052/lakes/lake-4052/zones/zone-4052"; + client.listAssets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAssetTest() throws Exception { + Asset expectedResponse = + Asset.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setResourceSpec(Asset.ResourceSpec.newBuilder().build()) + .setResourceStatus(Asset.ResourceStatus.newBuilder().build()) + .setSecurityStatus(Asset.SecurityStatus.newBuilder().build()) + .setDiscoverySpec(Asset.DiscoverySpec.newBuilder().build()) + .setDiscoveryStatus(Asset.DiscoveryStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + AssetName name = AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]"); + + Asset actualResponse = client.getAsset(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getAssetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AssetName name = AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]"); + client.getAsset(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAssetTest2() throws Exception { + Asset expectedResponse = + Asset.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setResourceSpec(Asset.ResourceSpec.newBuilder().build()) + .setResourceStatus(Asset.ResourceStatus.newBuilder().build()) + .setSecurityStatus(Asset.SecurityStatus.newBuilder().build()) + .setDiscoverySpec(Asset.DiscoverySpec.newBuilder().build()) + .setDiscoveryStatus(Asset.DiscoveryStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6864/locations/location-6864/lakes/lake-6864/zones/zone-6864/assets/asset-6864"; + + Asset actualResponse = client.getAsset(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getAssetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6864/locations/location-6864/lakes/lake-6864/zones/zone-6864/assets/asset-6864"; + client.getAsset(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAssetActionsTest() throws Exception { + Action responsesElement = Action.newBuilder().build(); + ListActionsResponse expectedResponse = + ListActionsResponse.newBuilder() + .setNextPageToken("") + .addAllActions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + AssetName parent = AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]"); + + ListAssetActionsPagedResponse pagedListResponse = client.listAssetActions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getActionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAssetActionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AssetName parent = AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]"); + client.listAssetActions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAssetActionsTest2() throws Exception { + Action responsesElement = Action.newBuilder().build(); + ListActionsResponse expectedResponse = + ListActionsResponse.newBuilder() + .setNextPageToken("") + .addAllActions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-383/locations/location-383/lakes/lake-383/zones/zone-383/assets/asset-383"; + + ListAssetActionsPagedResponse pagedListResponse = client.listAssetActions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getActionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAssetActionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-383/locations/location-383/lakes/lake-383/zones/zone-383/assets/asset-383"; + client.listAssetActions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createTaskTest() throws Exception { + Task expectedResponse = + Task.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setDisplayName("displayName1714148973") + .setState(State.forNumber(0)) + .putAllLabels(new HashMap()) + .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) + .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createTaskTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Task task = Task.newBuilder().build(); + String taskId = "taskId-880873088"; + + Task actualResponse = client.createTaskAsync(parent, task, taskId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createTaskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Task task = Task.newBuilder().build(); + String taskId = "taskId-880873088"; + client.createTaskAsync(parent, task, taskId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createTaskTest2() throws Exception { + Task expectedResponse = + Task.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setDisplayName("displayName1714148973") + .setState(State.forNumber(0)) + .putAllLabels(new HashMap()) + .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) + .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createTaskTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + Task task = Task.newBuilder().build(); + String taskId = "taskId-880873088"; + + Task actualResponse = client.createTaskAsync(parent, task, taskId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createTaskExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + Task task = Task.newBuilder().build(); + String taskId = "taskId-880873088"; + client.createTaskAsync(parent, task, taskId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateTaskTest() throws Exception { + Task expectedResponse = + Task.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setDisplayName("displayName1714148973") + .setState(State.forNumber(0)) + .putAllLabels(new HashMap()) + .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) + .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateTaskTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Task task = + Task.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setDisplayName("displayName1714148973") + .setState(State.forNumber(0)) + .putAllLabels(new HashMap()) + .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) + .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Task actualResponse = client.updateTaskAsync(task, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateTaskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Task task = + Task.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setDisplayName("displayName1714148973") + .setState(State.forNumber(0)) + .putAllLabels(new HashMap()) + .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) + .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateTaskAsync(task, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteTaskTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteTaskTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]"); + + client.deleteTaskAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteTaskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]"); + client.deleteTaskAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteTaskTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteTaskTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-4700/locations/location-4700/lakes/lake-4700/tasks/task-4700"; + + client.deleteTaskAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteTaskExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4700/locations/location-4700/lakes/lake-4700/tasks/task-4700"; + client.deleteTaskAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listTasksTest() throws Exception { + Task responsesElement = Task.newBuilder().build(); + ListTasksResponse expectedResponse = + ListTasksResponse.newBuilder() + .setNextPageToken("") + .addAllTasks(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + + ListTasksPagedResponse pagedListResponse = client.listTasks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTasksList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listTasksExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + client.listTasks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTasksTest2() throws Exception { + Task responsesElement = Task.newBuilder().build(); + ListTasksResponse expectedResponse = + ListTasksResponse.newBuilder() + .setNextPageToken("") + .addAllTasks(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + + ListTasksPagedResponse pagedListResponse = client.listTasks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTasksList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listTasksExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + client.listTasks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTaskTest() throws Exception { + Task expectedResponse = + Task.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setDisplayName("displayName1714148973") + .setState(State.forNumber(0)) + .putAllLabels(new HashMap()) + .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) + .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]"); + + Task actualResponse = client.getTask(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getTaskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]"); + client.getTask(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTaskTest2() throws Exception { + Task expectedResponse = + Task.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setDisplayName("displayName1714148973") + .setState(State.forNumber(0)) + .putAllLabels(new HashMap()) + .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) + .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-4700/locations/location-4700/lakes/lake-4700/tasks/task-4700"; + + Task actualResponse = client.getTask(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getTaskExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4700/locations/location-4700/lakes/lake-4700/tasks/task-4700"; + client.getTask(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listJobsTest() throws Exception { + Job responsesElement = Job.newBuilder().build(); + ListJobsResponse expectedResponse = + ListJobsResponse.newBuilder() + .setNextPageToken("") + .addAllJobs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + TaskName parent = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]"); + + ListJobsPagedResponse pagedListResponse = client.listJobs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getJobsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listJobsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TaskName parent = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]"); + client.listJobs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listJobsTest2() throws Exception { + Job responsesElement = Job.newBuilder().build(); + ListJobsResponse expectedResponse = + ListJobsResponse.newBuilder() + .setNextPageToken("") + .addAllJobs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-6691/locations/location-6691/lakes/lake-6691/tasks/task-6691"; + + ListJobsPagedResponse pagedListResponse = client.listJobs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getJobsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listJobsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-6691/locations/location-6691/lakes/lake-6691/tasks/task-6691"; + client.listJobs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getJobTest() throws Exception { + Job expectedResponse = + Job.newBuilder() + .setName(JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]").toString()) + .setUid("uid115792") + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setRetryCount(-928040776) + .setServiceJob("serviceJob-1724783416") + .setMessage("message954925063") + .build(); + mockService.addResponse(expectedResponse); + + JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]"); + + Job actualResponse = client.getJob(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getJobExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]"); + client.getJob(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getJobTest2() throws Exception { + Job expectedResponse = + Job.newBuilder() + .setName(JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]").toString()) + .setUid("uid115792") + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setRetryCount(-928040776) + .setServiceJob("serviceJob-1724783416") + .setMessage("message954925063") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-4548/locations/location-4548/lakes/lake-4548/tasks/task-4548/jobs/job-4548"; + + Job actualResponse = client.getJob(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getJobExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-4548/locations/location-4548/lakes/lake-4548/tasks/task-4548/jobs/job-4548"; + client.getJob(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cancelJobTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]"); + + client.cancelJob(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void cancelJobExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]"); + client.cancelJob(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cancelJobTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-4548/locations/location-4548/lakes/lake-4548/tasks/task-4548/jobs/job-4548"; + + client.cancelJob(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void cancelJobExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-4548/locations/location-4548/lakes/lake-4548/tasks/task-4548/jobs/job-4548"; + client.cancelJob(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createEnvironmentTest() throws Exception { + Environment expectedResponse = + Environment.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setInfrastructureSpec(Environment.InfrastructureSpec.newBuilder().build()) + .setSessionSpec(Environment.SessionSpec.newBuilder().build()) + .setSessionStatus(Environment.SessionStatus.newBuilder().build()) + .setEndpoints(Environment.Endpoints.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEnvironmentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Environment environment = Environment.newBuilder().build(); + String environmentId = "environmentId-950205810"; + + Environment actualResponse = + client.createEnvironmentAsync(parent, environment, environmentId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createEnvironmentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Environment environment = Environment.newBuilder().build(); + String environmentId = "environmentId-950205810"; + client.createEnvironmentAsync(parent, environment, environmentId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createEnvironmentTest2() throws Exception { + Environment expectedResponse = + Environment.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setInfrastructureSpec(Environment.InfrastructureSpec.newBuilder().build()) + .setSessionSpec(Environment.SessionSpec.newBuilder().build()) + .setSessionStatus(Environment.SessionStatus.newBuilder().build()) + .setEndpoints(Environment.Endpoints.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEnvironmentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + Environment environment = Environment.newBuilder().build(); + String environmentId = "environmentId-950205810"; + + Environment actualResponse = + client.createEnvironmentAsync(parent, environment, environmentId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createEnvironmentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + Environment environment = Environment.newBuilder().build(); + String environmentId = "environmentId-950205810"; + client.createEnvironmentAsync(parent, environment, environmentId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateEnvironmentTest() throws Exception { + Environment expectedResponse = + Environment.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setInfrastructureSpec(Environment.InfrastructureSpec.newBuilder().build()) + .setSessionSpec(Environment.SessionSpec.newBuilder().build()) + .setSessionStatus(Environment.SessionStatus.newBuilder().build()) + .setEndpoints(Environment.Endpoints.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateEnvironmentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Environment environment = + Environment.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setInfrastructureSpec(Environment.InfrastructureSpec.newBuilder().build()) + .setSessionSpec(Environment.SessionSpec.newBuilder().build()) + .setSessionStatus(Environment.SessionStatus.newBuilder().build()) + .setEndpoints(Environment.Endpoints.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Environment actualResponse = client.updateEnvironmentAsync(environment, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateEnvironmentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Environment environment = + Environment.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setInfrastructureSpec(Environment.InfrastructureSpec.newBuilder().build()) + .setSessionSpec(Environment.SessionSpec.newBuilder().build()) + .setSessionStatus(Environment.SessionStatus.newBuilder().build()) + .setEndpoints(Environment.Endpoints.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateEnvironmentAsync(environment, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteEnvironmentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteEnvironmentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]"); + + client.deleteEnvironmentAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteEnvironmentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]"); + client.deleteEnvironmentAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteEnvironmentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteEnvironmentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-6992/locations/location-6992/lakes/lake-6992/environments/environment-6992"; + + client.deleteEnvironmentAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteEnvironmentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6992/locations/location-6992/lakes/lake-6992/environments/environment-6992"; + client.deleteEnvironmentAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listEnvironmentsTest() throws Exception { + Environment responsesElement = Environment.newBuilder().build(); + ListEnvironmentsResponse expectedResponse = + ListEnvironmentsResponse.newBuilder() + .setNextPageToken("") + .addAllEnvironments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + + ListEnvironmentsPagedResponse pagedListResponse = client.listEnvironments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listEnvironmentsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + client.listEnvironments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEnvironmentsTest2() throws Exception { + Environment responsesElement = Environment.newBuilder().build(); + ListEnvironmentsResponse expectedResponse = + ListEnvironmentsResponse.newBuilder() + .setNextPageToken("") + .addAllEnvironments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + + ListEnvironmentsPagedResponse pagedListResponse = client.listEnvironments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listEnvironmentsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-8905/locations/location-8905/lakes/lake-8905"; + client.listEnvironments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEnvironmentTest() throws Exception { + Environment expectedResponse = + Environment.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setInfrastructureSpec(Environment.InfrastructureSpec.newBuilder().build()) + .setSessionSpec(Environment.SessionSpec.newBuilder().build()) + .setSessionStatus(Environment.SessionStatus.newBuilder().build()) + .setEndpoints(Environment.Endpoints.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]"); + + Environment actualResponse = client.getEnvironment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEnvironmentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]"); + client.getEnvironment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEnvironmentTest2() throws Exception { + Environment expectedResponse = + Environment.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(State.forNumber(0)) + .setInfrastructureSpec(Environment.InfrastructureSpec.newBuilder().build()) + .setSessionSpec(Environment.SessionSpec.newBuilder().build()) + .setSessionStatus(Environment.SessionStatus.newBuilder().build()) + .setEndpoints(Environment.Endpoints.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6992/locations/location-6992/lakes/lake-6992/environments/environment-6992"; + + Environment actualResponse = client.getEnvironment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEnvironmentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6992/locations/location-6992/lakes/lake-6992/environments/environment-6992"; + client.getEnvironment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + EnvironmentName parent = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]"); + + ListSessionsPagedResponse pagedListResponse = client.listSessions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSessionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnvironmentName parent = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]"); + client.listSessions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest2() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-353/locations/location-353/lakes/lake-353/environments/environment-353"; + + ListSessionsPagedResponse pagedListResponse = client.listSessions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSessionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-353/locations/location-353/lakes/lake-353/environments/environment-353"; + client.listSessions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/DataplexServiceClientTest.java b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/DataplexServiceClientTest.java index 3d5b932..15f85eb 100644 --- a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/DataplexServiceClientTest.java +++ b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/DataplexServiceClientTest.java @@ -22,6 +22,7 @@ import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListJobsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakeActionsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLakesPagedResponse; +import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListLocationsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListSessionsPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListTasksPagedResponse; import static com.google.cloud.dataplex.v1.DataplexServiceClient.ListZoneActionsPagedResponse; @@ -35,6 +36,10 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +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.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; @@ -60,6 +65,8 @@ @Generated("by gapic-generator-java") public class DataplexServiceClientTest { private static MockDataplexService mockDataplexService; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; private DataplexServiceClient client; @@ -67,9 +74,12 @@ public class DataplexServiceClientTest { @BeforeClass public static void startStaticServer() { mockDataplexService = new MockDataplexService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockDataplexService)); + UUID.randomUUID().toString(), + Arrays.asList(mockDataplexService, mockLocations, mockIAMPolicy)); mockServiceHelper.start(); } @@ -1746,6 +1756,7 @@ public void createTaskTest() throws Exception { .putAllLabels(new HashMap()) .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1807,6 +1818,7 @@ public void createTaskTest2() throws Exception { .putAllLabels(new HashMap()) .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1868,6 +1880,7 @@ public void updateTaskTest() throws Exception { .putAllLabels(new HashMap()) .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -2098,6 +2111,7 @@ public void getTaskTest() throws Exception { .putAllLabels(new HashMap()) .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) .build(); mockDataplexService.addResponse(expectedResponse); @@ -2145,6 +2159,7 @@ public void getTaskTest2() throws Exception { .putAllLabels(new HashMap()) .setTriggerSpec(Task.TriggerSpec.newBuilder().build()) .setExecutionSpec(Task.ExecutionSpec.newBuilder().build()) + .setExecutionStatus(Task.ExecutionStatus.newBuilder().build()) .build(); mockDataplexService.addResponse(expectedResponse); @@ -2976,4 +2991,105 @@ public void listSessionsExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MetadataServiceClientHttpJsonTest.java b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MetadataServiceClientHttpJsonTest.java new file mode 100644 index 0000000..c645637 --- /dev/null +++ b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MetadataServiceClientHttpJsonTest.java @@ -0,0 +1,1133 @@ +/* + * Copyright 2022 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 static com.google.cloud.dataplex.v1.MetadataServiceClient.ListEntitiesPagedResponse; +import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListPartitionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.dataplex.v1.stub.HttpJsonMetadataServiceStub; +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.collect.Lists; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class MetadataServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static MetadataServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonMetadataServiceStub.getMethodDescriptors(), + MetadataServiceSettings.getDefaultEndpoint()); + MetadataServiceSettings settings = + MetadataServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + MetadataServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MetadataServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createEntityTest() throws Exception { + Entity expectedResponse = + Entity.newBuilder() + .setName( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setId("id3355") + .setEtag("etag3123477") + .setAsset("asset93121264") + .setDataPath("dataPath1788928751") + .setDataPathPattern("dataPathPattern1514620321") + .setCatalogEntry("catalogEntry-1171922983") + .setSystem(StorageSystem.forNumber(0)) + .setFormat(StorageFormat.newBuilder().build()) + .setCompatibility(Entity.CompatibilityStatus.newBuilder().build()) + .setSchema(Schema.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + Entity entity = Entity.newBuilder().build(); + + Entity actualResponse = client.createEntity(parent, entity); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createEntityExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + Entity entity = Entity.newBuilder().build(); + client.createEntity(parent, entity); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createEntityTest2() throws Exception { + Entity expectedResponse = + Entity.newBuilder() + .setName( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setId("id3355") + .setEtag("etag3123477") + .setAsset("asset93121264") + .setDataPath("dataPath1788928751") + .setDataPathPattern("dataPathPattern1514620321") + .setCatalogEntry("catalogEntry-1171922983") + .setSystem(StorageSystem.forNumber(0)) + .setFormat(StorageFormat.newBuilder().build()) + .setCompatibility(Entity.CompatibilityStatus.newBuilder().build()) + .setSchema(Schema.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-4052/locations/location-4052/lakes/lake-4052/zones/zone-4052"; + Entity entity = Entity.newBuilder().build(); + + Entity actualResponse = client.createEntity(parent, entity); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createEntityExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-4052/locations/location-4052/lakes/lake-4052/zones/zone-4052"; + Entity entity = Entity.newBuilder().build(); + client.createEntity(parent, entity); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateEntityTest() throws Exception { + Entity expectedResponse = + Entity.newBuilder() + .setName( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setId("id3355") + .setEtag("etag3123477") + .setAsset("asset93121264") + .setDataPath("dataPath1788928751") + .setDataPathPattern("dataPathPattern1514620321") + .setCatalogEntry("catalogEntry-1171922983") + .setSystem(StorageSystem.forNumber(0)) + .setFormat(StorageFormat.newBuilder().build()) + .setCompatibility(Entity.CompatibilityStatus.newBuilder().build()) + .setSchema(Schema.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UpdateEntityRequest request = + UpdateEntityRequest.newBuilder() + .setEntity( + Entity.newBuilder() + .setName( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setId("id3355") + .setEtag("etag3123477") + .setAsset("asset93121264") + .setDataPath("dataPath1788928751") + .setDataPathPattern("dataPathPattern1514620321") + .setCatalogEntry("catalogEntry-1171922983") + .setSystem(StorageSystem.forNumber(0)) + .setFormat(StorageFormat.newBuilder().build()) + .setCompatibility(Entity.CompatibilityStatus.newBuilder().build()) + .setSchema(Schema.newBuilder().build()) + .build()) + .setValidateOnly(true) + .build(); + + Entity actualResponse = client.updateEntity(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateEntityExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateEntityRequest request = + UpdateEntityRequest.newBuilder() + .setEntity( + Entity.newBuilder() + .setName( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setId("id3355") + .setEtag("etag3123477") + .setAsset("asset93121264") + .setDataPath("dataPath1788928751") + .setDataPathPattern("dataPathPattern1514620321") + .setCatalogEntry("catalogEntry-1171922983") + .setSystem(StorageSystem.forNumber(0)) + .setFormat(StorageFormat.newBuilder().build()) + .setCompatibility(Entity.CompatibilityStatus.newBuilder().build()) + .setSchema(Schema.newBuilder().build()) + .build()) + .setValidateOnly(true) + .build(); + client.updateEntity(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteEntityTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + EntityName name = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + + client.deleteEntity(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteEntityExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EntityName name = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + client.deleteEntity(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteEntityTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-7294/locations/location-7294/lakes/lake-7294/zones/zone-7294/entities/entitie-7294"; + + client.deleteEntity(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteEntityExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7294/locations/location-7294/lakes/lake-7294/zones/zone-7294/entities/entitie-7294"; + client.deleteEntity(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEntityTest() throws Exception { + Entity expectedResponse = + Entity.newBuilder() + .setName( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setId("id3355") + .setEtag("etag3123477") + .setAsset("asset93121264") + .setDataPath("dataPath1788928751") + .setDataPathPattern("dataPathPattern1514620321") + .setCatalogEntry("catalogEntry-1171922983") + .setSystem(StorageSystem.forNumber(0)) + .setFormat(StorageFormat.newBuilder().build()) + .setCompatibility(Entity.CompatibilityStatus.newBuilder().build()) + .setSchema(Schema.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + EntityName name = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + + Entity actualResponse = client.getEntity(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEntityExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EntityName name = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + client.getEntity(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEntityTest2() throws Exception { + Entity expectedResponse = + Entity.newBuilder() + .setName( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setId("id3355") + .setEtag("etag3123477") + .setAsset("asset93121264") + .setDataPath("dataPath1788928751") + .setDataPathPattern("dataPathPattern1514620321") + .setCatalogEntry("catalogEntry-1171922983") + .setSystem(StorageSystem.forNumber(0)) + .setFormat(StorageFormat.newBuilder().build()) + .setCompatibility(Entity.CompatibilityStatus.newBuilder().build()) + .setSchema(Schema.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-7294/locations/location-7294/lakes/lake-7294/zones/zone-7294/entities/entitie-7294"; + + Entity actualResponse = client.getEntity(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEntityExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7294/locations/location-7294/lakes/lake-7294/zones/zone-7294/entities/entitie-7294"; + client.getEntity(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEntitiesTest() throws Exception { + Entity responsesElement = Entity.newBuilder().build(); + ListEntitiesResponse expectedResponse = + ListEntitiesResponse.newBuilder() + .setNextPageToken("") + .addAllEntities(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + + ListEntitiesPagedResponse pagedListResponse = client.listEntities(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEntitiesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listEntitiesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + client.listEntities(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEntitiesTest2() throws Exception { + Entity responsesElement = Entity.newBuilder().build(); + ListEntitiesResponse expectedResponse = + ListEntitiesResponse.newBuilder() + .setNextPageToken("") + .addAllEntities(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-4052/locations/location-4052/lakes/lake-4052/zones/zone-4052"; + + ListEntitiesPagedResponse pagedListResponse = client.listEntities(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEntitiesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listEntitiesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-4052/locations/location-4052/lakes/lake-4052/zones/zone-4052"; + client.listEntities(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPartitionTest() throws Exception { + Partition expectedResponse = + Partition.newBuilder() + .setName( + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]") + .toString()) + .addAllValues(new ArrayList()) + .setLocation("location1901043637") + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + EntityName parent = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + Partition partition = Partition.newBuilder().build(); + + Partition actualResponse = client.createPartition(parent, partition); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createPartitionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EntityName parent = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + Partition partition = Partition.newBuilder().build(); + client.createPartition(parent, partition); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPartitionTest2() throws Exception { + Partition expectedResponse = + Partition.newBuilder() + .setName( + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]") + .toString()) + .addAllValues(new ArrayList()) + .setLocation("location1901043637") + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-9473/locations/location-9473/lakes/lake-9473/zones/zone-9473/entities/entitie-9473"; + Partition partition = Partition.newBuilder().build(); + + Partition actualResponse = client.createPartition(parent, partition); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createPartitionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-9473/locations/location-9473/lakes/lake-9473/zones/zone-9473/entities/entitie-9473"; + Partition partition = Partition.newBuilder().build(); + client.createPartition(parent, partition); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePartitionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + PartitionName name = + PartitionName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]"); + + client.deletePartition(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deletePartitionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PartitionName name = + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]"); + client.deletePartition(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePartitionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6283/locations/location-6283/lakes/lake-6283/zones/zone-6283/entities/entitie-6283/partitions/partition-6283"; + + client.deletePartition(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deletePartitionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6283/locations/location-6283/lakes/lake-6283/zones/zone-6283/entities/entitie-6283/partitions/partition-6283"; + client.deletePartition(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartitionTest() throws Exception { + Partition expectedResponse = + Partition.newBuilder() + .setName( + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]") + .toString()) + .addAllValues(new ArrayList()) + .setLocation("location1901043637") + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + PartitionName name = + PartitionName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]"); + + Partition actualResponse = client.getPartition(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getPartitionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PartitionName name = + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]"); + client.getPartition(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartitionTest2() throws Exception { + Partition expectedResponse = + Partition.newBuilder() + .setName( + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]") + .toString()) + .addAllValues(new ArrayList()) + .setLocation("location1901043637") + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6283/locations/location-6283/lakes/lake-6283/zones/zone-6283/entities/entitie-6283/partitions/partition-6283"; + + Partition actualResponse = client.getPartition(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getPartitionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6283/locations/location-6283/lakes/lake-6283/zones/zone-6283/entities/entitie-6283/partitions/partition-6283"; + client.getPartition(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPartitionsTest() throws Exception { + Partition responsesElement = Partition.newBuilder().build(); + ListPartitionsResponse expectedResponse = + ListPartitionsResponse.newBuilder() + .setNextPageToken("") + .addAllPartitions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + EntityName parent = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + + ListPartitionsPagedResponse pagedListResponse = client.listPartitions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPartitionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listPartitionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EntityName parent = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + client.listPartitions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPartitionsTest2() throws Exception { + Partition responsesElement = Partition.newBuilder().build(); + ListPartitionsResponse expectedResponse = + ListPartitionsResponse.newBuilder() + .setNextPageToken("") + .addAllPartitions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-9473/locations/location-9473/lakes/lake-9473/zones/zone-9473/entities/entitie-9473"; + + ListPartitionsPagedResponse pagedListResponse = client.listPartitions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPartitionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listPartitionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-9473/locations/location-9473/lakes/lake-9473/zones/zone-9473/entities/entitie-9473"; + client.listPartitions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MetadataServiceClientTest.java b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MetadataServiceClientTest.java index ad2c92c..348687b 100644 --- a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MetadataServiceClientTest.java +++ b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MetadataServiceClientTest.java @@ -17,6 +17,7 @@ package com.google.cloud.dataplex.v1; import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListEntitiesPagedResponse; +import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListLocationsPagedResponse; import static com.google.cloud.dataplex.v1.MetadataServiceClient.ListPartitionsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -26,14 +27,20 @@ import com.google.api.gax.grpc.testing.MockServiceHelper; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; +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.collect.Lists; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; import com.google.protobuf.Empty; import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.UUID; import javax.annotation.Generated; @@ -46,6 +53,8 @@ @Generated("by gapic-generator-java") public class MetadataServiceClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; private static MockMetadataService mockMetadataService; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; @@ -54,9 +63,12 @@ public class MetadataServiceClientTest { @BeforeClass public static void startStaticServer() { mockMetadataService = new MockMetadataService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockMetadataService)); + UUID.randomUUID().toString(), + Arrays.asList(mockMetadataService, mockLocations, mockIAMPolicy)); mockServiceHelper.start(); } @@ -861,4 +873,105 @@ public void listPartitionsExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockContentServiceImpl.java b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockContentServiceImpl.java index 9355247..70c664a 100644 --- a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockContentServiceImpl.java +++ b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockContentServiceImpl.java @@ -18,6 +18,11 @@ import com.google.api.core.BetaApi; import com.google.cloud.dataplex.v1.ContentServiceGrpc.ContentServiceImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import io.grpc.stub.StreamObserver; @@ -141,6 +146,68 @@ public void getContent(GetContentRequest request, StreamObserver respon } } + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + @Override public void listContent( ListContentRequest request, StreamObserver responseObserver) { diff --git a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockIAMPolicy.java b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockIAMPolicy.java new file mode 100644 index 0000000..2fe7443 --- /dev/null +++ b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockIAMPolicyImpl.java b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockIAMPolicyImpl.java new file mode 100644 index 0000000..6802d7a --- /dev/null +++ b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2022 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.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockLocations.java b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockLocations.java new file mode 100644 index 0000000..4d912a5 --- /dev/null +++ b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockLocationsImpl.java b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockLocationsImpl.java new file mode 100644 index 0000000..aa559c5 --- /dev/null +++ b/google-cloud-dataplex/src/test/java/com/google/cloud/dataplex/v1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 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.BetaApi; +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.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-dataplex-v1/pom.xml b/grpc-google-cloud-dataplex-v1/pom.xml index eeca7b6..d2b72b5 100644 --- a/grpc-google-cloud-dataplex-v1/pom.xml +++ b/grpc-google-cloud-dataplex-v1/pom.xml @@ -37,6 +37,10 @@ com.google.api.grpc proto-google-cloud-dataplex-v1 + + com.google.api.grpc + proto-google-iam-v1 + com.google.guava guava @@ -66,4 +70,4 @@ - \ No newline at end of file + diff --git a/grpc-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ContentServiceGrpc.java b/grpc-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ContentServiceGrpc.java index 1fd1568..bba6a18 100644 --- a/grpc-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ContentServiceGrpc.java +++ b/grpc-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ContentServiceGrpc.java @@ -205,6 +205,128 @@ private ContentServiceGrpc() {} return getGetContentMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = ContentServiceGrpc.getGetIamPolicyMethod) == null) { + synchronized (ContentServiceGrpc.class) { + if ((getGetIamPolicyMethod = ContentServiceGrpc.getGetIamPolicyMethod) == null) { + ContentServiceGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new ContentServiceMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = ContentServiceGrpc.getSetIamPolicyMethod) == null) { + synchronized (ContentServiceGrpc.class) { + if ((getSetIamPolicyMethod = ContentServiceGrpc.getSetIamPolicyMethod) == null) { + ContentServiceGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new ContentServiceMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = ContentServiceGrpc.getTestIamPermissionsMethod) == null) { + synchronized (ContentServiceGrpc.class) { + if ((getTestIamPermissionsMethod = ContentServiceGrpc.getTestIamPermissionsMethod) + == null) { + ContentServiceGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ContentServiceMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.dataplex.v1.ListContentRequest, com.google.cloud.dataplex.v1.ListContentResponse> @@ -356,6 +478,63 @@ public void getContent( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetContentMethod(), responseObserver); } + /** + * + * + *
      +     * Gets the access control policy for a contentitem resource. A `NOT_FOUND`
      +     * error is returned if the resource does not exist. An empty policy is
      +     * returned if the resource exists but does not have a policy set on it.
      +     * Caller must have Google IAM `dataplex.content.getIamPolicy` permission
      +     * on the resource.
      +     * 
      + */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
      +     * Sets the access control policy on the specified contentitem resource.
      +     * Replaces any existing policy.
      +     * Caller must have Google IAM `dataplex.content.setIamPolicy` permission
      +     * on the resource.
      +     * 
      + */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
      +     * Returns the caller's permissions on a resource.
      +     * If the resource does not exist, an empty set of
      +     * permissions is returned (a `NOT_FOUND` error is not returned).
      +     * A caller is not required to have Google IAM permission to make this
      +     * request.
      +     * Note: This operation is designed to be used for building permission-aware
      +     * UIs and command-line tools, not for authorization checking. This operation
      +     * may "fail open" without warning.
      +     * 
      + */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTestIamPermissionsMethod(), responseObserver); + } + /** * * @@ -398,6 +577,25 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.dataplex.v1.GetContentRequest, com.google.cloud.dataplex.v1.Content>(this, METHODID_GET_CONTENT))) + .addMethod( + getGetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getSetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) .addMethod( getListContentMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -489,6 +687,69 @@ public void getContent( getChannel().newCall(getGetContentMethod(), getCallOptions()), request, responseObserver); } + /** + * + * + *
      +     * Gets the access control policy for a contentitem resource. A `NOT_FOUND`
      +     * error is returned if the resource does not exist. An empty policy is
      +     * returned if the resource exists but does not have a policy set on it.
      +     * Caller must have Google IAM `dataplex.content.getIamPolicy` permission
      +     * on the resource.
      +     * 
      + */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
      +     * Sets the access control policy on the specified contentitem resource.
      +     * Replaces any existing policy.
      +     * Caller must have Google IAM `dataplex.content.setIamPolicy` permission
      +     * on the resource.
      +     * 
      + */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
      +     * Returns the caller's permissions on a resource.
      +     * If the resource does not exist, an empty set of
      +     * permissions is returned (a `NOT_FOUND` error is not returned).
      +     * A caller is not required to have Google IAM permission to make this
      +     * request.
      +     * Note: This operation is designed to be used for building permission-aware
      +     * UIs and command-line tools, not for authorization checking. This operation
      +     * may "fail open" without warning.
      +     * 
      + */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -578,6 +839,57 @@ public com.google.cloud.dataplex.v1.Content getContent( getChannel(), getGetContentMethod(), getCallOptions(), request); } + /** + * + * + *
      +     * Gets the access control policy for a contentitem resource. A `NOT_FOUND`
      +     * error is returned if the resource does not exist. An empty policy is
      +     * returned if the resource exists but does not have a policy set on it.
      +     * Caller must have Google IAM `dataplex.content.getIamPolicy` permission
      +     * on the resource.
      +     * 
      + */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
      +     * Sets the access control policy on the specified contentitem resource.
      +     * Replaces any existing policy.
      +     * Caller must have Google IAM `dataplex.content.setIamPolicy` permission
      +     * on the resource.
      +     * 
      + */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
      +     * Returns the caller's permissions on a resource.
      +     * If the resource does not exist, an empty set of
      +     * permissions is returned (a `NOT_FOUND` error is not returned).
      +     * A caller is not required to have Google IAM permission to make this
      +     * request.
      +     * Note: This operation is designed to be used for building permission-aware
      +     * UIs and command-line tools, not for authorization checking. This operation
      +     * may "fail open" without warning.
      +     * 
      + */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + /** * * @@ -663,6 +975,60 @@ protected ContentServiceFutureStub build( getChannel().newCall(getGetContentMethod(), getCallOptions()), request); } + /** + * + * + *
      +     * Gets the access control policy for a contentitem resource. A `NOT_FOUND`
      +     * error is returned if the resource does not exist. An empty policy is
      +     * returned if the resource exists but does not have a policy set on it.
      +     * Caller must have Google IAM `dataplex.content.getIamPolicy` permission
      +     * on the resource.
      +     * 
      + */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
      +     * Sets the access control policy on the specified contentitem resource.
      +     * Replaces any existing policy.
      +     * Caller must have Google IAM `dataplex.content.setIamPolicy` permission
      +     * on the resource.
      +     * 
      + */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
      +     * Returns the caller's permissions on a resource.
      +     * If the resource does not exist, an empty set of
      +     * permissions is returned (a `NOT_FOUND` error is not returned).
      +     * A caller is not required to have Google IAM permission to make this
      +     * request.
      +     * Note: This operation is designed to be used for building permission-aware
      +     * UIs and command-line tools, not for authorization checking. This operation
      +     * may "fail open" without warning.
      +     * 
      + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + /** * * @@ -682,7 +1048,10 @@ protected ContentServiceFutureStub build( private static final int METHODID_UPDATE_CONTENT = 1; private static final int METHODID_DELETE_CONTENT = 2; private static final int METHODID_GET_CONTENT = 3; - private static final int METHODID_LIST_CONTENT = 4; + private static final int METHODID_GET_IAM_POLICY = 4; + private static final int METHODID_SET_IAM_POLICY = 5; + private static final int METHODID_TEST_IAM_PERMISSIONS = 6; + private static final int METHODID_LIST_CONTENT = 7; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -721,6 +1090,22 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.dataplex.v1.GetContentRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; case METHODID_LIST_CONTENT: serviceImpl.listContent( (com.google.cloud.dataplex.v1.ListContentRequest) request, @@ -795,6 +1180,9 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getUpdateContentMethod()) .addMethod(getDeleteContentMethod()) .addMethod(getGetContentMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) .addMethod(getListContentMethod()) .build(); } diff --git a/grpc-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceGrpc.java b/grpc-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceGrpc.java index e17f3bf..2f4dc8a 100644 --- a/grpc-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceGrpc.java +++ b/grpc-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DataplexServiceGrpc.java @@ -23,9 +23,9 @@ *
        * Dataplex service provides data lakes as a service. The primary resources
        * offered by this service are Lakes, Zones and Assets which collectively allow
      - * a data adminstrator to organize, manage, secure and catalog data across their
      - * organization located across cloud projects in a variety of storage systems
      - * including Cloud Storage and BigQuery.
      + * a data administrator to organize, manage, secure and catalog data across
      + * their organization located across cloud projects in a variety of storage
      + * systems including Cloud Storage and BigQuery.
        * 
      */ @javax.annotation.Generated( @@ -1466,9 +1466,9 @@ public DataplexServiceFutureStub newStub( *
          * Dataplex service provides data lakes as a service. The primary resources
          * offered by this service are Lakes, Zones and Assets which collectively allow
      -   * a data adminstrator to organize, manage, secure and catalog data across their
      -   * organization located across cloud projects in a variety of storage systems
      -   * including Cloud Storage and BigQuery.
      +   * a data administrator to organize, manage, secure and catalog data across
      +   * their organization located across cloud projects in a variety of storage
      +   * systems including Cloud Storage and BigQuery.
          * 
      */ public abstract static class DataplexServiceImplBase implements io.grpc.BindableService { @@ -2125,9 +2125,9 @@ public final io.grpc.ServerServiceDefinition bindService() { *
          * Dataplex service provides data lakes as a service. The primary resources
          * offered by this service are Lakes, Zones and Assets which collectively allow
      -   * a data adminstrator to organize, manage, secure and catalog data across their
      -   * organization located across cloud projects in a variety of storage systems
      -   * including Cloud Storage and BigQuery.
      +   * a data administrator to organize, manage, secure and catalog data across
      +   * their organization located across cloud projects in a variety of storage
      +   * systems including Cloud Storage and BigQuery.
          * 
      */ public static final class DataplexServiceStub @@ -2634,9 +2634,9 @@ public void listSessions( *
          * Dataplex service provides data lakes as a service. The primary resources
          * offered by this service are Lakes, Zones and Assets which collectively allow
      -   * a data adminstrator to organize, manage, secure and catalog data across their
      -   * organization located across cloud projects in a variety of storage systems
      -   * including Cloud Storage and BigQuery.
      +   * a data administrator to organize, manage, secure and catalog data across
      +   * their organization located across cloud projects in a variety of storage
      +   * systems including Cloud Storage and BigQuery.
          * 
      */ public static final class DataplexServiceBlockingStub @@ -3078,9 +3078,9 @@ public com.google.cloud.dataplex.v1.ListSessionsResponse listSessions( *
          * Dataplex service provides data lakes as a service. The primary resources
          * offered by this service are Lakes, Zones and Assets which collectively allow
      -   * a data adminstrator to organize, manage, secure and catalog data across their
      -   * organization located across cloud projects in a variety of storage systems
      -   * including Cloud Storage and BigQuery.
      +   * a data administrator to organize, manage, secure and catalog data across
      +   * their organization located across cloud projects in a variety of storage
      +   * systems including Cloud Storage and BigQuery.
          * 
      */ public static final class DataplexServiceFutureStub diff --git a/proto-google-cloud-dataplex-v1/pom.xml b/proto-google-cloud-dataplex-v1/pom.xml index d87b402..4fa8dd2 100644 --- a/proto-google-cloud-dataplex-v1/pom.xml +++ b/proto-google-cloud-dataplex-v1/pom.xml @@ -21,6 +21,10 @@ com.google.api.grpc proto-google-common-protos
      + + com.google.api.grpc + proto-google-iam-v1 + com.google.api api-common diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ContentProto.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ContentProto.java index b523214..f20cbf7 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ContentProto.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ContentProto.java @@ -65,59 +65,87 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "nnotations.proto\032\027google/api/client.prot" + "o\032\037google/api/field_behavior.proto\032\031goog" + "le/api/resource.proto\032&google/cloud/data" - + "plex/v1/analyze.proto\032\033google/protobuf/e" - + "mpty.proto\032 google/protobuf/field_mask.p" - + "roto\"\241\001\n\024CreateContentRequest\0224\n\006parent\030" - + "\001 \001(\tB$\340A\002\372A\036\n\034dataplex.googleapis.com/L" - + "ake\0227\n\007content\030\002 \001(\0132!.google.cloud.data" - + "plex.v1.ContentB\003\340A\002\022\032\n\rvalidate_only\030\003 " - + "\001(\010B\003\340A\001\"\241\001\n\024UpdateContentRequest\0224\n\013upd" - + "ate_mask\030\001 \001(\0132\032.google.protobuf.FieldMa" - + "skB\003\340A\002\0227\n\007content\030\002 \001(\0132!.google.cloud." - + "dataplex.v1.ContentB\003\340A\002\022\032\n\rvalidate_onl" - + "y\030\003 \001(\010B\003\340A\001\"M\n\024DeleteContentRequest\0225\n\004" - + "name\030\001 \001(\tB\'\340A\002\372A!\n\037dataplex.googleapis." - + "com/Content\"\220\001\n\022ListContentRequest\0224\n\006pa" - + "rent\030\001 \001(\tB$\340A\002\372A\036\n\034dataplex.googleapis." - + "com/Lake\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage" - + "_token\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001\"b" - + "\n\023ListContentResponse\0222\n\007content\030\001 \003(\0132!" - + ".google.cloud.dataplex.v1.Content\022\027\n\017nex" - + "t_page_token\030\002 \001(\t\"\330\001\n\021GetContentRequest" - + "\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037dataplex.googlea" - + "pis.com/Content\022J\n\004view\030\002 \001(\01627.google.c" - + "loud.dataplex.v1.GetContentRequest.Conte" - + "ntViewB\003\340A\001\"@\n\013ContentView\022\034\n\030CONTENT_VI" - + "EW_UNSPECIFIED\020\000\022\t\n\005BASIC\020\001\022\010\n\004FULL\020\0022\362\007" - + "\n\016ContentService\022\276\001\n\rCreateContent\022..goo" - + "gle.cloud.dataplex.v1.CreateContentReque" - + "st\032!.google.cloud.dataplex.v1.Content\"Z\202" - + "\323\344\223\002C\"8/v1/{parent=projects/*/locations/" - + "*/lakes/*}/contentitems:\007content\332A\016paren" - + "t,content\022\314\001\n\rUpdateContent\022..google.clo" - + "ud.dataplex.v1.UpdateContentRequest\032!.go" - + "ogle.cloud.dataplex.v1.Content\"h\202\323\344\223\002L2A" - + "/v1/{content.name=projects/*/locations/*" - + "/lakes/*/contentitems/**}:\007content\332A\023con" - + "tent,update_mask\022\241\001\n\rDeleteContent\022..goo" - + "gle.cloud.dataplex.v1.DeleteContentReque" - + "st\032\026.google.protobuf.Empty\"H\202\323\344\223\002;*9/v1/" - + "{name=projects/*/locations/*/lakes/*/con" - + "tentitems/**}\332A\004name\022\246\001\n\nGetContent\022+.go" - + "ogle.cloud.dataplex.v1.GetContentRequest" - + "\032!.google.cloud.dataplex.v1.Content\"H\202\323\344" - + "\223\002;\0229/v1/{name=projects/*/locations/*/la" - + "kes/*/contentitems/**}\332A\004name\022\265\001\n\013ListCo" - + "ntent\022,.google.cloud.dataplex.v1.ListCon" - + "tentRequest\032-.google.cloud.dataplex.v1.L" - + "istContentResponse\"I\202\323\344\223\002:\0228/v1/{parent=" - + "projects/*/locations/*/lakes/*}/contenti" - + "tems\332A\006parent\032K\312A\027dataplex.googleapis.co" - + "m\322A.https://www.googleapis.com/auth/clou" - + "d-platformBp\n\034com.google.cloud.dataplex." - + "v1B\014ContentProtoP\001Z@google.golang.org/ge" - + "nproto/googleapis/cloud/dataplex/v1;data" - + "plexb\006proto3" + + "plex/v1/analyze.proto\032\036google/iam/v1/iam" + + "_policy.proto\032\032google/iam/v1/policy.prot" + + "o\032\033google/protobuf/empty.proto\032 google/p" + + "rotobuf/field_mask.proto\"\241\001\n\024CreateConte" + + "ntRequest\0224\n\006parent\030\001 \001(\tB$\340A\002\372A\036\n\034datap" + + "lex.googleapis.com/Lake\0227\n\007content\030\002 \001(\013" + + "2!.google.cloud.dataplex.v1.ContentB\003\340A\002" + + "\022\032\n\rvalidate_only\030\003 \001(\010B\003\340A\001\"\241\001\n\024UpdateC" + + "ontentRequest\0224\n\013update_mask\030\001 \001(\0132\032.goo" + + "gle.protobuf.FieldMaskB\003\340A\002\0227\n\007content\030\002" + + " \001(\0132!.google.cloud.dataplex.v1.ContentB" + + "\003\340A\002\022\032\n\rvalidate_only\030\003 \001(\010B\003\340A\001\"M\n\024Dele" + + "teContentRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037" + + "dataplex.googleapis.com/Content\"\220\001\n\022List" + + "ContentRequest\0224\n\006parent\030\001 \001(\tB$\340A\002\372A\036\n\034" + + "dataplex.googleapis.com/Lake\022\026\n\tpage_siz" + + "e\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\022\023\n" + + "\006filter\030\004 \001(\tB\003\340A\001\"b\n\023ListContentRespons" + + "e\0222\n\007content\030\001 \003(\0132!.google.cloud.datapl" + + "ex.v1.Content\022\027\n\017next_page_token\030\002 \001(\t\"\330" + + "\001\n\021GetContentRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372" + + "A!\n\037dataplex.googleapis.com/Content\022J\n\004v" + + "iew\030\002 \001(\01627.google.cloud.dataplex.v1.Get" + + "ContentRequest.ContentViewB\003\340A\001\"@\n\013Conte" + + "ntView\022\034\n\030CONTENT_VIEW_UNSPECIFIED\020\000\022\t\n\005" + + "BASIC\020\001\022\010\n\004FULL\020\0022\255\020\n\016ContentService\022\200\002\n" + + "\rCreateContent\022..google.cloud.dataplex.v" + + "1.CreateContentRequest\032!.google.cloud.da" + + "taplex.v1.Content\"\233\001\202\323\344\223\002\203\001\"8/v1/{parent" + + "=projects/*/locations/*/lakes/*}/content" + + "items:\007contentZ>\"3/v1/{parent=projects/*" + + "/locations/*/lakes/*}/content:\007content\332A" + + "\016parent,content\022\227\002\n\rUpdateContent\022..goog" + + "le.cloud.dataplex.v1.UpdateContentReques" + + "t\032!.google.cloud.dataplex.v1.Content\"\262\001\202" + + "\323\344\223\002\225\0012A/v1/{content.name=projects/*/loc" + + "ations/*/lakes/*/contentitems/**}:\007conte" + + "ntZG2 * Required. The resource name of the parent zone: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}` + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. * * * @@ -174,7 +174,7 @@ public java.lang.String getParent() { * *
          * Required. The resource name of the parent zone:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
          * 
      * * @@ -709,7 +709,7 @@ public Builder mergeFrom( * *
            * Required. The resource name of the parent zone:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
            * 
      * * @@ -734,7 +734,7 @@ public java.lang.String getParent() { * *
            * Required. The resource name of the parent zone:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
            * 
      * * @@ -759,7 +759,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
            * Required. The resource name of the parent zone:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
            * 
      * * @@ -783,7 +783,7 @@ public Builder setParent(java.lang.String value) { * *
            * Required. The resource name of the parent zone:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
            * 
      * * @@ -803,7 +803,7 @@ public Builder clearParent() { * *
            * Required. The resource name of the parent zone:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
            * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateAssetRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateAssetRequestOrBuilder.java index 62e6c19..3d17df3 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateAssetRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateAssetRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface CreateAssetRequestOrBuilder * *
          * Required. The resource name of the parent zone:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
          * 
      * * @@ -43,7 +43,7 @@ public interface CreateAssetRequestOrBuilder * *
          * Required. The resource name of the parent zone:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
          * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateEnvironmentRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateEnvironmentRequest.java index 078e372..2edf1bc 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateEnvironmentRequest.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateEnvironmentRequest.java @@ -149,7 +149,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
          * Required. The resource name of the parent lake:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -175,7 +175,7 @@ public java.lang.String getParent() { * *
          * Required. The resource name of the parent lake:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -713,7 +713,7 @@ public Builder mergeFrom( * *
            * Required. The resource name of the parent lake:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -738,7 +738,7 @@ public java.lang.String getParent() { * *
            * Required. The resource name of the parent lake:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -763,7 +763,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
            * Required. The resource name of the parent lake:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -787,7 +787,7 @@ public Builder setParent(java.lang.String value) { * *
            * Required. The resource name of the parent lake:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -807,7 +807,7 @@ public Builder clearParent() { * *
            * Required. The resource name of the parent lake:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateEnvironmentRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateEnvironmentRequestOrBuilder.java index be57975..a781d6a 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateEnvironmentRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/CreateEnvironmentRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface CreateEnvironmentRequestOrBuilder * *
          * Required. The resource name of the parent lake:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -43,7 +43,7 @@ public interface CreateEnvironmentRequestOrBuilder * *
          * Required. The resource name of the parent lake:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEntityRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEntityRequest.java index dfca6cb..d56cc48 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEntityRequest.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEntityRequest.java @@ -182,7 +182,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
      -   * Required. The etag associated with the partition if it was previously retrieved.
      +   * Required. The etag associated with the entity, which can be retrieved with a
      +   * [GetEntity][] request.
          * 
      * * string etag = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -205,7 +206,8 @@ public java.lang.String getEtag() { * * *
      -   * Required. The etag associated with the partition if it was previously retrieved.
      +   * Required. The etag associated with the entity, which can be retrieved with a
      +   * [GetEntity][] request.
          * 
      * * string etag = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -684,7 +686,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
      -     * Required. The etag associated with the partition if it was previously retrieved.
      +     * Required. The etag associated with the entity, which can be retrieved with a
      +     * [GetEntity][] request.
            * 
      * * string etag = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -706,7 +709,8 @@ public java.lang.String getEtag() { * * *
      -     * Required. The etag associated with the partition if it was previously retrieved.
      +     * Required. The etag associated with the entity, which can be retrieved with a
      +     * [GetEntity][] request.
            * 
      * * string etag = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -728,7 +732,8 @@ public com.google.protobuf.ByteString getEtagBytes() { * * *
      -     * Required. The etag associated with the partition if it was previously retrieved.
      +     * Required. The etag associated with the entity, which can be retrieved with a
      +     * [GetEntity][] request.
            * 
      * * string etag = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -749,7 +754,8 @@ public Builder setEtag(java.lang.String value) { * * *
      -     * Required. The etag associated with the partition if it was previously retrieved.
      +     * Required. The etag associated with the entity, which can be retrieved with a
      +     * [GetEntity][] request.
            * 
      * * string etag = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -766,7 +772,8 @@ public Builder clearEtag() { * * *
      -     * Required. The etag associated with the partition if it was previously retrieved.
      +     * Required. The etag associated with the entity, which can be retrieved with a
      +     * [GetEntity][] request.
            * 
      * * string etag = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEntityRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEntityRequestOrBuilder.java index 0818b13..a79d5ef 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEntityRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEntityRequestOrBuilder.java @@ -58,7 +58,8 @@ public interface DeleteEntityRequestOrBuilder * * *
      -   * Required. The etag associated with the partition if it was previously retrieved.
      +   * Required. The etag associated with the entity, which can be retrieved with a
      +   * [GetEntity][] request.
          * 
      * * string etag = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -70,7 +71,8 @@ public interface DeleteEntityRequestOrBuilder * * *
      -   * Required. The etag associated with the partition if it was previously retrieved.
      +   * Required. The etag associated with the entity, which can be retrieved with a
      +   * [GetEntity][] request.
          * 
      * * string etag = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEnvironmentRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEnvironmentRequest.java index 2b7d6ee..e4ae078 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEnvironmentRequest.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEnvironmentRequest.java @@ -120,7 +120,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
          * Required. The resource name of the environment:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
          * 
      * * @@ -146,7 +146,7 @@ public java.lang.String getName() { * *
          * Required. The resource name of the environment:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
          * 
      * * @@ -493,7 +493,7 @@ public Builder mergeFrom( * *
            * Required. The resource name of the environment:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
            * 
      * * @@ -518,7 +518,7 @@ public java.lang.String getName() { * *
            * Required. The resource name of the environment:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
            * 
      * * @@ -543,7 +543,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
            * Required. The resource name of the environment:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
            * 
      * * @@ -567,7 +567,7 @@ public Builder setName(java.lang.String value) { * *
            * Required. The resource name of the environment:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
            * 
      * * @@ -587,7 +587,7 @@ public Builder clearName() { * *
            * Required. The resource name of the environment:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
            * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEnvironmentRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEnvironmentRequestOrBuilder.java index 56ad597..fb39bfc 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEnvironmentRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteEnvironmentRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface DeleteEnvironmentRequestOrBuilder * *
          * Required. The resource name of the environment:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
          * 
      * * @@ -43,7 +43,7 @@ public interface DeleteEnvironmentRequestOrBuilder * *
          * Required. The resource name of the environment:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
          * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteLakeRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteLakeRequest.java index 8416a17..3fed2a9 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteLakeRequest.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteLakeRequest.java @@ -120,7 +120,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
          * Required. The resource name of the lake:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -146,7 +146,7 @@ public java.lang.String getName() { * *
          * Required. The resource name of the lake:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -490,7 +490,7 @@ public Builder mergeFrom( * *
            * Required. The resource name of the lake:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -515,7 +515,7 @@ public java.lang.String getName() { * *
            * Required. The resource name of the lake:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -540,7 +540,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
            * Required. The resource name of the lake:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -564,7 +564,7 @@ public Builder setName(java.lang.String value) { * *
            * Required. The resource name of the lake:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -584,7 +584,7 @@ public Builder clearName() { * *
            * Required. The resource name of the lake:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteLakeRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteLakeRequestOrBuilder.java index 67a8c90..3b627d2 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteLakeRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeleteLakeRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface DeleteLakeRequestOrBuilder * *
          * Required. The resource name of the lake:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -43,7 +43,7 @@ public interface DeleteLakeRequestOrBuilder * *
          * Required. The resource name of the lake:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeletePartitionRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeletePartitionRequest.java index afbeeec..63b6874 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeletePartitionRequest.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeletePartitionRequest.java @@ -188,13 +188,13 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
      -   * Optional. The etag associated with the partition if it was previously retrieved.
      +   * Optional. The etag associated with the partition.
          * 
      * * string etag = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.DeletePartitionRequest.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=325 + * google/cloud/dataplex/v1/metadata.proto;l=327 * @return The etag. */ @java.lang.Override @@ -214,13 +214,13 @@ public java.lang.String getEtag() { * * *
      -   * Optional. The etag associated with the partition if it was previously retrieved.
      +   * Optional. The etag associated with the partition.
          * 
      * * string etag = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.DeletePartitionRequest.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=325 + * google/cloud/dataplex/v1/metadata.proto;l=327 * @return The bytes for etag. */ @java.lang.Override @@ -712,13 +712,13 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
      -     * Optional. The etag associated with the partition if it was previously retrieved.
      +     * Optional. The etag associated with the partition.
            * 
      * * string etag = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.DeletePartitionRequest.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=325 + * google/cloud/dataplex/v1/metadata.proto;l=327 * @return The etag. */ @java.lang.Deprecated @@ -737,13 +737,13 @@ public java.lang.String getEtag() { * * *
      -     * Optional. The etag associated with the partition if it was previously retrieved.
      +     * Optional. The etag associated with the partition.
            * 
      * * string etag = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.DeletePartitionRequest.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=325 + * google/cloud/dataplex/v1/metadata.proto;l=327 * @return The bytes for etag. */ @java.lang.Deprecated @@ -762,13 +762,13 @@ public com.google.protobuf.ByteString getEtagBytes() { * * *
      -     * Optional. The etag associated with the partition if it was previously retrieved.
      +     * Optional. The etag associated with the partition.
            * 
      * * string etag = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.DeletePartitionRequest.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=325 + * google/cloud/dataplex/v1/metadata.proto;l=327 * @param value The etag to set. * @return This builder for chaining. */ @@ -786,13 +786,13 @@ public Builder setEtag(java.lang.String value) { * * *
      -     * Optional. The etag associated with the partition if it was previously retrieved.
      +     * Optional. The etag associated with the partition.
            * 
      * * string etag = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.DeletePartitionRequest.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=325 + * google/cloud/dataplex/v1/metadata.proto;l=327 * @return This builder for chaining. */ @java.lang.Deprecated @@ -806,13 +806,13 @@ public Builder clearEtag() { * * *
      -     * Optional. The etag associated with the partition if it was previously retrieved.
      +     * Optional. The etag associated with the partition.
            * 
      * * string etag = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.DeletePartitionRequest.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=325 + * google/cloud/dataplex/v1/metadata.proto;l=327 * @param value The bytes for etag to set. * @return This builder for chaining. */ diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeletePartitionRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeletePartitionRequestOrBuilder.java index bc7631d..1064ba0 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeletePartitionRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DeletePartitionRequestOrBuilder.java @@ -64,13 +64,13 @@ public interface DeletePartitionRequestOrBuilder * * *
      -   * Optional. The etag associated with the partition if it was previously retrieved.
      +   * Optional. The etag associated with the partition.
          * 
      * * string etag = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.DeletePartitionRequest.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=325 + * google/cloud/dataplex/v1/metadata.proto;l=327 * @return The etag. */ @java.lang.Deprecated @@ -79,13 +79,13 @@ public interface DeletePartitionRequestOrBuilder * * *
      -   * Optional. The etag associated with the partition if it was previously retrieved.
      +   * Optional. The etag associated with the partition.
          * 
      * * string etag = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.DeletePartitionRequest.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=325 + * google/cloud/dataplex/v1/metadata.proto;l=327 * @return The bytes for etag. */ @java.lang.Deprecated diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DiscoveryEvent.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DiscoveryEvent.java index fb37d0a..2d73894 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DiscoveryEvent.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/DiscoveryEvent.java @@ -2478,6 +2478,61 @@ public interface PartitionDetailsOrBuilder * @return The type. */ com.google.cloud.dataplex.v1.DiscoveryEvent.EntityType getType(); + + /** + * + * + *
      +     * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +     * for metadata inference.
      +     * 
      + * + * repeated string sampled_data_locations = 4; + * + * @return A list containing the sampledDataLocations. + */ + java.util.List getSampledDataLocationsList(); + /** + * + * + *
      +     * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +     * for metadata inference.
      +     * 
      + * + * repeated string sampled_data_locations = 4; + * + * @return The count of sampledDataLocations. + */ + int getSampledDataLocationsCount(); + /** + * + * + *
      +     * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +     * for metadata inference.
      +     * 
      + * + * repeated string sampled_data_locations = 4; + * + * @param index The index of the element to return. + * @return The sampledDataLocations at the given index. + */ + java.lang.String getSampledDataLocations(int index); + /** + * + * + *
      +     * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +     * for metadata inference.
      +     * 
      + * + * repeated string sampled_data_locations = 4; + * + * @param index The index of the value to return. + * @return The bytes of the sampledDataLocations at the given index. + */ + com.google.protobuf.ByteString getSampledDataLocationsBytes(int index); } /** * @@ -2502,6 +2557,7 @@ private PartitionDetails() { partition_ = ""; entity_ = ""; type_ = 0; + sampledDataLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; } @java.lang.Override @@ -2523,6 +2579,7 @@ private PartitionDetails( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -2554,6 +2611,16 @@ private PartitionDetails( type_ = rawValue; break; } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + sampledDataLocations_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + sampledDataLocations_.add(s); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -2570,6 +2637,9 @@ private PartitionDetails( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + sampledDataLocations_ = sampledDataLocations_.getUnmodifiableView(); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -2730,6 +2800,71 @@ public com.google.cloud.dataplex.v1.DiscoveryEvent.EntityType getType() { : result; } + public static final int SAMPLED_DATA_LOCATIONS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList sampledDataLocations_; + /** + * + * + *
      +     * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +     * for metadata inference.
      +     * 
      + * + * repeated string sampled_data_locations = 4; + * + * @return A list containing the sampledDataLocations. + */ + public com.google.protobuf.ProtocolStringList getSampledDataLocationsList() { + return sampledDataLocations_; + } + /** + * + * + *
      +     * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +     * for metadata inference.
      +     * 
      + * + * repeated string sampled_data_locations = 4; + * + * @return The count of sampledDataLocations. + */ + public int getSampledDataLocationsCount() { + return sampledDataLocations_.size(); + } + /** + * + * + *
      +     * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +     * for metadata inference.
      +     * 
      + * + * repeated string sampled_data_locations = 4; + * + * @param index The index of the element to return. + * @return The sampledDataLocations at the given index. + */ + public java.lang.String getSampledDataLocations(int index) { + return sampledDataLocations_.get(index); + } + /** + * + * + *
      +     * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +     * for metadata inference.
      +     * 
      + * + * repeated string sampled_data_locations = 4; + * + * @param index The index of the value to return. + * @return The bytes of the sampledDataLocations at the given index. + */ + public com.google.protobuf.ByteString getSampledDataLocationsBytes(int index) { + return sampledDataLocations_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -2755,6 +2890,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(3, type_); } + for (int i = 0; i < sampledDataLocations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 4, sampledDataLocations_.getRaw(i)); + } unknownFields.writeTo(output); } @@ -2775,6 +2914,14 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); } + { + int dataSize = 0; + for (int i = 0; i < sampledDataLocations_.size(); i++) { + dataSize += computeStringSizeNoTag(sampledDataLocations_.getRaw(i)); + } + size += dataSize; + size += 1 * getSampledDataLocationsList().size(); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -2794,6 +2941,7 @@ public boolean equals(final java.lang.Object obj) { if (!getPartition().equals(other.getPartition())) return false; if (!getEntity().equals(other.getEntity())) return false; if (type_ != other.type_) return false; + if (!getSampledDataLocationsList().equals(other.getSampledDataLocationsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -2811,6 +2959,10 @@ public int hashCode() { hash = (53 * hash) + getEntity().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; + if (getSampledDataLocationsCount() > 0) { + hash = (37 * hash) + SAMPLED_DATA_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getSampledDataLocationsList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -2965,6 +3117,8 @@ public Builder clear() { type_ = 0; + sampledDataLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -2993,9 +3147,15 @@ public com.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails build() { public com.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails buildPartial() { com.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails result = new com.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails(this); + int from_bitField0_ = bitField0_; result.partition_ = partition_; result.entity_ = entity_; result.type_ = type_; + if (((bitField0_ & 0x00000001) != 0)) { + sampledDataLocations_ = sampledDataLocations_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sampledDataLocations_ = sampledDataLocations_; onBuilt(); return result; } @@ -3060,6 +3220,16 @@ public Builder mergeFrom(com.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDe if (other.type_ != 0) { setTypeValue(other.getTypeValue()); } + if (!other.sampledDataLocations_.isEmpty()) { + if (sampledDataLocations_.isEmpty()) { + sampledDataLocations_ = other.sampledDataLocations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSampledDataLocationsIsMutable(); + sampledDataLocations_.addAll(other.sampledDataLocations_); + } + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -3091,6 +3261,8 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object partition_ = ""; /** * @@ -3406,6 +3578,184 @@ public Builder clearType() { return this; } + private com.google.protobuf.LazyStringList sampledDataLocations_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSampledDataLocationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sampledDataLocations_ = + new com.google.protobuf.LazyStringArrayList(sampledDataLocations_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
      +       * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +       * for metadata inference.
      +       * 
      + * + * repeated string sampled_data_locations = 4; + * + * @return A list containing the sampledDataLocations. + */ + public com.google.protobuf.ProtocolStringList getSampledDataLocationsList() { + return sampledDataLocations_.getUnmodifiableView(); + } + /** + * + * + *
      +       * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +       * for metadata inference.
      +       * 
      + * + * repeated string sampled_data_locations = 4; + * + * @return The count of sampledDataLocations. + */ + public int getSampledDataLocationsCount() { + return sampledDataLocations_.size(); + } + /** + * + * + *
      +       * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +       * for metadata inference.
      +       * 
      + * + * repeated string sampled_data_locations = 4; + * + * @param index The index of the element to return. + * @return The sampledDataLocations at the given index. + */ + public java.lang.String getSampledDataLocations(int index) { + return sampledDataLocations_.get(index); + } + /** + * + * + *
      +       * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +       * for metadata inference.
      +       * 
      + * + * repeated string sampled_data_locations = 4; + * + * @param index The index of the value to return. + * @return The bytes of the sampledDataLocations at the given index. + */ + public com.google.protobuf.ByteString getSampledDataLocationsBytes(int index) { + return sampledDataLocations_.getByteString(index); + } + /** + * + * + *
      +       * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +       * for metadata inference.
      +       * 
      + * + * repeated string sampled_data_locations = 4; + * + * @param index The index to set the value at. + * @param value The sampledDataLocations to set. + * @return This builder for chaining. + */ + public Builder setSampledDataLocations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSampledDataLocationsIsMutable(); + sampledDataLocations_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
      +       * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +       * for metadata inference.
      +       * 
      + * + * repeated string sampled_data_locations = 4; + * + * @param value The sampledDataLocations to add. + * @return This builder for chaining. + */ + public Builder addSampledDataLocations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSampledDataLocationsIsMutable(); + sampledDataLocations_.add(value); + onChanged(); + return this; + } + /** + * + * + *
      +       * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +       * for metadata inference.
      +       * 
      + * + * repeated string sampled_data_locations = 4; + * + * @param values The sampledDataLocations to add. + * @return This builder for chaining. + */ + public Builder addAllSampledDataLocations(java.lang.Iterable values) { + ensureSampledDataLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sampledDataLocations_); + onChanged(); + return this; + } + /** + * + * + *
      +       * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +       * for metadata inference.
      +       * 
      + * + * repeated string sampled_data_locations = 4; + * + * @return This builder for chaining. + */ + public Builder clearSampledDataLocations() { + sampledDataLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
      +       * The locations of the data items (e.g., a Cloud Storage objects) sampled
      +       * for metadata inference.
      +       * 
      + * + * repeated string sampled_data_locations = 4; + * + * @param value The bytes of the sampledDataLocations to add. + * @return This builder for chaining. + */ + public Builder addSampledDataLocationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSampledDataLocationsIsMutable(); + sampledDataLocations_.add(value); + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Entity.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Entity.java index f55ed49..fcc1d62 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Entity.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Entity.java @@ -2449,7 +2449,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
      -   * Optional. Display name must be shorter than or equal to 63 characters.
      +   * Optional. Display name must be shorter than or equal to 256 characters.
          * 
      * * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -2472,7 +2472,7 @@ public java.lang.String getDisplayName() { * * *
      -   * Optional. Display name must be shorter than or equal to 63 characters.
      +   * Optional. Display name must be shorter than or equal to 256 characters.
          * 
      * * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -2651,7 +2651,8 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * published table name. Specifying a new ID in an update entity * request will override the existing value. * The ID must contain only letters (a-z, A-Z), numbers (0-9), and - * underscores. Must begin with a letter. + * underscores. Must begin with a letter and consist of 256 or fewer + * characters. * * * string id = 7 [(.google.api.field_behavior) = REQUIRED]; @@ -2678,7 +2679,8 @@ public java.lang.String getId() { * published table name. Specifying a new ID in an update entity * request will override the existing value. * The ID must contain only letters (a-z, A-Z), numbers (0-9), and - * underscores. Must begin with a letter. + * underscores. Must begin with a letter and consist of 256 or fewer + * characters. * * * string id = 7 [(.google.api.field_behavior) = REQUIRED]; @@ -2704,8 +2706,8 @@ public com.google.protobuf.ByteString getIdBytes() { * * *
      -   * Optional. The etag for this entity. Required for update and delete requests. Must
      -   * match the server's etag.
      +   * Optional. The etag associated with the entity, which can be retrieved with a
      +   * [GetEntity][] request. Required for update and delete requests.
          * 
      * * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; @@ -2728,8 +2730,8 @@ public java.lang.String getEtag() { * * *
      -   * Optional. The etag for this entity. Required for update and delete requests. Must
      -   * match the server's etag.
      +   * Optional. The etag associated with the entity, which can be retrieved with a
      +   * [GetEntity][] request. Required for update and delete requests.
          * 
      * * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; @@ -3953,7 +3955,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
      -     * Optional. Display name must be shorter than or equal to 63 characters.
      +     * Optional. Display name must be shorter than or equal to 256 characters.
            * 
      * * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -3975,7 +3977,7 @@ public java.lang.String getDisplayName() { * * *
      -     * Optional. Display name must be shorter than or equal to 63 characters.
      +     * Optional. Display name must be shorter than or equal to 256 characters.
            * 
      * * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -3997,7 +3999,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { * * *
      -     * Optional. Display name must be shorter than or equal to 63 characters.
      +     * Optional. Display name must be shorter than or equal to 256 characters.
            * 
      * * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -4018,7 +4020,7 @@ public Builder setDisplayName(java.lang.String value) { * * *
      -     * Optional. Display name must be shorter than or equal to 63 characters.
      +     * Optional. Display name must be shorter than or equal to 256 characters.
            * 
      * * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -4035,7 +4037,7 @@ public Builder clearDisplayName() { * * *
      -     * Optional. Display name must be shorter than or equal to 63 characters.
      +     * Optional. Display name must be shorter than or equal to 256 characters.
            * 
      * * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -4576,7 +4578,8 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * published table name. Specifying a new ID in an update entity * request will override the existing value. * The ID must contain only letters (a-z, A-Z), numbers (0-9), and - * underscores. Must begin with a letter. + * underscores. Must begin with a letter and consist of 256 or fewer + * characters. * * * string id = 7 [(.google.api.field_behavior) = REQUIRED]; @@ -4602,7 +4605,8 @@ public java.lang.String getId() { * published table name. Specifying a new ID in an update entity * request will override the existing value. * The ID must contain only letters (a-z, A-Z), numbers (0-9), and - * underscores. Must begin with a letter. + * underscores. Must begin with a letter and consist of 256 or fewer + * characters. * * * string id = 7 [(.google.api.field_behavior) = REQUIRED]; @@ -4628,7 +4632,8 @@ public com.google.protobuf.ByteString getIdBytes() { * published table name. Specifying a new ID in an update entity * request will override the existing value. * The ID must contain only letters (a-z, A-Z), numbers (0-9), and - * underscores. Must begin with a letter. + * underscores. Must begin with a letter and consist of 256 or fewer + * characters. * * * string id = 7 [(.google.api.field_behavior) = REQUIRED]; @@ -4653,7 +4658,8 @@ public Builder setId(java.lang.String value) { * published table name. Specifying a new ID in an update entity * request will override the existing value. * The ID must contain only letters (a-z, A-Z), numbers (0-9), and - * underscores. Must begin with a letter. + * underscores. Must begin with a letter and consist of 256 or fewer + * characters. * * * string id = 7 [(.google.api.field_behavior) = REQUIRED]; @@ -4674,7 +4680,8 @@ public Builder clearId() { * published table name. Specifying a new ID in an update entity * request will override the existing value. * The ID must contain only letters (a-z, A-Z), numbers (0-9), and - * underscores. Must begin with a letter. + * underscores. Must begin with a letter and consist of 256 or fewer + * characters. * * * string id = 7 [(.google.api.field_behavior) = REQUIRED]; @@ -4698,8 +4705,8 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { * * *
      -     * Optional. The etag for this entity. Required for update and delete requests. Must
      -     * match the server's etag.
      +     * Optional. The etag associated with the entity, which can be retrieved with a
      +     * [GetEntity][] request. Required for update and delete requests.
            * 
      * * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; @@ -4721,8 +4728,8 @@ public java.lang.String getEtag() { * * *
      -     * Optional. The etag for this entity. Required for update and delete requests. Must
      -     * match the server's etag.
      +     * Optional. The etag associated with the entity, which can be retrieved with a
      +     * [GetEntity][] request. Required for update and delete requests.
            * 
      * * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; @@ -4744,8 +4751,8 @@ public com.google.protobuf.ByteString getEtagBytes() { * * *
      -     * Optional. The etag for this entity. Required for update and delete requests. Must
      -     * match the server's etag.
      +     * Optional. The etag associated with the entity, which can be retrieved with a
      +     * [GetEntity][] request. Required for update and delete requests.
            * 
      * * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; @@ -4766,8 +4773,8 @@ public Builder setEtag(java.lang.String value) { * * *
      -     * Optional. The etag for this entity. Required for update and delete requests. Must
      -     * match the server's etag.
      +     * Optional. The etag associated with the entity, which can be retrieved with a
      +     * [GetEntity][] request. Required for update and delete requests.
            * 
      * * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; @@ -4784,8 +4791,8 @@ public Builder clearEtag() { * * *
      -     * Optional. The etag for this entity. Required for update and delete requests. Must
      -     * match the server's etag.
      +     * Optional. The etag associated with the entity, which can be retrieved with a
      +     * [GetEntity][] request. Required for update and delete requests.
            * 
      * * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/EntityOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/EntityOrBuilder.java index ce04a10..c03c7cf 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/EntityOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/EntityOrBuilder.java @@ -58,7 +58,7 @@ public interface EntityOrBuilder * * *
      -   * Optional. Display name must be shorter than or equal to 63 characters.
      +   * Optional. Display name must be shorter than or equal to 256 characters.
          * 
      * * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -70,7 +70,7 @@ public interface EntityOrBuilder * * *
      -   * Optional. Display name must be shorter than or equal to 63 characters.
      +   * Optional. Display name must be shorter than or equal to 256 characters.
          * 
      * * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -190,7 +190,8 @@ public interface EntityOrBuilder * published table name. Specifying a new ID in an update entity * request will override the existing value. * The ID must contain only letters (a-z, A-Z), numbers (0-9), and - * underscores. Must begin with a letter. + * underscores. Must begin with a letter and consist of 256 or fewer + * characters. * * * string id = 7 [(.google.api.field_behavior) = REQUIRED]; @@ -206,7 +207,8 @@ public interface EntityOrBuilder * published table name. Specifying a new ID in an update entity * request will override the existing value. * The ID must contain only letters (a-z, A-Z), numbers (0-9), and - * underscores. Must begin with a letter. + * underscores. Must begin with a letter and consist of 256 or fewer + * characters. * * * string id = 7 [(.google.api.field_behavior) = REQUIRED]; @@ -219,8 +221,8 @@ public interface EntityOrBuilder * * *
      -   * Optional. The etag for this entity. Required for update and delete requests. Must
      -   * match the server's etag.
      +   * Optional. The etag associated with the entity, which can be retrieved with a
      +   * [GetEntity][] request. Required for update and delete requests.
          * 
      * * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; @@ -232,8 +234,8 @@ public interface EntityOrBuilder * * *
      -   * Optional. The etag for this entity. Required for update and delete requests. Must
      -   * match the server's etag.
      +   * Optional. The etag associated with the entity, which can be retrieved with a
      +   * [GetEntity][] request. Required for update and delete requests.
          * 
      * * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetEnvironmentRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetEnvironmentRequest.java index 6c63aa7..c619407 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetEnvironmentRequest.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetEnvironmentRequest.java @@ -120,7 +120,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
          * Required. The resource name of the environment:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
          * 
      * * @@ -146,7 +146,7 @@ public java.lang.String getName() { * *
          * Required. The resource name of the environment:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
          * 
      * * @@ -492,7 +492,7 @@ public Builder mergeFrom( * *
            * Required. The resource name of the environment:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
            * 
      * * @@ -517,7 +517,7 @@ public java.lang.String getName() { * *
            * Required. The resource name of the environment:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
            * 
      * * @@ -542,7 +542,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
            * Required. The resource name of the environment:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
            * 
      * * @@ -566,7 +566,7 @@ public Builder setName(java.lang.String value) { * *
            * Required. The resource name of the environment:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
            * 
      * * @@ -586,7 +586,7 @@ public Builder clearName() { * *
            * Required. The resource name of the environment:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
            * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetEnvironmentRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetEnvironmentRequestOrBuilder.java index 5b79386..f84390c 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetEnvironmentRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetEnvironmentRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface GetEnvironmentRequestOrBuilder * *
          * Required. The resource name of the environment:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
          * 
      * * @@ -43,7 +43,7 @@ public interface GetEnvironmentRequestOrBuilder * *
          * Required. The resource name of the environment:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`.
          * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetTaskRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetTaskRequest.java index 39086f2..dd0aed2 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetTaskRequest.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetTaskRequest.java @@ -120,7 +120,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
          * Required. The resource name of the task:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`.
          * 
      * * @@ -146,7 +146,7 @@ public java.lang.String getName() { * *
          * Required. The resource name of the task:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`.
          * 
      * * @@ -490,7 +490,7 @@ public Builder mergeFrom( * *
            * Required. The resource name of the task:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`.
            * 
      * * @@ -515,7 +515,7 @@ public java.lang.String getName() { * *
            * Required. The resource name of the task:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`.
            * 
      * * @@ -540,7 +540,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
            * Required. The resource name of the task:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`.
            * 
      * * @@ -564,7 +564,7 @@ public Builder setName(java.lang.String value) { * *
            * Required. The resource name of the task:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`.
            * 
      * * @@ -584,7 +584,7 @@ public Builder clearName() { * *
            * Required. The resource name of the task:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`.
            * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetTaskRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetTaskRequestOrBuilder.java index 01fe98c..f654f0e 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetTaskRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/GetTaskRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface GetTaskRequestOrBuilder * *
          * Required. The resource name of the task:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`.
          * 
      * * @@ -43,7 +43,7 @@ public interface GetTaskRequestOrBuilder * *
          * Required. The resource name of the task:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`.
          * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEntitiesRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEntitiesRequest.java index caa8873..77240ec 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEntitiesRequest.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEntitiesRequest.java @@ -156,7 +156,8 @@ public enum EntityView implements com.google.protobuf.ProtocolMessageEnum { * * *
      -     * The default unset value. The API will default to the FULL view.
      +     * The default unset value. Return both table and fileset entities
      +     * if unspecified.
            * 
      * * ENTITY_VIEW_UNSPECIFIED = 0; @@ -189,7 +190,8 @@ public enum EntityView implements com.google.protobuf.ProtocolMessageEnum { * * *
      -     * The default unset value. The API will default to the FULL view.
      +     * The default unset value. Return both table and fileset entities
      +     * if unspecified.
            * 
      * * ENTITY_VIEW_UNSPECIFIED = 0; @@ -482,8 +484,8 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * - Entity ID: ?filter="id=entityID" * - Asset ID: ?filter="asset=assetID" * - Data path ?filter="data_path=gs://my-bucket" - * - Is HIVE compatible: ?filter=”hive_compatible=true” - * - Is BigQuery compatible: ?filter=”bigquery_compatible=true” + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" * * * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -511,8 +513,8 @@ public java.lang.String getFilter() { * - Entity ID: ?filter="id=entityID" * - Asset ID: ?filter="asset=assetID" * - Data path ?filter="data_path=gs://my-bucket" - * - Is HIVE compatible: ?filter=”hive_compatible=true” - * - Is BigQuery compatible: ?filter=”bigquery_compatible=true” + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" * * * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -1328,8 +1330,8 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { * - Entity ID: ?filter="id=entityID" * - Asset ID: ?filter="asset=assetID" * - Data path ?filter="data_path=gs://my-bucket" - * - Is HIVE compatible: ?filter=”hive_compatible=true” - * - Is BigQuery compatible: ?filter=”bigquery_compatible=true” + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" * * * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -1356,8 +1358,8 @@ public java.lang.String getFilter() { * - Entity ID: ?filter="id=entityID" * - Asset ID: ?filter="asset=assetID" * - Data path ?filter="data_path=gs://my-bucket" - * - Is HIVE compatible: ?filter=”hive_compatible=true” - * - Is BigQuery compatible: ?filter=”bigquery_compatible=true” + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" * * * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -1384,8 +1386,8 @@ public com.google.protobuf.ByteString getFilterBytes() { * - Entity ID: ?filter="id=entityID" * - Asset ID: ?filter="asset=assetID" * - Data path ?filter="data_path=gs://my-bucket" - * - Is HIVE compatible: ?filter=”hive_compatible=true” - * - Is BigQuery compatible: ?filter=”bigquery_compatible=true” + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" * * * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -1411,8 +1413,8 @@ public Builder setFilter(java.lang.String value) { * - Entity ID: ?filter="id=entityID" * - Asset ID: ?filter="asset=assetID" * - Data path ?filter="data_path=gs://my-bucket" - * - Is HIVE compatible: ?filter=”hive_compatible=true” - * - Is BigQuery compatible: ?filter=”bigquery_compatible=true” + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" * * * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -1434,8 +1436,8 @@ public Builder clearFilter() { * - Entity ID: ?filter="id=entityID" * - Asset ID: ?filter="asset=assetID" * - Data path ?filter="data_path=gs://my-bucket" - * - Is HIVE compatible: ?filter=”hive_compatible=true” - * - Is BigQuery compatible: ?filter=”bigquery_compatible=true” + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" * * * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEntitiesRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEntitiesRequestOrBuilder.java index 729518b..3aea773 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEntitiesRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEntitiesRequestOrBuilder.java @@ -138,8 +138,8 @@ public interface ListEntitiesRequestOrBuilder * - Entity ID: ?filter="id=entityID" * - Asset ID: ?filter="asset=assetID" * - Data path ?filter="data_path=gs://my-bucket" - * - Is HIVE compatible: ?filter=”hive_compatible=true” - * - Is BigQuery compatible: ?filter=”bigquery_compatible=true” + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" * * * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -156,8 +156,8 @@ public interface ListEntitiesRequestOrBuilder * - Entity ID: ?filter="id=entityID" * - Asset ID: ?filter="asset=assetID" * - Data path ?filter="data_path=gs://my-bucket" - * - Is HIVE compatible: ?filter=”hive_compatible=true” - * - Is BigQuery compatible: ?filter=”bigquery_compatible=true” + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" * * * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEnvironmentsRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEnvironmentsRequest.java index dd33335..4bb367d 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEnvironmentsRequest.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEnvironmentsRequest.java @@ -149,7 +149,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
          * Required. The resource name of the parent lake:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -175,7 +175,7 @@ public java.lang.String getParent() { * *
          * Required. The resource name of the parent lake:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -757,7 +757,7 @@ public Builder mergeFrom( * *
            * Required. The resource name of the parent lake:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -782,7 +782,7 @@ public java.lang.String getParent() { * *
            * Required. The resource name of the parent lake:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -807,7 +807,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
            * Required. The resource name of the parent lake:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -831,7 +831,7 @@ public Builder setParent(java.lang.String value) { * *
            * Required. The resource name of the parent lake:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -851,7 +851,7 @@ public Builder clearParent() { * *
            * Required. The resource name of the parent lake:
      -     * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +     * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEnvironmentsRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEnvironmentsRequestOrBuilder.java index 98e0ceb..88ec409 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEnvironmentsRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListEnvironmentsRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface ListEnvironmentsRequestOrBuilder * *
          * Required. The resource name of the parent lake:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -43,7 +43,7 @@ public interface ListEnvironmentsRequestOrBuilder * *
          * Required. The resource name of the parent lake:
      -   * projects/{project_id}/locations/{location_id}/lakes/{lake_id}
      +   * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListLakeActionsRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListLakeActionsRequest.java index fa5f32a..f4f4cf6 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListLakeActionsRequest.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListLakeActionsRequest.java @@ -133,7 +133,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
          * Required. The resource name of the parent lake:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -159,7 +159,7 @@ public java.lang.String getParent() { * *
          * Required. The resource name of the parent lake:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -611,7 +611,7 @@ public Builder mergeFrom( * *
            * Required. The resource name of the parent lake:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -636,7 +636,7 @@ public java.lang.String getParent() { * *
            * Required. The resource name of the parent lake:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -661,7 +661,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
            * Required. The resource name of the parent lake:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -685,7 +685,7 @@ public Builder setParent(java.lang.String value) { * *
            * Required. The resource name of the parent lake:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * @@ -705,7 +705,7 @@ public Builder clearParent() { * *
            * Required. The resource name of the parent lake:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
            * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListLakeActionsRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListLakeActionsRequestOrBuilder.java index 4031ca7..679c711 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListLakeActionsRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListLakeActionsRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface ListLakeActionsRequestOrBuilder * *
          * Required. The resource name of the parent lake:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * @@ -43,7 +43,7 @@ public interface ListLakeActionsRequestOrBuilder * *
          * Required. The resource name of the parent lake:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`.
          * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListPartitionsRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListPartitionsRequest.java index 5000e9f..306e596 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListPartitionsRequest.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListPartitionsRequest.java @@ -270,13 +270,13 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * * *
      -   * Optional. Filter the partitions returned to the caller using a key vslue pair
      -   * expression. The filter expression supports:
      -   * - logical operators: AND, OR
      +   * Optional. Filter the partitions returned to the caller using a key value pair
      +   * expression. Supported operators and syntax:
      +   * - logic operators: AND, OR
          * - comparison operators: <, >, >=, <= ,=, !=
          * - LIKE operators:
      -   *     - The right hand of a LIKE operator supports “.” and
      -   *       “*” for wildcard searches, for example "value1 LIKE ".*oo.*"
      +   *   - The right hand of a LIKE operator supports "." and
      +   *     "*" for wildcard searches, for example "value1 LIKE ".*oo.*"
          * - parenthetical grouping: ( )
          * Sample filter expression: `?filter="key1 < value1 OR key2 > value2"
          * **Notes:**
      @@ -307,13 +307,13 @@ public java.lang.String getFilter() {
          *
          *
          * 
      -   * Optional. Filter the partitions returned to the caller using a key vslue pair
      -   * expression. The filter expression supports:
      -   * - logical operators: AND, OR
      +   * Optional. Filter the partitions returned to the caller using a key value pair
      +   * expression. Supported operators and syntax:
      +   * - logic operators: AND, OR
          * - comparison operators: <, >, >=, <= ,=, !=
          * - LIKE operators:
      -   *     - The right hand of a LIKE operator supports “.” and
      -   *       “*” for wildcard searches, for example "value1 LIKE ".*oo.*"
      +   *   - The right hand of a LIKE operator supports "." and
      +   *     "*" for wildcard searches, for example "value1 LIKE ".*oo.*"
          * - parenthetical grouping: ( )
          * Sample filter expression: `?filter="key1 < value1 OR key2 > value2"
          * **Notes:**
      @@ -1011,13 +1011,13 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
            *
            *
            * 
      -     * Optional. Filter the partitions returned to the caller using a key vslue pair
      -     * expression. The filter expression supports:
      -     * - logical operators: AND, OR
      +     * Optional. Filter the partitions returned to the caller using a key value pair
      +     * expression. Supported operators and syntax:
      +     * - logic operators: AND, OR
            * - comparison operators: <, >, >=, <= ,=, !=
            * - LIKE operators:
      -     *     - The right hand of a LIKE operator supports “.” and
      -     *       “*” for wildcard searches, for example "value1 LIKE ".*oo.*"
      +     *   - The right hand of a LIKE operator supports "." and
      +     *     "*" for wildcard searches, for example "value1 LIKE ".*oo.*"
            * - parenthetical grouping: ( )
            * Sample filter expression: `?filter="key1 < value1 OR key2 > value2"
            * **Notes:**
      @@ -1047,13 +1047,13 @@ public java.lang.String getFilter() {
            *
            *
            * 
      -     * Optional. Filter the partitions returned to the caller using a key vslue pair
      -     * expression. The filter expression supports:
      -     * - logical operators: AND, OR
      +     * Optional. Filter the partitions returned to the caller using a key value pair
      +     * expression. Supported operators and syntax:
      +     * - logic operators: AND, OR
            * - comparison operators: <, >, >=, <= ,=, !=
            * - LIKE operators:
      -     *     - The right hand of a LIKE operator supports “.” and
      -     *       “*” for wildcard searches, for example "value1 LIKE ".*oo.*"
      +     *   - The right hand of a LIKE operator supports "." and
      +     *     "*" for wildcard searches, for example "value1 LIKE ".*oo.*"
            * - parenthetical grouping: ( )
            * Sample filter expression: `?filter="key1 < value1 OR key2 > value2"
            * **Notes:**
      @@ -1083,13 +1083,13 @@ public com.google.protobuf.ByteString getFilterBytes() {
            *
            *
            * 
      -     * Optional. Filter the partitions returned to the caller using a key vslue pair
      -     * expression. The filter expression supports:
      -     * - logical operators: AND, OR
      +     * Optional. Filter the partitions returned to the caller using a key value pair
      +     * expression. Supported operators and syntax:
      +     * - logic operators: AND, OR
            * - comparison operators: <, >, >=, <= ,=, !=
            * - LIKE operators:
      -     *     - The right hand of a LIKE operator supports “.” and
      -     *       “*” for wildcard searches, for example "value1 LIKE ".*oo.*"
      +     *   - The right hand of a LIKE operator supports "." and
      +     *     "*" for wildcard searches, for example "value1 LIKE ".*oo.*"
            * - parenthetical grouping: ( )
            * Sample filter expression: `?filter="key1 < value1 OR key2 > value2"
            * **Notes:**
      @@ -1118,13 +1118,13 @@ public Builder setFilter(java.lang.String value) {
            *
            *
            * 
      -     * Optional. Filter the partitions returned to the caller using a key vslue pair
      -     * expression. The filter expression supports:
      -     * - logical operators: AND, OR
      +     * Optional. Filter the partitions returned to the caller using a key value pair
      +     * expression. Supported operators and syntax:
      +     * - logic operators: AND, OR
            * - comparison operators: <, >, >=, <= ,=, !=
            * - LIKE operators:
      -     *     - The right hand of a LIKE operator supports “.” and
      -     *       “*” for wildcard searches, for example "value1 LIKE ".*oo.*"
      +     *   - The right hand of a LIKE operator supports "." and
      +     *     "*" for wildcard searches, for example "value1 LIKE ".*oo.*"
            * - parenthetical grouping: ( )
            * Sample filter expression: `?filter="key1 < value1 OR key2 > value2"
            * **Notes:**
      @@ -1149,13 +1149,13 @@ public Builder clearFilter() {
            *
            *
            * 
      -     * Optional. Filter the partitions returned to the caller using a key vslue pair
      -     * expression. The filter expression supports:
      -     * - logical operators: AND, OR
      +     * Optional. Filter the partitions returned to the caller using a key value pair
      +     * expression. Supported operators and syntax:
      +     * - logic operators: AND, OR
            * - comparison operators: <, >, >=, <= ,=, !=
            * - LIKE operators:
      -     *     - The right hand of a LIKE operator supports “.” and
      -     *       “*” for wildcard searches, for example "value1 LIKE ".*oo.*"
      +     *   - The right hand of a LIKE operator supports "." and
      +     *     "*" for wildcard searches, for example "value1 LIKE ".*oo.*"
            * - parenthetical grouping: ( )
            * Sample filter expression: `?filter="key1 < value1 OR key2 > value2"
            * **Notes:**
      diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListPartitionsRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListPartitionsRequestOrBuilder.java
      index 9c8aac8..2f644da 100644
      --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListPartitionsRequestOrBuilder.java
      +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListPartitionsRequestOrBuilder.java
      @@ -104,13 +104,13 @@ public interface ListPartitionsRequestOrBuilder
          *
          *
          * 
      -   * Optional. Filter the partitions returned to the caller using a key vslue pair
      -   * expression. The filter expression supports:
      -   * - logical operators: AND, OR
      +   * Optional. Filter the partitions returned to the caller using a key value pair
      +   * expression. Supported operators and syntax:
      +   * - logic operators: AND, OR
          * - comparison operators: <, >, >=, <= ,=, !=
          * - LIKE operators:
      -   *     - The right hand of a LIKE operator supports “.” and
      -   *       “*” for wildcard searches, for example "value1 LIKE ".*oo.*"
      +   *   - The right hand of a LIKE operator supports "." and
      +   *     "*" for wildcard searches, for example "value1 LIKE ".*oo.*"
          * - parenthetical grouping: ( )
          * Sample filter expression: `?filter="key1 < value1 OR key2 > value2"
          * **Notes:**
      @@ -130,13 +130,13 @@ public interface ListPartitionsRequestOrBuilder
          *
          *
          * 
      -   * Optional. Filter the partitions returned to the caller using a key vslue pair
      -   * expression. The filter expression supports:
      -   * - logical operators: AND, OR
      +   * Optional. Filter the partitions returned to the caller using a key value pair
      +   * expression. Supported operators and syntax:
      +   * - logic operators: AND, OR
          * - comparison operators: <, >, >=, <= ,=, !=
          * - LIKE operators:
      -   *     - The right hand of a LIKE operator supports “.” and
      -   *       “*” for wildcard searches, for example "value1 LIKE ".*oo.*"
      +   *   - The right hand of a LIKE operator supports "." and
      +   *     "*" for wildcard searches, for example "value1 LIKE ".*oo.*"
          * - parenthetical grouping: ( )
          * Sample filter expression: `?filter="key1 < value1 OR key2 > value2"
          * **Notes:**
      diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListSessionsRequest.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListSessionsRequest.java
      index 4eaca67..ca97502 100644
      --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListSessionsRequest.java
      +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListSessionsRequest.java
      @@ -40,6 +40,7 @@ private ListSessionsRequest(com.google.protobuf.GeneratedMessageV3.Builder bu
         private ListSessionsRequest() {
           parent_ = "";
           pageToken_ = "";
      +    filter_ = "";
         }
       
         @java.lang.Override
      @@ -90,6 +91,13 @@ private ListSessionsRequest(
                     pageToken_ = s;
                     break;
                   }
      +          case 34:
      +            {
      +              java.lang.String s = input.readStringRequireUtf8();
      +
      +              filter_ = s;
      +              break;
      +            }
                 default:
                   {
                     if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
      @@ -133,7 +141,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
          *
          * 
          * Required. The resource name of the parent environment:
      -   * projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`.
          * 
      * * @@ -159,7 +167,7 @@ public java.lang.String getParent() { * *
          * Required. The resource name of the parent environment:
      -   * projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`.
          * 
      * * @@ -256,6 +264,69 @@ public com.google.protobuf.ByteString getPageTokenBytes() { } } + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
      +   * Optional. Filter request. The following `mode` filter is supported to return only the
      +   * sessions belonging to the requester when the mode is USER and return
      +   * sessions of all the users when the mode is ADMIN. When no filter is sent
      +   * default to USER mode.
      +   * NOTE: When the mode is ADMIN, the requester should have
      +   * `dataplex.environments.listAllSessions` permission to list all sessions,
      +   * in absence of the permission, the request fails.
      +   * mode = ADMIN | USER
      +   * 
      + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
      +   * Optional. Filter request. The following `mode` filter is supported to return only the
      +   * sessions belonging to the requester when the mode is USER and return
      +   * sessions of all the users when the mode is ADMIN. When no filter is sent
      +   * default to USER mode.
      +   * NOTE: When the mode is ADMIN, the requester should have
      +   * `dataplex.environments.listAllSessions` permission to list all sessions,
      +   * in absence of the permission, the request fails.
      +   * mode = ADMIN | USER
      +   * 
      + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -279,6 +350,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } unknownFields.writeTo(output); } @@ -297,6 +371,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -316,6 +393,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParent().equals(other.getParent())) return false; if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -333,6 +411,8 @@ public int hashCode() { hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -484,6 +564,8 @@ public Builder clear() { pageToken_ = ""; + filter_ = ""; + return this; } @@ -514,6 +596,7 @@ public com.google.cloud.dataplex.v1.ListSessionsRequest buildPartial() { result.parent_ = parent_; result.pageSize_ = pageSize_; result.pageToken_ = pageToken_; + result.filter_ = filter_; onBuilt(); return result; } @@ -575,6 +658,10 @@ public Builder mergeFrom(com.google.cloud.dataplex.v1.ListSessionsRequest other) pageToken_ = other.pageToken_; onChanged(); } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -610,7 +697,7 @@ public Builder mergeFrom( * *
            * Required. The resource name of the parent environment:
      -     * projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`.
            * 
      * * @@ -635,7 +722,7 @@ public java.lang.String getParent() { * *
            * Required. The resource name of the parent environment:
      -     * projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`.
            * 
      * * @@ -660,7 +747,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
            * Required. The resource name of the parent environment:
      -     * projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`.
            * 
      * * @@ -684,7 +771,7 @@ public Builder setParent(java.lang.String value) { * *
            * Required. The resource name of the parent environment:
      -     * projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`.
            * 
      * * @@ -704,7 +791,7 @@ public Builder clearParent() { * *
            * Required. The resource name of the parent environment:
      -     * projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`.
            * 
      * * @@ -904,6 +991,147 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object filter_ = ""; + /** + * + * + *
      +     * Optional. Filter request. The following `mode` filter is supported to return only the
      +     * sessions belonging to the requester when the mode is USER and return
      +     * sessions of all the users when the mode is ADMIN. When no filter is sent
      +     * default to USER mode.
      +     * NOTE: When the mode is ADMIN, the requester should have
      +     * `dataplex.environments.listAllSessions` permission to list all sessions,
      +     * in absence of the permission, the request fails.
      +     * mode = ADMIN | USER
      +     * 
      + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
      +     * Optional. Filter request. The following `mode` filter is supported to return only the
      +     * sessions belonging to the requester when the mode is USER and return
      +     * sessions of all the users when the mode is ADMIN. When no filter is sent
      +     * default to USER mode.
      +     * NOTE: When the mode is ADMIN, the requester should have
      +     * `dataplex.environments.listAllSessions` permission to list all sessions,
      +     * in absence of the permission, the request fails.
      +     * mode = ADMIN | USER
      +     * 
      + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
      +     * Optional. Filter request. The following `mode` filter is supported to return only the
      +     * sessions belonging to the requester when the mode is USER and return
      +     * sessions of all the users when the mode is ADMIN. When no filter is sent
      +     * default to USER mode.
      +     * NOTE: When the mode is ADMIN, the requester should have
      +     * `dataplex.environments.listAllSessions` permission to list all sessions,
      +     * in absence of the permission, the request fails.
      +     * mode = ADMIN | USER
      +     * 
      + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
      +     * Optional. Filter request. The following `mode` filter is supported to return only the
      +     * sessions belonging to the requester when the mode is USER and return
      +     * sessions of all the users when the mode is ADMIN. When no filter is sent
      +     * default to USER mode.
      +     * NOTE: When the mode is ADMIN, the requester should have
      +     * `dataplex.environments.listAllSessions` permission to list all sessions,
      +     * in absence of the permission, the request fails.
      +     * mode = ADMIN | USER
      +     * 
      + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
      +     * Optional. Filter request. The following `mode` filter is supported to return only the
      +     * sessions belonging to the requester when the mode is USER and return
      +     * sessions of all the users when the mode is ADMIN. When no filter is sent
      +     * default to USER mode.
      +     * NOTE: When the mode is ADMIN, the requester should have
      +     * `dataplex.environments.listAllSessions` permission to list all sessions,
      +     * in absence of the permission, the request fails.
      +     * mode = ADMIN | USER
      +     * 
      + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListSessionsRequestOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListSessionsRequestOrBuilder.java index a927eb9..9e2318d 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListSessionsRequestOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ListSessionsRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface ListSessionsRequestOrBuilder * *
          * Required. The resource name of the parent environment:
      -   * projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`.
          * 
      * * @@ -43,7 +43,7 @@ public interface ListSessionsRequestOrBuilder * *
          * Required. The resource name of the parent environment:
      -   * projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`.
          * 
      * * @@ -99,4 +99,43 @@ public interface ListSessionsRequestOrBuilder * @return The bytes for pageToken. */ com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
      +   * Optional. Filter request. The following `mode` filter is supported to return only the
      +   * sessions belonging to the requester when the mode is USER and return
      +   * sessions of all the users when the mode is ADMIN. When no filter is sent
      +   * default to USER mode.
      +   * NOTE: When the mode is ADMIN, the requester should have
      +   * `dataplex.environments.listAllSessions` permission to list all sessions,
      +   * in absence of the permission, the request fails.
      +   * mode = ADMIN | USER
      +   * 
      + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
      +   * Optional. Filter request. The following `mode` filter is supported to return only the
      +   * sessions belonging to the requester when the mode is USER and return
      +   * sessions of all the users when the mode is ADMIN. When no filter is sent
      +   * default to USER mode.
      +   * NOTE: When the mode is ADMIN, the requester should have
      +   * `dataplex.environments.listAllSessions` permission to list all sessions,
      +   * in absence of the permission, the request fails.
      +   * mode = ADMIN | USER
      +   * 
      + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); } diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/LogsProto.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/LogsProto.java index 51e435f..b7d66c1 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/LogsProto.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/LogsProto.java @@ -75,7 +75,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n#google/cloud/dataplex/v1/logs.proto\022\030g" + "oogle.cloud.dataplex.v1\032\036google/protobuf" + "/duration.proto\032\037google/protobuf/timesta" - + "mp.proto\"\377\010\n\016DiscoveryEvent\022\017\n\007message\030\001" + + "mp.proto\"\240\t\n\016DiscoveryEvent\022\017\n\007message\030\001" + " \001(\t\022\017\n\007lake_id\030\002 \001(\t\022\017\n\007zone_id\030\003 \001(\t\022\020" + "\n\010asset_id\030\004 \001(\t\022\025\n\rdata_location\030\005 \001(\t\022" + "@\n\004type\030\n \001(\01622.google.cloud.dataplex.v1" @@ -93,49 +93,49 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\017ParametersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002" + " \001(\t:\0028\001\032b\n\rEntityDetails\022\016\n\006entity\030\001 \001(" + "\t\022A\n\004type\030\002 \001(\01623.google.cloud.dataplex." - + "v1.DiscoveryEvent.EntityType\032x\n\020Partitio" - + "nDetails\022\021\n\tpartition\030\001 \001(\t\022\016\n\006entity\030\002 " - + "\001(\t\022A\n\004type\030\003 \001(\01623.google.cloud.dataple" - + "x.v1.DiscoveryEvent.EntityType\032\035\n\rAction" - + "Details\022\014\n\004type\030\001 \001(\t\"\264\001\n\tEventType\022\032\n\026E" - + "VENT_TYPE_UNSPECIFIED\020\000\022\n\n\006CONFIG\020\001\022\022\n\016E" - + "NTITY_CREATED\020\002\022\022\n\016ENTITY_UPDATED\020\003\022\022\n\016E" - + "NTITY_DELETED\020\004\022\025\n\021PARTITION_CREATED\020\005\022\025" - + "\n\021PARTITION_UPDATED\020\006\022\025\n\021PARTITION_DELET" - + "ED\020\007\"A\n\nEntityType\022\033\n\027ENTITY_TYPE_UNSPEC" - + "IFIED\020\000\022\t\n\005TABLE\020\001\022\013\n\007FILESET\020\002B\t\n\007detai" - + "ls\"\234\004\n\010JobEvent\022\017\n\007message\030\001 \001(\t\022\016\n\006job_" - + "id\030\002 \001(\t\022.\n\nstart_time\030\003 \001(\0132\032.google.pr" - + "otobuf.Timestamp\022,\n\010end_time\030\004 \001(\0132\032.goo" - + "gle.protobuf.Timestamp\0227\n\005state\030\005 \001(\0162(." - + "google.cloud.dataplex.v1.JobEvent.State\022" - + "\017\n\007retries\030\006 \001(\005\0225\n\004type\030\007 \001(\0162\'.google." - + "cloud.dataplex.v1.JobEvent.Type\022;\n\007servi" - + "ce\030\010 \001(\0162*.google.cloud.dataplex.v1.JobE" - + "vent.Service\022\023\n\013service_job\030\t \001(\t\"5\n\004Typ" - + "e\022\024\n\020TYPE_UNSPECIFIED\020\000\022\t\n\005SPARK\020\001\022\014\n\010NO" - + "TEBOOK\020\002\"U\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000" - + "\022\r\n\tSUCCEEDED\020\001\022\n\n\006FAILED\020\002\022\r\n\tCANCELLED" - + "\020\003\022\013\n\007ABORTED\020\004\"0\n\007Service\022\027\n\023SERVICE_UN" - + "SPECIFIED\020\000\022\014\n\010DATAPROC\020\001\"\302\004\n\014SessionEve" - + "nt\022\017\n\007message\030\001 \001(\t\022\017\n\007user_id\030\002 \001(\t\022\022\n\n" - + "session_id\030\003 \001(\t\022>\n\004type\030\004 \001(\01620.google." - + "cloud.dataplex.v1.SessionEvent.EventType" - + "\022C\n\005query\030\005 \001(\01322.google.cloud.dataplex." - + "v1.SessionEvent.QueryDetailH\000\032\243\002\n\013QueryD" - + "etail\022\020\n\010query_id\030\001 \001(\t\022\022\n\nquery_text\030\002 " - + "\001(\t\022I\n\006engine\030\003 \001(\01629.google.cloud.datap" - + "lex.v1.SessionEvent.QueryDetail.Engine\022+" - + "\n\010duration\030\004 \001(\0132\031.google.protobuf.Durat" - + "ion\022\031\n\021result_size_bytes\030\005 \001(\003\022\034\n\024data_p" - + "rocessed_bytes\030\006 \001(\003\"=\n\006Engine\022\026\n\022ENGINE" - + "_UNSPECIFIED\020\000\022\r\n\tSPARK_SQL\020\001\022\014\n\010BIGQUER" - + "Y\020\002\"G\n\tEventType\022\032\n\026EVENT_TYPE_UNSPECIFI" - + "ED\020\000\022\t\n\005START\020\001\022\010\n\004STOP\020\002\022\t\n\005QUERY\020\003B\010\n\006" - + "detailBm\n\034com.google.cloud.dataplex.v1B\t" - + "LogsProtoP\001Z@google.golang.org/genproto/" - + "googleapis/cloud/dataplex/v1;dataplexb\006p" - + "roto3" + + "v1.DiscoveryEvent.EntityType\032\230\001\n\020Partiti" + + "onDetails\022\021\n\tpartition\030\001 \001(\t\022\016\n\006entity\030\002" + + " \001(\t\022A\n\004type\030\003 \001(\01623.google.cloud.datapl" + + "ex.v1.DiscoveryEvent.EntityType\022\036\n\026sampl" + + "ed_data_locations\030\004 \003(\t\032\035\n\rActionDetails" + + "\022\014\n\004type\030\001 \001(\t\"\264\001\n\tEventType\022\032\n\026EVENT_TY" + + "PE_UNSPECIFIED\020\000\022\n\n\006CONFIG\020\001\022\022\n\016ENTITY_C" + + "REATED\020\002\022\022\n\016ENTITY_UPDATED\020\003\022\022\n\016ENTITY_D" + + "ELETED\020\004\022\025\n\021PARTITION_CREATED\020\005\022\025\n\021PARTI" + + "TION_UPDATED\020\006\022\025\n\021PARTITION_DELETED\020\007\"A\n" + + "\nEntityType\022\033\n\027ENTITY_TYPE_UNSPECIFIED\020\000" + + "\022\t\n\005TABLE\020\001\022\013\n\007FILESET\020\002B\t\n\007details\"\234\004\n\010" + + "JobEvent\022\017\n\007message\030\001 \001(\t\022\016\n\006job_id\030\002 \001(" + + "\t\022.\n\nstart_time\030\003 \001(\0132\032.google.protobuf." + + "Timestamp\022,\n\010end_time\030\004 \001(\0132\032.google.pro" + + "tobuf.Timestamp\0227\n\005state\030\005 \001(\0162(.google." + + "cloud.dataplex.v1.JobEvent.State\022\017\n\007retr" + + "ies\030\006 \001(\005\0225\n\004type\030\007 \001(\0162\'.google.cloud.d" + + "ataplex.v1.JobEvent.Type\022;\n\007service\030\010 \001(" + + "\0162*.google.cloud.dataplex.v1.JobEvent.Se" + + "rvice\022\023\n\013service_job\030\t \001(\t\"5\n\004Type\022\024\n\020TY" + + "PE_UNSPECIFIED\020\000\022\t\n\005SPARK\020\001\022\014\n\010NOTEBOOK\020" + + "\002\"U\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\r\n\tSUC" + + "CEEDED\020\001\022\n\n\006FAILED\020\002\022\r\n\tCANCELLED\020\003\022\013\n\007A" + + "BORTED\020\004\"0\n\007Service\022\027\n\023SERVICE_UNSPECIFI" + + "ED\020\000\022\014\n\010DATAPROC\020\001\"\302\004\n\014SessionEvent\022\017\n\007m" + + "essage\030\001 \001(\t\022\017\n\007user_id\030\002 \001(\t\022\022\n\nsession" + + "_id\030\003 \001(\t\022>\n\004type\030\004 \001(\01620.google.cloud.d" + + "ataplex.v1.SessionEvent.EventType\022C\n\005que" + + "ry\030\005 \001(\01322.google.cloud.dataplex.v1.Sess" + + "ionEvent.QueryDetailH\000\032\243\002\n\013QueryDetail\022\020" + + "\n\010query_id\030\001 \001(\t\022\022\n\nquery_text\030\002 \001(\t\022I\n\006" + + "engine\030\003 \001(\01629.google.cloud.dataplex.v1." + + "SessionEvent.QueryDetail.Engine\022+\n\010durat" + + "ion\030\004 \001(\0132\031.google.protobuf.Duration\022\031\n\021" + + "result_size_bytes\030\005 \001(\003\022\034\n\024data_processe" + + "d_bytes\030\006 \001(\003\"=\n\006Engine\022\026\n\022ENGINE_UNSPEC" + + "IFIED\020\000\022\r\n\tSPARK_SQL\020\001\022\014\n\010BIGQUERY\020\002\"G\n\t" + + "EventType\022\032\n\026EVENT_TYPE_UNSPECIFIED\020\000\022\t\n" + + "\005START\020\001\022\010\n\004STOP\020\002\022\t\n\005QUERY\020\003B\010\n\006detailB" + + "m\n\034com.google.cloud.dataplex.v1B\tLogsPro" + + "toP\001Z@google.golang.org/genproto/googlea" + + "pis/cloud/dataplex/v1;dataplexb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -194,7 +194,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataplex_v1_DiscoveryEvent_PartitionDetails_descriptor, new java.lang.String[] { - "Partition", "Entity", "Type", + "Partition", "Entity", "Type", "SampledDataLocations", }); internal_static_google_cloud_dataplex_v1_DiscoveryEvent_ActionDetails_descriptor = internal_static_google_cloud_dataplex_v1_DiscoveryEvent_descriptor.getNestedTypes().get(3); diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Partition.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Partition.java index 2fd6f0f..59f8d05 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Partition.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Partition.java @@ -150,13 +150,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
      -   * Output only. The values must be HTML URL encoded two times before constructing the path.
      -   * For example, if you have a value of "US:CA", encoded it two times and you
      -   * get "US%253ACA". Then if you have the 2nd value is "CA#Sunnyvale", encoded
      -   * two times and you get "CA%2523Sunnyvale". The partition values path is
      -   * "US%253ACA/CA%2523Sunnyvale". The final URL will be
      -   * "https://.../partitions/US%253ACA/CA%2523Sunnyvale". The name field in the
      -   * responses will always have the encoded format.
      +   * Output only. Partition values used in the HTTP URL must be
      +   * double encoded. For example, `url_encode(url_encode(value))` can be used
      +   * to encode "US:CA/CA#Sunnyvale so that the request URL ends
      +   * with "/partitions/US%253ACA/CA%2523Sunnyvale".
      +   * The name field in the response retains the encoded format.
          * 
      * * @@ -181,13 +179,11 @@ public java.lang.String getName() { * * *
      -   * Output only. The values must be HTML URL encoded two times before constructing the path.
      -   * For example, if you have a value of "US:CA", encoded it two times and you
      -   * get "US%253ACA". Then if you have the 2nd value is "CA#Sunnyvale", encoded
      -   * two times and you get "CA%2523Sunnyvale". The partition values path is
      -   * "US%253ACA/CA%2523Sunnyvale". The final URL will be
      -   * "https://.../partitions/US%253ACA/CA%2523Sunnyvale". The name field in the
      -   * responses will always have the encoded format.
      +   * Output only. Partition values used in the HTTP URL must be
      +   * double encoded. For example, `url_encode(url_encode(value))` can be used
      +   * to encode "US:CA/CA#Sunnyvale so that the request URL ends
      +   * with "/partitions/US%253ACA/CA%2523Sunnyvale".
      +   * The name field in the response retains the encoded format.
          * 
      * * @@ -351,7 +347,7 @@ public com.google.protobuf.ByteString getLocationBytes() { * string etag = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.Partition.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=514 + * google/cloud/dataplex/v1/metadata.proto;l=515 * @return The etag. */ @java.lang.Override @@ -377,7 +373,7 @@ public java.lang.String getEtag() { * string etag = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.Partition.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=514 + * google/cloud/dataplex/v1/metadata.proto;l=515 * @return The bytes for etag. */ @java.lang.Override @@ -782,13 +778,11 @@ public Builder mergeFrom( * * *
      -     * Output only. The values must be HTML URL encoded two times before constructing the path.
      -     * For example, if you have a value of "US:CA", encoded it two times and you
      -     * get "US%253ACA". Then if you have the 2nd value is "CA#Sunnyvale", encoded
      -     * two times and you get "CA%2523Sunnyvale". The partition values path is
      -     * "US%253ACA/CA%2523Sunnyvale". The final URL will be
      -     * "https://.../partitions/US%253ACA/CA%2523Sunnyvale". The name field in the
      -     * responses will always have the encoded format.
      +     * Output only. Partition values used in the HTTP URL must be
      +     * double encoded. For example, `url_encode(url_encode(value))` can be used
      +     * to encode "US:CA/CA#Sunnyvale so that the request URL ends
      +     * with "/partitions/US%253ACA/CA%2523Sunnyvale".
      +     * The name field in the response retains the encoded format.
            * 
      * * @@ -812,13 +806,11 @@ public java.lang.String getName() { * * *
      -     * Output only. The values must be HTML URL encoded two times before constructing the path.
      -     * For example, if you have a value of "US:CA", encoded it two times and you
      -     * get "US%253ACA". Then if you have the 2nd value is "CA#Sunnyvale", encoded
      -     * two times and you get "CA%2523Sunnyvale". The partition values path is
      -     * "US%253ACA/CA%2523Sunnyvale". The final URL will be
      -     * "https://.../partitions/US%253ACA/CA%2523Sunnyvale". The name field in the
      -     * responses will always have the encoded format.
      +     * Output only. Partition values used in the HTTP URL must be
      +     * double encoded. For example, `url_encode(url_encode(value))` can be used
      +     * to encode "US:CA/CA#Sunnyvale so that the request URL ends
      +     * with "/partitions/US%253ACA/CA%2523Sunnyvale".
      +     * The name field in the response retains the encoded format.
            * 
      * * @@ -842,13 +834,11 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
      -     * Output only. The values must be HTML URL encoded two times before constructing the path.
      -     * For example, if you have a value of "US:CA", encoded it two times and you
      -     * get "US%253ACA". Then if you have the 2nd value is "CA#Sunnyvale", encoded
      -     * two times and you get "CA%2523Sunnyvale". The partition values path is
      -     * "US%253ACA/CA%2523Sunnyvale". The final URL will be
      -     * "https://.../partitions/US%253ACA/CA%2523Sunnyvale". The name field in the
      -     * responses will always have the encoded format.
      +     * Output only. Partition values used in the HTTP URL must be
      +     * double encoded. For example, `url_encode(url_encode(value))` can be used
      +     * to encode "US:CA/CA#Sunnyvale so that the request URL ends
      +     * with "/partitions/US%253ACA/CA%2523Sunnyvale".
      +     * The name field in the response retains the encoded format.
            * 
      * * @@ -871,13 +861,11 @@ public Builder setName(java.lang.String value) { * * *
      -     * Output only. The values must be HTML URL encoded two times before constructing the path.
      -     * For example, if you have a value of "US:CA", encoded it two times and you
      -     * get "US%253ACA". Then if you have the 2nd value is "CA#Sunnyvale", encoded
      -     * two times and you get "CA%2523Sunnyvale". The partition values path is
      -     * "US%253ACA/CA%2523Sunnyvale". The final URL will be
      -     * "https://.../partitions/US%253ACA/CA%2523Sunnyvale". The name field in the
      -     * responses will always have the encoded format.
      +     * Output only. Partition values used in the HTTP URL must be
      +     * double encoded. For example, `url_encode(url_encode(value))` can be used
      +     * to encode "US:CA/CA#Sunnyvale so that the request URL ends
      +     * with "/partitions/US%253ACA/CA%2523Sunnyvale".
      +     * The name field in the response retains the encoded format.
            * 
      * * @@ -896,13 +884,11 @@ public Builder clearName() { * * *
      -     * Output only. The values must be HTML URL encoded two times before constructing the path.
      -     * For example, if you have a value of "US:CA", encoded it two times and you
      -     * get "US%253ACA". Then if you have the 2nd value is "CA#Sunnyvale", encoded
      -     * two times and you get "CA%2523Sunnyvale". The partition values path is
      -     * "US%253ACA/CA%2523Sunnyvale". The final URL will be
      -     * "https://.../partitions/US%253ACA/CA%2523Sunnyvale". The name field in the
      -     * responses will always have the encoded format.
      +     * Output only. Partition values used in the HTTP URL must be
      +     * double encoded. For example, `url_encode(url_encode(value))` can be used
      +     * to encode "US:CA/CA#Sunnyvale so that the request URL ends
      +     * with "/partitions/US%253ACA/CA%2523Sunnyvale".
      +     * The name field in the response retains the encoded format.
            * 
      * * @@ -1255,7 +1241,7 @@ public Builder setLocationBytes(com.google.protobuf.ByteString value) { * string etag = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.Partition.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=514 + * google/cloud/dataplex/v1/metadata.proto;l=515 * @return The etag. */ @java.lang.Deprecated @@ -1280,7 +1266,7 @@ public java.lang.String getEtag() { * string etag = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.Partition.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=514 + * google/cloud/dataplex/v1/metadata.proto;l=515 * @return The bytes for etag. */ @java.lang.Deprecated @@ -1305,7 +1291,7 @@ public com.google.protobuf.ByteString getEtagBytes() { * string etag = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.Partition.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=514 + * google/cloud/dataplex/v1/metadata.proto;l=515 * @param value The etag to set. * @return This builder for chaining. */ @@ -1329,7 +1315,7 @@ public Builder setEtag(java.lang.String value) { * string etag = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.Partition.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=514 + * google/cloud/dataplex/v1/metadata.proto;l=515 * @return This builder for chaining. */ @java.lang.Deprecated @@ -1349,7 +1335,7 @@ public Builder clearEtag() { * string etag = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.Partition.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=514 + * google/cloud/dataplex/v1/metadata.proto;l=515 * @param value The bytes for etag to set. * @return This builder for chaining. */ diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/PartitionOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/PartitionOrBuilder.java index 8b16d69..32e890d 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/PartitionOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/PartitionOrBuilder.java @@ -27,13 +27,11 @@ public interface PartitionOrBuilder * * *
      -   * Output only. The values must be HTML URL encoded two times before constructing the path.
      -   * For example, if you have a value of "US:CA", encoded it two times and you
      -   * get "US%253ACA". Then if you have the 2nd value is "CA#Sunnyvale", encoded
      -   * two times and you get "CA%2523Sunnyvale". The partition values path is
      -   * "US%253ACA/CA%2523Sunnyvale". The final URL will be
      -   * "https://.../partitions/US%253ACA/CA%2523Sunnyvale". The name field in the
      -   * responses will always have the encoded format.
      +   * Output only. Partition values used in the HTTP URL must be
      +   * double encoded. For example, `url_encode(url_encode(value))` can be used
      +   * to encode "US:CA/CA#Sunnyvale so that the request URL ends
      +   * with "/partitions/US%253ACA/CA%2523Sunnyvale".
      +   * The name field in the response retains the encoded format.
          * 
      * * @@ -47,13 +45,11 @@ public interface PartitionOrBuilder * * *
      -   * Output only. The values must be HTML URL encoded two times before constructing the path.
      -   * For example, if you have a value of "US:CA", encoded it two times and you
      -   * get "US%253ACA". Then if you have the 2nd value is "CA#Sunnyvale", encoded
      -   * two times and you get "CA%2523Sunnyvale". The partition values path is
      -   * "US%253ACA/CA%2523Sunnyvale". The final URL will be
      -   * "https://.../partitions/US%253ACA/CA%2523Sunnyvale". The name field in the
      -   * responses will always have the encoded format.
      +   * Output only. Partition values used in the HTTP URL must be
      +   * double encoded. For example, `url_encode(url_encode(value))` can be used
      +   * to encode "US:CA/CA#Sunnyvale so that the request URL ends
      +   * with "/partitions/US%253ACA/CA%2523Sunnyvale".
      +   * The name field in the response retains the encoded format.
          * 
      * * @@ -170,7 +166,7 @@ public interface PartitionOrBuilder * string etag = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.Partition.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=514 + * google/cloud/dataplex/v1/metadata.proto;l=515 * @return The etag. */ @java.lang.Deprecated @@ -185,7 +181,7 @@ public interface PartitionOrBuilder * string etag = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * * @deprecated google.cloud.dataplex.v1.Partition.etag is deprecated. See - * google/cloud/dataplex/v1/metadata.proto;l=514 + * google/cloud/dataplex/v1/metadata.proto;l=515 * @return The bytes for etag. */ @java.lang.Deprecated diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Schema.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Schema.java index c8a1513..1dd2e87 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Schema.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Schema.java @@ -924,8 +924,9 @@ public interface SchemaFieldOrBuilder * * *
      -     * Required. The name of the field. The maximum length is 767 characters. The name
      -     * must begins with a letter and not contains `:` and `.`.
      +     * Required. The name of the field. Must contain only letters, numbers and
      +     * underscores, with a maximum length of 767 characters,
      +     * and must begin with a letter or underscore.
            * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -937,8 +938,9 @@ public interface SchemaFieldOrBuilder * * *
      -     * Required. The name of the field. The maximum length is 767 characters. The name
      -     * must begins with a letter and not contains `:` and `.`.
      +     * Required. The name of the field. Must contain only letters, numbers and
      +     * underscores, with a maximum length of 767 characters,
      +     * and must begin with a letter or underscore.
            * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -1237,8 +1239,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
      -     * Required. The name of the field. The maximum length is 767 characters. The name
      -     * must begins with a letter and not contains `:` and `.`.
      +     * Required. The name of the field. Must contain only letters, numbers and
      +     * underscores, with a maximum length of 767 characters,
      +     * and must begin with a letter or underscore.
            * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -1261,8 +1264,9 @@ public java.lang.String getName() { * * *
      -     * Required. The name of the field. The maximum length is 767 characters. The name
      -     * must begins with a letter and not contains `:` and `.`.
      +     * Required. The name of the field. Must contain only letters, numbers and
      +     * underscores, with a maximum length of 767 characters,
      +     * and must begin with a letter or underscore.
            * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -1923,8 +1927,9 @@ public Builder mergeFrom( * * *
      -       * Required. The name of the field. The maximum length is 767 characters. The name
      -       * must begins with a letter and not contains `:` and `.`.
      +       * Required. The name of the field. Must contain only letters, numbers and
      +       * underscores, with a maximum length of 767 characters,
      +       * and must begin with a letter or underscore.
              * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -1946,8 +1951,9 @@ public java.lang.String getName() { * * *
      -       * Required. The name of the field. The maximum length is 767 characters. The name
      -       * must begins with a letter and not contains `:` and `.`.
      +       * Required. The name of the field. Must contain only letters, numbers and
      +       * underscores, with a maximum length of 767 characters,
      +       * and must begin with a letter or underscore.
              * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -1969,8 +1975,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
      -       * Required. The name of the field. The maximum length is 767 characters. The name
      -       * must begins with a letter and not contains `:` and `.`.
      +       * Required. The name of the field. Must contain only letters, numbers and
      +       * underscores, with a maximum length of 767 characters,
      +       * and must begin with a letter or underscore.
              * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -1991,8 +1998,9 @@ public Builder setName(java.lang.String value) { * * *
      -       * Required. The name of the field. The maximum length is 767 characters. The name
      -       * must begins with a letter and not contains `:` and `.`.
      +       * Required. The name of the field. Must contain only letters, numbers and
      +       * underscores, with a maximum length of 767 characters,
      +       * and must begin with a letter or underscore.
              * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2009,8 +2017,9 @@ public Builder clearName() { * * *
      -       * Required. The name of the field. The maximum length is 767 characters. The name
      -       * must begins with a letter and not contains `:` and `.`.
      +       * Required. The name of the field. Must contain only letters, numbers and
      +       * underscores, with a maximum length of 767 characters,
      +       * and must begin with a letter or underscore.
              * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2792,8 +2801,9 @@ public interface PartitionFieldOrBuilder * * *
      -     * Required. Partition name is editable if only the partition style is not HIVE
      -     * compatible. The maximum length allowed is 767 characters.
      +     * Required. Partition field name must consist of letters, numbers, and underscores
      +     * only, with a maximum of length of 256 characters,
      +     * and must begin with a letter or underscore..
            * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2805,8 +2815,9 @@ public interface PartitionFieldOrBuilder * * *
      -     * Required. Partition name is editable if only the partition style is not HIVE
      -     * compatible. The maximum length allowed is 767 characters.
      +     * Required. Partition field name must consist of letters, numbers, and underscores
      +     * only, with a maximum of length of 256 characters,
      +     * and must begin with a letter or underscore..
            * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2850,7 +2861,8 @@ public interface PartitionFieldOrBuilder *
          * Represents a key field within the entity's partition structure. You could
          * have up to 20 partition fields, but only the first 10 partitions have the
      -   * filtering ability due to performance consideration.
      +   * filtering ability due to performance consideration. **Note:**
      +   * Partition fields are immutable.
          * 
      * * Protobuf type {@code google.cloud.dataplex.v1.Schema.PartitionField} @@ -2955,8 +2967,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
      -     * Required. Partition name is editable if only the partition style is not HIVE
      -     * compatible. The maximum length allowed is 767 characters.
      +     * Required. Partition field name must consist of letters, numbers, and underscores
      +     * only, with a maximum of length of 256 characters,
      +     * and must begin with a letter or underscore..
            * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2979,8 +2992,9 @@ public java.lang.String getName() { * * *
      -     * Required. Partition name is editable if only the partition style is not HIVE
      -     * compatible. The maximum length allowed is 767 characters.
      +     * Required. Partition field name must consist of letters, numbers, and underscores
      +     * only, with a maximum of length of 256 characters,
      +     * and must begin with a letter or underscore..
            * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -3215,7 +3229,8 @@ protected Builder newBuilderForType( *
            * Represents a key field within the entity's partition structure. You could
            * have up to 20 partition fields, but only the first 10 partitions have the
      -     * filtering ability due to performance consideration.
      +     * filtering ability due to performance consideration. **Note:**
      +     * Partition fields are immutable.
            * 
      * * Protobuf type {@code google.cloud.dataplex.v1.Schema.PartitionField} @@ -3384,8 +3399,9 @@ public Builder mergeFrom( * * *
      -       * Required. Partition name is editable if only the partition style is not HIVE
      -       * compatible. The maximum length allowed is 767 characters.
      +       * Required. Partition field name must consist of letters, numbers, and underscores
      +       * only, with a maximum of length of 256 characters,
      +       * and must begin with a letter or underscore..
              * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -3407,8 +3423,9 @@ public java.lang.String getName() { * * *
      -       * Required. Partition name is editable if only the partition style is not HIVE
      -       * compatible. The maximum length allowed is 767 characters.
      +       * Required. Partition field name must consist of letters, numbers, and underscores
      +       * only, with a maximum of length of 256 characters,
      +       * and must begin with a letter or underscore..
              * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -3430,8 +3447,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
      -       * Required. Partition name is editable if only the partition style is not HIVE
      -       * compatible. The maximum length allowed is 767 characters.
      +       * Required. Partition field name must consist of letters, numbers, and underscores
      +       * only, with a maximum of length of 256 characters,
      +       * and must begin with a letter or underscore..
              * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -3452,8 +3470,9 @@ public Builder setName(java.lang.String value) { * * *
      -       * Required. Partition name is editable if only the partition style is not HIVE
      -       * compatible. The maximum length allowed is 767 characters.
      +       * Required. Partition field name must consist of letters, numbers, and underscores
      +       * only, with a maximum of length of 256 characters,
      +       * and must begin with a letter or underscore..
              * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -3470,8 +3489,9 @@ public Builder clearName() { * * *
      -       * Required. Partition name is editable if only the partition style is not HIVE
      -       * compatible. The maximum length allowed is 767 characters.
      +       * Required. Partition field name must consist of letters, numbers, and underscores
      +       * only, with a maximum of length of 256 characters,
      +       * and must begin with a letter or underscore..
              * 
      * * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -3649,23 +3669,17 @@ public com.google.cloud.dataplex.v1.Schema.PartitionField getDefaultInstanceForT * * *
      -   * Required. Whether the schema is user-managed or managed by the service.
      -   * - Set user_manage to false if you would like Dataplex to help you manage
      -   * the schema. You will get the full service provided by Dataplex discovery,
      -   * including new data discovery, schema inference and schema evolution. You
      -   * can still provide input the schema of the entities, for example renaming a
      -   * schema field, changing CSV or Json options if you think the discovered
      -   * values are not as accurate. Dataplex will consider your input as the
      -   * initial schema (as if they were produced by the previous discovery run),
      -   * and will evolve schema or flag actions based on that.
      -   * - Set user_manage to true if you would like to fully manage the entity
      -   * schema by yourself. This is useful when you would like to manually specify
      -   * the schema for a table. In this case, the schema defined by the user is
      -   * guaranteed to be kept unchanged and would not be overwritten. But this also
      -   * means Dataplex will not provide schema evolution management for you.
      -   * Dataplex will still be able to manage partition registration (i.e., keeping
      -   * the list of partitions up to date) when Dataplex discovery is turned on and
      -   * user_managed is set to true.
      +   * Required. Set to `true` if user-managed or `false` if managed by Dataplex. The
      +   * default is `false` (managed by Dataplex).
      +   * - Set to `false`to enable Dataplex discovery to update the schema.
      +   *   including new data discovery, schema inference, and schema evolution.
      +   *   Users retain the ability to input and edit the schema. Dataplex
      +   *   treats schema input by the user as though produced
      +   *   by a previous Dataplex discovery operation, and it will
      +   *   evolve the schema and take action based on that treatment.
      +   * - Set to `true` to fully manage the entity
      +   *   schema. This setting guarantees that Dataplex will not
      +   *   change schema fields.
          * 
      * * bool user_managed = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -3684,6 +3698,7 @@ public boolean getUserManaged() { * *
          * Optional. The sequence of fields describing data in table entities.
      +   * **Note:** BigQuery SchemaFields are immutable.
          * 
      * * @@ -3699,6 +3714,7 @@ public java.util.List getFields * *
          * Optional. The sequence of fields describing data in table entities.
      +   * **Note:** BigQuery SchemaFields are immutable.
          * 
      * * @@ -3715,6 +3731,7 @@ public java.util.List getFields * *
          * Optional. The sequence of fields describing data in table entities.
      +   * **Note:** BigQuery SchemaFields are immutable.
          * 
      * * @@ -3730,6 +3747,7 @@ public int getFieldsCount() { * *
          * Optional. The sequence of fields describing data in table entities.
      +   * **Note:** BigQuery SchemaFields are immutable.
          * 
      * * @@ -3745,6 +3763,7 @@ public com.google.cloud.dataplex.v1.Schema.SchemaField getFields(int index) { * *
          * Optional. The sequence of fields describing data in table entities.
      +   * **Note:** BigQuery SchemaFields are immutable.
          * 
      * * @@ -4332,23 +4351,17 @@ public Builder mergeFrom( * * *
      -     * Required. Whether the schema is user-managed or managed by the service.
      -     * - Set user_manage to false if you would like Dataplex to help you manage
      -     * the schema. You will get the full service provided by Dataplex discovery,
      -     * including new data discovery, schema inference and schema evolution. You
      -     * can still provide input the schema of the entities, for example renaming a
      -     * schema field, changing CSV or Json options if you think the discovered
      -     * values are not as accurate. Dataplex will consider your input as the
      -     * initial schema (as if they were produced by the previous discovery run),
      -     * and will evolve schema or flag actions based on that.
      -     * - Set user_manage to true if you would like to fully manage the entity
      -     * schema by yourself. This is useful when you would like to manually specify
      -     * the schema for a table. In this case, the schema defined by the user is
      -     * guaranteed to be kept unchanged and would not be overwritten. But this also
      -     * means Dataplex will not provide schema evolution management for you.
      -     * Dataplex will still be able to manage partition registration (i.e., keeping
      -     * the list of partitions up to date) when Dataplex discovery is turned on and
      -     * user_managed is set to true.
      +     * Required. Set to `true` if user-managed or `false` if managed by Dataplex. The
      +     * default is `false` (managed by Dataplex).
      +     * - Set to `false`to enable Dataplex discovery to update the schema.
      +     *   including new data discovery, schema inference, and schema evolution.
      +     *   Users retain the ability to input and edit the schema. Dataplex
      +     *   treats schema input by the user as though produced
      +     *   by a previous Dataplex discovery operation, and it will
      +     *   evolve the schema and take action based on that treatment.
      +     * - Set to `true` to fully manage the entity
      +     *   schema. This setting guarantees that Dataplex will not
      +     *   change schema fields.
            * 
      * * bool user_managed = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4363,23 +4376,17 @@ public boolean getUserManaged() { * * *
      -     * Required. Whether the schema is user-managed or managed by the service.
      -     * - Set user_manage to false if you would like Dataplex to help you manage
      -     * the schema. You will get the full service provided by Dataplex discovery,
      -     * including new data discovery, schema inference and schema evolution. You
      -     * can still provide input the schema of the entities, for example renaming a
      -     * schema field, changing CSV or Json options if you think the discovered
      -     * values are not as accurate. Dataplex will consider your input as the
      -     * initial schema (as if they were produced by the previous discovery run),
      -     * and will evolve schema or flag actions based on that.
      -     * - Set user_manage to true if you would like to fully manage the entity
      -     * schema by yourself. This is useful when you would like to manually specify
      -     * the schema for a table. In this case, the schema defined by the user is
      -     * guaranteed to be kept unchanged and would not be overwritten. But this also
      -     * means Dataplex will not provide schema evolution management for you.
      -     * Dataplex will still be able to manage partition registration (i.e., keeping
      -     * the list of partitions up to date) when Dataplex discovery is turned on and
      -     * user_managed is set to true.
      +     * Required. Set to `true` if user-managed or `false` if managed by Dataplex. The
      +     * default is `false` (managed by Dataplex).
      +     * - Set to `false`to enable Dataplex discovery to update the schema.
      +     *   including new data discovery, schema inference, and schema evolution.
      +     *   Users retain the ability to input and edit the schema. Dataplex
      +     *   treats schema input by the user as though produced
      +     *   by a previous Dataplex discovery operation, and it will
      +     *   evolve the schema and take action based on that treatment.
      +     * - Set to `true` to fully manage the entity
      +     *   schema. This setting guarantees that Dataplex will not
      +     *   change schema fields.
            * 
      * * bool user_managed = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4397,23 +4404,17 @@ public Builder setUserManaged(boolean value) { * * *
      -     * Required. Whether the schema is user-managed or managed by the service.
      -     * - Set user_manage to false if you would like Dataplex to help you manage
      -     * the schema. You will get the full service provided by Dataplex discovery,
      -     * including new data discovery, schema inference and schema evolution. You
      -     * can still provide input the schema of the entities, for example renaming a
      -     * schema field, changing CSV or Json options if you think the discovered
      -     * values are not as accurate. Dataplex will consider your input as the
      -     * initial schema (as if they were produced by the previous discovery run),
      -     * and will evolve schema or flag actions based on that.
      -     * - Set user_manage to true if you would like to fully manage the entity
      -     * schema by yourself. This is useful when you would like to manually specify
      -     * the schema for a table. In this case, the schema defined by the user is
      -     * guaranteed to be kept unchanged and would not be overwritten. But this also
      -     * means Dataplex will not provide schema evolution management for you.
      -     * Dataplex will still be able to manage partition registration (i.e., keeping
      -     * the list of partitions up to date) when Dataplex discovery is turned on and
      -     * user_managed is set to true.
      +     * Required. Set to `true` if user-managed or `false` if managed by Dataplex. The
      +     * default is `false` (managed by Dataplex).
      +     * - Set to `false`to enable Dataplex discovery to update the schema.
      +     *   including new data discovery, schema inference, and schema evolution.
      +     *   Users retain the ability to input and edit the schema. Dataplex
      +     *   treats schema input by the user as though produced
      +     *   by a previous Dataplex discovery operation, and it will
      +     *   evolve the schema and take action based on that treatment.
      +     * - Set to `true` to fully manage the entity
      +     *   schema. This setting guarantees that Dataplex will not
      +     *   change schema fields.
            * 
      * * bool user_managed = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4448,6 +4449,7 @@ private void ensureFieldsIsMutable() { * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4466,6 +4468,7 @@ public java.util.List getFields * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4484,6 +4487,7 @@ public int getFieldsCount() { * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4502,6 +4506,7 @@ public com.google.cloud.dataplex.v1.Schema.SchemaField getFields(int index) { * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4526,6 +4531,7 @@ public Builder setFields(int index, com.google.cloud.dataplex.v1.Schema.SchemaFi * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4548,6 +4554,7 @@ public Builder setFields( * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4572,6 +4579,7 @@ public Builder addFields(com.google.cloud.dataplex.v1.Schema.SchemaField value) * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4596,6 +4604,7 @@ public Builder addFields(int index, com.google.cloud.dataplex.v1.Schema.SchemaFi * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4618,6 +4627,7 @@ public Builder addFields( * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4640,6 +4650,7 @@ public Builder addFields( * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4662,6 +4673,7 @@ public Builder addAllFields( * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4683,6 +4695,7 @@ public Builder clearFields() { * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4704,6 +4717,7 @@ public Builder removeFields(int index) { * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4718,6 +4732,7 @@ public com.google.cloud.dataplex.v1.Schema.SchemaField.Builder getFieldsBuilder( * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4736,6 +4751,7 @@ public com.google.cloud.dataplex.v1.Schema.SchemaFieldOrBuilder getFieldsOrBuild * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4755,6 +4771,7 @@ public com.google.cloud.dataplex.v1.Schema.SchemaFieldOrBuilder getFieldsOrBuild * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4770,6 +4787,7 @@ public com.google.cloud.dataplex.v1.Schema.SchemaField.Builder addFieldsBuilder( * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * @@ -4785,6 +4803,7 @@ public com.google.cloud.dataplex.v1.Schema.SchemaField.Builder addFieldsBuilder( * *
            * Optional. The sequence of fields describing data in table entities.
      +     * **Note:** BigQuery SchemaFields are immutable.
            * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/SchemaOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/SchemaOrBuilder.java index b142fbc..f7011fa 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/SchemaOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/SchemaOrBuilder.java @@ -27,23 +27,17 @@ public interface SchemaOrBuilder * * *
      -   * Required. Whether the schema is user-managed or managed by the service.
      -   * - Set user_manage to false if you would like Dataplex to help you manage
      -   * the schema. You will get the full service provided by Dataplex discovery,
      -   * including new data discovery, schema inference and schema evolution. You
      -   * can still provide input the schema of the entities, for example renaming a
      -   * schema field, changing CSV or Json options if you think the discovered
      -   * values are not as accurate. Dataplex will consider your input as the
      -   * initial schema (as if they were produced by the previous discovery run),
      -   * and will evolve schema or flag actions based on that.
      -   * - Set user_manage to true if you would like to fully manage the entity
      -   * schema by yourself. This is useful when you would like to manually specify
      -   * the schema for a table. In this case, the schema defined by the user is
      -   * guaranteed to be kept unchanged and would not be overwritten. But this also
      -   * means Dataplex will not provide schema evolution management for you.
      -   * Dataplex will still be able to manage partition registration (i.e., keeping
      -   * the list of partitions up to date) when Dataplex discovery is turned on and
      -   * user_managed is set to true.
      +   * Required. Set to `true` if user-managed or `false` if managed by Dataplex. The
      +   * default is `false` (managed by Dataplex).
      +   * - Set to `false`to enable Dataplex discovery to update the schema.
      +   *   including new data discovery, schema inference, and schema evolution.
      +   *   Users retain the ability to input and edit the schema. Dataplex
      +   *   treats schema input by the user as though produced
      +   *   by a previous Dataplex discovery operation, and it will
      +   *   evolve the schema and take action based on that treatment.
      +   * - Set to `true` to fully manage the entity
      +   *   schema. This setting guarantees that Dataplex will not
      +   *   change schema fields.
          * 
      * * bool user_managed = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -57,6 +51,7 @@ public interface SchemaOrBuilder * *
          * Optional. The sequence of fields describing data in table entities.
      +   * **Note:** BigQuery SchemaFields are immutable.
          * 
      * * @@ -69,6 +64,7 @@ public interface SchemaOrBuilder * *
          * Optional. The sequence of fields describing data in table entities.
      +   * **Note:** BigQuery SchemaFields are immutable.
          * 
      * * @@ -81,6 +77,7 @@ public interface SchemaOrBuilder * *
          * Optional. The sequence of fields describing data in table entities.
      +   * **Note:** BigQuery SchemaFields are immutable.
          * 
      * * @@ -93,6 +90,7 @@ public interface SchemaOrBuilder * *
          * Optional. The sequence of fields describing data in table entities.
      +   * **Note:** BigQuery SchemaFields are immutable.
          * 
      * * @@ -106,6 +104,7 @@ public interface SchemaOrBuilder * *
          * Optional. The sequence of fields describing data in table entities.
      +   * **Note:** BigQuery SchemaFields are immutable.
          * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ServiceProto.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ServiceProto.java index 5ec6b4d..b44951e 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ServiceProto.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ServiceProto.java @@ -335,172 +335,173 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "x.v1.Environment\022\027\n\017next_page_token\030\002 \001(" + "\t\"R\n\025GetEnvironmentRequest\0229\n\004name\030\001 \001(\t" + "B+\340A\002\372A%\n#dataplex.googleapis.com/Enviro" - + "nment\"\203\001\n\023ListSessionsRequest\022;\n\006parent\030" + + "nment\"\230\001\n\023ListSessionsRequest\022;\n\006parent\030" + "\001 \001(\tB+\340A\002\372A%\n#dataplex.googleapis.com/E" + "nvironment\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npa" - + "ge_token\030\003 \001(\tB\003\340A\001\"d\n\024ListSessionsRespo" - + "nse\0223\n\010sessions\030\001 \003(\0132!.google.cloud.dat" - + "aplex.v1.Session\022\027\n\017next_page_token\030\002 \001(" - + "\t2\2021\n\017DataplexService\022\303\001\n\nCreateLake\022+.g" - + "oogle.cloud.dataplex.v1.CreateLakeReques" - + "t\032\035.google.longrunning.Operation\"i\202\323\344\223\0021" - + "\")/v1/{parent=projects/*/locations/*}/la" - + "kes:\004lake\332A\023parent,lake,lake_id\312A\031\n\004Lake" - + "\022\021OperationMetadata\022\305\001\n\nUpdateLake\022+.goo" - + "gle.cloud.dataplex.v1.UpdateLakeRequest\032" - + "\035.google.longrunning.Operation\"k\202\323\344\223\00262." - + "/v1/{lake.name=projects/*/locations/*/la" - + "kes/*}:\004lake\332A\020lake,update_mask\312A\031\n\004Lake" - + "\022\021OperationMetadata\022\277\001\n\nDeleteLake\022+.goo" - + "gle.cloud.dataplex.v1.DeleteLakeRequest\032" - + "\035.google.longrunning.Operation\"e\202\323\344\223\002+*)" + + "ge_token\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001" + + "\"d\n\024ListSessionsResponse\0223\n\010sessions\030\001 \003" + + "(\0132!.google.cloud.dataplex.v1.Session\022\027\n" + + "\017next_page_token\030\002 \001(\t2\2021\n\017DataplexServi" + + "ce\022\303\001\n\nCreateLake\022+.google.cloud.dataple" + + "x.v1.CreateLakeRequest\032\035.google.longrunn" + + "ing.Operation\"i\202\323\344\223\0021\")/v1/{parent=proje" + + "cts/*/locations/*}/lakes:\004lake\332A\023parent," + + "lake,lake_id\312A\031\n\004Lake\022\021OperationMetadata" + + "\022\305\001\n\nUpdateLake\022+.google.cloud.dataplex." + + "v1.UpdateLakeRequest\032\035.google.longrunnin" + + "g.Operation\"k\202\323\344\223\00262./v1/{lake.name=proj" + + "ects/*/locations/*/lakes/*}:\004lake\332A\020lake" + + ",update_mask\312A\031\n\004Lake\022\021OperationMetadata" + + "\022\277\001\n\nDeleteLake\022+.google.cloud.dataplex." + + "v1.DeleteLakeRequest\032\035.google.longrunnin" + + "g.Operation\"e\202\323\344\223\002+*)/v1/{name=projects/" + + "*/locations/*/lakes/*}\332A\004name\312A*\n\025google" + + ".protobuf.Empty\022\021OperationMetadata\022\240\001\n\tL" + + "istLakes\022*.google.cloud.dataplex.v1.List" + + "LakesRequest\032+.google.cloud.dataplex.v1." + + "ListLakesResponse\":\202\323\344\223\002+\022)/v1/{parent=p" + + "rojects/*/locations/*}/lakes\332A\006parent\022\215\001" + + "\n\007GetLake\022(.google.cloud.dataplex.v1.Get" + + "LakeRequest\032\036.google.cloud.dataplex.v1.L" + + "ake\"8\202\323\344\223\002+\022)/v1/{name=projects/*/locati" + + "ons/*/lakes/*}\332A\004name\022\270\001\n\017ListLakeAction" + + "s\0220.google.cloud.dataplex.v1.ListLakeAct" + + "ionsRequest\032-.google.cloud.dataplex.v1.L" + + "istActionsResponse\"D\202\323\344\223\0025\0223/v1/{parent=" + + "projects/*/locations/*/lakes/*}/actions\332" + + "A\006parent\022\313\001\n\nCreateZone\022+.google.cloud.d" + + "ataplex.v1.CreateZoneRequest\032\035.google.lo" + + "ngrunning.Operation\"q\202\323\344\223\0029\"1/v1/{parent" + + "=projects/*/locations/*/lakes/*}/zones:\004" + + "zone\332A\023parent,zone,zone_id\312A\031\n\004Zone\022\021Ope" + + "rationMetadata\022\315\001\n\nUpdateZone\022+.google.c" + + "loud.dataplex.v1.UpdateZoneRequest\032\035.goo" + + "gle.longrunning.Operation\"s\202\323\344\223\002>26/v1/{" + + "zone.name=projects/*/locations/*/lakes/*" + + "/zones/*}:\004zone\332A\020zone,update_mask\312A\031\n\004Z" + + "one\022\021OperationMetadata\022\307\001\n\nDeleteZone\022+." + + "google.cloud.dataplex.v1.DeleteZoneReque" + + "st\032\035.google.longrunning.Operation\"m\202\323\344\223\002" + + "3*1/v1/{name=projects/*/locations/*/lake" + + "s/*/zones/*}\332A\004name\312A*\n\025google.protobuf." + + "Empty\022\021OperationMetadata\022\250\001\n\tListZones\022*" + + ".google.cloud.dataplex.v1.ListZonesReque" + + "st\032+.google.cloud.dataplex.v1.ListZonesR" + + "esponse\"B\202\323\344\223\0023\0221/v1/{parent=projects/*/" + + "locations/*/lakes/*}/zones\332A\006parent\022\225\001\n\007" + + "GetZone\022(.google.cloud.dataplex.v1.GetZo" + + "neRequest\032\036.google.cloud.dataplex.v1.Zon" + + "e\"@\202\323\344\223\0023\0221/v1/{name=projects/*/location" + + "s/*/lakes/*/zones/*}\332A\004name\022\300\001\n\017ListZone" + + "Actions\0220.google.cloud.dataplex.v1.ListZ" + + "oneActionsRequest\032-.google.cloud.dataple" + + "x.v1.ListActionsResponse\"L\202\323\344\223\002=\022;/v1/{p" + + "arent=projects/*/locations/*/lakes/*/zon" + + "es/*}/actions\332A\006parent\022\332\001\n\013CreateAsset\022," + + ".google.cloud.dataplex.v1.CreateAssetReq" + + "uest\032\035.google.longrunning.Operation\"~\202\323\344" + + "\223\002C\":/v1/{parent=projects/*/locations/*/" + + "lakes/*/zones/*}/assets:\005asset\332A\025parent," + + "asset,asset_id\312A\032\n\005Asset\022\021OperationMetad" + + "ata\022\335\001\n\013UpdateAsset\022,.google.cloud.datap" + + "lex.v1.UpdateAssetRequest\032\035.google.longr" + + "unning.Operation\"\200\001\202\323\344\223\002I2@/v1/{asset.na" + + "me=projects/*/locations/*/lakes/*/zones/" + + "*/assets/*}:\005asset\332A\021asset,update_mask\312A" + + "\032\n\005Asset\022\021OperationMetadata\022\322\001\n\013DeleteAs" + + "set\022,.google.cloud.dataplex.v1.DeleteAss" + + "etRequest\032\035.google.longrunning.Operation" + + "\"v\202\323\344\223\002<*:/v1/{name=projects/*/locations" + + "/*/lakes/*/zones/*/assets/*}\332A\004name\312A*\n\025" + + "google.protobuf.Empty\022\021OperationMetadata" + + "\022\264\001\n\nListAssets\022+.google.cloud.dataplex." + + "v1.ListAssetsRequest\032,.google.cloud.data" + + "plex.v1.ListAssetsResponse\"K\202\323\344\223\002<\022:/v1/" + + "{parent=projects/*/locations/*/lakes/*/z" + + "ones/*}/assets\332A\006parent\022\241\001\n\010GetAsset\022).g" + + "oogle.cloud.dataplex.v1.GetAssetRequest\032" + + "\037.google.cloud.dataplex.v1.Asset\"I\202\323\344\223\002<" + + "\022:/v1/{name=projects/*/locations/*/lakes" + + "/*/zones/*/assets/*}\332A\004name\022\313\001\n\020ListAsse" + + "tActions\0221.google.cloud.dataplex.v1.List" + + "AssetActionsRequest\032-.google.cloud.datap" + + "lex.v1.ListActionsResponse\"U\202\323\344\223\002F\022D/v1/" + + "{parent=projects/*/locations/*/lakes/*/z" + + "ones/*/assets/*}/actions\332A\006parent\022\313\001\n\nCr" + + "eateTask\022+.google.cloud.dataplex.v1.Crea" + + "teTaskRequest\032\035.google.longrunning.Opera" + + "tion\"q\202\323\344\223\0029\"1/v1/{parent=projects/*/loc" + + "ations/*/lakes/*}/tasks:\004task\332A\023parent,t" + + "ask,task_id\312A\031\n\004Task\022\021OperationMetadata\022" + + "\315\001\n\nUpdateTask\022+.google.cloud.dataplex.v" + + "1.UpdateTaskRequest\032\035.google.longrunning" + + ".Operation\"s\202\323\344\223\002>26/v1/{task.name=proje" + + "cts/*/locations/*/lakes/*/tasks/*}:\004task" + + "\332A\020task,update_mask\312A\031\n\004Task\022\021OperationM" + + "etadata\022\307\001\n\nDeleteTask\022+.google.cloud.da" + + "taplex.v1.DeleteTaskRequest\032\035.google.lon" + + "grunning.Operation\"m\202\323\344\223\0023*1/v1/{name=pr" + + "ojects/*/locations/*/lakes/*/tasks/*}\332A\004" + + "name\312A*\n\025google.protobuf.Empty\022\021Operatio" + + "nMetadata\022\250\001\n\tListTasks\022*.google.cloud.d" + + "ataplex.v1.ListTasksRequest\032+.google.clo" + + "ud.dataplex.v1.ListTasksResponse\"B\202\323\344\223\0023" + + "\0221/v1/{parent=projects/*/locations/*/lak" + + "es/*}/tasks\332A\006parent\022\225\001\n\007GetTask\022(.googl" + + "e.cloud.dataplex.v1.GetTaskRequest\032\036.goo" + + "gle.cloud.dataplex.v1.Task\"@\202\323\344\223\0023\0221/v1/" + + "{name=projects/*/locations/*/lakes/*/tas" + + "ks/*}\332A\004name\022\254\001\n\010ListJobs\022).google.cloud" + + ".dataplex.v1.ListJobsRequest\032*.google.cl" + + "oud.dataplex.v1.ListJobsResponse\"I\202\323\344\223\002:" + + "\0228/v1/{parent=projects/*/locations/*/lak" + + "es/*/tasks/*}/jobs\332A\006parent\022\231\001\n\006GetJob\022\'" + + ".google.cloud.dataplex.v1.GetJobRequest\032" + + "\035.google.cloud.dataplex.v1.Job\"G\202\323\344\223\002:\0228" + "/v1/{name=projects/*/locations/*/lakes/*" - + "}\332A\004name\312A*\n\025google.protobuf.Empty\022\021Oper" - + "ationMetadata\022\240\001\n\tListLakes\022*.google.clo" - + "ud.dataplex.v1.ListLakesRequest\032+.google" - + ".cloud.dataplex.v1.ListLakesResponse\":\202\323" - + "\344\223\002+\022)/v1/{parent=projects/*/locations/*" - + "}/lakes\332A\006parent\022\215\001\n\007GetLake\022(.google.cl" - + "oud.dataplex.v1.GetLakeRequest\032\036.google." - + "cloud.dataplex.v1.Lake\"8\202\323\344\223\002+\022)/v1/{nam" - + "e=projects/*/locations/*/lakes/*}\332A\004name" - + "\022\270\001\n\017ListLakeActions\0220.google.cloud.data" - + "plex.v1.ListLakeActionsRequest\032-.google." - + "cloud.dataplex.v1.ListActionsResponse\"D\202" - + "\323\344\223\0025\0223/v1/{parent=projects/*/locations/" - + "*/lakes/*}/actions\332A\006parent\022\313\001\n\nCreateZo" - + "ne\022+.google.cloud.dataplex.v1.CreateZone" - + "Request\032\035.google.longrunning.Operation\"q" - + "\202\323\344\223\0029\"1/v1/{parent=projects/*/locations" - + "/*/lakes/*}/zones:\004zone\332A\023parent,zone,zo" - + "ne_id\312A\031\n\004Zone\022\021OperationMetadata\022\315\001\n\nUp" - + "dateZone\022+.google.cloud.dataplex.v1.Upda" - + "teZoneRequest\032\035.google.longrunning.Opera" - + "tion\"s\202\323\344\223\002>26/v1/{zone.name=projects/*/" - + "locations/*/lakes/*/zones/*}:\004zone\332A\020zon" - + "e,update_mask\312A\031\n\004Zone\022\021OperationMetadat" - + "a\022\307\001\n\nDeleteZone\022+.google.cloud.dataplex" - + ".v1.DeleteZoneRequest\032\035.google.longrunni" - + "ng.Operation\"m\202\323\344\223\0023*1/v1/{name=projects" - + "/*/locations/*/lakes/*/zones/*}\332A\004name\312A" - + "*\n\025google.protobuf.Empty\022\021OperationMetad" - + "ata\022\250\001\n\tListZones\022*.google.cloud.dataple" - + "x.v1.ListZonesRequest\032+.google.cloud.dat" - + "aplex.v1.ListZonesResponse\"B\202\323\344\223\0023\0221/v1/" - + "{parent=projects/*/locations/*/lakes/*}/" - + "zones\332A\006parent\022\225\001\n\007GetZone\022(.google.clou" - + "d.dataplex.v1.GetZoneRequest\032\036.google.cl" - + "oud.dataplex.v1.Zone\"@\202\323\344\223\0023\0221/v1/{name=" - + "projects/*/locations/*/lakes/*/zones/*}\332" - + "A\004name\022\300\001\n\017ListZoneActions\0220.google.clou" - + "d.dataplex.v1.ListZoneActionsRequest\032-.g" - + "oogle.cloud.dataplex.v1.ListActionsRespo" - + "nse\"L\202\323\344\223\002=\022;/v1/{parent=projects/*/loca" - + "tions/*/lakes/*/zones/*}/actions\332A\006paren" - + "t\022\332\001\n\013CreateAsset\022,.google.cloud.dataple" - + "x.v1.CreateAssetRequest\032\035.google.longrun" - + "ning.Operation\"~\202\323\344\223\002C\":/v1/{parent=proj" - + "ects/*/locations/*/lakes/*/zones/*}/asse" - + "ts:\005asset\332A\025parent,asset,asset_id\312A\032\n\005As" - + "set\022\021OperationMetadata\022\335\001\n\013UpdateAsset\022," - + ".google.cloud.dataplex.v1.UpdateAssetReq" - + "uest\032\035.google.longrunning.Operation\"\200\001\202\323" - + "\344\223\002I2@/v1/{asset.name=projects/*/locatio" - + "ns/*/lakes/*/zones/*/assets/*}:\005asset\332A\021" - + "asset,update_mask\312A\032\n\005Asset\022\021OperationMe" - + "tadata\022\322\001\n\013DeleteAsset\022,.google.cloud.da" - + "taplex.v1.DeleteAssetRequest\032\035.google.lo" - + "ngrunning.Operation\"v\202\323\344\223\002<*:/v1/{name=p" - + "rojects/*/locations/*/lakes/*/zones/*/as" - + "sets/*}\332A\004name\312A*\n\025google.protobuf.Empty" - + "\022\021OperationMetadata\022\264\001\n\nListAssets\022+.goo" - + "gle.cloud.dataplex.v1.ListAssetsRequest\032" - + ",.google.cloud.dataplex.v1.ListAssetsRes" - + "ponse\"K\202\323\344\223\002<\022:/v1/{parent=projects/*/lo" - + "cations/*/lakes/*/zones/*}/assets\332A\006pare" - + "nt\022\241\001\n\010GetAsset\022).google.cloud.dataplex." - + "v1.GetAssetRequest\032\037.google.cloud.datapl" - + "ex.v1.Asset\"I\202\323\344\223\002<\022:/v1/{name=projects/" - + "*/locations/*/lakes/*/zones/*/assets/*}\332" - + "A\004name\022\313\001\n\020ListAssetActions\0221.google.clo" - + "ud.dataplex.v1.ListAssetActionsRequest\032-" - + ".google.cloud.dataplex.v1.ListActionsRes" - + "ponse\"U\202\323\344\223\002F\022D/v1/{parent=projects/*/lo" - + "cations/*/lakes/*/zones/*/assets/*}/acti" - + "ons\332A\006parent\022\313\001\n\nCreateTask\022+.google.clo" - + "ud.dataplex.v1.CreateTaskRequest\032\035.googl" - + "e.longrunning.Operation\"q\202\323\344\223\0029\"1/v1/{pa" - + "rent=projects/*/locations/*/lakes/*}/tas" - + "ks:\004task\332A\023parent,task,task_id\312A\031\n\004Task\022" - + "\021OperationMetadata\022\315\001\n\nUpdateTask\022+.goog" - + "le.cloud.dataplex.v1.UpdateTaskRequest\032\035" - + ".google.longrunning.Operation\"s\202\323\344\223\002>26/" - + "v1/{task.name=projects/*/locations/*/lak" - + "es/*/tasks/*}:\004task\332A\020task,update_mask\312A" - + "\031\n\004Task\022\021OperationMetadata\022\307\001\n\nDeleteTas" - + "k\022+.google.cloud.dataplex.v1.DeleteTaskR" - + "equest\032\035.google.longrunning.Operation\"m\202" - + "\323\344\223\0023*1/v1/{name=projects/*/locations/*/" - + "lakes/*/tasks/*}\332A\004name\312A*\n\025google.proto" - + "buf.Empty\022\021OperationMetadata\022\250\001\n\tListTas" - + "ks\022*.google.cloud.dataplex.v1.ListTasksR" - + "equest\032+.google.cloud.dataplex.v1.ListTa" - + "sksResponse\"B\202\323\344\223\0023\0221/v1/{parent=project" - + "s/*/locations/*/lakes/*}/tasks\332A\006parent\022" - + "\225\001\n\007GetTask\022(.google.cloud.dataplex.v1.G" - + "etTaskRequest\032\036.google.cloud.dataplex.v1" - + ".Task\"@\202\323\344\223\0023\0221/v1/{name=projects/*/loca" - + "tions/*/lakes/*/tasks/*}\332A\004name\022\254\001\n\010List" - + "Jobs\022).google.cloud.dataplex.v1.ListJobs" - + "Request\032*.google.cloud.dataplex.v1.ListJ" - + "obsResponse\"I\202\323\344\223\002:\0228/v1/{parent=project" - + "s/*/locations/*/lakes/*/tasks/*}/jobs\332A\006" - + "parent\022\231\001\n\006GetJob\022\'.google.cloud.dataple" - + "x.v1.GetJobRequest\032\035.google.cloud.datapl" - + "ex.v1.Job\"G\202\323\344\223\002:\0228/v1/{name=projects/*/" - + "locations/*/lakes/*/tasks/*/jobs/*}\332A\004na" - + "me\022\242\001\n\tCancelJob\022*.google.cloud.dataplex" - + ".v1.CancelJobRequest\032\026.google.protobuf.E" - + "mpty\"Q\202\323\344\223\002D\"?/v1/{name=projects/*/locat" - + "ions/*/lakes/*/tasks/*/jobs/*}:cancel:\001*" - + "\332A\004name\022\375\001\n\021CreateEnvironment\0222.google.c" - + "loud.dataplex.v1.CreateEnvironmentReques" - + "t\032\035.google.longrunning.Operation\"\224\001\202\323\344\223\002" - + "G\"8/v1/{parent=projects/*/locations/*/la" - + "kes/*}/environments:\013environment\332A!paren" - + "t,environment,environment_id\312A \n\013Environ" - + "ment\022\021OperationMetadata\022\377\001\n\021UpdateEnviro" - + "nment\0222.google.cloud.dataplex.v1.UpdateE" - + "nvironmentRequest\032\035.google.longrunning.O" - + "peration\"\226\001\202\323\344\223\002S2D/v1/{environment.name" - + "=projects/*/locations/*/lakes/*/environm" - + "ents/*}:\013environment\332A\027environment,updat" - + "e_mask\312A \n\013Environment\022\021OperationMetadat" - + "a\022\334\001\n\021DeleteEnvironment\0222.google.cloud.d" - + "ataplex.v1.DeleteEnvironmentRequest\032\035.go" - + "ogle.longrunning.Operation\"t\202\323\344\223\002:*8/v1/" - + "{name=projects/*/locations/*/lakes/*/env" - + "ironments/*}\332A\004name\312A*\n\025google.protobuf." - + "Empty\022\021OperationMetadata\022\304\001\n\020ListEnviron" - + "ments\0221.google.cloud.dataplex.v1.ListEnv" - + "ironmentsRequest\0322.google.cloud.dataplex" - + ".v1.ListEnvironmentsResponse\"I\202\323\344\223\002:\0228/v" - + "1/{parent=projects/*/locations/*/lakes/*" - + "}/environments\332A\006parent\022\261\001\n\016GetEnvironme" - + "nt\022/.google.cloud.dataplex.v1.GetEnviron" - + "mentRequest\032%.google.cloud.dataplex.v1.E" - + "nvironment\"G\202\323\344\223\002:\0228/v1/{name=projects/*" - + "/locations/*/lakes/*/environments/*}\332A\004n" - + "ame\022\303\001\n\014ListSessions\022-.google.cloud.data" - + "plex.v1.ListSessionsRequest\032..google.clo" - + "ud.dataplex.v1.ListSessionsResponse\"T\202\323\344" - + "\223\002E\022C/v1/{parent=projects/*/locations/*/" - + "lakes/*/environments/*}/sessions\332A\006paren" - + "t\032K\312A\027dataplex.googleapis.com\322A.https://" - + "www.googleapis.com/auth/cloud-platformBp" - + "\n\034com.google.cloud.dataplex.v1B\014ServiceP" - + "rotoP\001Z@google.golang.org/genproto/googl" - + "eapis/cloud/dataplex/v1;dataplexb\006proto3" + + "/tasks/*/jobs/*}\332A\004name\022\242\001\n\tCancelJob\022*." + + "google.cloud.dataplex.v1.CancelJobReques" + + "t\032\026.google.protobuf.Empty\"Q\202\323\344\223\002D\"?/v1/{" + + "name=projects/*/locations/*/lakes/*/task" + + "s/*/jobs/*}:cancel:\001*\332A\004name\022\375\001\n\021CreateE" + + "nvironment\0222.google.cloud.dataplex.v1.Cr" + + "eateEnvironmentRequest\032\035.google.longrunn" + + "ing.Operation\"\224\001\202\323\344\223\002G\"8/v1/{parent=proj" + + "ects/*/locations/*/lakes/*}/environments" + + ":\013environment\332A!parent,environment,envir" + + "onment_id\312A \n\013Environment\022\021OperationMeta" + + "data\022\377\001\n\021UpdateEnvironment\0222.google.clou" + + "d.dataplex.v1.UpdateEnvironmentRequest\032\035" + + ".google.longrunning.Operation\"\226\001\202\323\344\223\002S2D" + + "/v1/{environment.name=projects/*/locatio" + + "ns/*/lakes/*/environments/*}:\013environmen" + + "t\332A\027environment,update_mask\312A \n\013Environm" + + "ent\022\021OperationMetadata\022\334\001\n\021DeleteEnviron" + + "ment\0222.google.cloud.dataplex.v1.DeleteEn" + + "vironmentRequest\032\035.google.longrunning.Op" + + "eration\"t\202\323\344\223\002:*8/v1/{name=projects/*/lo" + + "cations/*/lakes/*/environments/*}\332A\004name" + + "\312A*\n\025google.protobuf.Empty\022\021OperationMet" + + "adata\022\304\001\n\020ListEnvironments\0221.google.clou" + + "d.dataplex.v1.ListEnvironmentsRequest\0322." + + "google.cloud.dataplex.v1.ListEnvironment" + + "sResponse\"I\202\323\344\223\002:\0228/v1/{parent=projects/" + + "*/locations/*/lakes/*}/environments\332A\006pa" + + "rent\022\261\001\n\016GetEnvironment\022/.google.cloud.d" + + "ataplex.v1.GetEnvironmentRequest\032%.googl" + + "e.cloud.dataplex.v1.Environment\"G\202\323\344\223\002:\022" + + "8/v1/{name=projects/*/locations/*/lakes/" + + "*/environments/*}\332A\004name\022\303\001\n\014ListSession" + + "s\022-.google.cloud.dataplex.v1.ListSession" + + "sRequest\032..google.cloud.dataplex.v1.List" + + "SessionsResponse\"T\202\323\344\223\002E\022C/v1/{parent=pr" + + "ojects/*/locations/*/lakes/*/environment" + + "s/*}/sessions\332A\006parent\032K\312A\027dataplex.goog" + + "leapis.com\322A.https://www.googleapis.com/" + + "auth/cloud-platformBp\n\034com.google.cloud." + + "dataplex.v1B\014ServiceProtoP\001Z@google.gola" + + "ng.org/genproto/googleapis/cloud/dataple" + + "x/v1;dataplexb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -842,7 +843,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataplex_v1_ListSessionsRequest_descriptor, new java.lang.String[] { - "Parent", "PageSize", "PageToken", + "Parent", "PageSize", "PageToken", "Filter", }); internal_static_google_cloud_dataplex_v1_ListSessionsResponse_descriptor = getDescriptor().getMessageTypes().get(40); diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/StorageFormat.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/StorageFormat.java index 30dd665..968347e 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/StorageFormat.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/StorageFormat.java @@ -779,8 +779,9 @@ public interface CsvOptionsOrBuilder * * *
      -     * Optional. The character used to quote column values. Accepts '"' and '''.
      -     * Defaults to '"' if unspecified.
      +     * Optional. The character used to quote column values. Accepts '"'
      +     * (double quotation mark) or ''' (single quotation mark). Defaults to
      +     * '"' (double quotation mark) if unspecified.
            * 
      * * string quote = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -792,8 +793,9 @@ public interface CsvOptionsOrBuilder * * *
      -     * Optional. The character used to quote column values. Accepts '"' and '''.
      -     * Defaults to '"' if unspecified.
      +     * Optional. The character used to quote column values. Accepts '"'
      +     * (double quotation mark) or ''' (single quotation mark). Defaults to
      +     * '"' (double quotation mark) if unspecified.
            * 
      * * string quote = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1043,8 +1045,9 @@ public com.google.protobuf.ByteString getDelimiterBytes() { * * *
      -     * Optional. The character used to quote column values. Accepts '"' and '''.
      -     * Defaults to '"' if unspecified.
      +     * Optional. The character used to quote column values. Accepts '"'
      +     * (double quotation mark) or ''' (single quotation mark). Defaults to
      +     * '"' (double quotation mark) if unspecified.
            * 
      * * string quote = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1067,8 +1070,9 @@ public java.lang.String getQuote() { * * *
      -     * Optional. The character used to quote column values. Accepts '"' and '''.
      -     * Defaults to '"' if unspecified.
      +     * Optional. The character used to quote column values. Accepts '"'
      +     * (double quotation mark) or ''' (single quotation mark). Defaults to
      +     * '"' (double quotation mark) if unspecified.
            * 
      * * string quote = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1735,8 +1739,9 @@ public Builder setDelimiterBytes(com.google.protobuf.ByteString value) { * * *
      -       * Optional. The character used to quote column values. Accepts '"' and '''.
      -       * Defaults to '"' if unspecified.
      +       * Optional. The character used to quote column values. Accepts '"'
      +       * (double quotation mark) or ''' (single quotation mark). Defaults to
      +       * '"' (double quotation mark) if unspecified.
              * 
      * * string quote = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1758,8 +1763,9 @@ public java.lang.String getQuote() { * * *
      -       * Optional. The character used to quote column values. Accepts '"' and '''.
      -       * Defaults to '"' if unspecified.
      +       * Optional. The character used to quote column values. Accepts '"'
      +       * (double quotation mark) or ''' (single quotation mark). Defaults to
      +       * '"' (double quotation mark) if unspecified.
              * 
      * * string quote = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1781,8 +1787,9 @@ public com.google.protobuf.ByteString getQuoteBytes() { * * *
      -       * Optional. The character used to quote column values. Accepts '"' and '''.
      -       * Defaults to '"' if unspecified.
      +       * Optional. The character used to quote column values. Accepts '"'
      +       * (double quotation mark) or ''' (single quotation mark). Defaults to
      +       * '"' (double quotation mark) if unspecified.
              * 
      * * string quote = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1803,8 +1810,9 @@ public Builder setQuote(java.lang.String value) { * * *
      -       * Optional. The character used to quote column values. Accepts '"' and '''.
      -       * Defaults to '"' if unspecified.
      +       * Optional. The character used to quote column values. Accepts '"'
      +       * (double quotation mark) or ''' (single quotation mark). Defaults to
      +       * '"' (double quotation mark) if unspecified.
              * 
      * * string quote = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1821,8 +1829,9 @@ public Builder clearQuote() { * * *
      -       * Optional. The character used to quote column values. Accepts '"' and '''.
      -       * Defaults to '"' if unspecified.
      +       * Optional. The character used to quote column values. Accepts '"'
      +       * (double quotation mark) or ''' (single quotation mark). Defaults to
      +       * '"' (double quotation mark) if unspecified.
              * 
      * * string quote = 4 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Task.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Task.java index e956e54..6ef4e80 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Task.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Task.java @@ -183,6 +183,23 @@ private Task( executionSpec_ = subBuilder.buildPartial(); } + break; + } + case 1610: + { + com.google.cloud.dataplex.v1.Task.ExecutionStatus.Builder subBuilder = null; + if (executionStatus_ != null) { + subBuilder = executionStatus_.toBuilder(); + } + executionStatus_ = + input.readMessage( + com.google.cloud.dataplex.v1.Task.ExecutionStatus.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(executionStatus_); + executionStatus_ = subBuilder.buildPartial(); + } + break; } case 2402: @@ -543,6 +560,7 @@ public interface BatchComputeResourcesOrBuilder * *
              * Optional. Total number of job executors.
      +       * Executor Count should be between 2 and 100. [Default=2]
              * 
      * * int32 executors_count = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -557,6 +575,7 @@ public interface BatchComputeResourcesOrBuilder *
              * Optional. Max configurable executors.
              * If max_executors_count > executors_count, then auto-scaling is enabled.
      +       * Max Executor Count should be between 2 and 1000. [Default=1000]
              * 
      * * int32 max_executors_count = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -670,6 +689,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
              * Optional. Total number of job executors.
      +       * Executor Count should be between 2 and 100. [Default=2]
              * 
      * * int32 executors_count = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -689,6 +709,7 @@ public int getExecutorsCount() { *
              * Optional. Max configurable executors.
              * If max_executors_count > executors_count, then auto-scaling is enabled.
      +       * Max Executor Count should be between 2 and 1000. [Default=1000]
              * 
      * * int32 max_executors_count = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1067,6 +1088,7 @@ public Builder mergeFrom( * *
                * Optional. Total number of job executors.
      +         * Executor Count should be between 2 and 100. [Default=2]
                * 
      * * int32 executors_count = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -1082,6 +1104,7 @@ public int getExecutorsCount() { * *
                * Optional. Total number of job executors.
      +         * Executor Count should be between 2 and 100. [Default=2]
                * 
      * * int32 executors_count = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -1100,6 +1123,7 @@ public Builder setExecutorsCount(int value) { * *
                * Optional. Total number of job executors.
      +         * Executor Count should be between 2 and 100. [Default=2]
                * 
      * * int32 executors_count = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -1120,6 +1144,7 @@ public Builder clearExecutorsCount() { *
                * Optional. Max configurable executors.
                * If max_executors_count > executors_count, then auto-scaling is enabled.
      +         * Max Executor Count should be between 2 and 1000. [Default=1000]
                * 
      * * int32 max_executors_count = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1136,6 +1161,7 @@ public int getMaxExecutorsCount() { *
                * Optional. Max configurable executors.
                * If max_executors_count > executors_count, then auto-scaling is enabled.
      +         * Max Executor Count should be between 2 and 1000. [Default=1000]
                * 
      * * int32 max_executors_count = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1155,6 +1181,7 @@ public Builder setMaxExecutorsCount(int value) { *
                * Optional. Max configurable executors.
                * If max_executors_count > executors_count, then auto-scaling is enabled.
      +         * Max Executor Count should be between 2 and 1000. [Default=1000]
                * 
      * * int32 max_executors_count = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1230,13 +1257,38 @@ public interface ContainerImageRuntimeOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime) com.google.protobuf.MessageOrBuilder { + /** + * + * + *
      +       * Optional. Container image to use.
      +       * 
      + * + * string image = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The image. + */ + java.lang.String getImage(); + /** + * + * + *
      +       * Optional. Container image to use.
      +       * 
      + * + * string image = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for image. + */ + com.google.protobuf.ByteString getImageBytes(); + /** * * *
              * Optional. A list of Java JARS to add to the classpath.
              * Valid input includes Cloud Storage URIs to Jar binaries.
      -       * For example, `gs://bucket-name/my/path/to/file.jar`.
      +       * For example, gs://bucket-name/my/path/to/file.jar
              * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1250,7 +1302,7 @@ public interface ContainerImageRuntimeOrBuilder *
              * Optional. A list of Java JARS to add to the classpath.
              * Valid input includes Cloud Storage URIs to Jar binaries.
      -       * For example, `gs://bucket-name/my/path/to/file.jar`.
      +       * For example, gs://bucket-name/my/path/to/file.jar
              * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1264,7 +1316,7 @@ public interface ContainerImageRuntimeOrBuilder *
              * Optional. A list of Java JARS to add to the classpath.
              * Valid input includes Cloud Storage URIs to Jar binaries.
      -       * For example, `gs://bucket-name/my/path/to/file.jar`.
      +       * For example, gs://bucket-name/my/path/to/file.jar
              * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1279,7 +1331,7 @@ public interface ContainerImageRuntimeOrBuilder *
              * Optional. A list of Java JARS to add to the classpath.
              * Valid input includes Cloud Storage URIs to Jar binaries.
      -       * For example, `gs://bucket-name/my/path/to/file.jar`.
      +       * For example, gs://bucket-name/my/path/to/file.jar
              * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1295,7 +1347,7 @@ public interface ContainerImageRuntimeOrBuilder *
              * Optional. A list of python packages to be installed.
              * Valid formats include Cloud Storage URI to a PIP installable library.
      -       * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +       * For example, gs://bucket-name/my/path/to/lib.tar.gz
              * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1309,7 +1361,7 @@ public interface ContainerImageRuntimeOrBuilder *
              * Optional. A list of python packages to be installed.
              * Valid formats include Cloud Storage URI to a PIP installable library.
      -       * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +       * For example, gs://bucket-name/my/path/to/lib.tar.gz
              * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1323,7 +1375,7 @@ public interface ContainerImageRuntimeOrBuilder *
              * Optional. A list of python packages to be installed.
              * Valid formats include Cloud Storage URI to a PIP installable library.
      -       * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +       * For example, gs://bucket-name/my/path/to/lib.tar.gz
              * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1338,7 +1390,7 @@ public interface ContainerImageRuntimeOrBuilder *
              * Optional. A list of python packages to be installed.
              * Valid formats include Cloud Storage URI to a PIP installable library.
      -       * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +       * For example, gs://bucket-name/my/path/to/lib.tar.gz
              * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1462,6 +1514,7 @@ private ContainerImageRuntime(com.google.protobuf.GeneratedMessageV3.Builder } private ContainerImageRuntime() { + image_ = ""; javaJars_ = com.google.protobuf.LazyStringArrayList.EMPTY; pythonPackages_ = com.google.protobuf.LazyStringArrayList.EMPTY; } @@ -1496,6 +1549,13 @@ private ContainerImageRuntime( case 0: done = true; break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + image_ = s; + break; + } case 18: { java.lang.String s = input.readStringRequireUtf8(); @@ -1586,6 +1646,55 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { .class); } + public static final int IMAGE_FIELD_NUMBER = 1; + private volatile java.lang.Object image_; + /** + * + * + *
      +       * Optional. Container image to use.
      +       * 
      + * + * string image = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The image. + */ + @java.lang.Override + public java.lang.String getImage() { + java.lang.Object ref = image_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + image_ = s; + return s; + } + } + /** + * + * + *
      +       * Optional. Container image to use.
      +       * 
      + * + * string image = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for image. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int JAVA_JARS_FIELD_NUMBER = 2; private com.google.protobuf.LazyStringList javaJars_; /** @@ -1594,7 +1703,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { *
              * Optional. A list of Java JARS to add to the classpath.
              * Valid input includes Cloud Storage URIs to Jar binaries.
      -       * For example, `gs://bucket-name/my/path/to/file.jar`.
      +       * For example, gs://bucket-name/my/path/to/file.jar
              * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1610,7 +1719,7 @@ public com.google.protobuf.ProtocolStringList getJavaJarsList() { *
              * Optional. A list of Java JARS to add to the classpath.
              * Valid input includes Cloud Storage URIs to Jar binaries.
      -       * For example, `gs://bucket-name/my/path/to/file.jar`.
      +       * For example, gs://bucket-name/my/path/to/file.jar
              * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1626,7 +1735,7 @@ public int getJavaJarsCount() { *
              * Optional. A list of Java JARS to add to the classpath.
              * Valid input includes Cloud Storage URIs to Jar binaries.
      -       * For example, `gs://bucket-name/my/path/to/file.jar`.
      +       * For example, gs://bucket-name/my/path/to/file.jar
              * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1643,7 +1752,7 @@ public java.lang.String getJavaJars(int index) { *
              * Optional. A list of Java JARS to add to the classpath.
              * Valid input includes Cloud Storage URIs to Jar binaries.
      -       * For example, `gs://bucket-name/my/path/to/file.jar`.
      +       * For example, gs://bucket-name/my/path/to/file.jar
              * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1663,7 +1772,7 @@ public com.google.protobuf.ByteString getJavaJarsBytes(int index) { *
              * Optional. A list of python packages to be installed.
              * Valid formats include Cloud Storage URI to a PIP installable library.
      -       * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +       * For example, gs://bucket-name/my/path/to/lib.tar.gz
              * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1679,7 +1788,7 @@ public com.google.protobuf.ProtocolStringList getPythonPackagesList() { *
              * Optional. A list of python packages to be installed.
              * Valid formats include Cloud Storage URI to a PIP installable library.
      -       * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +       * For example, gs://bucket-name/my/path/to/lib.tar.gz
              * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1695,7 +1804,7 @@ public int getPythonPackagesCount() { *
              * Optional. A list of python packages to be installed.
              * Valid formats include Cloud Storage URI to a PIP installable library.
      -       * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +       * For example, gs://bucket-name/my/path/to/lib.tar.gz
              * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1712,7 +1821,7 @@ public java.lang.String getPythonPackages(int index) { *
              * Optional. A list of python packages to be installed.
              * Valid formats include Cloud Storage URI to a PIP installable library.
      -       * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +       * For example, gs://bucket-name/my/path/to/lib.tar.gz
              * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1867,6 +1976,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(image_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, image_); + } for (int i = 0; i < javaJars_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, javaJars_.getRaw(i)); } @@ -1884,6 +1996,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(image_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, image_); + } { int dataSize = 0; for (int i = 0; i < javaJars_.size(); i++) { @@ -1928,6 +2043,7 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime other = (com.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime) obj; + if (!getImage().equals(other.getImage())) return false; if (!getJavaJarsList().equals(other.getJavaJarsList())) return false; if (!getPythonPackagesList().equals(other.getPythonPackagesList())) return false; if (!internalGetProperties().equals(other.internalGetProperties())) return false; @@ -1942,6 +2058,8 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); if (getJavaJarsCount() > 0) { hash = (37 * hash) + JAVA_JARS_FIELD_NUMBER; hash = (53 * hash) + getJavaJarsList().hashCode(); @@ -2133,6 +2251,8 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); + image_ = ""; + javaJars_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); pythonPackages_ = com.google.protobuf.LazyStringArrayList.EMPTY; @@ -2170,6 +2290,7 @@ public com.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntim com.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime result = new com.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime(this); int from_bitField0_ = bitField0_; + result.image_ = image_; if (((bitField0_ & 0x00000001) != 0)) { javaJars_ = javaJars_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000001); @@ -2239,6 +2360,10 @@ public Builder mergeFrom( if (other == com.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime .getDefaultInstance()) return this; + if (!other.getImage().isEmpty()) { + image_ = other.image_; + onChanged(); + } if (!other.javaJars_.isEmpty()) { if (javaJars_.isEmpty()) { javaJars_ = other.javaJars_; @@ -2294,6 +2419,112 @@ public Builder mergeFrom( private int bitField0_; + private java.lang.Object image_ = ""; + /** + * + * + *
      +         * Optional. Container image to use.
      +         * 
      + * + * string image = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The image. + */ + public java.lang.String getImage() { + java.lang.Object ref = image_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + image_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
      +         * Optional. Container image to use.
      +         * 
      + * + * string image = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for image. + */ + public com.google.protobuf.ByteString getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
      +         * Optional. Container image to use.
      +         * 
      + * + * string image = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The image to set. + * @return This builder for chaining. + */ + public Builder setImage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + image_ = value; + onChanged(); + return this; + } + /** + * + * + *
      +         * Optional. Container image to use.
      +         * 
      + * + * string image = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearImage() { + + image_ = getDefaultInstance().getImage(); + onChanged(); + return this; + } + /** + * + * + *
      +         * Optional. Container image to use.
      +         * 
      + * + * string image = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for image to set. + * @return This builder for chaining. + */ + public Builder setImageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + image_ = value; + onChanged(); + return this; + } + private com.google.protobuf.LazyStringList javaJars_ = com.google.protobuf.LazyStringArrayList.EMPTY; @@ -2309,7 +2540,7 @@ private void ensureJavaJarsIsMutable() { *
                * Optional. A list of Java JARS to add to the classpath.
                * Valid input includes Cloud Storage URIs to Jar binaries.
      -         * For example, `gs://bucket-name/my/path/to/file.jar`.
      +         * For example, gs://bucket-name/my/path/to/file.jar
                * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -2325,7 +2556,7 @@ public com.google.protobuf.ProtocolStringList getJavaJarsList() { *
                * Optional. A list of Java JARS to add to the classpath.
                * Valid input includes Cloud Storage URIs to Jar binaries.
      -         * For example, `gs://bucket-name/my/path/to/file.jar`.
      +         * For example, gs://bucket-name/my/path/to/file.jar
                * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -2341,7 +2572,7 @@ public int getJavaJarsCount() { *
                * Optional. A list of Java JARS to add to the classpath.
                * Valid input includes Cloud Storage URIs to Jar binaries.
      -         * For example, `gs://bucket-name/my/path/to/file.jar`.
      +         * For example, gs://bucket-name/my/path/to/file.jar
                * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -2358,7 +2589,7 @@ public java.lang.String getJavaJars(int index) { *
                * Optional. A list of Java JARS to add to the classpath.
                * Valid input includes Cloud Storage URIs to Jar binaries.
      -         * For example, `gs://bucket-name/my/path/to/file.jar`.
      +         * For example, gs://bucket-name/my/path/to/file.jar
                * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -2375,7 +2606,7 @@ public com.google.protobuf.ByteString getJavaJarsBytes(int index) { *
                * Optional. A list of Java JARS to add to the classpath.
                * Valid input includes Cloud Storage URIs to Jar binaries.
      -         * For example, `gs://bucket-name/my/path/to/file.jar`.
      +         * For example, gs://bucket-name/my/path/to/file.jar
                * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -2399,7 +2630,7 @@ public Builder setJavaJars(int index, java.lang.String value) { *
                * Optional. A list of Java JARS to add to the classpath.
                * Valid input includes Cloud Storage URIs to Jar binaries.
      -         * For example, `gs://bucket-name/my/path/to/file.jar`.
      +         * For example, gs://bucket-name/my/path/to/file.jar
                * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -2422,7 +2653,7 @@ public Builder addJavaJars(java.lang.String value) { *
                * Optional. A list of Java JARS to add to the classpath.
                * Valid input includes Cloud Storage URIs to Jar binaries.
      -         * For example, `gs://bucket-name/my/path/to/file.jar`.
      +         * For example, gs://bucket-name/my/path/to/file.jar
                * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -2442,7 +2673,7 @@ public Builder addAllJavaJars(java.lang.Iterable values) { *
                * Optional. A list of Java JARS to add to the classpath.
                * Valid input includes Cloud Storage URIs to Jar binaries.
      -         * For example, `gs://bucket-name/my/path/to/file.jar`.
      +         * For example, gs://bucket-name/my/path/to/file.jar
                * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -2461,7 +2692,7 @@ public Builder clearJavaJars() { *
                * Optional. A list of Java JARS to add to the classpath.
                * Valid input includes Cloud Storage URIs to Jar binaries.
      -         * For example, `gs://bucket-name/my/path/to/file.jar`.
      +         * For example, gs://bucket-name/my/path/to/file.jar
                * 
      * * repeated string java_jars = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -2495,7 +2726,7 @@ private void ensurePythonPackagesIsMutable() { *
                * Optional. A list of python packages to be installed.
                * Valid formats include Cloud Storage URI to a PIP installable library.
      -         * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +         * For example, gs://bucket-name/my/path/to/lib.tar.gz
                * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -2512,7 +2743,7 @@ public com.google.protobuf.ProtocolStringList getPythonPackagesList() { *
                * Optional. A list of python packages to be installed.
                * Valid formats include Cloud Storage URI to a PIP installable library.
      -         * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +         * For example, gs://bucket-name/my/path/to/lib.tar.gz
                * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -2529,7 +2760,7 @@ public int getPythonPackagesCount() { *
                * Optional. A list of python packages to be installed.
                * Valid formats include Cloud Storage URI to a PIP installable library.
      -         * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +         * For example, gs://bucket-name/my/path/to/lib.tar.gz
                * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -2547,7 +2778,7 @@ public java.lang.String getPythonPackages(int index) { *
                * Optional. A list of python packages to be installed.
                * Valid formats include Cloud Storage URI to a PIP installable library.
      -         * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +         * For example, gs://bucket-name/my/path/to/lib.tar.gz
                * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -2565,7 +2796,7 @@ public com.google.protobuf.ByteString getPythonPackagesBytes(int index) { *
                * Optional. A list of python packages to be installed.
                * Valid formats include Cloud Storage URI to a PIP installable library.
      -         * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +         * For example, gs://bucket-name/my/path/to/lib.tar.gz
                * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -2590,7 +2821,7 @@ public Builder setPythonPackages(int index, java.lang.String value) { *
                * Optional. A list of python packages to be installed.
                * Valid formats include Cloud Storage URI to a PIP installable library.
      -         * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +         * For example, gs://bucket-name/my/path/to/lib.tar.gz
                * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -2614,7 +2845,7 @@ public Builder addPythonPackages(java.lang.String value) { *
                * Optional. A list of python packages to be installed.
                * Valid formats include Cloud Storage URI to a PIP installable library.
      -         * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +         * For example, gs://bucket-name/my/path/to/lib.tar.gz
                * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -2635,7 +2866,7 @@ public Builder addAllPythonPackages(java.lang.Iterable values) *
                * Optional. A list of python packages to be installed.
                * Valid formats include Cloud Storage URI to a PIP installable library.
      -         * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +         * For example, gs://bucket-name/my/path/to/lib.tar.gz
                * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -2655,7 +2886,7 @@ public Builder clearPythonPackages() { *
                * Optional. A list of python packages to be installed.
                * Valid formats include Cloud Storage URI to a PIP installable library.
      -         * For example, `gs://bucket-name/my/path/to/lib.tar.gz`.
      +         * For example, gs://bucket-name/my/path/to/lib.tar.gz
                * 
      * * repeated string python_packages = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -7902,6 +8133,35 @@ java.lang.String getArgsOrDefault( */ com.google.protobuf.ByteString getServiceAccountBytes(); + /** + * + * + *
      +     * Optional. The project in which jobs are run. By default, the project containing the
      +     * Lake is used. If a project is provided, the
      +     * [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account] must belong to this project.
      +     * 
      + * + * string project = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The project. + */ + java.lang.String getProject(); + /** + * + * + *
      +     * Optional. The project in which jobs are run. By default, the project containing the
      +     * Lake is used. If a project is provided, the
      +     * [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account] must belong to this project.
      +     * 
      + * + * string project = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + /** * * @@ -7942,6 +8202,33 @@ java.lang.String getArgsOrDefault( *
      */ com.google.protobuf.DurationOrBuilder getMaxJobExecutionLifetimeOrBuilder(); + + /** + * + * + *
      +     * Optional. The Cloud KMS key to use for encryption, of the form:
      +     * `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`.
      +     * 
      + * + * string kms_key = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kmsKey. + */ + java.lang.String getKmsKey(); + /** + * + * + *
      +     * Optional. The Cloud KMS key to use for encryption, of the form:
      +     * `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`.
      +     * 
      + * + * string kms_key = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kmsKey. + */ + com.google.protobuf.ByteString getKmsKeyBytes(); } /** * @@ -7964,6 +8251,8 @@ private ExecutionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) private ExecutionSpec() { serviceAccount_ = ""; + project_ = ""; + kmsKey_ = ""; } @java.lang.Override @@ -8016,6 +8305,13 @@ private ExecutionSpec( serviceAccount_ = s; break; } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + project_ = s; + break; + } case 66: { com.google.protobuf.Duration.Builder subBuilder = null; @@ -8029,6 +8325,13 @@ private ExecutionSpec( maxJobExecutionLifetime_ = subBuilder.buildPartial(); } + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKey_ = s; break; } default: @@ -8273,6 +8576,59 @@ public com.google.protobuf.ByteString getServiceAccountBytes() { } } + public static final int PROJECT_FIELD_NUMBER = 7; + private volatile java.lang.Object project_; + /** + * + * + *
      +     * Optional. The project in which jobs are run. By default, the project containing the
      +     * Lake is used. If a project is provided, the
      +     * [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account] must belong to this project.
      +     * 
      + * + * string project = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + /** + * + * + *
      +     * Optional. The project in which jobs are run. By default, the project containing the
      +     * Lake is used. If a project is provided, the
      +     * [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account] must belong to this project.
      +     * 
      + * + * string project = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int MAX_JOB_EXECUTION_LIFETIME_FIELD_NUMBER = 8; private com.google.protobuf.Duration maxJobExecutionLifetime_; /** @@ -8327,28 +8683,85 @@ public com.google.protobuf.DurationOrBuilder getMaxJobExecutionLifetimeOrBuilder return getMaxJobExecutionLifetime(); } - private byte memoizedIsInitialized = -1; - + public static final int KMS_KEY_FIELD_NUMBER = 9; + private volatile java.lang.Object kmsKey_; + /** + * + * + *
      +     * Optional. The Cloud KMS key to use for encryption, of the form:
      +     * `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`.
      +     * 
      + * + * string kms_key = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kmsKey. + */ @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public java.lang.String getKmsKey() { + java.lang.Object ref = kmsKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKey_ = s; + return s; + } } - - @java.lang.Override + /** + * + * + *
      +     * Optional. The Cloud KMS key to use for encryption, of the form:
      +     * `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`.
      +     * 
      + * + * string kms_key = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kmsKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyBytes() { + java.lang.Object ref = kmsKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetArgs(), ArgsDefaultEntryHolder.defaultEntry, 4); if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, serviceAccount_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, project_); + } if (maxJobExecutionLifetime_ != null) { output.writeMessage(8, getMaxJobExecutionLifetime()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKey_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, kmsKey_); + } unknownFields.writeTo(output); } @@ -8371,11 +8784,17 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, serviceAccount_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, project_); + } if (maxJobExecutionLifetime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 8, getMaxJobExecutionLifetime()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKey_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, kmsKey_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -8394,10 +8813,12 @@ public boolean equals(final java.lang.Object obj) { if (!internalGetArgs().equals(other.internalGetArgs())) return false; if (!getServiceAccount().equals(other.getServiceAccount())) return false; + if (!getProject().equals(other.getProject())) return false; if (hasMaxJobExecutionLifetime() != other.hasMaxJobExecutionLifetime()) return false; if (hasMaxJobExecutionLifetime()) { if (!getMaxJobExecutionLifetime().equals(other.getMaxJobExecutionLifetime())) return false; } + if (!getKmsKey().equals(other.getKmsKey())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -8415,10 +8836,14 @@ public int hashCode() { } hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER; hash = (53 * hash) + getServiceAccount().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); if (hasMaxJobExecutionLifetime()) { hash = (37 * hash) + MAX_JOB_EXECUTION_LIFETIME_FIELD_NUMBER; hash = (53 * hash) + getMaxJobExecutionLifetime().hashCode(); } + hash = (37 * hash) + KMS_KEY_FIELD_NUMBER; + hash = (53 * hash) + getKmsKey().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -8589,12 +9014,16 @@ public Builder clear() { internalGetMutableArgs().clear(); serviceAccount_ = ""; + project_ = ""; + if (maxJobExecutionLifetimeBuilder_ == null) { maxJobExecutionLifetime_ = null; } else { maxJobExecutionLifetime_ = null; maxJobExecutionLifetimeBuilder_ = null; } + kmsKey_ = ""; + return this; } @@ -8626,11 +9055,13 @@ public com.google.cloud.dataplex.v1.Task.ExecutionSpec buildPartial() { result.args_ = internalGetArgs(); result.args_.makeImmutable(); result.serviceAccount_ = serviceAccount_; + result.project_ = project_; if (maxJobExecutionLifetimeBuilder_ == null) { result.maxJobExecutionLifetime_ = maxJobExecutionLifetime_; } else { result.maxJobExecutionLifetime_ = maxJobExecutionLifetimeBuilder_.build(); } + result.kmsKey_ = kmsKey_; onBuilt(); return result; } @@ -8688,9 +9119,17 @@ public Builder mergeFrom(com.google.cloud.dataplex.v1.Task.ExecutionSpec other) serviceAccount_ = other.serviceAccount_; onChanged(); } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + onChanged(); + } if (other.hasMaxJobExecutionLifetime()) { mergeMaxJobExecutionLifetime(other.getMaxJobExecutionLifetime()); } + if (!other.getKmsKey().isEmpty()) { + kmsKey_ = other.kmsKey_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -9074,6 +9513,122 @@ public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object project_ = ""; + /** + * + * + *
      +       * Optional. The project in which jobs are run. By default, the project containing the
      +       * Lake is used. If a project is provided, the
      +       * [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account] must belong to this project.
      +       * 
      + * + * string project = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
      +       * Optional. The project in which jobs are run. By default, the project containing the
      +       * Lake is used. If a project is provided, the
      +       * [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account] must belong to this project.
      +       * 
      + * + * string project = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
      +       * Optional. The project in which jobs are run. By default, the project containing the
      +       * Lake is used. If a project is provided, the
      +       * [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account] must belong to this project.
      +       * 
      + * + * string project = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + project_ = value; + onChanged(); + return this; + } + /** + * + * + *
      +       * Optional. The project in which jobs are run. By default, the project containing the
      +       * Lake is used. If a project is provided, the
      +       * [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account] must belong to this project.
      +       * 
      + * + * string project = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + + project_ = getDefaultInstance().getProject(); + onChanged(); + return this; + } + /** + * + * + *
      +       * Optional. The project in which jobs are run. By default, the project containing the
      +       * Lake is used. If a project is provided, the
      +       * [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account] must belong to this project.
      +       * 
      + * + * string project = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + project_ = value; + onChanged(); + return this; + } + private com.google.protobuf.Duration maxJobExecutionLifetime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, @@ -9278,6 +9833,117 @@ public com.google.protobuf.DurationOrBuilder getMaxJobExecutionLifetimeOrBuilder return maxJobExecutionLifetimeBuilder_; } + private java.lang.Object kmsKey_ = ""; + /** + * + * + *
      +       * Optional. The Cloud KMS key to use for encryption, of the form:
      +       * `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`.
      +       * 
      + * + * string kms_key = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kmsKey. + */ + public java.lang.String getKmsKey() { + java.lang.Object ref = kmsKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
      +       * Optional. The Cloud KMS key to use for encryption, of the form:
      +       * `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`.
      +       * 
      + * + * string kms_key = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kmsKey. + */ + public com.google.protobuf.ByteString getKmsKeyBytes() { + java.lang.Object ref = kmsKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
      +       * Optional. The Cloud KMS key to use for encryption, of the form:
      +       * `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`.
      +       * 
      + * + * string kms_key = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The kmsKey to set. + * @return This builder for chaining. + */ + public Builder setKmsKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKey_ = value; + onChanged(); + return this; + } + /** + * + * + *
      +       * Optional. The Cloud KMS key to use for encryption, of the form:
      +       * `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`.
      +       * 
      + * + * string kms_key = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearKmsKey() { + + kmsKey_ = getDefaultInstance().getKmsKey(); + onChanged(); + return this; + } + /** + * + * + *
      +       * Optional. The Cloud KMS key to use for encryption, of the form:
      +       * `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`.
      +       * 
      + * + * string kms_key = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for kmsKey to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKey_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -12440,36 +13106,1165 @@ public com.google.cloud.dataplex.v1.Task.SparkTaskConfig getDefaultInstanceForTy } } - private int configCase_ = 0; - private java.lang.Object config_; - - public enum ConfigCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - SPARK(300), - CONFIG_NOT_SET(0); - private final int value; + public interface ExecutionStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dataplex.v1.Task.ExecutionStatus) + com.google.protobuf.MessageOrBuilder { - private ConfigCase(int value) { - this.value = value; - } /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. + * + * + *
      +     * Output only. Last update time of the status.
      +     * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. */ - @java.lang.Deprecated - public static ConfigCase valueOf(int value) { - return forNumber(value); - } + boolean hasUpdateTime(); + /** + * + * + *
      +     * Output only. Last update time of the status.
      +     * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
      +     * Output only. Last update time of the status.
      +     * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); - public static ConfigCase forNumber(int value) { - switch (value) { - case 300: - return SPARK; - case 0: - return CONFIG_NOT_SET; + /** + * + * + *
      +     * Output only. latest job execution
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the latestJob field is set. + */ + boolean hasLatestJob(); + /** + * + * + *
      +     * Output only. latest job execution
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The latestJob. + */ + com.google.cloud.dataplex.v1.Job getLatestJob(); + /** + * + * + *
      +     * Output only. latest job execution
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.dataplex.v1.JobOrBuilder getLatestJobOrBuilder(); + } + /** + * + * + *
      +   * Status of the task execution (e.g. Jobs).
      +   * 
      + * + * Protobuf type {@code google.cloud.dataplex.v1.Task.ExecutionStatus} + */ + public static final class ExecutionStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dataplex.v1.Task.ExecutionStatus) + ExecutionStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExecutionStatus.newBuilder() to construct. + private ExecutionStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExecutionStatus() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExecutionStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExecutionStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + com.google.cloud.dataplex.v1.Job.Builder subBuilder = null; + if (latestJob_ != null) { + subBuilder = latestJob_.toBuilder(); + } + latestJob_ = + input.readMessage(com.google.cloud.dataplex.v1.Job.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(latestJob_); + latestJob_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dataplex.v1.TasksProto + .internal_static_google_cloud_dataplex_v1_Task_ExecutionStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dataplex.v1.TasksProto + .internal_static_google_cloud_dataplex_v1_Task_ExecutionStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dataplex.v1.Task.ExecutionStatus.class, + com.google.cloud.dataplex.v1.Task.ExecutionStatus.Builder.class); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
      +     * Output only. Last update time of the status.
      +     * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
      +     * Output only. Last update time of the status.
      +     * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
      +     * Output only. Last update time of the status.
      +     * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LATEST_JOB_FIELD_NUMBER = 9; + private com.google.cloud.dataplex.v1.Job latestJob_; + /** + * + * + *
      +     * Output only. latest job execution
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the latestJob field is set. + */ + @java.lang.Override + public boolean hasLatestJob() { + return latestJob_ != null; + } + /** + * + * + *
      +     * Output only. latest job execution
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The latestJob. + */ + @java.lang.Override + public com.google.cloud.dataplex.v1.Job getLatestJob() { + return latestJob_ == null + ? com.google.cloud.dataplex.v1.Job.getDefaultInstance() + : latestJob_; + } + /** + * + * + *
      +     * Output only. latest job execution
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.dataplex.v1.JobOrBuilder getLatestJobOrBuilder() { + return getLatestJob(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + if (latestJob_ != null) { + output.writeMessage(9, getLatestJob()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + if (latestJob_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getLatestJob()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dataplex.v1.Task.ExecutionStatus)) { + return super.equals(obj); + } + com.google.cloud.dataplex.v1.Task.ExecutionStatus other = + (com.google.cloud.dataplex.v1.Task.ExecutionStatus) obj; + + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasLatestJob() != other.hasLatestJob()) return false; + if (hasLatestJob()) { + if (!getLatestJob().equals(other.getLatestJob())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasLatestJob()) { + hash = (37 * hash) + LATEST_JOB_FIELD_NUMBER; + hash = (53 * hash) + getLatestJob().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.dataplex.v1.Task.ExecutionStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
      +     * Status of the task execution (e.g. Jobs).
      +     * 
      + * + * Protobuf type {@code google.cloud.dataplex.v1.Task.ExecutionStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dataplex.v1.Task.ExecutionStatus) + com.google.cloud.dataplex.v1.Task.ExecutionStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dataplex.v1.TasksProto + .internal_static_google_cloud_dataplex_v1_Task_ExecutionStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dataplex.v1.TasksProto + .internal_static_google_cloud_dataplex_v1_Task_ExecutionStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dataplex.v1.Task.ExecutionStatus.class, + com.google.cloud.dataplex.v1.Task.ExecutionStatus.Builder.class); + } + + // Construct using com.google.cloud.dataplex.v1.Task.ExecutionStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (latestJobBuilder_ == null) { + latestJob_ = null; + } else { + latestJob_ = null; + latestJobBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dataplex.v1.TasksProto + .internal_static_google_cloud_dataplex_v1_Task_ExecutionStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.dataplex.v1.Task.ExecutionStatus getDefaultInstanceForType() { + return com.google.cloud.dataplex.v1.Task.ExecutionStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dataplex.v1.Task.ExecutionStatus build() { + com.google.cloud.dataplex.v1.Task.ExecutionStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dataplex.v1.Task.ExecutionStatus buildPartial() { + com.google.cloud.dataplex.v1.Task.ExecutionStatus result = + new com.google.cloud.dataplex.v1.Task.ExecutionStatus(this); + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (latestJobBuilder_ == null) { + result.latestJob_ = latestJob_; + } else { + result.latestJob_ = latestJobBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dataplex.v1.Task.ExecutionStatus) { + return mergeFrom((com.google.cloud.dataplex.v1.Task.ExecutionStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dataplex.v1.Task.ExecutionStatus other) { + if (other == com.google.cloud.dataplex.v1.Task.ExecutionStatus.getDefaultInstance()) + return this; + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasLatestJob()) { + mergeLatestJob(other.getLatestJob()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dataplex.v1.Task.ExecutionStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dataplex.v1.Task.ExecutionStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
      +       * Output only. Last update time of the status.
      +       * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
      +       * Output only. Last update time of the status.
      +       * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
      +       * Output only. Last update time of the status.
      +       * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
      +       * Output only. Last update time of the status.
      +       * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
      +       * Output only. Last update time of the status.
      +       * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_) + .mergeFrom(value) + .buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
      +       * Output only. Last update time of the status.
      +       * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
      +       * Output only. Last update time of the status.
      +       * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
      +       * Output only. Last update time of the status.
      +       * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
      +       * Output only. Last update time of the status.
      +       * 
      + * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.cloud.dataplex.v1.Job latestJob_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dataplex.v1.Job, + com.google.cloud.dataplex.v1.Job.Builder, + com.google.cloud.dataplex.v1.JobOrBuilder> + latestJobBuilder_; + /** + * + * + *
      +       * Output only. latest job execution
      +       * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the latestJob field is set. + */ + public boolean hasLatestJob() { + return latestJobBuilder_ != null || latestJob_ != null; + } + /** + * + * + *
      +       * Output only. latest job execution
      +       * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The latestJob. + */ + public com.google.cloud.dataplex.v1.Job getLatestJob() { + if (latestJobBuilder_ == null) { + return latestJob_ == null + ? com.google.cloud.dataplex.v1.Job.getDefaultInstance() + : latestJob_; + } else { + return latestJobBuilder_.getMessage(); + } + } + /** + * + * + *
      +       * Output only. latest job execution
      +       * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setLatestJob(com.google.cloud.dataplex.v1.Job value) { + if (latestJobBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latestJob_ = value; + onChanged(); + } else { + latestJobBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
      +       * Output only. latest job execution
      +       * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setLatestJob(com.google.cloud.dataplex.v1.Job.Builder builderForValue) { + if (latestJobBuilder_ == null) { + latestJob_ = builderForValue.build(); + onChanged(); + } else { + latestJobBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
      +       * Output only. latest job execution
      +       * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeLatestJob(com.google.cloud.dataplex.v1.Job value) { + if (latestJobBuilder_ == null) { + if (latestJob_ != null) { + latestJob_ = + com.google.cloud.dataplex.v1.Job.newBuilder(latestJob_) + .mergeFrom(value) + .buildPartial(); + } else { + latestJob_ = value; + } + onChanged(); + } else { + latestJobBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
      +       * Output only. latest job execution
      +       * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearLatestJob() { + if (latestJobBuilder_ == null) { + latestJob_ = null; + onChanged(); + } else { + latestJob_ = null; + latestJobBuilder_ = null; + } + + return this; + } + /** + * + * + *
      +       * Output only. latest job execution
      +       * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.dataplex.v1.Job.Builder getLatestJobBuilder() { + + onChanged(); + return getLatestJobFieldBuilder().getBuilder(); + } + /** + * + * + *
      +       * Output only. latest job execution
      +       * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.dataplex.v1.JobOrBuilder getLatestJobOrBuilder() { + if (latestJobBuilder_ != null) { + return latestJobBuilder_.getMessageOrBuilder(); + } else { + return latestJob_ == null + ? com.google.cloud.dataplex.v1.Job.getDefaultInstance() + : latestJob_; + } + } + /** + * + * + *
      +       * Output only. latest job execution
      +       * 
      + * + * + * .google.cloud.dataplex.v1.Job latest_job = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dataplex.v1.Job, + com.google.cloud.dataplex.v1.Job.Builder, + com.google.cloud.dataplex.v1.JobOrBuilder> + getLatestJobFieldBuilder() { + if (latestJobBuilder_ == null) { + latestJobBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dataplex.v1.Job, + com.google.cloud.dataplex.v1.Job.Builder, + com.google.cloud.dataplex.v1.JobOrBuilder>( + getLatestJob(), getParentForChildren(), isClean()); + latestJob_ = null; + } + return latestJobBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dataplex.v1.Task.ExecutionStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dataplex.v1.Task.ExecutionStatus) + private static final com.google.cloud.dataplex.v1.Task.ExecutionStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dataplex.v1.Task.ExecutionStatus(); + } + + public static com.google.cloud.dataplex.v1.Task.ExecutionStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExecutionStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExecutionStatus(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.dataplex.v1.Task.ExecutionStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int configCase_ = 0; + private java.lang.Object config_; + + public enum ConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SPARK(300), + CONFIG_NOT_SET(0); + private final int value; + + private ConfigCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConfigCase valueOf(int value) { + return forNumber(value); + } + + public static ConfigCase forNumber(int value) { + switch (value) { + case 300: + return SPARK; + case 0: + return CONFIG_NOT_SET; default: return null; } @@ -13031,6 +14826,60 @@ public com.google.cloud.dataplex.v1.Task.ExecutionSpecOrBuilder getExecutionSpec return getExecutionSpec(); } + public static final int EXECUTION_STATUS_FIELD_NUMBER = 201; + private com.google.cloud.dataplex.v1.Task.ExecutionStatus executionStatus_; + /** + * + * + *
      +   * Output only. Status of the latest task executions.
      +   * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the executionStatus field is set. + */ + @java.lang.Override + public boolean hasExecutionStatus() { + return executionStatus_ != null; + } + /** + * + * + *
      +   * Output only. Status of the latest task executions.
      +   * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The executionStatus. + */ + @java.lang.Override + public com.google.cloud.dataplex.v1.Task.ExecutionStatus getExecutionStatus() { + return executionStatus_ == null + ? com.google.cloud.dataplex.v1.Task.ExecutionStatus.getDefaultInstance() + : executionStatus_; + } + /** + * + * + *
      +   * Output only. Status of the latest task executions.
      +   * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.dataplex.v1.Task.ExecutionStatusOrBuilder getExecutionStatusOrBuilder() { + return getExecutionStatus(); + } + public static final int SPARK_FIELD_NUMBER = 300; /** * @@ -13125,6 +14974,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (executionSpec_ != null) { output.writeMessage(101, getExecutionSpec()); } + if (executionStatus_ != null) { + output.writeMessage(201, getExecutionStatus()); + } if (configCase_ == 300) { output.writeMessage(300, (com.google.cloud.dataplex.v1.Task.SparkTaskConfig) config_); } @@ -13174,6 +15026,9 @@ public int getSerializedSize() { if (executionSpec_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(101, getExecutionSpec()); } + if (executionStatus_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(201, getExecutionStatus()); + } if (configCase_ == 300) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( @@ -13216,6 +15071,10 @@ public boolean equals(final java.lang.Object obj) { if (hasExecutionSpec()) { if (!getExecutionSpec().equals(other.getExecutionSpec())) return false; } + if (hasExecutionStatus() != other.hasExecutionStatus()) return false; + if (hasExecutionStatus()) { + if (!getExecutionStatus().equals(other.getExecutionStatus())) return false; + } if (!getConfigCase().equals(other.getConfigCase())) return false; switch (configCase_) { case 300: @@ -13265,6 +15124,10 @@ public int hashCode() { hash = (37 * hash) + EXECUTION_SPEC_FIELD_NUMBER; hash = (53 * hash) + getExecutionSpec().hashCode(); } + if (hasExecutionStatus()) { + hash = (37 * hash) + EXECUTION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getExecutionStatus().hashCode(); + } switch (configCase_) { case 300: hash = (37 * hash) + SPARK_FIELD_NUMBER; @@ -13472,6 +15335,12 @@ public Builder clear() { executionSpec_ = null; executionSpecBuilder_ = null; } + if (executionStatusBuilder_ == null) { + executionStatus_ = null; + } else { + executionStatus_ = null; + executionStatusBuilder_ = null; + } configCase_ = 0; config_ = null; return this; @@ -13528,6 +15397,11 @@ public com.google.cloud.dataplex.v1.Task buildPartial() { } else { result.executionSpec_ = executionSpecBuilder_.build(); } + if (executionStatusBuilder_ == null) { + result.executionStatus_ = executionStatus_; + } else { + result.executionStatus_ = executionStatusBuilder_.build(); + } if (configCase_ == 300) { if (sparkBuilder_ == null) { result.config_ = config_; @@ -13617,6 +15491,9 @@ public Builder mergeFrom(com.google.cloud.dataplex.v1.Task other) { if (other.hasExecutionSpec()) { mergeExecutionSpec(other.getExecutionSpec()); } + if (other.hasExecutionStatus()) { + mergeExecutionStatus(other.getExecutionStatus()); + } switch (other.getConfigCase()) { case SPARK: { @@ -15186,6 +17063,211 @@ public com.google.cloud.dataplex.v1.Task.ExecutionSpecOrBuilder getExecutionSpec return executionSpecBuilder_; } + private com.google.cloud.dataplex.v1.Task.ExecutionStatus executionStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dataplex.v1.Task.ExecutionStatus, + com.google.cloud.dataplex.v1.Task.ExecutionStatus.Builder, + com.google.cloud.dataplex.v1.Task.ExecutionStatusOrBuilder> + executionStatusBuilder_; + /** + * + * + *
      +     * Output only. Status of the latest task executions.
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the executionStatus field is set. + */ + public boolean hasExecutionStatus() { + return executionStatusBuilder_ != null || executionStatus_ != null; + } + /** + * + * + *
      +     * Output only. Status of the latest task executions.
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The executionStatus. + */ + public com.google.cloud.dataplex.v1.Task.ExecutionStatus getExecutionStatus() { + if (executionStatusBuilder_ == null) { + return executionStatus_ == null + ? com.google.cloud.dataplex.v1.Task.ExecutionStatus.getDefaultInstance() + : executionStatus_; + } else { + return executionStatusBuilder_.getMessage(); + } + } + /** + * + * + *
      +     * Output only. Status of the latest task executions.
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExecutionStatus(com.google.cloud.dataplex.v1.Task.ExecutionStatus value) { + if (executionStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + executionStatus_ = value; + onChanged(); + } else { + executionStatusBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
      +     * Output only. Status of the latest task executions.
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExecutionStatus( + com.google.cloud.dataplex.v1.Task.ExecutionStatus.Builder builderForValue) { + if (executionStatusBuilder_ == null) { + executionStatus_ = builderForValue.build(); + onChanged(); + } else { + executionStatusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
      +     * Output only. Status of the latest task executions.
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeExecutionStatus(com.google.cloud.dataplex.v1.Task.ExecutionStatus value) { + if (executionStatusBuilder_ == null) { + if (executionStatus_ != null) { + executionStatus_ = + com.google.cloud.dataplex.v1.Task.ExecutionStatus.newBuilder(executionStatus_) + .mergeFrom(value) + .buildPartial(); + } else { + executionStatus_ = value; + } + onChanged(); + } else { + executionStatusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
      +     * Output only. Status of the latest task executions.
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearExecutionStatus() { + if (executionStatusBuilder_ == null) { + executionStatus_ = null; + onChanged(); + } else { + executionStatus_ = null; + executionStatusBuilder_ = null; + } + + return this; + } + /** + * + * + *
      +     * Output only. Status of the latest task executions.
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.dataplex.v1.Task.ExecutionStatus.Builder getExecutionStatusBuilder() { + + onChanged(); + return getExecutionStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
      +     * Output only. Status of the latest task executions.
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.dataplex.v1.Task.ExecutionStatusOrBuilder + getExecutionStatusOrBuilder() { + if (executionStatusBuilder_ != null) { + return executionStatusBuilder_.getMessageOrBuilder(); + } else { + return executionStatus_ == null + ? com.google.cloud.dataplex.v1.Task.ExecutionStatus.getDefaultInstance() + : executionStatus_; + } + } + /** + * + * + *
      +     * Output only. Status of the latest task executions.
      +     * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dataplex.v1.Task.ExecutionStatus, + com.google.cloud.dataplex.v1.Task.ExecutionStatus.Builder, + com.google.cloud.dataplex.v1.Task.ExecutionStatusOrBuilder> + getExecutionStatusFieldBuilder() { + if (executionStatusBuilder_ == null) { + executionStatusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dataplex.v1.Task.ExecutionStatus, + com.google.cloud.dataplex.v1.Task.ExecutionStatus.Builder, + com.google.cloud.dataplex.v1.Task.ExecutionStatusOrBuilder>( + getExecutionStatus(), getParentForChildren(), isClean()); + executionStatus_ = null; + } + return executionStatusBuilder_; + } + private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dataplex.v1.Task.SparkTaskConfig, com.google.cloud.dataplex.v1.Task.SparkTaskConfig.Builder, diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/TaskOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/TaskOrBuilder.java index 757473f..7d37ebe 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/TaskOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/TaskOrBuilder.java @@ -377,6 +377,47 @@ java.lang.String getLabelsOrDefault( */ com.google.cloud.dataplex.v1.Task.ExecutionSpecOrBuilder getExecutionSpecOrBuilder(); + /** + * + * + *
      +   * Output only. Status of the latest task executions.
      +   * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the executionStatus field is set. + */ + boolean hasExecutionStatus(); + /** + * + * + *
      +   * Output only. Status of the latest task executions.
      +   * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The executionStatus. + */ + com.google.cloud.dataplex.v1.Task.ExecutionStatus getExecutionStatus(); + /** + * + * + *
      +   * Output only. Status of the latest task executions.
      +   * 
      + * + * + * .google.cloud.dataplex.v1.Task.ExecutionStatus execution_status = 201 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.dataplex.v1.Task.ExecutionStatusOrBuilder getExecutionStatusOrBuilder(); + /** * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/TasksProto.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/TasksProto.java index 9961a92..f7c7f30 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/TasksProto.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/TasksProto.java @@ -67,6 +67,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_dataplex_v1_Task_SparkTaskConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataplex_v1_Task_SparkTaskConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dataplex_v1_Task_ExecutionStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dataplex_v1_Task_ExecutionStatus_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataplex_v1_Task_LabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -89,7 +93,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ld_behavior.proto\032\031google/api/resource.p" + "roto\032(google/cloud/dataplex/v1/resources" + ".proto\032\036google/protobuf/duration.proto\032\037" - + "google/protobuf/timestamp.proto\"\220\022\n\004Task" + + "google/protobuf/timestamp.proto\"\241\024\n\004Task" + "\0222\n\004name\030\001 \001(\tB$\340A\003\372A\036\n\034dataplex.googlea" + "pis.com/Task\022\020\n\003uid\030\002 \001(\tB\003\340A\003\0224\n\013create" + "_time\030\003 \001(\0132\032.google.protobuf.TimestampB" @@ -102,9 +106,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "_spec\030d \001(\0132*.google.cloud.dataplex.v1.T" + "ask.TriggerSpecB\003\340A\002\022I\n\016execution_spec\030e" + " \001(\0132,.google.cloud.dataplex.v1.Task.Exe" - + "cutionSpecB\003\340A\002\022@\n\005spark\030\254\002 \001(\0132..google" + + "cutionSpecB\003\340A\002\022N\n\020execution_status\030\311\001 \001" + + "(\0132..google.cloud.dataplex.v1.Task.Execu" + + "tionStatusB\003\340A\003\022@\n\005spark\030\254\002 \001(\0132..google" + ".cloud.dataplex.v1.Task.SparkTaskConfigH" - + "\000\032\206\006\n\022InfrastructureSpec\022X\n\005batch\0304 \001(\0132" + + "\000\032\232\006\n\022InfrastructureSpec\022X\n\005batch\0304 \001(\0132" + "G.google.cloud.dataplex.v1.Task.Infrastr" + "uctureSpec.BatchComputeResourcesH\000\022b\n\017co" + "ntainer_image\030e \001(\0132G.google.cloud.datap" @@ -113,61 +119,65 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "oogle.cloud.dataplex.v1.Task.Infrastruct" + "ureSpec.VpcNetworkH\002\032W\n\025BatchComputeReso" + "urces\022\034\n\017executors_count\030\001 \001(\005B\003\340A\001\022 \n\023m" - + "ax_executors_count\030\002 \001(\005B\003\340A\001\032\362\001\n\025Contai" - + "nerImageRuntime\022\026\n\tjava_jars\030\002 \003(\tB\003\340A\001\022" - + "\034\n\017python_packages\030\003 \003(\tB\003\340A\001\022p\n\npropert" - + "ies\030\004 \003(\0132W.google.cloud.dataplex.v1.Tas" - + "k.InfrastructureSpec.ContainerImageRunti" - + "me.PropertiesEntryB\003\340A\001\0321\n\017PropertiesEnt" - + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032k\n\nVp" - + "cNetwork\022\026\n\007network\030\001 \001(\tB\003\340A\001H\000\022\032\n\013sub_" - + "network\030\002 \001(\tB\003\340A\001H\000\022\031\n\014network_tags\030\003 \003" - + "(\tB\003\340A\001B\016\n\014network_nameB\013\n\tresourcesB\t\n\007" - + "runtimeB\t\n\007network\032\232\002\n\013TriggerSpec\022E\n\004ty" - + "pe\030\005 \001(\0162/.google.cloud.dataplex.v1.Task" - + ".TriggerSpec.TypeB\006\340A\002\340A\005\0223\n\nstart_time\030" - + "\006 \001(\0132\032.google.protobuf.TimestampB\003\340A\001\022\025" - + "\n\010disabled\030\004 \001(\010B\003\340A\001\022\030\n\013max_retries\030\007 \001" - + "(\005B\003\340A\001\022\027\n\010schedule\030d \001(\tB\003\340A\001H\000\":\n\004Type" - + "\022\024\n\020TYPE_UNSPECIFIED\020\000\022\r\n\tON_DEMAND\020\001\022\r\n" - + "\tRECURRING\020\002B\t\n\007trigger\032\351\001\n\rExecutionSpe" - + "c\022I\n\004args\030\004 \003(\01326.google.cloud.dataplex." - + "v1.Task.ExecutionSpec.ArgsEntryB\003\340A\001\022\034\n\017" - + "service_account\030\005 \001(\tB\003\340A\002\022B\n\032max_job_ex" - + "ecution_lifetime\030\010 \001(\0132\031.google.protobuf" - + ".DurationB\003\340A\001\032+\n\tArgsEntry\022\013\n\003key\030\001 \001(\t" - + "\022\r\n\005value\030\002 \001(\t:\0028\001\032\245\002\n\017SparkTaskConfig\022" - + "\033\n\021main_jar_file_uri\030d \001(\tH\000\022\024\n\nmain_cla" - + "ss\030e \001(\tH\000\022\034\n\022python_script_file\030f \001(\tH\000" - + "\022\031\n\017sql_script_file\030h \001(\tH\000\022\024\n\nsql_scrip" - + "t\030i \001(\tH\000\022\026\n\tfile_uris\030\003 \003(\tB\003\340A\001\022\031\n\014arc" - + "hive_uris\030\004 \003(\tB\003\340A\001\022S\n\023infrastructure_s" - + "pec\030\006 \001(\01321.google.cloud.dataplex.v1.Tas" - + "k.InfrastructureSpecB\003\340A\001B\010\n\006driver\032-\n\013L" - + "abelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" - + "8\001:d\352Aa\n\034dataplex.googleapis.com/Task\022Ap" - + "rojects/{project}/locations/{location}/l" - + "akes/{lake}/tasks/{task}B\010\n\006config\"\210\005\n\003J" - + "ob\0221\n\004name\030\001 \001(\tB#\340A\003\372A\035\n\033dataplex.googl" - + "eapis.com/Job\022\020\n\003uid\030\002 \001(\tB\003\340A\003\0223\n\nstart" - + "_time\030\003 \001(\0132\032.google.protobuf.TimestampB" - + "\003\340A\003\0221\n\010end_time\030\004 \001(\0132\032.google.protobuf" - + ".TimestampB\003\340A\003\0227\n\005state\030\005 \001(\0162#.google." - + "cloud.dataplex.v1.Job.StateB\003\340A\003\022\030\n\013retr" - + "y_count\030\006 \001(\rB\003\340A\003\022;\n\007service\030\007 \001(\0162%.go" - + "ogle.cloud.dataplex.v1.Job.ServiceB\003\340A\003\022" - + "\030\n\013service_job\030\010 \001(\tB\003\340A\003\022\024\n\007message\030\t \001" - + "(\tB\003\340A\003\"0\n\007Service\022\027\n\023SERVICE_UNSPECIFIE" - + "D\020\000\022\014\n\010DATAPROC\020\001\"r\n\005State\022\025\n\021STATE_UNSP" - + "ECIFIED\020\000\022\013\n\007RUNNING\020\001\022\016\n\nCANCELLING\020\002\022\r" - + "\n\tCANCELLED\020\003\022\r\n\tSUCCEEDED\020\004\022\n\n\006FAILED\020\005" - + "\022\013\n\007ABORTED\020\006:n\352Ak\n\033dataplex.googleapis." - + "com/Job\022Lprojects/{project}/locations/{l" - + "ocation}/lakes/{lake}/tasks/{task}/jobs/" - + "{job}Bn\n\034com.google.cloud.dataplex.v1B\nT" - + "asksProtoP\001Z@google.golang.org/genproto/" - + "googleapis/cloud/dataplex/v1;dataplexb\006p" - + "roto3" + + "ax_executors_count\030\002 \001(\005B\003\340A\001\032\206\002\n\025Contai" + + "nerImageRuntime\022\022\n\005image\030\001 \001(\tB\003\340A\001\022\026\n\tj" + + "ava_jars\030\002 \003(\tB\003\340A\001\022\034\n\017python_packages\030\003" + + " \003(\tB\003\340A\001\022p\n\nproperties\030\004 \003(\0132W.google.c" + + "loud.dataplex.v1.Task.InfrastructureSpec" + + ".ContainerImageRuntime.PropertiesEntryB\003" + + "\340A\001\0321\n\017PropertiesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + + "alue\030\002 \001(\t:\0028\001\032k\n\nVpcNetwork\022\026\n\007network\030" + + "\001 \001(\tB\003\340A\001H\000\022\032\n\013sub_network\030\002 \001(\tB\003\340A\001H\000" + + "\022\031\n\014network_tags\030\003 \003(\tB\003\340A\001B\016\n\014network_n" + + "ameB\013\n\tresourcesB\t\n\007runtimeB\t\n\007network\032\232" + + "\002\n\013TriggerSpec\022E\n\004type\030\005 \001(\0162/.google.cl" + + "oud.dataplex.v1.Task.TriggerSpec.TypeB\006\340" + + "A\002\340A\005\0223\n\nstart_time\030\006 \001(\0132\032.google.proto" + + "buf.TimestampB\003\340A\001\022\025\n\010disabled\030\004 \001(\010B\003\340A" + + "\001\022\030\n\013max_retries\030\007 \001(\005B\003\340A\001\022\027\n\010schedule\030" + + "d \001(\tB\003\340A\001H\000\":\n\004Type\022\024\n\020TYPE_UNSPECIFIED" + + "\020\000\022\r\n\tON_DEMAND\020\001\022\r\n\tRECURRING\020\002B\t\n\007trig" + + "ger\032\225\002\n\rExecutionSpec\022I\n\004args\030\004 \003(\01326.go" + + "ogle.cloud.dataplex.v1.Task.ExecutionSpe" + + "c.ArgsEntryB\003\340A\001\022\034\n\017service_account\030\005 \001(" + + "\tB\003\340A\002\022\024\n\007project\030\007 \001(\tB\003\340A\001\022B\n\032max_job_" + + "execution_lifetime\030\010 \001(\0132\031.google.protob" + + "uf.DurationB\003\340A\001\022\024\n\007kms_key\030\t \001(\tB\003\340A\001\032+" + + "\n\tArgsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + + "\0028\001\032\245\002\n\017SparkTaskConfig\022\033\n\021main_jar_file" + + "_uri\030d \001(\tH\000\022\024\n\nmain_class\030e \001(\tH\000\022\034\n\022py" + + "thon_script_file\030f \001(\tH\000\022\031\n\017sql_script_f" + + "ile\030h \001(\tH\000\022\024\n\nsql_script\030i \001(\tH\000\022\026\n\tfil" + + "e_uris\030\003 \003(\tB\003\340A\001\022\031\n\014archive_uris\030\004 \003(\tB" + + "\003\340A\001\022S\n\023infrastructure_spec\030\006 \001(\01321.goog" + + "le.cloud.dataplex.v1.Task.Infrastructure" + + "SpecB\003\340A\001B\010\n\006driver\032\177\n\017ExecutionStatus\0224" + + "\n\013update_time\030\003 \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\003\0226\n\nlatest_job\030\t \001(\0132\035.googl" + + "e.cloud.dataplex.v1.JobB\003\340A\003\032-\n\013LabelsEn" + + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:d\352Aa" + + "\n\034dataplex.googleapis.com/Task\022Aprojects" + + "/{project}/locations/{location}/lakes/{l" + + "ake}/tasks/{task}B\010\n\006config\"\210\005\n\003Job\0221\n\004n" + + "ame\030\001 \001(\tB#\340A\003\372A\035\n\033dataplex.googleapis.c" + + "om/Job\022\020\n\003uid\030\002 \001(\tB\003\340A\003\0223\n\nstart_time\030\003" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0221\n" + + "\010end_time\030\004 \001(\0132\032.google.protobuf.Timest" + + "ampB\003\340A\003\0227\n\005state\030\005 \001(\0162#.google.cloud.d" + + "ataplex.v1.Job.StateB\003\340A\003\022\030\n\013retry_count" + + "\030\006 \001(\rB\003\340A\003\022;\n\007service\030\007 \001(\0162%.google.cl" + + "oud.dataplex.v1.Job.ServiceB\003\340A\003\022\030\n\013serv" + + "ice_job\030\010 \001(\tB\003\340A\003\022\024\n\007message\030\t \001(\tB\003\340A\003" + + "\"0\n\007Service\022\027\n\023SERVICE_UNSPECIFIED\020\000\022\014\n\010" + + "DATAPROC\020\001\"r\n\005State\022\025\n\021STATE_UNSPECIFIED" + + "\020\000\022\013\n\007RUNNING\020\001\022\016\n\nCANCELLING\020\002\022\r\n\tCANCE" + + "LLED\020\003\022\r\n\tSUCCEEDED\020\004\022\n\n\006FAILED\020\005\022\013\n\007ABO" + + "RTED\020\006:n\352Ak\n\033dataplex.googleapis.com/Job" + + "\022Lprojects/{project}/locations/{location" + + "}/lakes/{lake}/tasks/{task}/jobs/{job}Bn" + + "\n\034com.google.cloud.dataplex.v1B\nTasksPro" + + "toP\001Z@google.golang.org/genproto/googlea" + + "pis/cloud/dataplex/v1;dataplexb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -195,6 +205,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Labels", "TriggerSpec", "ExecutionSpec", + "ExecutionStatus", "Spark", "Config", }); @@ -224,7 +235,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataplex_v1_Task_InfrastructureSpec_ContainerImageRuntime_descriptor, new java.lang.String[] { - "JavaJars", "PythonPackages", "Properties", + "Image", "JavaJars", "PythonPackages", "Properties", }); internal_static_google_cloud_dataplex_v1_Task_InfrastructureSpec_ContainerImageRuntime_PropertiesEntry_descriptor = internal_static_google_cloud_dataplex_v1_Task_InfrastructureSpec_ContainerImageRuntime_descriptor @@ -260,7 +271,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataplex_v1_Task_ExecutionSpec_descriptor, new java.lang.String[] { - "Args", "ServiceAccount", "MaxJobExecutionLifetime", + "Args", "ServiceAccount", "Project", "MaxJobExecutionLifetime", "KmsKey", }); internal_static_google_cloud_dataplex_v1_Task_ExecutionSpec_ArgsEntry_descriptor = internal_static_google_cloud_dataplex_v1_Task_ExecutionSpec_descriptor @@ -288,8 +299,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InfrastructureSpec", "Driver", }); - internal_static_google_cloud_dataplex_v1_Task_LabelsEntry_descriptor = + internal_static_google_cloud_dataplex_v1_Task_ExecutionStatus_descriptor = internal_static_google_cloud_dataplex_v1_Task_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_dataplex_v1_Task_ExecutionStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dataplex_v1_Task_ExecutionStatus_descriptor, + new java.lang.String[] { + "UpdateTime", "LatestJob", + }); + internal_static_google_cloud_dataplex_v1_Task_LabelsEntry_descriptor = + internal_static_google_cloud_dataplex_v1_Task_descriptor.getNestedTypes().get(5); internal_static_google_cloud_dataplex_v1_Task_LabelsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataplex_v1_Task_LabelsEntry_descriptor, diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Zone.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Zone.java index 6401936..4d07dee 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Zone.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/Zone.java @@ -5599,7 +5599,7 @@ public com.google.cloud.dataplex.v1.Zone.DiscoverySpec getDefaultInstanceForType * *
          * Output only. The relative resource name of the zone, of the form:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
          * 
      * * @@ -5625,7 +5625,7 @@ public java.lang.String getName() { * *
          * Output only. The relative resource name of the zone, of the form:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
          * 
      * * @@ -6818,7 +6818,7 @@ public Builder mergeFrom( * *
            * Output only. The relative resource name of the zone, of the form:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
            * 
      * * @@ -6843,7 +6843,7 @@ public java.lang.String getName() { * *
            * Output only. The relative resource name of the zone, of the form:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
            * 
      * * @@ -6868,7 +6868,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
            * Output only. The relative resource name of the zone, of the form:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
            * 
      * * @@ -6892,7 +6892,7 @@ public Builder setName(java.lang.String value) { * *
            * Output only. The relative resource name of the zone, of the form:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
            * 
      * * @@ -6912,7 +6912,7 @@ public Builder clearName() { * *
            * Output only. The relative resource name of the zone, of the form:
      -     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +     * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
            * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ZoneOrBuilder.java b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ZoneOrBuilder.java index 76d2ee3..53026cd 100644 --- a/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ZoneOrBuilder.java +++ b/proto-google-cloud-dataplex-v1/src/main/java/com/google/cloud/dataplex/v1/ZoneOrBuilder.java @@ -28,7 +28,7 @@ public interface ZoneOrBuilder * *
          * Output only. The relative resource name of the zone, of the form:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
          * 
      * * @@ -43,7 +43,7 @@ public interface ZoneOrBuilder * *
          * Output only. The relative resource name of the zone, of the form:
      -   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`
      +   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
          * 
      * * diff --git a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/content.proto b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/content.proto index bc0f5c6..cd335a5 100644 --- a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/content.proto +++ b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/content.proto @@ -21,6 +21,8 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/dataplex/v1/analyze.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; @@ -39,6 +41,10 @@ service ContentService { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems" body: "content" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/lakes/*}/content" + body: "content" + } }; option (google.api.method_signature) = "parent,content"; } @@ -48,6 +54,10 @@ service ContentService { option (google.api.http) = { patch: "/v1/{content.name=projects/*/locations/*/lakes/*/contentitems/**}" body: "content" + additional_bindings { + patch: "/v1/{content.name=projects/*/locations/*/lakes/*/content/**}" + body: "content" + } }; option (google.api.method_signature) = "content,update_mask"; } @@ -56,6 +66,9 @@ service ContentService { rpc DeleteContent(DeleteContentRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}" + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/lakes/*/content/**}" + } }; option (google.api.method_signature) = "name"; } @@ -64,14 +77,73 @@ service ContentService { rpc GetContent(GetContentRequest) returns (Content) { option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}" + additional_bindings { + get: "/v1/{name=projects/*/locations/*/lakes/*/content/**}" + } }; option (google.api.method_signature) = "name"; } + // Gets the access control policy for a contentitem resource. A `NOT_FOUND` + // error is returned if the resource does not exist. An empty policy is + // returned if the resource exists but does not have a policy set on it. + // + // Caller must have Google IAM `dataplex.content.getIamPolicy` permission + // on the resource. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + get: "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:getIamPolicy" + additional_bindings { + get: "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:getIamPolicy" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy on the specified contentitem resource. + // Replaces any existing policy. + // + // Caller must have Google IAM `dataplex.content.setIamPolicy` permission + // on the resource. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:setIamPolicy" + body: "*" + } + }; + } + + // Returns the caller's permissions on a resource. + // If the resource does not exist, an empty set of + // permissions is returned (a `NOT_FOUND` error is not returned). + // + // A caller is not required to have Google IAM permission to make this + // request. + // + // Note: This operation is designed to be used for building permission-aware + // UIs and command-line tools, not for authorization checking. This operation + // may "fail open" without warning. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:testIamPermissions" + body: "*" + } + }; + } + // List content. rpc ListContent(ListContentRequest) returns (ListContentResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems" + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/lakes/*}/content" + } }; option (google.api.method_signature) = "parent"; } diff --git a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/logs.proto b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/logs.proto index c1255bc..51e48e4 100644 --- a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/logs.proto +++ b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/logs.proto @@ -96,6 +96,10 @@ message DiscoveryEvent { // The type of the containing entity resource. EntityType type = 3; + + // The locations of the data items (e.g., a Cloud Storage objects) sampled + // for metadata inference. + repeated string sampled_data_locations = 4; } // Details about the action. diff --git a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/metadata.proto b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/metadata.proto index 48d4390..290d940 100644 --- a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/metadata.proto +++ b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/metadata.proto @@ -152,7 +152,8 @@ message DeleteEntityRequest { } ]; - // Required. The etag associated with the partition if it was previously retrieved. + // Required. The etag associated with the entity, which can be retrieved with a + // [GetEntity][] request. string etag = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -160,7 +161,8 @@ message DeleteEntityRequest { message ListEntitiesRequest { // Entity views. enum EntityView { - // The default unset value. The API will default to the FULL view. + // The default unset value. Return both table and fileset entities + // if unspecified. ENTITY_VIEW_UNSPECIFIED = 0; // Only list table entities. @@ -199,8 +201,8 @@ message ListEntitiesRequest { // - Entity ID: ?filter="id=entityID" // - Asset ID: ?filter="asset=assetID" // - Data path ?filter="data_path=gs://my-bucket" - // - Is HIVE compatible: ?filter=”hive_compatible=true” - // - Is BigQuery compatible: ?filter=”bigquery_compatible=true” + // - Is HIVE compatible: ?filter="hive_compatible=true" + // - Is BigQuery compatible: ?filter="bigquery_compatible=true" string filter = 5 [(google.api.field_behavior) = OPTIONAL]; } @@ -267,14 +269,14 @@ message ListPartitionsRequest { // page token. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Filter the partitions returned to the caller using a key vslue pair - // expression. The filter expression supports: + // Optional. Filter the partitions returned to the caller using a key value pair + // expression. Supported operators and syntax: // - // - logical operators: AND, OR + // - logic operators: AND, OR // - comparison operators: <, >, >=, <= ,=, != // - LIKE operators: - // - The right hand of a LIKE operator supports “.” and - // “*” for wildcard searches, for example "value1 LIKE ".*oo.*" + // - The right hand of a LIKE operator supports "." and + // "*" for wildcard searches, for example "value1 LIKE ".*oo.*" // - parenthetical grouping: ( ) // // Sample filter expression: `?filter="key1 < value1 OR key2 > value2" @@ -322,7 +324,7 @@ message DeletePartitionRequest { } ]; - // Optional. The etag associated with the partition if it was previously retrieved. + // Optional. The etag associated with the partition. string etag = 2 [ deprecated = true, (google.api.field_behavior) = OPTIONAL @@ -401,7 +403,7 @@ message Entity { } ]; - // Optional. Display name must be shorter than or equal to 63 characters. + // Optional. Display name must be shorter than or equal to 256 characters. string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. User friendly longer description text. Must be shorter than or equal to @@ -418,11 +420,12 @@ message Entity { // published table name. Specifying a new ID in an update entity // request will override the existing value. // The ID must contain only letters (a-z, A-Z), numbers (0-9), and - // underscores. Must begin with a letter. + // underscores. Must begin with a letter and consist of 256 or fewer + // characters. string id = 7 [(google.api.field_behavior) = REQUIRED]; - // Optional. The etag for this entity. Required for update and delete requests. Must - // match the server's etag. + // Optional. The etag associated with the entity, which can be retrieved with a + // [GetEntity][] request. Required for update and delete requests. string etag = 8 [(google.api.field_behavior) = OPTIONAL]; // Required. Immutable. The type of entity. @@ -482,13 +485,11 @@ message Partition { pattern: "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}/partitions/{partition}" }; - // Output only. The values must be HTML URL encoded two times before constructing the path. - // For example, if you have a value of "US:CA", encoded it two times and you - // get "US%253ACA". Then if you have the 2nd value is "CA#Sunnyvale", encoded - // two times and you get "CA%2523Sunnyvale". The partition values path is - // "US%253ACA/CA%2523Sunnyvale". The final URL will be - // "https://.../partitions/US%253ACA/CA%2523Sunnyvale". The name field in the - // responses will always have the encoded format. + // Output only. Partition values used in the HTTP URL must be + // double encoded. For example, `url_encode(url_encode(value))` can be used + // to encode "US:CA/CA#Sunnyvale so that the request URL ends + // with "/partitions/US%253ACA/CA%2523Sunnyvale". + // The name field in the response retains the encoded format. string name = 1 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { @@ -589,8 +590,9 @@ message Schema { // Represents a column field within a table schema. message SchemaField { - // Required. The name of the field. The maximum length is 767 characters. The name - // must begins with a letter and not contains `:` and `.`. + // Required. The name of the field. Must contain only letters, numbers and + // underscores, with a maximum length of 767 characters, + // and must begin with a letter or underscore. string name = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. User friendly field description. Must be less than or equal to 1024 @@ -609,10 +611,12 @@ message Schema { // Represents a key field within the entity's partition structure. You could // have up to 20 partition fields, but only the first 10 partitions have the - // filtering ability due to performance consideration. + // filtering ability due to performance consideration. **Note:** + // Partition fields are immutable. message PartitionField { - // Required. Partition name is editable if only the partition style is not HIVE - // compatible. The maximum length allowed is 767 characters. + // Required. Partition field name must consist of letters, numbers, and underscores + // only, with a maximum of length of 256 characters, + // and must begin with a letter or underscore.. string name = 1 [(google.api.field_behavior) = REQUIRED]; // Required. Immutable. The type of field. @@ -633,26 +637,23 @@ message Schema { HIVE_COMPATIBLE = 1; } - // Required. Whether the schema is user-managed or managed by the service. - // - Set user_manage to false if you would like Dataplex to help you manage - // the schema. You will get the full service provided by Dataplex discovery, - // including new data discovery, schema inference and schema evolution. You - // can still provide input the schema of the entities, for example renaming a - // schema field, changing CSV or Json options if you think the discovered - // values are not as accurate. Dataplex will consider your input as the - // initial schema (as if they were produced by the previous discovery run), - // and will evolve schema or flag actions based on that. - // - Set user_manage to true if you would like to fully manage the entity - // schema by yourself. This is useful when you would like to manually specify - // the schema for a table. In this case, the schema defined by the user is - // guaranteed to be kept unchanged and would not be overwritten. But this also - // means Dataplex will not provide schema evolution management for you. - // Dataplex will still be able to manage partition registration (i.e., keeping - // the list of partitions up to date) when Dataplex discovery is turned on and - // user_managed is set to true. + // Required. Set to `true` if user-managed or `false` if managed by Dataplex. The + // default is `false` (managed by Dataplex). + // + // - Set to `false`to enable Dataplex discovery to update the schema. + // including new data discovery, schema inference, and schema evolution. + // Users retain the ability to input and edit the schema. Dataplex + // treats schema input by the user as though produced + // by a previous Dataplex discovery operation, and it will + // evolve the schema and take action based on that treatment. + // + // - Set to `true` to fully manage the entity + // schema. This setting guarantees that Dataplex will not + // change schema fields. bool user_managed = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The sequence of fields describing data in table entities. + // **Note:** BigQuery SchemaFields are immutable. repeated SchemaField fields = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The sequence of fields describing the partition structure in entities. @@ -678,8 +679,9 @@ message StorageFormat { // Optional. The delimiter used to separate values. Defaults to ','. string delimiter = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The character used to quote column values. Accepts '"' and '''. - // Defaults to '"' if unspecified. + // Optional. The character used to quote column values. Accepts '"' + // (double quotation mark) or ''' (single quotation mark). Defaults to + // '"' (double quotation mark) if unspecified. string quote = 4 [(google.api.field_behavior) = OPTIONAL]; } @@ -754,6 +756,7 @@ message StorageFormat { // Required. The mime type descriptor for the data. Must match the pattern // {type}/{subtype}. Supported values: + // // - application/x-parquet // - application/x-avro // - application/x-orc diff --git a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/resources.proto b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/resources.proto index 8786a00..e07caac 100644 --- a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/resources.proto +++ b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/resources.proto @@ -257,7 +257,7 @@ message Zone { } // Output only. The relative resource name of the zone, of the form: - // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}` + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. string name = 1 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { diff --git a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/service.proto b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/service.proto index e104f44..f7995c0 100644 --- a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/service.proto +++ b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/service.proto @@ -35,9 +35,9 @@ option java_package = "com.google.cloud.dataplex.v1"; // Dataplex service provides data lakes as a service. The primary resources // offered by this service are Lakes, Zones and Assets which collectively allow -// a data adminstrator to organize, manage, secure and catalog data across their -// organization located across cloud projects in a variety of storage systems -// including Cloud Storage and BigQuery. +// a data administrator to organize, manage, secure and catalog data across +// their organization located across cloud projects in a variety of storage +// systems including Cloud Storage and BigQuery. service DataplexService { option (google.api.default_host) = "dataplex.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; @@ -421,7 +421,7 @@ message UpdateLakeRequest { // Delete lake request. message DeleteLakeRequest { // Required. The resource name of the lake: - // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -475,7 +475,7 @@ message ListLakesResponse { // List lake actions request. message ListLakeActionsRequest { // Required. The resource name of the parent lake: - // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -649,7 +649,7 @@ message GetZoneRequest { // Create asset request. message CreateAssetRequest { // Required. The resource name of the parent zone: - // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}` + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -894,7 +894,7 @@ message ListTasksResponse { // Get task request. message GetTaskRequest { // Required. The resource name of the task: - // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}` + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -963,7 +963,7 @@ message CancelJobRequest { // Create environment request. message CreateEnvironmentRequest { // Required. The resource name of the parent lake: - // projects/{project_id}/locations/{location_id}/lakes/{lake_id} + // `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1004,7 +1004,7 @@ message UpdateEnvironmentRequest { // Delete environment request. message DeleteEnvironmentRequest { // Required. The resource name of the environment: - // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}` + // `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1016,7 +1016,7 @@ message DeleteEnvironmentRequest { // List environments request. message ListEnvironmentsRequest { // Required. The resource name of the parent lake: - // projects/{project_id}/locations/{location_id}/lakes/{lake_id} + // `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1055,7 +1055,7 @@ message ListEnvironmentsResponse { // Get environment request. message GetEnvironmentRequest { // Required. The resource name of the environment: - // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id} + // `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1067,7 +1067,7 @@ message GetEnvironmentRequest { // List sessions request. message ListSessionsRequest { // Required. The resource name of the parent environment: - // projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id} + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1085,6 +1085,17 @@ message ListSessionsRequest { // provided to `ListSessions` must match the call that provided the page // token. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter request. The following `mode` filter is supported to return only the + // sessions belonging to the requester when the mode is USER and return + // sessions of all the users when the mode is ADMIN. When no filter is sent + // default to USER mode. + // NOTE: When the mode is ADMIN, the requester should have + // `dataplex.environments.listAllSessions` permission to list all sessions, + // in absence of the permission, the request fails. + // + // mode = ADMIN | USER + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; } // List sessions response. diff --git a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/tasks.proto b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/tasks.proto index 8bb07a2..8ca33da 100644 --- a/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/tasks.proto +++ b/proto-google-cloud-dataplex-v1/src/main/proto/google/cloud/dataplex/v1/tasks.proto @@ -39,23 +39,28 @@ message Task { // Batch compute resources associated with the task. message BatchComputeResources { // Optional. Total number of job executors. + // Executor Count should be between 2 and 100. [Default=2] int32 executors_count = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. Max configurable executors. // If max_executors_count > executors_count, then auto-scaling is enabled. + // Max Executor Count should be between 2 and 1000. [Default=1000] int32 max_executors_count = 2 [(google.api.field_behavior) = OPTIONAL]; } // Container Image Runtime Configuration used with Batch execution. message ContainerImageRuntime { + // Optional. Container image to use. + string image = 1 [(google.api.field_behavior) = OPTIONAL]; + // Optional. A list of Java JARS to add to the classpath. // Valid input includes Cloud Storage URIs to Jar binaries. - // For example, `gs://bucket-name/my/path/to/file.jar`. + // For example, gs://bucket-name/my/path/to/file.jar repeated string java_jars = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. A list of python packages to be installed. // Valid formats include Cloud Storage URI to a PIP installable library. - // For example, `gs://bucket-name/my/path/to/lib.tar.gz`. + // For example, gs://bucket-name/my/path/to/lib.tar.gz repeated string python_packages = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Override to common configuration of open source components installed on @@ -137,7 +142,7 @@ message Task { // Set to zero to never attempt to retry a failed task. int32 max_retries = 7 [(google.api.field_behavior) = OPTIONAL]; - // Trigger only applies for `RECURRING` tasks. + // Trigger only applies for RECURRING tasks. oneof trigger { // Optional. Cron schedule (https://en.wikipedia.org/wiki/Cron) for running // tasks periodically. @@ -172,8 +177,17 @@ message Task { // used. string service_account = 5 [(google.api.field_behavior) = REQUIRED]; + // Optional. The project in which jobs are run. By default, the project containing the + // Lake is used. If a project is provided, the + // [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account] must belong to this project. + string project = 7 [(google.api.field_behavior) = OPTIONAL]; + // Optional. The maximum duration after which the job execution is expired. google.protobuf.Duration max_job_execution_lifetime = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud KMS key to use for encryption, of the form: + // `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`. + string kms_key = 9 [(google.api.field_behavior) = OPTIONAL]; } // User-specified config for running a Spark task. @@ -224,6 +238,15 @@ message Task { InfrastructureSpec infrastructure_spec = 6 [(google.api.field_behavior) = OPTIONAL]; } + // Status of the task execution (e.g. Jobs). + message ExecutionStatus { + // Output only. Last update time of the status. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. latest job execution + Job latest_job = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + // Output only. The relative resource name of the task, of the form: // projects/{project_number}/locations/{location_id}/lakes/{lake_id}/ // tasks/{task_id}. @@ -262,6 +285,9 @@ message Task { // Required. Spec related to how a task is executed. ExecutionSpec execution_spec = 101 [(google.api.field_behavior) = REQUIRED]; + // Output only. Status of the latest task executions. + ExecutionStatus execution_status = 201 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Task template specific user-specified config. oneof config { // Config related to running custom Spark tasks. diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000..e6d40f2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.ContentServiceSettings; +import com.google.cloud.dataplex.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ContentServiceSettings contentServiceSettings = + ContentServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ContentServiceClient contentServiceClient = ContentServiceClient.create(contentServiceSettings); + } +} +// [END dataplex_v1_generated_contentserviceclient_create_setcredentialsprovider_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/create/SyncCreateSetCredentialsProvider1.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 0000000..a550104 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.ContentServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ContentServiceSettings contentServiceSettings = + ContentServiceSettings.newBuilder() + .setTransportChannelProvider( + ContentServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + ContentServiceClient contentServiceClient = ContentServiceClient.create(contentServiceSettings); + } +} +// [END dataplex_v1_generated_contentserviceclient_create_setcredentialsprovider1_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000..8c37671 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,38 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_create_setendpoint_sync] +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.ContentServiceSettings; +import com.google.cloud.dataplex.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ContentServiceSettings contentServiceSettings = + ContentServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + ContentServiceClient contentServiceClient = ContentServiceClient.create(contentServiceSettings); + } +} +// [END dataplex_v1_generated_contentserviceclient_create_setendpoint_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/AsyncCreateContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/AsyncCreateContent.java new file mode 100644 index 0000000..4c8642a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/AsyncCreateContent.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_createcontent_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.CreateContentRequest; +import com.google.cloud.dataplex.v1.LakeName; + +public class AsyncCreateContent { + + public static void main(String[] args) throws Exception { + asyncCreateContent(); + } + + public static void asyncCreateContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + CreateContentRequest request = + CreateContentRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setContent(Content.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = contentServiceClient.createContentCallable().futureCall(request); + // Do something. + Content response = future.get(); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_createcontent_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/SyncCreateContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/SyncCreateContent.java new file mode 100644 index 0000000..b04f91d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/SyncCreateContent.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_createcontent_sync] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.CreateContentRequest; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncCreateContent { + + public static void main(String[] args) throws Exception { + syncCreateContent(); + } + + public static void syncCreateContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + CreateContentRequest request = + CreateContentRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setContent(Content.newBuilder().build()) + .setValidateOnly(true) + .build(); + Content response = contentServiceClient.createContent(request); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_createcontent_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/SyncCreateContentLakenameContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/SyncCreateContentLakenameContent.java new file mode 100644 index 0000000..d8daaab --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/SyncCreateContentLakenameContent.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_createcontent_lakenamecontent_sync] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncCreateContentLakenameContent { + + public static void main(String[] args) throws Exception { + syncCreateContentLakenameContent(); + } + + public static void syncCreateContentLakenameContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Content content = Content.newBuilder().build(); + Content response = contentServiceClient.createContent(parent, content); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_createcontent_lakenamecontent_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/SyncCreateContentStringContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/SyncCreateContentStringContent.java new file mode 100644 index 0000000..11627a6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/createcontent/SyncCreateContentStringContent.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_createcontent_stringcontent_sync] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncCreateContentStringContent { + + public static void main(String[] args) throws Exception { + syncCreateContentStringContent(); + } + + public static void syncCreateContentStringContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + String parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString(); + Content content = Content.newBuilder().build(); + Content response = contentServiceClient.createContent(parent, content); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_createcontent_stringcontent_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/AsyncDeleteContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/AsyncDeleteContent.java new file mode 100644 index 0000000..b4140e6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/AsyncDeleteContent.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_deletecontent_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.DeleteContentRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteContent { + + public static void main(String[] args) throws Exception { + asyncDeleteContent(); + } + + public static void asyncDeleteContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + DeleteContentRequest request = + DeleteContentRequest.newBuilder() + .setName(ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .build(); + ApiFuture future = contentServiceClient.deleteContentCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_deletecontent_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/SyncDeleteContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/SyncDeleteContent.java new file mode 100644 index 0000000..662a30f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/SyncDeleteContent.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_deletecontent_sync] +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.DeleteContentRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteContent { + + public static void main(String[] args) throws Exception { + syncDeleteContent(); + } + + public static void syncDeleteContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + DeleteContentRequest request = + DeleteContentRequest.newBuilder() + .setName(ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .build(); + contentServiceClient.deleteContent(request); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_deletecontent_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/SyncDeleteContentContentname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/SyncDeleteContentContentname.java new file mode 100644 index 0000000..84275f9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/SyncDeleteContentContentname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_deletecontent_contentname_sync] +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteContentContentname { + + public static void main(String[] args) throws Exception { + syncDeleteContentContentname(); + } + + public static void syncDeleteContentContentname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + ContentName name = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"); + contentServiceClient.deleteContent(name); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_deletecontent_contentname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/SyncDeleteContentString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/SyncDeleteContentString.java new file mode 100644 index 0000000..dab3b3c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/deletecontent/SyncDeleteContentString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_deletecontent_string_sync] +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteContentString { + + public static void main(String[] args) throws Exception { + syncDeleteContentString(); + } + + public static void syncDeleteContentString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + String name = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString(); + contentServiceClient.deleteContent(name); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_deletecontent_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/AsyncGetContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/AsyncGetContent.java new file mode 100644 index 0000000..943835e --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/AsyncGetContent.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_getcontent_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.GetContentRequest; + +public class AsyncGetContent { + + public static void main(String[] args) throws Exception { + asyncGetContent(); + } + + public static void asyncGetContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + GetContentRequest request = + GetContentRequest.newBuilder() + .setName(ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .build(); + ApiFuture future = contentServiceClient.getContentCallable().futureCall(request); + // Do something. + Content response = future.get(); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_getcontent_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/SyncGetContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/SyncGetContent.java new file mode 100644 index 0000000..3e65b00 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/SyncGetContent.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_getcontent_sync] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.GetContentRequest; + +public class SyncGetContent { + + public static void main(String[] args) throws Exception { + syncGetContent(); + } + + public static void syncGetContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + GetContentRequest request = + GetContentRequest.newBuilder() + .setName(ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .build(); + Content response = contentServiceClient.getContent(request); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_getcontent_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/SyncGetContentContentname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/SyncGetContentContentname.java new file mode 100644 index 0000000..ba4645a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/SyncGetContentContentname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_getcontent_contentname_sync] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; + +public class SyncGetContentContentname { + + public static void main(String[] args) throws Exception { + syncGetContentContentname(); + } + + public static void syncGetContentContentname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + ContentName name = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"); + Content response = contentServiceClient.getContent(name); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_getcontent_contentname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/SyncGetContentString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/SyncGetContentString.java new file mode 100644 index 0000000..69cb01f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getcontent/SyncGetContentString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_getcontent_string_sync] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; + +public class SyncGetContentString { + + public static void main(String[] args) throws Exception { + syncGetContentString(); + } + + public static void syncGetContentString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + String name = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString(); + Content response = contentServiceClient.getContent(name); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_getcontent_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/AsyncGetIamPolicy.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000..673bbef --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_getiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = contentServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_getiampolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/SyncGetIamPolicy.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000..0e40b2d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_getiampolicy_sync] +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = contentServiceClient.getIamPolicy(request); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_getiampolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/SyncGetIamPolicyResourcename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/SyncGetIamPolicyResourcename.java new file mode 100644 index 0000000..d15fdf2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/SyncGetIamPolicyResourcename.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_getiampolicy_resourcename_sync] +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicyResourcename { + + public static void main(String[] args) throws Exception { + syncGetIamPolicyResourcename(); + } + + public static void syncGetIamPolicyResourcename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + ResourceName resource = ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]"); + Policy response = contentServiceClient.getIamPolicy(resource); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_getiampolicy_resourcename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/SyncGetIamPolicyString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/SyncGetIamPolicyString.java new file mode 100644 index 0000000..22ec58a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getiampolicy/SyncGetIamPolicyString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_getiampolicy_string_sync] +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicyString { + + public static void main(String[] args) throws Exception { + syncGetIamPolicyString(); + } + + public static void syncGetIamPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + String resource = + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString(); + Policy response = contentServiceClient.getIamPolicy(resource); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_getiampolicy_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getlocation/AsyncGetLocation.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getlocation/AsyncGetLocation.java new file mode 100644 index 0000000..63557f9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getlocation/AsyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_getlocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = contentServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_getlocation_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getlocation/SyncGetLocation.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getlocation/SyncGetLocation.java new file mode 100644 index 0000000..ef3e6ad --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/getlocation/SyncGetLocation.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_getlocation_sync] +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = contentServiceClient.getLocation(request); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_getlocation_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/AsyncListContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/AsyncListContent.java new file mode 100644 index 0000000..1aabcb9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/AsyncListContent.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_listcontent_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListContentRequest; + +public class AsyncListContent { + + public static void main(String[] args) throws Exception { + asyncListContent(); + } + + public static void asyncListContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + ListContentRequest request = + ListContentRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + contentServiceClient.listContentPagedCallable().futureCall(request); + // Do something. + for (Content element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_contentserviceclient_listcontent_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/AsyncListContentPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/AsyncListContentPaged.java new file mode 100644 index 0000000..80dda7b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/AsyncListContentPaged.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_listcontent_paged_async] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListContentRequest; +import com.google.cloud.dataplex.v1.ListContentResponse; +import com.google.common.base.Strings; + +public class AsyncListContentPaged { + + public static void main(String[] args) throws Exception { + asyncListContentPaged(); + } + + public static void asyncListContentPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + ListContentRequest request = + ListContentRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListContentResponse response = contentServiceClient.listContentCallable().call(request); + for (Content element : response.getContentList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_contentserviceclient_listcontent_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/SyncListContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/SyncListContent.java new file mode 100644 index 0000000..dd702be --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/SyncListContent.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_listcontent_sync] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListContentRequest; + +public class SyncListContent { + + public static void main(String[] args) throws Exception { + syncListContent(); + } + + public static void syncListContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + ListContentRequest request = + ListContentRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (Content element : contentServiceClient.listContent(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_contentserviceclient_listcontent_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/SyncListContentLakename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/SyncListContentLakename.java new file mode 100644 index 0000000..758554a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/SyncListContentLakename.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_listcontent_lakename_sync] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncListContentLakename { + + public static void main(String[] args) throws Exception { + syncListContentLakename(); + } + + public static void syncListContentLakename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + for (Content element : contentServiceClient.listContent(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_contentserviceclient_listcontent_lakename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/SyncListContentString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/SyncListContentString.java new file mode 100644 index 0000000..45de8b7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listcontent/SyncListContentString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_listcontent_string_sync] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncListContentString { + + public static void main(String[] args) throws Exception { + syncListContentString(); + } + + public static void syncListContentString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + String parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString(); + for (Content element : contentServiceClient.listContent(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_contentserviceclient_listcontent_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listlocations/AsyncListLocations.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listlocations/AsyncListLocations.java new file mode 100644 index 0000000..3969845 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listlocations/AsyncListLocations.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_listlocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + contentServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_contentserviceclient_listlocations_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listlocations/AsyncListLocationsPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 0000000..d778221 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_listlocations_paged_async] +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = contentServiceClient.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; + } + } + } + } +} +// [END dataplex_v1_generated_contentserviceclient_listlocations_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listlocations/SyncListLocations.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listlocations/SyncListLocations.java new file mode 100644 index 0000000..658cd45 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/listlocations/SyncListLocations.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_listlocations_sync] +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : contentServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_contentserviceclient_listlocations_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/setiampolicy/AsyncSetIamPolicy.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000..49545a9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_setiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = contentServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_setiampolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/setiampolicy/SyncSetIamPolicy.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000..2fa4f6a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_setiampolicy_sync] +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = contentServiceClient.setIamPolicy(request); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_setiampolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/testiampermissions/AsyncTestIamPermissions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000..cace1b3 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_testiampermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + contentServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_testiampermissions_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/testiampermissions/SyncTestIamPermissions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000..067a56f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_testiampermissions_sync] +import com.google.cloud.dataplex.v1.ContentName; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + ContentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[CONTENT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = contentServiceClient.testIamPermissions(request); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_testiampermissions_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/updatecontent/AsyncUpdateContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/updatecontent/AsyncUpdateContent.java new file mode 100644 index 0000000..e6cc852 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/updatecontent/AsyncUpdateContent.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_updatecontent_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.UpdateContentRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateContent { + + public static void main(String[] args) throws Exception { + asyncUpdateContent(); + } + + public static void asyncUpdateContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + UpdateContentRequest request = + UpdateContentRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setContent(Content.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = contentServiceClient.updateContentCallable().futureCall(request); + // Do something. + Content response = future.get(); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_updatecontent_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/updatecontent/SyncUpdateContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/updatecontent/SyncUpdateContent.java new file mode 100644 index 0000000..38012cd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/updatecontent/SyncUpdateContent.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_updatecontent_sync] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.cloud.dataplex.v1.UpdateContentRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateContent { + + public static void main(String[] args) throws Exception { + syncUpdateContent(); + } + + public static void syncUpdateContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + UpdateContentRequest request = + UpdateContentRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setContent(Content.newBuilder().build()) + .setValidateOnly(true) + .build(); + Content response = contentServiceClient.updateContent(request); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_updatecontent_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/updatecontent/SyncUpdateContentContentFieldmask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/updatecontent/SyncUpdateContentContentFieldmask.java new file mode 100644 index 0000000..aa4896d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentserviceclient/updatecontent/SyncUpdateContentContentFieldmask.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentserviceclient_updatecontent_contentfieldmask_sync] +import com.google.cloud.dataplex.v1.Content; +import com.google.cloud.dataplex.v1.ContentServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateContentContentFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateContentContentFieldmask(); + } + + public static void syncUpdateContentContentFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ContentServiceClient contentServiceClient = ContentServiceClient.create()) { + Content content = Content.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Content response = contentServiceClient.updateContent(content, updateMask); + } + } +} +// [END dataplex_v1_generated_contentserviceclient_updatecontent_contentfieldmask_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/contentservicesettings/createcontent/SyncCreateContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentservicesettings/createcontent/SyncCreateContent.java new file mode 100644 index 0000000..3dbd488 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/contentservicesettings/createcontent/SyncCreateContent.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_contentservicesettings_createcontent_sync] +import com.google.cloud.dataplex.v1.ContentServiceSettings; +import java.time.Duration; + +public class SyncCreateContent { + + public static void main(String[] args) throws Exception { + syncCreateContent(); + } + + public static void syncCreateContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ContentServiceSettings.Builder contentServiceSettingsBuilder = + ContentServiceSettings.newBuilder(); + contentServiceSettingsBuilder + .createContentSettings() + .setRetrySettings( + contentServiceSettingsBuilder + .createContentSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ContentServiceSettings contentServiceSettings = contentServiceSettingsBuilder.build(); + } +} +// [END dataplex_v1_generated_contentservicesettings_createcontent_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/AsyncCancelJob.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/AsyncCancelJob.java new file mode 100644 index 0000000..1538143 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/AsyncCancelJob.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_canceljob_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.CancelJobRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.JobName; +import com.google.protobuf.Empty; + +public class AsyncCancelJob { + + public static void main(String[] args) throws Exception { + asyncCancelJob(); + } + + public static void asyncCancelJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CancelJobRequest request = + CancelJobRequest.newBuilder() + .setName( + JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]").toString()) + .build(); + ApiFuture future = dataplexServiceClient.cancelJobCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_canceljob_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/SyncCancelJob.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/SyncCancelJob.java new file mode 100644 index 0000000..79cc97c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/SyncCancelJob.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_canceljob_sync] +import com.google.cloud.dataplex.v1.CancelJobRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.JobName; +import com.google.protobuf.Empty; + +public class SyncCancelJob { + + public static void main(String[] args) throws Exception { + syncCancelJob(); + } + + public static void syncCancelJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CancelJobRequest request = + CancelJobRequest.newBuilder() + .setName( + JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]").toString()) + .build(); + dataplexServiceClient.cancelJob(request); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_canceljob_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/SyncCancelJobJobname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/SyncCancelJobJobname.java new file mode 100644 index 0000000..02590c2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/SyncCancelJobJobname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_canceljob_jobname_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.JobName; +import com.google.protobuf.Empty; + +public class SyncCancelJobJobname { + + public static void main(String[] args) throws Exception { + syncCancelJobJobname(); + } + + public static void syncCancelJobJobname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]"); + dataplexServiceClient.cancelJob(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_canceljob_jobname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/SyncCancelJobString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/SyncCancelJobString.java new file mode 100644 index 0000000..396741b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/canceljob/SyncCancelJobString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_canceljob_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.JobName; +import com.google.protobuf.Empty; + +public class SyncCancelJobString { + + public static void main(String[] args) throws Exception { + syncCancelJobString(); + } + + public static void syncCancelJobString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]").toString(); + dataplexServiceClient.cancelJob(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_canceljob_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000..fe375a4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DataplexServiceSettings; +import com.google.cloud.dataplex.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + DataplexServiceSettings dataplexServiceSettings = + DataplexServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + DataplexServiceClient dataplexServiceClient = + DataplexServiceClient.create(dataplexServiceSettings); + } +} +// [END dataplex_v1_generated_dataplexserviceclient_create_setcredentialsprovider_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/create/SyncCreateSetCredentialsProvider1.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 0000000..461f207 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DataplexServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + DataplexServiceSettings dataplexServiceSettings = + DataplexServiceSettings.newBuilder() + .setTransportChannelProvider( + DataplexServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + DataplexServiceClient dataplexServiceClient = + DataplexServiceClient.create(dataplexServiceSettings); + } +} +// [END dataplex_v1_generated_dataplexserviceclient_create_setcredentialsprovider1_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000..e8acac4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_create_setendpoint_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DataplexServiceSettings; +import com.google.cloud.dataplex.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + DataplexServiceSettings dataplexServiceSettings = + DataplexServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + DataplexServiceClient dataplexServiceClient = + DataplexServiceClient.create(dataplexServiceSettings); + } +} +// [END dataplex_v1_generated_dataplexserviceclient_create_setendpoint_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/AsyncCreateAsset.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/AsyncCreateAsset.java new file mode 100644 index 0000000..0133c52 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/AsyncCreateAsset.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createasset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.CreateAssetRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; +import com.google.longrunning.Operation; + +public class AsyncCreateAsset { + + public static void main(String[] args) throws Exception { + asyncCreateAsset(); + } + + public static void asyncCreateAsset() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateAssetRequest request = + CreateAssetRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setAssetId("assetId-704776149") + .setAsset(Asset.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = dataplexServiceClient.createAssetCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createasset_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/AsyncCreateAssetLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/AsyncCreateAssetLRO.java new file mode 100644 index 0000000..dfcd90b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/AsyncCreateAssetLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createasset_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.CreateAssetRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.cloud.dataplex.v1.ZoneName; + +public class AsyncCreateAssetLRO { + + public static void main(String[] args) throws Exception { + asyncCreateAssetLRO(); + } + + public static void asyncCreateAssetLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateAssetRequest request = + CreateAssetRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setAssetId("assetId-704776149") + .setAsset(Asset.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + dataplexServiceClient.createAssetOperationCallable().futureCall(request); + // Do something. + Asset response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createasset_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/SyncCreateAsset.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/SyncCreateAsset.java new file mode 100644 index 0000000..8ca234c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/SyncCreateAsset.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createasset_sync] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.CreateAssetRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncCreateAsset { + + public static void main(String[] args) throws Exception { + syncCreateAsset(); + } + + public static void syncCreateAsset() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateAssetRequest request = + CreateAssetRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setAssetId("assetId-704776149") + .setAsset(Asset.newBuilder().build()) + .setValidateOnly(true) + .build(); + Asset response = dataplexServiceClient.createAssetAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createasset_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/SyncCreateAssetStringAssetString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/SyncCreateAssetStringAssetString.java new file mode 100644 index 0000000..4160f82 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/SyncCreateAssetStringAssetString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createasset_stringassetstring_sync] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncCreateAssetStringAssetString { + + public static void main(String[] args) throws Exception { + syncCreateAssetStringAssetString(); + } + + public static void syncCreateAssetStringAssetString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString(); + Asset asset = Asset.newBuilder().build(); + String assetId = "assetId-704776149"; + Asset response = dataplexServiceClient.createAssetAsync(parent, asset, assetId).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createasset_stringassetstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/SyncCreateAssetZonenameAssetString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/SyncCreateAssetZonenameAssetString.java new file mode 100644 index 0000000..1a229cc --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createasset/SyncCreateAssetZonenameAssetString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createasset_zonenameassetstring_sync] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncCreateAssetZonenameAssetString { + + public static void main(String[] args) throws Exception { + syncCreateAssetZonenameAssetString(); + } + + public static void syncCreateAssetZonenameAssetString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + Asset asset = Asset.newBuilder().build(); + String assetId = "assetId-704776149"; + Asset response = dataplexServiceClient.createAssetAsync(parent, asset, assetId).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createasset_zonenameassetstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/AsyncCreateEnvironment.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/AsyncCreateEnvironment.java new file mode 100644 index 0000000..83bba63 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/AsyncCreateEnvironment.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createenvironment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.CreateEnvironmentRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.longrunning.Operation; + +public class AsyncCreateEnvironment { + + public static void main(String[] args) throws Exception { + asyncCreateEnvironment(); + } + + public static void asyncCreateEnvironment() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateEnvironmentRequest request = + CreateEnvironmentRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setEnvironmentId("environmentId-950205810") + .setEnvironment(Environment.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = + dataplexServiceClient.createEnvironmentCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createenvironment_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/AsyncCreateEnvironmentLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/AsyncCreateEnvironmentLRO.java new file mode 100644 index 0000000..c8fab08 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/AsyncCreateEnvironmentLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createenvironment_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.CreateEnvironmentRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.OperationMetadata; + +public class AsyncCreateEnvironmentLRO { + + public static void main(String[] args) throws Exception { + asyncCreateEnvironmentLRO(); + } + + public static void asyncCreateEnvironmentLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateEnvironmentRequest request = + CreateEnvironmentRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setEnvironmentId("environmentId-950205810") + .setEnvironment(Environment.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + dataplexServiceClient.createEnvironmentOperationCallable().futureCall(request); + // Do something. + Environment response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createenvironment_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/SyncCreateEnvironment.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/SyncCreateEnvironment.java new file mode 100644 index 0000000..54a08a7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/SyncCreateEnvironment.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createenvironment_sync] +import com.google.cloud.dataplex.v1.CreateEnvironmentRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncCreateEnvironment { + + public static void main(String[] args) throws Exception { + syncCreateEnvironment(); + } + + public static void syncCreateEnvironment() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateEnvironmentRequest request = + CreateEnvironmentRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setEnvironmentId("environmentId-950205810") + .setEnvironment(Environment.newBuilder().build()) + .setValidateOnly(true) + .build(); + Environment response = dataplexServiceClient.createEnvironmentAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createenvironment_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/SyncCreateEnvironmentLakenameEnvironmentString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/SyncCreateEnvironmentLakenameEnvironmentString.java new file mode 100644 index 0000000..4e86bcd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/SyncCreateEnvironmentLakenameEnvironmentString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createenvironment_lakenameenvironmentstring_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncCreateEnvironmentLakenameEnvironmentString { + + public static void main(String[] args) throws Exception { + syncCreateEnvironmentLakenameEnvironmentString(); + } + + public static void syncCreateEnvironmentLakenameEnvironmentString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Environment environment = Environment.newBuilder().build(); + String environmentId = "environmentId-950205810"; + Environment response = + dataplexServiceClient.createEnvironmentAsync(parent, environment, environmentId).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createenvironment_lakenameenvironmentstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/SyncCreateEnvironmentStringEnvironmentString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/SyncCreateEnvironmentStringEnvironmentString.java new file mode 100644 index 0000000..eb7e44a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createenvironment/SyncCreateEnvironmentStringEnvironmentString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createenvironment_stringenvironmentstring_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncCreateEnvironmentStringEnvironmentString { + + public static void main(String[] args) throws Exception { + syncCreateEnvironmentStringEnvironmentString(); + } + + public static void syncCreateEnvironmentStringEnvironmentString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString(); + Environment environment = Environment.newBuilder().build(); + String environmentId = "environmentId-950205810"; + Environment response = + dataplexServiceClient.createEnvironmentAsync(parent, environment, environmentId).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createenvironment_stringenvironmentstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/AsyncCreateLake.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/AsyncCreateLake.java new file mode 100644 index 0000000..975bebf --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/AsyncCreateLake.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createlake_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.CreateLakeRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateLake { + + public static void main(String[] args) throws Exception { + asyncCreateLake(); + } + + public static void asyncCreateLake() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateLakeRequest request = + CreateLakeRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setLakeId("lakeId-1110150390") + .setLake(Lake.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = dataplexServiceClient.createLakeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createlake_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/AsyncCreateLakeLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/AsyncCreateLakeLRO.java new file mode 100644 index 0000000..de16861 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/AsyncCreateLakeLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createlake_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.CreateLakeRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.LocationName; +import com.google.cloud.dataplex.v1.OperationMetadata; + +public class AsyncCreateLakeLRO { + + public static void main(String[] args) throws Exception { + asyncCreateLakeLRO(); + } + + public static void asyncCreateLakeLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateLakeRequest request = + CreateLakeRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setLakeId("lakeId-1110150390") + .setLake(Lake.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + dataplexServiceClient.createLakeOperationCallable().futureCall(request); + // Do something. + Lake response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createlake_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/SyncCreateLake.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/SyncCreateLake.java new file mode 100644 index 0000000..bf9119f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/SyncCreateLake.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createlake_sync] +import com.google.cloud.dataplex.v1.CreateLakeRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.LocationName; + +public class SyncCreateLake { + + public static void main(String[] args) throws Exception { + syncCreateLake(); + } + + public static void syncCreateLake() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateLakeRequest request = + CreateLakeRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setLakeId("lakeId-1110150390") + .setLake(Lake.newBuilder().build()) + .setValidateOnly(true) + .build(); + Lake response = dataplexServiceClient.createLakeAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createlake_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/SyncCreateLakeLocationnameLakeString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/SyncCreateLakeLocationnameLakeString.java new file mode 100644 index 0000000..5fd358d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/SyncCreateLakeLocationnameLakeString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createlake_locationnamelakestring_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.LocationName; + +public class SyncCreateLakeLocationnameLakeString { + + public static void main(String[] args) throws Exception { + syncCreateLakeLocationnameLakeString(); + } + + public static void syncCreateLakeLocationnameLakeString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Lake lake = Lake.newBuilder().build(); + String lakeId = "lakeId-1110150390"; + Lake response = dataplexServiceClient.createLakeAsync(parent, lake, lakeId).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createlake_locationnamelakestring_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/SyncCreateLakeStringLakeString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/SyncCreateLakeStringLakeString.java new file mode 100644 index 0000000..037a402 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createlake/SyncCreateLakeStringLakeString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createlake_stringlakestring_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.LocationName; + +public class SyncCreateLakeStringLakeString { + + public static void main(String[] args) throws Exception { + syncCreateLakeStringLakeString(); + } + + public static void syncCreateLakeStringLakeString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Lake lake = Lake.newBuilder().build(); + String lakeId = "lakeId-1110150390"; + Lake response = dataplexServiceClient.createLakeAsync(parent, lake, lakeId).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createlake_stringlakestring_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/AsyncCreateTask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/AsyncCreateTask.java new file mode 100644 index 0000000..d887f0a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/AsyncCreateTask.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createtask_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.CreateTaskRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Task; +import com.google.longrunning.Operation; + +public class AsyncCreateTask { + + public static void main(String[] args) throws Exception { + asyncCreateTask(); + } + + public static void asyncCreateTask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateTaskRequest request = + CreateTaskRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setTaskId("taskId-880873088") + .setTask(Task.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = dataplexServiceClient.createTaskCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createtask_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/AsyncCreateTaskLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/AsyncCreateTaskLRO.java new file mode 100644 index 0000000..0a8ed44 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/AsyncCreateTaskLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createtask_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.CreateTaskRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.cloud.dataplex.v1.Task; + +public class AsyncCreateTaskLRO { + + public static void main(String[] args) throws Exception { + asyncCreateTaskLRO(); + } + + public static void asyncCreateTaskLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateTaskRequest request = + CreateTaskRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setTaskId("taskId-880873088") + .setTask(Task.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + dataplexServiceClient.createTaskOperationCallable().futureCall(request); + // Do something. + Task response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createtask_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/SyncCreateTask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/SyncCreateTask.java new file mode 100644 index 0000000..9bf8a82 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/SyncCreateTask.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createtask_sync] +import com.google.cloud.dataplex.v1.CreateTaskRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Task; + +public class SyncCreateTask { + + public static void main(String[] args) throws Exception { + syncCreateTask(); + } + + public static void syncCreateTask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateTaskRequest request = + CreateTaskRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setTaskId("taskId-880873088") + .setTask(Task.newBuilder().build()) + .setValidateOnly(true) + .build(); + Task response = dataplexServiceClient.createTaskAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createtask_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/SyncCreateTaskLakenameTaskString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/SyncCreateTaskLakenameTaskString.java new file mode 100644 index 0000000..233d75d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/SyncCreateTaskLakenameTaskString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createtask_lakenametaskstring_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Task; + +public class SyncCreateTaskLakenameTaskString { + + public static void main(String[] args) throws Exception { + syncCreateTaskLakenameTaskString(); + } + + public static void syncCreateTaskLakenameTaskString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Task task = Task.newBuilder().build(); + String taskId = "taskId-880873088"; + Task response = dataplexServiceClient.createTaskAsync(parent, task, taskId).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createtask_lakenametaskstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/SyncCreateTaskStringTaskString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/SyncCreateTaskStringTaskString.java new file mode 100644 index 0000000..6404b98 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createtask/SyncCreateTaskStringTaskString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createtask_stringtaskstring_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Task; + +public class SyncCreateTaskStringTaskString { + + public static void main(String[] args) throws Exception { + syncCreateTaskStringTaskString(); + } + + public static void syncCreateTaskStringTaskString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString(); + Task task = Task.newBuilder().build(); + String taskId = "taskId-880873088"; + Task response = dataplexServiceClient.createTaskAsync(parent, task, taskId).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createtask_stringtaskstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/AsyncCreateZone.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/AsyncCreateZone.java new file mode 100644 index 0000000..c3d027f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/AsyncCreateZone.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createzone_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.CreateZoneRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Zone; +import com.google.longrunning.Operation; + +public class AsyncCreateZone { + + public static void main(String[] args) throws Exception { + asyncCreateZone(); + } + + public static void asyncCreateZone() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateZoneRequest request = + CreateZoneRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setZoneId("zoneId-696323609") + .setZone(Zone.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = dataplexServiceClient.createZoneCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createzone_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/AsyncCreateZoneLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/AsyncCreateZoneLRO.java new file mode 100644 index 0000000..540fecf --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/AsyncCreateZoneLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createzone_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.CreateZoneRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.cloud.dataplex.v1.Zone; + +public class AsyncCreateZoneLRO { + + public static void main(String[] args) throws Exception { + asyncCreateZoneLRO(); + } + + public static void asyncCreateZoneLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateZoneRequest request = + CreateZoneRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setZoneId("zoneId-696323609") + .setZone(Zone.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + dataplexServiceClient.createZoneOperationCallable().futureCall(request); + // Do something. + Zone response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createzone_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/SyncCreateZone.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/SyncCreateZone.java new file mode 100644 index 0000000..a9da6f0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/SyncCreateZone.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createzone_sync] +import com.google.cloud.dataplex.v1.CreateZoneRequest; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Zone; + +public class SyncCreateZone { + + public static void main(String[] args) throws Exception { + syncCreateZone(); + } + + public static void syncCreateZone() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + CreateZoneRequest request = + CreateZoneRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setZoneId("zoneId-696323609") + .setZone(Zone.newBuilder().build()) + .setValidateOnly(true) + .build(); + Zone response = dataplexServiceClient.createZoneAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createzone_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/SyncCreateZoneLakenameZoneString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/SyncCreateZoneLakenameZoneString.java new file mode 100644 index 0000000..b94e859 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/SyncCreateZoneLakenameZoneString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createzone_lakenamezonestring_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Zone; + +public class SyncCreateZoneLakenameZoneString { + + public static void main(String[] args) throws Exception { + syncCreateZoneLakenameZoneString(); + } + + public static void syncCreateZoneLakenameZoneString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Zone zone = Zone.newBuilder().build(); + String zoneId = "zoneId-696323609"; + Zone response = dataplexServiceClient.createZoneAsync(parent, zone, zoneId).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createzone_lakenamezonestring_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/SyncCreateZoneStringZoneString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/SyncCreateZoneStringZoneString.java new file mode 100644 index 0000000..2e09f88 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/createzone/SyncCreateZoneStringZoneString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_createzone_stringzonestring_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Zone; + +public class SyncCreateZoneStringZoneString { + + public static void main(String[] args) throws Exception { + syncCreateZoneStringZoneString(); + } + + public static void syncCreateZoneStringZoneString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString(); + Zone zone = Zone.newBuilder().build(); + String zoneId = "zoneId-696323609"; + Zone response = dataplexServiceClient.createZoneAsync(parent, zone, zoneId).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_createzone_stringzonestring_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/AsyncDeleteAsset.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/AsyncDeleteAsset.java new file mode 100644 index 0000000..6d03171 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/AsyncDeleteAsset.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deleteasset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteAssetRequest; +import com.google.longrunning.Operation; + +public class AsyncDeleteAsset { + + public static void main(String[] args) throws Exception { + asyncDeleteAsset(); + } + + public static void asyncDeleteAsset() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteAssetRequest request = + DeleteAssetRequest.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .build(); + ApiFuture future = dataplexServiceClient.deleteAssetCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deleteasset_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/AsyncDeleteAssetLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/AsyncDeleteAssetLRO.java new file mode 100644 index 0000000..f916fda --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/AsyncDeleteAssetLRO.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deleteasset_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteAssetRequest; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteAssetLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteAssetLRO(); + } + + public static void asyncDeleteAssetLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteAssetRequest request = + DeleteAssetRequest.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .build(); + OperationFuture future = + dataplexServiceClient.deleteAssetOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deleteasset_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/SyncDeleteAsset.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/SyncDeleteAsset.java new file mode 100644 index 0000000..51eda9d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/SyncDeleteAsset.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deleteasset_sync] +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteAssetRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteAsset { + + public static void main(String[] args) throws Exception { + syncDeleteAsset(); + } + + public static void syncDeleteAsset() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteAssetRequest request = + DeleteAssetRequest.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .build(); + dataplexServiceClient.deleteAssetAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deleteasset_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/SyncDeleteAssetAssetname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/SyncDeleteAssetAssetname.java new file mode 100644 index 0000000..ed48f6a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/SyncDeleteAssetAssetname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deleteasset_assetname_sync] +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteAssetAssetname { + + public static void main(String[] args) throws Exception { + syncDeleteAssetAssetname(); + } + + public static void syncDeleteAssetAssetname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + AssetName name = AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]"); + dataplexServiceClient.deleteAssetAsync(name).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deleteasset_assetname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/SyncDeleteAssetString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/SyncDeleteAssetString.java new file mode 100644 index 0000000..7dbea1d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteasset/SyncDeleteAssetString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deleteasset_string_sync] +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteAssetString { + + public static void main(String[] args) throws Exception { + syncDeleteAssetString(); + } + + public static void syncDeleteAssetString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString(); + dataplexServiceClient.deleteAssetAsync(name).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deleteasset_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/AsyncDeleteEnvironment.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/AsyncDeleteEnvironment.java new file mode 100644 index 0000000..b6c25f0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/AsyncDeleteEnvironment.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deleteenvironment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteEnvironmentRequest; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.longrunning.Operation; + +public class AsyncDeleteEnvironment { + + public static void main(String[] args) throws Exception { + asyncDeleteEnvironment(); + } + + public static void asyncDeleteEnvironment() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteEnvironmentRequest request = + DeleteEnvironmentRequest.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]") + .toString()) + .build(); + ApiFuture future = + dataplexServiceClient.deleteEnvironmentCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deleteenvironment_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/AsyncDeleteEnvironmentLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/AsyncDeleteEnvironmentLRO.java new file mode 100644 index 0000000..3b0512e --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/AsyncDeleteEnvironmentLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deleteenvironment_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteEnvironmentRequest; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteEnvironmentLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteEnvironmentLRO(); + } + + public static void asyncDeleteEnvironmentLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteEnvironmentRequest request = + DeleteEnvironmentRequest.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]") + .toString()) + .build(); + OperationFuture future = + dataplexServiceClient.deleteEnvironmentOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deleteenvironment_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/SyncDeleteEnvironment.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/SyncDeleteEnvironment.java new file mode 100644 index 0000000..cfe6524 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/SyncDeleteEnvironment.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deleteenvironment_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteEnvironmentRequest; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.protobuf.Empty; + +public class SyncDeleteEnvironment { + + public static void main(String[] args) throws Exception { + syncDeleteEnvironment(); + } + + public static void syncDeleteEnvironment() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteEnvironmentRequest request = + DeleteEnvironmentRequest.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]") + .toString()) + .build(); + dataplexServiceClient.deleteEnvironmentAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deleteenvironment_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/SyncDeleteEnvironmentEnvironmentname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/SyncDeleteEnvironmentEnvironmentname.java new file mode 100644 index 0000000..0ac63c9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/SyncDeleteEnvironmentEnvironmentname.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deleteenvironment_environmentname_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.protobuf.Empty; + +public class SyncDeleteEnvironmentEnvironmentname { + + public static void main(String[] args) throws Exception { + syncDeleteEnvironmentEnvironmentname(); + } + + public static void syncDeleteEnvironmentEnvironmentname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]"); + dataplexServiceClient.deleteEnvironmentAsync(name).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deleteenvironment_environmentname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/SyncDeleteEnvironmentString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/SyncDeleteEnvironmentString.java new file mode 100644 index 0000000..4c25e51 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deleteenvironment/SyncDeleteEnvironmentString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deleteenvironment_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.protobuf.Empty; + +public class SyncDeleteEnvironmentString { + + public static void main(String[] args) throws Exception { + syncDeleteEnvironmentString(); + } + + public static void syncDeleteEnvironmentString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]").toString(); + dataplexServiceClient.deleteEnvironmentAsync(name).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deleteenvironment_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/AsyncDeleteLake.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/AsyncDeleteLake.java new file mode 100644 index 0000000..e912582 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/AsyncDeleteLake.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletelake_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteLakeRequest; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.longrunning.Operation; + +public class AsyncDeleteLake { + + public static void main(String[] args) throws Exception { + asyncDeleteLake(); + } + + public static void asyncDeleteLake() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteLakeRequest request = + DeleteLakeRequest.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .build(); + ApiFuture future = dataplexServiceClient.deleteLakeCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletelake_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/AsyncDeleteLakeLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/AsyncDeleteLakeLRO.java new file mode 100644 index 0000000..4d8bf46 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/AsyncDeleteLakeLRO.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletelake_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteLakeRequest; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteLakeLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteLakeLRO(); + } + + public static void asyncDeleteLakeLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteLakeRequest request = + DeleteLakeRequest.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .build(); + OperationFuture future = + dataplexServiceClient.deleteLakeOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletelake_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/SyncDeleteLake.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/SyncDeleteLake.java new file mode 100644 index 0000000..b2a737b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/SyncDeleteLake.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletelake_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteLakeRequest; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.protobuf.Empty; + +public class SyncDeleteLake { + + public static void main(String[] args) throws Exception { + syncDeleteLake(); + } + + public static void syncDeleteLake() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteLakeRequest request = + DeleteLakeRequest.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .build(); + dataplexServiceClient.deleteLakeAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletelake_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/SyncDeleteLakeLakename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/SyncDeleteLakeLakename.java new file mode 100644 index 0000000..1f0e312 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/SyncDeleteLakeLakename.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletelake_lakename_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.protobuf.Empty; + +public class SyncDeleteLakeLakename { + + public static void main(String[] args) throws Exception { + syncDeleteLakeLakename(); + } + + public static void syncDeleteLakeLakename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + LakeName name = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + dataplexServiceClient.deleteLakeAsync(name).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletelake_lakename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/SyncDeleteLakeString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/SyncDeleteLakeString.java new file mode 100644 index 0000000..1be6ced --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletelake/SyncDeleteLakeString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletelake_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.protobuf.Empty; + +public class SyncDeleteLakeString { + + public static void main(String[] args) throws Exception { + syncDeleteLakeString(); + } + + public static void syncDeleteLakeString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString(); + dataplexServiceClient.deleteLakeAsync(name).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletelake_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/AsyncDeleteTask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/AsyncDeleteTask.java new file mode 100644 index 0000000..9e25257 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/AsyncDeleteTask.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletetask_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteTaskRequest; +import com.google.cloud.dataplex.v1.TaskName; +import com.google.longrunning.Operation; + +public class AsyncDeleteTask { + + public static void main(String[] args) throws Exception { + asyncDeleteTask(); + } + + public static void asyncDeleteTask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteTaskRequest request = + DeleteTaskRequest.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .build(); + ApiFuture future = dataplexServiceClient.deleteTaskCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletetask_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/AsyncDeleteTaskLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/AsyncDeleteTaskLRO.java new file mode 100644 index 0000000..980a855 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/AsyncDeleteTaskLRO.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletetask_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteTaskRequest; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.cloud.dataplex.v1.TaskName; +import com.google.protobuf.Empty; + +public class AsyncDeleteTaskLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteTaskLRO(); + } + + public static void asyncDeleteTaskLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteTaskRequest request = + DeleteTaskRequest.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .build(); + OperationFuture future = + dataplexServiceClient.deleteTaskOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletetask_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/SyncDeleteTask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/SyncDeleteTask.java new file mode 100644 index 0000000..9c723ff --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/SyncDeleteTask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletetask_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteTaskRequest; +import com.google.cloud.dataplex.v1.TaskName; +import com.google.protobuf.Empty; + +public class SyncDeleteTask { + + public static void main(String[] args) throws Exception { + syncDeleteTask(); + } + + public static void syncDeleteTask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteTaskRequest request = + DeleteTaskRequest.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .build(); + dataplexServiceClient.deleteTaskAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletetask_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/SyncDeleteTaskString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/SyncDeleteTaskString.java new file mode 100644 index 0000000..5b9900e --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/SyncDeleteTaskString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletetask_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.TaskName; +import com.google.protobuf.Empty; + +public class SyncDeleteTaskString { + + public static void main(String[] args) throws Exception { + syncDeleteTaskString(); + } + + public static void syncDeleteTaskString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString(); + dataplexServiceClient.deleteTaskAsync(name).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletetask_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/SyncDeleteTaskTaskname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/SyncDeleteTaskTaskname.java new file mode 100644 index 0000000..bdb251b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletetask/SyncDeleteTaskTaskname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletetask_taskname_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.TaskName; +import com.google.protobuf.Empty; + +public class SyncDeleteTaskTaskname { + + public static void main(String[] args) throws Exception { + syncDeleteTaskTaskname(); + } + + public static void syncDeleteTaskTaskname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]"); + dataplexServiceClient.deleteTaskAsync(name).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletetask_taskname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/AsyncDeleteZone.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/AsyncDeleteZone.java new file mode 100644 index 0000000..5cde6c7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/AsyncDeleteZone.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletezone_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteZoneRequest; +import com.google.cloud.dataplex.v1.ZoneName; +import com.google.longrunning.Operation; + +public class AsyncDeleteZone { + + public static void main(String[] args) throws Exception { + asyncDeleteZone(); + } + + public static void asyncDeleteZone() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteZoneRequest request = + DeleteZoneRequest.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .build(); + ApiFuture future = dataplexServiceClient.deleteZoneCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletezone_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/AsyncDeleteZoneLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/AsyncDeleteZoneLRO.java new file mode 100644 index 0000000..d198e8b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/AsyncDeleteZoneLRO.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletezone_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteZoneRequest; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.cloud.dataplex.v1.ZoneName; +import com.google.protobuf.Empty; + +public class AsyncDeleteZoneLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteZoneLRO(); + } + + public static void asyncDeleteZoneLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteZoneRequest request = + DeleteZoneRequest.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .build(); + OperationFuture future = + dataplexServiceClient.deleteZoneOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletezone_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/SyncDeleteZone.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/SyncDeleteZone.java new file mode 100644 index 0000000..1236ea1 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/SyncDeleteZone.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletezone_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.DeleteZoneRequest; +import com.google.cloud.dataplex.v1.ZoneName; +import com.google.protobuf.Empty; + +public class SyncDeleteZone { + + public static void main(String[] args) throws Exception { + syncDeleteZone(); + } + + public static void syncDeleteZone() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + DeleteZoneRequest request = + DeleteZoneRequest.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .build(); + dataplexServiceClient.deleteZoneAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletezone_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/SyncDeleteZoneString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/SyncDeleteZoneString.java new file mode 100644 index 0000000..e29e2d7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/SyncDeleteZoneString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletezone_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; +import com.google.protobuf.Empty; + +public class SyncDeleteZoneString { + + public static void main(String[] args) throws Exception { + syncDeleteZoneString(); + } + + public static void syncDeleteZoneString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString(); + dataplexServiceClient.deleteZoneAsync(name).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletezone_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/SyncDeleteZoneZonename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/SyncDeleteZoneZonename.java new file mode 100644 index 0000000..d1586e6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/deletezone/SyncDeleteZoneZonename.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_deletezone_zonename_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; +import com.google.protobuf.Empty; + +public class SyncDeleteZoneZonename { + + public static void main(String[] args) throws Exception { + syncDeleteZoneZonename(); + } + + public static void syncDeleteZoneZonename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ZoneName name = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + dataplexServiceClient.deleteZoneAsync(name).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_deletezone_zonename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/AsyncGetAsset.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/AsyncGetAsset.java new file mode 100644 index 0000000..2f5763a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/AsyncGetAsset.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getasset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.GetAssetRequest; + +public class AsyncGetAsset { + + public static void main(String[] args) throws Exception { + asyncGetAsset(); + } + + public static void asyncGetAsset() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetAssetRequest request = + GetAssetRequest.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .build(); + ApiFuture future = dataplexServiceClient.getAssetCallable().futureCall(request); + // Do something. + Asset response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getasset_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/SyncGetAsset.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/SyncGetAsset.java new file mode 100644 index 0000000..bb06bf7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/SyncGetAsset.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getasset_sync] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.GetAssetRequest; + +public class SyncGetAsset { + + public static void main(String[] args) throws Exception { + syncGetAsset(); + } + + public static void syncGetAsset() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetAssetRequest request = + GetAssetRequest.newBuilder() + .setName( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .build(); + Asset response = dataplexServiceClient.getAsset(request); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getasset_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/SyncGetAssetAssetname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/SyncGetAssetAssetname.java new file mode 100644 index 0000000..a17e428 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/SyncGetAssetAssetname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getasset_assetname_sync] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; + +public class SyncGetAssetAssetname { + + public static void main(String[] args) throws Exception { + syncGetAssetAssetname(); + } + + public static void syncGetAssetAssetname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + AssetName name = AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]"); + Asset response = dataplexServiceClient.getAsset(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getasset_assetname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/SyncGetAssetString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/SyncGetAssetString.java new file mode 100644 index 0000000..710fde9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getasset/SyncGetAssetString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getasset_string_sync] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; + +public class SyncGetAssetString { + + public static void main(String[] args) throws Exception { + syncGetAssetString(); + } + + public static void syncGetAssetString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString(); + Asset response = dataplexServiceClient.getAsset(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getasset_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/AsyncGetEnvironment.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/AsyncGetEnvironment.java new file mode 100644 index 0000000..708b557 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/AsyncGetEnvironment.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getenvironment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.cloud.dataplex.v1.GetEnvironmentRequest; + +public class AsyncGetEnvironment { + + public static void main(String[] args) throws Exception { + asyncGetEnvironment(); + } + + public static void asyncGetEnvironment() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetEnvironmentRequest request = + GetEnvironmentRequest.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]") + .toString()) + .build(); + ApiFuture future = + dataplexServiceClient.getEnvironmentCallable().futureCall(request); + // Do something. + Environment response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getenvironment_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/SyncGetEnvironment.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/SyncGetEnvironment.java new file mode 100644 index 0000000..a0670a5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/SyncGetEnvironment.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getenvironment_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.cloud.dataplex.v1.GetEnvironmentRequest; + +public class SyncGetEnvironment { + + public static void main(String[] args) throws Exception { + syncGetEnvironment(); + } + + public static void syncGetEnvironment() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetEnvironmentRequest request = + GetEnvironmentRequest.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]") + .toString()) + .build(); + Environment response = dataplexServiceClient.getEnvironment(request); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getenvironment_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/SyncGetEnvironmentEnvironmentname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/SyncGetEnvironmentEnvironmentname.java new file mode 100644 index 0000000..9e95dda --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/SyncGetEnvironmentEnvironmentname.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getenvironment_environmentname_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.EnvironmentName; + +public class SyncGetEnvironmentEnvironmentname { + + public static void main(String[] args) throws Exception { + syncGetEnvironmentEnvironmentname(); + } + + public static void syncGetEnvironmentEnvironmentname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]"); + Environment response = dataplexServiceClient.getEnvironment(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getenvironment_environmentname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/SyncGetEnvironmentString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/SyncGetEnvironmentString.java new file mode 100644 index 0000000..493b824 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getenvironment/SyncGetEnvironmentString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getenvironment_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.EnvironmentName; + +public class SyncGetEnvironmentString { + + public static void main(String[] args) throws Exception { + syncGetEnvironmentString(); + } + + public static void syncGetEnvironmentString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]").toString(); + Environment response = dataplexServiceClient.getEnvironment(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getenvironment_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/AsyncGetJob.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/AsyncGetJob.java new file mode 100644 index 0000000..6031672 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/AsyncGetJob.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getjob_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.GetJobRequest; +import com.google.cloud.dataplex.v1.Job; +import com.google.cloud.dataplex.v1.JobName; + +public class AsyncGetJob { + + public static void main(String[] args) throws Exception { + asyncGetJob(); + } + + public static void asyncGetJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetJobRequest request = + GetJobRequest.newBuilder() + .setName( + JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]").toString()) + .build(); + ApiFuture future = dataplexServiceClient.getJobCallable().futureCall(request); + // Do something. + Job response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getjob_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/SyncGetJob.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/SyncGetJob.java new file mode 100644 index 0000000..dc239c3 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/SyncGetJob.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getjob_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.GetJobRequest; +import com.google.cloud.dataplex.v1.Job; +import com.google.cloud.dataplex.v1.JobName; + +public class SyncGetJob { + + public static void main(String[] args) throws Exception { + syncGetJob(); + } + + public static void syncGetJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetJobRequest request = + GetJobRequest.newBuilder() + .setName( + JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]").toString()) + .build(); + Job response = dataplexServiceClient.getJob(request); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getjob_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/SyncGetJobJobname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/SyncGetJobJobname.java new file mode 100644 index 0000000..53153d5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/SyncGetJobJobname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getjob_jobname_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Job; +import com.google.cloud.dataplex.v1.JobName; + +public class SyncGetJobJobname { + + public static void main(String[] args) throws Exception { + syncGetJobJobname(); + } + + public static void syncGetJobJobname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]"); + Job response = dataplexServiceClient.getJob(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getjob_jobname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/SyncGetJobString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/SyncGetJobString.java new file mode 100644 index 0000000..3a0f1bb --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getjob/SyncGetJobString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getjob_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Job; +import com.google.cloud.dataplex.v1.JobName; + +public class SyncGetJobString { + + public static void main(String[] args) throws Exception { + syncGetJobString(); + } + + public static void syncGetJobString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = JobName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]", "[JOB]").toString(); + Job response = dataplexServiceClient.getJob(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getjob_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/AsyncGetLake.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/AsyncGetLake.java new file mode 100644 index 0000000..2f35b1a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/AsyncGetLake.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getlake_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.GetLakeRequest; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.LakeName; + +public class AsyncGetLake { + + public static void main(String[] args) throws Exception { + asyncGetLake(); + } + + public static void asyncGetLake() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetLakeRequest request = + GetLakeRequest.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .build(); + ApiFuture future = dataplexServiceClient.getLakeCallable().futureCall(request); + // Do something. + Lake response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getlake_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/SyncGetLake.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/SyncGetLake.java new file mode 100644 index 0000000..d9f5868 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/SyncGetLake.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getlake_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.GetLakeRequest; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncGetLake { + + public static void main(String[] args) throws Exception { + syncGetLake(); + } + + public static void syncGetLake() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetLakeRequest request = + GetLakeRequest.newBuilder() + .setName(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .build(); + Lake response = dataplexServiceClient.getLake(request); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getlake_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/SyncGetLakeLakename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/SyncGetLakeLakename.java new file mode 100644 index 0000000..37ca9e3 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/SyncGetLakeLakename.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getlake_lakename_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncGetLakeLakename { + + public static void main(String[] args) throws Exception { + syncGetLakeLakename(); + } + + public static void syncGetLakeLakename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + LakeName name = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + Lake response = dataplexServiceClient.getLake(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getlake_lakename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/SyncGetLakeString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/SyncGetLakeString.java new file mode 100644 index 0000000..f0fef3f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlake/SyncGetLakeString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getlake_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncGetLakeString { + + public static void main(String[] args) throws Exception { + syncGetLakeString(); + } + + public static void syncGetLakeString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString(); + Lake response = dataplexServiceClient.getLake(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getlake_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlocation/AsyncGetLocation.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlocation/AsyncGetLocation.java new file mode 100644 index 0000000..aa33e59 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlocation/AsyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getlocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = dataplexServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getlocation_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlocation/SyncGetLocation.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlocation/SyncGetLocation.java new file mode 100644 index 0000000..2fefd65 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getlocation/SyncGetLocation.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getlocation_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = dataplexServiceClient.getLocation(request); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getlocation_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/AsyncGetTask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/AsyncGetTask.java new file mode 100644 index 0000000..b1adef7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/AsyncGetTask.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_gettask_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.GetTaskRequest; +import com.google.cloud.dataplex.v1.Task; +import com.google.cloud.dataplex.v1.TaskName; + +public class AsyncGetTask { + + public static void main(String[] args) throws Exception { + asyncGetTask(); + } + + public static void asyncGetTask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetTaskRequest request = + GetTaskRequest.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .build(); + ApiFuture future = dataplexServiceClient.getTaskCallable().futureCall(request); + // Do something. + Task response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_gettask_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/SyncGetTask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/SyncGetTask.java new file mode 100644 index 0000000..3fc0508 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/SyncGetTask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_gettask_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.GetTaskRequest; +import com.google.cloud.dataplex.v1.Task; +import com.google.cloud.dataplex.v1.TaskName; + +public class SyncGetTask { + + public static void main(String[] args) throws Exception { + syncGetTask(); + } + + public static void syncGetTask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetTaskRequest request = + GetTaskRequest.newBuilder() + .setName(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .build(); + Task response = dataplexServiceClient.getTask(request); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_gettask_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/SyncGetTaskString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/SyncGetTaskString.java new file mode 100644 index 0000000..68f0f10 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/SyncGetTaskString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_gettask_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Task; +import com.google.cloud.dataplex.v1.TaskName; + +public class SyncGetTaskString { + + public static void main(String[] args) throws Exception { + syncGetTaskString(); + } + + public static void syncGetTaskString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString(); + Task response = dataplexServiceClient.getTask(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_gettask_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/SyncGetTaskTaskname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/SyncGetTaskTaskname.java new file mode 100644 index 0000000..7ad6789 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/gettask/SyncGetTaskTaskname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_gettask_taskname_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Task; +import com.google.cloud.dataplex.v1.TaskName; + +public class SyncGetTaskTaskname { + + public static void main(String[] args) throws Exception { + syncGetTaskTaskname(); + } + + public static void syncGetTaskTaskname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]"); + Task response = dataplexServiceClient.getTask(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_gettask_taskname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/AsyncGetZone.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/AsyncGetZone.java new file mode 100644 index 0000000..9bb2ec1 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/AsyncGetZone.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getzone_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.GetZoneRequest; +import com.google.cloud.dataplex.v1.Zone; +import com.google.cloud.dataplex.v1.ZoneName; + +public class AsyncGetZone { + + public static void main(String[] args) throws Exception { + asyncGetZone(); + } + + public static void asyncGetZone() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetZoneRequest request = + GetZoneRequest.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .build(); + ApiFuture future = dataplexServiceClient.getZoneCallable().futureCall(request); + // Do something. + Zone response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getzone_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/SyncGetZone.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/SyncGetZone.java new file mode 100644 index 0000000..c858f97 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/SyncGetZone.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getzone_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.GetZoneRequest; +import com.google.cloud.dataplex.v1.Zone; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncGetZone { + + public static void main(String[] args) throws Exception { + syncGetZone(); + } + + public static void syncGetZone() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + GetZoneRequest request = + GetZoneRequest.newBuilder() + .setName(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .build(); + Zone response = dataplexServiceClient.getZone(request); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getzone_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/SyncGetZoneString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/SyncGetZoneString.java new file mode 100644 index 0000000..1bab814 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/SyncGetZoneString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getzone_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Zone; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncGetZoneString { + + public static void main(String[] args) throws Exception { + syncGetZoneString(); + } + + public static void syncGetZoneString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String name = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString(); + Zone response = dataplexServiceClient.getZone(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getzone_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/SyncGetZoneZonename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/SyncGetZoneZonename.java new file mode 100644 index 0000000..41ac1f5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/getzone/SyncGetZoneZonename.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_getzone_zonename_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Zone; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncGetZoneZonename { + + public static void main(String[] args) throws Exception { + syncGetZoneZonename(); + } + + public static void syncGetZoneZonename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ZoneName name = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + Zone response = dataplexServiceClient.getZone(name); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_getzone_zonename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/AsyncListAssetActions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/AsyncListAssetActions.java new file mode 100644 index 0000000..1b3d6f0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/AsyncListAssetActions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listassetactions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ListAssetActionsRequest; + +public class AsyncListAssetActions { + + public static void main(String[] args) throws Exception { + asyncListAssetActions(); + } + + public static void asyncListAssetActions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListAssetActionsRequest request = + ListAssetActionsRequest.newBuilder() + .setParent( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + dataplexServiceClient.listAssetActionsPagedCallable().futureCall(request); + // Do something. + for (Action element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listassetactions_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/AsyncListAssetActionsPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/AsyncListAssetActionsPaged.java new file mode 100644 index 0000000..d1bccc8 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/AsyncListAssetActionsPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listassetactions_paged_async] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ListActionsResponse; +import com.google.cloud.dataplex.v1.ListAssetActionsRequest; +import com.google.common.base.Strings; + +public class AsyncListAssetActionsPaged { + + public static void main(String[] args) throws Exception { + asyncListAssetActionsPaged(); + } + + public static void asyncListAssetActionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListAssetActionsRequest request = + ListAssetActionsRequest.newBuilder() + .setParent( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListActionsResponse response = + dataplexServiceClient.listAssetActionsCallable().call(request); + for (Action element : response.getActionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listassetactions_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/SyncListAssetActions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/SyncListAssetActions.java new file mode 100644 index 0000000..65699e5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/SyncListAssetActions.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listassetactions_sync] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ListAssetActionsRequest; + +public class SyncListAssetActions { + + public static void main(String[] args) throws Exception { + syncListAssetActions(); + } + + public static void syncListAssetActions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListAssetActionsRequest request = + ListAssetActionsRequest.newBuilder() + .setParent( + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Action element : dataplexServiceClient.listAssetActions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listassetactions_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/SyncListAssetActionsAssetname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/SyncListAssetActionsAssetname.java new file mode 100644 index 0000000..a4c3161 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/SyncListAssetActionsAssetname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listassetactions_assetname_sync] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; + +public class SyncListAssetActionsAssetname { + + public static void main(String[] args) throws Exception { + syncListAssetActionsAssetname(); + } + + public static void syncListAssetActionsAssetname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + AssetName parent = AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]"); + for (Action element : dataplexServiceClient.listAssetActions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listassetactions_assetname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/SyncListAssetActionsString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/SyncListAssetActionsString.java new file mode 100644 index 0000000..b0184f3 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassetactions/SyncListAssetActionsString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listassetactions_string_sync] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.AssetName; +import com.google.cloud.dataplex.v1.DataplexServiceClient; + +public class SyncListAssetActionsString { + + public static void main(String[] args) throws Exception { + syncListAssetActionsString(); + } + + public static void syncListAssetActionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = + AssetName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ASSET]").toString(); + for (Action element : dataplexServiceClient.listAssetActions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listassetactions_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/AsyncListAssets.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/AsyncListAssets.java new file mode 100644 index 0000000..1c98c6a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/AsyncListAssets.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listassets_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ListAssetsRequest; +import com.google.cloud.dataplex.v1.ZoneName; + +public class AsyncListAssets { + + public static void main(String[] args) throws Exception { + asyncListAssets(); + } + + public static void asyncListAssets() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListAssetsRequest request = + ListAssetsRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = dataplexServiceClient.listAssetsPagedCallable().futureCall(request); + // Do something. + for (Asset element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listassets_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/AsyncListAssetsPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/AsyncListAssetsPaged.java new file mode 100644 index 0000000..b8a84b6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/AsyncListAssetsPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listassets_paged_async] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ListAssetsRequest; +import com.google.cloud.dataplex.v1.ListAssetsResponse; +import com.google.cloud.dataplex.v1.ZoneName; +import com.google.common.base.Strings; + +public class AsyncListAssetsPaged { + + public static void main(String[] args) throws Exception { + asyncListAssetsPaged(); + } + + public static void asyncListAssetsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListAssetsRequest request = + ListAssetsRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListAssetsResponse response = dataplexServiceClient.listAssetsCallable().call(request); + for (Asset element : response.getAssetsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listassets_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/SyncListAssets.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/SyncListAssets.java new file mode 100644 index 0000000..9fcda18 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/SyncListAssets.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listassets_sync] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ListAssetsRequest; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncListAssets { + + public static void main(String[] args) throws Exception { + syncListAssets(); + } + + public static void syncListAssets() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListAssetsRequest request = + ListAssetsRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Asset element : dataplexServiceClient.listAssets(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listassets_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/SyncListAssetsString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/SyncListAssetsString.java new file mode 100644 index 0000000..ef29dbf --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/SyncListAssetsString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listassets_string_sync] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncListAssetsString { + + public static void main(String[] args) throws Exception { + syncListAssetsString(); + } + + public static void syncListAssetsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString(); + for (Asset element : dataplexServiceClient.listAssets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listassets_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/SyncListAssetsZonename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/SyncListAssetsZonename.java new file mode 100644 index 0000000..aa7092f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listassets/SyncListAssetsZonename.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listassets_zonename_sync] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncListAssetsZonename { + + public static void main(String[] args) throws Exception { + syncListAssetsZonename(); + } + + public static void syncListAssetsZonename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + for (Asset element : dataplexServiceClient.listAssets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listassets_zonename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/AsyncListEnvironments.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/AsyncListEnvironments.java new file mode 100644 index 0000000..9624ab9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/AsyncListEnvironments.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listenvironments_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListEnvironmentsRequest; + +public class AsyncListEnvironments { + + public static void main(String[] args) throws Exception { + asyncListEnvironments(); + } + + public static void asyncListEnvironments() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListEnvironmentsRequest request = + ListEnvironmentsRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + dataplexServiceClient.listEnvironmentsPagedCallable().futureCall(request); + // Do something. + for (Environment element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listenvironments_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/AsyncListEnvironmentsPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/AsyncListEnvironmentsPaged.java new file mode 100644 index 0000000..0caf1f3 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/AsyncListEnvironmentsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listenvironments_paged_async] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListEnvironmentsRequest; +import com.google.cloud.dataplex.v1.ListEnvironmentsResponse; +import com.google.common.base.Strings; + +public class AsyncListEnvironmentsPaged { + + public static void main(String[] args) throws Exception { + asyncListEnvironmentsPaged(); + } + + public static void asyncListEnvironmentsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListEnvironmentsRequest request = + ListEnvironmentsRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListEnvironmentsResponse response = + dataplexServiceClient.listEnvironmentsCallable().call(request); + for (Environment element : response.getEnvironmentsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listenvironments_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/SyncListEnvironments.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/SyncListEnvironments.java new file mode 100644 index 0000000..b6f3b56 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/SyncListEnvironments.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listenvironments_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListEnvironmentsRequest; + +public class SyncListEnvironments { + + public static void main(String[] args) throws Exception { + syncListEnvironments(); + } + + public static void syncListEnvironments() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListEnvironmentsRequest request = + ListEnvironmentsRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Environment element : dataplexServiceClient.listEnvironments(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listenvironments_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/SyncListEnvironmentsLakename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/SyncListEnvironmentsLakename.java new file mode 100644 index 0000000..6ef51bd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/SyncListEnvironmentsLakename.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listenvironments_lakename_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncListEnvironmentsLakename { + + public static void main(String[] args) throws Exception { + syncListEnvironmentsLakename(); + } + + public static void syncListEnvironmentsLakename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + for (Environment element : dataplexServiceClient.listEnvironments(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listenvironments_lakename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/SyncListEnvironmentsString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/SyncListEnvironmentsString.java new file mode 100644 index 0000000..d3fe560 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listenvironments/SyncListEnvironmentsString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listenvironments_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncListEnvironmentsString { + + public static void main(String[] args) throws Exception { + syncListEnvironmentsString(); + } + + public static void syncListEnvironmentsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString(); + for (Environment element : dataplexServiceClient.listEnvironments(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listenvironments_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/AsyncListJobs.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/AsyncListJobs.java new file mode 100644 index 0000000..683c5ef --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/AsyncListJobs.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listjobs_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Job; +import com.google.cloud.dataplex.v1.ListJobsRequest; +import com.google.cloud.dataplex.v1.TaskName; + +public class AsyncListJobs { + + public static void main(String[] args) throws Exception { + asyncListJobs(); + } + + public static void asyncListJobs() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListJobsRequest request = + ListJobsRequest.newBuilder() + .setParent(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = dataplexServiceClient.listJobsPagedCallable().futureCall(request); + // Do something. + for (Job element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listjobs_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/AsyncListJobsPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/AsyncListJobsPaged.java new file mode 100644 index 0000000..f1690dd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/AsyncListJobsPaged.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listjobs_paged_async] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Job; +import com.google.cloud.dataplex.v1.ListJobsRequest; +import com.google.cloud.dataplex.v1.ListJobsResponse; +import com.google.cloud.dataplex.v1.TaskName; +import com.google.common.base.Strings; + +public class AsyncListJobsPaged { + + public static void main(String[] args) throws Exception { + asyncListJobsPaged(); + } + + public static void asyncListJobsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListJobsRequest request = + ListJobsRequest.newBuilder() + .setParent(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListJobsResponse response = dataplexServiceClient.listJobsCallable().call(request); + for (Job element : response.getJobsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listjobs_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/SyncListJobs.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/SyncListJobs.java new file mode 100644 index 0000000..43eca55 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/SyncListJobs.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listjobs_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Job; +import com.google.cloud.dataplex.v1.ListJobsRequest; +import com.google.cloud.dataplex.v1.TaskName; + +public class SyncListJobs { + + public static void main(String[] args) throws Exception { + syncListJobs(); + } + + public static void syncListJobs() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListJobsRequest request = + ListJobsRequest.newBuilder() + .setParent(TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Job element : dataplexServiceClient.listJobs(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listjobs_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/SyncListJobsString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/SyncListJobsString.java new file mode 100644 index 0000000..ea91048 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/SyncListJobsString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listjobs_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Job; +import com.google.cloud.dataplex.v1.TaskName; + +public class SyncListJobsString { + + public static void main(String[] args) throws Exception { + syncListJobsString(); + } + + public static void syncListJobsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]").toString(); + for (Job element : dataplexServiceClient.listJobs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listjobs_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/SyncListJobsTaskname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/SyncListJobsTaskname.java new file mode 100644 index 0000000..bd453ef --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listjobs/SyncListJobsTaskname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listjobs_taskname_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Job; +import com.google.cloud.dataplex.v1.TaskName; + +public class SyncListJobsTaskname { + + public static void main(String[] args) throws Exception { + syncListJobsTaskname(); + } + + public static void syncListJobsTaskname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + TaskName parent = TaskName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[TASK]"); + for (Job element : dataplexServiceClient.listJobs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listjobs_taskname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/AsyncListLakeActions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/AsyncListLakeActions.java new file mode 100644 index 0000000..8c894da --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/AsyncListLakeActions.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlakeactions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListLakeActionsRequest; + +public class AsyncListLakeActions { + + public static void main(String[] args) throws Exception { + asyncListLakeActions(); + } + + public static void asyncListLakeActions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListLakeActionsRequest request = + ListLakeActionsRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + dataplexServiceClient.listLakeActionsPagedCallable().futureCall(request); + // Do something. + for (Action element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlakeactions_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/AsyncListLakeActionsPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/AsyncListLakeActionsPaged.java new file mode 100644 index 0000000..8c14ca4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/AsyncListLakeActionsPaged.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlakeactions_paged_async] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListActionsResponse; +import com.google.cloud.dataplex.v1.ListLakeActionsRequest; +import com.google.common.base.Strings; + +public class AsyncListLakeActionsPaged { + + public static void main(String[] args) throws Exception { + asyncListLakeActionsPaged(); + } + + public static void asyncListLakeActionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListLakeActionsRequest request = + ListLakeActionsRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListActionsResponse response = + dataplexServiceClient.listLakeActionsCallable().call(request); + for (Action element : response.getActionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlakeactions_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/SyncListLakeActions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/SyncListLakeActions.java new file mode 100644 index 0000000..3f6cf8a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/SyncListLakeActions.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlakeactions_sync] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListLakeActionsRequest; + +public class SyncListLakeActions { + + public static void main(String[] args) throws Exception { + syncListLakeActions(); + } + + public static void syncListLakeActions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListLakeActionsRequest request = + ListLakeActionsRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Action element : dataplexServiceClient.listLakeActions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlakeactions_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/SyncListLakeActionsLakename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/SyncListLakeActionsLakename.java new file mode 100644 index 0000000..ed5e367 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/SyncListLakeActionsLakename.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlakeactions_lakename_sync] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncListLakeActionsLakename { + + public static void main(String[] args) throws Exception { + syncListLakeActionsLakename(); + } + + public static void syncListLakeActionsLakename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + for (Action element : dataplexServiceClient.listLakeActions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlakeactions_lakename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/SyncListLakeActionsString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/SyncListLakeActionsString.java new file mode 100644 index 0000000..ce9fa42 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakeactions/SyncListLakeActionsString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlakeactions_string_sync] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; + +public class SyncListLakeActionsString { + + public static void main(String[] args) throws Exception { + syncListLakeActionsString(); + } + + public static void syncListLakeActionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString(); + for (Action element : dataplexServiceClient.listLakeActions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlakeactions_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/AsyncListLakes.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/AsyncListLakes.java new file mode 100644 index 0000000..70b14f4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/AsyncListLakes.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlakes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.ListLakesRequest; +import com.google.cloud.dataplex.v1.LocationName; + +public class AsyncListLakes { + + public static void main(String[] args) throws Exception { + asyncListLakes(); + } + + public static void asyncListLakes() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListLakesRequest request = + ListLakesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = dataplexServiceClient.listLakesPagedCallable().futureCall(request); + // Do something. + for (Lake element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlakes_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/AsyncListLakesPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/AsyncListLakesPaged.java new file mode 100644 index 0000000..821bdc0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/AsyncListLakesPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlakes_paged_async] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.ListLakesRequest; +import com.google.cloud.dataplex.v1.ListLakesResponse; +import com.google.cloud.dataplex.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListLakesPaged { + + public static void main(String[] args) throws Exception { + asyncListLakesPaged(); + } + + public static void asyncListLakesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListLakesRequest request = + ListLakesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListLakesResponse response = dataplexServiceClient.listLakesCallable().call(request); + for (Lake element : response.getLakesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlakes_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/SyncListLakes.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/SyncListLakes.java new file mode 100644 index 0000000..9f56840 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/SyncListLakes.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlakes_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.ListLakesRequest; +import com.google.cloud.dataplex.v1.LocationName; + +public class SyncListLakes { + + public static void main(String[] args) throws Exception { + syncListLakes(); + } + + public static void syncListLakes() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListLakesRequest request = + ListLakesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Lake element : dataplexServiceClient.listLakes(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlakes_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/SyncListLakesLocationname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/SyncListLakesLocationname.java new file mode 100644 index 0000000..bf50d79 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/SyncListLakesLocationname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlakes_locationname_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.LocationName; + +public class SyncListLakesLocationname { + + public static void main(String[] args) throws Exception { + syncListLakesLocationname(); + } + + public static void syncListLakesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Lake element : dataplexServiceClient.listLakes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlakes_locationname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/SyncListLakesString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/SyncListLakesString.java new file mode 100644 index 0000000..04ee302 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlakes/SyncListLakesString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlakes_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.LocationName; + +public class SyncListLakesString { + + public static void main(String[] args) throws Exception { + syncListLakesString(); + } + + public static void syncListLakesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Lake element : dataplexServiceClient.listLakes(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlakes_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlocations/AsyncListLocations.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlocations/AsyncListLocations.java new file mode 100644 index 0000000..feace4f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlocations/AsyncListLocations.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + dataplexServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlocations_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlocations/AsyncListLocationsPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 0000000..2a7cf34 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlocations_paged_async] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + dataplexServiceClient.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; + } + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlocations_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlocations/SyncListLocations.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlocations/SyncListLocations.java new file mode 100644 index 0000000..0f58d28 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listlocations/SyncListLocations.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listlocations_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : dataplexServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listlocations_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/AsyncListSessions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/AsyncListSessions.java new file mode 100644 index 0000000..b6fa861 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/AsyncListSessions.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listsessions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.cloud.dataplex.v1.ListSessionsRequest; +import com.google.cloud.dataplex.v1.Session; + +public class AsyncListSessions { + + public static void main(String[] args) throws Exception { + asyncListSessions(); + } + + public static void asyncListSessions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setParent( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + dataplexServiceClient.listSessionsPagedCallable().futureCall(request); + // Do something. + for (Session element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listsessions_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/AsyncListSessionsPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/AsyncListSessionsPaged.java new file mode 100644 index 0000000..4fc999b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/AsyncListSessionsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listsessions_paged_async] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.cloud.dataplex.v1.ListSessionsRequest; +import com.google.cloud.dataplex.v1.ListSessionsResponse; +import com.google.cloud.dataplex.v1.Session; +import com.google.common.base.Strings; + +public class AsyncListSessionsPaged { + + public static void main(String[] args) throws Exception { + asyncListSessionsPaged(); + } + + public static void asyncListSessionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setParent( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListSessionsResponse response = dataplexServiceClient.listSessionsCallable().call(request); + for (Session element : response.getSessionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listsessions_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/SyncListSessions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/SyncListSessions.java new file mode 100644 index 0000000..733c709 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/SyncListSessions.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listsessions_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.cloud.dataplex.v1.ListSessionsRequest; +import com.google.cloud.dataplex.v1.Session; + +public class SyncListSessions { + + public static void main(String[] args) throws Exception { + syncListSessions(); + } + + public static void syncListSessions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setParent( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (Session element : dataplexServiceClient.listSessions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listsessions_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/SyncListSessionsEnvironmentname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/SyncListSessionsEnvironmentname.java new file mode 100644 index 0000000..076f003 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/SyncListSessionsEnvironmentname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listsessions_environmentname_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.cloud.dataplex.v1.Session; + +public class SyncListSessionsEnvironmentname { + + public static void main(String[] args) throws Exception { + syncListSessionsEnvironmentname(); + } + + public static void syncListSessionsEnvironmentname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + EnvironmentName parent = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]"); + for (Session element : dataplexServiceClient.listSessions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listsessions_environmentname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/SyncListSessionsString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/SyncListSessionsString.java new file mode 100644 index 0000000..f9c1095 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listsessions/SyncListSessionsString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listsessions_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.EnvironmentName; +import com.google.cloud.dataplex.v1.Session; + +public class SyncListSessionsString { + + public static void main(String[] args) throws Exception { + syncListSessionsString(); + } + + public static void syncListSessionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ENVIRONMENT]").toString(); + for (Session element : dataplexServiceClient.listSessions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listsessions_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/AsyncListTasks.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/AsyncListTasks.java new file mode 100644 index 0000000..1d39b28 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/AsyncListTasks.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listtasks_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListTasksRequest; +import com.google.cloud.dataplex.v1.Task; + +public class AsyncListTasks { + + public static void main(String[] args) throws Exception { + asyncListTasks(); + } + + public static void asyncListTasks() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListTasksRequest request = + ListTasksRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = dataplexServiceClient.listTasksPagedCallable().futureCall(request); + // Do something. + for (Task element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listtasks_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/AsyncListTasksPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/AsyncListTasksPaged.java new file mode 100644 index 0000000..67a9bbd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/AsyncListTasksPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listtasks_paged_async] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListTasksRequest; +import com.google.cloud.dataplex.v1.ListTasksResponse; +import com.google.cloud.dataplex.v1.Task; +import com.google.common.base.Strings; + +public class AsyncListTasksPaged { + + public static void main(String[] args) throws Exception { + asyncListTasksPaged(); + } + + public static void asyncListTasksPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListTasksRequest request = + ListTasksRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListTasksResponse response = dataplexServiceClient.listTasksCallable().call(request); + for (Task element : response.getTasksList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listtasks_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/SyncListTasks.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/SyncListTasks.java new file mode 100644 index 0000000..0169140 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/SyncListTasks.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listtasks_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListTasksRequest; +import com.google.cloud.dataplex.v1.Task; + +public class SyncListTasks { + + public static void main(String[] args) throws Exception { + syncListTasks(); + } + + public static void syncListTasks() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListTasksRequest request = + ListTasksRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Task element : dataplexServiceClient.listTasks(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listtasks_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/SyncListTasksLakename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/SyncListTasksLakename.java new file mode 100644 index 0000000..25b73bc --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/SyncListTasksLakename.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listtasks_lakename_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Task; + +public class SyncListTasksLakename { + + public static void main(String[] args) throws Exception { + syncListTasksLakename(); + } + + public static void syncListTasksLakename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + for (Task element : dataplexServiceClient.listTasks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listtasks_lakename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/SyncListTasksString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/SyncListTasksString.java new file mode 100644 index 0000000..1e041fc --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listtasks/SyncListTasksString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listtasks_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Task; + +public class SyncListTasksString { + + public static void main(String[] args) throws Exception { + syncListTasksString(); + } + + public static void syncListTasksString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString(); + for (Task element : dataplexServiceClient.listTasks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listtasks_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/AsyncListZoneActions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/AsyncListZoneActions.java new file mode 100644 index 0000000..2a96507 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/AsyncListZoneActions.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listzoneactions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ListZoneActionsRequest; +import com.google.cloud.dataplex.v1.ZoneName; + +public class AsyncListZoneActions { + + public static void main(String[] args) throws Exception { + asyncListZoneActions(); + } + + public static void asyncListZoneActions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListZoneActionsRequest request = + ListZoneActionsRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + dataplexServiceClient.listZoneActionsPagedCallable().futureCall(request); + // Do something. + for (Action element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listzoneactions_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/AsyncListZoneActionsPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/AsyncListZoneActionsPaged.java new file mode 100644 index 0000000..30034c3 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/AsyncListZoneActionsPaged.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listzoneactions_paged_async] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ListActionsResponse; +import com.google.cloud.dataplex.v1.ListZoneActionsRequest; +import com.google.cloud.dataplex.v1.ZoneName; +import com.google.common.base.Strings; + +public class AsyncListZoneActionsPaged { + + public static void main(String[] args) throws Exception { + asyncListZoneActionsPaged(); + } + + public static void asyncListZoneActionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListZoneActionsRequest request = + ListZoneActionsRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListActionsResponse response = + dataplexServiceClient.listZoneActionsCallable().call(request); + for (Action element : response.getActionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listzoneactions_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/SyncListZoneActions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/SyncListZoneActions.java new file mode 100644 index 0000000..cf45485 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/SyncListZoneActions.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listzoneactions_sync] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ListZoneActionsRequest; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncListZoneActions { + + public static void main(String[] args) throws Exception { + syncListZoneActions(); + } + + public static void syncListZoneActions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListZoneActionsRequest request = + ListZoneActionsRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Action element : dataplexServiceClient.listZoneActions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listzoneactions_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/SyncListZoneActionsString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/SyncListZoneActionsString.java new file mode 100644 index 0000000..615cde7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/SyncListZoneActionsString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listzoneactions_string_sync] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncListZoneActionsString { + + public static void main(String[] args) throws Exception { + syncListZoneActionsString(); + } + + public static void syncListZoneActionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString(); + for (Action element : dataplexServiceClient.listZoneActions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listzoneactions_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/SyncListZoneActionsZonename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/SyncListZoneActionsZonename.java new file mode 100644 index 0000000..2ae5eef --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzoneactions/SyncListZoneActionsZonename.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listzoneactions_zonename_sync] +import com.google.cloud.dataplex.v1.Action; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncListZoneActionsZonename { + + public static void main(String[] args) throws Exception { + syncListZoneActionsZonename(); + } + + public static void syncListZoneActionsZonename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + for (Action element : dataplexServiceClient.listZoneActions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listzoneactions_zonename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/AsyncListZones.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/AsyncListZones.java new file mode 100644 index 0000000..95ff857 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/AsyncListZones.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listzones_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListZonesRequest; +import com.google.cloud.dataplex.v1.Zone; + +public class AsyncListZones { + + public static void main(String[] args) throws Exception { + asyncListZones(); + } + + public static void asyncListZones() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListZonesRequest request = + ListZonesRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = dataplexServiceClient.listZonesPagedCallable().futureCall(request); + // Do something. + for (Zone element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listzones_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/AsyncListZonesPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/AsyncListZonesPaged.java new file mode 100644 index 0000000..a11a3a2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/AsyncListZonesPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listzones_paged_async] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListZonesRequest; +import com.google.cloud.dataplex.v1.ListZonesResponse; +import com.google.cloud.dataplex.v1.Zone; +import com.google.common.base.Strings; + +public class AsyncListZonesPaged { + + public static void main(String[] args) throws Exception { + asyncListZonesPaged(); + } + + public static void asyncListZonesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListZonesRequest request = + ListZonesRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListZonesResponse response = dataplexServiceClient.listZonesCallable().call(request); + for (Zone element : response.getZonesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listzones_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/SyncListZones.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/SyncListZones.java new file mode 100644 index 0000000..b21624d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/SyncListZones.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listzones_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.ListZonesRequest; +import com.google.cloud.dataplex.v1.Zone; + +public class SyncListZones { + + public static void main(String[] args) throws Exception { + syncListZones(); + } + + public static void syncListZones() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + ListZonesRequest request = + ListZonesRequest.newBuilder() + .setParent(LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Zone element : dataplexServiceClient.listZones(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listzones_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/SyncListZonesLakename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/SyncListZonesLakename.java new file mode 100644 index 0000000..0db2892 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/SyncListZonesLakename.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listzones_lakename_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Zone; + +public class SyncListZonesLakename { + + public static void main(String[] args) throws Exception { + syncListZonesLakename(); + } + + public static void syncListZonesLakename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + LakeName parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]"); + for (Zone element : dataplexServiceClient.listZones(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listzones_lakename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/SyncListZonesString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/SyncListZonesString.java new file mode 100644 index 0000000..a60bd0a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/listzones/SyncListZonesString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_listzones_string_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.LakeName; +import com.google.cloud.dataplex.v1.Zone; + +public class SyncListZonesString { + + public static void main(String[] args) throws Exception { + syncListZonesString(); + } + + public static void syncListZonesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + String parent = LakeName.of("[PROJECT]", "[LOCATION]", "[LAKE]").toString(); + for (Zone element : dataplexServiceClient.listZones(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_listzones_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/AsyncUpdateAsset.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/AsyncUpdateAsset.java new file mode 100644 index 0000000..60637d6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/AsyncUpdateAsset.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updateasset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.UpdateAssetRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateAsset { + + public static void main(String[] args) throws Exception { + asyncUpdateAsset(); + } + + public static void asyncUpdateAsset() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateAssetRequest request = + UpdateAssetRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setAsset(Asset.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = dataplexServiceClient.updateAssetCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updateasset_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/AsyncUpdateAssetLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/AsyncUpdateAssetLRO.java new file mode 100644 index 0000000..022b509 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/AsyncUpdateAssetLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updateasset_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.cloud.dataplex.v1.UpdateAssetRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateAssetLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateAssetLRO(); + } + + public static void asyncUpdateAssetLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateAssetRequest request = + UpdateAssetRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setAsset(Asset.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + dataplexServiceClient.updateAssetOperationCallable().futureCall(request); + // Do something. + Asset response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updateasset_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/SyncUpdateAsset.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/SyncUpdateAsset.java new file mode 100644 index 0000000..1a911fb --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/SyncUpdateAsset.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updateasset_sync] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.UpdateAssetRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateAsset { + + public static void main(String[] args) throws Exception { + syncUpdateAsset(); + } + + public static void syncUpdateAsset() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateAssetRequest request = + UpdateAssetRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setAsset(Asset.newBuilder().build()) + .setValidateOnly(true) + .build(); + Asset response = dataplexServiceClient.updateAssetAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updateasset_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/SyncUpdateAssetAssetFieldmask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/SyncUpdateAssetAssetFieldmask.java new file mode 100644 index 0000000..4b2b77d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateasset/SyncUpdateAssetAssetFieldmask.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updateasset_assetfieldmask_sync] +import com.google.cloud.dataplex.v1.Asset; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateAssetAssetFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateAssetAssetFieldmask(); + } + + public static void syncUpdateAssetAssetFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + Asset asset = Asset.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Asset response = dataplexServiceClient.updateAssetAsync(asset, updateMask).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updateasset_assetfieldmask_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/AsyncUpdateEnvironment.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/AsyncUpdateEnvironment.java new file mode 100644 index 0000000..c288831 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/AsyncUpdateEnvironment.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updateenvironment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.UpdateEnvironmentRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateEnvironment { + + public static void main(String[] args) throws Exception { + asyncUpdateEnvironment(); + } + + public static void asyncUpdateEnvironment() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateEnvironmentRequest request = + UpdateEnvironmentRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setEnvironment(Environment.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = + dataplexServiceClient.updateEnvironmentCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updateenvironment_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/AsyncUpdateEnvironmentLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/AsyncUpdateEnvironmentLRO.java new file mode 100644 index 0000000..f603f2a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/AsyncUpdateEnvironmentLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updateenvironment_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.cloud.dataplex.v1.UpdateEnvironmentRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateEnvironmentLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateEnvironmentLRO(); + } + + public static void asyncUpdateEnvironmentLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateEnvironmentRequest request = + UpdateEnvironmentRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setEnvironment(Environment.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + dataplexServiceClient.updateEnvironmentOperationCallable().futureCall(request); + // Do something. + Environment response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updateenvironment_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/SyncUpdateEnvironment.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/SyncUpdateEnvironment.java new file mode 100644 index 0000000..9c9ab8b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/SyncUpdateEnvironment.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updateenvironment_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.cloud.dataplex.v1.UpdateEnvironmentRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateEnvironment { + + public static void main(String[] args) throws Exception { + syncUpdateEnvironment(); + } + + public static void syncUpdateEnvironment() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateEnvironmentRequest request = + UpdateEnvironmentRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setEnvironment(Environment.newBuilder().build()) + .setValidateOnly(true) + .build(); + Environment response = dataplexServiceClient.updateEnvironmentAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updateenvironment_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/SyncUpdateEnvironmentEnvironmentFieldmask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/SyncUpdateEnvironmentEnvironmentFieldmask.java new file mode 100644 index 0000000..156245e --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updateenvironment/SyncUpdateEnvironmentEnvironmentFieldmask.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updateenvironment_environmentfieldmask_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Environment; +import com.google.protobuf.FieldMask; + +public class SyncUpdateEnvironmentEnvironmentFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateEnvironmentEnvironmentFieldmask(); + } + + public static void syncUpdateEnvironmentEnvironmentFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + Environment environment = Environment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Environment response = + dataplexServiceClient.updateEnvironmentAsync(environment, updateMask).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updateenvironment_environmentfieldmask_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/AsyncUpdateLake.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/AsyncUpdateLake.java new file mode 100644 index 0000000..58b076c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/AsyncUpdateLake.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatelake_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.UpdateLakeRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateLake { + + public static void main(String[] args) throws Exception { + asyncUpdateLake(); + } + + public static void asyncUpdateLake() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateLakeRequest request = + UpdateLakeRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setLake(Lake.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = dataplexServiceClient.updateLakeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatelake_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/AsyncUpdateLakeLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/AsyncUpdateLakeLRO.java new file mode 100644 index 0000000..78651c2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/AsyncUpdateLakeLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatelake_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.cloud.dataplex.v1.UpdateLakeRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateLakeLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateLakeLRO(); + } + + public static void asyncUpdateLakeLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateLakeRequest request = + UpdateLakeRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setLake(Lake.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + dataplexServiceClient.updateLakeOperationCallable().futureCall(request); + // Do something. + Lake response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatelake_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/SyncUpdateLake.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/SyncUpdateLake.java new file mode 100644 index 0000000..9754c43 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/SyncUpdateLake.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatelake_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.cloud.dataplex.v1.UpdateLakeRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateLake { + + public static void main(String[] args) throws Exception { + syncUpdateLake(); + } + + public static void syncUpdateLake() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateLakeRequest request = + UpdateLakeRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setLake(Lake.newBuilder().build()) + .setValidateOnly(true) + .build(); + Lake response = dataplexServiceClient.updateLakeAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatelake_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/SyncUpdateLakeLakeFieldmask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/SyncUpdateLakeLakeFieldmask.java new file mode 100644 index 0000000..689cb99 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatelake/SyncUpdateLakeLakeFieldmask.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatelake_lakefieldmask_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Lake; +import com.google.protobuf.FieldMask; + +public class SyncUpdateLakeLakeFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateLakeLakeFieldmask(); + } + + public static void syncUpdateLakeLakeFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + Lake lake = Lake.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Lake response = dataplexServiceClient.updateLakeAsync(lake, updateMask).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatelake_lakefieldmask_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/AsyncUpdateTask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/AsyncUpdateTask.java new file mode 100644 index 0000000..d22aafa --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/AsyncUpdateTask.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatetask_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Task; +import com.google.cloud.dataplex.v1.UpdateTaskRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateTask { + + public static void main(String[] args) throws Exception { + asyncUpdateTask(); + } + + public static void asyncUpdateTask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateTaskRequest request = + UpdateTaskRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setTask(Task.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = dataplexServiceClient.updateTaskCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatetask_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/AsyncUpdateTaskLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/AsyncUpdateTaskLRO.java new file mode 100644 index 0000000..a7cf652 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/AsyncUpdateTaskLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatetask_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.cloud.dataplex.v1.Task; +import com.google.cloud.dataplex.v1.UpdateTaskRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateTaskLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateTaskLRO(); + } + + public static void asyncUpdateTaskLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateTaskRequest request = + UpdateTaskRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setTask(Task.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + dataplexServiceClient.updateTaskOperationCallable().futureCall(request); + // Do something. + Task response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatetask_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/SyncUpdateTask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/SyncUpdateTask.java new file mode 100644 index 0000000..24719d4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/SyncUpdateTask.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatetask_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Task; +import com.google.cloud.dataplex.v1.UpdateTaskRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateTask { + + public static void main(String[] args) throws Exception { + syncUpdateTask(); + } + + public static void syncUpdateTask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateTaskRequest request = + UpdateTaskRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setTask(Task.newBuilder().build()) + .setValidateOnly(true) + .build(); + Task response = dataplexServiceClient.updateTaskAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatetask_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/SyncUpdateTaskTaskFieldmask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/SyncUpdateTaskTaskFieldmask.java new file mode 100644 index 0000000..04d2025 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatetask/SyncUpdateTaskTaskFieldmask.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatetask_taskfieldmask_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Task; +import com.google.protobuf.FieldMask; + +public class SyncUpdateTaskTaskFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateTaskTaskFieldmask(); + } + + public static void syncUpdateTaskTaskFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + Task task = Task.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Task response = dataplexServiceClient.updateTaskAsync(task, updateMask).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatetask_taskfieldmask_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/AsyncUpdateZone.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/AsyncUpdateZone.java new file mode 100644 index 0000000..2bf2d97 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/AsyncUpdateZone.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatezone_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.UpdateZoneRequest; +import com.google.cloud.dataplex.v1.Zone; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateZone { + + public static void main(String[] args) throws Exception { + asyncUpdateZone(); + } + + public static void asyncUpdateZone() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateZoneRequest request = + UpdateZoneRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setZone(Zone.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = dataplexServiceClient.updateZoneCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatezone_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/AsyncUpdateZoneLRO.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/AsyncUpdateZoneLRO.java new file mode 100644 index 0000000..4dc122c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/AsyncUpdateZoneLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatezone_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.OperationMetadata; +import com.google.cloud.dataplex.v1.UpdateZoneRequest; +import com.google.cloud.dataplex.v1.Zone; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateZoneLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateZoneLRO(); + } + + public static void asyncUpdateZoneLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateZoneRequest request = + UpdateZoneRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setZone(Zone.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + dataplexServiceClient.updateZoneOperationCallable().futureCall(request); + // Do something. + Zone response = future.get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatezone_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/SyncUpdateZone.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/SyncUpdateZone.java new file mode 100644 index 0000000..174be6a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/SyncUpdateZone.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatezone_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.UpdateZoneRequest; +import com.google.cloud.dataplex.v1.Zone; +import com.google.protobuf.FieldMask; + +public class SyncUpdateZone { + + public static void main(String[] args) throws Exception { + syncUpdateZone(); + } + + public static void syncUpdateZone() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + UpdateZoneRequest request = + UpdateZoneRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setZone(Zone.newBuilder().build()) + .setValidateOnly(true) + .build(); + Zone response = dataplexServiceClient.updateZoneAsync(request).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatezone_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/SyncUpdateZoneZoneFieldmask.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/SyncUpdateZoneZoneFieldmask.java new file mode 100644 index 0000000..6d642c4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexserviceclient/updatezone/SyncUpdateZoneZoneFieldmask.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexserviceclient_updatezone_zonefieldmask_sync] +import com.google.cloud.dataplex.v1.DataplexServiceClient; +import com.google.cloud.dataplex.v1.Zone; +import com.google.protobuf.FieldMask; + +public class SyncUpdateZoneZoneFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateZoneZoneFieldmask(); + } + + public static void syncUpdateZoneZoneFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (DataplexServiceClient dataplexServiceClient = DataplexServiceClient.create()) { + Zone zone = Zone.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Zone response = dataplexServiceClient.updateZoneAsync(zone, updateMask).get(); + } + } +} +// [END dataplex_v1_generated_dataplexserviceclient_updatezone_zonefieldmask_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexservicesettings/getlake/SyncGetLake.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexservicesettings/getlake/SyncGetLake.java new file mode 100644 index 0000000..c6146e7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/dataplexservicesettings/getlake/SyncGetLake.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_dataplexservicesettings_getlake_sync] +import com.google.cloud.dataplex.v1.DataplexServiceSettings; +import java.time.Duration; + +public class SyncGetLake { + + public static void main(String[] args) throws Exception { + syncGetLake(); + } + + public static void syncGetLake() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + DataplexServiceSettings.Builder dataplexServiceSettingsBuilder = + DataplexServiceSettings.newBuilder(); + dataplexServiceSettingsBuilder + .getLakeSettings() + .setRetrySettings( + dataplexServiceSettingsBuilder + .getLakeSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + DataplexServiceSettings dataplexServiceSettings = dataplexServiceSettingsBuilder.build(); + } +} +// [END dataplex_v1_generated_dataplexservicesettings_getlake_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000..e8b953d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.MetadataServiceSettings; +import com.google.cloud.dataplex.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + MetadataServiceSettings metadataServiceSettings = + MetadataServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + MetadataServiceClient metadataServiceClient = + MetadataServiceClient.create(metadataServiceSettings); + } +} +// [END dataplex_v1_generated_metadataserviceclient_create_setcredentialsprovider_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/create/SyncCreateSetCredentialsProvider1.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 0000000..20178ac --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.MetadataServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + MetadataServiceSettings metadataServiceSettings = + MetadataServiceSettings.newBuilder() + .setTransportChannelProvider( + MetadataServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + MetadataServiceClient metadataServiceClient = + MetadataServiceClient.create(metadataServiceSettings); + } +} +// [END dataplex_v1_generated_metadataserviceclient_create_setcredentialsprovider1_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000..0b2a40a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_create_setendpoint_sync] +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.MetadataServiceSettings; +import com.google.cloud.dataplex.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + MetadataServiceSettings metadataServiceSettings = + MetadataServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + MetadataServiceClient metadataServiceClient = + MetadataServiceClient.create(metadataServiceSettings); + } +} +// [END dataplex_v1_generated_metadataserviceclient_create_setendpoint_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/AsyncCreateEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/AsyncCreateEntity.java new file mode 100644 index 0000000..444c167 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/AsyncCreateEntity.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_createentity_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.CreateEntityRequest; +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class AsyncCreateEntity { + + public static void main(String[] args) throws Exception { + asyncCreateEntity(); + } + + public static void asyncCreateEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + CreateEntityRequest request = + CreateEntityRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setEntity(Entity.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = metadataServiceClient.createEntityCallable().futureCall(request); + // Do something. + Entity response = future.get(); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_createentity_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/SyncCreateEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/SyncCreateEntity.java new file mode 100644 index 0000000..3cedf08 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/SyncCreateEntity.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_createentity_sync] +import com.google.cloud.dataplex.v1.CreateEntityRequest; +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncCreateEntity { + + public static void main(String[] args) throws Exception { + syncCreateEntity(); + } + + public static void syncCreateEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + CreateEntityRequest request = + CreateEntityRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setEntity(Entity.newBuilder().build()) + .setValidateOnly(true) + .build(); + Entity response = metadataServiceClient.createEntity(request); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_createentity_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/SyncCreateEntityStringEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/SyncCreateEntityStringEntity.java new file mode 100644 index 0000000..d371e8b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/SyncCreateEntityStringEntity.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_createentity_stringentity_sync] +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncCreateEntityStringEntity { + + public static void main(String[] args) throws Exception { + syncCreateEntityStringEntity(); + } + + public static void syncCreateEntityStringEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + String parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString(); + Entity entity = Entity.newBuilder().build(); + Entity response = metadataServiceClient.createEntity(parent, entity); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_createentity_stringentity_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/SyncCreateEntityZonenameEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/SyncCreateEntityZonenameEntity.java new file mode 100644 index 0000000..30ab182 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createentity/SyncCreateEntityZonenameEntity.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_createentity_zonenameentity_sync] +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncCreateEntityZonenameEntity { + + public static void main(String[] args) throws Exception { + syncCreateEntityZonenameEntity(); + } + + public static void syncCreateEntityZonenameEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + Entity entity = Entity.newBuilder().build(); + Entity response = metadataServiceClient.createEntity(parent, entity); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_createentity_zonenameentity_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/AsyncCreatePartition.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/AsyncCreatePartition.java new file mode 100644 index 0000000..307a32b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/AsyncCreatePartition.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_createpartition_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.CreatePartitionRequest; +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; + +public class AsyncCreatePartition { + + public static void main(String[] args) throws Exception { + asyncCreatePartition(); + } + + public static void asyncCreatePartition() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + CreatePartitionRequest request = + CreatePartitionRequest.newBuilder() + .setParent( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]") + .toString()) + .setPartition(Partition.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = + metadataServiceClient.createPartitionCallable().futureCall(request); + // Do something. + Partition response = future.get(); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_createpartition_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/SyncCreatePartition.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/SyncCreatePartition.java new file mode 100644 index 0000000..2b70837 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/SyncCreatePartition.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_createpartition_sync] +import com.google.cloud.dataplex.v1.CreatePartitionRequest; +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; + +public class SyncCreatePartition { + + public static void main(String[] args) throws Exception { + syncCreatePartition(); + } + + public static void syncCreatePartition() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + CreatePartitionRequest request = + CreatePartitionRequest.newBuilder() + .setParent( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]") + .toString()) + .setPartition(Partition.newBuilder().build()) + .setValidateOnly(true) + .build(); + Partition response = metadataServiceClient.createPartition(request); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_createpartition_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/SyncCreatePartitionEntitynamePartition.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/SyncCreatePartitionEntitynamePartition.java new file mode 100644 index 0000000..dc01fd0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/SyncCreatePartitionEntitynamePartition.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_createpartition_entitynamepartition_sync] +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; + +public class SyncCreatePartitionEntitynamePartition { + + public static void main(String[] args) throws Exception { + syncCreatePartitionEntitynamePartition(); + } + + public static void syncCreatePartitionEntitynamePartition() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + EntityName parent = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + Partition partition = Partition.newBuilder().build(); + Partition response = metadataServiceClient.createPartition(parent, partition); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_createpartition_entitynamepartition_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/SyncCreatePartitionStringPartition.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/SyncCreatePartitionStringPartition.java new file mode 100644 index 0000000..a4cc01b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/createpartition/SyncCreatePartitionStringPartition.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_createpartition_stringpartition_sync] +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; + +public class SyncCreatePartitionStringPartition { + + public static void main(String[] args) throws Exception { + syncCreatePartitionStringPartition(); + } + + public static void syncCreatePartitionStringPartition() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + String parent = + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]").toString(); + Partition partition = Partition.newBuilder().build(); + Partition response = metadataServiceClient.createPartition(parent, partition); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_createpartition_stringpartition_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/AsyncDeleteEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/AsyncDeleteEntity.java new file mode 100644 index 0000000..a674416 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/AsyncDeleteEntity.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_deleteentity_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DeleteEntityRequest; +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteEntity { + + public static void main(String[] args) throws Exception { + asyncDeleteEntity(); + } + + public static void asyncDeleteEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + DeleteEntityRequest request = + DeleteEntityRequest.newBuilder() + .setName( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]") + .toString()) + .setEtag("etag3123477") + .build(); + ApiFuture future = metadataServiceClient.deleteEntityCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_deleteentity_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/SyncDeleteEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/SyncDeleteEntity.java new file mode 100644 index 0000000..da19aaf --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/SyncDeleteEntity.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_deleteentity_sync] +import com.google.cloud.dataplex.v1.DeleteEntityRequest; +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEntity { + + public static void main(String[] args) throws Exception { + syncDeleteEntity(); + } + + public static void syncDeleteEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + DeleteEntityRequest request = + DeleteEntityRequest.newBuilder() + .setName( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]") + .toString()) + .setEtag("etag3123477") + .build(); + metadataServiceClient.deleteEntity(request); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_deleteentity_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/SyncDeleteEntityEntityname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/SyncDeleteEntityEntityname.java new file mode 100644 index 0000000..1f65af6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/SyncDeleteEntityEntityname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_deleteentity_entityname_sync] +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEntityEntityname { + + public static void main(String[] args) throws Exception { + syncDeleteEntityEntityname(); + } + + public static void syncDeleteEntityEntityname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + EntityName name = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + metadataServiceClient.deleteEntity(name); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_deleteentity_entityname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/SyncDeleteEntityString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/SyncDeleteEntityString.java new file mode 100644 index 0000000..efd63df --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deleteentity/SyncDeleteEntityString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_deleteentity_string_sync] +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEntityString { + + public static void main(String[] args) throws Exception { + syncDeleteEntityString(); + } + + public static void syncDeleteEntityString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + String name = + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]").toString(); + metadataServiceClient.deleteEntity(name); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_deleteentity_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/AsyncDeletePartition.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/AsyncDeletePartition.java new file mode 100644 index 0000000..f3a1744 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/AsyncDeletePartition.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_deletepartition_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.DeletePartitionRequest; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.PartitionName; +import com.google.protobuf.Empty; + +public class AsyncDeletePartition { + + public static void main(String[] args) throws Exception { + asyncDeletePartition(); + } + + public static void asyncDeletePartition() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + DeletePartitionRequest request = + DeletePartitionRequest.newBuilder() + .setName( + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]") + .toString()) + .setEtag("etag3123477") + .build(); + ApiFuture future = metadataServiceClient.deletePartitionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_deletepartition_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/SyncDeletePartition.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/SyncDeletePartition.java new file mode 100644 index 0000000..219f820 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/SyncDeletePartition.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_deletepartition_sync] +import com.google.cloud.dataplex.v1.DeletePartitionRequest; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.PartitionName; +import com.google.protobuf.Empty; + +public class SyncDeletePartition { + + public static void main(String[] args) throws Exception { + syncDeletePartition(); + } + + public static void syncDeletePartition() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + DeletePartitionRequest request = + DeletePartitionRequest.newBuilder() + .setName( + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]") + .toString()) + .setEtag("etag3123477") + .build(); + metadataServiceClient.deletePartition(request); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_deletepartition_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/SyncDeletePartitionPartitionname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/SyncDeletePartitionPartitionname.java new file mode 100644 index 0000000..2d8de8d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/SyncDeletePartitionPartitionname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_deletepartition_partitionname_sync] +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.PartitionName; +import com.google.protobuf.Empty; + +public class SyncDeletePartitionPartitionname { + + public static void main(String[] args) throws Exception { + syncDeletePartitionPartitionname(); + } + + public static void syncDeletePartitionPartitionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + PartitionName name = + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]"); + metadataServiceClient.deletePartition(name); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_deletepartition_partitionname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/SyncDeletePartitionString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/SyncDeletePartitionString.java new file mode 100644 index 0000000..3dfa741 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/deletepartition/SyncDeletePartitionString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_deletepartition_string_sync] +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.PartitionName; +import com.google.protobuf.Empty; + +public class SyncDeletePartitionString { + + public static void main(String[] args) throws Exception { + syncDeletePartitionString(); + } + + public static void syncDeletePartitionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + String name = + PartitionName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]") + .toString(); + metadataServiceClient.deletePartition(name); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_deletepartition_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/AsyncGetEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/AsyncGetEntity.java new file mode 100644 index 0000000..dec3e5c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/AsyncGetEntity.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_getentity_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.GetEntityRequest; +import com.google.cloud.dataplex.v1.MetadataServiceClient; + +public class AsyncGetEntity { + + public static void main(String[] args) throws Exception { + asyncGetEntity(); + } + + public static void asyncGetEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + GetEntityRequest request = + GetEntityRequest.newBuilder() + .setName( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]") + .toString()) + .build(); + ApiFuture future = metadataServiceClient.getEntityCallable().futureCall(request); + // Do something. + Entity response = future.get(); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_getentity_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/SyncGetEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/SyncGetEntity.java new file mode 100644 index 0000000..afadc13 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/SyncGetEntity.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_getentity_sync] +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.GetEntityRequest; +import com.google.cloud.dataplex.v1.MetadataServiceClient; + +public class SyncGetEntity { + + public static void main(String[] args) throws Exception { + syncGetEntity(); + } + + public static void syncGetEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + GetEntityRequest request = + GetEntityRequest.newBuilder() + .setName( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]") + .toString()) + .build(); + Entity response = metadataServiceClient.getEntity(request); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_getentity_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/SyncGetEntityEntityname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/SyncGetEntityEntityname.java new file mode 100644 index 0000000..d292f25 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/SyncGetEntityEntityname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_getentity_entityname_sync] +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; + +public class SyncGetEntityEntityname { + + public static void main(String[] args) throws Exception { + syncGetEntityEntityname(); + } + + public static void syncGetEntityEntityname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + EntityName name = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + Entity response = metadataServiceClient.getEntity(name); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_getentity_entityname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/SyncGetEntityString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/SyncGetEntityString.java new file mode 100644 index 0000000..e7b56ac --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getentity/SyncGetEntityString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_getentity_string_sync] +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; + +public class SyncGetEntityString { + + public static void main(String[] args) throws Exception { + syncGetEntityString(); + } + + public static void syncGetEntityString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + String name = + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]").toString(); + Entity response = metadataServiceClient.getEntity(name); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_getentity_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getlocation/AsyncGetLocation.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getlocation/AsyncGetLocation.java new file mode 100644 index 0000000..baa8603 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getlocation/AsyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_getlocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = metadataServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_getlocation_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getlocation/SyncGetLocation.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getlocation/SyncGetLocation.java new file mode 100644 index 0000000..0f55ce2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getlocation/SyncGetLocation.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_getlocation_sync] +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = metadataServiceClient.getLocation(request); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_getlocation_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/AsyncGetPartition.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/AsyncGetPartition.java new file mode 100644 index 0000000..60fb1f3 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/AsyncGetPartition.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_getpartition_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.GetPartitionRequest; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; +import com.google.cloud.dataplex.v1.PartitionName; + +public class AsyncGetPartition { + + public static void main(String[] args) throws Exception { + asyncGetPartition(); + } + + public static void asyncGetPartition() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + GetPartitionRequest request = + GetPartitionRequest.newBuilder() + .setName( + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]") + .toString()) + .build(); + ApiFuture future = + metadataServiceClient.getPartitionCallable().futureCall(request); + // Do something. + Partition response = future.get(); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_getpartition_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/SyncGetPartition.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/SyncGetPartition.java new file mode 100644 index 0000000..049422e --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/SyncGetPartition.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_getpartition_sync] +import com.google.cloud.dataplex.v1.GetPartitionRequest; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; +import com.google.cloud.dataplex.v1.PartitionName; + +public class SyncGetPartition { + + public static void main(String[] args) throws Exception { + syncGetPartition(); + } + + public static void syncGetPartition() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + GetPartitionRequest request = + GetPartitionRequest.newBuilder() + .setName( + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]") + .toString()) + .build(); + Partition response = metadataServiceClient.getPartition(request); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_getpartition_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/SyncGetPartitionPartitionname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/SyncGetPartitionPartitionname.java new file mode 100644 index 0000000..8d1744a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/SyncGetPartitionPartitionname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_getpartition_partitionname_sync] +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; +import com.google.cloud.dataplex.v1.PartitionName; + +public class SyncGetPartitionPartitionname { + + public static void main(String[] args) throws Exception { + syncGetPartitionPartitionname(); + } + + public static void syncGetPartitionPartitionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + PartitionName name = + PartitionName.of( + "[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]"); + Partition response = metadataServiceClient.getPartition(name); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_getpartition_partitionname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/SyncGetPartitionString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/SyncGetPartitionString.java new file mode 100644 index 0000000..b3d03f8 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/getpartition/SyncGetPartitionString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_getpartition_string_sync] +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; +import com.google.cloud.dataplex.v1.PartitionName; + +public class SyncGetPartitionString { + + public static void main(String[] args) throws Exception { + syncGetPartitionString(); + } + + public static void syncGetPartitionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + String name = + PartitionName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]", "[PARTITION]") + .toString(); + Partition response = metadataServiceClient.getPartition(name); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_getpartition_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/AsyncListEntities.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/AsyncListEntities.java new file mode 100644 index 0000000..de632de --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/AsyncListEntities.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listentities_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.ListEntitiesRequest; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class AsyncListEntities { + + public static void main(String[] args) throws Exception { + asyncListEntities(); + } + + public static void asyncListEntities() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + ListEntitiesRequest request = + ListEntitiesRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + metadataServiceClient.listEntitiesPagedCallable().futureCall(request); + // Do something. + for (Entity element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listentities_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/AsyncListEntitiesPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/AsyncListEntitiesPaged.java new file mode 100644 index 0000000..7a7b782 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/AsyncListEntitiesPaged.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listentities_paged_async] +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.ListEntitiesRequest; +import com.google.cloud.dataplex.v1.ListEntitiesResponse; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; +import com.google.common.base.Strings; + +public class AsyncListEntitiesPaged { + + public static void main(String[] args) throws Exception { + asyncListEntitiesPaged(); + } + + public static void asyncListEntitiesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + ListEntitiesRequest request = + ListEntitiesRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListEntitiesResponse response = metadataServiceClient.listEntitiesCallable().call(request); + for (Entity element : response.getEntitiesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listentities_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/SyncListEntities.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/SyncListEntities.java new file mode 100644 index 0000000..a79f55e --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/SyncListEntities.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listentities_sync] +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.ListEntitiesRequest; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncListEntities { + + public static void main(String[] args) throws Exception { + syncListEntities(); + } + + public static void syncListEntities() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + ListEntitiesRequest request = + ListEntitiesRequest.newBuilder() + .setParent(ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (Entity element : metadataServiceClient.listEntities(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listentities_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/SyncListEntitiesString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/SyncListEntitiesString.java new file mode 100644 index 0000000..48fd580 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/SyncListEntitiesString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listentities_string_sync] +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncListEntitiesString { + + public static void main(String[] args) throws Exception { + syncListEntitiesString(); + } + + public static void syncListEntitiesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + String parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]").toString(); + for (Entity element : metadataServiceClient.listEntities(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listentities_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/SyncListEntitiesZonename.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/SyncListEntitiesZonename.java new file mode 100644 index 0000000..dd621eb --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listentities/SyncListEntitiesZonename.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listentities_zonename_sync] +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.ZoneName; + +public class SyncListEntitiesZonename { + + public static void main(String[] args) throws Exception { + syncListEntitiesZonename(); + } + + public static void syncListEntitiesZonename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + ZoneName parent = ZoneName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"); + for (Entity element : metadataServiceClient.listEntities(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listentities_zonename_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listlocations/AsyncListLocations.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listlocations/AsyncListLocations.java new file mode 100644 index 0000000..242089a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listlocations/AsyncListLocations.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listlocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + metadataServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listlocations_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listlocations/AsyncListLocationsPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 0000000..fa966b7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listlocations_paged_async] +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + metadataServiceClient.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; + } + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listlocations_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listlocations/SyncListLocations.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listlocations/SyncListLocations.java new file mode 100644 index 0000000..0cd620a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listlocations/SyncListLocations.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listlocations_sync] +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : metadataServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listlocations_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/AsyncListPartitions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/AsyncListPartitions.java new file mode 100644 index 0000000..eacdf32 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/AsyncListPartitions.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listpartitions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.ListPartitionsRequest; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; + +public class AsyncListPartitions { + + public static void main(String[] args) throws Exception { + asyncListPartitions(); + } + + public static void asyncListPartitions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + ListPartitionsRequest request = + ListPartitionsRequest.newBuilder() + .setParent( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + metadataServiceClient.listPartitionsPagedCallable().futureCall(request); + // Do something. + for (Partition element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listpartitions_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/AsyncListPartitionsPaged.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/AsyncListPartitionsPaged.java new file mode 100644 index 0000000..ac7cc68 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/AsyncListPartitionsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listpartitions_paged_async] +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.ListPartitionsRequest; +import com.google.cloud.dataplex.v1.ListPartitionsResponse; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; +import com.google.common.base.Strings; + +public class AsyncListPartitionsPaged { + + public static void main(String[] args) throws Exception { + asyncListPartitionsPaged(); + } + + public static void asyncListPartitionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + ListPartitionsRequest request = + ListPartitionsRequest.newBuilder() + .setParent( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListPartitionsResponse response = + metadataServiceClient.listPartitionsCallable().call(request); + for (Partition element : response.getPartitionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listpartitions_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/SyncListPartitions.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/SyncListPartitions.java new file mode 100644 index 0000000..831b9c5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/SyncListPartitions.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listpartitions_sync] +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.ListPartitionsRequest; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; + +public class SyncListPartitions { + + public static void main(String[] args) throws Exception { + syncListPartitions(); + } + + public static void syncListPartitions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + ListPartitionsRequest request = + ListPartitionsRequest.newBuilder() + .setParent( + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (Partition element : metadataServiceClient.listPartitions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listpartitions_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/SyncListPartitionsEntityname.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/SyncListPartitionsEntityname.java new file mode 100644 index 0000000..a912c7b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/SyncListPartitionsEntityname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listpartitions_entityname_sync] +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; + +public class SyncListPartitionsEntityname { + + public static void main(String[] args) throws Exception { + syncListPartitionsEntityname(); + } + + public static void syncListPartitionsEntityname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + EntityName parent = EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]"); + for (Partition element : metadataServiceClient.listPartitions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listpartitions_entityname_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/SyncListPartitionsString.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/SyncListPartitionsString.java new file mode 100644 index 0000000..28a6bb7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/listpartitions/SyncListPartitionsString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_listpartitions_string_sync] +import com.google.cloud.dataplex.v1.EntityName; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.Partition; + +public class SyncListPartitionsString { + + public static void main(String[] args) throws Exception { + syncListPartitionsString(); + } + + public static void syncListPartitionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + String parent = + EntityName.of("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]", "[ENTITY]").toString(); + for (Partition element : metadataServiceClient.listPartitions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_listpartitions_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/updateentity/AsyncUpdateEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/updateentity/AsyncUpdateEntity.java new file mode 100644 index 0000000..62a28e1 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/updateentity/AsyncUpdateEntity.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_updateentity_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.UpdateEntityRequest; + +public class AsyncUpdateEntity { + + public static void main(String[] args) throws Exception { + asyncUpdateEntity(); + } + + public static void asyncUpdateEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + UpdateEntityRequest request = + UpdateEntityRequest.newBuilder() + .setEntity(Entity.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = metadataServiceClient.updateEntityCallable().futureCall(request); + // Do something. + Entity response = future.get(); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_updateentity_async] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/updateentity/SyncUpdateEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/updateentity/SyncUpdateEntity.java new file mode 100644 index 0000000..5a05a1d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataserviceclient/updateentity/SyncUpdateEntity.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataserviceclient_updateentity_sync] +import com.google.cloud.dataplex.v1.Entity; +import com.google.cloud.dataplex.v1.MetadataServiceClient; +import com.google.cloud.dataplex.v1.UpdateEntityRequest; + +public class SyncUpdateEntity { + + public static void main(String[] args) throws Exception { + syncUpdateEntity(); + } + + public static void syncUpdateEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetadataServiceClient metadataServiceClient = MetadataServiceClient.create()) { + UpdateEntityRequest request = + UpdateEntityRequest.newBuilder() + .setEntity(Entity.newBuilder().build()) + .setValidateOnly(true) + .build(); + Entity response = metadataServiceClient.updateEntity(request); + } + } +} +// [END dataplex_v1_generated_metadataserviceclient_updateentity_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataservicesettings/createentity/SyncCreateEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataservicesettings/createentity/SyncCreateEntity.java new file mode 100644 index 0000000..3771601 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/metadataservicesettings/createentity/SyncCreateEntity.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.samples; + +// [START dataplex_v1_generated_metadataservicesettings_createentity_sync] +import com.google.cloud.dataplex.v1.MetadataServiceSettings; +import java.time.Duration; + +public class SyncCreateEntity { + + public static void main(String[] args) throws Exception { + syncCreateEntity(); + } + + public static void syncCreateEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + MetadataServiceSettings.Builder metadataServiceSettingsBuilder = + MetadataServiceSettings.newBuilder(); + metadataServiceSettingsBuilder + .createEntitySettings() + .setRetrySettings( + metadataServiceSettingsBuilder + .createEntitySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + MetadataServiceSettings metadataServiceSettings = metadataServiceSettingsBuilder.build(); + } +} +// [END dataplex_v1_generated_metadataservicesettings_createentity_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/stub/contentservicestubsettings/createcontent/SyncCreateContent.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/stub/contentservicestubsettings/createcontent/SyncCreateContent.java new file mode 100644 index 0000000..477f5ab --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/stub/contentservicestubsettings/createcontent/SyncCreateContent.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.stub.samples; + +// [START dataplex_v1_generated_contentservicestubsettings_createcontent_sync] +import com.google.cloud.dataplex.v1.stub.ContentServiceStubSettings; +import java.time.Duration; + +public class SyncCreateContent { + + public static void main(String[] args) throws Exception { + syncCreateContent(); + } + + public static void syncCreateContent() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ContentServiceStubSettings.Builder contentServiceSettingsBuilder = + ContentServiceStubSettings.newBuilder(); + contentServiceSettingsBuilder + .createContentSettings() + .setRetrySettings( + contentServiceSettingsBuilder + .createContentSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ContentServiceStubSettings contentServiceSettings = contentServiceSettingsBuilder.build(); + } +} +// [END dataplex_v1_generated_contentservicestubsettings_createcontent_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/stub/dataplexservicestubsettings/getlake/SyncGetLake.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/stub/dataplexservicestubsettings/getlake/SyncGetLake.java new file mode 100644 index 0000000..16376fe --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/stub/dataplexservicestubsettings/getlake/SyncGetLake.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.stub.samples; + +// [START dataplex_v1_generated_dataplexservicestubsettings_getlake_sync] +import com.google.cloud.dataplex.v1.stub.DataplexServiceStubSettings; +import java.time.Duration; + +public class SyncGetLake { + + public static void main(String[] args) throws Exception { + syncGetLake(); + } + + public static void syncGetLake() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + DataplexServiceStubSettings.Builder dataplexServiceSettingsBuilder = + DataplexServiceStubSettings.newBuilder(); + dataplexServiceSettingsBuilder + .getLakeSettings() + .setRetrySettings( + dataplexServiceSettingsBuilder + .getLakeSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + DataplexServiceStubSettings dataplexServiceSettings = dataplexServiceSettingsBuilder.build(); + } +} +// [END dataplex_v1_generated_dataplexservicestubsettings_getlake_sync] diff --git a/samples/snippets/generated/com/google/cloud/dataplex/v1/stub/metadataservicestubsettings/createentity/SyncCreateEntity.java b/samples/snippets/generated/com/google/cloud/dataplex/v1/stub/metadataservicestubsettings/createentity/SyncCreateEntity.java new file mode 100644 index 0000000..2178af1 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/dataplex/v1/stub/metadataservicestubsettings/createentity/SyncCreateEntity.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.stub.samples; + +// [START dataplex_v1_generated_metadataservicestubsettings_createentity_sync] +import com.google.cloud.dataplex.v1.stub.MetadataServiceStubSettings; +import java.time.Duration; + +public class SyncCreateEntity { + + public static void main(String[] args) throws Exception { + syncCreateEntity(); + } + + public static void syncCreateEntity() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + MetadataServiceStubSettings.Builder metadataServiceSettingsBuilder = + MetadataServiceStubSettings.newBuilder(); + metadataServiceSettingsBuilder + .createEntitySettings() + .setRetrySettings( + metadataServiceSettingsBuilder + .createEntitySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + MetadataServiceStubSettings metadataServiceSettings = metadataServiceSettingsBuilder.build(); + } +} +// [END dataplex_v1_generated_metadataservicestubsettings_createentity_sync]