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

Commit bef1b0d

Browse files
fix: migrate to grpc_service_config (#248)
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
1 parent f246195 commit bef1b0d

File tree

45 files changed

+3456
-2978
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3456
-2978
lines changed

google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java

Lines changed: 76 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
4444
* <pre>
4545
* <code>
4646
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
47+
* RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
4748
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
48-
* AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
49+
* AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy);
4950
* }
5051
* </code>
5152
* </pre>
@@ -157,80 +158,6 @@ public AutoscalingPolicyServiceStub getStub() {
157158
return stub;
158159
}
159160

160-
// AUTO-GENERATED DOCUMENTATION AND METHOD
161-
/**
162-
* Updates (replaces) autoscaling policy.
163-
*
164-
* <p>Disabled check for update_mask, because all updates will be full replacements.
165-
*
166-
* <p>Sample code:
167-
*
168-
* <pre><code>
169-
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
170-
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
171-
* AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
172-
* }
173-
* </code></pre>
174-
*
175-
* @param policy Required. The updated autoscaling policy.
176-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
177-
*/
178-
public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) {
179-
UpdateAutoscalingPolicyRequest request =
180-
UpdateAutoscalingPolicyRequest.newBuilder().setPolicy(policy).build();
181-
return updateAutoscalingPolicy(request);
182-
}
183-
184-
// AUTO-GENERATED DOCUMENTATION AND METHOD
185-
/**
186-
* Updates (replaces) autoscaling policy.
187-
*
188-
* <p>Disabled check for update_mask, because all updates will be full replacements.
189-
*
190-
* <p>Sample code:
191-
*
192-
* <pre><code>
193-
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
194-
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
195-
* UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
196-
* .setPolicy(policy)
197-
* .build();
198-
* AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(request);
199-
* }
200-
* </code></pre>
201-
*
202-
* @param request The request object containing all of the parameters for the API call.
203-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
204-
*/
205-
public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request) {
206-
return updateAutoscalingPolicyCallable().call(request);
207-
}
208-
209-
// AUTO-GENERATED DOCUMENTATION AND METHOD
210-
/**
211-
* Updates (replaces) autoscaling policy.
212-
*
213-
* <p>Disabled check for update_mask, because all updates will be full replacements.
214-
*
215-
* <p>Sample code:
216-
*
217-
* <pre><code>
218-
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
219-
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
220-
* UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
221-
* .setPolicy(policy)
222-
* .build();
223-
* ApiFuture&lt;AutoscalingPolicy&gt; future = autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request);
224-
* // Do something
225-
* AutoscalingPolicy response = future.get();
226-
* }
227-
* </code></pre>
228-
*/
229-
public final UnaryCallable<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
230-
updateAutoscalingPolicyCallable() {
231-
return stub.updateAutoscalingPolicyCallable();
232-
}
233-
234161
// AUTO-GENERATED DOCUMENTATION AND METHOD
235162
/**
236163
* Creates new autoscaling policy.
@@ -376,6 +303,80 @@ public final AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRe
376303
return stub.createAutoscalingPolicyCallable();
377304
}
378305

306+
// AUTO-GENERATED DOCUMENTATION AND METHOD
307+
/**
308+
* Updates (replaces) autoscaling policy.
309+
*
310+
* <p>Disabled check for update_mask, because all updates will be full replacements.
311+
*
312+
* <p>Sample code:
313+
*
314+
* <pre><code>
315+
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
316+
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
317+
* AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
318+
* }
319+
* </code></pre>
320+
*
321+
* @param policy Required. The updated autoscaling policy.
322+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
323+
*/
324+
public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) {
325+
UpdateAutoscalingPolicyRequest request =
326+
UpdateAutoscalingPolicyRequest.newBuilder().setPolicy(policy).build();
327+
return updateAutoscalingPolicy(request);
328+
}
329+
330+
// AUTO-GENERATED DOCUMENTATION AND METHOD
331+
/**
332+
* Updates (replaces) autoscaling policy.
333+
*
334+
* <p>Disabled check for update_mask, because all updates will be full replacements.
335+
*
336+
* <p>Sample code:
337+
*
338+
* <pre><code>
339+
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
340+
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
341+
* UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
342+
* .setPolicy(policy)
343+
* .build();
344+
* AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(request);
345+
* }
346+
* </code></pre>
347+
*
348+
* @param request The request object containing all of the parameters for the API call.
349+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
350+
*/
351+
public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request) {
352+
return updateAutoscalingPolicyCallable().call(request);
353+
}
354+
355+
// AUTO-GENERATED DOCUMENTATION AND METHOD
356+
/**
357+
* Updates (replaces) autoscaling policy.
358+
*
359+
* <p>Disabled check for update_mask, because all updates will be full replacements.
360+
*
361+
* <p>Sample code:
362+
*
363+
* <pre><code>
364+
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
365+
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
366+
* UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
367+
* .setPolicy(policy)
368+
* .build();
369+
* ApiFuture&lt;AutoscalingPolicy&gt; future = autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request);
370+
* // Do something
371+
* AutoscalingPolicy response = future.get();
372+
* }
373+
* </code></pre>
374+
*/
375+
public final UnaryCallable<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
376+
updateAutoscalingPolicyCallable() {
377+
return stub.updateAutoscalingPolicyCallable();
378+
}
379+
379380
// AUTO-GENERATED DOCUMENTATION AND METHOD
380381
/**
381382
* Retrieves autoscaling policy.

google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@
4949
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
5050
* build() is called, the tree of builders is called to create the complete settings object.
5151
*
52-
* <p>For example, to set the total timeout of updateAutoscalingPolicy to 30 seconds:
52+
* <p>For example, to set the total timeout of createAutoscalingPolicy to 30 seconds:
5353
*
5454
* <pre>
5555
* <code>
5656
* AutoscalingPolicyServiceSettings.Builder autoscalingPolicyServiceSettingsBuilder =
5757
* AutoscalingPolicyServiceSettings.newBuilder();
5858
* autoscalingPolicyServiceSettingsBuilder
59-
* .updateAutoscalingPolicySettings()
59+
* .createAutoscalingPolicySettings()
6060
* .setRetrySettings(
61-
* autoscalingPolicyServiceSettingsBuilder.updateAutoscalingPolicySettings().getRetrySettings().toBuilder()
61+
* autoscalingPolicyServiceSettingsBuilder.createAutoscalingPolicySettings().getRetrySettings().toBuilder()
6262
* .setTotalTimeout(Duration.ofSeconds(30))
6363
* .build());
6464
* AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings = autoscalingPolicyServiceSettingsBuilder.build();
@@ -69,20 +69,20 @@
6969
@BetaApi
7070
public class AutoscalingPolicyServiceSettings
7171
extends ClientSettings<AutoscalingPolicyServiceSettings> {
72-
/** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
73-
public UnaryCallSettings<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
74-
updateAutoscalingPolicySettings() {
75-
return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
76-
.updateAutoscalingPolicySettings();
77-
}
78-
7972
/** Returns the object with the settings used for calls to createAutoscalingPolicy. */
8073
public UnaryCallSettings<CreateAutoscalingPolicyRequest, AutoscalingPolicy>
8174
createAutoscalingPolicySettings() {
8275
return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
8376
.createAutoscalingPolicySettings();
8477
}
8578

