diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh index e92658bc..4c8806b1 100755 --- a/.kokoro/linkage-monitor.sh +++ b/.kokoro/linkage-monitor.sh @@ -23,7 +23,12 @@ cd github/java-dataproc/ java -version echo ${JOB_TYPE} -mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true # Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR JAR=linkage-monitor-latest-all-deps.jar diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java new file mode 100644 index 00000000..bca2309b --- /dev/null +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java @@ -0,0 +1,701 @@ +/* + * Copyright 2020 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.dataproc.v1; + +import com.google.api.core.ApiFunction; +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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dataproc.v1.stub.AutoscalingPolicyServiceStub; +import com.google.cloud.dataproc.v1.stub.AutoscalingPolicyServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: The API interface for managing autoscaling policies in the Dataproc API. + * + *
This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
+ *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(formattedParent, policy);
+ * }
+ *
+ *
+ *
+ * Note: close() needs to be called on the autoscalingPolicyServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of + * AutoscalingPolicyServiceSettings to create(). For example: + * + *
To customize credentials: + * + *
+ *
+ * AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings =
+ * AutoscalingPolicyServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
+ * AutoscalingPolicyServiceClient.create(autoscalingPolicyServiceSettings);
+ *
+ *
+ *
+ * To customize the endpoint:
+ *
+ *
+ *
+ * AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings =
+ * AutoscalingPolicyServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
+ * AutoscalingPolicyServiceClient.create(autoscalingPolicyServiceSettings);
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class AutoscalingPolicyServiceClient implements BackgroundResource {
+ private final AutoscalingPolicyServiceSettings settings;
+ private final AutoscalingPolicyServiceStub stub;
+
+ /** Constructs an instance of AutoscalingPolicyServiceClient with default settings. */
+ public static final AutoscalingPolicyServiceClient create() throws IOException {
+ return create(AutoscalingPolicyServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of AutoscalingPolicyServiceClient, using the given settings. The
+ * channels are created based on the settings passed in, or defaults for any settings that are not
+ * set.
+ */
+ public static final AutoscalingPolicyServiceClient create(
+ AutoscalingPolicyServiceSettings settings) throws IOException {
+ return new AutoscalingPolicyServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of AutoscalingPolicyServiceClient, using the given stub for making
+ * calls. This is for advanced usage - prefer to use AutoscalingPolicyServiceSettings}.
+ */
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final AutoscalingPolicyServiceClient create(AutoscalingPolicyServiceStub stub) {
+ return new AutoscalingPolicyServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of AutoscalingPolicyServiceClient, 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 AutoscalingPolicyServiceClient(AutoscalingPolicyServiceSettings settings)
+ throws IOException {
+ this.settings = settings;
+ this.stub = ((AutoscalingPolicyServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected AutoscalingPolicyServiceClient(AutoscalingPolicyServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final AutoscalingPolicyServiceSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public AutoscalingPolicyServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates new autoscaling policy.
+ *
+ * Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(formattedParent, policy);
+ * }
+ *
+ *
+ * @param parent Required. The "resource name" of the region or location, as described in
+ * https://cloud.google.com/apis/design/resource_names.
+ * * For `projects.regions.autoscalingPolicies.create`, the resource name of the region + * has the following format: `projects/{project_id}/regions/{region}` + *
* For `projects.locations.autoscalingPolicies.create`, the resource name of the + * location has the following format: `projects/{project_id}/locations/{location}` + * @param policy The autoscaling policy to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AutoscalingPolicy createAutoscalingPolicy(String parent, AutoscalingPolicy policy) { + CreateAutoscalingPolicyRequest request = + CreateAutoscalingPolicyRequest.newBuilder().setParent(parent).setPolicy(policy).build(); + return createAutoscalingPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates new autoscaling policy. + * + *
Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ * CreateAutoscalingPolicyRequest request = CreateAutoscalingPolicyRequest.newBuilder()
+ * .setParent(formattedParent)
+ * .setPolicy(policy)
+ * .build();
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(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 AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRequest request) {
+ return createAutoscalingPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates new autoscaling policy.
+ *
+ * Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ * CreateAutoscalingPolicyRequest request = CreateAutoscalingPolicyRequest.newBuilder()
+ * .setParent(formattedParent)
+ * .setPolicy(policy)
+ * .build();
+ * ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.createAutoscalingPolicyCallable().futureCall(request);
+ * // Do something
+ * AutoscalingPolicy response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableDisabled check for update_mask, because all updates will be full replacements. + * + *
Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
+ * }
+ *
+ *
+ * @param policy Required. The updated autoscaling policy.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) {
+ UpdateAutoscalingPolicyRequest request =
+ UpdateAutoscalingPolicyRequest.newBuilder().setPolicy(policy).build();
+ return updateAutoscalingPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates (replaces) autoscaling policy.
+ *
+ * Disabled check for update_mask, because all updates will be full replacements. + * + *
Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ * UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
+ * .setPolicy(policy)
+ * .build();
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(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 AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request) {
+ return updateAutoscalingPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates (replaces) autoscaling policy.
+ *
+ * Disabled check for update_mask, because all updates will be full replacements. + * + *
Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ * UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
+ * .setPolicy(policy)
+ * .build();
+ * ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request);
+ * // Do something
+ * AutoscalingPolicy response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(formattedName);
+ * }
+ *
+ *
+ * @param name Required. The "resource name" of the autoscaling policy, as described in
+ * https://cloud.google.com/apis/design/resource_names.
+ * * For `projects.regions.autoscalingPolicies.get`, the resource name of the policy + * has the following format: + * `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + *
* For `projects.locations.autoscalingPolicies.get`, the resource name of the policy + * has the following format: + * `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AutoscalingPolicy getAutoscalingPolicy(String name) { + GetAutoscalingPolicyRequest request = + GetAutoscalingPolicyRequest.newBuilder().setName(name).build(); + return getAutoscalingPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves autoscaling policy. + * + *
Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * GetAutoscalingPolicyRequest request = GetAutoscalingPolicyRequest.newBuilder()
+ * .setName(formattedName)
+ * .build();
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(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 AutoscalingPolicy getAutoscalingPolicy(GetAutoscalingPolicyRequest request) {
+ return getAutoscalingPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves autoscaling policy.
+ *
+ * Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * GetAutoscalingPolicyRequest request = GetAutoscalingPolicyRequest.newBuilder()
+ * .setName(formattedName)
+ * .build();
+ * ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.getAutoscalingPolicyCallable().futureCall(request);
+ * // Do something
+ * AutoscalingPolicy response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * for (AutoscalingPolicy element : autoscalingPolicyServiceClient.listAutoscalingPolicies(formattedParent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The "resource name" of the region or location, as described in
+ * https://cloud.google.com/apis/design/resource_names.
+ * * For `projects.regions.autoscalingPolicies.list`, the resource name of the region + * has the following format: `projects/{project_id}/regions/{region}` + *
* For `projects.locations.autoscalingPolicies.list`, the resource name of the + * location has the following format: `projects/{project_id}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(String parent) { + ListAutoscalingPoliciesRequest request = + ListAutoscalingPoliciesRequest.newBuilder().setParent(parent).build(); + return listAutoscalingPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists autoscaling policies in the project. + * + *
Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * ListAutoscalingPoliciesRequest request = ListAutoscalingPoliciesRequest.newBuilder()
+ * .setParent(formattedParent)
+ * .build();
+ * for (AutoscalingPolicy element : autoscalingPolicyServiceClient.listAutoscalingPolicies(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 ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
+ ListAutoscalingPoliciesRequest request) {
+ return listAutoscalingPoliciesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists autoscaling policies in the project.
+ *
+ * Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * ListAutoscalingPoliciesRequest request = ListAutoscalingPoliciesRequest.newBuilder()
+ * .setParent(formattedParent)
+ * .build();
+ * ApiFuture<ListAutoscalingPoliciesPagedResponse> future = autoscalingPolicyServiceClient.listAutoscalingPoliciesPagedCallable().futureCall(request);
+ * // Do something
+ * for (AutoscalingPolicy element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * ListAutoscalingPoliciesRequest request = ListAutoscalingPoliciesRequest.newBuilder()
+ * .setParent(formattedParent)
+ * .build();
+ * while (true) {
+ * ListAutoscalingPoliciesResponse response = autoscalingPolicyServiceClient.listAutoscalingPoliciesCallable().call(request);
+ * for (AutoscalingPolicy element : response.getPoliciesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * autoscalingPolicyServiceClient.deleteAutoscalingPolicy(formattedName);
+ * }
+ *
+ *
+ * @param name Required. The "resource name" of the autoscaling policy, as described in
+ * https://cloud.google.com/apis/design/resource_names.
+ * * For `projects.regions.autoscalingPolicies.delete`, the resource name of the policy + * has the following format: + * `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + *
* For `projects.locations.autoscalingPolicies.delete`, the resource name of the + * policy has the following format: + * `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAutoscalingPolicy(String name) { + DeleteAutoscalingPolicyRequest request = + DeleteAutoscalingPolicyRequest.newBuilder().setName(name).build(); + deleteAutoscalingPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by + * one or more clusters. + * + *
Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * DeleteAutoscalingPolicyRequest request = DeleteAutoscalingPolicyRequest.newBuilder()
+ * .setName(formattedName)
+ * .build();
+ * autoscalingPolicyServiceClient.deleteAutoscalingPolicy(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 void deleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest request) {
+ deleteAutoscalingPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by
+ * one or more clusters.
+ *
+ * Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * DeleteAutoscalingPolicyRequest request = DeleteAutoscalingPolicyRequest.newBuilder()
+ * .setName(formattedName)
+ * .build();
+ * ApiFuture<Void> future = autoscalingPolicyServiceClient.deleteAutoscalingPolicyCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallableThe default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of createAutoscalingPolicy to 30 seconds: + * + *
+ *
+ * AutoscalingPolicyServiceSettings.Builder autoscalingPolicyServiceSettingsBuilder =
+ * AutoscalingPolicyServiceSettings.newBuilder();
+ * autoscalingPolicyServiceSettingsBuilder.createAutoscalingPolicySettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30));
+ * AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings = autoscalingPolicyServiceSettingsBuilder.build();
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class AutoscalingPolicyServiceSettings
+ extends ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction Service Description: The API interface for managing autoscaling policies in the Dataproc API.
+ *
+ * Sample for AutoscalingPolicyServiceClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator")
+@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+public abstract class AutoscalingPolicyServiceStub implements BackgroundResource {
+
+ public UnaryCallable The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of createAutoscalingPolicy to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@Generated("by gapic-generator")
+@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+public class GrpcAutoscalingPolicyServiceCallableFactory implements GrpcStubCallableFactory {
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator")
+@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+public class GrpcAutoscalingPolicyServiceStub extends AutoscalingPolicyServiceStub {
+
+ private static final MethodDescriptor
+ *
*/
@Generated("by gapic-generator")
package com.google.cloud.dataproc.v1;
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java
new file mode 100644
index 00000000..a06777bd
--- /dev/null
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2020 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.dataproc.v1.stub;
+
+import static com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient.ListAutoscalingPoliciesPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.dataproc.v1.AutoscalingPolicy;
+import com.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest;
+import com.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest;
+import com.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest;
+import com.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest;
+import com.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse;
+import com.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * Base stub class for Google Cloud Dataproc API.
+ *
+ *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(formattedParent, policy);
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class AutoscalingPolicyServiceStubSettings
+ extends StubSettings
+ * AutoscalingPolicyServiceStubSettings.Builder autoscalingPolicyServiceSettingsBuilder =
+ * AutoscalingPolicyServiceStubSettings.newBuilder();
+ * autoscalingPolicyServiceSettingsBuilder.createAutoscalingPolicySettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30));
+ * AutoscalingPolicyServiceStubSettings autoscalingPolicyServiceSettings = autoscalingPolicyServiceSettingsBuilder.build();
+ *
+ *