diff options
Diffstat (limited to 'google/api_core/operations_v1/operations_client.py')
-rw-r--r-- | google/api_core/operations_v1/operations_client.py | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/google/api_core/operations_v1/operations_client.py b/google/api_core/operations_v1/operations_client.py index cd2923b..b850796 100644 --- a/google/api_core/operations_v1/operations_client.py +++ b/google/api_core/operations_v1/operations_client.py @@ -91,7 +91,11 @@ class OperationsClient(object): # Service calls def get_operation( - self, name, retry=gapic_v1.method.DEFAULT, timeout=gapic_v1.method.DEFAULT + self, + name, + retry=gapic_v1.method.DEFAULT, + timeout=gapic_v1.method.DEFAULT, + metadata=None, ): """Gets the latest state of a long-running operation. @@ -117,6 +121,8 @@ class OperationsClient(object): unspecified, the the default timeout in the client configuration is used. If ``None``, then the RPC method will not time out. + metadata (Optional[List[Tuple[str, str]]]): + Additional gRPC metadata. Returns: google.longrunning.operations_pb2.Operation: The state of the @@ -128,7 +134,7 @@ class OperationsClient(object): subclass will be raised. """ request = operations_pb2.GetOperationRequest(name=name) - return self._get_operation(request, retry=retry, timeout=timeout) + return self._get_operation(request, retry=retry, timeout=timeout, metadata=metadata) def list_operations( self, @@ -136,6 +142,7 @@ class OperationsClient(object): filter_, retry=gapic_v1.method.DEFAULT, timeout=gapic_v1.method.DEFAULT, + metadata=None, ): """ Lists operations that match the specified filter in the request. @@ -171,6 +178,8 @@ class OperationsClient(object): unspecified, the the default timeout in the client configuration is used. If ``None``, then the RPC method will not time out. + metadata (Optional[List[Tuple[str, str]]]): Additional gRPC + metadata. Returns: google.api_core.page_iterator.Iterator: An iterator that yields @@ -188,7 +197,7 @@ class OperationsClient(object): request = operations_pb2.ListOperationsRequest(name=name, filter=filter_) # Create the method used to fetch pages - method = functools.partial(self._list_operations, retry=retry, timeout=timeout) + method = functools.partial(self._list_operations, retry=retry, timeout=timeout, metadata=metadata) iterator = page_iterator.GRPCIterator( client=None, @@ -202,7 +211,11 @@ class OperationsClient(object): return iterator def cancel_operation( - self, name, retry=gapic_v1.method.DEFAULT, timeout=gapic_v1.method.DEFAULT + self, + name, + retry=gapic_v1.method.DEFAULT, + timeout=gapic_v1.method.DEFAULT, + metadata=None, ): """Starts asynchronous cancellation on a long-running operation. @@ -234,6 +247,8 @@ class OperationsClient(object): unspecified, the the default timeout in the client configuration is used. If ``None``, then the RPC method will not time out. + metadata (Optional[List[Tuple[str, str]]]): Additional gRPC + metadata. Raises: google.api_core.exceptions.MethodNotImplemented: If the server @@ -245,10 +260,14 @@ class OperationsClient(object): """ # Create the request object. request = operations_pb2.CancelOperationRequest(name=name) - self._cancel_operation(request, retry=retry, timeout=timeout) + self._cancel_operation(request, retry=retry, timeout=timeout, metadata=metadata) def delete_operation( - self, name, retry=gapic_v1.method.DEFAULT, timeout=gapic_v1.method.DEFAULT + self, + name, + retry=gapic_v1.method.DEFAULT, + timeout=gapic_v1.method.DEFAULT, + metadata=None, ): """Deletes a long-running operation. @@ -274,6 +293,8 @@ class OperationsClient(object): unspecified, the the default timeout in the client configuration is used. If ``None``, then the RPC method will not time out. + metadata (Optional[List[Tuple[str, str]]]): Additional gRPC + metadata. Raises: google.api_core.exceptions.MethodNotImplemented: If the server @@ -285,4 +306,4 @@ class OperationsClient(object): """ # Create the request object. request = operations_pb2.DeleteOperationRequest(name=name) - self._delete_operation(request, retry=retry, timeout=timeout) + self._delete_operation(request, retry=retry, timeout=timeout, metadata=metadata) |