Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

fix: migrate to grpc_service_config #248

Merged
merged 2 commits into from Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -44,8 +44,9 @@
* <pre>
* <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);
* }
* </code>
* </pre>
Expand Down Expand Up @@ -157,80 +158,6 @@ public AutoscalingPolicyServiceStub getStub() {
return stub;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates (replaces) autoscaling policy.
*
* <p>Disabled check for update_mask, because all updates will be full replacements.
*
* <p>Sample code:
*
* <pre><code>
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
* AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
* }
* </code></pre>
*
* @param policy Required. The updated autoscaling policy.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) {
UpdateAutoscalingPolicyRequest request =
UpdateAutoscalingPolicyRequest.newBuilder().setPolicy(policy).build();
return updateAutoscalingPolicy(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates (replaces) autoscaling policy.
*
* <p>Disabled check for update_mask, because all updates will be full replacements.
*
* <p>Sample code:
*
* <pre><code>
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
* UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
* .setPolicy(policy)
* .build();
* AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(request);
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request) {
return updateAutoscalingPolicyCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates (replaces) autoscaling policy.
*
* <p>Disabled check for update_mask, because all updates will be full replacements.
*
* <p>Sample code:
*
* <pre><code>
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
* UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
* .setPolicy(policy)
* .build();
* ApiFuture&lt;AutoscalingPolicy&gt; future = autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request);
* // Do something
* AutoscalingPolicy response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
updateAutoscalingPolicyCallable() {
return stub.updateAutoscalingPolicyCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates new autoscaling policy.
Expand Down Expand Up @@ -376,6 +303,80 @@ public final AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRe
return stub.createAutoscalingPolicyCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates (replaces) autoscaling policy.
*
* <p>Disabled check for update_mask, because all updates will be full replacements.
*
* <p>Sample code:
*
* <pre><code>
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
* AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
* }
* </code></pre>
*
* @param policy Required. The updated autoscaling policy.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) {
UpdateAutoscalingPolicyRequest request =
UpdateAutoscalingPolicyRequest.newBuilder().setPolicy(policy).build();
return updateAutoscalingPolicy(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates (replaces) autoscaling policy.
*
* <p>Disabled check for update_mask, because all updates will be full replacements.
*
* <p>Sample code:
*
* <pre><code>
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
* UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
* .setPolicy(policy)
* .build();
* AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(request);
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request) {
return updateAutoscalingPolicyCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates (replaces) autoscaling policy.
*
* <p>Disabled check for update_mask, because all updates will be full replacements.
*
* <p>Sample code:
*
* <pre><code>
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
* UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
* .setPolicy(policy)
* .build();
* ApiFuture&lt;AutoscalingPolicy&gt; future = autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request);
* // Do something
* AutoscalingPolicy response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
updateAutoscalingPolicyCallable() {
return stub.updateAutoscalingPolicyCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Retrieves autoscaling policy.
Expand Down
Expand Up @@ -49,16 +49,16 @@
* <p>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.
*
* <p>For example, to set the total timeout of updateAutoscalingPolicy to 30 seconds:
* <p>For example, to set the total timeout of createAutoscalingPolicy to 30 seconds:
*
* <pre>
* <code>
* AutoscalingPolicyServiceSettings.Builder autoscalingPolicyServiceSettingsBuilder =
* AutoscalingPolicyServiceSettings.newBuilder();
* autoscalingPolicyServiceSettingsBuilder
* .updateAutoscalingPolicySettings()
* .createAutoscalingPolicySettings()
* .setRetrySettings(
* autoscalingPolicyServiceSettingsBuilder.updateAutoscalingPolicySettings().getRetrySettings().toBuilder()
* autoscalingPolicyServiceSettingsBuilder.createAutoscalingPolicySettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings = autoscalingPolicyServiceSettingsBuilder.build();
Expand All @@ -69,20 +69,20 @@
@BetaApi
public class AutoscalingPolicyServiceSettings
extends ClientSettings<AutoscalingPolicyServiceSettings> {
/** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
public UnaryCallSettings<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
updateAutoscalingPolicySettings() {
return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
.updateAutoscalingPolicySettings();
}

/** Returns the object with the settings used for calls to createAutoscalingPolicy. */
public UnaryCallSettings<CreateAutoscalingPolicyRequest, AutoscalingPolicy>
createAutoscalingPolicySettings() {
return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
.createAutoscalingPolicySettings();
}

/** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
public UnaryCallSettings<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
updateAutoscalingPolicySettings() {
return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
.updateAutoscalingPolicySettings();
}

/** Returns the object with the settings used for calls to getAutoscalingPolicy. */
public UnaryCallSettings<GetAutoscalingPolicyRequest, AutoscalingPolicy>
getAutoscalingPolicySettings() {
Expand Down Expand Up @@ -205,18 +205,18 @@ public Builder applyToAllUnaryMethods(
return this;
}

/** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
public UnaryCallSettings.Builder<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
updateAutoscalingPolicySettings() {
return getStubSettingsBuilder().updateAutoscalingPolicySettings();
}

/** Returns the builder for the settings used for calls to createAutoscalingPolicy. */
public UnaryCallSettings.Builder<CreateAutoscalingPolicyRequest, AutoscalingPolicy>
createAutoscalingPolicySettings() {
return getStubSettingsBuilder().createAutoscalingPolicySettings();
}

/** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
public UnaryCallSettings.Builder<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
updateAutoscalingPolicySettings() {
return getStubSettingsBuilder().updateAutoscalingPolicySettings();
}

/** Returns the builder for the settings used for calls to getAutoscalingPolicy. */
public UnaryCallSettings.Builder<GetAutoscalingPolicyRequest, AutoscalingPolicy>
getAutoscalingPolicySettings() {
Expand Down