From a683a99124ca0107bcdd2db694c10cf6d4823b20 Mon Sep 17 00:00:00 2001 From: Emily Wang Date: Mon, 8 May 2023 14:43:07 -0400 Subject: [PATCH] Revert "temp: introduce generated code changes from removing classifyText method" This reverts commit 71b6f95a30e4e10d3b5d1df5a33b238512b1cc2e. --- .../LanguageServiceSpringAutoConfiguration.java | 15 +++++++++++++++ .../spring/LanguageServiceSpringProperties.java | 13 +++++++++++++ 2 files changed, 28 insertions(+) diff --git a/spring-cloud-previews/google-cloud-language-spring-starter/src/main/java/com/google/cloud/language/v1/spring/LanguageServiceSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-language-spring-starter/src/main/java/com/google/cloud/language/v1/spring/LanguageServiceSpringAutoConfiguration.java index 91b339cf78..7607eb4343 100644 --- a/spring-cloud-previews/google-cloud-language-spring-starter/src/main/java/com/google/cloud/language/v1/spring/LanguageServiceSpringAutoConfiguration.java +++ b/spring-cloud-previews/google-cloud-language-spring-starter/src/main/java/com/google/cloud/language/v1/spring/LanguageServiceSpringAutoConfiguration.java @@ -184,6 +184,11 @@ public LanguageServiceSettings languageServiceSettings( clientSettingsBuilder.analyzeSyntaxSettings().getRetrySettings(), serviceRetry); clientSettingsBuilder.analyzeSyntaxSettings().setRetrySettings(analyzeSyntaxRetrySettings); + RetrySettings classifyTextRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.classifyTextSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.classifyTextSettings().setRetrySettings(classifyTextRetrySettings); + RetrySettings annotateTextRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder.annotateTextSettings().getRetrySettings(), serviceRetry); @@ -244,6 +249,16 @@ public LanguageServiceSettings languageServiceSettings( LOGGER.trace("Configured method-level retry settings for analyzeSyntax from properties."); } } + Retry classifyTextRetry = clientProperties.getClassifyTextRetry(); + if (classifyTextRetry != null) { + RetrySettings classifyTextRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.classifyTextSettings().getRetrySettings(), classifyTextRetry); + clientSettingsBuilder.classifyTextSettings().setRetrySettings(classifyTextRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for classifyText from properties."); + } + } Retry annotateTextRetry = clientProperties.getAnnotateTextRetry(); if (annotateTextRetry != null) { RetrySettings annotateTextRetrySettings = diff --git a/spring-cloud-previews/google-cloud-language-spring-starter/src/main/java/com/google/cloud/language/v1/spring/LanguageServiceSpringProperties.java b/spring-cloud-previews/google-cloud-language-spring-starter/src/main/java/com/google/cloud/language/v1/spring/LanguageServiceSpringProperties.java index c1c2d62d45..2dc3ba178f 100644 --- a/spring-cloud-previews/google-cloud-language-spring-starter/src/main/java/com/google/cloud/language/v1/spring/LanguageServiceSpringProperties.java +++ b/spring-cloud-previews/google-cloud-language-spring-starter/src/main/java/com/google/cloud/language/v1/spring/LanguageServiceSpringProperties.java @@ -64,6 +64,11 @@ public class LanguageServiceSpringProperties implements CredentialsSupplier { * precedence over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry analyzeSyntaxRetry; + /** + * Allow override of retry settings at method-level for classifyText. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry classifyTextRetry; /** * Allow override of retry settings at method-level for annotateText. If defined, this takes * precedence over service-level retry configurations for that RPC method. @@ -139,6 +144,14 @@ public void setAnalyzeSyntaxRetry(Retry analyzeSyntaxRetry) { this.analyzeSyntaxRetry = analyzeSyntaxRetry; } + public Retry getClassifyTextRetry() { + return this.classifyTextRetry; + } + + public void setClassifyTextRetry(Retry classifyTextRetry) { + this.classifyTextRetry = classifyTextRetry; + } + public Retry getAnnotateTextRetry() { return this.annotateTextRetry; }