From 5be66cd3ebf2ccf34f21db40463a2d9115a77798 Mon Sep 17 00:00:00 2001 From: Mira Leung Date: Tue, 2 Feb 2021 11:55:02 -0800 Subject: [PATCH] fix(operations): Make Operations a manual client [gax-java] (#1282) * fix(operations): Make Operations a manual client * fix: remove autogen annotations from tests * fix: remove client and settings classes' beta annotations * fix: apply googleJavaFormat --- .../google/longrunning/OperationsClient.java | 17 ----------------- .../google/longrunning/OperationsSettings.java | 4 ---- .../stub/GrpcOperationsCallableFactory.java | 3 --- .../longrunning/stub/GrpcOperationsStub.java | 3 --- .../google/longrunning/stub/OperationsStub.java | 3 --- .../stub/OperationsStubSettings.java | 3 --- .../longrunning/OperationsClientTest.java | 1 - 7 files changed, 34 deletions(-) diff --git a/gax-grpc/src/main/java/com/google/longrunning/OperationsClient.java b/gax-grpc/src/main/java/com/google/longrunning/OperationsClient.java index 9d0888136..c1b826e78 100644 --- a/gax-grpc/src/main/java/com/google/longrunning/OperationsClient.java +++ b/gax-grpc/src/main/java/com/google/longrunning/OperationsClient.java @@ -47,9 +47,7 @@ import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE /** * Service Description: Manages long-running operations with an API service. * @@ -111,8 +109,6 @@ * * */ -@Generated("by GAPIC v0.0.5") -@BetaApi public class OperationsClient implements BackgroundResource { private final OperationsSettings settings; private final OperationsStub stub; @@ -158,7 +154,6 @@ public OperationsStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets the latest state of a long-running operation. Clients can use this method to poll the * operation result at intervals as recommended by the API service. @@ -181,7 +176,6 @@ public final Operation getOperation(String name) { return getOperation(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets the latest state of a long-running operation. Clients can use this method to poll the * operation result at intervals as recommended by the API service. @@ -205,7 +199,6 @@ private final Operation getOperation(GetOperationRequest request) { return getOperationCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets the latest state of a long-running operation. Clients can use this method to poll the * operation result at intervals as recommended by the API service. @@ -228,7 +221,6 @@ public final UnaryCallable getOperationCallable( return stub.getOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists operations that match the specified filter in the request. If the server doesn't support * this method, it returns `UNIMPLEMENTED`. @@ -258,7 +250,6 @@ public final ListOperationsPagedResponse listOperations(String name, String filt return listOperations(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists operations that match the specified filter in the request. If the server doesn't support * this method, it returns `UNIMPLEMENTED`. @@ -289,7 +280,6 @@ public final ListOperationsPagedResponse listOperations(ListOperationsRequest re return listOperationsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists operations that match the specified filter in the request. If the server doesn't support * this method, it returns `UNIMPLEMENTED`. @@ -320,7 +310,6 @@ public final ListOperationsPagedResponse listOperations(ListOperationsRequest re return stub.listOperationsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists operations that match the specified filter in the request. If the server doesn't support * this method, it returns `UNIMPLEMENTED`. @@ -358,7 +347,6 @@ public final ListOperationsPagedResponse listOperations(ListOperationsRequest re return stub.listOperationsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to * cancel the operation, but success is not guaranteed. If the server doesn't support this method, @@ -387,7 +375,6 @@ public final void cancelOperation(String name) { cancelOperation(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to * cancel the operation, but success is not guaranteed. If the server doesn't support this method, @@ -417,7 +404,6 @@ private final void cancelOperation(CancelOperationRequest request) { cancelOperationCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to * cancel the operation, but success is not guaranteed. If the server doesn't support this method, @@ -446,7 +432,6 @@ public final UnaryCallable cancelOperationCallabl return stub.cancelOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Deletes a long-running operation. This method indicates that the client is no longer interested * in the operation result. It does not cancel the operation. If the server doesn't support this @@ -470,7 +455,6 @@ public final void deleteOperation(String name) { deleteOperation(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Deletes a long-running operation. This method indicates that the client is no longer interested * in the operation result. It does not cancel the operation. If the server doesn't support this @@ -495,7 +479,6 @@ private final void deleteOperation(DeleteOperationRequest request) { deleteOperationCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Deletes a long-running operation. This method indicates that the client is no longer interested * in the operation result. It does not cancel the operation. If the server doesn't support this diff --git a/gax-grpc/src/main/java/com/google/longrunning/OperationsSettings.java b/gax-grpc/src/main/java/com/google/longrunning/OperationsSettings.java index 8e9e8287b..c1cc54773 100644 --- a/gax-grpc/src/main/java/com/google/longrunning/OperationsSettings.java +++ b/gax-grpc/src/main/java/com/google/longrunning/OperationsSettings.java @@ -43,12 +43,8 @@ import com.google.longrunning.stub.OperationsStubSettings; import com.google.protobuf.Empty; import java.io.IOException; -import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS /** Settings class to configure an instance of {@link OperationsClient}. */ -@Generated("by GAPIC v0.0.5") -@BetaApi public class OperationsSettings extends ClientSettings { /** Returns the object with the settings used for calls to getOperation. */ public UnaryCallSettings getOperationSettings() { diff --git a/gax-grpc/src/main/java/com/google/longrunning/stub/GrpcOperationsCallableFactory.java b/gax-grpc/src/main/java/com/google/longrunning/stub/GrpcOperationsCallableFactory.java index db87fa0c9..fad6deebe 100644 --- a/gax-grpc/src/main/java/com/google/longrunning/stub/GrpcOperationsCallableFactory.java +++ b/gax-grpc/src/main/java/com/google/longrunning/stub/GrpcOperationsCallableFactory.java @@ -46,15 +46,12 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.longrunning.Operation; -import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS /** * gRPC callable factory implementation for Google Long Running Operations API. * *

This class is for advanced usage. */ -@Generated("by GAPIC v0.0.5") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcOperationsCallableFactory implements GrpcStubCallableFactory { @Override diff --git a/gax-grpc/src/main/java/com/google/longrunning/stub/GrpcOperationsStub.java b/gax-grpc/src/main/java/com/google/longrunning/stub/GrpcOperationsStub.java index d8cc2d812..3466eda6a 100644 --- a/gax-grpc/src/main/java/com/google/longrunning/stub/GrpcOperationsStub.java +++ b/gax-grpc/src/main/java/com/google/longrunning/stub/GrpcOperationsStub.java @@ -49,15 +49,12 @@ import io.grpc.protobuf.ProtoUtils; import java.io.IOException; import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS /** * gRPC stub implementation for Google Long Running Operations API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcOperationsStub extends OperationsStub { diff --git a/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStub.java b/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStub.java index ca3e04c96..db104738a 100644 --- a/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStub.java +++ b/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStub.java @@ -41,15 +41,12 @@ import com.google.longrunning.ListOperationsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; -import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS /** * Base stub class for Google Long Running Operations API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by GAPIC v0.0.5") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class OperationsStub implements BackgroundResource { diff --git a/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStubSettings.java b/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStubSettings.java index a8ca6f586..dce049842 100644 --- a/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStubSettings.java +++ b/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStubSettings.java @@ -63,12 +63,9 @@ import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; -import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS /** Settings class to configure an instance of {@link OperationsStub}. */ -@Generated("by GAPIC v0.0.5") @BetaApi public class OperationsStubSettings extends StubSettings { diff --git a/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java b/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java index bfa4da03f..ac41b8f66 100644 --- a/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java +++ b/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java @@ -51,7 +51,6 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") public class OperationsClientTest { private static MockOperations mockOperations; private static MockServiceHelper serviceHelper;