wait method
- GoogleLongrunningWaitOperationRequest request,
- String name, {
- String? $fields,
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.
request
- The metadata request object.
Request parameters:
name
- The name of the operation resource to wait on.
Value must have pattern
^projects/\[^/\]+/apps/\[^/\]+/releases/\[^/\]+/operations/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleLongrunningOperation.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<GoogleLongrunningOperation> wait(
GoogleLongrunningWaitOperationRequest request,
core.String name, {
core.String? $fields,
}) async {
final _body = convert.json.encode(request);
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name') + ':wait';
final _response = await _requester.request(
_url,
'POST',
body: _body,
queryParams: _queryParams,
);
return GoogleLongrunningOperation.fromJson(
_response as core.Map<core.String, core.dynamic>);
}