79+
/** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
80+
public UnaryCallSettings<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
81+
updateAutoscalingPolicySettings() {
82+
return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
83+
.updateAutoscalingPolicySettings();
84+
}
85+
8686
/** Returns the object with the settings used for calls to getAutoscalingPolicy. */
8787
public UnaryCallSettings<GetAutoscalingPolicyRequest, AutoscalingPolicy>
8888
getAutoscalingPolicySettings() {
@@ -205,18 +205,18 @@ public Builder applyToAllUnaryMethods(
205205
return this;
206206
}
207207

208-
/** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
209-
public UnaryCallSettings.Builder<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
210-
updateAutoscalingPolicySettings() {
211-
return getStubSettingsBuilder().updateAutoscalingPolicySettings();
212-
}
213-
214208
/** Returns the builder for the settings used for calls to createAutoscalingPolicy. */
215209
public UnaryCallSettings.Builder<CreateAutoscalingPolicyRequest, AutoscalingPolicy>
216210
createAutoscalingPolicySettings() {
217211
return getStubSettingsBuilder().createAutoscalingPolicySettings();
218212
}
219213

214+
/** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
215+
public UnaryCallSettings.Builder<UpdateAutoscalingPolicyRequest, AutoscalingPolicy>
216+
updateAutoscalingPolicySettings() {
217+
return getStubSettingsBuilder().updateAutoscalingPolicySettings();
218+
}
219+
220220
/** Returns the builder for the settings used for calls to getAutoscalingPolicy. */
221221
public UnaryCallSettings.Builder<GetAutoscalingPolicyRequest, AutoscalingPolicy>
222222
getAutoscalingPolicySettings() {

0 commit comments

Comments
 (0)