From bb356719e818b896259f399c084092c056549a6a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 8 Feb 2021 16:42:09 -0800 Subject: [PATCH] docs: generate sample code in the Java microgenerator (#437) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/2eb44d9f-9230-443a-a6c3-d1d42a6b9d96/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 356341083 Source-Link: https://github.com/googleapis/googleapis/commit/8d8c008e56f1af31d57f75561e0f1848ffb29eeb --- .../v1/AutoscalingPolicyServiceClient.java | 340 +++++++++++ .../dataproc/v1/ClusterControllerClient.java | 377 ++++++++++++ .../dataproc/v1/JobControllerClient.java | 337 +++++++++++ .../v1/WorkflowTemplateServiceClient.java | 553 +++++++++++++++++ .../cloud/dataproc/v1/package-info.java | 38 ++ .../AutoscalingPolicyServiceClient.java | 340 +++++++++++ .../v1beta2/ClusterControllerClient.java | 376 ++++++++++++ .../dataproc/v1beta2/JobControllerClient.java | 337 +++++++++++ .../WorkflowTemplateServiceClient.java | 559 ++++++++++++++++++ .../cloud/dataproc/v1beta2/package-info.java | 38 ++ synth.metadata | 10 +- 11 files changed, 3300 insertions(+), 5 deletions(-) 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. *