From 65deae2424ef954a35ebe0de59da119d1a7631dd Mon Sep 17 00:00:00 2001 From: Alice Li Date: Tue, 23 Jul 2024 14:43:51 -0400 Subject: [PATCH 1/7] feat: add full RetrySettings sample code to Settings classes --- .../comment/SettingsCommentComposer.java | 8 +- .../samplecode/SettingsSampleComposer.java | 96 ++++++++++++++++++- .../ApiVersionTestingStubSettings.golden | 17 +++- .../goldens/DeprecatedServiceSettings.golden | 17 +++- .../DeprecatedServiceStubSettings.golden | 17 +++- .../composer/grpc/goldens/EchoSettings.golden | 17 +++- .../grpc/goldens/EchoStubSettings.golden | 17 +++- .../LoggingServiceV2StubSettings.golden | 17 +++- .../grpc/goldens/PublisherStubSettings.golden | 17 +++- .../samples/servicesettings/SyncEcho.golden | 9 +- .../servicesettings/SyncFastFibonacci.golden | 9 +- .../stub/SyncCreateTopic.golden | 9 +- .../servicesettings/stub/SyncDeleteLog.golden | 9 +- .../servicesettings/stub/SyncEcho.golden | 9 +- .../stub/SyncEchoWithVersionMethod.golden | 9 +- .../stub/SyncFastFibonacci.golden | 9 +- .../grpcrest/goldens/EchoSettings.golden | 17 +++- .../grpcrest/goldens/EchoStubSettings.golden | 17 +++- .../grpcrest/goldens/WickedSettings.golden | 17 +++- .../goldens/WickedStubSettings.golden | 17 +++- .../rest/goldens/ComplianceSettings.golden | 17 +++- .../goldens/ComplianceStubSettings.golden | 17 +++- ...tpJsonApiVersionTestingStubSettings.golden | 17 +++- .../SettingsSampleComposerTest.java | 18 +++- .../listconnections/SyncListConnections.java | 9 +- .../listconnections/SyncListConnections.java | 9 +- .../tetherstubsettings/egress/SyncEgress.java | 9 +- .../v1/tethersettings/egress/SyncEgress.java | 9 +- .../v1/ConnectionServiceSettings.java | 17 +++- .../apigeeconnect/v1/TetherSettings.java | 17 +++- .../stub/ConnectionServiceStubSettings.java | 17 +++- .../v1/stub/TetherStubSettings.java | 17 +++- .../SyncBatchGetAssetsHistory.java | 9 +- .../SyncBatchGetAssetsHistory.java | 9 +- .../cloud/asset/v1/AssetServiceSettings.java | 17 +++- .../v1/stub/AssetServiceStubSettings.java | 17 +++- .../mutaterow/SyncMutateRow.java | 9 +- .../mutaterow/SyncMutateRow.java | 9 +- .../data/v2/BaseBigtableDataSettings.java | 17 +++- .../data/v2/stub/BigtableStubSettings.java | 17 +++- .../aggregatedlist/SyncAggregatedList.java | 9 +- .../regionoperationssettings/get/SyncGet.java | 9 +- .../aggregatedlist/SyncAggregatedList.java | 9 +- .../get/SyncGet.java | 9 +- .../compute/v1small/AddressesSettings.java | 17 +++- .../v1small/RegionOperationsSettings.java | 17 +++- .../v1small/stub/AddressesStubSettings.java | 17 +++- .../stub/RegionOperationsStubSettings.java | 17 +++- .../SyncGenerateAccessToken.java | 9 +- .../SyncGenerateAccessToken.java | 9 +- .../v1/IamCredentialsSettings.java | 17 +++- .../v1/stub/IamCredentialsStubSettings.java | 17 +++- .../setiampolicy/SyncSetIamPolicy.java | 9 +- .../setiampolicy/SyncSetIamPolicy.java | 9 +- .../com/google/iam/v1/IAMPolicySettings.java | 17 +++- .../iam/v1/stub/IAMPolicyStubSettings.java | 17 +++- .../getkeyring/SyncGetKeyRing.java | 9 +- .../getkeyring/SyncGetKeyRing.java | 9 +- .../kms/v1/KeyManagementServiceSettings.java | 17 +++- .../KeyManagementServiceStubSettings.java | 17 +++- .../createshelf/SyncCreateShelf.java | 9 +- .../createshelf/SyncCreateShelf.java | 9 +- .../library/v1/LibraryServiceSettings.java | 17 +++- .../v1/stub/LibraryServiceStubSettings.java | 17 +++- .../getbucket/SyncGetBucket.java | 9 +- .../deletelog/SyncDeleteLog.java | 9 +- .../getlogmetric/SyncGetLogMetric.java | 9 +- .../getbucket/SyncGetBucket.java | 9 +- .../deletelog/SyncDeleteLog.java | 9 +- .../getlogmetric/SyncGetLogMetric.java | 9 +- .../cloud/logging/v2/ConfigSettings.java | 17 +++- .../cloud/logging/v2/LoggingSettings.java | 17 +++- .../cloud/logging/v2/MetricsSettings.java | 17 +++- .../v2/stub/ConfigServiceV2StubSettings.java | 17 +++- .../v2/stub/LoggingServiceV2StubSettings.java | 17 +++- .../v2/stub/MetricsServiceV2StubSettings.java | 17 +++- .../createschema/SyncCreateSchema.java | 9 +- .../createtopic/SyncCreateTopic.java | 9 +- .../createschema/SyncCreateSchema.java | 9 +- .../SyncCreateSubscription.java | 9 +- .../SyncCreateSubscription.java | 9 +- .../createtopic/SyncCreateTopic.java | 9 +- .../pubsub/v1/SchemaServiceSettings.java | 17 +++- .../pubsub/v1/SubscriptionAdminSettings.java | 17 +++- .../cloud/pubsub/v1/TopicAdminSettings.java | 17 +++- .../pubsub/v1/stub/PublisherStubSettings.java | 17 +++- .../v1/stub/SchemaServiceStubSettings.java | 17 +++- .../v1/stub/SubscriberStubSettings.java | 17 +++- .../getinstance/SyncGetInstance.java | 9 +- .../getinstance/SyncGetInstance.java | 9 +- .../redis/v1beta1/CloudRedisSettings.java | 17 +++- .../v1beta1/stub/CloudRedisStubSettings.java | 17 +++- .../deletebucket/SyncDeleteBucket.java | 9 +- .../deletebucket/SyncDeleteBucket.java | 9 +- .../google/storage/v2/StorageSettings.java | 17 +++- .../storage/v2/stub/StorageStubSettings.java | 17 +++- 96 files changed, 1210 insertions(+), 149 deletions(-) diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java index 649ee62e77..7e834cbfc4 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java @@ -39,7 +39,10 @@ public class SettingsCommentComposer { private static final String CLASS_HEADER_DEFAULT_ADDRESS_PORT_PATTERN = "The default service address (%s) and default port (%d) are used."; private static final String CLASS_HEADER_SAMPLE_CODE_PATTERN = - "For example, to set the total timeout of %s to 30 seconds:"; + "For example, to set the [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) of %s:"; + + private static final String CLASS_HEADER_SAMPLE_CODE_SUFFIX = + "Please refer to the [Client Side Retry Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for additional support in setting retries."; private static final String CLASS_HEADER_BUILDER_DESCRIPTION = "The builder of this class is recursive, so contained classes are themselves builders. When" @@ -170,7 +173,8 @@ public static List createClassHeaderComments( String.format( CLASS_HEADER_SAMPLE_CODE_PATTERN, JavaStyle.toLowerCamelCase(methodNameOpt.get()))) - .addSampleCode(sampleCodeOpt.get()); + .addSampleCode(sampleCodeOpt.get()) + .addComment(CLASS_HEADER_SAMPLE_CODE_SUFFIX); } if (isDeprecated) { diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java index 372399ee56..fa0fba1b74 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java @@ -89,7 +89,25 @@ public static Optional composeSettingsSample( .setExprReferenceExpr(retrySettingsArgExpr) .setMethodName("toBuilder") .build(); - MethodInvocationExpr ofSecondMethodInvocationExpr = + MethodInvocationExpr ofOneSecondMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofSeconds") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("1").build())) + .build(); + MethodInvocationExpr ofFiveSecondsMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofSeconds") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("5").build())) + .build(); + MethodInvocationExpr ofThirtySecondsMethodInvocationExpr = MethodInvocationExpr.builder() .setStaticReferenceType( TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) @@ -98,11 +116,85 @@ public static Optional composeSettingsSample( ValueExpr.withValue( PrimitiveValue.builder().setType(TypeNode.INT).setValue("30").build())) .build(); + MethodInvocationExpr ofSixtySecondsMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofSeconds") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("60").build())) + .build(); + MethodInvocationExpr ofThreeHundredSecondsMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofSeconds") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("300").build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setInitialRetryDelayDuration") + .setArguments(ofOneSecondMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setInitialRpcTimeoutDuration") + .setArguments(ofFiveSecondsMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxAttempts") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("5").build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxRetryDelayDuration") + .setArguments(ofThirtySecondsMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxRpcTimeoutDuration") + .setArguments(ofSixtySecondsMethodInvocationExpr) + .build(); + double retryDelayMultiplier = 1.3; + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setRetryDelayMultiplier") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder() + .setType(TypeNode.DOUBLE) + .setValue(String.format("%.1f", retryDelayMultiplier)) + .build())) + .build(); + double rpcTimeoutMultiplier = 1.5; + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setRpcTimeoutMultiplier") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder() + .setType(TypeNode.DOUBLE) + .setValue(String.format("%.1f", rpcTimeoutMultiplier)) + .build())) + .build(); retrySettingsArgExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(retrySettingsArgExpr) .setMethodName("setTotalTimeout") - .setArguments(ofSecondMethodInvocationExpr) + .setArguments(ofThreeHundredSecondsMethodInvocationExpr) .build(); retrySettingsArgExpr = MethodInvocationExpr.builder() diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden index 0920230bd1..a7223b7d3d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden @@ -40,7 +40,9 @@ import javax.annotation.Generated; *

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 echoWithVersionMethod to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echoWithVersionMethod: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -57,10 +59,21 @@ import javax.annotation.Generated;
  *             .echoWithVersionMethodSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * EchoWithVersionStubSettings echoWithVersionSettings = echoWithVersionSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class EchoWithVersionStubSettings extends StubSettings { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden index 76cd4cea9d..31ef0a5019 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden @@ -31,7 +31,9 @@ import javax.annotation.Generated; *

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 fastFibonacci to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of fastFibonacci: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -48,11 +50,22 @@ import javax.annotation.Generated;
  *             .fastFibonacciSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * DeprecatedServiceSettings deprecatedServiceSettings = deprecatedServiceSettingsBuilder.build();
  * }
* + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * * @deprecated This class is deprecated and will be removed in the next major version update. */ @Deprecated diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden index 87658bf3d9..1e689b94b1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden @@ -41,7 +41,9 @@ import org.threeten.bp.Duration; *

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 fastFibonacci to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of fastFibonacci: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -58,12 +60,23 @@ import org.threeten.bp.Duration;
  *             .fastFibonacciSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * DeprecatedServiceStubSettings deprecatedServiceSettings =
  *     deprecatedServiceSettingsBuilder.build();
  * }
* + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * * @deprecated This class is deprecated and will be removed in the next major version update. */ @Deprecated diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden index acc1bb868a..6d76bddd27 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden @@ -39,7 +39,9 @@ import javax.annotation.Generated; *

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 echo to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -55,10 +57,21 @@ import javax.annotation.Generated;
  *             .echoSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * EchoSettings echoSettings = echoSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden index b1022e5c5e..7dd1751f65 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden @@ -68,7 +68,9 @@ import org.threeten.bp.Duration; *

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 echo to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -84,10 +86,21 @@ import org.threeten.bp.Duration;
  *             .echoSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * EchoStubSettings echoSettings = echoSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden index 39984fb5a7..8e025da27d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden @@ -74,7 +74,9 @@ import org.threeten.bp.Duration; *

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 deleteLog to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of deleteLog: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -91,10 +93,21 @@ import org.threeten.bp.Duration;
  *             .deleteLogSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * LoggingServiceV2StubSettings loggingServiceV2Settings = loggingServiceV2SettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class LoggingServiceV2StubSettings extends StubSettings { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden index 3ac81fc3e4..f0ebe1778c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden @@ -75,7 +75,9 @@ import org.threeten.bp.Duration; *

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 createTopic to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createTopic: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -91,10 +93,21 @@ import org.threeten.bp.Duration;
  *             .createTopicSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * PublisherStubSettings publisherSettings = publisherSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class PublisherStubSettings extends StubSettings { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden index e49ab67421..5a8867d29f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden @@ -40,7 +40,14 @@ public class SyncEcho { .echoSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); EchoSettings echoSettings = echoSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden index 6600959c8b..cb0b5be3cc 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden @@ -41,7 +41,14 @@ public class SyncFastFibonacci { .fastFibonacciSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); DeprecatedServiceSettings deprecatedServiceSettings = deprecatedServiceSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden index 02dd51c41f..b8823877e3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden @@ -40,7 +40,14 @@ public class SyncCreateTopic { .createTopicSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); PublisherStubSettings publisherSettings = publisherSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden index 4c95dc1460..42563416ba 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden @@ -41,7 +41,14 @@ public class SyncDeleteLog { .deleteLogSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); LoggingServiceV2StubSettings loggingServiceV2Settings = loggingServiceV2SettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden index ebf64e322b..af48615e1b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden @@ -40,7 +40,14 @@ public class SyncEcho { .echoSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); EchoStubSettings echoSettings = echoSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoWithVersionMethod.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoWithVersionMethod.golden index fc298b28dc..2872fb640a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoWithVersionMethod.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoWithVersionMethod.golden @@ -41,7 +41,14 @@ public class SyncEchoWithVersionMethod { .echoWithVersionMethodSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); EchoWithVersionStubSettings echoWithVersionSettings = echoWithVersionSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden index 7646bc5a79..2a8a9b02ad 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden @@ -41,7 +41,14 @@ public class SyncFastFibonacci { .fastFibonacciSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); DeprecatedServiceStubSettings deprecatedServiceSettings = deprecatedServiceSettingsBuilder.build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden index 2456b6cb0c..3bd5121dd8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden @@ -40,7 +40,9 @@ import javax.annotation.Generated; *

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 echo to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -56,10 +58,21 @@ import javax.annotation.Generated;
  *             .echoSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * EchoSettings echoSettings = echoSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden index afb4998b5b..1353cc3c94 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden @@ -73,7 +73,9 @@ import org.threeten.bp.Duration; *

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 echo to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -89,10 +91,21 @@ import org.threeten.bp.Duration;
  *             .echoSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * EchoStubSettings echoSettings = echoSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden index df69e9b644..6be50612e2 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden @@ -32,7 +32,9 @@ import javax.annotation.Generated; *

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 craftEvilPlan to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of craftEvilPlan: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -48,10 +50,21 @@ import javax.annotation.Generated;
  *             .craftEvilPlanSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * WickedSettings wickedSettings = wickedSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden index 5a555d7001..82d96b0620 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden @@ -42,7 +42,9 @@ import javax.annotation.Generated; *

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 craftEvilPlan to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of craftEvilPlan: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -58,10 +60,21 @@ import javax.annotation.Generated;
  *             .craftEvilPlanSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * WickedStubSettings wickedSettings = wickedSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden index e7cd104fff..b58142529c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden @@ -31,7 +31,9 @@ import javax.annotation.Generated; *

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 repeatDataBody to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of repeatDataBody: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -47,10 +49,21 @@ import javax.annotation.Generated;
  *             .repeatDataBodySettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * ComplianceSettings complianceSettings = complianceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden index 0c6ab1cc1c..b06778c398 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden @@ -43,7 +43,9 @@ import javax.annotation.Generated; *

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 repeatDataBody to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of repeatDataBody: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -59,10 +61,21 @@ import javax.annotation.Generated;
  *             .repeatDataBodySettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden index 08b311156c..c689b0fc32 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden @@ -40,7 +40,9 @@ import javax.annotation.Generated; *

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 echoWithVersionMethod to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echoWithVersionMethod: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -57,10 +59,21 @@ import javax.annotation.Generated;
  *             .echoWithVersionMethodSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * EchoWithVersionStubSettings echoWithVersionSettings = echoWithVersionSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class EchoWithVersionStubSettings extends StubSettings { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java index 6aa6d1f583..5e1420c670 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java @@ -61,7 +61,14 @@ void composeSettingsSample_serviceSettingsClass() { " .echoSettings()\n", " .getRetrySettings()\n", " .toBuilder()\n", - " .setTotalTimeout(Duration.ofSeconds(30))\n", + " .setInitialRetryDelayDuration(Duration.ofSeconds(1))\n", + " .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))\n", + " .setMaxAttempts(5)\n", + " .setMaxRetryDelayDuration(Duration.ofSeconds(30))\n", + " .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))\n", + " .setRetryDelayMultiplier(1.3)\n", + " .setRpcTimeoutMultiplier(1.5)\n", + " .setTotalTimeout(Duration.ofSeconds(300))\n", " .build());\n", "EchoSettings echoSettings = echoSettingsBuilder.build();"); assertEquals(results.get(), expected); @@ -89,7 +96,14 @@ void composeSettingsSample_serviceStubClass() { " .echoSettings()\n", " .getRetrySettings()\n", " .toBuilder()\n", - " .setTotalTimeout(Duration.ofSeconds(30))\n", + " .setInitialRetryDelayDuration(Duration.ofSeconds(1))\n", + " .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))\n", + " .setMaxAttempts(5)\n", + " .setMaxRetryDelayDuration(Duration.ofSeconds(30))\n", + " .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))\n", + " .setRetryDelayMultiplier(1.3)\n", + " .setRpcTimeoutMultiplier(1.5)\n", + " .setTotalTimeout(Duration.ofSeconds(300))\n", " .build());\n", "EchoStubSettings echoSettings = echoSettingsBuilder.build();"); assertEquals(results.get(), expected); diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservicesettings/listconnections/SyncListConnections.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservicesettings/listconnections/SyncListConnections.java index 81efec5f6d..13da16e600 100644 --- a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservicesettings/listconnections/SyncListConnections.java +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservicesettings/listconnections/SyncListConnections.java @@ -41,7 +41,14 @@ public static void syncListConnections() throws Exception { .listConnectionsSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/connectionservicestubsettings/listconnections/SyncListConnections.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/connectionservicestubsettings/listconnections/SyncListConnections.java index 3c4fc6d001..7f5342c326 100644 --- a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/connectionservicestubsettings/listconnections/SyncListConnections.java +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/connectionservicestubsettings/listconnections/SyncListConnections.java @@ -41,7 +41,14 @@ public static void syncListConnections() throws Exception { .listConnectionsSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); ConnectionServiceStubSettings connectionServiceSettings = connectionServiceSettingsBuilder.build(); diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/tetherstubsettings/egress/SyncEgress.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/tetherstubsettings/egress/SyncEgress.java index 607db4c4dc..d94eeed6d2 100644 --- a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/tetherstubsettings/egress/SyncEgress.java +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/tetherstubsettings/egress/SyncEgress.java @@ -40,7 +40,14 @@ public static void syncEgress() throws Exception { .egressSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); TetherStubSettings tetherSettings = tetherSettingsBuilder.build(); } diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tethersettings/egress/SyncEgress.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tethersettings/egress/SyncEgress.java index 763f818edf..9a24a5a5be 100644 --- a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tethersettings/egress/SyncEgress.java +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tethersettings/egress/SyncEgress.java @@ -40,7 +40,14 @@ public static void syncEgress() throws Exception { .egressSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); TetherSettings tetherSettings = tetherSettingsBuilder.build(); } diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java index 4e26180f91..642f237365 100644 --- a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java @@ -51,7 +51,9 @@ *

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 listConnections to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of listConnections: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -68,10 +70,21 @@
  *             .listConnectionsSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class ConnectionServiceSettings extends ClientSettings { diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java index 0487510362..492b03e7a2 100644 --- a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java @@ -47,7 +47,9 @@ *

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 egress to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of egress: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -63,10 +65,21 @@
  *             .egressSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * TetherSettings tetherSettings = tetherSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class TetherSettings extends ClientSettings { diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java index fb12fd0b01..99b8391962 100644 --- a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java @@ -71,7 +71,9 @@ *

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 listConnections to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of listConnections: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -88,11 +90,22 @@
  *             .listConnectionsSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * ConnectionServiceStubSettings connectionServiceSettings =
  *     connectionServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class ConnectionServiceStubSettings extends StubSettings { diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java index 1c4419fedf..86fcb09c6f 100644 --- a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java @@ -57,7 +57,9 @@ *

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 egress to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of egress: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -73,10 +75,21 @@
  *             .egressSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * TetherStubSettings tetherSettings = tetherSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class TetherStubSettings extends StubSettings { diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java index 26f380d1b6..4d4d0063b2 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java @@ -40,7 +40,14 @@ public static void syncBatchGetAssetsHistory() throws Exception { .batchGetAssetsHistorySettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java index aec0bb6aea..ab686f365f 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java @@ -41,7 +41,14 @@ public static void syncBatchGetAssetsHistory() throws Exception { .batchGetAssetsHistorySettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java index 81a6e9bae3..0c572f7e8f 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java @@ -57,7 +57,9 @@ *

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 batchGetAssetsHistory to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of batchGetAssetsHistory: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -73,10 +75,21 @@
  *             .batchGetAssetsHistorySettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class AssetServiceSettings extends ClientSettings { diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java index 8ba0801966..79d312b39d 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java @@ -115,7 +115,9 @@ *

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 batchGetAssetsHistory to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of batchGetAssetsHistory: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -132,10 +134,21 @@
  *             .batchGetAssetsHistorySettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class AssetServiceStubSettings extends StubSettings { diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java index ddc13ebe69..66b13f8682 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java @@ -41,7 +41,14 @@ public static void syncMutateRow() throws Exception { .mutateRowSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); BaseBigtableDataSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build(); } diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java index 48c8448abe..00fad89b07 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java @@ -41,7 +41,14 @@ public static void syncMutateRow() throws Exception { .mutateRowSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); BigtableStubSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build(); } diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java index a33ec9a500..468782425e 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java @@ -61,7 +61,9 @@ *

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 mutateRow to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of mutateRow: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -78,10 +80,21 @@
  *             .mutateRowSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * BaseBigtableDataSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class BaseBigtableDataSettings extends ClientSettings { diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java index 22d06f6f70..1df27cf781 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java @@ -70,7 +70,9 @@ *

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 mutateRow to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of mutateRow: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -87,10 +89,21 @@
  *             .mutateRowSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * BigtableStubSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class BigtableStubSettings extends StubSettings { diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java index 954828dc4b..b94eadda96 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java @@ -40,7 +40,14 @@ public static void syncAggregatedList() throws Exception { .aggregatedListSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); AddressesSettings addressesSettings = addressesSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java index 99ef9e7dac..39ca29ebb8 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java @@ -41,7 +41,14 @@ public static void syncGet() throws Exception { .getSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); RegionOperationsSettings regionOperationsSettings = regionOperationsSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java index 4f04ef426b..2c001d4d11 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java @@ -40,7 +40,14 @@ public static void syncAggregatedList() throws Exception { .aggregatedListSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); AddressesStubSettings addressesSettings = addressesSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java index 9045231d98..64798143dd 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java @@ -41,7 +41,14 @@ public static void syncGet() throws Exception { .getSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); RegionOperationsStubSettings regionOperationsSettings = regionOperationsSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java index 07e45ebf83..d6c57cf7d1 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java @@ -51,7 +51,9 @@ *

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 aggregatedList to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of aggregatedList: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -67,10 +69,21 @@
  *             .aggregatedListSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * AddressesSettings addressesSettings = addressesSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class AddressesSettings extends ClientSettings { diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java index 6a599bdb7f..cf88bbc0b2 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java @@ -46,7 +46,9 @@ *

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 get to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of get: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -63,10 +65,21 @@
  *             .getSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * RegionOperationsSettings regionOperationsSettings = regionOperationsSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class RegionOperationsSettings extends ClientSettings { diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java index 2927d8c470..4381b0d34d 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java @@ -80,7 +80,9 @@ *

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 aggregatedList to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of aggregatedList: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -96,10 +98,21 @@
  *             .aggregatedListSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * AddressesStubSettings addressesSettings = addressesSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class AddressesStubSettings extends StubSettings { diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java index 06a58fd6d2..7d72dd19ff 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java @@ -58,7 +58,9 @@ *

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 get to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of get: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -75,10 +77,21 @@
  *             .getSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * RegionOperationsStubSettings regionOperationsSettings = regionOperationsSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class RegionOperationsStubSettings extends StubSettings { diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.java index f4ba4bc934..6e8b8d1b91 100644 --- a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.java +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.java @@ -41,7 +41,14 @@ public static void syncGenerateAccessToken() throws Exception { .generateAccessTokenSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); IamCredentialsSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build(); } diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.java index 74daf07eb3..09cf7ebe41 100644 --- a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.java +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.java @@ -41,7 +41,14 @@ public static void syncGenerateAccessToken() throws Exception { .generateAccessTokenSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); IamCredentialsStubSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build(); } diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java index 421e040501..8564022dd1 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java @@ -49,7 +49,9 @@ *

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 generateAccessToken to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of generateAccessToken: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -66,10 +68,21 @@
  *             .generateAccessTokenSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * IamCredentialsSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class IamCredentialsSettings extends ClientSettings { diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java index c6bf0a10b0..3043894910 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java @@ -68,7 +68,9 @@ *

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 generateAccessToken to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of generateAccessToken: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -85,10 +87,21 @@
  *             .generateAccessTokenSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * IamCredentialsStubSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class IamCredentialsStubSettings extends StubSettings { diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java index b8f0745a26..f46c98085d 100644 --- a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java @@ -40,7 +40,14 @@ public static void syncSetIamPolicy() throws Exception { .setIamPolicySettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); IAMPolicySettings iAMPolicySettings = iAMPolicySettingsBuilder.build(); } diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java index 5d9d0fe693..543866e4a3 100644 --- a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java @@ -40,7 +40,14 @@ public static void syncSetIamPolicy() throws Exception { .setIamPolicySettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); IAMPolicyStubSettings iAMPolicySettings = iAMPolicySettingsBuilder.build(); } diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java index 1d8ac2780c..8602195d12 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java @@ -46,7 +46,9 @@ *

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 setIamPolicy to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of setIamPolicy: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -62,10 +64,21 @@
  *             .setIamPolicySettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * IAMPolicySettings iAMPolicySettings = iAMPolicySettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class IAMPolicySettings extends ClientSettings { diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java index b079026263..054d39f96a 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java @@ -60,7 +60,9 @@ *

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 setIamPolicy to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of setIamPolicy: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -76,10 +78,21 @@
  *             .setIamPolicySettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * IAMPolicyStubSettings iAMPolicySettings = iAMPolicySettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class IAMPolicyStubSettings extends StubSettings { diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.java index a998bef402..850f6c0c50 100644 --- a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.java +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.java @@ -41,7 +41,14 @@ public static void syncGetKeyRing() throws Exception { .getKeyRingSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); KeyManagementServiceSettings keyManagementServiceSettings = keyManagementServiceSettingsBuilder.build(); diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.java index 14c50feecc..9595db4020 100644 --- a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.java +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.java @@ -41,7 +41,14 @@ public static void syncGetKeyRing() throws Exception { .getKeyRingSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); KeyManagementServiceStubSettings keyManagementServiceSettings = keyManagementServiceSettingsBuilder.build(); diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java index 8914ec9257..25d884a96f 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java @@ -61,7 +61,9 @@ *

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 getKeyRing to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getKeyRing: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -78,11 +80,22 @@
  *             .getKeyRingSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * KeyManagementServiceSettings keyManagementServiceSettings =
  *     keyManagementServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class KeyManagementServiceSettings extends ClientSettings { diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java index f0f3309b4b..8cd904049c 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java @@ -112,7 +112,9 @@ *

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 getKeyRing to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getKeyRing: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -129,11 +131,22 @@
  *             .getKeyRingSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * KeyManagementServiceStubSettings keyManagementServiceSettings =
  *     keyManagementServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class KeyManagementServiceStubSettings diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java index 7dc4625f7e..4615568356 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java @@ -41,7 +41,14 @@ public static void syncCreateShelf() throws Exception { .createShelfSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); LibraryServiceSettings libraryServiceSettings = libraryServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java index 1b27c73b64..fec1f4cd69 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java @@ -41,7 +41,14 @@ public static void syncCreateShelf() throws Exception { .createShelfSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); LibraryServiceStubSettings libraryServiceSettings = libraryServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java index d6e3b5a5bf..4c2f6f8ee4 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java @@ -69,7 +69,9 @@ *

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 createShelf to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createShelf: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -86,10 +88,21 @@
  *             .createShelfSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * LibraryServiceSettings libraryServiceSettings = libraryServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class LibraryServiceSettings extends ClientSettings { diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java index aabb28bf5d..91a41a5477 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java @@ -86,7 +86,9 @@ *

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 createShelf to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createShelf: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -103,10 +105,21 @@
  *             .createShelfSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * LibraryServiceStubSettings libraryServiceSettings = libraryServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class LibraryServiceStubSettings extends StubSettings { diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java index bc551dcff4..9e91328bf4 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java @@ -40,7 +40,14 @@ public static void syncGetBucket() throws Exception { .getBucketSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); ConfigSettings configSettings = configSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java index e6a610ff26..29c96a5cbc 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java @@ -40,7 +40,14 @@ public static void syncDeleteLog() throws Exception { .deleteLogSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); LoggingSettings loggingSettings = loggingSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java index c577cdb68e..ad56d19aa2 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java @@ -40,7 +40,14 @@ public static void syncGetLogMetric() throws Exception { .getLogMetricSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); MetricsSettings metricsSettings = metricsSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java index b424ac1e6e..d1f4e1ef35 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java @@ -41,7 +41,14 @@ public static void syncGetBucket() throws Exception { .getBucketSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); ConfigServiceV2StubSettings configSettings = configSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java index 7a478c4a72..d61b45c2c3 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java @@ -41,7 +41,14 @@ public static void syncDeleteLog() throws Exception { .deleteLogSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); LoggingServiceV2StubSettings loggingSettings = loggingSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java index 34727d7491..4d1d4fe810 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java @@ -41,7 +41,14 @@ public static void syncGetLogMetric() throws Exception { .getLogMetricSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); MetricsServiceV2StubSettings metricsSettings = metricsSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java index c73cc438d2..d3e9073a97 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java @@ -93,7 +93,9 @@ *

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 getBucket to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getBucket: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -109,10 +111,21 @@
  *             .getBucketSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * ConfigSettings configSettings = configSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class ConfigSettings extends ClientSettings { diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java index b50cf22405..a66fc87531 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java @@ -65,7 +65,9 @@ *

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 deleteLog to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of deleteLog: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -81,10 +83,21 @@
  *             .deleteLogSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * LoggingSettings loggingSettings = loggingSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class LoggingSettings extends ClientSettings { diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java index 025d7bc7bc..e18e3458e1 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java @@ -57,7 +57,9 @@ *

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 getLogMetric to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getLogMetric: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -73,10 +75,21 @@
  *             .getLogMetricSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * MetricsSettings metricsSettings = metricsSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class MetricsSettings extends ClientSettings { diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java index 952e8e1089..69eca6aa14 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java @@ -111,7 +111,9 @@ *

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 getBucket to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getBucket: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -128,10 +130,21 @@
  *             .getBucketSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * ConfigServiceV2StubSettings configSettings = configSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class ConfigServiceV2StubSettings extends StubSettings { diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java index d4f3c30bd8..44d8fc34c9 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java @@ -90,7 +90,9 @@ *

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 deleteLog to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of deleteLog: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -107,10 +109,21 @@
  *             .deleteLogSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * LoggingServiceV2StubSettings loggingSettings = loggingSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class LoggingServiceV2StubSettings extends StubSettings { diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java index 84eecd198a..43ea126387 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java @@ -72,7 +72,9 @@ *

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 getLogMetric to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getLogMetric: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -89,10 +91,21 @@
  *             .getLogMetricSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * MetricsServiceV2StubSettings metricsSettings = metricsSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class MetricsServiceV2StubSettings extends StubSettings { diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java index bacfa7ee89..32a861a1cd 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java @@ -40,7 +40,14 @@ public static void syncCreateSchema() throws Exception { .createSchemaSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java index b411874e44..236aea51b0 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java @@ -40,7 +40,14 @@ public static void syncCreateTopic() throws Exception { .createTopicSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); PublisherStubSettings topicAdminSettings = topicAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java index a66903e1d6..fec071b8ae 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java @@ -41,7 +41,14 @@ public static void syncCreateSchema() throws Exception { .createSchemaSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java index e306396681..2ce549835f 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java @@ -41,7 +41,14 @@ public static void syncCreateSubscription() throws Exception { .createSubscriptionSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); SubscriberStubSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java index 5d61561bc5..a1a8d6e394 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java @@ -41,7 +41,14 @@ public static void syncCreateSubscription() throws Exception { .createSubscriptionSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); SubscriptionAdminSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java index d97e48cbb7..97a5461e3f 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java @@ -40,7 +40,14 @@ public static void syncCreateTopic() throws Exception { .createTopicSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); TopicAdminSettings topicAdminSettings = topicAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java index 7108a832f8..b4f5862f09 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java @@ -71,7 +71,9 @@ *

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 createSchema to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSchema: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -87,10 +89,21 @@
  *             .createSchemaSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class SchemaServiceSettings extends ClientSettings { diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java index 1a3f87a03d..871619ac67 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java @@ -79,7 +79,9 @@ *

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 createSubscription to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSubscription: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -96,10 +98,21 @@
  *             .createSubscriptionSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * SubscriptionAdminSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class SubscriptionAdminSettings extends ClientSettings { diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java index 92db8c9f19..3ced4b7926 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java @@ -72,7 +72,9 @@ *

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 createTopic to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createTopic: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -88,10 +90,21 @@
  *             .createTopicSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * TopicAdminSettings topicAdminSettings = topicAdminSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class TopicAdminSettings extends ClientSettings { diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java index 5f39c1339a..2271861ee3 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java @@ -96,7 +96,9 @@ *

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 createTopic to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createTopic: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -112,10 +114,21 @@
  *             .createTopicSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * PublisherStubSettings topicAdminSettings = topicAdminSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class PublisherStubSettings extends StubSettings { diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java index 2ea645a4ca..e2c752b9a2 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java @@ -85,7 +85,9 @@ *

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 createSchema to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSchema: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -102,10 +104,21 @@
  *             .createSchemaSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class SchemaServiceStubSettings extends StubSettings { diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java index dfe1c04656..caa96453f5 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java @@ -94,7 +94,9 @@ *

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 createSubscription to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSubscription: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -111,10 +113,21 @@
  *             .createSubscriptionSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * SubscriberStubSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class SubscriberStubSettings extends StubSettings { diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.java index e966df8411..1424fa3a82 100644 --- a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.java +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.java @@ -40,7 +40,14 @@ public static void syncGetInstance() throws Exception { .getInstanceSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); CloudRedisSettings cloudRedisSettings = cloudRedisSettingsBuilder.build(); } diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.java index 37c1590b58..c669650327 100644 --- a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.java +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.java @@ -40,7 +40,14 @@ public static void syncGetInstance() throws Exception { .getInstanceSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); CloudRedisStubSettings cloudRedisSettings = cloudRedisSettingsBuilder.build(); } diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java index 089c7c5a26..0b9b4a7735 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java @@ -55,7 +55,9 @@ *

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 getInstance to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getInstance: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -71,10 +73,21 @@
  *             .getInstanceSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * CloudRedisSettings cloudRedisSettings = cloudRedisSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java index 4644cd4e8c..d07bcd6bad 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java @@ -89,7 +89,9 @@ *

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 getInstance to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getInstance: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -105,10 +107,21 @@
  *             .getInstanceSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * CloudRedisStubSettings cloudRedisSettings = cloudRedisSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java index a0baacf0bc..eb46488d41 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java @@ -40,7 +40,14 @@ public static void syncDeleteBucket() throws Exception { .deleteBucketSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); StorageSettings storageSettings = storageSettingsBuilder.build(); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java index fd497e5cec..097d5d685a 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java @@ -40,7 +40,14 @@ public static void syncDeleteBucket() throws Exception { .deleteBucketSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeout(Duration.ofSeconds(300)) .build()); StorageStubSettings storageSettings = storageSettingsBuilder.build(); } diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java b/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java index 9fa448bf07..0bf0366958 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java @@ -60,7 +60,9 @@ *

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 deleteBucket to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of deleteBucket: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -76,10 +78,21 @@
  *             .deleteBucketSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * StorageSettings storageSettings = storageSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class StorageSettings extends ClientSettings { diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java index 1b43b13abc..bd33ca47e7 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java @@ -118,7 +118,9 @@ *

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 deleteBucket to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of deleteBucket: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -134,10 +136,21 @@
  *             .deleteBucketSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * StorageStubSettings storageSettings = storageSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class StorageStubSettings extends StubSettings { From 9cc6a70882012946cf2e3cfcdc7fb8a20e78e42d Mon Sep 17 00:00:00 2001 From: Alice Li Date: Wed, 24 Jul 2024 11:20:12 -0400 Subject: [PATCH 2/7] update showcase goldens --- .../showcase/v1beta1/ComplianceSettings.java | 17 +++++++++++++++-- .../google/showcase/v1beta1/EchoSettings.java | 17 +++++++++++++++-- .../showcase/v1beta1/IdentitySettings.java | 17 +++++++++++++++-- .../showcase/v1beta1/MessagingSettings.java | 17 +++++++++++++++-- .../v1beta1/SequenceServiceSettings.java | 17 +++++++++++++++-- .../showcase/v1beta1/TestingSettings.java | 17 +++++++++++++++-- .../v1beta1/stub/ComplianceStubSettings.java | 17 +++++++++++++++-- .../showcase/v1beta1/stub/EchoStubSettings.java | 17 +++++++++++++++-- .../v1beta1/stub/IdentityStubSettings.java | 17 +++++++++++++++-- .../v1beta1/stub/MessagingStubSettings.java | 17 +++++++++++++++-- .../stub/SequenceServiceStubSettings.java | 17 +++++++++++++++-- .../v1beta1/stub/TestingStubSettings.java | 17 +++++++++++++++-- 12 files changed, 180 insertions(+), 24 deletions(-) diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java index f07f55a8c7..9aeb0b8941 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java @@ -60,7 +60,9 @@ *

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 repeatDataBody to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of repeatDataBody: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -76,10 +78,21 @@
  *             .repeatDataBodySettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * ComplianceSettings complianceSettings = complianceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java index aed2c2ea70..44372eb0e2 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java @@ -66,7 +66,9 @@ *

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 echo to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -82,10 +84,21 @@
  *             .echoSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * EchoSettings echoSettings = echoSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java index 252c9aba3e..ba096ff25d 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java @@ -62,7 +62,9 @@ *

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 createUser to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createUser: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -78,10 +80,21 @@
  *             .createUserSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * IdentitySettings identitySettings = identitySettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java index 22670dcd5d..b756c7a247 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java @@ -67,7 +67,9 @@ *

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 createRoom to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createRoom: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -83,10 +85,21 @@
  *             .createRoomSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * MessagingSettings messagingSettings = messagingSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java index a323894e08..b6500ed713 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java @@ -62,7 +62,9 @@ *

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 createSequence to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSequence: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -79,10 +81,21 @@
  *             .createSequenceSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java index 8d49238eb6..378da6a0ab 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java @@ -63,7 +63,9 @@ *

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 createSession to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSession: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -79,10 +81,21 @@
  *             .createSessionSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * TestingSettings testingSettings = testingSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java index 9074275b6f..c0f90da32d 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java @@ -80,7 +80,9 @@ *

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 repeatDataBody to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of repeatDataBody: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -96,10 +98,21 @@
  *             .repeatDataBodySettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java index 57a62ee46b..1a657a488c 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java @@ -103,7 +103,9 @@ *

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 echo to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -119,10 +121,21 @@
  *             .echoSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * EchoStubSettings echoSettings = echoSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java index f40fdb7b08..12f314aa7b 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java @@ -86,7 +86,9 @@ *

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 createUser to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createUser: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -102,10 +104,21 @@
  *             .createUserSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * IdentityStubSettings identitySettings = identitySettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java index c565384ba4..cb78962215 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java @@ -108,7 +108,9 @@ *

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 createRoom to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createRoom: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -124,10 +126,21 @@
  *             .createRoomSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * MessagingStubSettings messagingSettings = messagingSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java index fd334ddcbe..89309607d1 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java @@ -90,7 +90,9 @@ *

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 createSequence to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSequence: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -107,10 +109,21 @@
  *             .createSequenceSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java index 6e86808a9d..2364aa78ef 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java @@ -93,7 +93,9 @@ *

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 createSession to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSession: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -109,10 +111,21 @@
  *             .createSessionSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeout(Duration.ofSeconds(300))
  *             .build());
  * TestingStubSettings testingSettings = testingSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @BetaApi @Generated("by gapic-generator-java") From eefb50c4a263d633f5170540ff6b1b35d4eadaf4 Mon Sep 17 00:00:00 2001 From: Alice Li Date: Wed, 24 Jul 2024 14:26:30 -0400 Subject: [PATCH 3/7] update to use setTotalTimeoutDuration to use the java.time method --- .../gapic/composer/samplecode/SettingsSampleComposer.java | 2 +- .../grpc/goldens/ApiVersionTestingStubSettings.golden | 2 +- .../composer/grpc/goldens/DeprecatedServiceSettings.golden | 2 +- .../grpc/goldens/DeprecatedServiceStubSettings.golden | 2 +- .../generator/gapic/composer/grpc/goldens/EchoSettings.golden | 2 +- .../gapic/composer/grpc/goldens/EchoStubSettings.golden | 2 +- .../composer/grpc/goldens/LoggingServiceV2StubSettings.golden | 2 +- .../gapic/composer/grpc/goldens/PublisherStubSettings.golden | 2 +- .../grpc/goldens/samples/servicesettings/SyncEcho.golden | 2 +- .../goldens/samples/servicesettings/SyncFastFibonacci.golden | 2 +- .../samples/servicesettings/stub/SyncCreateTopic.golden | 2 +- .../goldens/samples/servicesettings/stub/SyncDeleteLog.golden | 2 +- .../grpc/goldens/samples/servicesettings/stub/SyncEcho.golden | 2 +- .../servicesettings/stub/SyncEchoWithVersionMethod.golden | 2 +- .../samples/servicesettings/stub/SyncFastFibonacci.golden | 2 +- .../gapic/composer/grpcrest/goldens/EchoSettings.golden | 2 +- .../gapic/composer/grpcrest/goldens/EchoStubSettings.golden | 2 +- .../gapic/composer/grpcrest/goldens/WickedSettings.golden | 2 +- .../gapic/composer/grpcrest/goldens/WickedStubSettings.golden | 2 +- .../gapic/composer/rest/goldens/ComplianceSettings.golden | 2 +- .../gapic/composer/rest/goldens/ComplianceStubSettings.golden | 2 +- .../rest/goldens/HttpJsonApiVersionTestingStubSettings.golden | 2 +- .../gapic/composer/samplecode/SettingsSampleComposerTest.java | 4 ++-- .../java/com/google/showcase/v1beta1/ComplianceSettings.java | 2 +- .../main/java/com/google/showcase/v1beta1/EchoSettings.java | 2 +- .../java/com/google/showcase/v1beta1/IdentitySettings.java | 2 +- .../java/com/google/showcase/v1beta1/MessagingSettings.java | 2 +- .../com/google/showcase/v1beta1/SequenceServiceSettings.java | 2 +- .../java/com/google/showcase/v1beta1/TestingSettings.java | 2 +- .../google/showcase/v1beta1/stub/ComplianceStubSettings.java | 2 +- .../com/google/showcase/v1beta1/stub/EchoStubSettings.java | 2 +- .../google/showcase/v1beta1/stub/IdentityStubSettings.java | 2 +- .../google/showcase/v1beta1/stub/MessagingStubSettings.java | 2 +- .../showcase/v1beta1/stub/SequenceServiceStubSettings.java | 2 +- .../com/google/showcase/v1beta1/stub/TestingStubSettings.java | 2 +- .../listconnections/SyncListConnections.java | 2 +- .../listconnections/SyncListConnections.java | 2 +- .../v1/stub/tetherstubsettings/egress/SyncEgress.java | 2 +- .../apigeeconnect/v1/tethersettings/egress/SyncEgress.java | 2 +- .../cloud/apigeeconnect/v1/ConnectionServiceSettings.java | 2 +- .../src/com/google/cloud/apigeeconnect/v1/TetherSettings.java | 2 +- .../apigeeconnect/v1/stub/ConnectionServiceStubSettings.java | 2 +- .../cloud/apigeeconnect/v1/stub/TetherStubSettings.java | 2 +- .../batchgetassetshistory/SyncBatchGetAssetsHistory.java | 2 +- .../batchgetassetshistory/SyncBatchGetAssetsHistory.java | 2 +- .../src/com/google/cloud/asset/v1/AssetServiceSettings.java | 2 +- .../google/cloud/asset/v1/stub/AssetServiceStubSettings.java | 2 +- .../v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java | 2 +- .../v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java | 2 +- .../cloud/bigtable/data/v2/BaseBigtableDataSettings.java | 2 +- .../cloud/bigtable/data/v2/stub/BigtableStubSettings.java | 2 +- .../addressessettings/aggregatedlist/SyncAggregatedList.java | 2 +- .../compute/v1small/regionoperationssettings/get/SyncGet.java | 2 +- .../aggregatedlist/SyncAggregatedList.java | 2 +- .../stub/regionoperationsstubsettings/get/SyncGet.java | 2 +- .../com/google/cloud/compute/v1small/AddressesSettings.java | 2 +- .../cloud/compute/v1small/RegionOperationsSettings.java | 2 +- .../cloud/compute/v1small/stub/AddressesStubSettings.java | 2 +- .../compute/v1small/stub/RegionOperationsStubSettings.java | 2 +- .../generateaccesstoken/SyncGenerateAccessToken.java | 2 +- .../generateaccesstoken/SyncGenerateAccessToken.java | 2 +- .../cloud/iam/credentials/v1/IamCredentialsSettings.java | 2 +- .../iam/credentials/v1/stub/IamCredentialsStubSettings.java | 2 +- .../v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java | 2 +- .../iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java | 2 +- .../goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java | 2 +- .../iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java | 2 +- .../getkeyring/SyncGetKeyRing.java | 2 +- .../getkeyring/SyncGetKeyRing.java | 2 +- .../com/google/cloud/kms/v1/KeyManagementServiceSettings.java | 2 +- .../cloud/kms/v1/stub/KeyManagementServiceStubSettings.java | 2 +- .../libraryservicesettings/createshelf/SyncCreateShelf.java | 2 +- .../createshelf/SyncCreateShelf.java | 2 +- .../cloud/example/library/v1/LibraryServiceSettings.java | 2 +- .../example/library/v1/stub/LibraryServiceStubSettings.java | 2 +- .../logging/v2/configsettings/getbucket/SyncGetBucket.java | 2 +- .../logging/v2/loggingsettings/deletelog/SyncDeleteLog.java | 2 +- .../v2/metricssettings/getlogmetric/SyncGetLogMetric.java | 2 +- .../configservicev2stubsettings/getbucket/SyncGetBucket.java | 2 +- .../loggingservicev2stubsettings/deletelog/SyncDeleteLog.java | 2 +- .../getlogmetric/SyncGetLogMetric.java | 2 +- .../src/com/google/cloud/logging/v2/ConfigSettings.java | 2 +- .../src/com/google/cloud/logging/v2/LoggingSettings.java | 2 +- .../src/com/google/cloud/logging/v2/MetricsSettings.java | 2 +- .../cloud/logging/v2/stub/ConfigServiceV2StubSettings.java | 2 +- .../cloud/logging/v2/stub/LoggingServiceV2StubSettings.java | 2 +- .../cloud/logging/v2/stub/MetricsServiceV2StubSettings.java | 2 +- .../schemaservicesettings/createschema/SyncCreateSchema.java | 2 +- .../publisherstubsettings/createtopic/SyncCreateTopic.java | 2 +- .../createschema/SyncCreateSchema.java | 2 +- .../createsubscription/SyncCreateSubscription.java | 2 +- .../createsubscription/SyncCreateSubscription.java | 2 +- .../v1/topicadminsettings/createtopic/SyncCreateTopic.java | 2 +- .../src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java | 2 +- .../com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java | 2 +- .../src/com/google/cloud/pubsub/v1/TopicAdminSettings.java | 2 +- .../google/cloud/pubsub/v1/stub/PublisherStubSettings.java | 2 +- .../cloud/pubsub/v1/stub/SchemaServiceStubSettings.java | 2 +- .../google/cloud/pubsub/v1/stub/SubscriberStubSettings.java | 2 +- .../cloudredissettings/getinstance/SyncGetInstance.java | 2 +- .../cloudredisstubsettings/getinstance/SyncGetInstance.java | 2 +- .../com/google/cloud/redis/v1beta1/CloudRedisSettings.java | 2 +- .../cloud/redis/v1beta1/stub/CloudRedisStubSettings.java | 2 +- .../v2/storagesettings/deletebucket/SyncDeleteBucket.java | 2 +- .../storagestubsettings/deletebucket/SyncDeleteBucket.java | 2 +- .../storage/src/com/google/storage/v2/StorageSettings.java | 2 +- .../src/com/google/storage/v2/stub/StorageStubSettings.java | 2 +- 107 files changed, 108 insertions(+), 108 deletions(-) diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java index fa0fba1b74..d42c5156d6 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java @@ -193,7 +193,7 @@ public static Optional composeSettingsSample( retrySettingsArgExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setTotalTimeout") + .setMethodName("setTotalTimeoutDuration") .setArguments(ofThreeHundredSecondsMethodInvocationExpr) .build(); retrySettingsArgExpr = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden index a7223b7d3d..7d93b4e252 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden @@ -66,7 +66,7 @@ import javax.annotation.Generated; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * EchoWithVersionStubSettings echoWithVersionSettings = echoWithVersionSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden index 31ef0a5019..2bb135e262 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden @@ -57,7 +57,7 @@ import javax.annotation.Generated; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * DeprecatedServiceSettings deprecatedServiceSettings = deprecatedServiceSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden index 1e689b94b1..329be3111f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden @@ -67,7 +67,7 @@ import org.threeten.bp.Duration; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * DeprecatedServiceStubSettings deprecatedServiceSettings = * deprecatedServiceSettingsBuilder.build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden index 6d76bddd27..9a653ff7f1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden @@ -64,7 +64,7 @@ import javax.annotation.Generated; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * EchoSettings echoSettings = echoSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden index 7dd1751f65..75cbb2378e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden @@ -93,7 +93,7 @@ import org.threeten.bp.Duration; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * EchoStubSettings echoSettings = echoSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden index 8e025da27d..84bac1bf7c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden @@ -100,7 +100,7 @@ import org.threeten.bp.Duration; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * LoggingServiceV2StubSettings loggingServiceV2Settings = loggingServiceV2SettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden index f0ebe1778c..cac396a5b0 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden @@ -100,7 +100,7 @@ import org.threeten.bp.Duration; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * PublisherStubSettings publisherSettings = publisherSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden index 5a8867d29f..59dec377dd 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden @@ -47,7 +47,7 @@ public class SyncEcho { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); EchoSettings echoSettings = echoSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden index cb0b5be3cc..c977904ed9 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden @@ -48,7 +48,7 @@ public class SyncFastFibonacci { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); DeprecatedServiceSettings deprecatedServiceSettings = deprecatedServiceSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden index b8823877e3..a8b93dc142 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden @@ -47,7 +47,7 @@ public class SyncCreateTopic { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); PublisherStubSettings publisherSettings = publisherSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden index 42563416ba..41d7cb3799 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden @@ -48,7 +48,7 @@ public class SyncDeleteLog { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); LoggingServiceV2StubSettings loggingServiceV2Settings = loggingServiceV2SettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden index af48615e1b..74fa2f091f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden @@ -47,7 +47,7 @@ public class SyncEcho { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); EchoStubSettings echoSettings = echoSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoWithVersionMethod.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoWithVersionMethod.golden index 2872fb640a..14fb354cd2 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoWithVersionMethod.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoWithVersionMethod.golden @@ -48,7 +48,7 @@ public class SyncEchoWithVersionMethod { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); EchoWithVersionStubSettings echoWithVersionSettings = echoWithVersionSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden index 2a8a9b02ad..abec122904 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden @@ -48,7 +48,7 @@ public class SyncFastFibonacci { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); DeprecatedServiceStubSettings deprecatedServiceSettings = deprecatedServiceSettingsBuilder.build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden index 3bd5121dd8..a0caad2fd7 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden @@ -65,7 +65,7 @@ import javax.annotation.Generated; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * EchoSettings echoSettings = echoSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden index 1353cc3c94..9c15e37e3c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden @@ -98,7 +98,7 @@ import org.threeten.bp.Duration; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * EchoStubSettings echoSettings = echoSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden index 6be50612e2..f78e215b4f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden @@ -57,7 +57,7 @@ import javax.annotation.Generated; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * WickedSettings wickedSettings = wickedSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden index 82d96b0620..944a519af1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden @@ -67,7 +67,7 @@ import javax.annotation.Generated; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * WickedStubSettings wickedSettings = wickedSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden index b58142529c..69c037eb65 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden @@ -56,7 +56,7 @@ import javax.annotation.Generated; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * ComplianceSettings complianceSettings = complianceSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden index b06778c398..90371db892 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden @@ -68,7 +68,7 @@ import javax.annotation.Generated; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden index c689b0fc32..86a47cc75e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden @@ -66,7 +66,7 @@ import javax.annotation.Generated; * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * EchoWithVersionStubSettings echoWithVersionSettings = echoWithVersionSettingsBuilder.build(); * } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java index 5e1420c670..4d5537dc18 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java @@ -68,7 +68,7 @@ void composeSettingsSample_serviceSettingsClass() { " .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))\n", " .setRetryDelayMultiplier(1.3)\n", " .setRpcTimeoutMultiplier(1.5)\n", - " .setTotalTimeout(Duration.ofSeconds(300))\n", + " .setTotalTimeoutDuration(Duration.ofSeconds(300))\n", " .build());\n", "EchoSettings echoSettings = echoSettingsBuilder.build();"); assertEquals(results.get(), expected); @@ -103,7 +103,7 @@ void composeSettingsSample_serviceStubClass() { " .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))\n", " .setRetryDelayMultiplier(1.3)\n", " .setRpcTimeoutMultiplier(1.5)\n", - " .setTotalTimeout(Duration.ofSeconds(300))\n", + " .setTotalTimeoutDuration(Duration.ofSeconds(300))\n", " .build());\n", "EchoStubSettings echoSettings = echoSettingsBuilder.build();"); assertEquals(results.get(), expected); diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java index 9aeb0b8941..7de94e626c 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java @@ -85,7 +85,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * ComplianceSettings complianceSettings = complianceSettingsBuilder.build(); * } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java index 44372eb0e2..ac225d68fb 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java @@ -91,7 +91,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * EchoSettings echoSettings = echoSettingsBuilder.build(); * } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java index ba096ff25d..f5ef8c09f6 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java @@ -87,7 +87,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * IdentitySettings identitySettings = identitySettingsBuilder.build(); * } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java index b756c7a247..e77a7da0d7 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java @@ -92,7 +92,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * MessagingSettings messagingSettings = messagingSettingsBuilder.build(); * } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java index b6500ed713..481dfacc3b 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java @@ -88,7 +88,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build(); * } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java index 378da6a0ab..3c89777493 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java @@ -88,7 +88,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * TestingSettings testingSettings = testingSettingsBuilder.build(); * } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java index c0f90da32d..84c9022041 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java @@ -105,7 +105,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build(); * } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java index 1a657a488c..81bf689aff 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java @@ -128,7 +128,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * EchoStubSettings echoSettings = echoSettingsBuilder.build(); * } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java index 12f314aa7b..ab34bcff79 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java @@ -111,7 +111,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * IdentityStubSettings identitySettings = identitySettingsBuilder.build(); * } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java index cb78962215..fc6938de70 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java @@ -133,7 +133,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * MessagingStubSettings messagingSettings = messagingSettingsBuilder.build(); * } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java index 89309607d1..177617108d 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java @@ -116,7 +116,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build(); * } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java index 2364aa78ef..7a356f3755 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java @@ -118,7 +118,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * TestingStubSettings testingSettings = testingSettingsBuilder.build(); * } diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservicesettings/listconnections/SyncListConnections.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservicesettings/listconnections/SyncListConnections.java index 13da16e600..a1123e9556 100644 --- a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservicesettings/listconnections/SyncListConnections.java +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservicesettings/listconnections/SyncListConnections.java @@ -48,7 +48,7 @@ public static void syncListConnections() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/connectionservicestubsettings/listconnections/SyncListConnections.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/connectionservicestubsettings/listconnections/SyncListConnections.java index 7f5342c326..0bd7adfd3a 100644 --- a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/connectionservicestubsettings/listconnections/SyncListConnections.java +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/connectionservicestubsettings/listconnections/SyncListConnections.java @@ -48,7 +48,7 @@ public static void syncListConnections() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); ConnectionServiceStubSettings connectionServiceSettings = connectionServiceSettingsBuilder.build(); diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/tetherstubsettings/egress/SyncEgress.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/tetherstubsettings/egress/SyncEgress.java index d94eeed6d2..2ae22608c8 100644 --- a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/tetherstubsettings/egress/SyncEgress.java +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/tetherstubsettings/egress/SyncEgress.java @@ -47,7 +47,7 @@ public static void syncEgress() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); TetherStubSettings tetherSettings = tetherSettingsBuilder.build(); } diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tethersettings/egress/SyncEgress.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tethersettings/egress/SyncEgress.java index 9a24a5a5be..141187afe0 100644 --- a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tethersettings/egress/SyncEgress.java +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tethersettings/egress/SyncEgress.java @@ -47,7 +47,7 @@ public static void syncEgress() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); TetherSettings tetherSettings = tetherSettingsBuilder.build(); } diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java index 642f237365..9012ff94d7 100644 --- a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java @@ -77,7 +77,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build(); * } diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java index 492b03e7a2..69aa8f9020 100644 --- a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java @@ -72,7 +72,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * TetherSettings tetherSettings = tetherSettingsBuilder.build(); * } diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java index 99b8391962..706bfab87e 100644 --- a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java @@ -97,7 +97,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * ConnectionServiceStubSettings connectionServiceSettings = * connectionServiceSettingsBuilder.build(); diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java index 86fcb09c6f..91aa296e33 100644 --- a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java @@ -82,7 +82,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * TetherStubSettings tetherSettings = tetherSettingsBuilder.build(); * } diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java index 4d4d0063b2..008dec5b47 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java @@ -47,7 +47,7 @@ public static void syncBatchGetAssetsHistory() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java index ab686f365f..bee9726194 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java @@ -48,7 +48,7 @@ public static void syncBatchGetAssetsHistory() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java index 0c572f7e8f..9c35ef2483 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java @@ -82,7 +82,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build(); * } diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java index 79d312b39d..3610bee55d 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java @@ -141,7 +141,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build(); * } diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java index 66b13f8682..e782c9721d 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java @@ -48,7 +48,7 @@ public static void syncMutateRow() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); BaseBigtableDataSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build(); } diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java index 00fad89b07..2e6aedf14d 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java @@ -48,7 +48,7 @@ public static void syncMutateRow() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); BigtableStubSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build(); } diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java index 468782425e..6aa3fa9e10 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java @@ -87,7 +87,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * BaseBigtableDataSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build(); * } diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java index 1df27cf781..74208965e0 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java @@ -96,7 +96,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * BigtableStubSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build(); * } diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java index b94eadda96..c3fe854170 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java @@ -47,7 +47,7 @@ public static void syncAggregatedList() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); AddressesSettings addressesSettings = addressesSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java index 39ca29ebb8..00588d4672 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java @@ -48,7 +48,7 @@ public static void syncGet() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); RegionOperationsSettings regionOperationsSettings = regionOperationsSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java index 2c001d4d11..cdb0912932 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java @@ -47,7 +47,7 @@ public static void syncAggregatedList() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); AddressesStubSettings addressesSettings = addressesSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java index 64798143dd..cfd279abd0 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java @@ -48,7 +48,7 @@ public static void syncGet() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); RegionOperationsStubSettings regionOperationsSettings = regionOperationsSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java index d6c57cf7d1..4c629a6614 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java @@ -76,7 +76,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * AddressesSettings addressesSettings = addressesSettingsBuilder.build(); * } diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java index cf88bbc0b2..4624100d1b 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java @@ -72,7 +72,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * RegionOperationsSettings regionOperationsSettings = regionOperationsSettingsBuilder.build(); * } diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java index 4381b0d34d..f45050e228 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java @@ -105,7 +105,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * AddressesStubSettings addressesSettings = addressesSettingsBuilder.build(); * } diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java index 7d72dd19ff..4889730ef0 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java @@ -84,7 +84,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * RegionOperationsStubSettings regionOperationsSettings = regionOperationsSettingsBuilder.build(); * } diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.java index 6e8b8d1b91..7817b8e829 100644 --- a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.java +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.java @@ -48,7 +48,7 @@ public static void syncGenerateAccessToken() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); IamCredentialsSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build(); } diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.java index 09cf7ebe41..0ba5a50b3a 100644 --- a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.java +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.java @@ -48,7 +48,7 @@ public static void syncGenerateAccessToken() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); IamCredentialsStubSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build(); } diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java index 8564022dd1..fae15b00d4 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java @@ -75,7 +75,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * IamCredentialsSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build(); * } diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java index 3043894910..af2affa88c 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java @@ -94,7 +94,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * IamCredentialsStubSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build(); * } diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java index f46c98085d..a38452a2e8 100644 --- a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java @@ -47,7 +47,7 @@ public static void syncSetIamPolicy() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); IAMPolicySettings iAMPolicySettings = iAMPolicySettingsBuilder.build(); } diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java index 543866e4a3..9c441aa544 100644 --- a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java @@ -47,7 +47,7 @@ public static void syncSetIamPolicy() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); IAMPolicyStubSettings iAMPolicySettings = iAMPolicySettingsBuilder.build(); } diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java index 8602195d12..7db551147e 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java @@ -71,7 +71,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * IAMPolicySettings iAMPolicySettings = iAMPolicySettingsBuilder.build(); * } diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java index 054d39f96a..a30f3b8b4c 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java @@ -85,7 +85,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * IAMPolicyStubSettings iAMPolicySettings = iAMPolicySettingsBuilder.build(); * } diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.java index 850f6c0c50..a108e2494e 100644 --- a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.java +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.java @@ -48,7 +48,7 @@ public static void syncGetKeyRing() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); KeyManagementServiceSettings keyManagementServiceSettings = keyManagementServiceSettingsBuilder.build(); diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.java index 9595db4020..940e95b4a9 100644 --- a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.java +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.java @@ -48,7 +48,7 @@ public static void syncGetKeyRing() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); KeyManagementServiceStubSettings keyManagementServiceSettings = keyManagementServiceSettingsBuilder.build(); diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java index 25d884a96f..2cf0d74fe1 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java @@ -87,7 +87,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * KeyManagementServiceSettings keyManagementServiceSettings = * keyManagementServiceSettingsBuilder.build(); diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java index 8cd904049c..e080f7f43f 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java @@ -138,7 +138,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * KeyManagementServiceStubSettings keyManagementServiceSettings = * keyManagementServiceSettingsBuilder.build(); diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java index 4615568356..86e01d3b84 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java @@ -48,7 +48,7 @@ public static void syncCreateShelf() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); LibraryServiceSettings libraryServiceSettings = libraryServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java index fec1f4cd69..edbb41cea4 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java @@ -48,7 +48,7 @@ public static void syncCreateShelf() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); LibraryServiceStubSettings libraryServiceSettings = libraryServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java index 4c2f6f8ee4..71bd31c28d 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java @@ -95,7 +95,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * LibraryServiceSettings libraryServiceSettings = libraryServiceSettingsBuilder.build(); * } diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java index 91a41a5477..92ae57c30f 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java @@ -112,7 +112,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * LibraryServiceStubSettings libraryServiceSettings = libraryServiceSettingsBuilder.build(); * } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java index 9e91328bf4..3ef0ab4f72 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java @@ -47,7 +47,7 @@ public static void syncGetBucket() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); ConfigSettings configSettings = configSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java index 29c96a5cbc..f156660ea0 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java @@ -47,7 +47,7 @@ public static void syncDeleteLog() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); LoggingSettings loggingSettings = loggingSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java index ad56d19aa2..e86394cdb5 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java @@ -47,7 +47,7 @@ public static void syncGetLogMetric() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); MetricsSettings metricsSettings = metricsSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java index d1f4e1ef35..b3d3dcee4e 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java @@ -48,7 +48,7 @@ public static void syncGetBucket() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); ConfigServiceV2StubSettings configSettings = configSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java index d61b45c2c3..8b14263604 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java @@ -48,7 +48,7 @@ public static void syncDeleteLog() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); LoggingServiceV2StubSettings loggingSettings = loggingSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java index 4d1d4fe810..c1769245c9 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java @@ -48,7 +48,7 @@ public static void syncGetLogMetric() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); MetricsServiceV2StubSettings metricsSettings = metricsSettingsBuilder.build(); } diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java index d3e9073a97..747354c9db 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java @@ -118,7 +118,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * ConfigSettings configSettings = configSettingsBuilder.build(); * } diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java index a66fc87531..dbc62a4997 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java @@ -90,7 +90,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * LoggingSettings loggingSettings = loggingSettingsBuilder.build(); * } diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java index e18e3458e1..0594497a8f 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java @@ -82,7 +82,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * MetricsSettings metricsSettings = metricsSettingsBuilder.build(); * } diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java index 69eca6aa14..58322cf518 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java @@ -137,7 +137,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * ConfigServiceV2StubSettings configSettings = configSettingsBuilder.build(); * } diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java index 44d8fc34c9..939099f108 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java @@ -116,7 +116,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * LoggingServiceV2StubSettings loggingSettings = loggingSettingsBuilder.build(); * } diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java index 43ea126387..ac7e1b659a 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java @@ -98,7 +98,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * MetricsServiceV2StubSettings metricsSettings = metricsSettingsBuilder.build(); * } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java index 32a861a1cd..374bbf8750 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java @@ -47,7 +47,7 @@ public static void syncCreateSchema() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java index 236aea51b0..f85555e0ad 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java @@ -47,7 +47,7 @@ public static void syncCreateTopic() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); PublisherStubSettings topicAdminSettings = topicAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java index fec071b8ae..e061afc1fa 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java @@ -48,7 +48,7 @@ public static void syncCreateSchema() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java index 2ce549835f..1546bbde31 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java @@ -48,7 +48,7 @@ public static void syncCreateSubscription() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); SubscriberStubSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java index a1a8d6e394..4cc7687822 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java @@ -48,7 +48,7 @@ public static void syncCreateSubscription() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); SubscriptionAdminSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java index 97a5461e3f..25edf73b17 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java @@ -47,7 +47,7 @@ public static void syncCreateTopic() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); TopicAdminSettings topicAdminSettings = topicAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java index b4f5862f09..1abc3c9102 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java @@ -96,7 +96,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); * } diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java index 871619ac67..189d4e10ad 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java @@ -105,7 +105,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * SubscriptionAdminSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build(); * } diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java index 3ced4b7926..c0f5899136 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java @@ -97,7 +97,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * TopicAdminSettings topicAdminSettings = topicAdminSettingsBuilder.build(); * } diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java index 2271861ee3..47585fc221 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java @@ -121,7 +121,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * PublisherStubSettings topicAdminSettings = topicAdminSettingsBuilder.build(); * } diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java index e2c752b9a2..f65ca14057 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java @@ -111,7 +111,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); * } diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java index caa96453f5..8bcce5d901 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java @@ -120,7 +120,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * SubscriberStubSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build(); * } diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.java index 1424fa3a82..1cc029b8e8 100644 --- a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.java +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.java @@ -47,7 +47,7 @@ public static void syncGetInstance() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); CloudRedisSettings cloudRedisSettings = cloudRedisSettingsBuilder.build(); } diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.java index c669650327..dc39094d1e 100644 --- a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.java +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.java @@ -47,7 +47,7 @@ public static void syncGetInstance() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); CloudRedisStubSettings cloudRedisSettings = cloudRedisSettingsBuilder.build(); } diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java index 0b9b4a7735..58c24e3eb5 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java @@ -80,7 +80,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * CloudRedisSettings cloudRedisSettings = cloudRedisSettingsBuilder.build(); * } diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java index d07bcd6bad..db9d861f59 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java @@ -114,7 +114,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * CloudRedisStubSettings cloudRedisSettings = cloudRedisSettingsBuilder.build(); * } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java index eb46488d41..006a9755fb 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java @@ -47,7 +47,7 @@ public static void syncDeleteBucket() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); StorageSettings storageSettings = storageSettingsBuilder.build(); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java index 097d5d685a..1df95e5053 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java @@ -47,7 +47,7 @@ public static void syncDeleteBucket() throws Exception { .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofSeconds(300)) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); StorageStubSettings storageSettings = storageSettingsBuilder.build(); } diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java b/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java index 0bf0366958..1d4401673c 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java @@ -85,7 +85,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * StorageSettings storageSettings = storageSettingsBuilder.build(); * } diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java index bd33ca47e7..c0d6e8102c 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java @@ -143,7 +143,7 @@ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) * .setRetryDelayMultiplier(1.3) * .setRpcTimeoutMultiplier(1.5) - * .setTotalTimeout(Duration.ofSeconds(300)) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) * .build()); * StorageStubSettings storageSettings = storageSettingsBuilder.build(); * } From d3b98ae07e95784f4b565f86d64ba2f2fcfe8510 Mon Sep 17 00:00:00 2001 From: Alice Li Date: Thu, 25 Jul 2024 13:55:26 -0400 Subject: [PATCH 4/7] update to set different defaults for LRO methods --- .../AbstractServiceSettingsClassComposer.java | 7 +- ...tractServiceStubSettingsClassComposer.java | 7 +- .../samplecode/SettingsSampleComposer.java | 181 ++++++++++++------ .../SettingsSampleComposerTest.java | 68 ++++++- 4 files changed, 195 insertions(+), 68 deletions(-) diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java index 60e3fcd38a..adbcb518b5 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java @@ -145,9 +145,14 @@ private static List createClassHeaderComments( .orElse(service.methods().get(0))); Optional methodNameOpt = methodOpt.isPresent() ? Optional.of(methodOpt.get().name()) : Optional.empty(); + Optional isSampleMethodLRO = + methodOpt.isPresent() ? Optional.of(methodOpt.get().hasLro()) : Optional.of(false); Optional sampleCode = SettingsSampleComposer.composeSettingsSample( - methodNameOpt, ClassNames.getServiceSettingsClassName(service), classType); + methodNameOpt, + ClassNames.getServiceSettingsClassName(service), + classType, + isSampleMethodLRO); Optional docSampleCode = Optional.empty(); if (sampleCode.isPresent()) { diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java index 557b94663c..430f07591b 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java @@ -423,9 +423,14 @@ private static List createClassHeaderComments( .findFirst() .orElse(service.methods().get(0))); Optional methodNameOpt = methodOpt.map(Method::name); + Optional isSampleMethodLRO = + methodOpt.isPresent() ? Optional.of(methodOpt.get().hasLro()) : Optional.of(false); Optional sampleCode = SettingsSampleComposer.composeSettingsSample( - methodNameOpt, ClassNames.getServiceSettingsClassName(service), classType); + methodNameOpt, + ClassNames.getServiceSettingsClassName(service), + classType, + isSampleMethodLRO); Optional docSampleCode = Optional.empty(); if (sampleCode.isPresent()) { diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java index d42c5156d6..b77726845c 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java @@ -37,7 +37,10 @@ public final class SettingsSampleComposer { public static Optional composeSettingsSample( - Optional methodNameOpt, String settingsClassName, TypeNode classType) { + Optional methodNameOpt, + String settingsClassName, + TypeNode classType, + Optional isSampleMethodLRO) { if (!methodNameOpt.isPresent()) { return Optional.empty(); } @@ -89,6 +92,24 @@ public static Optional composeSettingsSample( .setExprReferenceExpr(retrySettingsArgExpr) .setMethodName("toBuilder") .build(); + MethodInvocationExpr ofFiveThousandMillisMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofMillis") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("5000").build())) + .build(); + MethodInvocationExpr ofTwentyFourHoursMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofHours") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("24").build())) + .build(); MethodInvocationExpr ofOneSecondMethodInvocationExpr = MethodInvocationExpr.builder() .setStaticReferenceType( @@ -134,68 +155,102 @@ public static Optional composeSettingsSample( ValueExpr.withValue( PrimitiveValue.builder().setType(TypeNode.INT).setValue("300").build())) .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setInitialRetryDelayDuration") - .setArguments(ofOneSecondMethodInvocationExpr) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setInitialRpcTimeoutDuration") - .setArguments(ofFiveSecondsMethodInvocationExpr) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setMaxAttempts") - .setArguments( - ValueExpr.withValue( - PrimitiveValue.builder().setType(TypeNode.INT).setValue("5").build())) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setMaxRetryDelayDuration") - .setArguments(ofThirtySecondsMethodInvocationExpr) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setMaxRpcTimeoutDuration") - .setArguments(ofSixtySecondsMethodInvocationExpr) - .build(); - double retryDelayMultiplier = 1.3; - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setRetryDelayMultiplier") - .setArguments( - ValueExpr.withValue( - PrimitiveValue.builder() - .setType(TypeNode.DOUBLE) - .setValue(String.format("%.1f", retryDelayMultiplier)) - .build())) - .build(); - double rpcTimeoutMultiplier = 1.5; - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setRpcTimeoutMultiplier") - .setArguments( - ValueExpr.withValue( - PrimitiveValue.builder() - .setType(TypeNode.DOUBLE) - .setValue(String.format("%.1f", rpcTimeoutMultiplier)) - .build())) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setTotalTimeoutDuration") - .setArguments(ofThreeHundredSecondsMethodInvocationExpr) - .build(); + // For LRO methods, use a different set of RetrySettings defaults. + if (isSampleMethodLRO.get()) { + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setInitialRetryDelayDuration") + .setArguments(ofFiveThousandMillisMethodInvocationExpr) + .build(); + double retryDelayMultiplier = 1.5; + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setRetryDelayMultiplier") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder() + .setType(TypeNode.DOUBLE) + .setValue(String.format("%.1f", retryDelayMultiplier)) + .build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxRetryDelay") + .setArguments(ofFiveThousandMillisMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setTotalTimeoutDuration") + .setArguments(ofTwentyFourHoursMethodInvocationExpr) + .build(); + } else { + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setInitialRetryDelayDuration") + .setArguments(ofOneSecondMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setInitialRpcTimeoutDuration") + .setArguments(ofFiveSecondsMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxAttempts") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("5").build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxRetryDelayDuration") + .setArguments(ofThirtySecondsMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxRpcTimeoutDuration") + .setArguments(ofSixtySecondsMethodInvocationExpr) + .build(); + double retryDelayMultiplier = 1.3; + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setRetryDelayMultiplier") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder() + .setType(TypeNode.DOUBLE) + .setValue(String.format("%.1f", retryDelayMultiplier)) + .build())) + .build(); + double rpcTimeoutMultiplier = 1.5; + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setRpcTimeoutMultiplier") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder() + .setType(TypeNode.DOUBLE) + .setValue(String.format("%.1f", rpcTimeoutMultiplier)) + .build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setTotalTimeoutDuration") + .setArguments(ofThreeHundredSecondsMethodInvocationExpr) + .build(); + } retrySettingsArgExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(retrySettingsArgExpr) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java index 4d5537dc18..5b2a3a6678 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java @@ -35,7 +35,7 @@ void composeSettingsSample_noMethods() { Optional results = writeSample( SettingsSampleComposer.composeSettingsSample( - Optional.empty(), "EchoSettings", classType)); + Optional.empty(), "EchoSettings", classType, Optional.of(false))); assertEquals(results, Optional.empty()); } @@ -50,7 +50,7 @@ void composeSettingsSample_serviceSettingsClass() { Optional results = writeSample( SettingsSampleComposer.composeSettingsSample( - Optional.of("Echo"), "EchoSettings", classType)); + Optional.of("Echo"), "EchoSettings", classType, Optional.of(false))); String expected = LineFormatter.lines( "EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();\n", @@ -85,7 +85,7 @@ void composeSettingsSample_serviceStubClass() { Optional results = writeSample( SettingsSampleComposer.composeSettingsSample( - Optional.of("Echo"), "EchoSettings", classType)); + Optional.of("Echo"), "EchoSettings", classType, Optional.of(false))); String expected = LineFormatter.lines( "EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();\n", @@ -109,6 +109,68 @@ void composeSettingsSample_serviceStubClass() { assertEquals(results.get(), expected); } + @Test + void composeSettingsSample_serviceSettingsClass_LROMethod() { + TypeNode classType = + TypeNode.withReference( + VaporReference.builder() + .setName("EchoSettings") + .setPakkage("com.google.showcase.v1beta1") + .build()); + Optional results = + writeSample( + SettingsSampleComposer.composeSettingsSample( + Optional.of("Echo"), "EchoSettings", classType, Optional.of(true))); + String expected = + LineFormatter.lines( + "EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();\n", + "echoSettingsBuilder\n", + " .echoSettings()\n", + " .setRetrySettings(\n", + " echoSettingsBuilder\n", + " .echoSettings()\n", + " .getRetrySettings()\n", + " .toBuilder()\n", + " .setInitialRetryDelayDuration(Duration.ofMillis(5000))\n", + " .setRetryDelayMultiplier(1.5)\n", + " .setMaxRetryDelay(Duration.ofMillis(5000))\n", + " .setTotalTimeoutDuration(Duration.ofHours(24))\n", + " .build());\n", + "EchoSettings echoSettings = echoSettingsBuilder.build();"); + assertEquals(results.get(), expected); + } + + @Test + void composeSettingsSample_serviceStubClass_LROMethod() { + TypeNode classType = + TypeNode.withReference( + VaporReference.builder() + .setName("EchoStubSettings") + .setPakkage("com.google.showcase.v1beta1") + .build()); + Optional results = + writeSample( + SettingsSampleComposer.composeSettingsSample( + Optional.of("Echo"), "EchoSettings", classType, Optional.of(true))); + String expected = + LineFormatter.lines( + "EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();\n", + "echoSettingsBuilder\n", + " .echoSettings()\n", + " .setRetrySettings(\n", + " echoSettingsBuilder\n", + " .echoSettings()\n", + " .getRetrySettings()\n", + " .toBuilder()\n", + " .setInitialRetryDelayDuration(Duration.ofMillis(5000))\n", + " .setRetryDelayMultiplier(1.5)\n", + " .setMaxRetryDelay(Duration.ofMillis(5000))\n", + " .setTotalTimeoutDuration(Duration.ofHours(24))\n", + " .build());\n", + "EchoStubSettings echoSettings = echoSettingsBuilder.build();"); + assertEquals(results.get(), expected); + } + private Optional writeSample(Optional sample) { if (sample.isPresent()) { return Optional.of(SampleCodeWriter.write(sample.get().body())); From 100cc0658f418d8038a32593547d91279b0834bc Mon Sep 17 00:00:00 2001 From: Alice Li Date: Thu, 25 Jul 2024 14:13:55 -0400 Subject: [PATCH 5/7] check if LRO isPresent first --- .../gapic/composer/samplecode/SettingsSampleComposer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java index b77726845c..20430df5c9 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java @@ -156,7 +156,11 @@ public static Optional composeSettingsSample( PrimitiveValue.builder().setType(TypeNode.INT).setValue("300").build())) .build(); // For LRO methods, use a different set of RetrySettings defaults. - if (isSampleMethodLRO.get()) { + boolean useLRODefaults = false; + if(isSampleMethodLRO.isPresent()){ + useLRODefaults = isSampleMethodLRO.get(); + } + if (useLRODefaults) { retrySettingsArgExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(retrySettingsArgExpr) From d72726e2f3b8ba423413f61022239aac0b7f8a83 Mon Sep 17 00:00:00 2001 From: Alice Li Date: Thu, 25 Jul 2024 14:19:57 -0400 Subject: [PATCH 6/7] fix lint --- .../gapic/composer/samplecode/SettingsSampleComposer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java index 20430df5c9..13ad2db790 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java @@ -157,7 +157,7 @@ public static Optional composeSettingsSample( .build(); // For LRO methods, use a different set of RetrySettings defaults. boolean useLRODefaults = false; - if(isSampleMethodLRO.isPresent()){ + if (isSampleMethodLRO.isPresent()) { useLRODefaults = isSampleMethodLRO.get(); } if (useLRODefaults) { From d167a3149c12e645d1fa23ceb0c4dec5e6915a44 Mon Sep 17 00:00:00 2001 From: Alice Li Date: Fri, 26 Jul 2024 17:48:12 -0400 Subject: [PATCH 7/7] update to include separate sample for lros --- .../comment/SettingsCommentComposer.java | 15 + .../AbstractServiceSettingsClassComposer.java | 29 +- ...tractServiceStubSettingsClassComposer.java | 30 +- .../samplecode/SettingsSampleComposer.java | 376 ++++++++++++------ .../composer/grpc/goldens/EchoSettings.golden | 25 ++ .../grpc/goldens/EchoStubSettings.golden | 25 ++ .../samples/servicesettings/SyncWait.golden | 53 +++ .../servicesettings/stub/SyncWait.golden | 53 +++ .../grpcrest/goldens/EchoSettings.golden | 25 ++ .../grpcrest/goldens/EchoStubSettings.golden | 25 ++ .../SettingsSampleComposerTest.java | 62 ++- .../google/showcase/v1beta1/EchoSettings.java | 25 ++ .../showcase/v1beta1/MessagingSettings.java | 25 ++ .../v1beta1/stub/EchoStubSettings.java | 25 ++ .../v1beta1/stub/MessagingStubSettings.java | 25 ++ .../exportassets/SyncExportAssets.java | 53 +++ .../exportassets/SyncExportAssets.java | 54 +++ .../cloud/asset/v1/AssetServiceSettings.java | 25 ++ .../v1/stub/AssetServiceStubSettings.java | 26 ++ .../addressessettings/delete/SyncDelete.java | 53 +++ .../delete/SyncDelete.java | 53 +++ .../compute/v1small/AddressesSettings.java | 25 ++ .../v1small/stub/AddressesStubSettings.java | 25 ++ .../copylogentries/SyncCopyLogEntries.java | 53 +++ .../copylogentries/SyncCopyLogEntries.java | 54 +++ .../cloud/logging/v2/ConfigSettings.java | 25 ++ .../v2/stub/ConfigServiceV2StubSettings.java | 26 ++ .../createinstance/SyncCreateInstance.java | 53 +++ .../createinstance/SyncCreateInstance.java | 53 +++ .../redis/v1beta1/CloudRedisSettings.java | 25 ++ .../v1beta1/stub/CloudRedisStubSettings.java | 25 ++ 31 files changed, 1278 insertions(+), 168 deletions(-) create mode 100644 gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncWait.golden create mode 100644 gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncWait.golden create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/exportassets/SyncExportAssets.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/exportassets/SyncExportAssets.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/delete/SyncDelete.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/delete/SyncDelete.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/copylogentries/SyncCopyLogEntries.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/copylogentries/SyncCopyLogEntries.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/createinstance/SyncCreateInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/createinstance/SyncCreateInstance.java diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java index 7e834cbfc4..eb906f2145 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java @@ -41,6 +41,9 @@ public class SettingsCommentComposer { private static final String CLASS_HEADER_SAMPLE_CODE_PATTERN = "For example, to set the [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) of %s:"; + private static final String CLASS_HEADER_LRO_SAMPLE_CODE_PATTERN = + "To configure the RetrySettings of a Long Running Operation method, create an OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to configure the RetrySettings for %s:"; + private static final String CLASS_HEADER_SAMPLE_CODE_SUFFIX = "Please refer to the [Client Side Retry Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for additional support in setting retries."; @@ -142,6 +145,8 @@ public static List createClassHeaderComments( boolean isDeprecated, Optional methodNameOpt, Optional sampleCodeOpt, + Optional lroMethodNameOpt, + Optional lroSampleCodeOpt, TypeNode classType) { // Split default address and port. int colonIndex = defaultHost.indexOf(COLON); @@ -177,6 +182,16 @@ public static List createClassHeaderComments( .addComment(CLASS_HEADER_SAMPLE_CODE_SUFFIX); } + if (lroMethodNameOpt.isPresent() && lroSampleCodeOpt.isPresent()) { + javaDocCommentBuilder = + javaDocCommentBuilder + .addParagraph( + String.format( + CLASS_HEADER_LRO_SAMPLE_CODE_PATTERN, + JavaStyle.toLowerCamelCase(lroMethodNameOpt.get()))) + .addSampleCode(lroSampleCodeOpt.get()); + } + if (isDeprecated) { javaDocCommentBuilder.setDeprecated(CommentComposer.DEPRECATED_CLASS_STRING); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java index adbcb518b5..c9b77fc22d 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java @@ -145,20 +145,33 @@ private static List createClassHeaderComments( .orElse(service.methods().get(0))); Optional methodNameOpt = methodOpt.isPresent() ? Optional.of(methodOpt.get().name()) : Optional.empty(); - Optional isSampleMethodLRO = - methodOpt.isPresent() ? Optional.of(methodOpt.get().hasLro()) : Optional.of(false); Optional sampleCode = SettingsSampleComposer.composeSettingsSample( - methodNameOpt, - ClassNames.getServiceSettingsClassName(service), - classType, - isSampleMethodLRO); - + methodNameOpt, ClassNames.getServiceSettingsClassName(service), classType); Optional docSampleCode = Optional.empty(); if (sampleCode.isPresent()) { samples.add(sampleCode.get()); docSampleCode = Optional.of(SampleCodeWriter.writeInlineSample(sampleCode.get().body())); } + // Create a sample for a LRO method using LRO-specific RetrySettings, if one exists in the + // service. + Optional lroMethodOpt = + service.methods().isEmpty() + ? Optional.empty() + : service.methods().stream() + .filter(m -> m.stream() == Stream.NONE && m.hasLro()) + .findFirst(); + Optional lroMethodNameOpt = + lroMethodOpt.isPresent() ? Optional.of(lroMethodOpt.get().name()) : Optional.empty(); + Optional lroSampleCode = + SettingsSampleComposer.composeLroSettingsSample( + lroMethodNameOpt, ClassNames.getServiceSettingsClassName(service), classType); + Optional lroDocSampleCode = Optional.empty(); + if (lroSampleCode.isPresent()) { + samples.add(lroSampleCode.get()); + lroDocSampleCode = + Optional.of(SampleCodeWriter.writeInlineSample(lroSampleCode.get().body())); + } return SettingsCommentComposer.createClassHeaderComments( ClassNames.getServiceClientClassName(service), @@ -166,6 +179,8 @@ private static List createClassHeaderComments( service.isDeprecated(), methodNameOpt, docSampleCode, + lroMethodNameOpt, + lroDocSampleCode, classType); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java index 430f07591b..1dfb4e611d 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java @@ -423,20 +423,34 @@ private static List createClassHeaderComments( .findFirst() .orElse(service.methods().get(0))); Optional methodNameOpt = methodOpt.map(Method::name); - Optional isSampleMethodLRO = - methodOpt.isPresent() ? Optional.of(methodOpt.get().hasLro()) : Optional.of(false); + Optional sampleCode = SettingsSampleComposer.composeSettingsSample( - methodNameOpt, - ClassNames.getServiceSettingsClassName(service), - classType, - isSampleMethodLRO); - + methodNameOpt, ClassNames.getServiceSettingsClassName(service), classType); Optional docSampleCode = Optional.empty(); if (sampleCode.isPresent()) { samples.add(sampleCode.get()); docSampleCode = Optional.of(SampleCodeWriter.writeInlineSample(sampleCode.get().body())); } + // Create a sample for a LRO method using LRO-specific RetrySettings, if one exists in the + // service. + Optional lroMethodOpt = + service.methods().isEmpty() + ? Optional.empty() + : service.methods().stream() + .filter(m -> m.stream() == Stream.NONE && m.hasLro()) + .findFirst(); + Optional lroMethodNameOpt = + lroMethodOpt.isPresent() ? Optional.of(lroMethodOpt.get().name()) : Optional.empty(); + Optional lroSampleCode = + SettingsSampleComposer.composeLroSettingsSample( + lroMethodNameOpt, ClassNames.getServiceSettingsClassName(service), classType); + Optional lroDocSampleCode = Optional.empty(); + if (lroSampleCode.isPresent()) { + samples.add(lroSampleCode.get()); + lroDocSampleCode = + Optional.of(SampleCodeWriter.writeInlineSample(lroSampleCode.get().body())); + } return SettingsCommentComposer.createClassHeaderComments( ClassNames.getServiceStubClassName(service), @@ -444,6 +458,8 @@ private static List createClassHeaderComments( service.isDeprecated(), methodNameOpt, docSampleCode, + lroMethodNameOpt, + lroDocSampleCode, classType); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java index 13ad2db790..460c8a443a 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java @@ -37,10 +37,7 @@ public final class SettingsSampleComposer { public static Optional composeSettingsSample( - Optional methodNameOpt, - String settingsClassName, - TypeNode classType, - Optional isSampleMethodLRO) { + Optional methodNameOpt, String settingsClassName, TypeNode classType) { if (!methodNameOpt.isPresent()) { return Optional.empty(); } @@ -92,24 +89,6 @@ public static Optional composeSettingsSample( .setExprReferenceExpr(retrySettingsArgExpr) .setMethodName("toBuilder") .build(); - MethodInvocationExpr ofFiveThousandMillisMethodInvocationExpr = - MethodInvocationExpr.builder() - .setStaticReferenceType( - TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) - .setMethodName("ofMillis") - .setArguments( - ValueExpr.withValue( - PrimitiveValue.builder().setType(TypeNode.INT).setValue("5000").build())) - .build(); - MethodInvocationExpr ofTwentyFourHoursMethodInvocationExpr = - MethodInvocationExpr.builder() - .setStaticReferenceType( - TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) - .setMethodName("ofHours") - .setArguments( - ValueExpr.withValue( - PrimitiveValue.builder().setType(TypeNode.INT).setValue("24").build())) - .build(); MethodInvocationExpr ofOneSecondMethodInvocationExpr = MethodInvocationExpr.builder() .setStaticReferenceType( @@ -155,106 +134,68 @@ public static Optional composeSettingsSample( ValueExpr.withValue( PrimitiveValue.builder().setType(TypeNode.INT).setValue("300").build())) .build(); - // For LRO methods, use a different set of RetrySettings defaults. - boolean useLRODefaults = false; - if (isSampleMethodLRO.isPresent()) { - useLRODefaults = isSampleMethodLRO.get(); - } - if (useLRODefaults) { - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setInitialRetryDelayDuration") - .setArguments(ofFiveThousandMillisMethodInvocationExpr) - .build(); - double retryDelayMultiplier = 1.5; - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setRetryDelayMultiplier") - .setArguments( - ValueExpr.withValue( - PrimitiveValue.builder() - .setType(TypeNode.DOUBLE) - .setValue(String.format("%.1f", retryDelayMultiplier)) - .build())) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setMaxRetryDelay") - .setArguments(ofFiveThousandMillisMethodInvocationExpr) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setTotalTimeoutDuration") - .setArguments(ofTwentyFourHoursMethodInvocationExpr) - .build(); - } else { - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setInitialRetryDelayDuration") - .setArguments(ofOneSecondMethodInvocationExpr) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setInitialRpcTimeoutDuration") - .setArguments(ofFiveSecondsMethodInvocationExpr) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setMaxAttempts") - .setArguments( - ValueExpr.withValue( - PrimitiveValue.builder().setType(TypeNode.INT).setValue("5").build())) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setMaxRetryDelayDuration") - .setArguments(ofThirtySecondsMethodInvocationExpr) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setMaxRpcTimeoutDuration") - .setArguments(ofSixtySecondsMethodInvocationExpr) - .build(); - double retryDelayMultiplier = 1.3; - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setRetryDelayMultiplier") - .setArguments( - ValueExpr.withValue( - PrimitiveValue.builder() - .setType(TypeNode.DOUBLE) - .setValue(String.format("%.1f", retryDelayMultiplier)) - .build())) - .build(); - double rpcTimeoutMultiplier = 1.5; - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setRpcTimeoutMultiplier") - .setArguments( - ValueExpr.withValue( - PrimitiveValue.builder() - .setType(TypeNode.DOUBLE) - .setValue(String.format("%.1f", rpcTimeoutMultiplier)) - .build())) - .build(); - retrySettingsArgExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setTotalTimeoutDuration") - .setArguments(ofThreeHundredSecondsMethodInvocationExpr) - .build(); - } + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setInitialRetryDelayDuration") + .setArguments(ofOneSecondMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setInitialRpcTimeoutDuration") + .setArguments(ofFiveSecondsMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxAttempts") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("5").build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxRetryDelayDuration") + .setArguments(ofThirtySecondsMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxRpcTimeoutDuration") + .setArguments(ofSixtySecondsMethodInvocationExpr) + .build(); + double retryDelayMultiplier = 1.3; + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setRetryDelayMultiplier") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder() + .setType(TypeNode.DOUBLE) + .setValue(String.format("%.1f", retryDelayMultiplier)) + .build())) + .build(); + double rpcTimeoutMultiplier = 1.5; + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setRpcTimeoutMultiplier") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder() + .setType(TypeNode.DOUBLE) + .setValue(String.format("%.1f", rpcTimeoutMultiplier)) + .build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setTotalTimeoutDuration") + .setArguments(ofThreeHundredSecondsMethodInvocationExpr) + .build(); retrySettingsArgExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(retrySettingsArgExpr) @@ -304,4 +245,195 @@ public static Optional composeSettingsSample( .build(); return Optional.of(Sample.builder().setBody(statements).setRegionTag(regionTag).build()); } + + public static Optional composeLroSettingsSample( + Optional methodNameOpt, String settingsClassName, TypeNode classType) { + if (!methodNameOpt.isPresent()) { + return Optional.empty(); + } + // Initialize services settingsBuilder with newBuilder() + // e.g. FoobarSettings.Builder foobarSettingsBuilder = FoobarSettings.newBuilder(); + TypeNode builderType = + TypeNode.withReference( + VaporReference.builder() + .setEnclosingClassNames(classType.reference().name()) + .setName("Builder") + .setPakkage(classType.reference().pakkage()) + .build()); + VariableExpr localSettingsVarExpr = + VariableExpr.withVariable( + Variable.builder() + .setName(JavaStyle.toLowerCamelCase(String.format("%sBuilder", settingsClassName))) + .setType(builderType) + .build()); + MethodInvocationExpr settingsBuilderMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(classType) + .setMethodName("newBuilder") + .setReturnType(builderType) + .build(); + AssignmentExpr initLocalSettingsExpr = + AssignmentExpr.builder() + .setVariableExpr(localSettingsVarExpr.toBuilder().setIsDecl(true).build()) + .setValueExpr(settingsBuilderMethodInvocationExpr) + .build(); + + // Initialize TimedRetryAlgorithm initialization + // e.g. TimedRetryAlgorithm timedRetryAlgorithm = OperationalTimedPollAlgorithm.create( + TypeNode TimedRetryAlgorithmType = + TypeNode.withReference( + VaporReference.builder() + .setName("TimedRetryAlgorithm") + .setPakkage("com.google.api.gax.retrying") + .build()); + VariableExpr TimedRetryVarExpr = + VariableExpr.withVariable( + Variable.builder() + .setName("timedRetryAlgorithm") + .setType(TimedRetryAlgorithmType) + .build()); + TypeNode OperationalTimedPollAlgorithmType = + TypeNode.withReference( + VaporReference.builder() + .setName("OperationalTimedPollAlgorithm") + .setPakkage("com.google.api.gax.longrunning") + .build()); + + // Set RetrySettings for TimedRetryAlgorithm + TypeNode RetrySettingsType = + TypeNode.withReference( + VaporReference.builder() + .setName("RetrySettings") + .setPakkage("com.google.api.gax.retrying") + .build()); + VariableExpr RetrySettingsVarExpr = + VariableExpr.withVariable( + Variable.builder().setName("RetrySettings").setType(RetrySettingsType).build()); + MethodInvocationExpr retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(RetrySettingsVarExpr) + .setMethodName("newBuilder") + .build(); + + MethodInvocationExpr ofFiveHundredMillisMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofMillis") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("500").build())) + .build(); + MethodInvocationExpr ofFiveThousandMillisMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofMillis") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("5000").build())) + .build(); + MethodInvocationExpr ofTwentyFourHoursMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofHours") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("24").build())) + .build(); + + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setInitialRetryDelayDuration") + .setArguments(ofFiveHundredMillisMethodInvocationExpr) + .build(); + double retryDelayMultiplier = 1.5; + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setRetryDelayMultiplier") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder() + .setType(TypeNode.DOUBLE) + .setValue(String.format("%.1f", retryDelayMultiplier)) + .build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxRetryDelay") + .setArguments(ofFiveThousandMillisMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setTotalTimeoutDuration") + .setArguments(ofTwentyFourHoursMethodInvocationExpr) + .build(); + + MethodInvocationExpr RetrySettingsMethodInvocationExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("build") + .setReturnType(RetrySettingsType) + .build(); + MethodInvocationExpr TimedRetryAlgorithmMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(OperationalTimedPollAlgorithmType) + .setMethodName("create") + .setReturnType(TimedRetryAlgorithmType) + .setArguments(RetrySettingsMethodInvocationExpr) + .build(); + AssignmentExpr initTimedRetryAlgorithmMethodInvocationExpr = + AssignmentExpr.builder() + .setVariableExpr(TimedRetryVarExpr.toBuilder().setIsDecl(true).build()) + .setValueExpr(TimedRetryAlgorithmMethodInvocationExpr) + .build(); + + // Build the settings + // e.g: + // echoSettingsBuilder.createClusterOperationSettings().setPollingAlgorithm(timedRetryAlgorithm).build(); + + MethodInvocationExpr builderMethodInvocationExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(localSettingsVarExpr) + .setMethodName("createClusterOperationSettings") + .setReturnType(builderType) + .build(); + + builderMethodInvocationExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(builderMethodInvocationExpr) + .setMethodName("setPollingAlgorithm") + .setArguments(TimedRetryVarExpr) + .setReturnType(builderType) + .build(); + + builderMethodInvocationExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(builderMethodInvocationExpr) + .setMethodName("build") + .setReturnType(builderType) + .build(); + + List statements = + Arrays.asList( + initLocalSettingsExpr, + initTimedRetryAlgorithmMethodInvocationExpr, + builderMethodInvocationExpr) + .stream() + .map(e -> ExprStatement.withExpr(e)) + .collect(Collectors.toList()); + + // TODO: alicejli edit RegionTag to match other languages + RegionTag regionTag = + RegionTag.builder() + .setServiceName(classType.reference().name()) + .setRpcName(methodNameOpt.get()) + .build(); + return Optional.of(Sample.builder().setBody(statements).setRegionTag(regionTag).build()); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden index 9a653ff7f1..e3b7c61d94 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden @@ -72,6 +72,31 @@ import javax.annotation.Generated; * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for wait: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * echoSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden index 75cbb2378e..5e89e0e847 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden @@ -101,6 +101,31 @@ import org.threeten.bp.Duration; * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for wait: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * echoSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncWait.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncWait.golden new file mode 100644 index 0000000000..71cf9529ac --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncWait.golden @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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.showcase.v1beta1.samples; + +// [START goldensample_generated_EchoSettings_Wait_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.showcase.v1beta1.EchoSettings; +import java.time.Duration; + +public class SyncWait { + + public static void main(String[] args) throws Exception { + syncWait(); + } + + public static void syncWait() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + echoSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END goldensample_generated_EchoSettings_Wait_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncWait.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncWait.golden new file mode 100644 index 0000000000..ee1c010647 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncWait.golden @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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.showcase.v1beta1.stub.samples; + +// [START goldensample_generated_EchoStubSettings_Wait_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import java.time.Duration; + +public class SyncWait { + + public static void main(String[] args) throws Exception { + syncWait(); + } + + public static void syncWait() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + echoSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END goldensample_generated_EchoStubSettings_Wait_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden index a0caad2fd7..c94624b679 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden @@ -73,6 +73,31 @@ import javax.annotation.Generated; * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for wait: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * echoSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden index 9c15e37e3c..a4ea58d8fc 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden @@ -106,6 +106,31 @@ import org.threeten.bp.Duration; * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for wait: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * echoSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @BetaApi @Generated("by gapic-generator-java") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java index 5b2a3a6678..7745f3aff8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java @@ -35,7 +35,7 @@ void composeSettingsSample_noMethods() { Optional results = writeSample( SettingsSampleComposer.composeSettingsSample( - Optional.empty(), "EchoSettings", classType, Optional.of(false))); + Optional.empty(), "EchoSettings", classType)); assertEquals(results, Optional.empty()); } @@ -50,7 +50,7 @@ void composeSettingsSample_serviceSettingsClass() { Optional results = writeSample( SettingsSampleComposer.composeSettingsSample( - Optional.of("Echo"), "EchoSettings", classType, Optional.of(false))); + Optional.of("Echo"), "EchoSettings", classType)); String expected = LineFormatter.lines( "EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();\n", @@ -85,7 +85,7 @@ void composeSettingsSample_serviceStubClass() { Optional results = writeSample( SettingsSampleComposer.composeSettingsSample( - Optional.of("Echo"), "EchoSettings", classType, Optional.of(false))); + Optional.of("Echo"), "EchoSettings", classType)); String expected = LineFormatter.lines( "EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();\n", @@ -110,64 +110,62 @@ void composeSettingsSample_serviceStubClass() { } @Test - void composeSettingsSample_serviceSettingsClass_LROMethod() { + void composeSettingsSample_serviceSettingsClass_LroMethod() { TypeNode classType = TypeNode.withReference( VaporReference.builder() - .setName("EchoSettings") + .setName("WaitSettings") .setPakkage("com.google.showcase.v1beta1") .build()); Optional results = writeSample( - SettingsSampleComposer.composeSettingsSample( - Optional.of("Echo"), "EchoSettings", classType, Optional.of(true))); + SettingsSampleComposer.composeLroSettingsSample( + Optional.of("Wait"), "WaitSettings", classType)); String expected = LineFormatter.lines( - "EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();\n", - "echoSettingsBuilder\n", - " .echoSettings()\n", - " .setRetrySettings(\n", - " echoSettingsBuilder\n", - " .echoSettings()\n", - " .getRetrySettings()\n", - " .toBuilder()\n", - " .setInitialRetryDelayDuration(Duration.ofMillis(5000))\n", + "WaitSettings.Builder waitSettingsBuilder = WaitSettings.newBuilder();\n", + "TimedRetryAlgorithm timedRetryAlgorithm =\n", + " OperationalTimedPollAlgorithm.create(\n", + " RetrySettings.newBuilder()\n", + " .setInitialRetryDelayDuration(Duration.ofMillis(500))\n", " .setRetryDelayMultiplier(1.5)\n", " .setMaxRetryDelay(Duration.ofMillis(5000))\n", " .setTotalTimeoutDuration(Duration.ofHours(24))\n", " .build());\n", - "EchoSettings echoSettings = echoSettingsBuilder.build();"); - assertEquals(results.get(), expected); + "waitSettingsBuilder\n", + " .createClusterOperationSettings()\n", + " .setPollingAlgorithm(timedRetryAlgorithm)\n", + " .build();"); + assertEquals(expected, results.get()); } @Test - void composeSettingsSample_serviceStubClass_LROMethod() { + void composeSettingsSample_serviceStubClass_LroMethod() { TypeNode classType = TypeNode.withReference( VaporReference.builder() - .setName("EchoStubSettings") + .setName("WaitStubSettings") .setPakkage("com.google.showcase.v1beta1") .build()); Optional results = writeSample( - SettingsSampleComposer.composeSettingsSample( - Optional.of("Echo"), "EchoSettings", classType, Optional.of(true))); + SettingsSampleComposer.composeLroSettingsSample( + Optional.of("Wait"), "WaitSettings", classType)); String expected = LineFormatter.lines( - "EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();\n", - "echoSettingsBuilder\n", - " .echoSettings()\n", - " .setRetrySettings(\n", - " echoSettingsBuilder\n", - " .echoSettings()\n", - " .getRetrySettings()\n", - " .toBuilder()\n", - " .setInitialRetryDelayDuration(Duration.ofMillis(5000))\n", + "WaitStubSettings.Builder waitSettingsBuilder = WaitStubSettings.newBuilder();\n", + "TimedRetryAlgorithm timedRetryAlgorithm =\n", + " OperationalTimedPollAlgorithm.create(\n", + " RetrySettings.newBuilder()\n", + " .setInitialRetryDelayDuration(Duration.ofMillis(500))\n", " .setRetryDelayMultiplier(1.5)\n", " .setMaxRetryDelay(Duration.ofMillis(5000))\n", " .setTotalTimeoutDuration(Duration.ofHours(24))\n", " .build());\n", - "EchoStubSettings echoSettings = echoSettingsBuilder.build();"); + "waitSettingsBuilder\n", + " .createClusterOperationSettings()\n", + " .setPollingAlgorithm(timedRetryAlgorithm)\n", + " .build();"); assertEquals(results.get(), expected); } diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java index ac225d68fb..a04432db8b 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java @@ -99,6 +99,31 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for wait: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * echoSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java index e77a7da0d7..e253bad663 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java @@ -100,6 +100,31 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for searchBlurbs: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * messagingSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java index 81bf689aff..fdfaf8c556 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java @@ -136,6 +136,31 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for wait: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * echoSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @BetaApi @Generated("by gapic-generator-java") diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java index fc6938de70..9a1b0726ea 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java @@ -141,6 +141,31 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for searchBlurbs: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * messagingSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @BetaApi @Generated("by gapic-generator-java") diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/exportassets/SyncExportAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/exportassets/SyncExportAssets.java new file mode 100644 index 0000000000..f7f3206394 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/exportassets/SyncExportAssets.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetServiceSettings_ExportAssets_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.asset.v1.AssetServiceSettings; +import java.time.Duration; + +public class SyncExportAssets { + + public static void main(String[] args) throws Exception { + syncExportAssets(); + } + + public static void syncExportAssets() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + assetServiceSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END cloudasset_v1_generated_AssetServiceSettings_ExportAssets_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/exportassets/SyncExportAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/exportassets/SyncExportAssets.java new file mode 100644 index 0000000000..85648d365f --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/exportassets/SyncExportAssets.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 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.asset.v1.stub.samples; + +// [START cloudasset_v1_generated_AssetServiceStubSettings_ExportAssets_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.asset.v1.stub.AssetServiceStubSettings; +import java.time.Duration; + +public class SyncExportAssets { + + public static void main(String[] args) throws Exception { + syncExportAssets(); + } + + public static void syncExportAssets() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AssetServiceStubSettings.Builder assetServiceSettingsBuilder = + AssetServiceStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + assetServiceSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END cloudasset_v1_generated_AssetServiceStubSettings_ExportAssets_sync] diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java index 9c35ef2483..ffa0a33735 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java @@ -90,6 +90,31 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for exportAssets: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * assetServiceSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class AssetServiceSettings extends ClientSettings { diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java index 3610bee55d..270824cebb 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java @@ -149,6 +149,32 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for exportAssets: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AssetServiceStubSettings.Builder assetServiceSettingsBuilder =
