Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,10 @@ public static String getSpringPropertyPrefix(String packageName, String serviceN
// Returns unique prefix for setting properties and enabling autoconfiguration
// Pattern: [package-name].spring.auto.[service-name]
// e.g. for vision's ImageAnnotator service:
// com.google.cloud.vision.v1.spring.auto.image-annotator
// com.google.cloud.vision.v1.image-annotator
// Service name is converted to lower hyphen as required by ConfigurationPropertyName
// https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/context/properties/source/ConfigurationPropertyName.html
return packageName
+ ".spring.auto."
+ CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, serviceName);
return packageName + "." + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, serviceName);
}

private static TypeStore createStaticTypes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ import org.springframework.context.annotation.Bean;
@BetaApi("Autogenerated Spring autoconfiguration is not yet stable")
@AutoConfiguration
@ConditionalOnClass(EchoClient.class)
@ConditionalOnProperty(
value = "com.google.showcase.v1beta1.spring.auto.echo.enabled",
matchIfMissing = true)
@ConditionalOnProperty(value = "com.google.showcase.v1beta1.echo.enabled", matchIfMissing = true)
@EnableConfigurationProperties(EchoSpringProperties.class)
public class EchoSpringAutoConfiguration {
private final EchoSpringProperties clientProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ import org.springframework.context.annotation.Bean;
*/
@AutoConfiguration
@ConditionalOnClass(EchoClient.class)
@ConditionalOnProperty(
value = "com.google.showcase.v1beta1.spring.auto.echo.enabled",
matchIfMissing = true)
@ConditionalOnProperty(value = "com.google.showcase.v1beta1.echo.enabled", matchIfMissing = true)
@EnableConfigurationProperties(EchoSpringProperties.class)
public class EchoSpringAutoConfiguration {
private final EchoSpringProperties clientProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ import org.springframework.context.annotation.Bean;
*/
@AutoConfiguration
@ConditionalOnClass(EchoClient.class)
@ConditionalOnProperty(
value = "com.google.showcase.v1beta1.spring.auto.echo.enabled",
matchIfMissing = true)
@ConditionalOnProperty(value = "com.google.showcase.v1beta1.echo.enabled", matchIfMissing = true)
@EnableConfigurationProperties(EchoSpringProperties.class)
public class EchoSpringAutoConfiguration {
private final EchoSpringProperties clientProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.springframework.boot.context.properties.NestedConfigurationProperty;
/** Provides default property values for Echo client bean */
@Generated("by google-cloud-spring-generator")
@BetaApi("Autogenerated Spring autoconfiguration is not yet stable")
@ConfigurationProperties("com.google.showcase.v1beta1.spring.auto.echo")
@ConfigurationProperties("com.google.showcase.v1beta1.echo")
public class EchoSpringProperties implements CredentialsSupplier {
@NestedConfigurationProperty
private final Credentials credentials =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.springframework.boot.context.properties.NestedConfigurationProperty;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/** Provides default property values for Echo client bean */
@ConfigurationProperties("com.google.showcase.v1beta1.spring.auto.echo")
@ConfigurationProperties("com.google.showcase.v1beta1.echo")
public class EchoSpringProperties implements CredentialsSupplier {
@NestedConfigurationProperty
private final Credentials credentials =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.springframework.boot.context.properties.NestedConfigurationProperty;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/** Provides default property values for Echo client bean */
@ConfigurationProperties("com.google.showcase.v1beta1.spring.auto.echo")
@ConfigurationProperties("com.google.showcase.v1beta1.echo")
public class EchoSpringProperties implements CredentialsSupplier {
@NestedConfigurationProperty
private final Credentials credentials =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"properties": [
{
"name": "com.google.showcase.v1beta1.spring.auto.echo.enabled",
"name": "com.google.showcase.v1beta1.echo.enabled",
"type": "java.lang.Boolean",
"description": "Auto-configure Google Cloud localhost:7469/Echo components.",
"defaultValue": true
Expand Down