/** * 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, * it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or other methods to check * whether the cancellation succeeded or whether the operation completed despite cancellation. On * successful cancellation, the operation is not deleted; instead, it becomes an operation with an * [Operation.error][google.longrunning.Operation.error] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. * * <p>Sample code: * * <pre><code> * try (OperationsClient operationsClient = OperationsClient.create()) { * String name = ""; * operationsClient.cancelOperation(name); * } * </code></pre> * * @param name The name of the operation resource to be cancelled. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void cancelOperation(String name) { CancelOperationRequest request = CancelOperationRequest.newBuilder().setName(name).build(); cancelOperation(request); }
/** * 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, * it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or other methods to check * whether the cancellation succeeded or whether the operation completed despite cancellation. On * successful cancellation, the operation is not deleted; instead, it becomes an operation with an * [Operation.error][google.longrunning.Operation.error] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. * * <p>Sample code: * * <pre><code> * try (OperationsClient operationsClient = OperationsClient.create()) { * String name = ""; * operationsClient.cancelOperation(name); * } * </code></pre> * * @param name The name of the operation resource to be cancelled. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void cancelOperation(String name) { CancelOperationRequest request = CancelOperationRequest.newBuilder().setName(name).build(); cancelOperation(request); }
@Override public CancelOperationRequest apply(String request) { return CancelOperationRequest.newBuilder().setName(request).build(); } },
@Override public CancelOperationRequest apply(String request) { return CancelOperationRequest.newBuilder().setName(request).build(); } },