public virtual Task<Empty> CancelOperation(CancelOperationRequest request, ServerCallContext context)
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.
public virtual Task<Empty> DeleteOperation(DeleteOperationRequest request, ServerCallContext context)
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 method, it returns
google.rpc.Code.UNIMPLEMENTED.
public virtual Task<Operation> GetOperation(GetOperationRequest request, ServerCallContext context)
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.
public virtual Task<ListOperationsResponse> ListOperations(ListOperationsRequest request, ServerCallContext context)
Lists operations that match the specified filter in the request. If the
server doesn't support this method, it returns UNIMPLEMENTED.
NOTE: the name binding allows API services to override the binding
to use different resource name schemes, such as users/*/operations. To
override the binding, API services can add a binding such as
"/v1/{name=users/*}/operations" to their service configuration.
For backwards compatibility, the default name includes the operations
collection id, however overriding users must ensure the name binding
is the parent resource, without the operations collection id.
public virtual Task<Operation> WaitOperation(WaitOperationRequest request, ServerCallContext context)
Waits until the specified long-running operation is done or reaches at most
a specified timeout, returning the latest state. If the operation is
already done, the latest state is immediately returned. If the timeout
specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
timeout is used. If the server does not support this method, it returns
google.rpc.Code.UNIMPLEMENTED.
Note that this method is on a best-effort basis. It may return the latest
state before the specified timeout (including immediately), meaning even an
immediate response is no guarantee that the operation is done.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThis documentation covers the \u003ccode\u003eOperations.OperationsBase\u003c/code\u003e class within the \u003ccode\u003eGoogle.LongRunning\u003c/code\u003e namespace, serving as a base for server-side implementations of long-running operations.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this package is 3.3.0, with other previous versions also having links to their respective documentation pages.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eOperations.OperationsBase\u003c/code\u003e class supports several methods for managing long-running operations, including \u003ccode\u003eCancelOperation\u003c/code\u003e, \u003ccode\u003eDeleteOperation\u003c/code\u003e, \u003ccode\u003eGetOperation\u003c/code\u003e, \u003ccode\u003eListOperations\u003c/code\u003e, and \u003ccode\u003eWaitOperation\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach method, like \u003ccode\u003eCancelOperation\u003c/code\u003e, \u003ccode\u003eDeleteOperation\u003c/code\u003e, \u003ccode\u003eGetOperation\u003c/code\u003e, \u003ccode\u003eListOperations\u003c/code\u003e, and \u003ccode\u003eWaitOperation\u003c/code\u003e, interacts with requests and server call contexts, and it also returns task-wrapped responses.\u003c/p\u003e\n"],["\u003cp\u003eThe class inherits from \u003ccode\u003eobject\u003c/code\u003e, and it also provides a way to interact with long-running operation data through \u003ccode\u003eCancelOperationRequest\u003c/code\u003e, \u003ccode\u003eDeleteOperationRequest\u003c/code\u003e, \u003ccode\u003eGetOperationRequest\u003c/code\u003e, \u003ccode\u003eListOperationsRequest\u003c/code\u003e, and \u003ccode\u003eWaitOperationRequest\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Google.LongRunning - Class Operations.OperationsBase (3.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.3.0 (latest)](/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operations.OperationsBase)\n- [3.2.0](/dotnet/docs/reference/Google.LongRunning/3.2.0/Google.LongRunning.Operations.OperationsBase)\n- [3.1.0](/dotnet/docs/reference/Google.LongRunning/3.1.0/Google.LongRunning.Operations.OperationsBase)\n- [3.0.0](/dotnet/docs/reference/Google.LongRunning/3.0.0/Google.LongRunning.Operations.OperationsBase)\n- [2.3.0](/dotnet/docs/reference/Google.LongRunning/2.3.0/Google.LongRunning.Operations.OperationsBase)\n- [2.2.0](/dotnet/docs/reference/Google.LongRunning/2.2.0/Google.LongRunning.Operations.OperationsBase) \n\n [BindServiceMethod(typeof(Operations), \"BindService\")]\n public abstract class Operations.OperationsBase\n\nReference documentation and code samples for the Google.LongRunning class Operations.OperationsBase.\n\nBase class for server-side implementations of Operations \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Operations.OperationsBase \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.LongRunning](/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning)\n\nAssembly\n--------\n\nGoogle.LongRunning.dll\n\nMethods\n-------\n\n### CancelOperation(CancelOperationRequest, ServerCallContext)\n\n public virtual Task\u003cEmpty\u003e CancelOperation(CancelOperationRequest request, ServerCallContext context)\n\nStarts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\n\\[Operations.GetOperation\\]\\[google.longrunning.Operations.GetOperation\\] or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan \\[Operation.error\\]\\[google.longrunning.Operation.error\\] value with a \\[google.rpc.Status.code\\]\\[google.rpc.Status.code\\] of 1,\ncorresponding to `Code.CANCELLED`.\n\n### DeleteOperation(DeleteOperationRequest, ServerCallContext)\n\n public virtual Task\u003cEmpty\u003e DeleteOperation(DeleteOperationRequest request, ServerCallContext context)\n\nDeletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.\n\n### GetOperation(GetOperationRequest, ServerCallContext)\n\n public virtual Task\u003cOperation\u003e GetOperation(GetOperationRequest request, ServerCallContext context)\n\nGets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.\n\n### ListOperations(ListOperationsRequest, ServerCallContext)\n\n public virtual Task\u003cListOperationsResponse\u003e ListOperations(ListOperationsRequest request, ServerCallContext context)\n\nLists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.\n\n### WaitOperation(WaitOperationRequest, ServerCallContext)\n\n public virtual Task\u003cOperation\u003e WaitOperation(WaitOperationRequest request, ServerCallContext context)\n\nWaits until the specified long-running operation is done or reaches at most\na specified timeout, returning the latest state. If the operation is\nalready done, the latest state is immediately returned. If the timeout\nspecified is greater than the default HTTP/RPC timeout, the HTTP/RPC\ntimeout is used. If the server does not support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.\nNote that this method is on a best-effort basis. It may return the latest\nstate before the specified timeout (including immediately), meaning even an\nimmediate response is no guarantee that the operation is done."]]