diff --git a/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java b/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java index 952d79335e..5af37202d9 100644 --- a/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java +++ b/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java @@ -48,6 +48,7 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicServiceConfig; import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.gapic.model.Transport; import com.google.api.generator.spring.composer.comment.SpringAutoconfigCommentComposer; import com.google.api.generator.spring.utils.LoggerUtils; import com.google.api.generator.spring.utils.Utils; @@ -96,6 +97,9 @@ public GapicClass generate(GapicContext context, Service service) { types.get("CredentialsProvider").isSupertypeOrEquals(types.get("DefaultCredentialsProvider")); + Transport transport = context.transport(); + boolean hasRestOption = transport.equals(Transport.GRPC_REST); + ClassDefinition classDef = ClassDefinition.builder() .setPackageString(packageName) @@ -104,6 +108,7 @@ public GapicClass generate(GapicContext context, Service service) { .setHeaderCommentStatements( SpringAutoconfigCommentComposer.createClassHeaderComments(className, serviceName)) .setStatements(createMemberVariables(service, packageName, types, gapicServiceConfig)) + .setAnnotations(createClassAnnotations(service, types)) .setMethods( Arrays.asList( createConstructor(service.name(), className, types), @@ -118,9 +123,10 @@ public GapicClass generate(GapicContext context, Service service) { transportChannelProviderName, clientName, types, - gapicServiceConfig))) - .setAnnotations(createClassAnnotations(service, types)) + gapicServiceConfig, + hasRestOption))) .build(); + return GapicClass.create(kind, classDef); } @@ -465,7 +471,8 @@ private static MethodDefinition createClientBeanMethod( String transportChannelProviderName, String clientName, Map types, - GapicServiceConfig gapicServiceConfig) { + GapicServiceConfig gapicServiceConfig, + boolean hasRestOption) { // argument variables: VariableExpr credentialsProviderVariableExpr = VariableExpr.withVariable( @@ -513,6 +520,7 @@ private static MethodDefinition createClientBeanMethod( .setMethodName("setTransportChannelProvider") .setArguments(transportChannelProviderVariableExpr) .build(); + // .setHeaderProvider( // new UserAgentHeaderProvider(this.getClass())); settingsBuilderExpr = @@ -654,50 +662,51 @@ private static MethodDefinition createClientBeanMethod( bodyStatements.add(setBackgroundExecutorProviderStatement); - // if (clientProperties.getUseRest()) { - // clientSettingsBuilder.setTransportChannelProvider( - // LanguageServiceSettings.defaultHttpJsonTransportProviderBuilder().build()); - // } - - MethodInvocationExpr getUseRest = - MethodInvocationExpr.builder() - .setMethodName("getUseRest") - .setReturnType(TypeNode.BOOLEAN) - .setExprReferenceExpr(thisClientPropertiesVarExpr) - .build(); - - // LanguageServiceSettings.defaultHttpJsonTransportProviderBuilder().build() - Expr defaultTransportProviderBuider = - MethodInvocationExpr.builder() - .setStaticReferenceType(types.get("ServiceSettings")) - .setMethodName("defaultHttpJsonTransportProviderBuilder") - .build(); - defaultTransportProviderBuider = - MethodInvocationExpr.builder() - .setExprReferenceExpr(defaultTransportProviderBuider) - .setMethodName("build") - .setReturnType(STATIC_TYPES.get("InstantiatingHttpJsonChannelProvider")) - .build(); - - MethodInvocationExpr setTransportProvider = - MethodInvocationExpr.builder() - .setExprReferenceExpr(VariableExpr.withVariable(settingBuilderVariable)) - .setMethodName("setTransportChannelProvider") - .setArguments(defaultTransportProviderBuider) - .build(); - IfStatement setTransportChannelProviderStatement = - createIfStatement( - getUseRest, - Arrays.asList( - ExprStatement.withExpr(setTransportProvider), - LoggerUtils.createLoggerStatement( - ValueExpr.withValue( - StringObjectValue.withValue("Using HTTP transport channel")), - types)), - null); - - bodyStatements.add(setTransportChannelProviderStatement); - + if (hasRestOption) { + // if (clientProperties.getUseRest()) { + // clientSettingsBuilder.setTransportChannelProvider( + // LanguageServiceSettings.defaultHttpJsonTransportProviderBuilder().build()); + // } + + MethodInvocationExpr getUseRest = + MethodInvocationExpr.builder() + .setMethodName("getUseRest") + .setReturnType(TypeNode.BOOLEAN) + .setExprReferenceExpr(thisClientPropertiesVarExpr) + .build(); + + // LanguageServiceSettings.defaultHttpJsonTransportProviderBuilder().build() + Expr defaultTransportProviderExprChain = + MethodInvocationExpr.builder() + .setStaticReferenceType(types.get("ServiceSettings")) + .setMethodName("defaultHttpJsonTransportProviderBuilder") + .build(); + defaultTransportProviderExprChain = + MethodInvocationExpr.builder() + .setExprReferenceExpr(defaultTransportProviderExprChain) + .setMethodName("build") + .setReturnType(STATIC_TYPES.get("InstantiatingHttpJsonChannelProvider")) + .build(); + + MethodInvocationExpr setTransportProvider = + MethodInvocationExpr.builder() + .setExprReferenceExpr(VariableExpr.withVariable(settingBuilderVariable)) + .setMethodName("setTransportChannelProvider") + .setArguments(defaultTransportProviderExprChain) + .build(); + IfStatement setTransportChannelProviderStatement = + createIfStatement( + getUseRest, + Arrays.asList( + ExprStatement.withExpr(setTransportProvider), + LoggerUtils.createLoggerStatement( + ValueExpr.withValue( + StringObjectValue.withValue("Using HTTP transport channel")), + types)), + null); + + bodyStatements.add(setTransportChannelProviderStatement); + } // retry settings for each method TypeNode thisClassType = types.get(service.name() + "AutoConfig"); List retrySettings = @@ -786,6 +795,28 @@ private static MethodDefinition createClientBeanMethod( .setReturnType(types.get("ServiceClient")) .setArguments(serviceSettingsBuilt) .build(); + List argumentsVariableExprs = + Arrays.asList( + credentialsProviderVariableExpr + .toBuilder() + .setIsDecl(true) + .setAnnotations( + Arrays.asList( + AnnotationNode.builder() + .setType(types.get("Qualifier")) + .setDescription(credentialsProviderName) + .build())) + .build(), + transportChannelProviderVariableExpr + .toBuilder() + .setIsDecl(true) + .setAnnotations( + Arrays.asList( + AnnotationNode.builder() + .setType(types.get("Qualifier")) + .setDescription(transportChannelProviderName) + .build())) + .build()); String methodName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, service.name()) + "Client"; @@ -798,28 +829,7 @@ private static MethodDefinition createClientBeanMethod( .setName(methodName) .setScope(ScopeNode.PUBLIC) .setReturnType(types.get("ServiceClient")) - .setArguments( - Arrays.asList( - credentialsProviderVariableExpr - .toBuilder() - .setIsDecl(true) - .setAnnotations( - Arrays.asList( - AnnotationNode.builder() - .setType(types.get("Qualifier")) - .setDescription(credentialsProviderName) - .build())) - .build(), - transportChannelProviderVariableExpr - .toBuilder() - .setIsDecl(true) - .setAnnotations( - Arrays.asList( - AnnotationNode.builder() - .setType(types.get("Qualifier")) - .setDescription(transportChannelProviderName) - .build())) - .build())) + .setArguments(argumentsVariableExprs) .setAnnotations( Arrays.asList( AnnotationNode.withType(types.get("Bean")), diff --git a/src/main/java/com/google/api/generator/spring/composer/SpringComposer.java b/src/main/java/com/google/api/generator/spring/composer/SpringComposer.java index b9f92c1f52..b255d1c05c 100644 --- a/src/main/java/com/google/api/generator/spring/composer/SpringComposer.java +++ b/src/main/java/com/google/api/generator/spring/composer/SpringComposer.java @@ -51,6 +51,7 @@ protected static List generatePerServiceClasses(GapicContext context .services() .forEach( s -> { + // Transport.REST is out of scope for Spring composers. if (context.transport() == Transport.GRPC || context.transport() == Transport.GRPC_REST) { clazzes.add(SpringAutoConfigClassComposer.instance().generate(context, s)); 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 618f6f933b..685830d7f8 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 @@ -26,6 +26,7 @@ import com.google.api.generator.engine.ast.ExprStatement; import com.google.api.generator.engine.ast.MethodDefinition; import com.google.api.generator.engine.ast.NewObjectExpr; +import com.google.api.generator.engine.ast.PrimitiveValue; import com.google.api.generator.engine.ast.ScopeNode; import com.google.api.generator.engine.ast.Statement; import com.google.api.generator.engine.ast.StringObjectValue; @@ -41,6 +42,7 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicServiceConfig; import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.gapic.model.Transport; import com.google.api.generator.spring.composer.comment.SpringPropertiesCommentComposer; import com.google.api.generator.spring.utils.Utils; import com.google.common.base.CaseFormat; @@ -70,6 +72,7 @@ public GapicClass generate(GapicContext context, Service service) { String className = String.format(CLASS_NAME_PATTERN, service.name()); GapicServiceConfig gapicServiceConfig = context.serviceConfig(); Map types = createDynamicTypes(service, packageName); + boolean hasRestOption = context.transport().equals(Transport.GRPC_REST); // TODO: this is the prefix user will use to set properties, may need to change depending on // branding. @@ -87,8 +90,10 @@ public GapicClass generate(GapicContext context, Service service) { .setPackageString(packageName) .setName(className) .setScope(ScopeNode.PUBLIC) - .setStatements(createMemberVariables(service, packageName, types, gapicServiceConfig)) - .setMethods(createGetterSetters(service, types, gapicServiceConfig)) + .setStatements( + createMemberVariables( + service, packageName, types, gapicServiceConfig, hasRestOption)) + .setMethods(createGetterSetters(service, types, gapicServiceConfig, hasRestOption)) .setAnnotations(Arrays.asList(classAnnotationNode)) .setImplementsTypes(Arrays.asList(types.get("CredentialsSupplier"))) .build(); @@ -129,9 +134,11 @@ private static List createMemberVariables( Service service, String packageName, Map types, - GapicServiceConfig serviceConfig) { + GapicServiceConfig serviceConfig, + boolean hasRestOption) { String serviceName = service.name(); + List statements = new ArrayList<>(); // @NestedConfigurationProperty // private final Credentials credentials = new // Credentials("https://www.googleapis.com/auth/cloud-language"); @@ -155,20 +162,27 @@ private static List createMemberVariables( true, defaultCredentialScopes, credentialsAnnotations); - + statements.add(credentialsStatement); // private String quotaProjectId; ExprStatement quotaProjectIdVarStatement = createMemberVarStatement("quotaProjectId", TypeNode.STRING, false, null, null); - + statements.add(quotaProjectIdVarStatement); // private Integer executorThreadCount; ExprStatement executorThreadCountVarStatement = createMemberVarStatement("executorThreadCount", TypeNode.INT_OBJECT, false, null, null); + statements.add(executorThreadCountVarStatement); + if (hasRestOption) { + ExprStatement useRestVarStatement = + createMemberVarStatement( + "useRest", + TypeNode.BOOLEAN, + false, + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.BOOLEAN).setValue("false").build()), + null); + statements.add(useRestVarStatement); + } - // private boolean useRest = false; - ExprStatement useRestVarStatement = - createMemberVarStatement("useRest", TypeNode.BOOLEAN, false, null, null); - - // // private static final ImmutableMap RETRY_PARAM_DEFINITIONS; // declare each retry settings with its default value. use defaults from serviceConfig @@ -194,18 +208,17 @@ private static List createMemberVariables( }, (String propertyName) -> new ArrayList<>()); - List statements = - retrySettings.stream().map(x -> (Statement) x).collect(Collectors.toList()); + statements.addAll( + retrySettings.stream().map(Statement.class::cast).collect(Collectors.toList())); - statements.add(0, useRestVarStatement); - statements.add(0, executorThreadCountVarStatement); - statements.add(0, quotaProjectIdVarStatement); - statements.add(0, credentialsStatement); return statements; } private static List createGetterSetters( - Service service, Map types, GapicServiceConfig gapicServiceConfig) { + Service service, + Map types, + GapicServiceConfig gapicServiceConfig, + boolean hasRestOption) { TypeNode thisClassType = types.get(service.name() + "Properties"); List methodDefinitions = new ArrayList<>(); @@ -219,7 +232,10 @@ private static List createGetterSetters( methodDefinitions.add( createGetterMethod(thisClassType, "quotaProjectId", TypeNode.STRING, null)); methodDefinitions.add(createSetterMethod(thisClassType, "quotaProjectId", TypeNode.STRING)); - methodDefinitions.add(createGetterMethod(thisClassType, "useRest", TypeNode.BOOLEAN, null)); + if (hasRestOption) { + methodDefinitions.add(createGetterMethod(thisClassType, "useRest", TypeNode.BOOLEAN, null)); + methodDefinitions.add(createSetterMethod(thisClassType, "useRest", TypeNode.BOOLEAN)); + } methodDefinitions.add( createGetterMethod(thisClassType, "executorThreadCount", TypeNode.INT_OBJECT, null)); methodDefinitions.add( @@ -246,15 +262,6 @@ private static List createGetterSetters( (String propertyName) -> new ArrayList<>()); methodDefinitions.addAll(retrySettings); - // TODO: This can be for future stages. for long running operations: - // for (Method method : service.methods()) { - // if (!method.hasLro()) { - // continue; - // } - // // - // com.google.api.generator.gapic.composer.common.RetrySettingsComposer.createLroSettingsBuilderExpr - // // %sOperationSettings - // } return methodDefinitions; } diff --git a/src/test/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposerTest.java b/src/test/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposerTest.java index 64f93c5df2..7ee9904fe1 100644 --- a/src/test/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposerTest.java +++ b/src/test/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposerTest.java @@ -18,6 +18,7 @@ import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.gapic.model.Transport; import com.google.api.generator.test.framework.Assert; import org.junit.Before; import org.junit.Test; @@ -33,10 +34,21 @@ public void setUp() { } @Test - public void generateAutoConfigClazzTest() { + public void generateAutoConfigClazzGrpcTest() { GapicClass clazz = SpringAutoConfigClassComposer.instance().generate(this.context, this.echoProtoService); - String fileName = clazz.classDefinition().classIdentifier() + ".golden"; + String fileName = clazz.classDefinition().classIdentifier() + "Grpc.golden"; + Assert.assertGoldenClass(this.getClass(), clazz, fileName); + } + + @Test + public void generateAutoConfigClazzGrpcRestTest() { + + GapicContext contextGrpcRest = + this.context.toBuilder().setTransport(Transport.GRPC_REST).build(); + GapicClass clazz = + SpringAutoConfigClassComposer.instance().generate(contextGrpcRest, this.echoProtoService); + String fileName = clazz.classDefinition().classIdentifier() + "GrpcRest.golden"; Assert.assertGoldenClass(this.getClass(), clazz, fileName); } } diff --git a/src/test/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposerTest.java b/src/test/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposerTest.java index f19298c067..356f976e0b 100644 --- a/src/test/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposerTest.java +++ b/src/test/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposerTest.java @@ -18,6 +18,7 @@ import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.gapic.model.Transport; import com.google.api.generator.test.framework.Assert; import org.junit.Before; import org.junit.Test; @@ -33,10 +34,20 @@ public void setUp() { } @Test - public void generateAutoConfigClazzTest() { + public void generatePropertiesClazzGrpcTest() { GapicClass clazz = SpringPropertiesClassComposer.instance().generate(this.context, this.echoProtoService); - String fileName = clazz.classDefinition().classIdentifier() + ".golden"; + String fileName = clazz.classDefinition().classIdentifier() + "Grpc.golden"; + Assert.assertGoldenClass(this.getClass(), clazz, fileName); + } + + @Test + public void generatePropertiesClazzGrpcRestTest() { + GapicContext contextGrpcRest = + this.context.toBuilder().setTransport(Transport.GRPC_REST).build(); + GapicClass clazz = + SpringPropertiesClassComposer.instance().generate(contextGrpcRest, this.echoProtoService); + String fileName = clazz.classDefinition().classIdentifier() + "GrpcRest.golden"; Assert.assertGoldenClass(this.getClass(), clazz, fileName); } } diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden index 274d5ff95a..15c1d4c6f9 100644 --- a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden @@ -19,7 +19,6 @@ package com.google.showcase.v1beta1.spring; import com.google.api.core.BetaApi; import com.google.api.gax.core.CredentialsProvider; import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.cloud.spring.core.DefaultCredentialsProvider; @@ -126,11 +125,6 @@ public class EchoSpringAutoConfiguration { LOGGER.info( "Background executor thread count is " + this.clientProperties.getExecutorThreadCount()); } - if (this.clientProperties.getUseRest()) { - clientSettingsBuilder.setTransportChannelProvider( - EchoSettings.defaultHttpJsonTransportProviderBuilder().build()); - LOGGER.info("Using HTTP transport channel"); - } RetrySettings.Builder echoRetrySettingBuilder = clientSettingsBuilder.echoSettings().getRetrySettings().toBuilder(); if (this.clientProperties.getEchoInitialRetryDelay() != null) { diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpc.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpc.golden new file mode 100644 index 0000000000..cad5a2bc75 --- /dev/null +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpc.golden @@ -0,0 +1,430 @@ +package com.google.showcase.v1beta1.spring; + +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.cloud.spring.core.DefaultCredentialsProvider; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import java.io.IOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Auto-configuration for {@link EchoClient}. + * + *

Provides auto-configuration for Spring Boot + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default transport provider is used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ */ +@AutoConfiguration +@ConditionalOnClass(EchoClient.class) +@ConditionalOnProperty( + value = "com.google.showcase.v1beta1.spring.auto.echo.enabled", + matchIfMissing = false) +@EnableConfigurationProperties(EchoSpringProperties.class) +public class EchoSpringAutoConfiguration { + private final EchoSpringProperties clientProperties; + private static final Log LOGGER = LogFactory.getLog(EchoSpringAutoConfig.class); + + protected EchoSpringAutoConfiguration(EchoSpringProperties clientProperties) { + this.clientProperties = clientProperties; + } + + /** + * Obtains the default credentials provider. The used key will be obtained from Spring Boot + * configuration data files. + */ + @Bean + @ConditionalOnMissingBean + public CredentialsProvider echoCredentials() throws IOException { + return ((CredentialsProvider) new DefaultCredentialsProvider(this.clientProperties)); + } + + /** + * Returns the default channel provider. The default is gRPC and will default to it unless the + * useRest option is provided to use HTTP transport instead + */ + @Bean + @ConditionalOnMissingBean + public TransportChannelProvider defaultEchoTransportChannelProvider() { + return EchoSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a EchoClient bean configured to use the default credentials provider (obtained with + * echoCredentials()) and its default transport channel provider + * (defaultEchoTransportChannelProvider()). It also configures the quota project ID if provided. + * It will configure an executor provider in case there is more than one thread configured in the + * client + * + *

Individual retry settings are configured as well. It will use the relevant client library's + * default retry settings when they are not specified in EchoProperties. + */ + @Bean + @ConditionalOnMissingBean + public EchoClient echoClient( + @Qualifier("echoCredentials") CredentialsProvider credentialsProvider, + @Qualifier("defaultEchoTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + EchoSettings.Builder clientSettingsBuilder = + EchoSettings.newBuilder() + .setCredentialsProvider(credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setHeaderProvider(); + if (this.clientProperties.getQuotaProjectId() != null) { + clientSettingsBuilder.setQuotaProjectId(this.clientProperties.getQuotaProjectId()); + LOGGER.info( + "Quota project id set to " + + this.clientProperties.getQuotaProjectId() + + ", this overrides project id from credentials."); + } + if (this.clientProperties.getExecutorThreadCount() != null) { + ExecutorProvider executorProvider = + EchoSettings.defaultExecutorProviderBuilder() + .setExecutorThreadCount(this.clientProperties.getExecutorThreadCount()) + .build(); + clientSettingsBuilder.setBackgroundExecutorProvider(executorProvider); + LOGGER.info( + "Background executor thread count is " + this.clientProperties.getExecutorThreadCount()); + } + RetrySettings.Builder echoRetrySettingBuilder = + clientSettingsBuilder.echoSettings().getRetrySettings().toBuilder(); + if (this.clientProperties.getEchoInitialRetryDelay() != null) { + echoRetrySettingBuilder.setInitialRetryDelay( + this.clientProperties.getEchoInitialRetryDelay()); + LOGGER.info( + "EchoInitialRetryDelay set to " + this.clientProperties.getEchoInitialRetryDelay()); + } + if (this.clientProperties.getEchoRetryDelayMultiplier() != null) { + echoRetrySettingBuilder.setRetryDelayMultiplier( + this.clientProperties.getEchoRetryDelayMultiplier()); + LOGGER.info( + "EchoRetryDelayMultiplier set to " + this.clientProperties.getEchoRetryDelayMultiplier()); + } + if (this.clientProperties.getEchoMaxRetryDelay() != null) { + echoRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getEchoMaxRetryDelay()); + LOGGER.info("EchoMaxRetryDelay set to " + this.clientProperties.getEchoMaxRetryDelay()); + } + if (this.clientProperties.getEchoInitialRpcTimeout() != null) { + echoRetrySettingBuilder.setInitialRpcTimeout( + this.clientProperties.getEchoInitialRpcTimeout()); + LOGGER.info( + "EchoInitialRpcTimeout set to " + this.clientProperties.getEchoInitialRpcTimeout()); + } + if (this.clientProperties.getEchoRpcTimeoutMultiplier() != null) { + echoRetrySettingBuilder.setRpcTimeoutMultiplier( + this.clientProperties.getEchoRpcTimeoutMultiplier()); + LOGGER.info( + "EchoRpcTimeoutMultiplier set to " + this.clientProperties.getEchoRpcTimeoutMultiplier()); + } + if (this.clientProperties.getEchoMaxRpcTimeout() != null) { + echoRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getEchoMaxRpcTimeout()); + LOGGER.info("EchoMaxRpcTimeout set to " + this.clientProperties.getEchoMaxRpcTimeout()); + } + if (this.clientProperties.getEchoTotalTimeout() != null) { + echoRetrySettingBuilder.setTotalTimeout(this.clientProperties.getEchoTotalTimeout()); + LOGGER.info("EchoTotalTimeout set to " + this.clientProperties.getEchoTotalTimeout()); + } + clientSettingsBuilder.echoSettings().setRetrySettings(echoRetrySettingBuilder.build()); + RetrySettings.Builder expandRetrySettingBuilder = + clientSettingsBuilder.expandSettings().getRetrySettings().toBuilder(); + if (this.clientProperties.getExpandInitialRetryDelay() != null) { + expandRetrySettingBuilder.setInitialRetryDelay( + this.clientProperties.getExpandInitialRetryDelay()); + LOGGER.info( + "ExpandInitialRetryDelay set to " + this.clientProperties.getExpandInitialRetryDelay()); + } + if (this.clientProperties.getExpandRetryDelayMultiplier() != null) { + expandRetrySettingBuilder.setRetryDelayMultiplier( + this.clientProperties.getExpandRetryDelayMultiplier()); + LOGGER.info( + "ExpandRetryDelayMultiplier set to " + + this.clientProperties.getExpandRetryDelayMultiplier()); + } + if (this.clientProperties.getExpandMaxRetryDelay() != null) { + expandRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getExpandMaxRetryDelay()); + LOGGER.info("ExpandMaxRetryDelay set to " + this.clientProperties.getExpandMaxRetryDelay()); + } + if (this.clientProperties.getExpandInitialRpcTimeout() != null) { + expandRetrySettingBuilder.setInitialRpcTimeout( + this.clientProperties.getExpandInitialRpcTimeout()); + LOGGER.info( + "ExpandInitialRpcTimeout set to " + this.clientProperties.getExpandInitialRpcTimeout()); + } + if (this.clientProperties.getExpandRpcTimeoutMultiplier() != null) { + expandRetrySettingBuilder.setRpcTimeoutMultiplier( + this.clientProperties.getExpandRpcTimeoutMultiplier()); + LOGGER.info( + "ExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getExpandRpcTimeoutMultiplier()); + } + if (this.clientProperties.getExpandMaxRpcTimeout() != null) { + expandRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getExpandMaxRpcTimeout()); + LOGGER.info("ExpandMaxRpcTimeout set to " + this.clientProperties.getExpandMaxRpcTimeout()); + } + if (this.clientProperties.getExpandTotalTimeout() != null) { + expandRetrySettingBuilder.setTotalTimeout(this.clientProperties.getExpandTotalTimeout()); + LOGGER.info("ExpandTotalTimeout set to " + this.clientProperties.getExpandTotalTimeout()); + } + clientSettingsBuilder.expandSettings().setRetrySettings(expandRetrySettingBuilder.build()); + RetrySettings.Builder collectRetrySettingBuilder = + clientSettingsBuilder.collectSettings().getRetrySettings().toBuilder(); + if (this.clientProperties.getCollectInitialRpcTimeout() != null) { + collectRetrySettingBuilder.setInitialRpcTimeout( + this.clientProperties.getCollectInitialRpcTimeout()); + LOGGER.info( + "CollectInitialRpcTimeout set to " + this.clientProperties.getCollectInitialRpcTimeout()); + } + if (this.clientProperties.getCollectRpcTimeoutMultiplier() != null) { + collectRetrySettingBuilder.setRpcTimeoutMultiplier( + this.clientProperties.getCollectRpcTimeoutMultiplier()); + LOGGER.info( + "CollectRpcTimeoutMultiplier set to " + + this.clientProperties.getCollectRpcTimeoutMultiplier()); + } + if (this.clientProperties.getCollectMaxRpcTimeout() != null) { + collectRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getCollectMaxRpcTimeout()); + LOGGER.info("CollectMaxRpcTimeout set to " + this.clientProperties.getCollectMaxRpcTimeout()); + } + if (this.clientProperties.getCollectTotalTimeout() != null) { + collectRetrySettingBuilder.setTotalTimeout(this.clientProperties.getCollectTotalTimeout()); + LOGGER.info("CollectTotalTimeout set to " + this.clientProperties.getCollectTotalTimeout()); + } + clientSettingsBuilder.collectSettings().setRetrySettings(collectRetrySettingBuilder.build()); + RetrySettings.Builder chatRetrySettingBuilder = + clientSettingsBuilder.chatSettings().getRetrySettings().toBuilder(); + if (this.clientProperties.getChatInitialRpcTimeout() != null) { + chatRetrySettingBuilder.setInitialRpcTimeout( + this.clientProperties.getChatInitialRpcTimeout()); + LOGGER.info( + "ChatInitialRpcTimeout set to " + this.clientProperties.getChatInitialRpcTimeout()); + } + if (this.clientProperties.getChatRpcTimeoutMultiplier() != null) { + chatRetrySettingBuilder.setRpcTimeoutMultiplier( + this.clientProperties.getChatRpcTimeoutMultiplier()); + LOGGER.info( + "ChatRpcTimeoutMultiplier set to " + this.clientProperties.getChatRpcTimeoutMultiplier()); + } + if (this.clientProperties.getChatMaxRpcTimeout() != null) { + chatRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getChatMaxRpcTimeout()); + LOGGER.info("ChatMaxRpcTimeout set to " + this.clientProperties.getChatMaxRpcTimeout()); + } + if (this.clientProperties.getChatTotalTimeout() != null) { + chatRetrySettingBuilder.setTotalTimeout(this.clientProperties.getChatTotalTimeout()); + LOGGER.info("ChatTotalTimeout set to " + this.clientProperties.getChatTotalTimeout()); + } + clientSettingsBuilder.chatSettings().setRetrySettings(chatRetrySettingBuilder.build()); + RetrySettings.Builder chatAgainRetrySettingBuilder = + clientSettingsBuilder.chatAgainSettings().getRetrySettings().toBuilder(); + if (this.clientProperties.getChatAgainInitialRpcTimeout() != null) { + chatAgainRetrySettingBuilder.setInitialRpcTimeout( + this.clientProperties.getChatAgainInitialRpcTimeout()); + LOGGER.info( + "ChatAgainInitialRpcTimeout set to " + + this.clientProperties.getChatAgainInitialRpcTimeout()); + } + if (this.clientProperties.getChatAgainRpcTimeoutMultiplier() != null) { + chatAgainRetrySettingBuilder.setRpcTimeoutMultiplier( + this.clientProperties.getChatAgainRpcTimeoutMultiplier()); + LOGGER.info( + "ChatAgainRpcTimeoutMultiplier set to " + + this.clientProperties.getChatAgainRpcTimeoutMultiplier()); + } + if (this.clientProperties.getChatAgainMaxRpcTimeout() != null) { + chatAgainRetrySettingBuilder.setMaxRpcTimeout( + this.clientProperties.getChatAgainMaxRpcTimeout()); + LOGGER.info( + "ChatAgainMaxRpcTimeout set to " + this.clientProperties.getChatAgainMaxRpcTimeout()); + } + if (this.clientProperties.getChatAgainTotalTimeout() != null) { + chatAgainRetrySettingBuilder.setTotalTimeout( + this.clientProperties.getChatAgainTotalTimeout()); + LOGGER.info( + "ChatAgainTotalTimeout set to " + this.clientProperties.getChatAgainTotalTimeout()); + } + clientSettingsBuilder + .chatAgainSettings() + .setRetrySettings(chatAgainRetrySettingBuilder.build()); + RetrySettings.Builder pagedExpandRetrySettingBuilder = + clientSettingsBuilder.pagedExpandSettings().getRetrySettings().toBuilder(); + if (this.clientProperties.getPagedExpandInitialRetryDelay() != null) { + pagedExpandRetrySettingBuilder.setInitialRetryDelay( + this.clientProperties.getPagedExpandInitialRetryDelay()); + LOGGER.info( + "PagedExpandInitialRetryDelay set to " + + this.clientProperties.getPagedExpandInitialRetryDelay()); + } + if (this.clientProperties.getPagedExpandRetryDelayMultiplier() != null) { + pagedExpandRetrySettingBuilder.setRetryDelayMultiplier( + this.clientProperties.getPagedExpandRetryDelayMultiplier()); + LOGGER.info( + "PagedExpandRetryDelayMultiplier set to " + + this.clientProperties.getPagedExpandRetryDelayMultiplier()); + } + if (this.clientProperties.getPagedExpandMaxRetryDelay() != null) { + pagedExpandRetrySettingBuilder.setMaxRetryDelay( + this.clientProperties.getPagedExpandMaxRetryDelay()); + LOGGER.info( + "PagedExpandMaxRetryDelay set to " + this.clientProperties.getPagedExpandMaxRetryDelay()); + } + if (this.clientProperties.getPagedExpandInitialRpcTimeout() != null) { + pagedExpandRetrySettingBuilder.setInitialRpcTimeout( + this.clientProperties.getPagedExpandInitialRpcTimeout()); + LOGGER.info( + "PagedExpandInitialRpcTimeout set to " + + this.clientProperties.getPagedExpandInitialRpcTimeout()); + } + if (this.clientProperties.getPagedExpandRpcTimeoutMultiplier() != null) { + pagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( + this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); + LOGGER.info( + "PagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); + } + if (this.clientProperties.getPagedExpandMaxRpcTimeout() != null) { + pagedExpandRetrySettingBuilder.setMaxRpcTimeout( + this.clientProperties.getPagedExpandMaxRpcTimeout()); + LOGGER.info( + "PagedExpandMaxRpcTimeout set to " + this.clientProperties.getPagedExpandMaxRpcTimeout()); + } + if (this.clientProperties.getPagedExpandTotalTimeout() != null) { + pagedExpandRetrySettingBuilder.setTotalTimeout( + this.clientProperties.getPagedExpandTotalTimeout()); + LOGGER.info( + "PagedExpandTotalTimeout set to " + this.clientProperties.getPagedExpandTotalTimeout()); + } + clientSettingsBuilder + .pagedExpandSettings() + .setRetrySettings(pagedExpandRetrySettingBuilder.build()); + RetrySettings.Builder simplePagedExpandRetrySettingBuilder = + clientSettingsBuilder.simplePagedExpandSettings().getRetrySettings().toBuilder(); + if (this.clientProperties.getSimplePagedExpandInitialRpcTimeout() != null) { + simplePagedExpandRetrySettingBuilder.setInitialRpcTimeout( + this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); + LOGGER.info( + "SimplePagedExpandInitialRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); + } + if (this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier() != null) { + simplePagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( + this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); + LOGGER.info( + "SimplePagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); + } + if (this.clientProperties.getSimplePagedExpandMaxRpcTimeout() != null) { + simplePagedExpandRetrySettingBuilder.setMaxRpcTimeout( + this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); + LOGGER.info( + "SimplePagedExpandMaxRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); + } + if (this.clientProperties.getSimplePagedExpandTotalTimeout() != null) { + simplePagedExpandRetrySettingBuilder.setTotalTimeout( + this.clientProperties.getSimplePagedExpandTotalTimeout()); + LOGGER.info( + "SimplePagedExpandTotalTimeout set to " + + this.clientProperties.getSimplePagedExpandTotalTimeout()); + } + clientSettingsBuilder + .simplePagedExpandSettings() + .setRetrySettings(simplePagedExpandRetrySettingBuilder.build()); + RetrySettings.Builder waitRetrySettingBuilder = + clientSettingsBuilder.waitSettings().getRetrySettings().toBuilder(); + if (this.clientProperties.getWaitInitialRpcTimeout() != null) { + waitRetrySettingBuilder.setInitialRpcTimeout( + this.clientProperties.getWaitInitialRpcTimeout()); + LOGGER.info( + "WaitInitialRpcTimeout set to " + this.clientProperties.getWaitInitialRpcTimeout()); + } + if (this.clientProperties.getWaitRpcTimeoutMultiplier() != null) { + waitRetrySettingBuilder.setRpcTimeoutMultiplier( + this.clientProperties.getWaitRpcTimeoutMultiplier()); + LOGGER.info( + "WaitRpcTimeoutMultiplier set to " + this.clientProperties.getWaitRpcTimeoutMultiplier()); + } + if (this.clientProperties.getWaitMaxRpcTimeout() != null) { + waitRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getWaitMaxRpcTimeout()); + LOGGER.info("WaitMaxRpcTimeout set to " + this.clientProperties.getWaitMaxRpcTimeout()); + } + if (this.clientProperties.getWaitTotalTimeout() != null) { + waitRetrySettingBuilder.setTotalTimeout(this.clientProperties.getWaitTotalTimeout()); + LOGGER.info("WaitTotalTimeout set to " + this.clientProperties.getWaitTotalTimeout()); + } + clientSettingsBuilder.waitSettings().setRetrySettings(waitRetrySettingBuilder.build()); + RetrySettings.Builder blockRetrySettingBuilder = + clientSettingsBuilder.blockSettings().getRetrySettings().toBuilder(); + if (this.clientProperties.getBlockInitialRpcTimeout() != null) { + blockRetrySettingBuilder.setInitialRpcTimeout( + this.clientProperties.getBlockInitialRpcTimeout()); + LOGGER.info( + "BlockInitialRpcTimeout set to " + this.clientProperties.getBlockInitialRpcTimeout()); + } + if (this.clientProperties.getBlockRpcTimeoutMultiplier() != null) { + blockRetrySettingBuilder.setRpcTimeoutMultiplier( + this.clientProperties.getBlockRpcTimeoutMultiplier()); + LOGGER.info( + "BlockRpcTimeoutMultiplier set to " + + this.clientProperties.getBlockRpcTimeoutMultiplier()); + } + if (this.clientProperties.getBlockMaxRpcTimeout() != null) { + blockRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getBlockMaxRpcTimeout()); + LOGGER.info("BlockMaxRpcTimeout set to " + this.clientProperties.getBlockMaxRpcTimeout()); + } + if (this.clientProperties.getBlockTotalTimeout() != null) { + blockRetrySettingBuilder.setTotalTimeout(this.clientProperties.getBlockTotalTimeout()); + LOGGER.info("BlockTotalTimeout set to " + this.clientProperties.getBlockTotalTimeout()); + } + clientSettingsBuilder.blockSettings().setRetrySettings(blockRetrySettingBuilder.build()); + RetrySettings.Builder collideNameRetrySettingBuilder = + clientSettingsBuilder.collideNameSettings().getRetrySettings().toBuilder(); + if (this.clientProperties.getCollideNameInitialRpcTimeout() != null) { + collideNameRetrySettingBuilder.setInitialRpcTimeout( + this.clientProperties.getCollideNameInitialRpcTimeout()); + LOGGER.info( + "CollideNameInitialRpcTimeout set to " + + this.clientProperties.getCollideNameInitialRpcTimeout()); + } + if (this.clientProperties.getCollideNameRpcTimeoutMultiplier() != null) { + collideNameRetrySettingBuilder.setRpcTimeoutMultiplier( + this.clientProperties.getCollideNameRpcTimeoutMultiplier()); + LOGGER.info( + "CollideNameRpcTimeoutMultiplier set to " + + this.clientProperties.getCollideNameRpcTimeoutMultiplier()); + } + if (this.clientProperties.getCollideNameMaxRpcTimeout() != null) { + collideNameRetrySettingBuilder.setMaxRpcTimeout( + this.clientProperties.getCollideNameMaxRpcTimeout()); + LOGGER.info( + "CollideNameMaxRpcTimeout set to " + this.clientProperties.getCollideNameMaxRpcTimeout()); + } + if (this.clientProperties.getCollideNameTotalTimeout() != null) { + collideNameRetrySettingBuilder.setTotalTimeout( + this.clientProperties.getCollideNameTotalTimeout()); + LOGGER.info( + "CollideNameTotalTimeout set to " + this.clientProperties.getCollideNameTotalTimeout()); + } + clientSettingsBuilder + .collideNameSettings() + .setRetrySettings(collideNameRetrySettingBuilder.build()); + return EchoClient.create(clientSettingsBuilder.build()); + } +} diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfiguration.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpcRest.golden similarity index 100% rename from src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfiguration.golden rename to src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpcRest.golden 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 d53b691bde..f568eef8db 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 @@ -36,7 +36,6 @@ public class EchoSpringProperties implements CredentialsSupplier { private String quotaProjectId; private Integer executorThreadCount; - private boolean useRest; private Duration echoInitialRetryDelay; private Double echoRetryDelayMultiplier; private Duration echoMaxRetryDelay; @@ -100,10 +99,6 @@ public class EchoSpringProperties implements CredentialsSupplier { this.quotaProjectId = quotaProjectId; } - public boolean getUseRest() { - return this.useRest; - } - public Integer getExecutorThreadCount() { return this.executorThreadCount; } diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringProperties.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpc.golden similarity index 99% rename from src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringProperties.golden rename to src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpc.golden index b7ca9ebe01..3767554993 100644 --- a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringProperties.golden +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpc.golden @@ -16,7 +16,6 @@ public class EchoSpringProperties implements CredentialsSupplier { private String quotaProjectId; private Integer executorThreadCount; - private boolean useRest; private Duration echoInitialRetryDelay; private Double echoRetryDelayMultiplier; private Duration echoMaxRetryDelay; @@ -80,10 +79,6 @@ public class EchoSpringProperties implements CredentialsSupplier { this.quotaProjectId = quotaProjectId; } - public boolean getUseRest() { - return this.useRest; - } - public Integer getExecutorThreadCount() { return this.executorThreadCount; } 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 new file mode 100644 index 0000000000..55d8a0f23c --- /dev/null +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpcRest.golden @@ -0,0 +1,491 @@ +package com.google.showcase.v1beta1.spring; + +import com.google.cloud.spring.core.Credentials; +import com.google.cloud.spring.core.CredentialsSupplier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** Provides default property values for Echo client bean */ +@ConfigurationProperties("com.google.showcase.v1beta1.spring.auto.echo") +public class EchoSpringProperties implements CredentialsSupplier { + @NestedConfigurationProperty + private final Credentials credentials = + new Credentials("https://www.googleapis.com/auth/cloud-platform"); + + private String quotaProjectId; + private Integer executorThreadCount; + private boolean useRest = false; + private Duration echoInitialRetryDelay; + private Double echoRetryDelayMultiplier; + private Duration echoMaxRetryDelay; + private Duration echoInitialRpcTimeout; + private Double echoRpcTimeoutMultiplier; + private Duration echoMaxRpcTimeout; + private Duration echoTotalTimeout; + private Duration expandInitialRetryDelay; + private Double expandRetryDelayMultiplier; + private Duration expandMaxRetryDelay; + private Duration expandInitialRpcTimeout; + private Double expandRpcTimeoutMultiplier; + private Duration expandMaxRpcTimeout; + private Duration expandTotalTimeout; + private Duration collectInitialRpcTimeout; + private Double collectRpcTimeoutMultiplier; + private Duration collectMaxRpcTimeout; + private Duration collectTotalTimeout; + private Duration chatInitialRpcTimeout; + private Double chatRpcTimeoutMultiplier; + private Duration chatMaxRpcTimeout; + private Duration chatTotalTimeout; + private Duration chatAgainInitialRpcTimeout; + private Double chatAgainRpcTimeoutMultiplier; + private Duration chatAgainMaxRpcTimeout; + private Duration chatAgainTotalTimeout; + private Duration pagedExpandInitialRetryDelay; + private Double pagedExpandRetryDelayMultiplier; + private Duration pagedExpandMaxRetryDelay; + private Duration pagedExpandInitialRpcTimeout; + private Double pagedExpandRpcTimeoutMultiplier; + private Duration pagedExpandMaxRpcTimeout; + private Duration pagedExpandTotalTimeout; + private Duration simplePagedExpandInitialRpcTimeout; + private Double simplePagedExpandRpcTimeoutMultiplier; + private Duration simplePagedExpandMaxRpcTimeout; + private Duration simplePagedExpandTotalTimeout; + private Duration waitInitialRpcTimeout; + private Double waitRpcTimeoutMultiplier; + private Duration waitMaxRpcTimeout; + private Duration waitTotalTimeout; + private Duration blockInitialRpcTimeout; + private Double blockRpcTimeoutMultiplier; + private Duration blockMaxRpcTimeout; + private Duration blockTotalTimeout; + private Duration collideNameInitialRpcTimeout; + private Double collideNameRpcTimeoutMultiplier; + private Duration collideNameMaxRpcTimeout; + private Duration collideNameTotalTimeout; + + @Override + public Credentials getCredentials() { + return this.credentials; + } + + public String getQuotaProjectId() { + return this.quotaProjectId; + } + + public void setQuotaProjectId(String quotaProjectId) { + this.quotaProjectId = quotaProjectId; + } + + public boolean getUseRest() { + return this.useRest; + } + + public void setUseRest(boolean useRest) { + this.useRest = useRest; + } + + public Integer getExecutorThreadCount() { + return this.executorThreadCount; + } + + public void setExecutorThreadCount(Integer executorThreadCount) { + this.executorThreadCount = executorThreadCount; + } + + public Duration getEchoInitialRetryDelay() { + return this.echoInitialRetryDelay; + } + + public void setEchoInitialRetryDelay(Duration echoInitialRetryDelay) { + this.echoInitialRetryDelay = echoInitialRetryDelay; + } + + public Double getEchoRetryDelayMultiplier() { + return this.echoRetryDelayMultiplier; + } + + public void setEchoRetryDelayMultiplier(Double echoRetryDelayMultiplier) { + this.echoRetryDelayMultiplier = echoRetryDelayMultiplier; + } + + public Duration getEchoMaxRetryDelay() { + return this.echoMaxRetryDelay; + } + + public void setEchoMaxRetryDelay(Duration echoMaxRetryDelay) { + this.echoMaxRetryDelay = echoMaxRetryDelay; + } + + public Duration getEchoInitialRpcTimeout() { + return this.echoInitialRpcTimeout; + } + + public void setEchoInitialRpcTimeout(Duration echoInitialRpcTimeout) { + this.echoInitialRpcTimeout = echoInitialRpcTimeout; + } + + public Double getEchoRpcTimeoutMultiplier() { + return this.echoRpcTimeoutMultiplier; + } + + public void setEchoRpcTimeoutMultiplier(Double echoRpcTimeoutMultiplier) { + this.echoRpcTimeoutMultiplier = echoRpcTimeoutMultiplier; + } + + public Duration getEchoMaxRpcTimeout() { + return this.echoMaxRpcTimeout; + } + + public void setEchoMaxRpcTimeout(Duration echoMaxRpcTimeout) { + this.echoMaxRpcTimeout = echoMaxRpcTimeout; + } + + public Duration getEchoTotalTimeout() { + return this.echoTotalTimeout; + } + + public void setEchoTotalTimeout(Duration echoTotalTimeout) { + this.echoTotalTimeout = echoTotalTimeout; + } + + public Duration getExpandInitialRetryDelay() { + return this.expandInitialRetryDelay; + } + + public void setExpandInitialRetryDelay(Duration expandInitialRetryDelay) { + this.expandInitialRetryDelay = expandInitialRetryDelay; + } + + public Double getExpandRetryDelayMultiplier() { + return this.expandRetryDelayMultiplier; + } + + public void setExpandRetryDelayMultiplier(Double expandRetryDelayMultiplier) { + this.expandRetryDelayMultiplier = expandRetryDelayMultiplier; + } + + public Duration getExpandMaxRetryDelay() { + return this.expandMaxRetryDelay; + } + + public void setExpandMaxRetryDelay(Duration expandMaxRetryDelay) { + this.expandMaxRetryDelay = expandMaxRetryDelay; + } + + public Duration getExpandInitialRpcTimeout() { + return this.expandInitialRpcTimeout; + } + + public void setExpandInitialRpcTimeout(Duration expandInitialRpcTimeout) { + this.expandInitialRpcTimeout = expandInitialRpcTimeout; + } + + public Double getExpandRpcTimeoutMultiplier() { + return this.expandRpcTimeoutMultiplier; + } + + public void setExpandRpcTimeoutMultiplier(Double expandRpcTimeoutMultiplier) { + this.expandRpcTimeoutMultiplier = expandRpcTimeoutMultiplier; + } + + public Duration getExpandMaxRpcTimeout() { + return this.expandMaxRpcTimeout; + } + + public void setExpandMaxRpcTimeout(Duration expandMaxRpcTimeout) { + this.expandMaxRpcTimeout = expandMaxRpcTimeout; + } + + public Duration getExpandTotalTimeout() { + return this.expandTotalTimeout; + } + + public void setExpandTotalTimeout(Duration expandTotalTimeout) { + this.expandTotalTimeout = expandTotalTimeout; + } + + public Duration getCollectInitialRpcTimeout() { + return this.collectInitialRpcTimeout; + } + + public void setCollectInitialRpcTimeout(Duration collectInitialRpcTimeout) { + this.collectInitialRpcTimeout = collectInitialRpcTimeout; + } + + public Double getCollectRpcTimeoutMultiplier() { + return this.collectRpcTimeoutMultiplier; + } + + public void setCollectRpcTimeoutMultiplier(Double collectRpcTimeoutMultiplier) { + this.collectRpcTimeoutMultiplier = collectRpcTimeoutMultiplier; + } + + public Duration getCollectMaxRpcTimeout() { + return this.collectMaxRpcTimeout; + } + + public void setCollectMaxRpcTimeout(Duration collectMaxRpcTimeout) { + this.collectMaxRpcTimeout = collectMaxRpcTimeout; + } + + public Duration getCollectTotalTimeout() { + return this.collectTotalTimeout; + } + + public void setCollectTotalTimeout(Duration collectTotalTimeout) { + this.collectTotalTimeout = collectTotalTimeout; + } + + public Duration getChatInitialRpcTimeout() { + return this.chatInitialRpcTimeout; + } + + public void setChatInitialRpcTimeout(Duration chatInitialRpcTimeout) { + this.chatInitialRpcTimeout = chatInitialRpcTimeout; + } + + public Double getChatRpcTimeoutMultiplier() { + return this.chatRpcTimeoutMultiplier; + } + + public void setChatRpcTimeoutMultiplier(Double chatRpcTimeoutMultiplier) { + this.chatRpcTimeoutMultiplier = chatRpcTimeoutMultiplier; + } + + public Duration getChatMaxRpcTimeout() { + return this.chatMaxRpcTimeout; + } + + public void setChatMaxRpcTimeout(Duration chatMaxRpcTimeout) { + this.chatMaxRpcTimeout = chatMaxRpcTimeout; + } + + public Duration getChatTotalTimeout() { + return this.chatTotalTimeout; + } + + public void setChatTotalTimeout(Duration chatTotalTimeout) { + this.chatTotalTimeout = chatTotalTimeout; + } + + public Duration getChatAgainInitialRpcTimeout() { + return this.chatAgainInitialRpcTimeout; + } + + public void setChatAgainInitialRpcTimeout(Duration chatAgainInitialRpcTimeout) { + this.chatAgainInitialRpcTimeout = chatAgainInitialRpcTimeout; + } + + public Double getChatAgainRpcTimeoutMultiplier() { + return this.chatAgainRpcTimeoutMultiplier; + } + + public void setChatAgainRpcTimeoutMultiplier(Double chatAgainRpcTimeoutMultiplier) { + this.chatAgainRpcTimeoutMultiplier = chatAgainRpcTimeoutMultiplier; + } + + public Duration getChatAgainMaxRpcTimeout() { + return this.chatAgainMaxRpcTimeout; + } + + public void setChatAgainMaxRpcTimeout(Duration chatAgainMaxRpcTimeout) { + this.chatAgainMaxRpcTimeout = chatAgainMaxRpcTimeout; + } + + public Duration getChatAgainTotalTimeout() { + return this.chatAgainTotalTimeout; + } + + public void setChatAgainTotalTimeout(Duration chatAgainTotalTimeout) { + this.chatAgainTotalTimeout = chatAgainTotalTimeout; + } + + public Duration getPagedExpandInitialRetryDelay() { + return this.pagedExpandInitialRetryDelay; + } + + public void setPagedExpandInitialRetryDelay(Duration pagedExpandInitialRetryDelay) { + this.pagedExpandInitialRetryDelay = pagedExpandInitialRetryDelay; + } + + public Double getPagedExpandRetryDelayMultiplier() { + return this.pagedExpandRetryDelayMultiplier; + } + + public void setPagedExpandRetryDelayMultiplier(Double pagedExpandRetryDelayMultiplier) { + this.pagedExpandRetryDelayMultiplier = pagedExpandRetryDelayMultiplier; + } + + public Duration getPagedExpandMaxRetryDelay() { + return this.pagedExpandMaxRetryDelay; + } + + public void setPagedExpandMaxRetryDelay(Duration pagedExpandMaxRetryDelay) { + this.pagedExpandMaxRetryDelay = pagedExpandMaxRetryDelay; + } + + public Duration getPagedExpandInitialRpcTimeout() { + return this.pagedExpandInitialRpcTimeout; + } + + public void setPagedExpandInitialRpcTimeout(Duration pagedExpandInitialRpcTimeout) { + this.pagedExpandInitialRpcTimeout = pagedExpandInitialRpcTimeout; + } + + public Double getPagedExpandRpcTimeoutMultiplier() { + return this.pagedExpandRpcTimeoutMultiplier; + } + + public void setPagedExpandRpcTimeoutMultiplier(Double pagedExpandRpcTimeoutMultiplier) { + this.pagedExpandRpcTimeoutMultiplier = pagedExpandRpcTimeoutMultiplier; + } + + public Duration getPagedExpandMaxRpcTimeout() { + return this.pagedExpandMaxRpcTimeout; + } + + public void setPagedExpandMaxRpcTimeout(Duration pagedExpandMaxRpcTimeout) { + this.pagedExpandMaxRpcTimeout = pagedExpandMaxRpcTimeout; + } + + public Duration getPagedExpandTotalTimeout() { + return this.pagedExpandTotalTimeout; + } + + public void setPagedExpandTotalTimeout(Duration pagedExpandTotalTimeout) { + this.pagedExpandTotalTimeout = pagedExpandTotalTimeout; + } + + public Duration getSimplePagedExpandInitialRpcTimeout() { + return this.simplePagedExpandInitialRpcTimeout; + } + + public void setSimplePagedExpandInitialRpcTimeout(Duration simplePagedExpandInitialRpcTimeout) { + this.simplePagedExpandInitialRpcTimeout = simplePagedExpandInitialRpcTimeout; + } + + public Double getSimplePagedExpandRpcTimeoutMultiplier() { + return this.simplePagedExpandRpcTimeoutMultiplier; + } + + public void setSimplePagedExpandRpcTimeoutMultiplier( + Double simplePagedExpandRpcTimeoutMultiplier) { + this.simplePagedExpandRpcTimeoutMultiplier = simplePagedExpandRpcTimeoutMultiplier; + } + + public Duration getSimplePagedExpandMaxRpcTimeout() { + return this.simplePagedExpandMaxRpcTimeout; + } + + public void setSimplePagedExpandMaxRpcTimeout(Duration simplePagedExpandMaxRpcTimeout) { + this.simplePagedExpandMaxRpcTimeout = simplePagedExpandMaxRpcTimeout; + } + + public Duration getSimplePagedExpandTotalTimeout() { + return this.simplePagedExpandTotalTimeout; + } + + public void setSimplePagedExpandTotalTimeout(Duration simplePagedExpandTotalTimeout) { + this.simplePagedExpandTotalTimeout = simplePagedExpandTotalTimeout; + } + + public Duration getWaitInitialRpcTimeout() { + return this.waitInitialRpcTimeout; + } + + public void setWaitInitialRpcTimeout(Duration waitInitialRpcTimeout) { + this.waitInitialRpcTimeout = waitInitialRpcTimeout; + } + + public Double getWaitRpcTimeoutMultiplier() { + return this.waitRpcTimeoutMultiplier; + } + + public void setWaitRpcTimeoutMultiplier(Double waitRpcTimeoutMultiplier) { + this.waitRpcTimeoutMultiplier = waitRpcTimeoutMultiplier; + } + + public Duration getWaitMaxRpcTimeout() { + return this.waitMaxRpcTimeout; + } + + public void setWaitMaxRpcTimeout(Duration waitMaxRpcTimeout) { + this.waitMaxRpcTimeout = waitMaxRpcTimeout; + } + + public Duration getWaitTotalTimeout() { + return this.waitTotalTimeout; + } + + public void setWaitTotalTimeout(Duration waitTotalTimeout) { + this.waitTotalTimeout = waitTotalTimeout; + } + + public Duration getBlockInitialRpcTimeout() { + return this.blockInitialRpcTimeout; + } + + public void setBlockInitialRpcTimeout(Duration blockInitialRpcTimeout) { + this.blockInitialRpcTimeout = blockInitialRpcTimeout; + } + + public Double getBlockRpcTimeoutMultiplier() { + return this.blockRpcTimeoutMultiplier; + } + + public void setBlockRpcTimeoutMultiplier(Double blockRpcTimeoutMultiplier) { + this.blockRpcTimeoutMultiplier = blockRpcTimeoutMultiplier; + } + + public Duration getBlockMaxRpcTimeout() { + return this.blockMaxRpcTimeout; + } + + public void setBlockMaxRpcTimeout(Duration blockMaxRpcTimeout) { + this.blockMaxRpcTimeout = blockMaxRpcTimeout; + } + + public Duration getBlockTotalTimeout() { + return this.blockTotalTimeout; + } + + public void setBlockTotalTimeout(Duration blockTotalTimeout) { + this.blockTotalTimeout = blockTotalTimeout; + } + + public Duration getCollideNameInitialRpcTimeout() { + return this.collideNameInitialRpcTimeout; + } + + public void setCollideNameInitialRpcTimeout(Duration collideNameInitialRpcTimeout) { + this.collideNameInitialRpcTimeout = collideNameInitialRpcTimeout; + } + + public Double getCollideNameRpcTimeoutMultiplier() { + return this.collideNameRpcTimeoutMultiplier; + } + + public void setCollideNameRpcTimeoutMultiplier(Double collideNameRpcTimeoutMultiplier) { + this.collideNameRpcTimeoutMultiplier = collideNameRpcTimeoutMultiplier; + } + + public Duration getCollideNameMaxRpcTimeout() { + return this.collideNameMaxRpcTimeout; + } + + public void setCollideNameMaxRpcTimeout(Duration collideNameMaxRpcTimeout) { + this.collideNameMaxRpcTimeout = collideNameMaxRpcTimeout; + } + + public Duration getCollideNameTotalTimeout() { + return this.collideNameTotalTimeout; + } + + public void setCollideNameTotalTimeout(Duration collideNameTotalTimeout) { + this.collideNameTotalTimeout = collideNameTotalTimeout; + } +}