Skip to content

Commit 6d154fe

Browse files
JoeWang1127lqiu96
authored andcommitted
chore: remove beta client LRO (#2497)
Fixes #2103 ☕️
1 parent 920f681 commit 6d154fe

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

-7
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

+1-1
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

-13
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

+2-26
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

-2
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

-2
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

-2
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

-2
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

-2
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

-2
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(

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

-2
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(

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

-2
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(

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

-2
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(

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

-2
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(

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

-2
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(

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

-2
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,6 @@ public UnaryCallSettings.Builder<SearchBlurbsRequest, Operation> searchBlurbsSet
943943
}
944944

945945
/** Returns the builder for the settings used for calls to searchBlurbs. */
946-
@BetaApi(
947-
"The surface for use by generated code is not stable yet and may change in the future.")
948946
public OperationCallSettings.Builder<
949947
SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata>
950948
searchBlurbsOperationSettings() {

test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/HttpJsonConnectionServiceCallableFactory.java

-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.cloud.apigeeconnect.v1.stub;
1818

19-
import com.google.api.core.BetaApi;
2019
import com.google.api.gax.httpjson.HttpJsonCallSettings;
2120
import com.google.api.gax.httpjson.HttpJsonCallableFactory;
2221
import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
@@ -41,7 +40,6 @@
4140
* <p>This class is for advanced usage.
4241
*/
4342
@Generated("by gapic-generator-java")
44-
@BetaApi
4543
public class HttpJsonConnectionServiceCallableFactory
4644
implements HttpJsonStubCallableFactory<Operation, OperationsStub> {
4745

@@ -73,8 +71,6 @@ public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCa
7371
httpJsonCallSettings, callSettings, clientContext);
7472
}
7573

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

test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java

-4
Original file line numberDiff line numberDiff line change
@@ -1164,8 +1164,6 @@ public UnaryCallSettings.Builder<ExportAssetsRequest, Operation> exportAssetsSet
11641164
}
11651165

11661166
/** Returns the builder for the settings used for calls to exportAssets. */
1167-
@BetaApi(
1168-
"The surface for use by generated code is not stable yet and may change in the future.")
11691167
public OperationCallSettings.Builder<
11701168
ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest>
11711169
exportAssetsOperationSettings() {
@@ -1238,8 +1236,6 @@ public UnaryCallSettings.Builder<DeleteFeedRequest, Empty> deleteFeedSettings()
12381236
}
12391237

12401238
/** Returns the builder for the settings used for calls to analyzeIamPolicyLongrunning. */
1241-
@BetaApi(
1242-
"The surface for use by generated code is not stable yet and may change in the future.")
12431239
public OperationCallSettings.Builder<
12441240
AnalyzeIamPolicyLongrunningRequest,
12451241
AnalyzeIamPolicyLongrunningResponse,

test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/HttpJsonAssetServiceCallableFactory.java

-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.cloud.asset.v1.stub;
1818

19-
import com.google.api.core.BetaApi;
2019
import com.google.api.gax.httpjson.HttpJsonCallSettings;
2120
import com.google.api.gax.httpjson.HttpJsonCallableFactory;
2221
import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
@@ -41,7 +40,6 @@
4140
* <p>This class is for advanced usage.
4241
*/
4342
@Generated("by gapic-generator-java")
44-
@BetaApi
4543
public class HttpJsonAssetServiceCallableFactory
4644
implements HttpJsonStubCallableFactory<Operation, OperationsStub> {
4745

@@ -73,8 +71,6 @@ public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCa
7371
httpJsonCallSettings, callSettings, clientContext);
7472
}
7573

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

test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClient.java

-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import com.google.api.core.ApiFuture;
2020
import com.google.api.core.ApiFutures;
21-
import com.google.api.core.BetaApi;
2221
import com.google.api.gax.core.BackgroundResource;
2322
import com.google.api.gax.longrunning.OperationFuture;
2423
import com.google.api.gax.paging.AbstractFixedSizeCollection;
@@ -442,8 +441,6 @@ public final OperationFuture<Operation, Operation> deleteAsync(
442441
* @param request The request object containing all of the parameters for the API call.
443442
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
444443
*/
445-
@BetaApi(
446-
"The surface for long-running operations is not stable yet and may change in the future.")
447444
public final OperationFuture<Operation, Operation> deleteAsync(DeleteAddressRequest request) {
448445
return deleteOperationCallable().futureCall(request);
449446
}
@@ -573,8 +570,6 @@ public final OperationFuture<Operation, Operation> insertAsync(
573570
* @param request The request object containing all of the parameters for the API call.
574571
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
575572
*/
576-
@BetaApi(
577-
"The surface for long-running operations is not stable yet and may change in the future.")
578573
public final OperationFuture<Operation, Operation> insertAsync(InsertAddressRequest request) {
579574
return insertOperationCallable().futureCall(request);
580575
}

test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java

-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import com.google.api.core.ApiFunction;
2323
import com.google.api.core.ApiFuture;
24-
import com.google.api.core.BetaApi;
2524
import com.google.api.gax.core.GaxProperties;
2625
import com.google.api.gax.core.GoogleCredentialsProvider;
2726
import com.google.api.gax.core.InstantiatingExecutorProvider;
@@ -579,8 +578,6 @@ public UnaryCallSettings.Builder<DeleteAddressRequest, Operation> deleteSettings
579578
}
580579

581580
/** Returns the builder for the settings used for calls to delete. */
582-
@BetaApi(
583-
"The surface for use by generated code is not stable yet and may change in the future.")
584581
public OperationCallSettings.Builder<DeleteAddressRequest, Operation, Operation>
585582
deleteOperationSettings() {
586583
return deleteOperationSettings;
@@ -592,8 +589,6 @@ public UnaryCallSettings.Builder<InsertAddressRequest, Operation> insertSettings
592589
}
593590

594591
/** Returns the builder for the settings used for calls to insert. */
595-
@BetaApi(
596-
"The surface for use by generated code is not stable yet and may change in the future.")
597592
public OperationCallSettings.Builder<InsertAddressRequest, Operation, Operation>
598593
insertOperationSettings() {
599594
return insertOperationSettings;

test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesCallableFactory.java

-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.cloud.compute.v1small.stub;
1818

19-
import com.google.api.core.BetaApi;
2019
import com.google.api.gax.httpjson.HttpJsonCallSettings;
2120
import com.google.api.gax.httpjson.HttpJsonCallableFactory;
2221
import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
@@ -40,7 +39,6 @@
4039
* <p>This class is for advanced usage.
4140
*/
4241
@Generated("by gapic-generator-java")
43-
@BetaApi
4442
public class HttpJsonAddressesCallableFactory
4543
implements HttpJsonStubCallableFactory<Operation, RegionOperationsStub> {
4644

@@ -72,8 +70,6 @@ public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCa
7270
httpJsonCallSettings, callSettings, clientContext);
7371
}
7472

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

test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsCallableFactory.java

-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.cloud.compute.v1small.stub;
1818

19-
import com.google.api.core.BetaApi;
2019
import com.google.api.gax.httpjson.HttpJsonCallSettings;
2120
import com.google.api.gax.httpjson.HttpJsonCallableFactory;
2221
import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
@@ -41,7 +40,6 @@
4140
* <p>This class is for advanced usage.
4241
*/
4342
@Generated("by gapic-generator-java")
44-
@BetaApi
4543
public class HttpJsonRegionOperationsCallableFactory
4644
implements HttpJsonStubCallableFactory<Operation, OperationsStub> {
4745

@@ -73,8 +71,6 @@ public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCa
7371
httpJsonCallSettings, callSettings, clientContext);
7472
}
7573

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

0 commit comments

Comments
 (0)