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 index 592055c5..9247e11f 100644 --- 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 @@ -42,6 +42,16 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
+ *     AutoscalingPolicyServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ *   AutoscalingPolicy response =
+ *       autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, 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(). @@ -150,6 +160,18 @@ public AutoscalingPolicyServiceStub getStub() { /** * Creates new autoscaling policy. * + *

Sample code: + * + *

{@code
+   * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
+   *     AutoscalingPolicyServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+   *   AutoscalingPolicy response =
+   *       autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy);
+   * }
+   * }
+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *