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

Commit 9f29581

Browse files
fix: migrate billing/v1 to grpc_service_config (#146)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/2e2af012-7d46-45a9-9790-2acbfe2ab896/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 318891538 Source-Link: googleapis/googleapis@d7c66c9
1 parent 4963b24 commit 9f29581

File tree

3 files changed

+82
-38
lines changed

3 files changed

+82
-38
lines changed

google-cloud-billing/src/main/java/com/google/cloud/billing/v1/stub/CloudBillingStubSettings.java

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,15 @@ public static class Builder extends StubSettings.Builder<CloudBillingStubSetting
435435
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
436436
ImmutableMap.builder();
437437
definitions.put(
438-
"idempotent",
438+
"retry_policy_1_codes",
439439
ImmutableSet.copyOf(
440440
Lists.<StatusCode.Code>newArrayList(
441441
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
442-
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
442+
definitions.put(
443+
"no_retry_2_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
444+
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
445+
definitions.put(
446+
"no_retry_1_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
443447
RETRYABLE_CODE_DEFINITIONS = definitions.build();
444448
}
445449

@@ -453,12 +457,30 @@ public static class Builder extends StubSettings.Builder<CloudBillingStubSetting
453457
.setInitialRetryDelay(Duration.ofMillis(100L))
454458
.setRetryDelayMultiplier(1.3)
455459
.setMaxRetryDelay(Duration.ofMillis(60000L))
456-
.setInitialRpcTimeout(Duration.ofMillis(20000L))
460+
.setInitialRpcTimeout(Duration.ofMillis(60000L))
461+
.setRpcTimeoutMultiplier(1.0)
462+
.setMaxRpcTimeout(Duration.ofMillis(60000L))
463+
.setTotalTimeout(Duration.ofMillis(60000L))
464+
.build();
465+
definitions.put("retry_policy_1_params", settings);
466+
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
467+
definitions.put("no_retry_params", settings);
468+
settings =
469+
RetrySettings.newBuilder()
470+
.setInitialRpcTimeout(Duration.ofMillis(60000L))
471+
.setRpcTimeoutMultiplier(1.0)
472+
.setMaxRpcTimeout(Duration.ofMillis(60000L))
473+
.setTotalTimeout(Duration.ofMillis(60000L))
474+
.build();
475+
definitions.put("no_retry_1_params", settings);
476+
settings =
477+
RetrySettings.newBuilder()
478+
.setInitialRpcTimeout(Duration.ofMillis(60000L))
457479
.setRpcTimeoutMultiplier(1.0)
458-
.setMaxRpcTimeout(Duration.ofMillis(20000L))
459-
.setTotalTimeout(Duration.ofMillis(600000L))
480+
.setMaxRpcTimeout(Duration.ofMillis(60000L))
481+
.setTotalTimeout(Duration.ofMillis(60000L))
460482
.build();
461-
definitions.put("default", settings);
483+
definitions.put("no_retry_2_params", settings);
462484
RETRY_PARAM_DEFINITIONS = definitions.build();
463485
}
464486

@@ -520,53 +542,53 @@ private static Builder initDefaults(Builder builder) {
520542

521543
builder
522544
.getBillingAccountSettings()
523-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
524-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
545+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
546+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
525547

526548
builder
527549
.listBillingAccountsSettings()
528-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
529-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
550+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
551+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
530552

531553
builder
532554
.updateBillingAccountSettings()
533-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
534-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
555+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
556+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
535557

536558
builder
537559
.createBillingAccountSettings()
538-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
539-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
560+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
561+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
540562

541563
builder
542564
.listProjectBillingInfoSettings()
543-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
544-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
565+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
566+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
545567

546568
builder
547569
.getProjectBillingInfoSettings()
548-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
549-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
570+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
571+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
550572

551573
builder
552574
.updateProjectBillingInfoSettings()
553-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
554-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
575+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
576+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
555577

556578
builder
557579
.getIamPolicySettings()
558-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
559-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
580+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
581+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
560582

561583
builder
562584
.setIamPolicySettings()
563-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
564-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
585+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
586+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
565587

566588
builder
567589
.testIamPermissionsSettings()
568-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
569-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
590+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
591+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
570592

571593
return builder;
572594
}

google-cloud-billing/src/main/java/com/google/cloud/billing/v1/stub/CloudCatalogStubSettings.java

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,15 @@ public static class Builder extends StubSettings.Builder<CloudCatalogStubSetting
307307
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
308308
ImmutableMap.builder();
309309
definitions.put(
310-
"idempotent",
310+
"retry_policy_1_codes",
311311
ImmutableSet.copyOf(
312312
Lists.<StatusCode.Code>newArrayList(
313313
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
314-
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
314+
definitions.put(
315+
"no_retry_2_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
316+
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
317+
definitions.put(
318+
"no_retry_1_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
315319
RETRYABLE_CODE_DEFINITIONS = definitions.build();
316320
}
317321

@@ -325,12 +329,30 @@ public static class Builder extends StubSettings.Builder<CloudCatalogStubSetting
325329
.setInitialRetryDelay(Duration.ofMillis(100L))
326330
.setRetryDelayMultiplier(1.3)
327331
.setMaxRetryDelay(Duration.ofMillis(60000L))
328-
.setInitialRpcTimeout(Duration.ofMillis(20000L))
332+
.setInitialRpcTimeout(Duration.ofMillis(60000L))
333+
.setRpcTimeoutMultiplier(1.0)
334+
.setMaxRpcTimeout(Duration.ofMillis(60000L))
335+
.setTotalTimeout(Duration.ofMillis(60000L))
336+
.build();
337+
definitions.put("retry_policy_1_params", settings);
338+
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
339+
definitions.put("no_retry_params", settings);
340+
settings =
341+
RetrySettings.newBuilder()
342+
.setInitialRpcTimeout(Duration.ofMillis(60000L))
343+
.setRpcTimeoutMultiplier(1.0)
344+
.setMaxRpcTimeout(Duration.ofMillis(60000L))
345+
.setTotalTimeout(Duration.ofMillis(60000L))
346+
.build();
347+
definitions.put("no_retry_1_params", settings);
348+
settings =
349+
RetrySettings.newBuilder()
350+
.setInitialRpcTimeout(Duration.ofMillis(60000L))
329351
.setRpcTimeoutMultiplier(1.0)
330-
.setMaxRpcTimeout(Duration.ofMillis(20000L))
331-
.setTotalTimeout(Duration.ofMillis(600000L))
352+
.setMaxRpcTimeout(Duration.ofMillis(60000L))
353+
.setTotalTimeout(Duration.ofMillis(60000L))
332354
.build();
333-
definitions.put("default", settings);
355+
definitions.put("no_retry_2_params", settings);
334356
RETRY_PARAM_DEFINITIONS = definitions.build();
335357
}
336358

@@ -364,13 +386,13 @@ private static Builder initDefaults(Builder builder) {
364386

365387
builder
366388
.listServicesSettings()
367-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
368-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
389+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes"))
390+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params"));
369391

370392
builder
371393
.listSkusSettings()
372-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
373-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
394+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes"))
395+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params"));
374396

375397
return builder;
376398
}

synth.metadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "c4e37010d74071851ff24121f522e802231ac86e",
15-
"internalRef": "313460921"
14+
"sha": "d7c66c92df10a9822fa1380d88b73286651b4f9f",
15+
"internalRef": "318891538"
1616
}
1717
},
1818
{

0 commit comments

Comments
 (0)