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 bca2309b..bc2cb235 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 @@ -44,9 +44,8 @@ *
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(formattedParent, policy);
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
* }
*
*
@@ -160,155 +159,217 @@ public AutoscalingPolicyServiceStub getStub() {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates new autoscaling policy.
+ * Updates (replaces) autoscaling policy.
+ *
+ * Disabled check for update_mask, because all updates will be full replacements. * *
Sample code: * *
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(formattedParent, policy);
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(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. + * @param policy Required. The updated autoscaling policy. * @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); + public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) { + UpdateAutoscalingPolicyRequest request = + UpdateAutoscalingPolicyRequest.newBuilder().setPolicy(policy).build(); + return updateAutoscalingPolicy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates new autoscaling policy. + * Updates (replaces) autoscaling policy. + * + *
Disabled check for update_mask, because all updates will be full replacements. * *
Sample code: * *
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * CreateAutoscalingPolicyRequest request = CreateAutoscalingPolicyRequest.newBuilder()
- * .setParent(formattedParent)
+ * UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
* .setPolicy(policy)
* .build();
- * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(request);
+ * 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 createAutoscalingPolicy(CreateAutoscalingPolicyRequest request) {
- return createAutoscalingPolicyCallable().call(request);
+ public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request) {
+ return updateAutoscalingPolicyCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates new autoscaling policy.
+ * Updates (replaces) autoscaling policy.
+ *
+ * Disabled check for update_mask, because all updates will be full replacements. * *
Sample code: * *
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * CreateAutoscalingPolicyRequest request = CreateAutoscalingPolicyRequest.newBuilder()
- * .setParent(formattedParent)
+ * UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
* .setPolicy(policy)
* .build();
- * ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.createAutoscalingPolicyCallable().futureCall(request);
+ * ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request);
* // Do something
* AutoscalingPolicy response = future.get();
* }
*
*/
- public final UnaryCallableDisabled check for update_mask, because all updates will be full replacements. + * Creates new autoscaling policy. * *
Sample code: * *
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy);
* }
*
*
- * @param policy Required. The updated autoscaling 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 updateAutoscalingPolicy(AutoscalingPolicy policy) { - UpdateAutoscalingPolicyRequest request = - UpdateAutoscalingPolicyRequest.newBuilder().setPolicy(policy).build(); - return updateAutoscalingPolicy(request); + public final AutoscalingPolicy createAutoscalingPolicy( + RegionName parent, AutoscalingPolicy policy) { + CreateAutoscalingPolicyRequest request = + CreateAutoscalingPolicyRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setPolicy(policy) + .build(); + return createAutoscalingPolicy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates (replaces) autoscaling policy. + * Creates new autoscaling policy. * - *
Disabled check for update_mask, because all updates will be full replacements. + *
Sample 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.
+ * * 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( + LocationName parent, AutoscalingPolicy policy) { + CreateAutoscalingPolicyRequest request = + CreateAutoscalingPolicyRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setPolicy(policy) + .build(); + return createAutoscalingPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates new autoscaling policy. * *
Sample code: * *
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
- * .setPolicy(policy)
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(parent.toString(), 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()) {
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+ * CreateAutoscalingPolicyRequest request = CreateAutoscalingPolicyRequest.newBuilder()
+ * .setParent(parent.toString())
* .build();
- * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(request);
+ * 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 updateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request) {
- return updateAutoscalingPolicyCallable().call(request);
+ public final AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRequest request) {
+ return createAutoscalingPolicyCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Updates (replaces) autoscaling policy.
- *
- * Disabled check for update_mask, because all updates will be full replacements. + * Creates new autoscaling policy. * *
Sample code: * *
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
- * .setPolicy(policy)
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+ * CreateAutoscalingPolicyRequest request = CreateAutoscalingPolicyRequest.newBuilder()
+ * .setParent(parent.toString())
* .build();
- * ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request);
+ * ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.createAutoscalingPolicyCallable().futureCall(request);
* // Do something
* AutoscalingPolicy response = future.get();
* }
*
*/
- public final UnaryCallable
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
- * AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(formattedName);
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(name);
+ * }
+ *
+ *
+ * @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(AutoscalingPolicyName name) { + GetAutoscalingPolicyRequest request = + GetAutoscalingPolicyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getAutoscalingPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves autoscaling policy. + * + *
Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(name.toString());
* }
*
*
@@ -348,9 +440,9 @@ public final AutoscalingPolicy getAutoscalingPolicy(String name) {
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* GetAutoscalingPolicyRequest request = GetAutoscalingPolicyRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .build();
* AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(request);
* }
@@ -371,9 +463,9 @@ public final AutoscalingPolicy getAutoscalingPolicy(GetAutoscalingPolicyRequest
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* GetAutoscalingPolicyRequest request = GetAutoscalingPolicyRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .build();
* ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.getAutoscalingPolicyCallable().futureCall(request);
* // Do something
@@ -394,8 +486,70 @@ public final AutoscalingPolicy getAutoscalingPolicy(GetAutoscalingPolicyRequest
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
- * for (AutoscalingPolicy element : autoscalingPolicyServiceClient.listAutoscalingPolicies(formattedParent).iterateAll()) {
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+ * for (AutoscalingPolicy element : autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).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(RegionName parent) {
+ ListAutoscalingPoliciesRequest request =
+ ListAutoscalingPoliciesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listAutoscalingPolicies(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists autoscaling policies in the project.
+ *
+ *
Sample code:
+ *
+ *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (AutoscalingPolicy element : autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).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(LocationName parent) {
+ ListAutoscalingPoliciesRequest request =
+ ListAutoscalingPoliciesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listAutoscalingPolicies(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists autoscaling policies in the project.
+ *
+ *
Sample code:
+ *
+ *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+ * for (AutoscalingPolicy element : autoscalingPolicyServiceClient.listAutoscalingPolicies(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -423,9 +577,9 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(String
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
* ListAutoscalingPoliciesRequest request = ListAutoscalingPoliciesRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* for (AutoscalingPolicy element : autoscalingPolicyServiceClient.listAutoscalingPolicies(request).iterateAll()) {
* // doThingsWith(element);
@@ -449,9 +603,9 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
* ListAutoscalingPoliciesRequest request = ListAutoscalingPoliciesRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* ApiFuture<ListAutoscalingPoliciesPagedResponse> future = autoscalingPolicyServiceClient.listAutoscalingPoliciesPagedCallable().futureCall(request);
* // Do something
@@ -474,9 +628,9 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
* ListAutoscalingPoliciesRequest request = ListAutoscalingPoliciesRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* while (true) {
* ListAutoscalingPoliciesResponse response = autoscalingPolicyServiceClient.listAutoscalingPoliciesCallable().call(request);
@@ -507,8 +661,40 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
- * autoscalingPolicyServiceClient.deleteAutoscalingPolicy(formattedName);
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
+ * autoscalingPolicyServiceClient.deleteAutoscalingPolicy(name);
+ * }
+ *
+ *
+ * @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(AutoscalingPolicyName name) {
+ DeleteAutoscalingPolicyRequest request =
+ DeleteAutoscalingPolicyRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .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()) {
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
+ * autoscalingPolicyServiceClient.deleteAutoscalingPolicy(name.toString());
* }
*
*
@@ -537,9 +723,9 @@ public final void deleteAutoscalingPolicy(String name) {
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* DeleteAutoscalingPolicyRequest request = DeleteAutoscalingPolicyRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .build();
* autoscalingPolicyServiceClient.deleteAutoscalingPolicy(request);
* }
@@ -561,9 +747,9 @@ public final void deleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest request
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedName = AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* DeleteAutoscalingPolicyRequest request = DeleteAutoscalingPolicyRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .build();
* ApiFuture<Void> future = autoscalingPolicyServiceClient.deleteAutoscalingPolicyCallable().futureCall(request);
* // Do something
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java
index 36d59fbf..5bd24dff 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java
@@ -49,16 +49,16 @@
* 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:
+ *
For example, to set the total timeout of updateAutoscalingPolicy to 30 seconds:
*
*
*
* AutoscalingPolicyServiceSettings.Builder autoscalingPolicyServiceSettingsBuilder =
* AutoscalingPolicyServiceSettings.newBuilder();
* autoscalingPolicyServiceSettingsBuilder
- * .createAutoscalingPolicySettings()
+ * .updateAutoscalingPolicySettings()
* .setRetrySettings(
- * autoscalingPolicyServiceSettingsBuilder.createAutoscalingPolicySettings().getRetrySettings().toBuilder()
+ * autoscalingPolicyServiceSettingsBuilder.updateAutoscalingPolicySettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings = autoscalingPolicyServiceSettingsBuilder.build();
@@ -69,13 +69,6 @@
@BetaApi
public class AutoscalingPolicyServiceSettings
extends ClientSettings {
- /** Returns the object with the settings used for calls to createAutoscalingPolicy. */
- public UnaryCallSettings
- createAutoscalingPolicySettings() {
- return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
- .createAutoscalingPolicySettings();
- }
-
/** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
public UnaryCallSettings
updateAutoscalingPolicySettings() {
@@ -83,6 +76,13 @@ public class AutoscalingPolicyServiceSettings
.updateAutoscalingPolicySettings();
}
+ /** Returns the object with the settings used for calls to createAutoscalingPolicy. */
+ public UnaryCallSettings
+ createAutoscalingPolicySettings() {
+ return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
+ .createAutoscalingPolicySettings();
+ }
+
/** Returns the object with the settings used for calls to getAutoscalingPolicy. */
public UnaryCallSettings
getAutoscalingPolicySettings() {
@@ -205,18 +205,18 @@ public Builder applyToAllUnaryMethods(
return this;
}
- /** Returns the builder for the settings used for calls to createAutoscalingPolicy. */
- public UnaryCallSettings.Builder
- createAutoscalingPolicySettings() {
- return getStubSettingsBuilder().createAutoscalingPolicySettings();
- }
-
/** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
public UnaryCallSettings.Builder
updateAutoscalingPolicySettings() {
return getStubSettingsBuilder().updateAutoscalingPolicySettings();
}
+ /** Returns the builder for the settings used for calls to createAutoscalingPolicy. */
+ public UnaryCallSettings.Builder
+ createAutoscalingPolicySettings() {
+ return getStubSettingsBuilder().createAutoscalingPolicySettings();
+ }
+
/** Returns the builder for the settings used for calls to getAutoscalingPolicy. */
public UnaryCallSettings.Builder
getAutoscalingPolicySettings() {
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java
index 8db2a56e..ec3d964c 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java
@@ -208,6 +208,39 @@ public final WorkflowTemplate createWorkflowTemplate(
return createWorkflowTemplate(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates new workflow template.
+ *
+ * Sample code:
+ *
+ *
+ * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+ * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
+ * }
+ *
+ *
+ * @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.workflowTemplates,create`, the resource name of the region
+ * has the following format: `projects/{project_id}/regions/{region}`
+ *
* For `projects.locations.workflowTemplates.create`, the resource name of the
+ * location has the following format: `projects/{project_id}/locations/{location}`
+ * @param template Required. The Dataproc workflow template to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final WorkflowTemplate createWorkflowTemplate(
+ LocationName parent, WorkflowTemplate template) {
+ CreateWorkflowTemplateRequest request =
+ CreateWorkflowTemplateRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setTemplate(template)
+ .build();
+ return createWorkflowTemplate(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates new workflow template.
@@ -297,7 +330,7 @@ public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateReque
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
* }
*
@@ -330,7 +363,7 @@ public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name) {
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name.toString());
* }
*
@@ -361,7 +394,7 @@ public final WorkflowTemplate getWorkflowTemplate(String name) {
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -386,7 +419,7 @@ public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest req
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -425,7 +458,7 @@ public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest req
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get();
* }
*
@@ -475,7 +508,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString()).get();
* }
*
@@ -523,7 +556,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* Map<String, String> parameters = new HashMap<>();
* workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
* }
@@ -577,7 +610,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* Map<String, String> parameters = new HashMap<>();
* workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString(), parameters).get();
* }
@@ -631,7 +664,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -673,7 +706,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -713,7 +746,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -784,6 +817,62 @@ public final OperationFuture instantiateInlineWorkflowT
return instantiateInlineWorkflowTemplateAsync(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Instantiates a template and begins execution.
+ *
+ * This method is equivalent to executing the sequence
+ * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
+ * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
+ * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
+ *
+ *
The returned Operation can be used to track execution of workflow by polling
+ * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
+ * entire workflow is finished.
+ *
+ *
The running workflow can be aborted via
+ * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
+ * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
+ *
+ *
The [Operation.metadata][google.longrunning.Operation.metadata] will be
+ * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
+ * Also see [Using
+ * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
+ *
+ *
On successful completion, [Operation.response][google.longrunning.Operation.response] will
+ * be [Empty][google.protobuf.Empty].
+ *
+ *
Sample code:
+ *
+ *
+ * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+ * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+ * }
+ *
+ *
+ * @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.workflowTemplates,instantiateinline`, the resource name of
+ * the region has the following format: `projects/{project_id}/regions/{region}`
+ *
* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of
+ * the location has the following format: `projects/{project_id}/locations/{location}`
+ * @param template Required. The workflow template to instantiate.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture instantiateInlineWorkflowTemplateAsync(
+ LocationName parent, WorkflowTemplate template) {
+ InstantiateInlineWorkflowTemplateRequest request =
+ InstantiateInlineWorkflowTemplateRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setTemplate(template)
+ .build();
+ return instantiateInlineWorkflowTemplateAsync(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Instantiates a template and begins execution.
@@ -1085,6 +1174,37 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(RegionName
return listWorkflowTemplates(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists workflows that match the specified filter in the request.
+ *
+ * Sample code:
+ *
+ *
+ * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (WorkflowTemplate element : workflowTemplateServiceClient.listWorkflowTemplates(parent).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.workflowTemplates,list`, the resource name of the region has
+ * the following format: `projects/{project_id}/regions/{region}`
+ *
* For `projects.locations.workflowTemplates.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 ListWorkflowTemplatesPagedResponse listWorkflowTemplates(LocationName parent) {
+ ListWorkflowTemplatesRequest request =
+ ListWorkflowTemplatesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listWorkflowTemplates(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists workflows that match the specified filter in the request.
@@ -1205,7 +1325,7 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* workflowTemplateServiceClient.deleteWorkflowTemplate(name);
* }
*
@@ -1236,7 +1356,7 @@ public final void deleteWorkflowTemplate(WorkflowTemplateName name) {
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* workflowTemplateServiceClient.deleteWorkflowTemplate(name.toString());
* }
*
@@ -1265,7 +1385,7 @@ public final void deleteWorkflowTemplate(String name) {
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* DeleteWorkflowTemplateRequest request = DeleteWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -1288,7 +1408,7 @@ public final void deleteWorkflowTemplate(DeleteWorkflowTemplateRequest request)
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* DeleteWorkflowTemplateRequest request = DeleteWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java
index 08b875d1..80b05478 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java
@@ -28,9 +28,8 @@
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(formattedParent, policy);
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
* }
*
*
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
index 01685310..337a677c 100644
--- 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
@@ -40,16 +40,16 @@
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public abstract class AutoscalingPolicyServiceStub implements BackgroundResource {
- public UnaryCallable
- createAutoscalingPolicyCallable() {
- throw new UnsupportedOperationException("Not implemented: createAutoscalingPolicyCallable()");
- }
-
public UnaryCallable
updateAutoscalingPolicyCallable() {
throw new UnsupportedOperationException("Not implemented: updateAutoscalingPolicyCallable()");
}
+ public UnaryCallable
+ createAutoscalingPolicyCallable() {
+ throw new UnsupportedOperationException("Not implemented: createAutoscalingPolicyCallable()");
+ }
+
public UnaryCallable
getAutoscalingPolicyCallable() {
throw new UnsupportedOperationException("Not implemented: getAutoscalingPolicyCallable()");
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java
index aece81fc..cd4e933d 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java
@@ -71,16 +71,16 @@
* 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:
+ *
For example, to set the total timeout of updateAutoscalingPolicy to 30 seconds:
*
*
*
* AutoscalingPolicyServiceStubSettings.Builder autoscalingPolicyServiceSettingsBuilder =
* AutoscalingPolicyServiceStubSettings.newBuilder();
* autoscalingPolicyServiceSettingsBuilder
- * .createAutoscalingPolicySettings()
+ * .updateAutoscalingPolicySettings()
* .setRetrySettings(
- * autoscalingPolicyServiceSettingsBuilder.createAutoscalingPolicySettings().getRetrySettings().toBuilder()
+ * autoscalingPolicyServiceSettingsBuilder.updateAutoscalingPolicySettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* AutoscalingPolicyServiceStubSettings autoscalingPolicyServiceSettings = autoscalingPolicyServiceSettingsBuilder.build();
@@ -95,10 +95,10 @@ public class AutoscalingPolicyServiceStubSettings
private static final ImmutableList DEFAULT_SERVICE_SCOPES =
ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build();
- private final UnaryCallSettings
- createAutoscalingPolicySettings;
private final UnaryCallSettings
updateAutoscalingPolicySettings;
+ private final UnaryCallSettings
+ createAutoscalingPolicySettings;
private final UnaryCallSettings
getAutoscalingPolicySettings;
private final PagedCallSettings<
@@ -109,18 +109,18 @@ public class AutoscalingPolicyServiceStubSettings
private final UnaryCallSettings
deleteAutoscalingPolicySettings;
- /** Returns the object with the settings used for calls to createAutoscalingPolicy. */
- public UnaryCallSettings
- createAutoscalingPolicySettings() {
- return createAutoscalingPolicySettings;
- }
-
/** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
public UnaryCallSettings
updateAutoscalingPolicySettings() {
return updateAutoscalingPolicySettings;
}
+ /** Returns the object with the settings used for calls to createAutoscalingPolicy. */
+ public UnaryCallSettings
+ createAutoscalingPolicySettings() {
+ return createAutoscalingPolicySettings;
+ }
+
/** Returns the object with the settings used for calls to getAutoscalingPolicy. */
public UnaryCallSettings
getAutoscalingPolicySettings() {
@@ -211,8 +211,8 @@ public Builder toBuilder() {
protected AutoscalingPolicyServiceStubSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
- createAutoscalingPolicySettings = settingsBuilder.createAutoscalingPolicySettings().build();
updateAutoscalingPolicySettings = settingsBuilder.updateAutoscalingPolicySettings().build();
+ createAutoscalingPolicySettings = settingsBuilder.createAutoscalingPolicySettings().build();
getAutoscalingPolicySettings = settingsBuilder.getAutoscalingPolicySettings().build();
listAutoscalingPoliciesSettings = settingsBuilder.listAutoscalingPoliciesSettings().build();
deleteAutoscalingPolicySettings = settingsBuilder.deleteAutoscalingPolicySettings().build();
@@ -295,10 +295,10 @@ public static class Builder
extends StubSettings.Builder {
private final ImmutableList> unaryMethodSettingsBuilders;
- private final UnaryCallSettings.Builder
- createAutoscalingPolicySettings;
private final UnaryCallSettings.Builder
updateAutoscalingPolicySettings;
+ private final UnaryCallSettings.Builder
+ createAutoscalingPolicySettings;
private final UnaryCallSettings.Builder
getAutoscalingPolicySettings;
private final PagedCallSettings.Builder<
@@ -350,10 +350,10 @@ protected Builder() {
protected Builder(ClientContext clientContext) {
super(clientContext);
- createAutoscalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
updateAutoscalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ createAutoscalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
getAutoscalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listAutoscalingPoliciesSettings =
@@ -363,8 +363,8 @@ protected Builder(ClientContext clientContext) {
unaryMethodSettingsBuilders =
ImmutableList.>of(
- createAutoscalingPolicySettings,
updateAutoscalingPolicySettings,
+ createAutoscalingPolicySettings,
getAutoscalingPolicySettings,
listAutoscalingPoliciesSettings,
deleteAutoscalingPolicySettings);
@@ -384,13 +384,13 @@ private static Builder createDefault() {
private static Builder initDefaults(Builder builder) {
builder
- .createAutoscalingPolicySettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+ .updateAutoscalingPolicySettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
- .updateAutoscalingPolicySettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .createAutoscalingPolicySettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
@@ -414,16 +414,16 @@ private static Builder initDefaults(Builder builder) {
protected Builder(AutoscalingPolicyServiceStubSettings settings) {
super(settings);
- createAutoscalingPolicySettings = settings.createAutoscalingPolicySettings.toBuilder();
updateAutoscalingPolicySettings = settings.updateAutoscalingPolicySettings.toBuilder();
+ createAutoscalingPolicySettings = settings.createAutoscalingPolicySettings.toBuilder();
getAutoscalingPolicySettings = settings.getAutoscalingPolicySettings.toBuilder();
listAutoscalingPoliciesSettings = settings.listAutoscalingPoliciesSettings.toBuilder();
deleteAutoscalingPolicySettings = settings.deleteAutoscalingPolicySettings.toBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
- createAutoscalingPolicySettings,
updateAutoscalingPolicySettings,
+ createAutoscalingPolicySettings,
getAutoscalingPolicySettings,
listAutoscalingPoliciesSettings,
deleteAutoscalingPolicySettings);
@@ -445,18 +445,18 @@ public Builder applyToAllUnaryMethods(
return unaryMethodSettingsBuilders;
}
- /** Returns the builder for the settings used for calls to createAutoscalingPolicy. */
- public UnaryCallSettings.Builder
- createAutoscalingPolicySettings() {
- return createAutoscalingPolicySettings;
- }
-
/** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
public UnaryCallSettings.Builder
updateAutoscalingPolicySettings() {
return updateAutoscalingPolicySettings;
}
+ /** Returns the builder for the settings used for calls to createAutoscalingPolicy. */
+ public UnaryCallSettings.Builder
+ createAutoscalingPolicySettings() {
+ return createAutoscalingPolicySettings;
+ }
+
/** Returns the builder for the settings used for calls to getAutoscalingPolicy. */
public UnaryCallSettings.Builder
getAutoscalingPolicySettings() {
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java
index 54146695..19e44023 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java
@@ -470,13 +470,13 @@ private static Builder initDefaults(Builder builder) {
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
- .setInitialRetryDelay(Duration.ofMillis(1000L))
- .setRetryDelayMultiplier(2.0)
- .setMaxRetryDelay(Duration.ofMillis(10000L))
+ .setInitialRetryDelay(Duration.ofMillis(500L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(5000L))
.setInitialRpcTimeout(Duration.ZERO) // ignored
.setRpcTimeoutMultiplier(1.0) // ignored
.setMaxRpcTimeout(Duration.ZERO) // ignored
- .setTotalTimeout(Duration.ofMillis(900000L))
+ .setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.updateClusterOperationSettings()
@@ -493,13 +493,13 @@ private static Builder initDefaults(Builder builder) {
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
- .setInitialRetryDelay(Duration.ofMillis(1000L))
- .setRetryDelayMultiplier(2.0)
- .setMaxRetryDelay(Duration.ofMillis(10000L))
+ .setInitialRetryDelay(Duration.ofMillis(500L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(5000L))
.setInitialRpcTimeout(Duration.ZERO) // ignored
.setRpcTimeoutMultiplier(1.0) // ignored
.setMaxRpcTimeout(Duration.ZERO) // ignored
- .setTotalTimeout(Duration.ofMillis(900000L))
+ .setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.deleteClusterOperationSettings()
@@ -516,13 +516,13 @@ private static Builder initDefaults(Builder builder) {
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
- .setInitialRetryDelay(Duration.ofMillis(1000L))
- .setRetryDelayMultiplier(2.0)
- .setMaxRetryDelay(Duration.ofMillis(10000L))
+ .setInitialRetryDelay(Duration.ofMillis(500L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(5000L))
.setInitialRpcTimeout(Duration.ZERO) // ignored
.setRpcTimeoutMultiplier(1.0) // ignored
.setMaxRpcTimeout(Duration.ZERO) // ignored
- .setTotalTimeout(Duration.ofMillis(900000L))
+ .setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.diagnoseClusterOperationSettings()
@@ -539,13 +539,13 @@ private static Builder initDefaults(Builder builder) {
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
- .setInitialRetryDelay(Duration.ofMillis(1000L))
- .setRetryDelayMultiplier(2.0)
- .setMaxRetryDelay(Duration.ofMillis(10000L))
+ .setInitialRetryDelay(Duration.ofMillis(500L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(5000L))
.setInitialRpcTimeout(Duration.ZERO) // ignored
.setRpcTimeoutMultiplier(1.0) // ignored
.setMaxRpcTimeout(Duration.ZERO) // ignored
- .setTotalTimeout(Duration.ofMillis(30000L))
+ .setTotalTimeout(Duration.ofMillis(300000L))
.build()));
return builder;
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java
index c8f1fde2..cc41ca85 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java
@@ -51,16 +51,6 @@
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public class GrpcAutoscalingPolicyServiceStub extends AutoscalingPolicyServiceStub {
- private static final MethodDescriptor
- createAutoscalingPolicyMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(
- "google.cloud.dataproc.v1.AutoscalingPolicyService/CreateAutoscalingPolicy")
- .setRequestMarshaller(
- ProtoUtils.marshaller(CreateAutoscalingPolicyRequest.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(AutoscalingPolicy.getDefaultInstance()))
- .build();
private static final MethodDescriptor
updateAutoscalingPolicyMethodDescriptor =
MethodDescriptor.newBuilder()
@@ -71,6 +61,16 @@ public class GrpcAutoscalingPolicyServiceStub extends AutoscalingPolicyServiceSt
ProtoUtils.marshaller(UpdateAutoscalingPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(AutoscalingPolicy.getDefaultInstance()))
.build();
+ private static final MethodDescriptor
+ createAutoscalingPolicyMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.cloud.dataproc.v1.AutoscalingPolicyService/CreateAutoscalingPolicy")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(CreateAutoscalingPolicyRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(AutoscalingPolicy.getDefaultInstance()))
+ .build();
private static final MethodDescriptor
getAutoscalingPolicyMethodDescriptor =
MethodDescriptor.newBuilder()
@@ -107,10 +107,10 @@ public class GrpcAutoscalingPolicyServiceStub extends AutoscalingPolicyServiceSt
private final BackgroundResource backgroundResources;
- private final UnaryCallable
- createAutoscalingPolicyCallable;
private final UnaryCallable
updateAutoscalingPolicyCallable;
+ private final UnaryCallable
+ createAutoscalingPolicyCallable;
private final UnaryCallable
getAutoscalingPolicyCallable;
private final UnaryCallable
@@ -162,20 +162,6 @@ protected GrpcAutoscalingPolicyServiceStub(
throws IOException {
this.callableFactory = callableFactory;
- GrpcCallSettings
- createAutoscalingPolicyTransportSettings =
- GrpcCallSettings.newBuilder()
- .setMethodDescriptor(createAutoscalingPolicyMethodDescriptor)
- .setParamsExtractor(
- new RequestParamsExtractor() {
- @Override
- public Map extract(CreateAutoscalingPolicyRequest request) {
- ImmutableMap.Builder params = ImmutableMap.builder();
- params.put("parent", String.valueOf(request.getParent()));
- return params.build();
- }
- })
- .build();
GrpcCallSettings
updateAutoscalingPolicyTransportSettings =
GrpcCallSettings.newBuilder()
@@ -190,6 +176,20 @@ public Map extract(UpdateAutoscalingPolicyRequest request) {
}
})
.build();
+ GrpcCallSettings
+ createAutoscalingPolicyTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(createAutoscalingPolicyMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(CreateAutoscalingPolicyRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("parent", String.valueOf(request.getParent()));
+ return params.build();
+ }
+ })
+ .build();
GrpcCallSettings
getAutoscalingPolicyTransportSettings =
GrpcCallSettings.newBuilder()
@@ -234,16 +234,16 @@ public Map extract(DeleteAutoscalingPolicyRequest request) {
})
.build();
- this.createAutoscalingPolicyCallable =
- callableFactory.createUnaryCallable(
- createAutoscalingPolicyTransportSettings,
- settings.createAutoscalingPolicySettings(),
- clientContext);
this.updateAutoscalingPolicyCallable =
callableFactory.createUnaryCallable(
updateAutoscalingPolicyTransportSettings,
settings.updateAutoscalingPolicySettings(),
clientContext);
+ this.createAutoscalingPolicyCallable =
+ callableFactory.createUnaryCallable(
+ createAutoscalingPolicyTransportSettings,
+ settings.createAutoscalingPolicySettings(),
+ clientContext);
this.getAutoscalingPolicyCallable =
callableFactory.createUnaryCallable(
getAutoscalingPolicyTransportSettings,
@@ -268,16 +268,16 @@ public Map extract(DeleteAutoscalingPolicyRequest request) {
backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
- public UnaryCallable
- createAutoscalingPolicyCallable() {
- return createAutoscalingPolicyCallable;
- }
-
public UnaryCallable
updateAutoscalingPolicyCallable() {
return updateAutoscalingPolicyCallable;
}
+ public UnaryCallable
+ createAutoscalingPolicyCallable() {
+ return createAutoscalingPolicyCallable;
+ }
+
public UnaryCallable
getAutoscalingPolicyCallable() {
return getAutoscalingPolicyCallable;
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java
index 75e12848..db516c66 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java
@@ -500,13 +500,13 @@ private static Builder initDefaults(Builder builder) {
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
- .setInitialRetryDelay(Duration.ofMillis(1000L))
- .setRetryDelayMultiplier(2.0)
- .setMaxRetryDelay(Duration.ofMillis(10000L))
+ .setInitialRetryDelay(Duration.ofMillis(500L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(5000L))
.setInitialRpcTimeout(Duration.ZERO) // ignored
.setRpcTimeoutMultiplier(1.0) // ignored
.setMaxRpcTimeout(Duration.ZERO) // ignored
- .setTotalTimeout(Duration.ofMillis(43200000L))
+ .setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.instantiateInlineWorkflowTemplateOperationSettings()
@@ -524,13 +524,13 @@ private static Builder initDefaults(Builder builder) {
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
- .setInitialRetryDelay(Duration.ofMillis(1000L))
- .setRetryDelayMultiplier(2.0)
- .setMaxRetryDelay(Duration.ofMillis(10000L))
+ .setInitialRetryDelay(Duration.ofMillis(500L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(5000L))
.setInitialRpcTimeout(Duration.ZERO) // ignored
.setRpcTimeoutMultiplier(1.0) // ignored
.setMaxRpcTimeout(Duration.ZERO) // ignored
- .setTotalTimeout(Duration.ofMillis(43200000L))
+ .setTotalTimeout(Duration.ofMillis(300000L))
.build()));
return builder;
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClient.java
index 5719aead..4c7f769c 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClient.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClient.java
@@ -192,6 +192,39 @@ public final AutoscalingPolicy createAutoscalingPolicy(
return createAutoscalingPolicy(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates new autoscaling policy.
+ *
+ * Sample 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.
+ * * For `projects.regions.autoscalingPolicies.create`, the resource name has the
+ * following format: `projects/{project_id}/regions/{region}`
+ *
* For `projects.locations.autoscalingPolicies.create`, the resource name has the
+ * following format: `projects/{project_id}/locations/{location}`
+ * @param policy Required. The autoscaling policy to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AutoscalingPolicy createAutoscalingPolicy(
+ LocationName parent, AutoscalingPolicy policy) {
+ CreateAutoscalingPolicyRequest request =
+ CreateAutoscalingPolicyRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setPolicy(policy)
+ .build();
+ return createAutoscalingPolicy(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates new autoscaling policy.
@@ -353,7 +386,7 @@ public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRe
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicyName name = AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(name);
* }
*
@@ -384,7 +417,7 @@ public final AutoscalingPolicy getAutoscalingPolicy(AutoscalingPolicyName name)
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicyName name = AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(name.toString());
* }
*
@@ -413,7 +446,7 @@ public final AutoscalingPolicy getAutoscalingPolicy(String name) {
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicyName name = AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* GetAutoscalingPolicyRequest request = GetAutoscalingPolicyRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -436,7 +469,7 @@ public final AutoscalingPolicy getAutoscalingPolicy(GetAutoscalingPolicyRequest
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicyName name = AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* GetAutoscalingPolicyRequest request = GetAutoscalingPolicyRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -482,6 +515,37 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(Region
return listAutoscalingPolicies(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists autoscaling policies in the project.
+ *
+ * Sample code:
+ *
+ *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (AutoscalingPolicy element : autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).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(LocationName parent) {
+ ListAutoscalingPoliciesRequest request =
+ ListAutoscalingPoliciesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listAutoscalingPolicies(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists autoscaling policies in the project.
@@ -603,7 +667,7 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicyName name = AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* autoscalingPolicyServiceClient.deleteAutoscalingPolicy(name);
* }
*
@@ -635,7 +699,7 @@ public final void deleteAutoscalingPolicy(AutoscalingPolicyName name) {
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicyName name = AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* autoscalingPolicyServiceClient.deleteAutoscalingPolicy(name.toString());
* }
*
@@ -665,7 +729,7 @@ public final void deleteAutoscalingPolicy(String name) {
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicyName name = AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* DeleteAutoscalingPolicyRequest request = DeleteAutoscalingPolicyRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -689,7 +753,7 @@ public final void deleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest request
*
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicyName name = AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ * AutoscalingPolicyName name = AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
* DeleteAutoscalingPolicyRequest request = DeleteAutoscalingPolicyRequest.newBuilder()
* .setName(name.toString())
* .build();
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClient.java
index 2e561778..4cd016aa 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClient.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerClient.java
@@ -868,7 +868,7 @@ public final UnaryCallable listCluste
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture diagnoseClusterAsync(
+ public final OperationFuture diagnoseClusterAsync(
String projectId, String region, String clusterName) {
DiagnoseClusterRequest request =
DiagnoseClusterRequest.newBuilder()
@@ -908,7 +908,7 @@ public final OperationFuture diagnoseClusterAsync
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture diagnoseClusterAsync(
+ public final OperationFuture diagnoseClusterAsync(
DiagnoseClusterRequest request) {
return diagnoseClusterOperationCallable().futureCall(request);
}
@@ -933,14 +933,14 @@ public final OperationFuture diagnoseClusterAsync
* .setRegion(region)
* .setClusterName(clusterName)
* .build();
- * OperationFuture<Empty, DiagnoseClusterResults> future = clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request);
+ * OperationFuture<Empty, ClusterOperationMetadata> future = clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request);
* // Do something
* future.get();
* }
*
*/
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
+ public final OperationCallable
diagnoseClusterOperationCallable() {
return stub.diagnoseClusterOperationCallable();
}
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerSettings.java
index df553934..5c8ae2a6 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/ClusterControllerSettings.java
@@ -128,7 +128,7 @@ public UnaryCallSettings diagnoseClusterSetti
/** Returns the object with the settings used for calls to diagnoseCluster. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings
+ public OperationCallSettings
diagnoseClusterOperationSettings() {
return ((ClusterControllerStubSettings) getStubSettings()).diagnoseClusterOperationSettings();
}
@@ -289,7 +289,7 @@ public UnaryCallSettings.Builder diagnoseClus
/** Returns the builder for the settings used for calls to diagnoseCluster. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings.Builder
+ public OperationCallSettings.Builder
diagnoseClusterOperationSettings() {
return getStubSettingsBuilder().diagnoseClusterOperationSettings();
}
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java
index a371e04c..9a1f297c 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java
@@ -208,6 +208,39 @@ public final WorkflowTemplate createWorkflowTemplate(
return createWorkflowTemplate(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates new workflow template.
+ *
+ * Sample code:
+ *
+ *
+ * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+ * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
+ * }
+ *
+ *
+ * @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.workflowTemplates,create`, the resource name of the region
+ * has the following format: `projects/{project_id}/regions/{region}`
+ *
* For `projects.locations.workflowTemplates.create`, the resource name of the
+ * location has the following format: `projects/{project_id}/locations/{location}`
+ * @param template Required. The Dataproc workflow template to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final WorkflowTemplate createWorkflowTemplate(
+ LocationName parent, WorkflowTemplate template) {
+ CreateWorkflowTemplateRequest request =
+ CreateWorkflowTemplateRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setTemplate(template)
+ .build();
+ return createWorkflowTemplate(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates new workflow template.
@@ -297,7 +330,7 @@ public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateReque
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
* }
*
@@ -330,7 +363,7 @@ public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name) {
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name.toString());
* }
*
@@ -361,7 +394,7 @@ public final WorkflowTemplate getWorkflowTemplate(String name) {
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -386,7 +419,7 @@ public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest req
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -425,7 +458,7 @@ public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest req
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get();
* }
*
@@ -475,7 +508,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString()).get();
* }
*
@@ -523,7 +556,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* Map<String, String> parameters = new HashMap<>();
* workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
* }
@@ -577,7 +610,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* Map<String, String> parameters = new HashMap<>();
* workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString(), parameters).get();
* }
@@ -631,7 +664,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -673,7 +706,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -713,7 +746,7 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -784,6 +817,62 @@ public final OperationFuture instantiateInlineWorkflowT
return instantiateInlineWorkflowTemplateAsync(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Instantiates a template and begins execution.
+ *
+ * This method is equivalent to executing the sequence
+ * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate],
+ * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate],
+ * [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate].
+ *
+ *
The returned Operation can be used to track execution of workflow by polling
+ * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
+ * entire workflow is finished.
+ *
+ *
The running workflow can be aborted via
+ * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
+ * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
+ *
+ *
The [Operation.metadata][google.longrunning.Operation.metadata] will be
+ * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
+ * Also see [Using
+ * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
+ *
+ *
On successful completion, [Operation.response][google.longrunning.Operation.response] will
+ * be [Empty][google.protobuf.Empty].
+ *
+ *
Sample code:
+ *
+ *
+ * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+ * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+ * }
+ *
+ *
+ * @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.workflowTemplates,instantiateinline`, the resource name of
+ * the region has the following format: `projects/{project_id}/regions/{region}`
+ *
* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of
+ * the location has the following format: `projects/{project_id}/locations/{location}`
+ * @param template Required. The workflow template to instantiate.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture instantiateInlineWorkflowTemplateAsync(
+ LocationName parent, WorkflowTemplate template) {
+ InstantiateInlineWorkflowTemplateRequest request =
+ InstantiateInlineWorkflowTemplateRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setTemplate(template)
+ .build();
+ return instantiateInlineWorkflowTemplateAsync(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Instantiates a template and begins execution.
@@ -1085,6 +1174,37 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(RegionName
return listWorkflowTemplates(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists workflows that match the specified filter in the request.
+ *
+ * Sample code:
+ *
+ *
+ * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (WorkflowTemplate element : workflowTemplateServiceClient.listWorkflowTemplates(parent).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.workflowTemplates,list`, the resource name of the region has
+ * the following format: `projects/{project_id}/regions/{region}`
+ *
* For `projects.locations.workflowTemplates.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 ListWorkflowTemplatesPagedResponse listWorkflowTemplates(LocationName parent) {
+ ListWorkflowTemplatesRequest request =
+ ListWorkflowTemplatesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listWorkflowTemplates(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists workflows that match the specified filter in the request.
@@ -1205,7 +1325,7 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* workflowTemplateServiceClient.deleteWorkflowTemplate(name);
* }
*
@@ -1236,7 +1356,7 @@ public final void deleteWorkflowTemplate(WorkflowTemplateName name) {
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* workflowTemplateServiceClient.deleteWorkflowTemplate(name.toString());
* }
*
@@ -1265,7 +1385,7 @@ public final void deleteWorkflowTemplate(String name) {
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* DeleteWorkflowTemplateRequest request = DeleteWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -1288,7 +1408,7 @@ public final void deleteWorkflowTemplate(DeleteWorkflowTemplateRequest request)
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
* DeleteWorkflowTemplateRequest request = DeleteWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/AutoscalingPolicyServiceStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/AutoscalingPolicyServiceStubSettings.java
index 152cb69f..a0a55161 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/AutoscalingPolicyServiceStubSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/AutoscalingPolicyServiceStubSettings.java
@@ -390,7 +390,7 @@ private static Builder initDefaults(Builder builder) {
builder
.updateAutoscalingPolicySettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStub.java
index e749d709..8df92ae0 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStub.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStub.java
@@ -26,7 +26,6 @@
import com.google.cloud.dataproc.v1beta2.CreateClusterRequest;
import com.google.cloud.dataproc.v1beta2.DeleteClusterRequest;
import com.google.cloud.dataproc.v1beta2.DiagnoseClusterRequest;
-import com.google.cloud.dataproc.v1beta2.DiagnoseClusterResults;
import com.google.cloud.dataproc.v1beta2.GetClusterRequest;
import com.google.cloud.dataproc.v1beta2.ListClustersRequest;
import com.google.cloud.dataproc.v1beta2.ListClustersResponse;
@@ -94,7 +93,7 @@ public UnaryCallable listClustersCall
}
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public OperationCallable
+ public OperationCallable
diagnoseClusterOperationCallable() {
throw new UnsupportedOperationException("Not implemented: diagnoseClusterOperationCallable()");
}
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStubSettings.java
index 53053ae6..687a9604 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStubSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/ClusterControllerStubSettings.java
@@ -48,7 +48,6 @@
import com.google.cloud.dataproc.v1beta2.CreateClusterRequest;
import com.google.cloud.dataproc.v1beta2.DeleteClusterRequest;
import com.google.cloud.dataproc.v1beta2.DiagnoseClusterRequest;
-import com.google.cloud.dataproc.v1beta2.DiagnoseClusterResults;
import com.google.cloud.dataproc.v1beta2.GetClusterRequest;
import com.google.cloud.dataproc.v1beta2.ListClustersRequest;
import com.google.cloud.dataproc.v1beta2.ListClustersResponse;
@@ -116,7 +115,7 @@ public class ClusterControllerStubSettings extends StubSettings
listClustersSettings;
private final UnaryCallSettings diagnoseClusterSettings;
- private final OperationCallSettings
+ private final OperationCallSettings
diagnoseClusterOperationSettings;
/** Returns the object with the settings used for calls to createCluster. */
@@ -173,7 +172,7 @@ public UnaryCallSettings diagnoseClusterSetti
/** Returns the object with the settings used for calls to diagnoseCluster. */
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public OperationCallSettings
+ public OperationCallSettings
diagnoseClusterOperationSettings() {
return diagnoseClusterOperationSettings;
}
@@ -335,7 +334,7 @@ public static class Builder extends StubSettings.Builder
diagnoseClusterSettings;
private final OperationCallSettings.Builder<
- DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
+ DiagnoseClusterRequest, Empty, ClusterOperationMetadata>
diagnoseClusterOperationSettings;
private static final ImmutableMap>
@@ -367,10 +366,10 @@ public static class Builder extends StubSettings.Builder diagnoseClus
/** Returns the builder for the settings used for calls to diagnoseCluster. */
@BetaApi(
"The surface for use by generated code is not stable yet and may change in the future.")
- public OperationCallSettings.Builder
+ public OperationCallSettings.Builder
diagnoseClusterOperationSettings() {
return diagnoseClusterOperationSettings;
}
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcClusterControllerStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcClusterControllerStub.java
index 37f97553..b9e155d5 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcClusterControllerStub.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/GrpcClusterControllerStub.java
@@ -30,7 +30,6 @@
import com.google.cloud.dataproc.v1beta2.CreateClusterRequest;
import com.google.cloud.dataproc.v1beta2.DeleteClusterRequest;
import com.google.cloud.dataproc.v1beta2.DiagnoseClusterRequest;
-import com.google.cloud.dataproc.v1beta2.DiagnoseClusterResults;
import com.google.cloud.dataproc.v1beta2.GetClusterRequest;
import com.google.cloud.dataproc.v1beta2.ListClustersRequest;
import com.google.cloud.dataproc.v1beta2.ListClustersResponse;
@@ -124,7 +123,7 @@ public class GrpcClusterControllerStub extends ClusterControllerStub {
private final UnaryCallable
listClustersPagedCallable;
private final UnaryCallable diagnoseClusterCallable;
- private final OperationCallable
+ private final OperationCallable
diagnoseClusterOperationCallable;
private final GrpcStubCallableFactory callableFactory;
@@ -291,7 +290,7 @@ public UnaryCallable listClustersCall
}
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public OperationCallable
+ public OperationCallable
diagnoseClusterOperationCallable() {
return diagnoseClusterOperationCallable;
}
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStubSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStubSettings.java
index 63037617..96bd987d 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStubSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/stub/JobControllerStubSettings.java
@@ -305,10 +305,10 @@ public static class Builder extends StubSettings.Builder actualRequests = mockAutoscalingPolicyService.getRequests();
Assert.assertEquals(1, actualRequests.size());
- CreateAutoscalingPolicyRequest actualRequest =
- (CreateAutoscalingPolicyRequest) actualRequests.get(0);
+ UpdateAutoscalingPolicyRequest actualRequest =
+ (UpdateAutoscalingPolicyRequest) actualRequests.get(0);
- Assert.assertEquals(formattedParent, actualRequest.getParent());
Assert.assertEquals(policy, actualRequest.getPolicy());
Assert.assertTrue(
channelProvider.isHeaderSent(
@@ -119,15 +119,14 @@ public void createAutoscalingPolicyTest() {
@Test
@SuppressWarnings("all")
- public void createAutoscalingPolicyExceptionTest() throws Exception {
+ public void updateAutoscalingPolicyExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
mockAutoscalingPolicyService.addException(exception);
try {
- String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- client.createAutoscalingPolicy(formattedParent, policy);
+ client.updateAutoscalingPolicy(policy);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception
@@ -136,23 +135,27 @@ public void createAutoscalingPolicyExceptionTest() throws Exception {
@Test
@SuppressWarnings("all")
- public void updateAutoscalingPolicyTest() {
+ public void createAutoscalingPolicyTest() {
String id = "id3355";
- String name = "name3373707";
+ AutoscalingPolicyName name =
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
AutoscalingPolicy expectedResponse =
- AutoscalingPolicy.newBuilder().setId(id).setName(name).build();
+ AutoscalingPolicy.newBuilder().setId(id).setName(name.toString()).build();
mockAutoscalingPolicyService.addResponse(expectedResponse);
+ RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- AutoscalingPolicy actualResponse = client.updateAutoscalingPolicy(policy);
+ AutoscalingPolicy actualResponse = client.createAutoscalingPolicy(parent, policy);
Assert.assertEquals(expectedResponse, actualResponse);
List actualRequests = mockAutoscalingPolicyService.getRequests();
Assert.assertEquals(1, actualRequests.size());
- UpdateAutoscalingPolicyRequest actualRequest =
- (UpdateAutoscalingPolicyRequest) actualRequests.get(0);
+ CreateAutoscalingPolicyRequest actualRequest =
+ (CreateAutoscalingPolicyRequest) actualRequests.get(0);
+ Assert.assertEquals(parent, RegionName.parse(actualRequest.getParent()));
Assert.assertEquals(policy, actualRequest.getPolicy());
Assert.assertTrue(
channelProvider.isHeaderSent(
@@ -162,14 +165,15 @@ public void updateAutoscalingPolicyTest() {
@Test
@SuppressWarnings("all")
- public void updateAutoscalingPolicyExceptionTest() throws Exception {
+ public void createAutoscalingPolicyExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
mockAutoscalingPolicyService.addException(exception);
try {
+ RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- client.updateAutoscalingPolicy(policy);
+ client.createAutoscalingPolicy(parent, policy);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception
@@ -180,22 +184,25 @@ public void updateAutoscalingPolicyExceptionTest() throws Exception {
@SuppressWarnings("all")
public void getAutoscalingPolicyTest() {
String id = "id3355";
- String name2 = "name2-1052831874";
+ AutoscalingPolicyName name2 =
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
AutoscalingPolicy expectedResponse =
- AutoscalingPolicy.newBuilder().setId(id).setName(name2).build();
+ AutoscalingPolicy.newBuilder().setId(id).setName(name2.toString()).build();
mockAutoscalingPolicyService.addResponse(expectedResponse);
- String formattedName =
- AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ AutoscalingPolicyName name =
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
- AutoscalingPolicy actualResponse = client.getAutoscalingPolicy(formattedName);
+ AutoscalingPolicy actualResponse = client.getAutoscalingPolicy(name);
Assert.assertEquals(expectedResponse, actualResponse);
List actualRequests = mockAutoscalingPolicyService.getRequests();
Assert.assertEquals(1, actualRequests.size());
GetAutoscalingPolicyRequest actualRequest = (GetAutoscalingPolicyRequest) actualRequests.get(0);
- Assert.assertEquals(formattedName, actualRequest.getName());
+ Assert.assertEquals(name, AutoscalingPolicyName.parse(actualRequest.getName()));
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -209,10 +216,11 @@ public void getAutoscalingPolicyExceptionTest() throws Exception {
mockAutoscalingPolicyService.addException(exception);
try {
- String formattedName =
- AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ AutoscalingPolicyName name =
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
- client.getAutoscalingPolicy(formattedName);
+ client.getAutoscalingPolicy(name);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception
@@ -232,10 +240,9 @@ public void listAutoscalingPoliciesTest() {
.build();
mockAutoscalingPolicyService.addResponse(expectedResponse);
- String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- ListAutoscalingPoliciesPagedResponse pagedListResponse =
- client.listAutoscalingPolicies(formattedParent);
+ ListAutoscalingPoliciesPagedResponse pagedListResponse = client.listAutoscalingPolicies(parent);
List resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
@@ -246,7 +253,7 @@ public void listAutoscalingPoliciesTest() {
ListAutoscalingPoliciesRequest actualRequest =
(ListAutoscalingPoliciesRequest) actualRequests.get(0);
- Assert.assertEquals(formattedParent, actualRequest.getParent());
+ Assert.assertEquals(parent, RegionName.parse(actualRequest.getParent()));
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -260,9 +267,9 @@ public void listAutoscalingPoliciesExceptionTest() throws Exception {
mockAutoscalingPolicyService.addException(exception);
try {
- String formattedParent = RegionName.format("[PROJECT]", "[REGION]");
+ RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- client.listAutoscalingPolicies(formattedParent);
+ client.listAutoscalingPolicies(parent);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception
@@ -275,17 +282,18 @@ public void deleteAutoscalingPolicyTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockAutoscalingPolicyService.addResponse(expectedResponse);
- String formattedName =
- AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ AutoscalingPolicyName name =
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
- client.deleteAutoscalingPolicy(formattedName);
+ client.deleteAutoscalingPolicy(name);
List actualRequests = mockAutoscalingPolicyService.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteAutoscalingPolicyRequest actualRequest =
(DeleteAutoscalingPolicyRequest) actualRequests.get(0);
- Assert.assertEquals(formattedName, actualRequest.getName());
+ Assert.assertEquals(name, AutoscalingPolicyName.parse(actualRequest.getName()));
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -299,10 +307,11 @@ public void deleteAutoscalingPolicyExceptionTest() throws Exception {
mockAutoscalingPolicyService.addException(exception);
try {
- String formattedName =
- AutoscalingPolicyName.format("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ AutoscalingPolicyName name =
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
- client.deleteAutoscalingPolicy(formattedName);
+ client.deleteAutoscalingPolicy(name);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception
diff --git a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java
index b213dadd..87142384 100644
--- a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java
+++ b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java
@@ -100,7 +100,8 @@ public void tearDown() throws Exception {
public void createWorkflowTemplateTest() {
String id = "id3355";
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
int version = 351608024;
WorkflowTemplate expectedResponse =
WorkflowTemplate.newBuilder()
@@ -151,7 +152,8 @@ public void createWorkflowTemplateExceptionTest() throws Exception {
public void getWorkflowTemplateTest() {
String id = "id3355";
WorkflowTemplateName name2 =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
int version = 351608024;
WorkflowTemplate expectedResponse =
WorkflowTemplate.newBuilder()
@@ -162,7 +164,8 @@ public void getWorkflowTemplateTest() {
mockWorkflowTemplateService.addResponse(expectedResponse);
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
WorkflowTemplate actualResponse = client.getWorkflowTemplate(name);
Assert.assertEquals(expectedResponse, actualResponse);
@@ -186,7 +189,8 @@ public void getWorkflowTemplateExceptionTest() throws Exception {
try {
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
client.getWorkflowTemplate(name);
Assert.fail("No exception raised");
@@ -208,7 +212,8 @@ public void instantiateWorkflowTemplateTest() throws Exception {
mockWorkflowTemplateService.addResponse(resultOperation);
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
Empty actualResponse = client.instantiateWorkflowTemplateAsync(name).get();
Assert.assertEquals(expectedResponse, actualResponse);
@@ -233,7 +238,8 @@ public void instantiateWorkflowTemplateExceptionTest() throws Exception {
try {
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
client.instantiateWorkflowTemplateAsync(name).get();
Assert.fail("No exception raised");
@@ -257,7 +263,8 @@ public void instantiateWorkflowTemplateTest2() throws Exception {
mockWorkflowTemplateService.addResponse(resultOperation);
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
Map parameters = new HashMap<>();
Empty actualResponse = client.instantiateWorkflowTemplateAsync(name, parameters).get();
@@ -284,7 +291,8 @@ public void instantiateWorkflowTemplateExceptionTest2() throws Exception {
try {
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
Map parameters = new HashMap<>();
client.instantiateWorkflowTemplateAsync(name, parameters).get();
@@ -351,7 +359,8 @@ public void instantiateInlineWorkflowTemplateExceptionTest() throws Exception {
public void updateWorkflowTemplateTest() {
String id = "id3355";
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
int version = 351608024;
WorkflowTemplate expectedResponse =
WorkflowTemplate.newBuilder()
@@ -450,7 +459,8 @@ public void deleteWorkflowTemplateTest() {
mockWorkflowTemplateService.addResponse(expectedResponse);
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
client.deleteWorkflowTemplate(name);
@@ -474,7 +484,8 @@ public void deleteWorkflowTemplateExceptionTest() throws Exception {
try {
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
client.deleteWorkflowTemplate(name);
Assert.fail("No exception raised");
diff --git a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClientTest.java b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClientTest.java
index 467e711c..7b0b70b8 100644
--- a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClientTest.java
+++ b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClientTest.java
@@ -94,7 +94,8 @@ public void tearDown() throws Exception {
public void createAutoscalingPolicyTest() {
String id = "id3355";
AutoscalingPolicyName name =
- AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
AutoscalingPolicy expectedResponse =
AutoscalingPolicy.newBuilder().setId(id).setName(name.toString()).build();
mockAutoscalingPolicyService.addResponse(expectedResponse);
@@ -140,7 +141,8 @@ public void createAutoscalingPolicyExceptionTest() throws Exception {
public void updateAutoscalingPolicyTest() {
String id = "id3355";
AutoscalingPolicyName name =
- AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
AutoscalingPolicy expectedResponse =
AutoscalingPolicy.newBuilder().setId(id).setName(name.toString()).build();
mockAutoscalingPolicyService.addResponse(expectedResponse);
@@ -183,13 +185,15 @@ public void updateAutoscalingPolicyExceptionTest() throws Exception {
public void getAutoscalingPolicyTest() {
String id = "id3355";
AutoscalingPolicyName name2 =
- AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
AutoscalingPolicy expectedResponse =
AutoscalingPolicy.newBuilder().setId(id).setName(name2.toString()).build();
mockAutoscalingPolicyService.addResponse(expectedResponse);
AutoscalingPolicyName name =
- AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
AutoscalingPolicy actualResponse = client.getAutoscalingPolicy(name);
Assert.assertEquals(expectedResponse, actualResponse);
@@ -213,7 +217,8 @@ public void getAutoscalingPolicyExceptionTest() throws Exception {
try {
AutoscalingPolicyName name =
- AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
client.getAutoscalingPolicy(name);
Assert.fail("No exception raised");
@@ -278,7 +283,8 @@ public void deleteAutoscalingPolicyTest() {
mockAutoscalingPolicyService.addResponse(expectedResponse);
AutoscalingPolicyName name =
- AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
client.deleteAutoscalingPolicy(name);
@@ -302,7 +308,8 @@ public void deleteAutoscalingPolicyExceptionTest() throws Exception {
try {
AutoscalingPolicyName name =
- AutoscalingPolicyName.of("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]");
+ AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+ "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
client.deleteAutoscalingPolicy(name);
Assert.fail("No exception raised");
diff --git a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClientTest.java b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClientTest.java
index 968c6c1b..228429a2 100644
--- a/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClientTest.java
+++ b/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClientTest.java
@@ -100,7 +100,8 @@ public void tearDown() throws Exception {
public void createWorkflowTemplateTest() {
String id = "id3355";
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
int version = 351608024;
WorkflowTemplate expectedResponse =
WorkflowTemplate.newBuilder()
@@ -151,7 +152,8 @@ public void createWorkflowTemplateExceptionTest() throws Exception {
public void getWorkflowTemplateTest() {
String id = "id3355";
WorkflowTemplateName name2 =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
int version = 351608024;
WorkflowTemplate expectedResponse =
WorkflowTemplate.newBuilder()
@@ -162,7 +164,8 @@ public void getWorkflowTemplateTest() {
mockWorkflowTemplateService.addResponse(expectedResponse);
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
WorkflowTemplate actualResponse = client.getWorkflowTemplate(name);
Assert.assertEquals(expectedResponse, actualResponse);
@@ -186,7 +189,8 @@ public void getWorkflowTemplateExceptionTest() throws Exception {
try {
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
client.getWorkflowTemplate(name);
Assert.fail("No exception raised");
@@ -208,7 +212,8 @@ public void instantiateWorkflowTemplateTest() throws Exception {
mockWorkflowTemplateService.addResponse(resultOperation);
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
Empty actualResponse = client.instantiateWorkflowTemplateAsync(name).get();
Assert.assertEquals(expectedResponse, actualResponse);
@@ -233,7 +238,8 @@ public void instantiateWorkflowTemplateExceptionTest() throws Exception {
try {
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
client.instantiateWorkflowTemplateAsync(name).get();
Assert.fail("No exception raised");
@@ -257,7 +263,8 @@ public void instantiateWorkflowTemplateTest2() throws Exception {
mockWorkflowTemplateService.addResponse(resultOperation);
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
Map parameters = new HashMap<>();
Empty actualResponse = client.instantiateWorkflowTemplateAsync(name, parameters).get();
@@ -284,7 +291,8 @@ public void instantiateWorkflowTemplateExceptionTest2() throws Exception {
try {
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
Map parameters = new HashMap<>();
client.instantiateWorkflowTemplateAsync(name, parameters).get();
@@ -351,7 +359,8 @@ public void instantiateInlineWorkflowTemplateExceptionTest() throws Exception {
public void updateWorkflowTemplateTest() {
String id = "id3355";
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
int version = 351608024;
WorkflowTemplate expectedResponse =
WorkflowTemplate.newBuilder()
@@ -450,7 +459,8 @@ public void deleteWorkflowTemplateTest() {
mockWorkflowTemplateService.addResponse(expectedResponse);
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
client.deleteWorkflowTemplate(name);
@@ -474,7 +484,8 @@ public void deleteWorkflowTemplateExceptionTest() throws Exception {
try {
WorkflowTemplateName name =
- WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+ "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
client.deleteWorkflowTemplate(name);
Assert.fail("No exception raised");
diff --git a/grpc-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceGrpc.java b/grpc-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceGrpc.java
index 0aeb05ba..0909a3e9 100644
--- a/grpc-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceGrpc.java
+++ b/grpc-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceGrpc.java
@@ -523,7 +523,8 @@ public void instantiateWorkflowTemplate(
*
* Instantiates a template and begins execution.
* This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate],
+ * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate],
+ * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate],
* [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate].
* The returned Operation can be used to track execution of
* workflow by polling
@@ -738,7 +739,8 @@ public void instantiateWorkflowTemplate(
*
* Instantiates a template and begins execution.
* This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate],
+ * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate],
+ * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate],
* [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate].
* The returned Operation can be used to track execution of
* workflow by polling
@@ -901,7 +903,8 @@ public com.google.longrunning.Operation instantiateWorkflowTemplate(
*
* Instantiates a template and begins execution.
* This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate],
+ * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate],
+ * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate],
* [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate].
* The returned Operation can be used to track execution of
* workflow by polling
@@ -1054,7 +1057,8 @@ protected WorkflowTemplateServiceFutureStub build(
*
* Instantiates a template and begins execution.
* This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate],
+ * [CreateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.CreateWorkflowTemplate],
+ * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.InstantiateWorkflowTemplate],
* [DeleteWorkflowTemplate][google.cloud.dataproc.v1beta2.WorkflowTemplateService.DeleteWorkflowTemplate].
* The returned Operation can be used to track execution of
* workflow by polling
diff --git a/proto-google-cloud-dataproc-v1/clirr-ignored-differences.xml b/proto-google-cloud-dataproc-v1/clirr-ignored-differences.xml
index fa53d8b6..b045425c 100644
--- a/proto-google-cloud-dataproc-v1/clirr-ignored-differences.xml
+++ b/proto-google-cloud-dataproc-v1/clirr-ignored-differences.xml
@@ -16,4 +16,9 @@
com/google/cloud/dataproc/v1/*OrBuilder
boolean has*(*)
+
+ 7002
+ com/google/cloud/dataproc/v1/AutoscalingPolicyName$Builder
+ * *etRegion(*)
+
diff --git a/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPoliciesProto.java b/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPoliciesProto.java
index 17ef8697..a1126b55 100644
--- a/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPoliciesProto.java
+++ b/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPoliciesProto.java
@@ -78,11 +78,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
java.lang.String[] descriptorData = {
"\n3google/cloud/dataproc/v1/autoscaling_p"
+ "olicies.proto\022\030google.cloud.dataproc.v1\032"
- + "\034google/api/annotations.proto\032\037google/ap"
- + "i/field_behavior.proto\032\031google/api/resou"
- + "rce.proto\032\036google/protobuf/duration.prot"
- + "o\032\033google/protobuf/empty.proto\032\027google/a"
- + "pi/client.proto\"\250\004\n\021AutoscalingPolicy\022\n\n"
+ + "\034google/api/annotations.proto\032\027google/ap"
+ + "i/client.proto\032\037google/api/field_behavio"
+ + "r.proto\032\031google/api/resource.proto\032\036goog"
+ + "le/protobuf/duration.proto\032\033google/proto"
+ + "buf/empty.proto\"\250\004\n\021AutoscalingPolicy\022\n\n"
+ "\002id\030\001 \001(\t\022\021\n\004name\030\002 \001(\tB\003\340A\003\022S\n\017basic_al"
+ "gorithm\030\003 \001(\01323.google.cloud.dataproc.v1"
+ ".BasicAutoscalingAlgorithmB\003\340A\002H\000\022Z\n\rwor"
@@ -128,58 +128,59 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "ListAutoscalingPoliciesResponse\022B\n\010polic"
+ "ies\030\001 \003(\0132+.google.cloud.dataproc.v1.Aut"
+ "oscalingPolicyB\003\340A\003\022\034\n\017next_page_token\030\002"
- + " \001(\tB\003\340A\0032\375\n\n\030AutoscalingPolicyService\022\214"
+ + " \001(\tB\003\340A\0032\256\013\n\030AutoscalingPolicyService\022\234"
+ "\002\n\027CreateAutoscalingPolicy\0228.google.clou"
+ "d.dataproc.v1.CreateAutoscalingPolicyReq"
+ "uest\032+.google.cloud.dataproc.v1.Autoscal"
- + "ingPolicy\"\211\001\202\323\344\223\002\202\001\"7/v1/{parent=project"
+ + "ingPolicy\"\231\001\202\323\344\223\002\202\001\"7/v1/{parent=project"
+ "s/*/locations/*}/autoscalingPolicies:\006po"
+ "licyZ?\"5/v1/{parent=projects/*/regions/*"
- + "}/autoscalingPolicies:\006policy\022\232\002\n\027Update"
- + "AutoscalingPolicy\0228.google.cloud.datapro"
- + "c.v1.UpdateAutoscalingPolicyRequest\032+.go"
- + "ogle.cloud.dataproc.v1.AutoscalingPolicy"
- + "\"\227\001\202\323\344\223\002\220\001\032>/v1/{policy.name=projects/*/"
- + "locations/*/autoscalingPolicies/*}:\006poli"
- + "cyZF\032/v1/{policy."
+ + "name=projects/*/locations/*/autoscalingP"
+ + "olicies/*}:\006policyZF\032 fieldValuesMap;
+ private PathTemplate pathTemplate;
+ private String fixedValue;
- private final String project;
- private final String region;
- private final String autoscalingPolicy;
+ private String project;
+ private String location;
+ private String autoscalingPolicy;
+ private String region;
public String getProject() {
return project;
}
- public String getRegion() {
- return region;
+ public String getLocation() {
+ return location;
}
public String getAutoscalingPolicy() {
return autoscalingPolicy;
}
+ public String getRegion() {
+ return region;
+ }
+
+ private AutoscalingPolicyName(Builder builder) {
+ project = Preconditions.checkNotNull(builder.getProject());
+ location = Preconditions.checkNotNull(builder.getLocation());
+ autoscalingPolicy = Preconditions.checkNotNull(builder.getAutoscalingPolicy());
+ pathTemplate = PROJECT_LOCATION_AUTOSCALING_POLICY_PATH_TEMPLATE;
+ }
+
+ private AutoscalingPolicyName(ProjectRegionAutoscalingPolicyBuilder builder) {
+ project = Preconditions.checkNotNull(builder.getProject());
+ region = Preconditions.checkNotNull(builder.getRegion());
+ autoscalingPolicy = Preconditions.checkNotNull(builder.getAutoscalingPolicy());
+ pathTemplate = PROJECT_REGION_AUTOSCALING_POLICY_PATH_TEMPLATE;
+ }
+
public static Builder newBuilder() {
return new Builder();
}
+ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
+ public static Builder newProjectLocationAutoscalingPolicyBuilder() {
+ return new Builder();
+ }
+
+ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
+ public static ProjectRegionAutoscalingPolicyBuilder newProjectRegionAutoscalingPolicyBuilder() {
+ return new ProjectRegionAutoscalingPolicyBuilder();
+ }
+
public Builder toBuilder() {
return new Builder(this);
}
- private AutoscalingPolicyName(Builder builder) {
- project = Preconditions.checkNotNull(builder.getProject());
- region = Preconditions.checkNotNull(builder.getRegion());
- autoscalingPolicy = Preconditions.checkNotNull(builder.getAutoscalingPolicy());
+ public static AutoscalingPolicyName of(
+ String project, String location, String autoscalingPolicy) {
+ return newProjectLocationAutoscalingPolicyBuilder()
+ .setProject(project)
+ .setLocation(location)
+ .setAutoscalingPolicy(autoscalingPolicy)
+ .build();
}
- public static AutoscalingPolicyName of(String project, String region, String autoscalingPolicy) {
- return newBuilder()
+ @BetaApi("The static create methods are not stable yet and may be changed in the future.")
+ public static AutoscalingPolicyName ofProjectLocationAutoscalingPolicyName(
+ String project, String location, String autoscalingPolicy) {
+ return newProjectLocationAutoscalingPolicyBuilder()
+ .setProject(project)
+ .setLocation(location)
+ .setAutoscalingPolicy(autoscalingPolicy)
+ .build();
+ }
+
+ @BetaApi("The static create methods are not stable yet and may be changed in the future.")
+ public static AutoscalingPolicyName ofProjectRegionAutoscalingPolicyName(
+ String project, String region, String autoscalingPolicy) {
+ return newProjectRegionAutoscalingPolicyBuilder()
.setProject(project)
.setRegion(region)
.setAutoscalingPolicy(autoscalingPolicy)
.build();
}
- public static String format(String project, String region, String autoscalingPolicy) {
+ public static String format(String project, String location, String autoscalingPolicy) {
return newBuilder()
+ .setProject(project)
+ .setLocation(location)
+ .setAutoscalingPolicy(autoscalingPolicy)
+ .build()
+ .toString();
+ }
+
+ @BetaApi("The static format methods are not stable yet and may be changed in the future.")
+ public static String formatProjectLocationAutoscalingPolicyName(
+ String project, String location, String autoscalingPolicy) {
+ return newBuilder()
+ .setProject(project)
+ .setLocation(location)
+ .setAutoscalingPolicy(autoscalingPolicy)
+ .build()
+ .toString();
+ }
+
+ @BetaApi("The static format methods are not stable yet and may be changed in the future.")
+ public static String formatProjectRegionAutoscalingPolicyName(
+ String project, String region, String autoscalingPolicy) {
+ return newProjectRegionAutoscalingPolicyBuilder()
.setProject(project)
.setRegion(region)
.setAutoscalingPolicy(autoscalingPolicy)
@@ -85,10 +162,18 @@ public static AutoscalingPolicyName parse(String formattedString) {
if (formattedString.isEmpty()) {
return null;
}
- Map matchMap =
- PATH_TEMPLATE.validatedMatch(
- formattedString, "AutoscalingPolicyName.parse: formattedString not in valid format");
- return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("autoscaling_policy"));
+ if (PROJECT_LOCATION_AUTOSCALING_POLICY_PATH_TEMPLATE.matches(formattedString)) {
+ Map matchMap =
+ PROJECT_LOCATION_AUTOSCALING_POLICY_PATH_TEMPLATE.match(formattedString);
+ return ofProjectLocationAutoscalingPolicyName(
+ matchMap.get("project"), matchMap.get("location"), matchMap.get("autoscaling_policy"));
+ } else if (PROJECT_REGION_AUTOSCALING_POLICY_PATH_TEMPLATE.matches(formattedString)) {
+ Map matchMap =
+ PROJECT_REGION_AUTOSCALING_POLICY_PATH_TEMPLATE.match(formattedString);
+ return ofProjectRegionAutoscalingPolicyName(
+ matchMap.get("project"), matchMap.get("region"), matchMap.get("autoscaling_policy"));
+ }
+ throw new ValidationException("JobName.parse: formattedString not in valid format");
}
public static List parseList(List formattedStrings) {
@@ -100,7 +185,7 @@ public static List parseList(List formattedString
}
public static List toStringList(List values) {
- List list = new ArrayList(values.size());
+ List list = new ArrayList<>(values.size());
for (AutoscalingPolicyName value : values) {
if (value == null) {
list.add("");
@@ -112,17 +197,28 @@ public static List toStringList(List values) {
}
public static boolean isParsableFrom(String formattedString) {
- return PATH_TEMPLATE.matches(formattedString);
+ return PROJECT_LOCATION_AUTOSCALING_POLICY_PATH_TEMPLATE.matches(formattedString)
+ || PROJECT_REGION_AUTOSCALING_POLICY_PATH_TEMPLATE.matches(formattedString);
}
+ @Override
public Map getFieldValuesMap() {
if (fieldValuesMap == null) {
synchronized (this) {
if (fieldValuesMap == null) {
ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
- fieldMapBuilder.put("project", project);
- fieldMapBuilder.put("region", region);
- fieldMapBuilder.put("autoscalingPolicy", autoscalingPolicy);
+ if (project != null) {
+ fieldMapBuilder.put("project", project);
+ }
+ if (location != null) {
+ fieldMapBuilder.put("location", location);
+ }
+ if (autoscalingPolicy != null) {
+ fieldMapBuilder.put("autoscaling_policy", autoscalingPolicy);
+ }
+ if (region != null) {
+ fieldMapBuilder.put("region", region);
+ }
fieldValuesMap = fieldMapBuilder.build();
}
}
@@ -136,23 +232,26 @@ public String getFieldValue(String fieldName) {
@Override
public String toString() {
- return PATH_TEMPLATE.instantiate(
- "project", project, "region", region, "autoscaling_policy", autoscalingPolicy);
+ return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap());
}
- /** Builder for AutoscalingPolicyName. */
+ /**
+ * Builder for projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}.
+ */
public static class Builder {
private String project;
- private String region;
+ private String location;
private String autoscalingPolicy;
+ protected Builder() {}
+
public String getProject() {
return project;
}
- public String getRegion() {
- return region;
+ public String getLocation() {
+ return location;
}
public String getAutoscalingPolicy() {
@@ -164,8 +263,8 @@ public Builder setProject(String project) {
return this;
}
- public Builder setRegion(String region) {
- this.region = region;
+ public Builder setLocation(String location) {
+ this.location = location;
return this;
}
@@ -174,11 +273,13 @@ public Builder setAutoscalingPolicy(String autoscalingPolicy) {
return this;
}
- private Builder() {}
-
private Builder(AutoscalingPolicyName autoscalingPolicyName) {
+ Preconditions.checkArgument(
+ autoscalingPolicyName.pathTemplate == PROJECT_LOCATION_AUTOSCALING_POLICY_PATH_TEMPLATE,
+ "toBuilder is only supported when AutoscalingPolicyName has the pattern of "
+ + "projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}.");
project = autoscalingPolicyName.project;
- region = autoscalingPolicyName.region;
+ location = autoscalingPolicyName.location;
autoscalingPolicy = autoscalingPolicyName.autoscalingPolicy;
}
@@ -187,16 +288,59 @@ public AutoscalingPolicyName build() {
}
}
+ /** Builder for projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}. */
+ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
+ public static class ProjectRegionAutoscalingPolicyBuilder {
+
+ private String project;
+ private String region;
+ private String autoscalingPolicy;
+
+ private ProjectRegionAutoscalingPolicyBuilder() {}
+
+ public String getProject() {
+ return project;
+ }
+
+ public String getRegion() {
+ return region;
+ }
+
+ public String getAutoscalingPolicy() {
+ return autoscalingPolicy;
+ }
+
+ public ProjectRegionAutoscalingPolicyBuilder setProject(String project) {
+ this.project = project;
+ return this;
+ }
+
+ public ProjectRegionAutoscalingPolicyBuilder setRegion(String region) {
+ this.region = region;
+ return this;
+ }
+
+ public ProjectRegionAutoscalingPolicyBuilder setAutoscalingPolicy(String autoscalingPolicy) {
+ this.autoscalingPolicy = autoscalingPolicy;
+ return this;
+ }
+
+ public AutoscalingPolicyName build() {
+ return new AutoscalingPolicyName(this);
+ }
+ }
+
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
- if (o instanceof AutoscalingPolicyName) {
+ if (o != null || getClass() == o.getClass()) {
AutoscalingPolicyName that = (AutoscalingPolicyName) o;
- return (this.project.equals(that.project))
- && (this.region.equals(that.region))
- && (this.autoscalingPolicy.equals(that.autoscalingPolicy));
+ return (Objects.equals(this.project, that.project))
+ && (Objects.equals(this.location, that.location))
+ && (Objects.equals(this.autoscalingPolicy, that.autoscalingPolicy))
+ && (Objects.equals(this.region, that.region));
}
return false;
}
@@ -205,11 +349,15 @@ public boolean equals(Object o) {
public int hashCode() {
int h = 1;
h *= 1000003;
- h ^= project.hashCode();
+ h ^= Objects.hashCode(fixedValue);
+ h *= 1000003;
+ h ^= Objects.hashCode(project);
+ h *= 1000003;
+ h ^= Objects.hashCode(location);
h *= 1000003;
- h ^= region.hashCode();
+ h ^= Objects.hashCode(autoscalingPolicy);
h *= 1000003;
- h ^= autoscalingPolicy.hashCode();
+ h ^= Objects.hashCode(region);
return h;
}
}
diff --git a/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LocationName.java b/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LocationName.java
new file mode 100644
index 00000000..ac38238d
--- /dev/null
+++ b/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LocationName.java
@@ -0,0 +1,182 @@
+/*
+ * 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.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceName;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/** AUTO-GENERATED DOCUMENTATION AND CLASS */
+@javax.annotation.Generated("by GAPIC protoc plugin")
+public class LocationName implements ResourceName {
+
+ private static final PathTemplate PATH_TEMPLATE =
+ PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}");
+
+ private volatile Map fieldValuesMap;
+
+ private final String project;
+ private final String location;
+
+ public String getProject() {
+ return project;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public static Builder newBuilder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ private LocationName(Builder builder) {
+ project = Preconditions.checkNotNull(builder.getProject());
+ location = Preconditions.checkNotNull(builder.getLocation());
+ }
+
+ public static LocationName of(String project, String location) {
+ return newBuilder().setProject(project).setLocation(location).build();
+ }
+
+ public static String format(String project, String location) {
+ return newBuilder().setProject(project).setLocation(location).build().toString();
+ }
+
+ public static LocationName parse(String formattedString) {
+ if (formattedString.isEmpty()) {
+ return null;
+ }
+ Map matchMap =
+ PATH_TEMPLATE.validatedMatch(
+ formattedString, "LocationName.parse: formattedString not in valid format");
+ return of(matchMap.get("project"), matchMap.get("location"));
+ }
+
+ public static List parseList(List formattedStrings) {
+ List list = new ArrayList<>(formattedStrings.size());
+ for (String formattedString : formattedStrings) {
+ list.add(parse(formattedString));
+ }
+ return list;
+ }
+
+ public static List toStringList(List values) {
+ List list = new ArrayList(values.size());
+ for (LocationName value : values) {
+ if (value == null) {
+ list.add("");
+ } else {
+ list.add(value.toString());
+ }
+ }
+ return list;
+ }
+
+ public static boolean isParsableFrom(String formattedString) {
+ return PATH_TEMPLATE.matches(formattedString);
+ }
+
+ public Map getFieldValuesMap() {
+ if (fieldValuesMap == null) {
+ synchronized (this) {
+ if (fieldValuesMap == null) {
+ ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
+ fieldMapBuilder.put("project", project);
+ fieldMapBuilder.put("location", location);
+ fieldValuesMap = fieldMapBuilder.build();
+ }
+ }
+ }
+ return fieldValuesMap;
+ }
+
+ public String getFieldValue(String fieldName) {
+ return getFieldValuesMap().get(fieldName);
+ }
+
+ @Override
+ public String toString() {
+ return PATH_TEMPLATE.instantiate("project", project, "location", location);
+ }
+
+ /** Builder for LocationName. */
+ public static class Builder {
+
+ private String project;
+ private String location;
+
+ public String getProject() {
+ return project;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public Builder setProject(String project) {
+ this.project = project;
+ return this;
+ }
+
+ public Builder setLocation(String location) {
+ this.location = location;
+ return this;
+ }
+
+ private Builder() {}
+
+ private Builder(LocationName locationName) {
+ project = locationName.project;
+ location = locationName.location;
+ }
+
+ public LocationName build() {
+ return new LocationName(this);
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (o instanceof LocationName) {
+ LocationName that = (LocationName) o;
+ return (this.project.equals(that.project)) && (this.location.equals(that.location));
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int h = 1;
+ h *= 1000003;
+ h ^= project.hashCode();
+ h *= 1000003;
+ h ^= location.hashCode();
+ return h;
+ }
+}
diff --git a/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateName.java b/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateName.java
index 7d7b8060..167a8a57 100644
--- a/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateName.java
+++ b/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateName.java
@@ -16,27 +16,39 @@
package com.google.cloud.dataproc.v1;
+import com.google.api.core.BetaApi;
import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.pathtemplate.ValidationException;
import com.google.api.resourcenames.ResourceName;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
/** AUTO-GENERATED DOCUMENTATION AND CLASS */
@javax.annotation.Generated("by GAPIC protoc plugin")
public class WorkflowTemplateName implements ResourceName {
- private static final PathTemplate PATH_TEMPLATE =
+ @Deprecated
+ protected WorkflowTemplateName() {}
+
+ private static final PathTemplate PROJECT_REGION_WORKFLOW_TEMPLATE_PATH_TEMPLATE =
PathTemplate.createWithoutUrlEncoding(
"projects/{project}/regions/{region}/workflowTemplates/{workflow_template}");
+ private static final PathTemplate PROJECT_LOCATION_WORKFLOW_TEMPLATE_PATH_TEMPLATE =
+ PathTemplate.createWithoutUrlEncoding(
+ "projects/{project}/locations/{location}/workflowTemplates/{workflow_template}");
private volatile Map fieldValuesMap;
+ private PathTemplate pathTemplate;
+ private String fixedValue;
- private final String project;
- private final String region;
- private final String workflowTemplate;
+ private String project;
+ private String region;
+ private String workflowTemplate;
+ private String location;
public String getProject() {
return project;
@@ -50,28 +62,70 @@ public String getWorkflowTemplate() {
return workflowTemplate;
}
+ public String getLocation() {
+ return location;
+ }
+
+ private WorkflowTemplateName(Builder builder) {
+ project = Preconditions.checkNotNull(builder.getProject());
+ region = Preconditions.checkNotNull(builder.getRegion());
+ workflowTemplate = Preconditions.checkNotNull(builder.getWorkflowTemplate());
+ pathTemplate = PROJECT_REGION_WORKFLOW_TEMPLATE_PATH_TEMPLATE;
+ }
+
+ private WorkflowTemplateName(ProjectLocationWorkflowTemplateBuilder builder) {
+ project = Preconditions.checkNotNull(builder.getProject());
+ location = Preconditions.checkNotNull(builder.getLocation());
+ workflowTemplate = Preconditions.checkNotNull(builder.getWorkflowTemplate());
+ pathTemplate = PROJECT_LOCATION_WORKFLOW_TEMPLATE_PATH_TEMPLATE;
+ }
+
public static Builder newBuilder() {
return new Builder();
}
+ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
+ public static Builder newProjectRegionWorkflowTemplateBuilder() {
+ return new Builder();
+ }
+
+ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
+ public static ProjectLocationWorkflowTemplateBuilder newProjectLocationWorkflowTemplateBuilder() {
+ return new ProjectLocationWorkflowTemplateBuilder();
+ }
+
public Builder toBuilder() {
return new Builder(this);
}
- private WorkflowTemplateName(Builder builder) {
- project = Preconditions.checkNotNull(builder.getProject());
- region = Preconditions.checkNotNull(builder.getRegion());
- workflowTemplate = Preconditions.checkNotNull(builder.getWorkflowTemplate());
+ public static WorkflowTemplateName of(String project, String region, String workflowTemplate) {
+ return newProjectRegionWorkflowTemplateBuilder()
+ .setProject(project)
+ .setRegion(region)
+ .setWorkflowTemplate(workflowTemplate)
+ .build();
}
- public static WorkflowTemplateName of(String project, String region, String workflowTemplate) {
- return newBuilder()
+ @BetaApi("The static create methods are not stable yet and may be changed in the future.")
+ public static WorkflowTemplateName ofProjectRegionWorkflowTemplateName(
+ String project, String region, String workflowTemplate) {
+ return newProjectRegionWorkflowTemplateBuilder()
.setProject(project)
.setRegion(region)
.setWorkflowTemplate(workflowTemplate)
.build();
}
+ @BetaApi("The static create methods are not stable yet and may be changed in the future.")
+ public static WorkflowTemplateName ofProjectLocationWorkflowTemplateName(
+ String project, String location, String workflowTemplate) {
+ return newProjectLocationWorkflowTemplateBuilder()
+ .setProject(project)
+ .setLocation(location)
+ .setWorkflowTemplate(workflowTemplate)
+ .build();
+ }
+
public static String format(String project, String region, String workflowTemplate) {
return newBuilder()
.setProject(project)
@@ -81,14 +135,44 @@ public static String format(String project, String region, String workflowTempla
.toString();
}
+ @BetaApi("The static format methods are not stable yet and may be changed in the future.")
+ public static String formatProjectRegionWorkflowTemplateName(
+ String project, String region, String workflowTemplate) {
+ return newBuilder()
+ .setProject(project)
+ .setRegion(region)
+ .setWorkflowTemplate(workflowTemplate)
+ .build()
+ .toString();
+ }
+
+ @BetaApi("The static format methods are not stable yet and may be changed in the future.")
+ public static String formatProjectLocationWorkflowTemplateName(
+ String project, String location, String workflowTemplate) {
+ return newProjectLocationWorkflowTemplateBuilder()
+ .setProject(project)
+ .setLocation(location)
+ .setWorkflowTemplate(workflowTemplate)
+ .build()
+ .toString();
+ }
+
public static WorkflowTemplateName parse(String formattedString) {
if (formattedString.isEmpty()) {
return null;
}
- Map matchMap =
- PATH_TEMPLATE.validatedMatch(
- formattedString, "WorkflowTemplateName.parse: formattedString not in valid format");
- return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("workflow_template"));
+ if (PROJECT_REGION_WORKFLOW_TEMPLATE_PATH_TEMPLATE.matches(formattedString)) {
+ Map matchMap =
+ PROJECT_REGION_WORKFLOW_TEMPLATE_PATH_TEMPLATE.match(formattedString);
+ return ofProjectRegionWorkflowTemplateName(
+ matchMap.get("project"), matchMap.get("region"), matchMap.get("workflow_template"));
+ } else if (PROJECT_LOCATION_WORKFLOW_TEMPLATE_PATH_TEMPLATE.matches(formattedString)) {
+ Map matchMap =
+ PROJECT_LOCATION_WORKFLOW_TEMPLATE_PATH_TEMPLATE.match(formattedString);
+ return ofProjectLocationWorkflowTemplateName(
+ matchMap.get("project"), matchMap.get("location"), matchMap.get("workflow_template"));
+ }
+ throw new ValidationException("JobName.parse: formattedString not in valid format");
}
public static List parseList(List formattedStrings) {
@@ -100,7 +184,7 @@ public static List parseList(List formattedStrings
}
public static List toStringList(List values) {
- List list = new ArrayList(values.size());
+ List list = new ArrayList<>(values.size());
for (WorkflowTemplateName value : values) {
if (value == null) {
list.add("");
@@ -112,17 +196,28 @@ public static List toStringList(List values) {
}
public static boolean isParsableFrom(String formattedString) {
- return PATH_TEMPLATE.matches(formattedString);
+ return PROJECT_REGION_WORKFLOW_TEMPLATE_PATH_TEMPLATE.matches(formattedString)
+ || PROJECT_LOCATION_WORKFLOW_TEMPLATE_PATH_TEMPLATE.matches(formattedString);
}
+ @Override
public Map getFieldValuesMap() {
if (fieldValuesMap == null) {
synchronized (this) {
if (fieldValuesMap == null) {
ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder();
- fieldMapBuilder.put("project", project);
- fieldMapBuilder.put("region", region);
- fieldMapBuilder.put("workflowTemplate", workflowTemplate);
+ if (project != null) {
+ fieldMapBuilder.put("project", project);
+ }
+ if (region != null) {
+ fieldMapBuilder.put("region", region);
+ }
+ if (workflowTemplate != null) {
+ fieldMapBuilder.put("workflow_template", workflowTemplate);
+ }
+ if (location != null) {
+ fieldMapBuilder.put("location", location);
+ }
fieldValuesMap = fieldMapBuilder.build();
}
}
@@ -136,17 +231,18 @@ public String getFieldValue(String fieldName) {
@Override
public String toString() {
- return PATH_TEMPLATE.instantiate(
- "project", project, "region", region, "workflow_template", workflowTemplate);
+ return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap());
}
- /** Builder for WorkflowTemplateName. */
+ /** Builder for projects/{project}/regions/{region}/workflowTemplates/{workflow_template}. */
public static class Builder {
private String project;
private String region;
private String workflowTemplate;
+ protected Builder() {}
+
public String getProject() {
return project;
}
@@ -174,9 +270,11 @@ public Builder setWorkflowTemplate(String workflowTemplate) {
return this;
}
- private Builder() {}
-
private Builder(WorkflowTemplateName workflowTemplateName) {
+ Preconditions.checkArgument(
+ workflowTemplateName.pathTemplate == PROJECT_REGION_WORKFLOW_TEMPLATE_PATH_TEMPLATE,
+ "toBuilder is only supported when WorkflowTemplateName has the pattern of "
+ + "projects/{project}/regions/{region}/workflowTemplates/{workflow_template}.");
project = workflowTemplateName.project;
region = workflowTemplateName.region;
workflowTemplate = workflowTemplateName.workflowTemplate;
@@ -187,16 +285,59 @@ public WorkflowTemplateName build() {
}
}
+ /** Builder for projects/{project}/locations/{location}/workflowTemplates/{workflow_template}. */
+ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
+ public static class ProjectLocationWorkflowTemplateBuilder {
+
+ private String project;
+ private String location;
+ private String workflowTemplate;
+
+ private ProjectLocationWorkflowTemplateBuilder() {}
+
+ public String getProject() {
+ return project;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getWorkflowTemplate() {
+ return workflowTemplate;
+ }
+
+ public ProjectLocationWorkflowTemplateBuilder setProject(String project) {
+ this.project = project;
+ return this;
+ }
+
+ public ProjectLocationWorkflowTemplateBuilder setLocation(String location) {
+ this.location = location;
+ return this;
+ }
+
+ public ProjectLocationWorkflowTemplateBuilder setWorkflowTemplate(String workflowTemplate) {
+ this.workflowTemplate = workflowTemplate;
+ return this;
+ }
+
+ public WorkflowTemplateName build() {
+ return new WorkflowTemplateName(this);
+ }
+ }
+
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
- if (o instanceof WorkflowTemplateName) {
+ if (o != null || getClass() == o.getClass()) {
WorkflowTemplateName that = (WorkflowTemplateName) o;
- return (this.project.equals(that.project))
- && (this.region.equals(that.region))
- && (this.workflowTemplate.equals(that.workflowTemplate));
+ return (Objects.equals(this.project, that.project))
+ && (Objects.equals(this.region, that.region))
+ && (Objects.equals(this.workflowTemplate, that.workflowTemplate))
+ && (Objects.equals(this.location, that.location));
}
return false;
}
@@ -205,11 +346,15 @@ public boolean equals(Object o) {
public int hashCode() {
int h = 1;
h *= 1000003;
- h ^= project.hashCode();
+ h ^= Objects.hashCode(fixedValue);
+ h *= 1000003;
+ h ^= Objects.hashCode(project);
+ h *= 1000003;
+ h ^= Objects.hashCode(region);
h *= 1000003;
- h ^= region.hashCode();
+ h ^= Objects.hashCode(workflowTemplate);
h *= 1000003;
- h ^= workflowTemplate.hashCode();
+ h ^= Objects.hashCode(location);
return h;
}
}
diff --git a/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/autoscaling_policies.proto b/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/autoscaling_policies.proto
index 53321d89..8d680bcd 100644
--- a/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/autoscaling_policies.proto
+++ b/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/autoscaling_policies.proto
@@ -17,11 +17,11 @@ syntax = "proto3";
package google.cloud.dataproc.v1;
import "google/api/annotations.proto";
+import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
-import "google/api/client.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/v1;dataproc";
option java_multiple_files = true;
@@ -36,10 +36,12 @@ option (google.api.resource_definition) = {
// Dataproc API.
service AutoscalingPolicyService {
option (google.api.default_host) = "dataproc.googleapis.com";
- option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
+ option (google.api.oauth_scopes) =
+ "https://www.googleapis.com/auth/cloud-platform";
// Creates new autoscaling policy.
- rpc CreateAutoscalingPolicy(CreateAutoscalingPolicyRequest) returns (AutoscalingPolicy) {
+ rpc CreateAutoscalingPolicy(CreateAutoscalingPolicyRequest)
+ returns (AutoscalingPolicy) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/autoscalingPolicies"
body: "policy"
@@ -48,13 +50,15 @@ service AutoscalingPolicyService {
body: "policy"
}
};
+ option (google.api.method_signature) = "parent,policy";
}
// Updates (replaces) autoscaling policy.
//
// Disabled check for update_mask, because all updates will be full
// replacements.
- rpc UpdateAutoscalingPolicy(UpdateAutoscalingPolicyRequest) returns (AutoscalingPolicy) {
+ rpc UpdateAutoscalingPolicy(UpdateAutoscalingPolicyRequest)
+ returns (AutoscalingPolicy) {
option (google.api.http) = {
put: "/v1/{policy.name=projects/*/locations/*/autoscalingPolicies/*}"
body: "policy"
@@ -63,37 +67,44 @@ service AutoscalingPolicyService {
body: "policy"
}
};
+ option (google.api.method_signature) = "policy";
}
// Retrieves autoscaling policy.
- rpc GetAutoscalingPolicy(GetAutoscalingPolicyRequest) returns (AutoscalingPolicy) {
+ rpc GetAutoscalingPolicy(GetAutoscalingPolicyRequest)
+ returns (AutoscalingPolicy) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}"
additional_bindings {
get: "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}"
}
};
+ option (google.api.method_signature) = "name";
}
// Lists autoscaling policies in the project.
- rpc ListAutoscalingPolicies(ListAutoscalingPoliciesRequest) returns (ListAutoscalingPoliciesResponse) {
+ rpc ListAutoscalingPolicies(ListAutoscalingPoliciesRequest)
+ returns (ListAutoscalingPoliciesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/autoscalingPolicies"
additional_bindings {
get: "/v1/{parent=projects/*/regions/*}/autoscalingPolicies"
}
};
+ option (google.api.method_signature) = "parent";
}
// Deletes an autoscaling policy. It is an error to delete an autoscaling
// policy that is in use by one or more clusters.
- rpc DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest) returns (google.protobuf.Empty) {
+ rpc DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest)
+ returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}"
additional_bindings {
delete: "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}"
}
};
+ option (google.api.method_signature) = "name";
}
}
@@ -127,26 +138,31 @@ message AutoscalingPolicy {
// Autoscaling algorithm for policy.
oneof algorithm {
- BasicAutoscalingAlgorithm basic_algorithm = 3 [(google.api.field_behavior) = REQUIRED];
+ BasicAutoscalingAlgorithm basic_algorithm = 3
+ [(google.api.field_behavior) = REQUIRED];
}
// Required. Describes how the autoscaler will operate for primary workers.
- InstanceGroupAutoscalingPolicyConfig worker_config = 4 [(google.api.field_behavior) = REQUIRED];
+ InstanceGroupAutoscalingPolicyConfig worker_config = 4
+ [(google.api.field_behavior) = REQUIRED];
// Optional. Describes how the autoscaler will operate for secondary workers.
- InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 [(google.api.field_behavior) = OPTIONAL];
+ InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5
+ [(google.api.field_behavior) = OPTIONAL];
}
// Basic algorithm for autoscaling.
message BasicAutoscalingAlgorithm {
// Required. YARN autoscaling configuration.
- BasicYarnAutoscalingConfig yarn_config = 1 [(google.api.field_behavior) = REQUIRED];
+ BasicYarnAutoscalingConfig yarn_config = 1
+ [(google.api.field_behavior) = REQUIRED];
// Optional. Duration between scaling events. A scaling period starts after
// the update operation from the previous event has completed.
//
// Bounds: [2m, 1d]. Default: 2m.
- google.protobuf.Duration cooldown_period = 2 [(google.api.field_behavior) = OPTIONAL];
+ google.protobuf.Duration cooldown_period = 2
+ [(google.api.field_behavior) = OPTIONAL];
}
// Basic autoscaling configurations for YARN.
@@ -157,7 +173,8 @@ message BasicYarnAutoscalingConfig {
// downscaling operations.
//
// Bounds: [0s, 1d].
- google.protobuf.Duration graceful_decommission_timeout = 5 [(google.api.field_behavior) = REQUIRED];
+ google.protobuf.Duration graceful_decommission_timeout = 5
+ [(google.api.field_behavior) = REQUIRED];
// Required. Fraction of average pending memory in the last cooldown period
// for which to add workers. A scale-up factor of 1.0 will result in scaling
@@ -184,7 +201,8 @@ message BasicYarnAutoscalingConfig {
// on any recommended change.
//
// Bounds: [0.0, 1.0]. Default: 0.0.
- double scale_up_min_worker_fraction = 3 [(google.api.field_behavior) = OPTIONAL];
+ double scale_up_min_worker_fraction = 3
+ [(google.api.field_behavior) = OPTIONAL];
// Optional. Minimum scale-down threshold as a fraction of total cluster size
// before scaling occurs. For example, in a 20-worker cluster, a threshold of
@@ -193,7 +211,8 @@ message BasicYarnAutoscalingConfig {
// on any recommended change.
//
// Bounds: [0.0, 1.0]. Default: 0.0.
- double scale_down_min_worker_fraction = 4 [(google.api.field_behavior) = OPTIONAL];
+ double scale_down_min_worker_fraction = 4
+ [(google.api.field_behavior) = OPTIONAL];
}
// Configuration for the size bounds of an instance group, including its
@@ -336,7 +355,8 @@ message ListAutoscalingPoliciesRequest {
// A response to a request to list autoscaling policies in a project.
message ListAutoscalingPoliciesResponse {
// Output only. Autoscaling policies list.
- repeated AutoscalingPolicy policies = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
+ repeated AutoscalingPolicy policies = 1
+ [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. This token is included in the response if there are more
// results to fetch.
diff --git a/proto-google-cloud-dataproc-v1beta2/clirr-ignored-differences.xml b/proto-google-cloud-dataproc-v1beta2/clirr-ignored-differences.xml
new file mode 100644
index 00000000..e1497cef
--- /dev/null
+++ b/proto-google-cloud-dataproc-v1beta2/clirr-ignored-differences.xml
@@ -0,0 +1,9 @@
+
+
+
+
+ 7002
+ com/google/cloud/dataproc/v1beta2/AutoscalingPolicyName$Builder
+ * *etRegion(*)
+
+
diff --git a/proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPoliciesProto.java b/proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPoliciesProto.java
index 42d4107c..096b7f2e 100644
--- a/proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPoliciesProto.java
+++ b/proto-google-cloud-dataproc-v1beta2/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPoliciesProto.java
@@ -92,10 +92,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "orker_config\030\005 \001(\0132C.google.cloud.datapr"
+ "oc.v1beta2.InstanceGroupAutoscalingPolic"
+ "yConfigB\003\340A\001:\321\001\352A\315\001\n)dataproc.googleapis"
- + ".com/AutoscalingPolicy\022Lprojects/{projec"
- + "t}/regions/{region}/autoscalingPolicies/"
- + "{autoscaling_policy}\022Pprojects/{project}"
- + "/locations/{location}/autoscalingPolicie"
+ + ".com/AutoscalingPolicy\022Pprojects/{projec"
+ + "t}/locations/{location}/autoscalingPolic"
+ + "ies/{autoscaling_policy}\022Lprojects/{proj"
+ + "ect}/regions/{region}/autoscalingPolicie"
+ "s/{autoscaling_policy} \001B\013\n\talgorithm\"\251\001"
+ "\n\031BasicAutoscalingAlgorithm\022S\n\013yarn_conf"
+ "ig\030\001 \001(\01329.google.cloud.dataproc.v1beta2"
@@ -117,63 +117,63 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ ".v1beta2.AutoscalingPolicyB\003\340A\002\"^\n\033GetAu"
+ "toscalingPolicyRequest\022?\n\004name\030\001 \001(\tB1\340A"
+ "\002\372A+\n)dataproc.googleapis.com/Autoscalin"
- + "gPolicy\"\225\001\n\036UpdateAutoscalingPolicyReque"
- + "st\022s\n\006policy\030\001 \001(\01320.google.cloud.datapr"
- + "oc.v1beta2.AutoscalingPolicyB1\340A\002\372A+\n)da"
- + "taproc.googleapis.com/AutoscalingPolicy\""
- + "a\n\036DeleteAutoscalingPolicyRequest\022?\n\004nam"
- + "e\030\001 \001(\tB1\340A\002\372A+\n)dataproc.googleapis.com"
- + "/AutoscalingPolicy\"\224\001\n\036ListAutoscalingPo"
- + "liciesRequest\022A\n\006parent\030\001 \001(\tB1\340A\002\372A+\022)d"
- + "ataproc.googleapis.com/AutoscalingPolicy"
- + "\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003"
- + " \001(\tB\003\340A\001\"\210\001\n\037ListAutoscalingPoliciesRes"
- + "ponse\022G\n\010policies\030\001 \003(\01320.google.cloud.d"
- + "ataproc.v1beta2.AutoscalingPolicyB\003\340A\003\022\034"
- + "\n\017next_page_token\030\002 \001(\tB\003\340A\0032\217\014\n\030Autosca"
- + "lingPolicyService\022\260\002\n\027CreateAutoscalingP"
- + "olicy\022=.google.cloud.dataproc.v1beta2.Cr"
- + "eateAutoscalingPolicyRequest\0320.google.cl"
- + "oud.dataproc.v1beta2.AutoscalingPolicy\"\243"
- + "\001\202\323\344\223\002\214\001\".google.cloud.dataproc.v1beta2.Lis"
- + "tAutoscalingPoliciesResponse\"\213\001\202\323\344\223\002|\022"
- + "v1beta2/{parent=projects/*/locations/*}/"
- + "autoscalingPoliciesZ<\022:/v1beta2/{parent="
- + "projects/*/regions/*}/autoscalingPolicie"
- + "s\332A\006parent\022\374\001\n\027DeleteAutoscalingPolicy\022="
- + ".google.cloud.dataproc.v1beta2.DeleteAut"
- + "oscalingPolicyRequest\032\026.google.protobuf."
- + "Empty\"\211\001\202\323\344\223\002|*."
+ + "google.cloud.dataproc.v1beta2.ListAutosc"
+ + "alingPoliciesResponse\"\213\001\202\323\344\223\002|\022 fieldValuesMap;
+ private PathTemplate pathTemplate;
+ private String fixedValue;
- private final String project;
- private final String region;
- private final String autoscalingPolicy;
+ private String project;
+ private String location;
+ private String autoscalingPolicy;
+ private String region;
public String getProject() {
return project;
}
- public String getRegion() {
- return region;
+ public String getLocation() {
+ return location;
}
public String getAutoscalingPolicy() {
return autoscalingPolicy;
}
+ public String getRegion() {
+ return region;
+ }
+
+ private AutoscalingPolicyName(Builder builder) {
+ project = Preconditions.checkNotNull(builder.getProject());
+ location = Preconditions.checkNotNull(builder.getLocation());
+ autoscalingPolicy = Preconditions.checkNotNull(builder.getAutoscalingPolicy());
+ pathTemplate = PROJECT_LOCATION_AUTOSCALING_POLICY_PATH_TEMPLATE;
+ }
+
+ private AutoscalingPolicyName(ProjectRegionAutoscalingPolicyBuilder builder) {
+ project = Preconditions.checkNotNull(builder.getProject());
+ region = Preconditions.checkNotNull(builder.getRegion());
+ autoscalingPolicy = Preconditions.checkNotNull(builder.getAutoscalingPolicy());
+ pathTemplate = PROJECT_REGION_AUTOSCALING_POLICY_PATH_TEMPLATE;
+ }
+
public static Builder newBuilder() {
return new Builder();
}
+ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
+ public static Builder newProjectLocationAutoscalingPolicyBuilder() {
+ return new Builder();
+ }
+
+ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
+ public static ProjectRegionAutoscalingPolicyBuilder newProjectRegionAutoscalingPolicyBuilder() {
+ return new ProjectRegionAutoscalingPolicyBuilder();
+ }
+
public Builder toBuilder() {
return new Builder(this);
}
- private AutoscalingPolicyName(Builder builder) {
- project = Preconditions.checkNotNull(builder.getProject());
- region = Preconditions.checkNotNull(builder.getRegion());
- autoscalingPolicy = Preconditions.checkNotNull(builder.getAutoscalingPolicy());
+ public static AutoscalingPolicyName of(
+ String project, String location, String autoscalingPolicy) {
+ return newProjectLocationAutoscalingPolicyBuilder()
+ .setProject(project)
+ .setLocation(location)
+ .setAutoscalingPolicy(autoscalingPolicy)
+ .build();
}
- public static AutoscalingPolicyName of(String project, String region, String autoscalingPolicy) {
- return newBuilder()
+ @BetaApi("The static create methods are not stable yet and may be changed in the future.")
+ public static AutoscalingPolicyName ofProjectLocationAutoscalingPolicyName(
+ String project, String location, String autoscalingPolicy) {
+ return newProjectLocationAutoscalingPolicyBuilder()
+ .setProject(project)
+ .setLocation(location)
+ .setAutoscalingPolicy(autoscalingPolicy)
+ .build();
+ }
+
+ @BetaApi("The static create methods are not stable yet and may be changed in the future.")
+ public static AutoscalingPolicyName ofProjectRegionAutoscalingPolicyName(
+ String project, String region, String autoscalingPolicy) {
+ return newProjectRegionAutoscalingPolicyBuilder()
.setProject(project)
.setRegion(region)
.setAutoscalingPolicy(autoscalingPolicy)
.build();
}
- public static String format(String project, String region, String autoscalingPolicy) {
+ public static String format(String project, String location, String autoscalingPolicy) {
return newBuilder()
+ .setProject(project)
+ .setLocation(location)
+ .setAutoscalingPolicy(autoscalingPolicy)
+ .build()
+ .toString();
+ }
+
+ @BetaApi("The static format methods are not stable yet and may be changed in the future.")
+ public static String formatProjectLocationAutoscalingPolicyName(
+ String project, String location, String autoscalingPolicy) {
+ return newBuilder()
+ .setProject(project)
+ .setLocation(location)
+ .setAutoscalingPolicy(autoscalingPolicy)
+ .build()
+ .toString();
+ }
+
+ @BetaApi("The static format methods are not stable yet and may be changed in the future.")
+ public static String formatProjectRegionAutoscalingPolicyName(
+ String project, String region, String autoscalingPolicy) {
+ return newProjectRegionAutoscalingPolicyBuilder()
.setProject(project)
.setRegion(region)
.setAutoscalingPolicy(autoscalingPolicy)
@@ -85,10 +162,18 @@ public static AutoscalingPolicyName parse(String formattedString) {
if (formattedString.isEmpty()) {
return null;
}
- Map matchMap =
- PATH_TEMPLATE.validatedMatch(
- formattedString, "AutoscalingPolicyName.parse: formattedString not in valid format");
- return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("autoscaling_policy"));
+ if (PROJECT_LOCATION_AUTOSCALING_POLICY_PATH_TEMPLATE.matches(formattedString)) {
+ Map matchMap =
+ PROJECT_LOCATION_AUTOSCALING_POLICY_PATH_TEMPLATE.match(formattedString);
+ return ofProjectLocationAutoscalingPolicyName(
+ matchMap.get("project"), matchMap.get("location"), matchMap.get("autoscaling_policy"));
+ } else if (PROJECT_REGION_AUTOSCALING_POLICY_PATH_TEMPLATE.matches(formattedString)) {
+ Map matchMap =
+ PROJECT_REGION_AUTOSCALING_POLICY_PATH_TEMPLATE.match(formattedString);
+ return ofProjectRegionAutoscalingPolicyName(
+ matchMap.get("project"), matchMap.get("region"), matchMap.get("autoscaling_policy"));
+ }
+ throw new ValidationException("JobName.parse: formattedString not in valid format");
}
public static List parseList(List formattedStrings) {
@@ -100,7 +185,7 @@ public static List parseList(List formattedString
}
public static List toStringList(List values) {
- List list = new ArrayList(values.size());
+ List list = new ArrayList<>(values.size());
for (AutoscalingPolicyName value : values) {
if (value == null) {
list.add("");
@@ -112,17 +197,28 @@ public static List toStringList(List values) {
}
public static boolean isParsableFrom(String formattedString) {
- return PATH_TEMPLATE.matches(formattedString);
+ return PROJECT_LOCATION_AUTOSCALING_POLICY_PATH_TEMPLATE.matches(formattedString)
+ || PROJECT_REGION_AUTOSCALING_POLICY_PATH_TEMPLATE.matches(formattedString);
}
+ @Override
public Map