list method
Lists service operations that match the specified filter in the request.
Request parameters:
filter - A string for filtering Operations. The following filter fields
are supported: * serviceName: Required. Only = operator is allowed. *
startTime: The time this job was started, in ISO 8601 format. Allowed
operators are >=, >, <=, and <. * status: Can be done,
in_progress, or failed. Allowed operators are =, and !=. Filter
expression supports conjunction (AND) and disjunction (OR) logical
operators. However, the serviceName restriction must be at the top-level
and can only be combined with other restrictions via the AND logical
operator. Examples: * serviceName={some-service}.googleapis.com *
serviceName={some-service}.googleapis.com AND startTime>="2017-02-01" *
serviceName={some-service}.googleapis.com AND status=done *
serviceName={some-service}.googleapis.com AND (status=done OR startTime>="2017-02-01")
name - Not used.
pageSize - The maximum number of operations to return. If unspecified,
defaults to 50. The maximum value is 100.
pageToken - The standard list page token.
returnPartialSuccess - When set to true, operations that are reachable
are returned as normal, and those that are unreachable are returned in the
ListOperationsResponse.unreachable field. This can only be true when
reading across collections. For example, when parent is set to
"projects/example/locations/-". This field is not supported by default
and will result in an UNIMPLEMENTED error if set unless explicitly
documented otherwise in service or product specific documentation.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a ListOperationsResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http_1.Client completes with an error when making a REST
call, this method will complete with the same error.
Implementation
async.Future<ListOperationsResponse> list({
core.String? filter,
core.String? name,
core.int? pageSize,
core.String? pageToken,
core.bool? returnPartialSuccess,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'name': ?name == null ? null : [name],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'returnPartialSuccess': ?returnPartialSuccess == null
? null
: ['${returnPartialSuccess}'],
'fields': ?$fields == null ? null : [$fields],
};
const url_ = 'v1/operations';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListOperationsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}