diff --git a/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java b/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java index ea072bc9e1..5886869597 100644 --- a/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java +++ b/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java @@ -167,14 +167,17 @@ private static List createMemberVariables( true, defaultCredentialScopes, credentialsAnnotations); + statements.add(SpringPropertiesCommentComposer.createCredentialsPropertyComment()); statements.add(credentialsStatement); // private String quotaProjectId; ExprStatement quotaProjectIdVarStatement = createMemberVarStatement("quotaProjectId", TypeNode.STRING, false, null, null); + statements.add(SpringPropertiesCommentComposer.createQuotaProjectIdPropertyComment()); statements.add(quotaProjectIdVarStatement); // private Integer executorThreadCount; ExprStatement executorThreadCountVarStatement = createMemberVarStatement("executorThreadCount", TypeNode.INT_OBJECT, false, null, null); + statements.add(SpringPropertiesCommentComposer.createExecutorThreadCountPropertyComment()); statements.add(executorThreadCountVarStatement); if (hasRestOption) { ExprStatement useRestVarStatement = @@ -185,6 +188,7 @@ private static List createMemberVariables( ValueExpr.withValue( PrimitiveValue.builder().setType(TypeNode.BOOLEAN).setValue("false").build()), null); + statements.add(SpringPropertiesCommentComposer.createUseRestPropertyComment()); statements.add(useRestVarStatement); } @@ -206,8 +210,11 @@ private static List createMemberVariables( propertyType = TypeNode.DOUBLE_OBJECT; } String propertyName = Joiner.on("").join(methodAndPropertyName); + String retryProperty = methodAndPropertyName.get(1); ExprStatement retrySettingsStatement = createMemberVarStatement(propertyName, propertyType, false, null, null); + getterAndSetter.add( + SpringPropertiesCommentComposer.createRetryPropertyComment(retryProperty)); getterAndSetter.add(retrySettingsStatement); return getterAndSetter; }, diff --git a/src/main/java/com/google/api/generator/spring/composer/comment/SpringPropertiesCommentComposer.java b/src/main/java/com/google/api/generator/spring/composer/comment/SpringPropertiesCommentComposer.java index 6d05240eea..6dde9318ae 100644 --- a/src/main/java/com/google/api/generator/spring/composer/comment/SpringPropertiesCommentComposer.java +++ b/src/main/java/com/google/api/generator/spring/composer/comment/SpringPropertiesCommentComposer.java @@ -17,12 +17,55 @@ import com.google.api.generator.engine.ast.CommentStatement; import com.google.api.generator.engine.ast.JavaDocComment; import com.google.api.generator.gapic.composer.comment.CommentComposer; +import com.google.common.collect.ImmutableMap; import java.util.Arrays; import java.util.List; +import java.util.Map; public class SpringPropertiesCommentComposer { private static final String CLASS_HEADER_GENERAL_DESCRIPTION = "Provides default property values for %s client bean"; + private static final String CREDENTIALS_DESCRIPTION = + "OAuth2 credentials to authenticate and authorize calls to Google Cloud Client Libraries."; + private static final String QUOTA_PROJECT_ID_DESCRIPTION = "Quota project to use for billing."; + private static final String EXECUTOR_THREAD_COUNT_DESCRIPTION = + "Number of threads used for executors."; + private static final String USE_REST_DESCRIPTION = + "Allow override of default transport channel provider to use REST instead of gRPC."; + + // Retry Setting Property Descriptions (TODO: refactor?) + // https://github.com/googleapis/gax-java/blob/main/gax/src/main/java/com/google/api/gax/retrying/RetrySettings.java + private static final String TOTAL_TIMEOUT_DESCRIPTION = + "TotalTimeout has ultimate control over how long the logic should keep trying the remote call " + + "until it gives up completely. The higher the total timeout, the more retries can be attempted."; + private static final String INITIAL_RETRY_DELAY_DESCRIPTION = + "InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this " + + "value adjusted according to the RetryDelayMultiplier."; + private static final String RETRY_DELAY_MULTIPLIER_DESCRIPTION = + "RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call " + + "is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call."; + private static final String MAX_RETRY_DELAY_DESCRIPTION = + "MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier " + + "can't increase the retry delay higher than this amount."; + private static final String INITIAL_RPC_TIMEOUT_DESCRIPTION = + "InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this " + + "value adjusted according to the RpcTimeoutMultiplier."; + private static final String RPC_TIMEOUT_MULTIPLIER_DESCRIPTION = + "RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call " + + "multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call."; + private static final String MAX_RPC_TIMEOUT_DESCRIPTION = + "MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier " + + "can't increase the RPC timeout higher than this amount."; + + private static final Map RETRY_PROPERTIES_DESCRIPTION_MAP = + ImmutableMap.of( + "TotalTimeout", TOTAL_TIMEOUT_DESCRIPTION, + "InitialRetryDelay", INITIAL_RETRY_DELAY_DESCRIPTION, + "RetryDelayMultiplier", RETRY_DELAY_MULTIPLIER_DESCRIPTION, + "MaxRetryDelay", MAX_RETRY_DELAY_DESCRIPTION, + "InitialRpcTimeout", INITIAL_RPC_TIMEOUT_DESCRIPTION, + "RpcTimeoutMultiplier", RPC_TIMEOUT_MULTIPLIER_DESCRIPTION, + "MaxRpcTimeout", MAX_RPC_TIMEOUT_DESCRIPTION); public static List createClassHeaderComments( String configuredClassName, String serviceName) { @@ -34,4 +77,29 @@ public static List createClassHeaderComments( CommentComposer.AUTO_GENERATED_CLASS_COMMENT, CommentStatement.withComment(javaDocCommentBuilder.build())); } + + public static CommentStatement createCredentialsPropertyComment() { + return toSimpleJavaDocComment(CREDENTIALS_DESCRIPTION); + } + + public static CommentStatement createQuotaProjectIdPropertyComment() { + return toSimpleJavaDocComment(QUOTA_PROJECT_ID_DESCRIPTION); + } + + public static CommentStatement createExecutorThreadCountPropertyComment() { + return toSimpleJavaDocComment(EXECUTOR_THREAD_COUNT_DESCRIPTION); + } + + public static CommentStatement createUseRestPropertyComment() { + return toSimpleJavaDocComment(USE_REST_DESCRIPTION); + } + + public static CommentStatement createRetryPropertyComment(String propertyName) { + String comment = RETRY_PROPERTIES_DESCRIPTION_MAP.getOrDefault(propertyName, ""); + return CommentStatement.withComment(JavaDocComment.withComment(comment)); + } + + private static CommentStatement toSimpleJavaDocComment(String comment) { + return CommentStatement.withComment(JavaDocComment.withComment(comment)); + } } diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesFull.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesFull.golden index 1a999d318d..b5fe3e9d30 100644 --- a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesFull.golden +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesFull.golden @@ -30,60 +30,258 @@ import org.threeten.bp.Duration; @BetaApi("Autogenerated Spring autoconfiguration is not yet stable") @ConfigurationProperties("com.google.showcase.v1beta1.spring.auto.echo") public class EchoSpringProperties implements CredentialsSupplier { + /** OAuth2 credentials to authenticate and authorize calls to Google Cloud Client Libraries. */ @NestedConfigurationProperty private final Credentials credentials = new Credentials("https://www.googleapis.com/auth/cloud-platform"); - + /** Quota project to use for billing. */ private String quotaProjectId; + /** Number of threads used for executors. */ private Integer executorThreadCount; + /** + * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this + * value adjusted according to the RetryDelayMultiplier. + */ private Duration echoInitialRetryDelay; + /** + * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call + * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. + */ private Double echoRetryDelayMultiplier; + /** + * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier + * can't increase the retry delay higher than this amount. + */ private Duration echoMaxRetryDelay; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration echoInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double echoRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration echoMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration echoTotalTimeout; + /** + * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this + * value adjusted according to the RetryDelayMultiplier. + */ private Duration expandInitialRetryDelay; + /** + * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call + * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. + */ private Double expandRetryDelayMultiplier; + /** + * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier + * can't increase the retry delay higher than this amount. + */ private Duration expandMaxRetryDelay; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration expandInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double expandRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration expandMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration expandTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration collectInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double collectRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration collectMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration collectTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration chatInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double chatRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration chatMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration chatTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration chatAgainInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double chatAgainRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration chatAgainMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration chatAgainTotalTimeout; + /** + * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this + * value adjusted according to the RetryDelayMultiplier. + */ private Duration pagedExpandInitialRetryDelay; + /** + * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call + * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. + */ private Double pagedExpandRetryDelayMultiplier; + /** + * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier + * can't increase the retry delay higher than this amount. + */ private Duration pagedExpandMaxRetryDelay; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration pagedExpandInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double pagedExpandRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration pagedExpandMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration pagedExpandTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration simplePagedExpandInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double simplePagedExpandRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration simplePagedExpandMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration simplePagedExpandTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration waitInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double waitRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration waitMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration waitTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration blockInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double blockRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration blockMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration blockTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration collideNameInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double collideNameRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration collideNameMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration collideNameTotalTimeout; @Override diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpc.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpc.golden index 84798083a6..ab0cb73457 100644 --- a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpc.golden +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpc.golden @@ -10,60 +10,258 @@ import org.threeten.bp.Duration; /** Provides default property values for Echo client bean */ @ConfigurationProperties("com.google.showcase.v1beta1.spring.auto.echo") public class EchoSpringProperties implements CredentialsSupplier { + /** OAuth2 credentials to authenticate and authorize calls to Google Cloud Client Libraries. */ @NestedConfigurationProperty private final Credentials credentials = new Credentials("https://www.googleapis.com/auth/cloud-platform"); - + /** Quota project to use for billing. */ private String quotaProjectId; + /** Number of threads used for executors. */ private Integer executorThreadCount; + /** + * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this + * value adjusted according to the RetryDelayMultiplier. + */ private Duration echoInitialRetryDelay; + /** + * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call + * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. + */ private Double echoRetryDelayMultiplier; + /** + * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier + * can't increase the retry delay higher than this amount. + */ private Duration echoMaxRetryDelay; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration echoInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double echoRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration echoMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration echoTotalTimeout; + /** + * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this + * value adjusted according to the RetryDelayMultiplier. + */ private Duration expandInitialRetryDelay; + /** + * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call + * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. + */ private Double expandRetryDelayMultiplier; + /** + * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier + * can't increase the retry delay higher than this amount. + */ private Duration expandMaxRetryDelay; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration expandInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double expandRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration expandMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration expandTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration collectInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double collectRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration collectMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration collectTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration chatInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double chatRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration chatMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration chatTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration chatAgainInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double chatAgainRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration chatAgainMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration chatAgainTotalTimeout; + /** + * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this + * value adjusted according to the RetryDelayMultiplier. + */ private Duration pagedExpandInitialRetryDelay; + /** + * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call + * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. + */ private Double pagedExpandRetryDelayMultiplier; + /** + * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier + * can't increase the retry delay higher than this amount. + */ private Duration pagedExpandMaxRetryDelay; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration pagedExpandInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double pagedExpandRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration pagedExpandMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration pagedExpandTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration simplePagedExpandInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double simplePagedExpandRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration simplePagedExpandMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration simplePagedExpandTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration waitInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double waitRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration waitMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration waitTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration blockInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double blockRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration blockMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration blockTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration collideNameInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double collideNameRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration collideNameMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration collideNameTotalTimeout; @Override diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpcRest.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpcRest.golden index 9769910645..8b81f28840 100644 --- a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpcRest.golden +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpcRest.golden @@ -10,61 +10,260 @@ import org.threeten.bp.Duration; /** Provides default property values for Echo client bean */ @ConfigurationProperties("com.google.showcase.v1beta1.spring.auto.echo") public class EchoSpringProperties implements CredentialsSupplier { + /** OAuth2 credentials to authenticate and authorize calls to Google Cloud Client Libraries. */ @NestedConfigurationProperty private final Credentials credentials = new Credentials("https://www.googleapis.com/auth/cloud-platform"); - + /** Quota project to use for billing. */ private String quotaProjectId; + /** Number of threads used for executors. */ private Integer executorThreadCount; + /** Allow override of default transport channel provider to use REST instead of gRPC. */ private boolean useRest = false; + /** + * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this + * value adjusted according to the RetryDelayMultiplier. + */ private Duration echoInitialRetryDelay; + /** + * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call + * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. + */ private Double echoRetryDelayMultiplier; + /** + * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier + * can't increase the retry delay higher than this amount. + */ private Duration echoMaxRetryDelay; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration echoInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double echoRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration echoMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration echoTotalTimeout; + /** + * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this + * value adjusted according to the RetryDelayMultiplier. + */ private Duration expandInitialRetryDelay; + /** + * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call + * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. + */ private Double expandRetryDelayMultiplier; + /** + * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier + * can't increase the retry delay higher than this amount. + */ private Duration expandMaxRetryDelay; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration expandInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double expandRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration expandMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration expandTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration collectInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double collectRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration collectMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration collectTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration chatInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double chatRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration chatMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration chatTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration chatAgainInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double chatAgainRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration chatAgainMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration chatAgainTotalTimeout; + /** + * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this + * value adjusted according to the RetryDelayMultiplier. + */ private Duration pagedExpandInitialRetryDelay; + /** + * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call + * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. + */ private Double pagedExpandRetryDelayMultiplier; + /** + * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier + * can't increase the retry delay higher than this amount. + */ private Duration pagedExpandMaxRetryDelay; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration pagedExpandInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double pagedExpandRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration pagedExpandMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration pagedExpandTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration simplePagedExpandInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double simplePagedExpandRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration simplePagedExpandMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration simplePagedExpandTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration waitInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double waitRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration waitMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration waitTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration blockInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double blockRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration blockMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration blockTotalTimeout; + /** + * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this + * value adjusted according to the RpcTimeoutMultiplier. + */ private Duration collideNameInitialRpcTimeout; + /** + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + */ private Double collideNameRpcTimeoutMultiplier; + /** + * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier + * can't increase the RPC timeout higher than this amount. + */ private Duration collideNameMaxRpcTimeout; + /** + * TotalTimeout has ultimate control over how long the logic should keep trying the remote call + * until it gives up completely. The higher the total timeout, the more retries can be attempted. + */ private Duration collideNameTotalTimeout; @Override