diff --git a/src/main/java/com/google/api/generator/gapic/composer/GrpcServiceCallableFactoryClassComposer.java b/src/main/java/com/google/api/generator/gapic/composer/GrpcServiceCallableFactoryClassComposer.java index 672a35804f..4a7b7375ef 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/GrpcServiceCallableFactoryClassComposer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/GrpcServiceCallableFactoryClassComposer.java @@ -14,6 +14,7 @@ package com.google.api.generator.gapic.composer; +import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -40,6 +41,7 @@ import com.google.api.generator.gapic.composer.comment.StubCommentComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; +import com.google.api.generator.gapic.composer.utils.PackageChecker; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; import com.google.api.generator.gapic.model.Message; @@ -77,7 +79,7 @@ public GapicClass generate(Service service, Map ignore) { .setHeaderCommentStatements( StubCommentComposer.createGrpcServiceCallableFactoryClassHeaderComments( service.name())) - .setAnnotations(createClassAnnotations(typeStore)) + .setAnnotations(createClassAnnotations(service.pakkage(), typeStore)) .setImplementsTypes(createClassImplements(typeStore)) .setName(className) .setMethods(createClassMethods(typeStore)) @@ -86,12 +88,17 @@ public GapicClass generate(Service service, Map ignore) { return GapicClass.create(kind, classDef); } - private static List createClassAnnotations(TypeStore typeStore) { - return Arrays.asList( + private static List createClassAnnotations(String pakkage, TypeStore typeStore) { + List annotations = new ArrayList<>(); + if (!PackageChecker.isGaApi(pakkage)) { + annotations.add(AnnotationNode.withType(typeStore.get("BetaApi"))); + } + annotations.add( AnnotationNode.builder() .setType(typeStore.get("Generated")) - .setDescription("by gapic-generator") + .setDescription("by gapic-generator-java") .build()); + return annotations; } private static List createClassImplements(TypeStore typeStore) { @@ -343,6 +350,7 @@ private static TypeStore createTypes(Service service) { Arrays.asList( // Gax-java classes. BatchingCallSettings.class, + BetaApi.class, BidiStreamingCallable.class, ClientContext.class, ClientStreamingCallable.class, diff --git a/src/main/java/com/google/api/generator/gapic/composer/GrpcServiceStubClassComposer.java b/src/main/java/com/google/api/generator/gapic/composer/GrpcServiceStubClassComposer.java index a43f27b91a..f05a0e057d 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/GrpcServiceStubClassComposer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/GrpcServiceStubClassComposer.java @@ -14,6 +14,7 @@ package com.google.api.generator.gapic.composer; +import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -51,6 +52,7 @@ import com.google.api.generator.gapic.composer.comment.StubCommentComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; +import com.google.api.generator.gapic.composer.utils.PackageChecker; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; import com.google.api.generator.gapic.model.Message; @@ -161,7 +163,7 @@ public GapicClass generate(Service service, Map ignore) { .setPackageString(pakkage) .setHeaderCommentStatements( StubCommentComposer.createGrpcServiceStubClassHeaderComments(service.name())) - .setAnnotations(createClassAnnotations()) + .setAnnotations(createClassAnnotations(service.pakkage())) .setScope(ScopeNode.PUBLIC) .setName(className) .setExtendsType(typeStore.get(ClassNames.getServiceStubClassName(service))) @@ -385,12 +387,17 @@ private static Map createCallableClassMembers( return callableClassMembers; } - private static List createClassAnnotations() { - return Arrays.asList( + private static List createClassAnnotations(String pakkage) { + List annotations = new ArrayList<>(); + if (!PackageChecker.isGaApi(pakkage)) { + annotations.add(AnnotationNode.withType(FIXED_TYPESTORE.get("BetaApi"))); + } + annotations.add( AnnotationNode.builder() .setType(FIXED_TYPESTORE.get("Generated")) .setDescription("by gapic-generator-java") .build()); + return annotations; } private static List createClassMethods( @@ -1024,6 +1031,7 @@ private static TypeStore createStaticTypes() { Arrays.asList( BackgroundResource.class, BackgroundResourceAggregation.class, + BetaApi.class, BidiStreamingCallable.class, ClientContext.class, ClientStreamingCallable.class, diff --git a/src/main/java/com/google/api/generator/gapic/composer/ServiceClientClassComposer.java b/src/main/java/com/google/api/generator/gapic/composer/ServiceClientClassComposer.java index 3c82ab145d..477a2b68a5 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/ServiceClientClassComposer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/ServiceClientClassComposer.java @@ -58,6 +58,7 @@ import com.google.api.generator.gapic.composer.samplecode.ServiceClientSampleCodeComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; +import com.google.api.generator.gapic.composer.utils.PackageChecker; import com.google.api.generator.gapic.model.Field; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; @@ -128,7 +129,7 @@ public GapicClass generate(Service service, Map messageTypes) { ClassDefinition.builder() .setHeaderCommentStatements(createClassHeaderComments(service, typeStore)) .setPackageString(pakkage) - .setAnnotations(createClassAnnotations(typeStore)) + .setAnnotations(createClassAnnotations(pakkage, typeStore)) .setScope(ScopeNode.PUBLIC) .setName(className) .setImplementsTypes(createClassImplements(typeStore)) @@ -139,13 +140,17 @@ public GapicClass generate(Service service, Map messageTypes) { return GapicClass.create(kind, classDef); } - private static List createClassAnnotations(TypeStore typeStore) { - return Arrays.asList( - AnnotationNode.withType(typeStore.get("BetaApi")), + private static List createClassAnnotations(String pakkage, TypeStore typeStore) { + List annotations = new ArrayList<>(); + if (!PackageChecker.isGaApi(pakkage)) { + annotations.add(AnnotationNode.withType(typeStore.get("BetaApi"))); + } + annotations.add( AnnotationNode.builder() .setType(typeStore.get("Generated")) - .setDescription("by gapic-generator") + .setDescription("by gapic-generator-java") .build()); + return annotations; } private static List createClassImplements(TypeStore typeStore) { diff --git a/src/main/java/com/google/api/generator/gapic/composer/ServiceSettingsClassComposer.java b/src/main/java/com/google/api/generator/gapic/composer/ServiceSettingsClassComposer.java index 8af3e88e38..37758868e0 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/ServiceSettingsClassComposer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/ServiceSettingsClassComposer.java @@ -54,6 +54,7 @@ import com.google.api.generator.gapic.composer.samplecode.SettingsSampleCodeComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; +import com.google.api.generator.gapic.composer.utils.PackageChecker; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; import com.google.api.generator.gapic.model.Message; @@ -104,7 +105,7 @@ public GapicClass generate(Service service, Map ignore) { .setPackageString(pakkage) .setHeaderCommentStatements( createClassHeaderComments(service, typeStore.get(className))) - .setAnnotations(createClassAnnotations()) + .setAnnotations(createClassAnnotations(service.pakkage())) .setScope(ScopeNode.PUBLIC) .setName(className) .setExtendsType( @@ -147,12 +148,17 @@ private static List createClassHeaderComments( classType); } - private static List createClassAnnotations() { - return Arrays.asList( + private static List createClassAnnotations(String pakkage) { + List annotations = new ArrayList<>(); + if (!PackageChecker.isGaApi(pakkage)) { + annotations.add(AnnotationNode.withType(FIXED_TYPESTORE.get("BetaApi"))); + } + annotations.add( AnnotationNode.builder() .setType(FIXED_TYPESTORE.get("Generated")) .setDescription("by gapic-generator-java") .build()); + return annotations; } private static List createClassMethods(Service service, TypeStore typeStore) { diff --git a/src/main/java/com/google/api/generator/gapic/composer/ServiceStubClassComposer.java b/src/main/java/com/google/api/generator/gapic/composer/ServiceStubClassComposer.java index 005b1415cb..f2f70a6e8e 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/ServiceStubClassComposer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/ServiceStubClassComposer.java @@ -14,6 +14,7 @@ package com.google.api.generator.gapic.composer; +import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientStreamingCallable; @@ -32,6 +33,7 @@ import com.google.api.generator.gapic.composer.comment.StubCommentComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; +import com.google.api.generator.gapic.composer.utils.PackageChecker; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; import com.google.api.generator.gapic.model.Message; @@ -69,7 +71,7 @@ public GapicClass generate(Service service, Map messageTypes) { .setPackageString(pakkage) .setHeaderCommentStatements( StubCommentComposer.createServiceStubClassHeaderComments(service.name())) - .setAnnotations(createClassAnnotations(typeStore)) + .setAnnotations(createClassAnnotations(service.pakkage(), typeStore)) .setIsAbstract(true) .setImplementsTypes(createClassImplements(typeStore)) .setName(className) @@ -79,12 +81,17 @@ public GapicClass generate(Service service, Map messageTypes) { return GapicClass.create(kind, classDef); } - private static List createClassAnnotations(TypeStore typeStore) { - return Arrays.asList( + private static List createClassAnnotations(String pakkage, TypeStore typeStore) { + List annotations = new ArrayList<>(); + if (!PackageChecker.isGaApi(pakkage)) { + annotations.add(AnnotationNode.withType(typeStore.get("BetaApi"))); + } + annotations.add( AnnotationNode.builder() .setType(typeStore.get("Generated")) - .setDescription("by gapic-generator") + .setDescription("by gapic-generator-java") .build()); + return annotations; } private static List createClassImplements(TypeStore typeStore) { @@ -215,6 +222,7 @@ private static TypeStore createTypes(Service service, Map messa List concreteClazzes = Arrays.asList( BackgroundResource.class, + BetaApi.class, BidiStreamingCallable.class, ClientStreamingCallable.class, Generated.class, diff --git a/src/main/java/com/google/api/generator/gapic/composer/ServiceStubSettingsClassComposer.java b/src/main/java/com/google/api/generator/gapic/composer/ServiceStubSettingsClassComposer.java index e0352303d7..2753fb6faf 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/ServiceStubSettingsClassComposer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/ServiceStubSettingsClassComposer.java @@ -85,6 +85,7 @@ import com.google.api.generator.gapic.composer.samplecode.SettingsSampleCodeComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; +import com.google.api.generator.gapic.composer.utils.PackageChecker; import com.google.api.generator.gapic.model.Field; import com.google.api.generator.gapic.model.GapicBatchingSettings; import com.google.api.generator.gapic.model.GapicClass; @@ -175,7 +176,7 @@ public GapicClass generate( .setPackageString(pakkage) .setHeaderCommentStatements( createClassHeaderComments(service, typeStore.get(className))) - .setAnnotations(createClassAnnotations()) + .setAnnotations(createClassAnnotations(service.pakkage())) .setScope(ScopeNode.PUBLIC) .setName(className) .setExtendsType(createExtendsType(service, typeStore)) @@ -189,13 +190,17 @@ public GapicClass generate( return GapicClass.create(GapicClass.Kind.STUB, classDef); } - private static List createClassAnnotations() { - return Arrays.asList( - AnnotationNode.withType(FIXED_TYPESTORE.get("BetaApi")), + private static List createClassAnnotations(String pakkage) { + List annotations = new ArrayList<>(); + if (!PackageChecker.isGaApi(pakkage)) { + annotations.add(AnnotationNode.withType(FIXED_TYPESTORE.get("BetaApi"))); + } + annotations.add( AnnotationNode.builder() .setType(FIXED_TYPESTORE.get("Generated")) .setDescription("by gapic-generator-java") .build()); + return annotations; } private static List createClassHeaderComments( diff --git a/src/main/java/com/google/api/generator/gapic/composer/utils/BUILD.bazel b/src/main/java/com/google/api/generator/gapic/composer/utils/BUILD.bazel index dbcf57db8a..2ecfd68fb0 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/utils/BUILD.bazel +++ b/src/main/java/com/google/api/generator/gapic/composer/utils/BUILD.bazel @@ -14,5 +14,6 @@ java_library( ], deps = [ "//src/main/java/com/google/api/generator/gapic/model", + "@com_google_guava_guava//jar", ], ) diff --git a/src/main/java/com/google/api/generator/gapic/composer/utils/PackageChecker.java b/src/main/java/com/google/api/generator/gapic/composer/utils/PackageChecker.java new file mode 100644 index 0000000000..9765df0425 --- /dev/null +++ b/src/main/java/com/google/api/generator/gapic/composer/utils/PackageChecker.java @@ -0,0 +1,44 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.api.generator.gapic.composer.utils; + +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class PackageChecker { + private PackageChecker() {} + + /** + * Identifies whether a Java package is GA API. Assumes that the version appears in the last + * component of the package, e.g. com.google.cloud.dataproc.v1beta1. + */ + public static boolean isGaApi(String pakkage) { + String[] packageComponents = pakkage.split("\\."); + Preconditions.checkState( + packageComponents.length > 0, "No subcomponents found in Java package %s", pakkage); + String versionComponent = packageComponents[packageComponents.length - 1]; + Matcher matcher = Pattern.compile("^v[0-9]+").matcher(versionComponent); + Preconditions.checkState( + matcher.find(), + "No version component found in last subpackage %s of %s", + versionComponent, + pakkage); + String versionSubstr = versionComponent.replace(matcher.group(), ""); + return Strings.isNullOrEmpty(versionSubstr) + || (!versionSubstr.contains("alpha") && !versionSubstr.contains("beta")); + } +} diff --git a/src/test/java/com/google/api/generator/gapic/composer/constants/BUILD.bazel b/src/test/java/com/google/api/generator/gapic/composer/constants/BUILD.bazel index 2288521d30..d77098ae19 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/constants/BUILD.bazel +++ b/src/test/java/com/google/api/generator/gapic/composer/constants/BUILD.bazel @@ -1,5 +1,3 @@ -load("@rules_java//java:defs.bzl", "java_library") - package(default_visibility = ["//visibility:public"]) filegroup( diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoClient.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoClient.golden index f6495514d6..3dc3eaffe0 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoClient.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoClient.golden @@ -80,7 +80,7 @@ import javax.annotation.Generated; *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class EchoClient implements BackgroundResource { private final EchoSettings settings; private final EchoStub stub; diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoSettings.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoSettings.golden index ceb903e029..d94e7838ef 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoSettings.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoSettings.golden @@ -55,6 +55,7 @@ import javax.annotation.Generated; * EchoSettings echoSettings = echoSettingsBuilder.build(); * } */ +@BetaApi @Generated("by gapic-generator-java") public class EchoSettings extends ClientSettings { diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoStub.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoStub.golden index 9d3eac8add..629e9939bb 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoStub.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoStub.golden @@ -3,6 +3,7 @@ package com.google.showcase.v1beta1.stub; import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; import static com.google.showcase.v1beta1.EchoClient.SimplePagedExpandPagedResponse; +import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientStreamingCallable; @@ -29,7 +30,8 @@ import javax.annotation.Generated; * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public abstract class EchoStub implements BackgroundResource { public OperationsStub getOperationsStub() { diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcEchoCallableFactory.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcEchoCallableFactory.golden index 0786cd3d1b..d6ac9c9fe7 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcEchoCallableFactory.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcEchoCallableFactory.golden @@ -1,5 +1,6 @@ package com.google.showcase.v1beta1.stub; +import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -25,7 +26,8 @@ import javax.annotation.Generated; * *

This class is for advanced usage. */ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class GrpcEchoCallableFactory implements GrpcStubCallableFactory { @Override diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcEchoStub.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcEchoStub.golden index bd53044979..3c32fbab4f 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcEchoStub.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcEchoStub.golden @@ -3,6 +3,7 @@ package com.google.showcase.v1beta1.stub; import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; import static com.google.showcase.v1beta1.EchoClient.SimplePagedExpandPagedResponse; +import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -37,6 +38,7 @@ import javax.annotation.Generated; * *

This class is for advanced usage and reflects the underlying API directly. */ +@BetaApi @Generated("by gapic-generator-java") public class GrpcEchoStub extends EchoStub { private static final MethodDescriptor echoMethodDescriptor = diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcTestingStub.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcTestingStub.golden index f5ffa8f0b8..5c6a4e4626 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcTestingStub.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcTestingStub.golden @@ -3,6 +3,7 @@ package com.google.showcase.v1beta1.stub; import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; +import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -41,6 +42,7 @@ import javax.annotation.Generated; * *

This class is for advanced usage and reflects the underlying API directly. */ +@BetaApi @Generated("by gapic-generator-java") public class GrpcTestingStub extends TestingStub { private static final MethodDescriptor diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/IdentityClient.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/IdentityClient.golden index edd19b1601..40133002aa 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/IdentityClient.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/IdentityClient.golden @@ -71,7 +71,7 @@ import javax.annotation.Generated; *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class IdentityClient implements BackgroundResource { private final IdentitySettings settings; private final IdentityStub stub; diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/LoggingServiceV2StubSettings.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/LoggingServiceV2StubSettings.golden index e4f242d816..29c1fe7941 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/LoggingServiceV2StubSettings.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/LoggingServiceV2StubSettings.golden @@ -88,7 +88,6 @@ import org.threeten.bp.Duration; * LoggingServiceV2StubSettings loggingServiceV2Settings = loggingServiceV2SettingsBuilder.build(); * } */ -@BetaApi @Generated("by gapic-generator-java") public class LoggingServiceV2StubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/PublisherStubSettings.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/PublisherStubSettings.golden index 2f19e405c1..41585255b2 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/PublisherStubSettings.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/PublisherStubSettings.golden @@ -91,7 +91,6 @@ import org.threeten.bp.Duration; * PublisherStubSettings publisherSettings = publisherSettingsBuilder.build(); * } */ -@BetaApi @Generated("by gapic-generator-java") public class PublisherStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/src/test/java/com/google/api/generator/gapic/composer/utils/BUILD.bazel b/src/test/java/com/google/api/generator/gapic/composer/utils/BUILD.bazel new file mode 100644 index 0000000000..f33101e6f9 --- /dev/null +++ b/src/test/java/com/google/api/generator/gapic/composer/utils/BUILD.bazel @@ -0,0 +1,30 @@ +load("@rules_java//java:defs.bzl", "java_test") + +package(default_visibility = ["//visibility:public"]) + +TESTS = [ + "PackageCheckerTest", +] + +TEST_DEPS = [ + "//src/main/java/com/google/api/generator/gapic/composer/utils", + "@com_google_guava_guava", + "@com_google_protobuf//:protobuf_java", + "@com_google_truth_truth//jar", + "@junit_junit//jar", +] + +filegroup( + name = "utils_files", + srcs = ["{0}.java".format(f) for f in TESTS], +) + +[java_test( + name = test_name, + testonly = True, + srcs = [ + "{0}.java".format(test_name), + ], + test_class = "com.google.api.generator.gapic.composer.utils.{0}".format(test_name), + deps = TEST_DEPS, +) for test_name in TESTS] diff --git a/src/test/java/com/google/api/generator/gapic/composer/utils/PackageCheckerTest.java b/src/test/java/com/google/api/generator/gapic/composer/utils/PackageCheckerTest.java new file mode 100644 index 0000000000..323f5e0100 --- /dev/null +++ b/src/test/java/com/google/api/generator/gapic/composer/utils/PackageCheckerTest.java @@ -0,0 +1,46 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.api.generator.gapic.composer.utils; + +import static junit.framework.Assert.assertFalse; +import static junit.framework.Assert.assertTrue; +import static org.junit.Assert.assertThrows; + +import org.junit.Test; + +public class PackageCheckerTest { + @Test + public void isGaApi_normalExpectedPackageStructure() { + assertTrue(PackageChecker.isGaApi("com.google.cloud.dataproc.v1")); + assertTrue(PackageChecker.isGaApi("com.google.cloud.dataproc.v999")); + assertTrue(PackageChecker.isGaApi("com.google.cloud.dataproc.v12345a")); + assertTrue(PackageChecker.isGaApi("com.google.cloud.dataproc.v999asdf")); + assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1beta1")); + assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1alpha1")); + assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1beta")); + assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1alpha")); + assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1p2alpha1")); + assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1p4beta")); + assertFalse(PackageChecker.isGaApi("com.google.cloud.asset.v1beta1")); + } + + @Test + public void isGaApi_invalidPackageStructure() { + assertThrows( + IllegalStateException.class, + () -> PackageChecker.isGaApi("com.google.cloud.dataproc.v1.foobar")); + assertThrows(IllegalStateException.class, () -> PackageChecker.isGaApi("")); + } +} diff --git a/test/integration/BUILD.bazel b/test/integration/BUILD.bazel index 777e1d0d93..449f19b19d 100644 --- a/test/integration/BUILD.bazel +++ b/test/integration/BUILD.bazel @@ -81,32 +81,32 @@ java_gapic_assembly_gradle_pkg( # Redis API. java_gapic_library( name = "redis_java_gapic", - srcs = ["@com_google_googleapis//google/cloud/redis/v1:redis_proto_with_info"], - gapic_yaml = "@com_google_googleapis//google/cloud/redis/v1:redis_gapic.yaml", - grpc_service_config = "@com_google_googleapis//google/cloud/redis/v1:redis_grpc_service_config.json", + srcs = ["@com_google_googleapis//google/cloud/redis/v1beta1:redis_proto_with_info"], + gapic_yaml = "@com_google_googleapis//google/cloud/redis/v1beta1:redis_gapic.yaml", + grpc_service_config = "@com_google_googleapis//google/cloud/redis/v1beta1:redis_grpc_service_config.json", test_deps = [ - "@com_google_googleapis//google/cloud/redis/v1:redis_java_grpc", + "@com_google_googleapis//google/cloud/redis/v1beta1:redis_java_grpc", ], deps = [ - "@com_google_googleapis//google/cloud/redis/v1:redis_java_proto", + "@com_google_googleapis//google/cloud/redis/v1beta1:redis_java_proto", ], ) java_gapic_test( name = "redis_java_gapic_test_suite", test_classes = [ - "com.google.cloud.redis.v1.CloudRedisClientTest", + "com.google.cloud.redis.v1beta1.CloudRedisClientTest", ], runtime_deps = [":redis_java_gapic_test"], ) java_gapic_assembly_gradle_pkg( - name = "google-cloud-redis-v1-java", + name = "google-cloud-redis-v1beta1-java", deps = [ ":redis_java_gapic", - "@com_google_googleapis//google/cloud/redis/v1:redis_java_grpc", - "@com_google_googleapis//google/cloud/redis/v1:redis_java_proto", - "@com_google_googleapis//google/cloud/redis/v1:redis_proto", + "@com_google_googleapis//google/cloud/redis/v1beta1:redis_java_grpc", + "@com_google_googleapis//google/cloud/redis/v1beta1:redis_java_proto", + "@com_google_googleapis//google/cloud/redis/v1beta1:redis_proto", ], ) diff --git a/test/integration/goldens/asset/AssetServiceClient.java b/test/integration/goldens/asset/AssetServiceClient.java index cfce3edd87..631aa590a6 100644 --- a/test/integration/goldens/asset/AssetServiceClient.java +++ b/test/integration/goldens/asset/AssetServiceClient.java @@ -92,8 +92,7 @@ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@BetaApi -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class AssetServiceClient implements BackgroundResource { private final AssetServiceSettings settings; private final AssetServiceStub stub; diff --git a/test/integration/goldens/asset/AssetServiceStub.java b/test/integration/goldens/asset/AssetServiceStub.java index 81eda8b2cd..274dfb3911 100644 --- a/test/integration/goldens/asset/AssetServiceStub.java +++ b/test/integration/goldens/asset/AssetServiceStub.java @@ -48,7 +48,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public abstract class AssetServiceStub implements BackgroundResource { public OperationsStub getOperationsStub() { diff --git a/test/integration/goldens/asset/AssetServiceStubSettings.java b/test/integration/goldens/asset/AssetServiceStubSettings.java index 055e09dea5..6b6094255d 100644 --- a/test/integration/goldens/asset/AssetServiceStubSettings.java +++ b/test/integration/goldens/asset/AssetServiceStubSettings.java @@ -105,7 +105,6 @@ * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build(); * } */ -@BetaApi @Generated("by gapic-generator-java") public class AssetServiceStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/test/integration/goldens/asset/GrpcAssetServiceCallableFactory.java b/test/integration/goldens/asset/GrpcAssetServiceCallableFactory.java index e67f9e56fa..8a3a677c97 100644 --- a/test/integration/goldens/asset/GrpcAssetServiceCallableFactory.java +++ b/test/integration/goldens/asset/GrpcAssetServiceCallableFactory.java @@ -41,7 +41,7 @@ * *

This class is for advanced usage. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class GrpcAssetServiceCallableFactory implements GrpcStubCallableFactory { @Override diff --git a/test/integration/goldens/credentials/GrpcIamCredentialsCallableFactory.java b/test/integration/goldens/credentials/GrpcIamCredentialsCallableFactory.java index 6dc31820a3..32b29d4f33 100644 --- a/test/integration/goldens/credentials/GrpcIamCredentialsCallableFactory.java +++ b/test/integration/goldens/credentials/GrpcIamCredentialsCallableFactory.java @@ -41,7 +41,7 @@ * *

This class is for advanced usage. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class GrpcIamCredentialsCallableFactory implements GrpcStubCallableFactory { @Override diff --git a/test/integration/goldens/credentials/IamCredentialsClient.java b/test/integration/goldens/credentials/IamCredentialsClient.java index e3699cdcc0..ecaed011f3 100644 --- a/test/integration/goldens/credentials/IamCredentialsClient.java +++ b/test/integration/goldens/credentials/IamCredentialsClient.java @@ -88,8 +88,7 @@ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@BetaApi -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class IamCredentialsClient implements BackgroundResource { private final IamCredentialsSettings settings; private final IamCredentialsStub stub; diff --git a/test/integration/goldens/credentials/IamCredentialsStub.java b/test/integration/goldens/credentials/IamCredentialsStub.java index 8b195e93b0..9a269e4bfc 100644 --- a/test/integration/goldens/credentials/IamCredentialsStub.java +++ b/test/integration/goldens/credentials/IamCredentialsStub.java @@ -34,7 +34,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public abstract class IamCredentialsStub implements BackgroundResource { public UnaryCallable diff --git a/test/integration/goldens/credentials/IamCredentialsStubSettings.java b/test/integration/goldens/credentials/IamCredentialsStubSettings.java index d86322d07b..05f986fbf4 100644 --- a/test/integration/goldens/credentials/IamCredentialsStubSettings.java +++ b/test/integration/goldens/credentials/IamCredentialsStubSettings.java @@ -81,7 +81,6 @@ * IamCredentialsStubSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build(); * } */ -@BetaApi @Generated("by gapic-generator-java") public class IamCredentialsStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/test/integration/goldens/library/GrpcLibraryServiceCallableFactory.java b/test/integration/goldens/library/GrpcLibraryServiceCallableFactory.java index 50414f7b6b..1732f3129d 100644 --- a/test/integration/goldens/library/GrpcLibraryServiceCallableFactory.java +++ b/test/integration/goldens/library/GrpcLibraryServiceCallableFactory.java @@ -41,7 +41,7 @@ * *

This class is for advanced usage. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class GrpcLibraryServiceCallableFactory implements GrpcStubCallableFactory { @Override diff --git a/test/integration/goldens/library/LibraryServiceClient.java b/test/integration/goldens/library/LibraryServiceClient.java index a8303d5fe3..b574501da4 100644 --- a/test/integration/goldens/library/LibraryServiceClient.java +++ b/test/integration/goldens/library/LibraryServiceClient.java @@ -112,8 +112,7 @@ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@BetaApi -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class LibraryServiceClient implements BackgroundResource { private final LibraryServiceSettings settings; private final LibraryServiceStub stub; diff --git a/test/integration/goldens/library/LibraryServiceStub.java b/test/integration/goldens/library/LibraryServiceStub.java index c256e68362..48eaf7b070 100644 --- a/test/integration/goldens/library/LibraryServiceStub.java +++ b/test/integration/goldens/library/LibraryServiceStub.java @@ -45,7 +45,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public abstract class LibraryServiceStub implements BackgroundResource { public UnaryCallable createShelfCallable() { diff --git a/test/integration/goldens/library/LibraryServiceStubSettings.java b/test/integration/goldens/library/LibraryServiceStubSettings.java index bc16111efe..d36fe4d22f 100644 --- a/test/integration/goldens/library/LibraryServiceStubSettings.java +++ b/test/integration/goldens/library/LibraryServiceStubSettings.java @@ -98,7 +98,6 @@ * LibraryServiceStubSettings libraryServiceSettings = libraryServiceSettingsBuilder.build(); * } */ -@BetaApi @Generated("by gapic-generator-java") public class LibraryServiceStubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/test/integration/goldens/logging/ConfigClient.java b/test/integration/goldens/logging/ConfigClient.java index c328da1caf..678d5300e6 100644 --- a/test/integration/goldens/logging/ConfigClient.java +++ b/test/integration/goldens/logging/ConfigClient.java @@ -120,8 +120,7 @@ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@BetaApi -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class ConfigClient implements BackgroundResource { private final ConfigSettings settings; private final ConfigServiceV2Stub stub; diff --git a/test/integration/goldens/logging/ConfigServiceV2Stub.java b/test/integration/goldens/logging/ConfigServiceV2Stub.java index a3d770adb0..e0e867e11d 100644 --- a/test/integration/goldens/logging/ConfigServiceV2Stub.java +++ b/test/integration/goldens/logging/ConfigServiceV2Stub.java @@ -53,7 +53,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public abstract class ConfigServiceV2Stub implements BackgroundResource { public UnaryCallable listBucketsPagedCallable() { diff --git a/test/integration/goldens/logging/ConfigServiceV2StubSettings.java b/test/integration/goldens/logging/ConfigServiceV2StubSettings.java index 82472fa977..9665b4956b 100644 --- a/test/integration/goldens/logging/ConfigServiceV2StubSettings.java +++ b/test/integration/goldens/logging/ConfigServiceV2StubSettings.java @@ -106,7 +106,6 @@ * ConfigServiceV2StubSettings configServiceV2Settings = configServiceV2SettingsBuilder.build(); * } */ -@BetaApi @Generated("by gapic-generator-java") public class ConfigServiceV2StubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/test/integration/goldens/logging/GrpcConfigServiceV2CallableFactory.java b/test/integration/goldens/logging/GrpcConfigServiceV2CallableFactory.java index a6b77d5f5d..b71fdfc862 100644 --- a/test/integration/goldens/logging/GrpcConfigServiceV2CallableFactory.java +++ b/test/integration/goldens/logging/GrpcConfigServiceV2CallableFactory.java @@ -41,7 +41,7 @@ * *

This class is for advanced usage. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class GrpcConfigServiceV2CallableFactory implements GrpcStubCallableFactory { @Override diff --git a/test/integration/goldens/logging/GrpcLoggingServiceV2CallableFactory.java b/test/integration/goldens/logging/GrpcLoggingServiceV2CallableFactory.java index b9399e7ee1..1779d7c70b 100644 --- a/test/integration/goldens/logging/GrpcLoggingServiceV2CallableFactory.java +++ b/test/integration/goldens/logging/GrpcLoggingServiceV2CallableFactory.java @@ -41,7 +41,7 @@ * *

This class is for advanced usage. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class GrpcLoggingServiceV2CallableFactory implements GrpcStubCallableFactory { @Override diff --git a/test/integration/goldens/logging/GrpcMetricsServiceV2CallableFactory.java b/test/integration/goldens/logging/GrpcMetricsServiceV2CallableFactory.java index d3f407cf31..ea54e8e76c 100644 --- a/test/integration/goldens/logging/GrpcMetricsServiceV2CallableFactory.java +++ b/test/integration/goldens/logging/GrpcMetricsServiceV2CallableFactory.java @@ -41,7 +41,7 @@ * *

This class is for advanced usage. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class GrpcMetricsServiceV2CallableFactory implements GrpcStubCallableFactory { @Override diff --git a/test/integration/goldens/logging/LoggingClient.java b/test/integration/goldens/logging/LoggingClient.java index 8b7fcd0f2b..3f47e0ebaa 100644 --- a/test/integration/goldens/logging/LoggingClient.java +++ b/test/integration/goldens/logging/LoggingClient.java @@ -105,8 +105,7 @@ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@BetaApi -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class LoggingClient implements BackgroundResource { private final LoggingSettings settings; private final LoggingServiceV2Stub stub; diff --git a/test/integration/goldens/logging/LoggingServiceV2Stub.java b/test/integration/goldens/logging/LoggingServiceV2Stub.java index 40e608ddae..7a18b2cc33 100644 --- a/test/integration/goldens/logging/LoggingServiceV2Stub.java +++ b/test/integration/goldens/logging/LoggingServiceV2Stub.java @@ -40,7 +40,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public abstract class LoggingServiceV2Stub implements BackgroundResource { public UnaryCallable deleteLogCallable() { diff --git a/test/integration/goldens/logging/LoggingServiceV2StubSettings.java b/test/integration/goldens/logging/LoggingServiceV2StubSettings.java index 47b910ab99..e62a198503 100644 --- a/test/integration/goldens/logging/LoggingServiceV2StubSettings.java +++ b/test/integration/goldens/logging/LoggingServiceV2StubSettings.java @@ -104,7 +104,6 @@ * LoggingServiceV2StubSettings loggingServiceV2Settings = loggingServiceV2SettingsBuilder.build(); * } */ -@BetaApi @Generated("by gapic-generator-java") public class LoggingServiceV2StubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/test/integration/goldens/logging/MetricsClient.java b/test/integration/goldens/logging/MetricsClient.java index 3d105de40d..14ccc5d1a4 100644 --- a/test/integration/goldens/logging/MetricsClient.java +++ b/test/integration/goldens/logging/MetricsClient.java @@ -96,8 +96,7 @@ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@BetaApi -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class MetricsClient implements BackgroundResource { private final MetricsSettings settings; private final MetricsServiceV2Stub stub; diff --git a/test/integration/goldens/logging/MetricsServiceV2Stub.java b/test/integration/goldens/logging/MetricsServiceV2Stub.java index 41151d0238..5cf37e71a8 100644 --- a/test/integration/goldens/logging/MetricsServiceV2Stub.java +++ b/test/integration/goldens/logging/MetricsServiceV2Stub.java @@ -36,7 +36,7 @@ * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public abstract class MetricsServiceV2Stub implements BackgroundResource { public UnaryCallable diff --git a/test/integration/goldens/logging/MetricsServiceV2StubSettings.java b/test/integration/goldens/logging/MetricsServiceV2StubSettings.java index 94082fb1c4..c3b691f2c6 100644 --- a/test/integration/goldens/logging/MetricsServiceV2StubSettings.java +++ b/test/integration/goldens/logging/MetricsServiceV2StubSettings.java @@ -89,7 +89,6 @@ * MetricsServiceV2StubSettings metricsServiceV2Settings = metricsServiceV2SettingsBuilder.build(); * } */ -@BetaApi @Generated("by gapic-generator-java") public class MetricsServiceV2StubSettings extends StubSettings { /** The default scopes of the service. */ diff --git a/test/integration/goldens/redis/CloudRedisClient.java b/test/integration/goldens/redis/CloudRedisClient.java index ae14c03a63..75fa4eebdd 100644 --- a/test/integration/goldens/redis/CloudRedisClient.java +++ b/test/integration/goldens/redis/CloudRedisClient.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.cloud.redis.v1; +package com.google.cloud.redis.v1beta1; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; @@ -28,11 +28,12 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.redis.v1.stub.CloudRedisStub; -import com.google.cloud.redis.v1.stub.CloudRedisStubSettings; +import com.google.cloud.redis.v1beta1.stub.CloudRedisStub; +import com.google.cloud.redis.v1beta1.stub.CloudRedisStubSettings; import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; import com.google.longrunning.OperationsClient; +import com.google.protobuf.Any; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; @@ -44,7 +45,7 @@ /** * Service Description: Configures and manages Cloud Memorystore for Redis instances * - *

Google Cloud Memorystore for Redis v1 + *

Google Cloud Memorystore for Redis v1beta1 * *

The `redis.googleapis.com` service implements the Google Cloud Memorystore for Redis API and * defines the following resource model for managing Redis instances: @@ -57,7 +58,7 @@ * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` * * - *

Note that location_id must be referring to a GCP `region`; for example: + *

Note that location_id must be refering to a GCP `region`; for example: * *

    *
  • `projects/redpepper-1290/locations/us-central1/instances/my-redis` @@ -113,7 +114,7 @@ *

    Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class CloudRedisClient implements BackgroundResource { private final CloudRedisSettings settings; private final CloudRedisStub stub; @@ -366,7 +367,7 @@ public final UnaryCallable getInstanceCallable() { * @param instance Required. A Redis [Instance] resource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture createInstanceAsync( + public final OperationFuture createInstanceAsync( LocationName parent, String instanceId, Instance instance) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() @@ -407,7 +408,7 @@ public final OperationFuture createInstanceAsync( * @param instance Required. A Redis [Instance] resource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture createInstanceAsync( + public final OperationFuture createInstanceAsync( String parent, String instanceId, Instance instance) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() @@ -436,8 +437,7 @@ public final OperationFuture createInstanceAsync( * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture createInstanceAsync( - CreateInstanceRequest request) { + public final OperationFuture createInstanceAsync(CreateInstanceRequest request) { return createInstanceOperationCallable().futureCall(request); } @@ -458,7 +458,7 @@ public final OperationFuture createInstanceAsync( * *

    Sample code: */ - public final OperationCallable + public final OperationCallable createInstanceOperationCallable() { return stub.createInstanceOperationCallable(); } @@ -494,12 +494,12 @@ public final UnaryCallable createInstanceCalla * * @param updateMask Required. Mask of fields to update. At least one path must be supplied in * this field. The elements of the repeated paths field may only include these fields from - * [Instance][google.cloud.redis.v1.Instance]: + * [Instance][google.cloud.redis.v1beta1.Instance]: *

    * `displayName` * `labels` * `memorySizeGb` * `redisConfig` * @param instance Required. Update description. Only fields specified in update_mask are updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture updateInstanceAsync( + public final OperationFuture updateInstanceAsync( FieldMask updateMask, Instance instance) { UpdateInstanceRequest request = UpdateInstanceRequest.newBuilder().setUpdateMask(updateMask).setInstance(instance).build(); @@ -517,8 +517,7 @@ public final OperationFuture updateInstanceAsync( * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture updateInstanceAsync( - UpdateInstanceRequest request) { + public final OperationFuture updateInstanceAsync(UpdateInstanceRequest request) { return updateInstanceOperationCallable().futureCall(request); } @@ -532,7 +531,7 @@ public final OperationFuture updateInstanceAsync( * *

    Sample code: */ - public final OperationCallable + public final OperationCallable updateInstanceOperationCallable() { return stub.updateInstanceOperationCallable(); } @@ -561,7 +560,7 @@ public final UnaryCallable updateInstanceCalla * @param redisVersion Required. Specifies the target version of Redis software to upgrade to. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture upgradeInstanceAsync( + public final OperationFuture upgradeInstanceAsync( InstanceName name, String redisVersion) { UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder() @@ -581,7 +580,7 @@ public final OperationFuture upgradeInstanceAsync( * @param redisVersion Required. Specifies the target version of Redis software to upgrade to. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture upgradeInstanceAsync( + public final OperationFuture upgradeInstanceAsync( String name, String redisVersion) { UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder().setName(name).setRedisVersion(redisVersion).build(); @@ -595,8 +594,7 @@ public final OperationFuture upgradeInstanceAsync( * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture upgradeInstanceAsync( - UpgradeInstanceRequest request) { + public final OperationFuture upgradeInstanceAsync(UpgradeInstanceRequest request) { return upgradeInstanceOperationCallable().futureCall(request); } @@ -606,7 +604,7 @@ public final OperationFuture upgradeInstanceAsync( * *

    Sample code: */ - public final OperationCallable + public final OperationCallable upgradeInstanceOperationCallable() { return stub.upgradeInstanceOperationCallable(); } @@ -637,7 +635,7 @@ public final UnaryCallable upgradeInstanceCal * @param inputConfig Required. Specify data to be imported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture importInstanceAsync( + public final OperationFuture importInstanceAsync( String name, InputConfig inputConfig) { ImportInstanceRequest request = ImportInstanceRequest.newBuilder().setName(name).setInputConfig(inputConfig).build(); @@ -657,8 +655,7 @@ public final OperationFuture importInstanceAsync( * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture importInstanceAsync( - ImportInstanceRequest request) { + public final OperationFuture importInstanceAsync(ImportInstanceRequest request) { return importInstanceOperationCallable().futureCall(request); } @@ -674,7 +671,7 @@ public final OperationFuture importInstanceAsync( * *

    Sample code: */ - public final OperationCallable + public final OperationCallable importInstanceOperationCallable() { return stub.importInstanceOperationCallable(); } @@ -710,7 +707,7 @@ public final UnaryCallable importInstanceCalla * @param outputConfig Required. Specify data to be exported. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture exportInstanceAsync( + public final OperationFuture exportInstanceAsync( String name, OutputConfig outputConfig) { ExportInstanceRequest request = ExportInstanceRequest.newBuilder().setName(name).setOutputConfig(outputConfig).build(); @@ -729,8 +726,7 @@ public final OperationFuture exportInstanceAsync( * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture exportInstanceAsync( - ExportInstanceRequest request) { + public final OperationFuture exportInstanceAsync(ExportInstanceRequest request) { return exportInstanceOperationCallable().futureCall(request); } @@ -745,7 +741,7 @@ public final OperationFuture exportInstanceAsync( * *

    Sample code: */ - public final OperationCallable + public final OperationCallable exportInstanceOperationCallable() { return stub.exportInstanceOperationCallable(); } @@ -777,7 +773,7 @@ public final UnaryCallable exportInstanceCalla * If it's unspecified, data protection mode will be LIMITED_DATA_LOSS by default. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture failoverInstanceAsync( + public final OperationFuture failoverInstanceAsync( InstanceName name, FailoverInstanceRequest.DataProtectionMode dataProtectionMode) { FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder() @@ -799,7 +795,7 @@ public final OperationFuture failoverInstanceAsync( * If it's unspecified, data protection mode will be LIMITED_DATA_LOSS by default. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture failoverInstanceAsync( + public final OperationFuture failoverInstanceAsync( String name, FailoverInstanceRequest.DataProtectionMode dataProtectionMode) { FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder() @@ -817,7 +813,7 @@ public final OperationFuture failoverInstanceAsync( * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture failoverInstanceAsync( + public final OperationFuture failoverInstanceAsync( FailoverInstanceRequest request) { return failoverInstanceOperationCallable().futureCall(request); } @@ -829,7 +825,7 @@ public final OperationFuture failoverInstanceAsync( * *

    Sample code: */ - public final OperationCallable + public final OperationCallable failoverInstanceOperationCallable() { return stub.failoverInstanceOperationCallable(); } @@ -854,7 +850,7 @@ public final UnaryCallable failoverInstanceC * refers to a GCP region. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture deleteInstanceAsync(InstanceName name) { + public final OperationFuture deleteInstanceAsync(InstanceName name) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return deleteInstanceAsync(request); @@ -869,7 +865,7 @@ public final OperationFuture deleteInstanceAsync(Insta * refers to a GCP region. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture deleteInstanceAsync(String name) { + public final OperationFuture deleteInstanceAsync(String name) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); return deleteInstanceAsync(request); } @@ -881,8 +877,7 @@ public final OperationFuture deleteInstanceAsync(Strin * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture deleteInstanceAsync( - DeleteInstanceRequest request) { + public final OperationFuture deleteInstanceAsync(DeleteInstanceRequest request) { return deleteInstanceOperationCallable().futureCall(request); } @@ -892,7 +887,7 @@ public final OperationFuture deleteInstanceAsync( * *

    Sample code: */ - public final OperationCallable + public final OperationCallable deleteInstanceOperationCallable() { return stub.deleteInstanceOperationCallable(); } diff --git a/test/integration/goldens/redis/CloudRedisClientTest.java b/test/integration/goldens/redis/CloudRedisClientTest.java index 27908462f4..01190587e4 100644 --- a/test/integration/goldens/redis/CloudRedisClientTest.java +++ b/test/integration/goldens/redis/CloudRedisClientTest.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.google.cloud.redis.v1; +package com.google.cloud.redis.v1beta1; -import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse; +import static com.google.cloud.redis.v1beta1.CloudRedisClient.ListInstancesPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; diff --git a/test/integration/goldens/redis/CloudRedisSettings.java b/test/integration/goldens/redis/CloudRedisSettings.java index f13b069810..92e316bff4 100644 --- a/test/integration/goldens/redis/CloudRedisSettings.java +++ b/test/integration/goldens/redis/CloudRedisSettings.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.google.cloud.redis.v1; +package com.google.cloud.redis.v1beta1; -import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse; +import static com.google.cloud.redis.v1beta1.CloudRedisClient.ListInstancesPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; @@ -31,8 +31,9 @@ import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.redis.v1.stub.CloudRedisStubSettings; +import com.google.cloud.redis.v1beta1.stub.CloudRedisStubSettings; import com.google.longrunning.Operation; +import com.google.protobuf.Any; import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; @@ -69,6 +70,7 @@ * CloudRedisSettings cloudRedisSettings = cloudRedisSettingsBuilder.build(); * } */ +@BetaApi @Generated("by gapic-generator-java") public class CloudRedisSettings extends ClientSettings { @@ -89,7 +91,7 @@ public UnaryCallSettings createInstanceSetting } /** Returns the object with the settings used for calls to createInstance. */ - public OperationCallSettings + public OperationCallSettings createInstanceOperationSettings() { return ((CloudRedisStubSettings) getStubSettings()).createInstanceOperationSettings(); } @@ -100,7 +102,7 @@ public UnaryCallSettings updateInstanceSetting } /** Returns the object with the settings used for calls to updateInstance. */ - public OperationCallSettings + public OperationCallSettings updateInstanceOperationSettings() { return ((CloudRedisStubSettings) getStubSettings()).updateInstanceOperationSettings(); } @@ -111,7 +113,7 @@ public UnaryCallSettings upgradeInstanceSetti } /** Returns the object with the settings used for calls to upgradeInstance. */ - public OperationCallSettings + public OperationCallSettings upgradeInstanceOperationSettings() { return ((CloudRedisStubSettings) getStubSettings()).upgradeInstanceOperationSettings(); } @@ -122,7 +124,7 @@ public UnaryCallSettings importInstanceSetting } /** Returns the object with the settings used for calls to importInstance. */ - public OperationCallSettings + public OperationCallSettings importInstanceOperationSettings() { return ((CloudRedisStubSettings) getStubSettings()).importInstanceOperationSettings(); } @@ -133,7 +135,7 @@ public UnaryCallSettings exportInstanceSetting } /** Returns the object with the settings used for calls to exportInstance. */ - public OperationCallSettings + public OperationCallSettings exportInstanceOperationSettings() { return ((CloudRedisStubSettings) getStubSettings()).exportInstanceOperationSettings(); } @@ -144,7 +146,7 @@ public UnaryCallSettings failoverInstanceSet } /** Returns the object with the settings used for calls to failoverInstance. */ - public OperationCallSettings + public OperationCallSettings failoverInstanceOperationSettings() { return ((CloudRedisStubSettings) getStubSettings()).failoverInstanceOperationSettings(); } @@ -155,7 +157,7 @@ public UnaryCallSettings deleteInstanceSetting } /** Returns the object with the settings used for calls to deleteInstance. */ - public OperationCallSettings + public OperationCallSettings deleteInstanceOperationSettings() { return ((CloudRedisStubSettings) getStubSettings()).deleteInstanceOperationSettings(); } @@ -275,7 +277,7 @@ public UnaryCallSettings.Builder createInstanc } /** Returns the builder for the settings used for calls to createInstance. */ - public OperationCallSettings.Builder + public OperationCallSettings.Builder createInstanceOperationSettings() { return getStubSettingsBuilder().createInstanceOperationSettings(); } @@ -286,7 +288,7 @@ public UnaryCallSettings.Builder updateInstanc } /** Returns the builder for the settings used for calls to updateInstance. */ - public OperationCallSettings.Builder + public OperationCallSettings.Builder updateInstanceOperationSettings() { return getStubSettingsBuilder().updateInstanceOperationSettings(); } @@ -297,7 +299,7 @@ public UnaryCallSettings.Builder upgradeInsta } /** Returns the builder for the settings used for calls to upgradeInstance. */ - public OperationCallSettings.Builder + public OperationCallSettings.Builder upgradeInstanceOperationSettings() { return getStubSettingsBuilder().upgradeInstanceOperationSettings(); } @@ -308,7 +310,7 @@ public UnaryCallSettings.Builder importInstanc } /** Returns the builder for the settings used for calls to importInstance. */ - public OperationCallSettings.Builder + public OperationCallSettings.Builder importInstanceOperationSettings() { return getStubSettingsBuilder().importInstanceOperationSettings(); } @@ -319,7 +321,7 @@ public UnaryCallSettings.Builder exportInstanc } /** Returns the builder for the settings used for calls to exportInstance. */ - public OperationCallSettings.Builder + public OperationCallSettings.Builder exportInstanceOperationSettings() { return getStubSettingsBuilder().exportInstanceOperationSettings(); } @@ -331,7 +333,7 @@ public UnaryCallSettings.Builder exportInstanc } /** Returns the builder for the settings used for calls to failoverInstance. */ - public OperationCallSettings.Builder + public OperationCallSettings.Builder failoverInstanceOperationSettings() { return getStubSettingsBuilder().failoverInstanceOperationSettings(); } @@ -342,7 +344,7 @@ public UnaryCallSettings.Builder deleteInstanc } /** Returns the builder for the settings used for calls to deleteInstance. */ - public OperationCallSettings.Builder + public OperationCallSettings.Builder deleteInstanceOperationSettings() { return getStubSettingsBuilder().deleteInstanceOperationSettings(); } diff --git a/test/integration/goldens/redis/CloudRedisStub.java b/test/integration/goldens/redis/CloudRedisStub.java index cb83fee1eb..a3ecc3945d 100644 --- a/test/integration/goldens/redis/CloudRedisStub.java +++ b/test/integration/goldens/redis/CloudRedisStub.java @@ -14,27 +14,28 @@ * limitations under the License. */ -package com.google.cloud.redis.v1.stub; +package com.google.cloud.redis.v1beta1.stub; -import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse; +import static com.google.cloud.redis.v1beta1.CloudRedisClient.ListInstancesPagedResponse; +import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.redis.v1.CreateInstanceRequest; -import com.google.cloud.redis.v1.DeleteInstanceRequest; -import com.google.cloud.redis.v1.ExportInstanceRequest; -import com.google.cloud.redis.v1.FailoverInstanceRequest; -import com.google.cloud.redis.v1.GetInstanceRequest; -import com.google.cloud.redis.v1.ImportInstanceRequest; -import com.google.cloud.redis.v1.Instance; -import com.google.cloud.redis.v1.ListInstancesRequest; -import com.google.cloud.redis.v1.ListInstancesResponse; -import com.google.cloud.redis.v1.OperationMetadata; -import com.google.cloud.redis.v1.UpdateInstanceRequest; -import com.google.cloud.redis.v1.UpgradeInstanceRequest; +import com.google.cloud.redis.v1beta1.CreateInstanceRequest; +import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; +import com.google.cloud.redis.v1beta1.ExportInstanceRequest; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; +import com.google.cloud.redis.v1beta1.GetInstanceRequest; +import com.google.cloud.redis.v1beta1.ImportInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.ListInstancesRequest; +import com.google.cloud.redis.v1beta1.ListInstancesResponse; +import com.google.cloud.redis.v1beta1.UpdateInstanceRequest; +import com.google.cloud.redis.v1beta1.UpgradeInstanceRequest; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Any; import com.google.protobuf.Empty; import javax.annotation.Generated; @@ -44,7 +45,8 @@ * *

    This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public abstract class CloudRedisStub implements BackgroundResource { public OperationsStub getOperationsStub() { @@ -64,8 +66,7 @@ public UnaryCallable getInstanceCallable() { throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); } - public OperationCallable - createInstanceOperationCallable() { + public OperationCallable createInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: createInstanceOperationCallable()"); } @@ -73,8 +74,7 @@ public UnaryCallable createInstanceCallable() throw new UnsupportedOperationException("Not implemented: createInstanceCallable()"); } - public OperationCallable - updateInstanceOperationCallable() { + public OperationCallable updateInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: updateInstanceOperationCallable()"); } @@ -82,7 +82,7 @@ public UnaryCallable updateInstanceCallable() throw new UnsupportedOperationException("Not implemented: updateInstanceCallable()"); } - public OperationCallable + public OperationCallable upgradeInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: upgradeInstanceOperationCallable()"); } @@ -91,8 +91,7 @@ public UnaryCallable upgradeInstanceCallable( throw new UnsupportedOperationException("Not implemented: upgradeInstanceCallable()"); } - public OperationCallable - importInstanceOperationCallable() { + public OperationCallable importInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: importInstanceOperationCallable()"); } @@ -100,8 +99,7 @@ public UnaryCallable importInstanceCallable() throw new UnsupportedOperationException("Not implemented: importInstanceCallable()"); } - public OperationCallable - exportInstanceOperationCallable() { + public OperationCallable exportInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: exportInstanceOperationCallable()"); } @@ -109,7 +107,7 @@ public UnaryCallable exportInstanceCallable() throw new UnsupportedOperationException("Not implemented: exportInstanceCallable()"); } - public OperationCallable + public OperationCallable failoverInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: failoverInstanceOperationCallable()"); } @@ -118,8 +116,7 @@ public UnaryCallable failoverInstanceCallabl throw new UnsupportedOperationException("Not implemented: failoverInstanceCallable()"); } - public OperationCallable - deleteInstanceOperationCallable() { + public OperationCallable deleteInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: deleteInstanceOperationCallable()"); } diff --git a/test/integration/goldens/redis/CloudRedisStubSettings.java b/test/integration/goldens/redis/CloudRedisStubSettings.java index 85739cc9a1..f911e92382 100644 --- a/test/integration/goldens/redis/CloudRedisStubSettings.java +++ b/test/integration/goldens/redis/CloudRedisStubSettings.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.google.cloud.redis.v1.stub; +package com.google.cloud.redis.v1beta1.stub; -import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse; +import static com.google.cloud.redis.v1beta1.CloudRedisClient.ListInstancesPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; @@ -44,23 +44,23 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.redis.v1.CreateInstanceRequest; -import com.google.cloud.redis.v1.DeleteInstanceRequest; -import com.google.cloud.redis.v1.ExportInstanceRequest; -import com.google.cloud.redis.v1.FailoverInstanceRequest; -import com.google.cloud.redis.v1.GetInstanceRequest; -import com.google.cloud.redis.v1.ImportInstanceRequest; -import com.google.cloud.redis.v1.Instance; -import com.google.cloud.redis.v1.ListInstancesRequest; -import com.google.cloud.redis.v1.ListInstancesResponse; -import com.google.cloud.redis.v1.OperationMetadata; -import com.google.cloud.redis.v1.UpdateInstanceRequest; -import com.google.cloud.redis.v1.UpgradeInstanceRequest; +import com.google.cloud.redis.v1beta1.CreateInstanceRequest; +import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; +import com.google.cloud.redis.v1beta1.ExportInstanceRequest; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; +import com.google.cloud.redis.v1beta1.GetInstanceRequest; +import com.google.cloud.redis.v1beta1.ImportInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.ListInstancesRequest; +import com.google.cloud.redis.v1beta1.ListInstancesResponse; +import com.google.cloud.redis.v1beta1.UpdateInstanceRequest; +import com.google.cloud.redis.v1beta1.UpgradeInstanceRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.longrunning.Operation; +import com.google.protobuf.Any; import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; @@ -110,25 +110,25 @@ public class CloudRedisStubSettings extends StubSettings listInstancesSettings; private final UnaryCallSettings getInstanceSettings; private final UnaryCallSettings createInstanceSettings; - private final OperationCallSettings + private final OperationCallSettings createInstanceOperationSettings; private final UnaryCallSettings updateInstanceSettings; - private final OperationCallSettings + private final OperationCallSettings updateInstanceOperationSettings; private final UnaryCallSettings upgradeInstanceSettings; - private final OperationCallSettings + private final OperationCallSettings upgradeInstanceOperationSettings; private final UnaryCallSettings importInstanceSettings; - private final OperationCallSettings + private final OperationCallSettings importInstanceOperationSettings; private final UnaryCallSettings exportInstanceSettings; - private final OperationCallSettings + private final OperationCallSettings exportInstanceOperationSettings; private final UnaryCallSettings failoverInstanceSettings; - private final OperationCallSettings + private final OperationCallSettings failoverInstanceOperationSettings; private final UnaryCallSettings deleteInstanceSettings; - private final OperationCallSettings + private final OperationCallSettings deleteInstanceOperationSettings; private static final PagedListDescriptor @@ -201,7 +201,7 @@ public UnaryCallSettings createInstanceSetting } /** Returns the object with the settings used for calls to createInstance. */ - public OperationCallSettings + public OperationCallSettings createInstanceOperationSettings() { return createInstanceOperationSettings; } @@ -212,7 +212,7 @@ public UnaryCallSettings updateInstanceSetting } /** Returns the object with the settings used for calls to updateInstance. */ - public OperationCallSettings + public OperationCallSettings updateInstanceOperationSettings() { return updateInstanceOperationSettings; } @@ -223,7 +223,7 @@ public UnaryCallSettings upgradeInstanceSetti } /** Returns the object with the settings used for calls to upgradeInstance. */ - public OperationCallSettings + public OperationCallSettings upgradeInstanceOperationSettings() { return upgradeInstanceOperationSettings; } @@ -234,7 +234,7 @@ public UnaryCallSettings importInstanceSetting } /** Returns the object with the settings used for calls to importInstance. */ - public OperationCallSettings + public OperationCallSettings importInstanceOperationSettings() { return importInstanceOperationSettings; } @@ -245,7 +245,7 @@ public UnaryCallSettings exportInstanceSetting } /** Returns the object with the settings used for calls to exportInstance. */ - public OperationCallSettings + public OperationCallSettings exportInstanceOperationSettings() { return exportInstanceOperationSettings; } @@ -256,7 +256,7 @@ public UnaryCallSettings failoverInstanceSet } /** Returns the object with the settings used for calls to failoverInstance. */ - public OperationCallSettings + public OperationCallSettings failoverInstanceOperationSettings() { return failoverInstanceOperationSettings; } @@ -267,7 +267,7 @@ public UnaryCallSettings deleteInstanceSetting } /** Returns the object with the settings used for calls to deleteInstance. */ - public OperationCallSettings + public OperationCallSettings deleteInstanceOperationSettings() { return deleteInstanceOperationSettings; } @@ -368,32 +368,31 @@ public static class Builder extends StubSettings.Builder getInstanceSettings; private final UnaryCallSettings.Builder createInstanceSettings; - private final OperationCallSettings.Builder + private final OperationCallSettings.Builder createInstanceOperationSettings; private final UnaryCallSettings.Builder updateInstanceSettings; - private final OperationCallSettings.Builder + private final OperationCallSettings.Builder updateInstanceOperationSettings; private final UnaryCallSettings.Builder upgradeInstanceSettings; - private final OperationCallSettings.Builder + private final OperationCallSettings.Builder upgradeInstanceOperationSettings; private final UnaryCallSettings.Builder importInstanceSettings; - private final OperationCallSettings.Builder + private final OperationCallSettings.Builder importInstanceOperationSettings; private final UnaryCallSettings.Builder exportInstanceSettings; - private final OperationCallSettings.Builder + private final OperationCallSettings.Builder exportInstanceOperationSettings; private final UnaryCallSettings.Builder failoverInstanceSettings; - private final OperationCallSettings.Builder< - FailoverInstanceRequest, Instance, OperationMetadata> + private final OperationCallSettings.Builder failoverInstanceOperationSettings; private final UnaryCallSettings.Builder deleteInstanceSettings; - private final OperationCallSettings.Builder + private final OperationCallSettings.Builder deleteInstanceOperationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -560,8 +559,7 @@ private static Builder initDefaults(Builder builder) { .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() @@ -571,7 +569,7 @@ private static Builder initDefaults(Builder builder) { .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(7200000L)) + .setTotalTimeout(Duration.ofMillis(1200000L)) .build())); builder @@ -584,8 +582,7 @@ private static Builder initDefaults(Builder builder) { .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() @@ -608,8 +605,7 @@ private static Builder initDefaults(Builder builder) { .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() @@ -632,8 +628,7 @@ private static Builder initDefaults(Builder builder) { .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() @@ -656,8 +651,7 @@ private static Builder initDefaults(Builder builder) { .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() @@ -680,8 +674,7 @@ private static Builder initDefaults(Builder builder) { .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() @@ -704,8 +697,7 @@ private static Builder initDefaults(Builder builder) { .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() @@ -757,7 +749,7 @@ public UnaryCallSettings.Builder createInstanc /** Returns the builder for the settings used for calls to createInstance. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder + public OperationCallSettings.Builder createInstanceOperationSettings() { return createInstanceOperationSettings; } @@ -770,7 +762,7 @@ public UnaryCallSettings.Builder updateInstanc /** Returns the builder for the settings used for calls to updateInstance. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder + public OperationCallSettings.Builder updateInstanceOperationSettings() { return updateInstanceOperationSettings; } @@ -783,7 +775,7 @@ public UnaryCallSettings.Builder upgradeInsta /** Returns the builder for the settings used for calls to upgradeInstance. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder + public OperationCallSettings.Builder upgradeInstanceOperationSettings() { return upgradeInstanceOperationSettings; } @@ -796,7 +788,7 @@ public UnaryCallSettings.Builder importInstanc /** Returns the builder for the settings used for calls to importInstance. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder + public OperationCallSettings.Builder importInstanceOperationSettings() { return importInstanceOperationSettings; } @@ -809,7 +801,7 @@ public UnaryCallSettings.Builder exportInstanc /** Returns the builder for the settings used for calls to exportInstance. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder + public OperationCallSettings.Builder exportInstanceOperationSettings() { return exportInstanceOperationSettings; } @@ -823,7 +815,7 @@ public UnaryCallSettings.Builder exportInstanc /** Returns the builder for the settings used for calls to failoverInstance. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder + public OperationCallSettings.Builder failoverInstanceOperationSettings() { return failoverInstanceOperationSettings; } @@ -836,7 +828,7 @@ public UnaryCallSettings.Builder deleteInstanc /** Returns the builder for the settings used for calls to deleteInstance. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder + public OperationCallSettings.Builder deleteInstanceOperationSettings() { return deleteInstanceOperationSettings; } diff --git a/test/integration/goldens/redis/GrpcCloudRedisCallableFactory.java b/test/integration/goldens/redis/GrpcCloudRedisCallableFactory.java index 7631c208ea..411e4955de 100644 --- a/test/integration/goldens/redis/GrpcCloudRedisCallableFactory.java +++ b/test/integration/goldens/redis/GrpcCloudRedisCallableFactory.java @@ -14,8 +14,9 @@ * limitations under the License. */ -package com.google.cloud.redis.v1.stub; +package com.google.cloud.redis.v1beta1.stub; +import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -41,7 +42,8 @@ * *

    This class is for advanced usage. */ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class GrpcCloudRedisCallableFactory implements GrpcStubCallableFactory { @Override diff --git a/test/integration/goldens/redis/GrpcCloudRedisStub.java b/test/integration/goldens/redis/GrpcCloudRedisStub.java index 474cc567de..416417d996 100644 --- a/test/integration/goldens/redis/GrpcCloudRedisStub.java +++ b/test/integration/goldens/redis/GrpcCloudRedisStub.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package com.google.cloud.redis.v1.stub; +package com.google.cloud.redis.v1beta1.stub; -import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse; +import static com.google.cloud.redis.v1beta1.CloudRedisClient.ListInstancesPagedResponse; +import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -26,21 +27,21 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.redis.v1.CreateInstanceRequest; -import com.google.cloud.redis.v1.DeleteInstanceRequest; -import com.google.cloud.redis.v1.ExportInstanceRequest; -import com.google.cloud.redis.v1.FailoverInstanceRequest; -import com.google.cloud.redis.v1.GetInstanceRequest; -import com.google.cloud.redis.v1.ImportInstanceRequest; -import com.google.cloud.redis.v1.Instance; -import com.google.cloud.redis.v1.ListInstancesRequest; -import com.google.cloud.redis.v1.ListInstancesResponse; -import com.google.cloud.redis.v1.OperationMetadata; -import com.google.cloud.redis.v1.UpdateInstanceRequest; -import com.google.cloud.redis.v1.UpgradeInstanceRequest; +import com.google.cloud.redis.v1beta1.CreateInstanceRequest; +import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; +import com.google.cloud.redis.v1beta1.ExportInstanceRequest; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; +import com.google.cloud.redis.v1beta1.GetInstanceRequest; +import com.google.cloud.redis.v1beta1.ImportInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.ListInstancesRequest; +import com.google.cloud.redis.v1beta1.ListInstancesResponse; +import com.google.cloud.redis.v1beta1.UpdateInstanceRequest; +import com.google.cloud.redis.v1beta1.UpgradeInstanceRequest; import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Any; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -55,13 +56,14 @@ * *

    This class is for advanced usage and reflects the underlying API directly. */ +@BetaApi @Generated("by gapic-generator-java") public class GrpcCloudRedisStub extends CloudRedisStub { private static final MethodDescriptor listInstancesMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.redis.v1.CloudRedis/ListInstances") + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/ListInstances") .setRequestMarshaller( ProtoUtils.marshaller(ListInstancesRequest.getDefaultInstance())) .setResponseMarshaller( @@ -71,7 +73,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { private static final MethodDescriptor getInstanceMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.redis.v1.CloudRedis/GetInstance") + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/GetInstance") .setRequestMarshaller(ProtoUtils.marshaller(GetInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) .build(); @@ -80,7 +82,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { createInstanceMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.redis.v1.CloudRedis/CreateInstance") + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/CreateInstance") .setRequestMarshaller( ProtoUtils.marshaller(CreateInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) @@ -90,7 +92,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { updateInstanceMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.redis.v1.CloudRedis/UpdateInstance") + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/UpdateInstance") .setRequestMarshaller( ProtoUtils.marshaller(UpdateInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) @@ -100,7 +102,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { upgradeInstanceMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.redis.v1.CloudRedis/UpgradeInstance") + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/UpgradeInstance") .setRequestMarshaller( ProtoUtils.marshaller(UpgradeInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) @@ -110,7 +112,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { importInstanceMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.redis.v1.CloudRedis/ImportInstance") + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/ImportInstance") .setRequestMarshaller( ProtoUtils.marshaller(ImportInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) @@ -120,7 +122,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { exportInstanceMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.redis.v1.CloudRedis/ExportInstance") + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/ExportInstance") .setRequestMarshaller( ProtoUtils.marshaller(ExportInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) @@ -130,7 +132,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { failoverInstanceMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.redis.v1.CloudRedis/FailoverInstance") + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/FailoverInstance") .setRequestMarshaller( ProtoUtils.marshaller(FailoverInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) @@ -140,7 +142,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { deleteInstanceMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.redis.v1.CloudRedis/DeleteInstance") + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/DeleteInstance") .setRequestMarshaller( ProtoUtils.marshaller(DeleteInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) @@ -151,25 +153,25 @@ public class GrpcCloudRedisStub extends CloudRedisStub { listInstancesPagedCallable; private final UnaryCallable getInstanceCallable; private final UnaryCallable createInstanceCallable; - private final OperationCallable + private final OperationCallable createInstanceOperationCallable; private final UnaryCallable updateInstanceCallable; - private final OperationCallable + private final OperationCallable updateInstanceOperationCallable; private final UnaryCallable upgradeInstanceCallable; - private final OperationCallable + private final OperationCallable upgradeInstanceOperationCallable; private final UnaryCallable importInstanceCallable; - private final OperationCallable + private final OperationCallable importInstanceOperationCallable; private final UnaryCallable exportInstanceCallable; - private final OperationCallable + private final OperationCallable exportInstanceOperationCallable; private final UnaryCallable failoverInstanceCallable; - private final OperationCallable + private final OperationCallable failoverInstanceOperationCallable; private final UnaryCallable deleteInstanceCallable; - private final OperationCallable + private final OperationCallable deleteInstanceOperationCallable; private final BackgroundResource backgroundResources; @@ -430,8 +432,7 @@ public UnaryCallable createInstanceCallable() return createInstanceCallable; } - public OperationCallable - createInstanceOperationCallable() { + public OperationCallable createInstanceOperationCallable() { return createInstanceOperationCallable; } @@ -439,8 +440,7 @@ public UnaryCallable updateInstanceCallable() return updateInstanceCallable; } - public OperationCallable - updateInstanceOperationCallable() { + public OperationCallable updateInstanceOperationCallable() { return updateInstanceOperationCallable; } @@ -448,7 +448,7 @@ public UnaryCallable upgradeInstanceCallable( return upgradeInstanceCallable; } - public OperationCallable + public OperationCallable upgradeInstanceOperationCallable() { return upgradeInstanceOperationCallable; } @@ -457,8 +457,7 @@ public UnaryCallable importInstanceCallable() return importInstanceCallable; } - public OperationCallable - importInstanceOperationCallable() { + public OperationCallable importInstanceOperationCallable() { return importInstanceOperationCallable; } @@ -466,8 +465,7 @@ public UnaryCallable exportInstanceCallable() return exportInstanceCallable; } - public OperationCallable - exportInstanceOperationCallable() { + public OperationCallable exportInstanceOperationCallable() { return exportInstanceOperationCallable; } @@ -475,7 +473,7 @@ public UnaryCallable failoverInstanceCallabl return failoverInstanceCallable; } - public OperationCallable + public OperationCallable failoverInstanceOperationCallable() { return failoverInstanceOperationCallable; } @@ -484,8 +482,7 @@ public UnaryCallable deleteInstanceCallable() return deleteInstanceCallable; } - public OperationCallable - deleteInstanceOperationCallable() { + public OperationCallable deleteInstanceOperationCallable() { return deleteInstanceOperationCallable; } diff --git a/test/integration/goldens/redis/InstanceName.java b/test/integration/goldens/redis/InstanceName.java index d3613b41c2..610c994619 100644 --- a/test/integration/goldens/redis/InstanceName.java +++ b/test/integration/goldens/redis/InstanceName.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.cloud.redis.v1; +package com.google.cloud.redis.v1beta1; import com.google.api.pathtemplate.PathTemplate; import com.google.api.resourcenames.ResourceName; diff --git a/test/integration/goldens/redis/LocationName.java b/test/integration/goldens/redis/LocationName.java index 966cb332b5..e4ff950ac5 100644 --- a/test/integration/goldens/redis/LocationName.java +++ b/test/integration/goldens/redis/LocationName.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.cloud.redis.v1; +package com.google.cloud.redis.v1beta1; import com.google.api.pathtemplate.PathTemplate; import com.google.api.resourcenames.ResourceName; diff --git a/test/integration/goldens/redis/MockCloudRedis.java b/test/integration/goldens/redis/MockCloudRedis.java index acbf9c33d0..00b4a0316e 100644 --- a/test/integration/goldens/redis/MockCloudRedis.java +++ b/test/integration/goldens/redis/MockCloudRedis.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.cloud.redis.v1; +package com.google.cloud.redis.v1beta1; import com.google.api.core.BetaApi; import com.google.api.gax.grpc.testing.MockGrpcService; diff --git a/test/integration/goldens/redis/MockCloudRedisImpl.java b/test/integration/goldens/redis/MockCloudRedisImpl.java index 434f9d3f57..953045dea1 100644 --- a/test/integration/goldens/redis/MockCloudRedisImpl.java +++ b/test/integration/goldens/redis/MockCloudRedisImpl.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package com.google.cloud.redis.v1; +package com.google.cloud.redis.v1beta1; import com.google.api.core.BetaApi; -import com.google.cloud.redis.v1.CloudRedisGrpc.CloudRedisImplBase; +import com.google.cloud.redis.v1beta1.CloudRedisGrpc.CloudRedisImplBase; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import io.grpc.stub.StreamObserver; diff --git a/test/integration/goldens/redis/package-info.java b/test/integration/goldens/redis/package-info.java index 3ed9ea15f2..34ceb21ccf 100644 --- a/test/integration/goldens/redis/package-info.java +++ b/test/integration/goldens/redis/package-info.java @@ -21,7 +21,7 @@ * *

    Service Description: Configures and manages Cloud Memorystore for Redis instances * - *

    Google Cloud Memorystore for Redis v1 + *

    Google Cloud Memorystore for Redis v1beta1 * *

    The `redis.googleapis.com` service implements the Google Cloud Memorystore for Redis API and * defines the following resource model for managing Redis instances: @@ -34,7 +34,7 @@ * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` *

* - *

Note that location_id must be referring to a GCP `region`; for example: + *

Note that location_id must be refering to a GCP `region`; for example: * *

    *
  • `projects/redpepper-1290/locations/us-central1/instances/my-redis` @@ -43,6 +43,6 @@ *

    Sample for CloudRedisClient: */ @Generated("by gapic-generator-java") -package com.google.cloud.redis.v1; +package com.google.cloud.redis.v1beta1; import javax.annotation.Generated;