Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

fix(operations): Make Operations a manual client [gax-java] #1282

Merged
merged 7 commits into from Feb 2, 2021
Expand Up @@ -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.
*
Expand Down Expand Up @@ -111,7 +109,6 @@
* </code>
* </pre>
*/
@Generated("by GAPIC v0.0.5")
@BetaApi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it still Beta?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed for this and OperationSettings. I left them in for the stub classes (since they're everywhere across the dependent APIs), but LMK if we should remove them in one fell swoop.

public class OperationsClient implements BackgroundResource {
private final OperationsSettings settings;
Expand Down Expand Up @@ -158,7 +155,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.
Expand All @@ -181,7 +177,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.
Expand All @@ -205,7 +200,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.
Expand All @@ -228,7 +222,6 @@ public final UnaryCallable<GetOperationRequest, Operation> 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`.
Expand Down Expand Up @@ -258,7 +251,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`.
Expand Down Expand Up @@ -289,7 +281,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`.
Expand Down Expand Up @@ -320,7 +311,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`.
Expand Down Expand Up @@ -358,7 +348,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,
Expand Down Expand Up @@ -387,7 +376,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,
Expand Down Expand Up @@ -417,7 +405,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,
Expand Down Expand Up @@ -446,7 +433,6 @@ public final UnaryCallable<CancelOperationRequest, Empty> 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
Expand All @@ -470,7 +456,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
Expand All @@ -495,7 +480,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
Expand Down
Expand Up @@ -43,11 +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<OperationsSettings> {
/** Returns the object with the settings used for calls to getOperation. */
Expand Down
Expand Up @@ -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.
*
* <p>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
Expand Down
Expand Up @@ -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.
*
* <p>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 {

Expand Down
Expand Up @@ -43,13 +43,11 @@
import com.google.protobuf.Empty;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
* Base stub class for Google Long Running Operations API.
*
* <p>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 {

Expand Down
Expand Up @@ -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<OperationsStubSettings> {

Expand Down
Expand Up @@ -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;
Expand Down