Skip to content

Commit fc18449

Browse files
authored
chore: remove beta client LRO (#2497)
Fixes #2103 ☕️
1 parent 49e4eb0 commit fc18449

File tree

29 files changed

+3
-132
lines changed

29 files changed

+3
-132
lines changed

gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientClassComposer.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -839,13 +839,6 @@ private static MethodDefinition createMethodDefaultMethod(
839839
.copyAndSetGenerics(
840840
Arrays.asList(
841841
lro.responseType().reference(), lro.metadataType().reference())));
842-
if (method.lro().operationServiceStubType() != null) {
843-
annotations.add(
844-
AnnotationNode.withTypeAndDescription(
845-
typeStore.get("BetaApi"),
846-
"The surface for long-running operations is not stable yet and may change in the"
847-
+ " future."));
848-
}
849842
}
850843

851844
// Construct the method that accepts a request proto.

gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubClassComposer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ private List<MethodDefinition> createLongRunningClientGetters(TypeStore typeStor
235235
createCallableGetterMethodDefinition(
236236
TypeNode.withReference(ConcreteReference.withClazz(LongRunningClient.class)),
237237
"longRunningClient",
238-
ImmutableList.of(AnnotationNode.withType(typeStore.get("BetaApi"))),
238+
Collections.emptyList(),
239239
typeStore));
240240
}
241241

gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,27 +2023,14 @@ private static List<MethodDefinition> createNestedClassSettingsBuilderGetterMeth
20232023
t.reference()
20242024
.copyAndSetGenerics(ImmutableList.of())
20252025
.equals(operationCallSettingsBuilderRef);
2026-
AnnotationNode lroBetaAnnotation =
2027-
AnnotationNode.builder()
2028-
.setType(FIXED_TYPESTORE.get("BetaApi"))
2029-
.setDescription(
2030-
"The surface for use by generated code is not stable yet and may change in the"
2031-
+ " future.")
2032-
.build();
20332026
AnnotationNode deprecatedAnnotation = AnnotationNode.withType(TypeNode.DEPRECATED);
20342027

