list method
Lists approval requests associated with a project, folder, or organization.
Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological.
Request parameters:
parent
- The parent resource. This may be "projects/{project}",
"folders/{folder}", or "organizations/{organization}".
Value must have pattern ^projects/\[^/\]+$
.
filter
- A filter on the type of approval requests to retrieve. Must be
one of the following values: * [not set]: Requests that are pending or
have active approvals. * ALL: All requests. * PENDING: Only pending
requests. * ACTIVE: Only active (i.e. currently approved) requests. *
DISMISSED: Only requests that have been dismissed, or requests that are
not approved and past expiration. * EXPIRED: Only requests that have been
approved, and the approval has expired. * HISTORY: Active, dismissed and
expired requests.
pageSize
- Requested page size.
pageToken
- A token identifying the page of results to return.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListApprovalRequestsResponse.
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<ListApprovalRequestsResponse> list(
core.String parent, {
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (filter != null) 'filter': [filter],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/approvalRequests';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListApprovalRequestsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}