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

Commit

Permalink
fix: migrate to grpc_service_config (#248)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/e9c50d75-a1ba-4ad3-a81e-eb3c5e7845ef/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 320442976
Source-Link: googleapis/googleapis@ec05fa8
PiperOrigin-RevId: 320442657
Source-Link: googleapis/googleapis@979372f
  • Loading branch information
yoshi-automation committed Jul 10, 2020
1 parent f246195 commit bef1b0d
Show file tree
Hide file tree
Showing 45 changed files with 3,456 additions and 2,978 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit bef1b0d

Please sign in to comment.