20352028
List<MethodDefinition> javaMethods = new ArrayList<>();
20362029
for (Map.Entry<String, VariableExpr> settingsVarEntry :
20372030
nestedMethodSettingsMemberVarExprs.entrySet()) {
20382031
String varName = settingsVarEntry.getKey();
20392032
VariableExpr settingsVarExpr = settingsVarEntry.getValue();
2040-
boolean isOperationCallSettings =
2041-
isOperationCallSettingsBuilderFn.apply(settingsVarExpr.type());
2042-
20432033
List<AnnotationNode> annotations = new ArrayList<>();
2044-
if (isOperationCallSettings) {
2045-
annotations.add(lroBetaAnnotation);
2046-
}
20472034

20482035
boolean isDeprecated = nestedDeprecatedSettingVarNames.contains(varName);
20492036
if (isDeprecated) {

gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposer.java

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
1919
import com.google.api.gax.rpc.OperationCallable;
2020
import com.google.api.gax.rpc.UnaryCallable;
21-
import com.google.api.generator.engine.ast.AnnotationNode;
2221
import com.google.api.generator.engine.ast.AssignmentExpr;
2322
import com.google.api.generator.engine.ast.ConcreteReference;
2423
import com.google.api.generator.engine.ast.ExprStatement;
@@ -36,6 +35,7 @@
3635
import com.google.longrunning.Operation;
3736
import java.util.ArrayList;
3837
import java.util.Arrays;
38+
import java.util.Collections;
3939
import java.util.List;
4040
import java.util.stream.Collectors;
4141

@@ -55,20 +55,6 @@ public static HttpJsonServiceCallableFactoryClassComposer instance() {
5555
return INSTANCE;
5656
}
5757

58-
@Override
59-
protected List<AnnotationNode> createClassAnnotations(Service service, TypeStore typeStore) {
60-
List<AnnotationNode> annotations = super.createClassAnnotations(service, typeStore);
61-
// Always add @BetaApi annotation to the generated CallableFactory for now. It is a public class
62-
// for technical reasons, end users are not expected to interact with it, but it may change
63-
// when we add LRO support, that is why making it @BetaApi for now.
64-
//
65-
// Remove the @BetaApi annotation once the LRO feature is fully implemented and stabilized.
66-
if (annotations.stream().noneMatch(a -> a.type().equals(typeStore.get("BetaApi")))) {
67-
annotations.add(AnnotationNode.withType(typeStore.get("BetaApi")));
68-
}
69-
return annotations;
70-
}
71-
7258
@Override
7359
protected List<TypeNode> createClassImplements(Service service, TypeStore typeStore) {
7460
TypeNode operationsStubType = getOperationsStubType(service);
@@ -104,16 +90,6 @@ protected MethodDefinition createOperationCallableMethod(Service service, TypeSt
10490
List<String> methodTemplateNames =
10591
Arrays.asList(requestTemplateName, responseTemplateName, "MetadataT");
10692

107-
// Always add @BetaApi annotation to the generated createOperationCallable() method for now,
108-
// until LRO is fully implemented.
109-
//
110-
// Remove the @BetaApi annotation once the LRO feature is fully implemented and stabilized.
111-
AnnotationNode betaAnnotation =
112-
AnnotationNode.withTypeAndDescription(
113-
typeStore.get("BetaApi"),
114-
"The surface for long-running operations is not stable yet and may change in the"
115-
+ " future.");
116-
11793
// Generate generic method without the body
11894
TypeNode operationType = service.operationType();
11995
if (operationType == null) {
@@ -133,7 +109,7 @@ protected MethodDefinition createOperationCallableMethod(Service service, TypeSt
133109
/*callSettingsTemplateObjects=*/ methodTemplateNames.stream()
134110
.map(n -> (Object) n)
135111
.collect(Collectors.toList()),
136-
Arrays.asList(betaAnnotation));
112+
Collections.emptyList());
137113

138114
List<Statement> createOperationCallableBody = new ArrayList<>();
139115
List<VariableExpr> arguments = new ArrayList<>(method.arguments());

gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,6 @@ public class EchoStubSettings extends StubSettings<EchoStubSettings> {
620620
}
621621

622622
/** Returns the builder for the settings used for calls to wait. */
623-
@BetaApi(
624-
"The surface for use by generated code is not stable yet and may change in the future.")
625623
public OperationCallSettings.Builder<WaitRequest, WaitResponse, WaitMetadata>
626624
waitOperationSettings() {
627625
return waitOperationSettings;

gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,6 @@ public class EchoStubSettings extends StubSettings<EchoStubSettings> {
659659
}
660660

661661
/** Returns the builder for the settings used for calls to wait. */
662-
@BetaApi(
663-
"The surface for use by generated code is not stable yet and may change in the future.")
664662
public OperationCallSettings.Builder<WaitRequest, WaitResponse, WaitMetadata>
665663
waitOperationSettings() {
666664
return waitOperationSettings;

gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/HttpJsonEchoCallableFactory.golden

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ public class HttpJsonEchoCallableFactory
5757
httpJsonCallSettings, callSettings, clientContext);
5858
}
5959

60-
@BetaApi(
61-
"The surface for long-running operations is not stable yet and may change in the future.")
6260
@Override
6361
public <RequestT, ResponseT, MetadataT>
6462
OperationCallable<RequestT, ResponseT, MetadataT> createOperationCallable(

gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonComplianceCallableFactory.golden

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ public class HttpJsonComplianceCallableFactory
5757
httpJsonCallSettings, callSettings, clientContext);
5858
}
5959

60-
@BetaApi(
61-
"The surface for long-running operations is not stable yet and may change in the future.")
6260
@Override
6361
public <RequestT, ResponseT, MetadataT>
6462
OperationCallable<RequestT, ResponseT, MetadataT> createOperationCallable(

showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,8 +882,6 @@ public UnaryCallSettings.Builder<WaitRequest, Operation> waitSettings() {
882882
}
883883

884884
/** Returns the builder for the settings used for calls to wait. */
885-
@BetaApi(
886-
"The surface for use by generated code is not stable yet and may change in the future.")
887885
public OperationCallSettings.Builder<WaitRequest, WaitResponse, WaitMetadata>
888886
waitOperationSettings() {
889887
return waitOperationSettings;

showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCa
7373
httpJsonCallSettings, callSettings, clientContext);
7474
}
7575

76-
@BetaApi(
77-
"The surface for long-running operations is not stable yet and may change in the future.")
7876
@Override
7977
public <RequestT, ResponseT, MetadataT>
8078
OperationCallable<RequestT, ResponseT, MetadataT> createOperationCallable(

0 commit comments

Comments
 (0)