+ *     AssetServiceStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * assetServiceSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class AssetServiceStubSettings extends StubSettings { diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/delete/SyncDelete.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/delete/SyncDelete.java new file mode 100644 index 0000000000..1775a427ea --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/delete/SyncDelete.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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.compute.v1small.samples; + +// [START compute_v1small_generated_AddressesSettings_Delete_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.compute.v1small.AddressesSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AddressesSettings.Builder addressesSettingsBuilder = AddressesSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + addressesSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END compute_v1small_generated_AddressesSettings_Delete_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/delete/SyncDelete.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/delete/SyncDelete.java new file mode 100644 index 0000000000..e1b3859c4a --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/delete/SyncDelete.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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.compute.v1small.stub.samples; + +// [START compute_v1small_generated_AddressesStubSettings_Delete_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.compute.v1small.stub.AddressesStubSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AddressesStubSettings.Builder addressesSettingsBuilder = AddressesStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + addressesSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END compute_v1small_generated_AddressesStubSettings_Delete_sync] diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java index 4c629a6614..7da3792c94 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java @@ -84,6 +84,31 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AddressesSettings.Builder addressesSettingsBuilder = AddressesSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * addressesSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class AddressesSettings extends ClientSettings { diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java index f45050e228..7fe62b92b1 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java @@ -113,6 +113,31 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for delete: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AddressesStubSettings.Builder addressesSettingsBuilder = AddressesStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * addressesSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class AddressesStubSettings extends StubSettings { diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/copylogentries/SyncCopyLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/copylogentries/SyncCopyLogEntries.java new file mode 100644 index 0000000000..02471c3404 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/copylogentries/SyncCopyLogEntries.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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.logging.v2.samples; + +// [START logging_v2_generated_ConfigSettings_CopyLogEntries_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.logging.v2.ConfigSettings; +import java.time.Duration; + +public class SyncCopyLogEntries { + + public static void main(String[] args) throws Exception { + syncCopyLogEntries(); + } + + public static void syncCopyLogEntries() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConfigSettings.Builder configSettingsBuilder = ConfigSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + configSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END logging_v2_generated_ConfigSettings_CopyLogEntries_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/copylogentries/SyncCopyLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/copylogentries/SyncCopyLogEntries.java new file mode 100644 index 0000000000..8b4cdddd0b --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/copylogentries/SyncCopyLogEntries.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 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.logging.v2.stub.samples; + +// [START logging_v2_generated_ConfigServiceV2StubSettings_CopyLogEntries_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.logging.v2.stub.ConfigServiceV2StubSettings; +import java.time.Duration; + +public class SyncCopyLogEntries { + + public static void main(String[] args) throws Exception { + syncCopyLogEntries(); + } + + public static void syncCopyLogEntries() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConfigServiceV2StubSettings.Builder configSettingsBuilder = + ConfigServiceV2StubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + configSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END logging_v2_generated_ConfigServiceV2StubSettings_CopyLogEntries_sync] diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java index 747354c9db..ddd7f369c3 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java @@ -126,6 +126,31 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for copyLogEntries: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConfigSettings.Builder configSettingsBuilder = ConfigSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * configSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class ConfigSettings extends ClientSettings { diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java index 58322cf518..fc53cb791e 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java @@ -145,6 +145,32 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for copyLogEntries: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConfigServiceV2StubSettings.Builder configSettingsBuilder =
+ *     ConfigServiceV2StubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * configSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class ConfigServiceV2StubSettings extends StubSettings { diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/createinstance/SyncCreateInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/createinstance/SyncCreateInstance.java new file mode 100644 index 0000000000..4aace73ccd --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/createinstance/SyncCreateInstance.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisSettings_CreateInstance_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.redis.v1beta1.CloudRedisSettings; +import java.time.Duration; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CloudRedisSettings.Builder cloudRedisSettingsBuilder = CloudRedisSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + cloudRedisSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END redis_v1beta1_generated_CloudRedisSettings_CreateInstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/createinstance/SyncCreateInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/createinstance/SyncCreateInstance.java new file mode 100644 index 0000000000..684480479b --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/createinstance/SyncCreateInstance.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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.redis.v1beta1.stub.samples; + +// [START redis_v1beta1_generated_CloudRedisStubSettings_CreateInstance_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.redis.v1beta1.stub.CloudRedisStubSettings; +import java.time.Duration; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CloudRedisStubSettings.Builder cloudRedisSettingsBuilder = CloudRedisStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + cloudRedisSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END redis_v1beta1_generated_CloudRedisStubSettings_CreateInstance_sync] diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java index 58c24e3eb5..eb03ebb56a 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java @@ -88,6 +88,31 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CloudRedisSettings.Builder cloudRedisSettingsBuilder = CloudRedisSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * cloudRedisSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @BetaApi @Generated("by gapic-generator-java") diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java index db9d861f59..fde6d515b2 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java @@ -122,6 +122,31 @@ * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CloudRedisStubSettings.Builder cloudRedisSettingsBuilder = CloudRedisStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * cloudRedisSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @BetaApi @Generated("by gapic-generator-java")