@@ -77,7 +77,11 @@ def __init__(self, channel, client_config=operations_client_config.config):
77
77
)
78
78
79
79
async def get_operation (
80
- self , name , retry = gapic_v1 .method_async .DEFAULT , timeout = gapic_v1 .method_async .DEFAULT
80
+ self ,
81
+ name ,
82
+ retry = gapic_v1 .method_async .DEFAULT ,
83
+ timeout = gapic_v1 .method_async .DEFAULT ,
84
+ metadata = None ,
81
85
):
82
86
"""Gets the latest state of a long-running operation.
83
87
@@ -103,6 +107,8 @@ async def get_operation(
103
107
unspecified, the the default timeout in the client
104
108
configuration is used. If ``None``, then the RPC method will
105
109
not time out.
110
+ metadata (Optional[List[Tuple[str, str]]]):
111
+ Additional gRPC metadata.
106
112
107
113
Returns:
108
114
google.longrunning.operations_pb2.Operation: The state of the
@@ -114,14 +120,15 @@ async def get_operation(
114
120
subclass will be raised.
115
121
"""
116
122
request = operations_pb2 .GetOperationRequest (name = name )
117
- return await self ._get_operation (request , retry = retry , timeout = timeout )
123
+ return await self ._get_operation (request , retry = retry , timeout = timeout , metadata = metadata )
118
124
119
125
async def list_operations (
120
126
self ,
121
127
name ,
122
128
filter_ ,
123
129
retry = gapic_v1 .method_async .DEFAULT ,
124
130
timeout = gapic_v1 .method_async .DEFAULT ,
131
+ metadata = None ,
125
132
):
126
133
"""
127
134
Lists operations that match the specified filter in the request.
@@ -157,6 +164,8 @@ async def list_operations(
157
164
unspecified, the the default timeout in the client
158
165
configuration is used. If ``None``, then the RPC method will
159
166
not time out.
167
+ metadata (Optional[List[Tuple[str, str]]]): Additional gRPC
168
+ metadata.
160
169
161
170
Returns:
162
171
google.api_core.page_iterator.Iterator: An iterator that yields
@@ -174,7 +183,7 @@ async def list_operations(
174
183
request = operations_pb2 .ListOperationsRequest (name = name , filter = filter_ )
175
184
176
185
# Create the method used to fetch pages
177
- method = functools .partial (self ._list_operations , retry = retry , timeout = timeout )
186
+ method = functools .partial (self ._list_operations , retry = retry , timeout = timeout , metadata = metadata )
178
187
179
188
iterator = page_iterator_async .AsyncGRPCIterator (
180
189
client = None ,
@@ -188,7 +197,11 @@ async def list_operations(
188
197
return iterator
189
198
190
199
async def cancel_operation (
191
- self , name , retry = gapic_v1 .method_async .DEFAULT , timeout = gapic_v1 .method_async .DEFAULT
200
+ self ,
201
+ name ,
202
+ retry = gapic_v1 .method_async .DEFAULT ,
203
+ timeout = gapic_v1 .method_async .DEFAULT ,
204
+ metadata = None ,
192
205
):
193
206
"""Starts asynchronous cancellation on a long-running operation.
194
207
@@ -228,13 +241,19 @@ async def cancel_operation(
228
241
google.api_core.exceptions.GoogleAPICallError: If an error occurred
229
242
while invoking the RPC, the appropriate ``GoogleAPICallError``
230
243
subclass will be raised.
244
+ metadata (Optional[List[Tuple[str, str]]]): Additional gRPC
245
+ metadata.
231
246
"""
232
247
# Create the request object.
233
248
request = operations_pb2 .CancelOperationRequest (name = name )
234
- await self ._cancel_operation (request , retry = retry , timeout = timeout )
249
+ await self ._cancel_operation (request , retry = retry , timeout = timeout , metadata = metadata )
235
250
236
251
async def delete_operation (
237
- self , name , retry = gapic_v1 .method_async .DEFAULT , timeout = gapic_v1 .method_async .DEFAULT
252
+ self ,
253
+ name ,
254
+ retry = gapic_v1 .method_async .DEFAULT ,
255
+ timeout = gapic_v1 .method_async .DEFAULT ,
256
+ metadata = None ,
238
257
):
239
258
"""Deletes a long-running operation.
240
259
@@ -260,6 +279,8 @@ async def delete_operation(
260
279
unspecified, the the default timeout in the client
261
280
configuration is used. If ``None``, then the RPC method will
262
281
not time out.
282
+ metadata (Optional[List[Tuple[str, str]]]): Additional gRPC
283
+ metadata.
263
284
264
285
Raises:
265
286
google.api_core.exceptions.MethodNotImplemented: If the server
@@ -271,4 +292,4 @@ async def delete_operation(
271
292
"""
272
293
# Create the request object.
273
294
request = operations_pb2 .DeleteOperationRequest (name = name )
274
- await self ._delete_operation (request , retry = retry , timeout = timeout )
295
+ await self ._delete_operation (request , retry = retry , timeout = timeout , metadata = metadata )
0 commit comments