list method
Retrieve all cases under the specified parent.
Request parameters:
parent
- Required. The fully qualified name of parent resource to list
cases under.
Value must have pattern ^\[^/\]+/\[^/\]+$
.
filter
- An expression written in the Cloud filter language. If
non-empty, then only cases whose fields match the filter are returned. If
empty, then no messages are filtered out. Filter strings can use the
following fields: - status (Accepted values: OPEN or CLOSED) - severity
(Accepted values: S0, S1, S2, S3, or S4) - creator.email with the
operators equals (=) and AND. Additionally, a global restriction (with no
operator) can be used to search across displayName, description, and
comments (e.g. "my search").
pageSize
- The maximum number of cases fetched with each request.
Defaults to 10.
pageToken
- A token identifying the page of results to return. If
unspecified, the first page is retrieved.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListCasesResponse
.
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<ListCasesResponse> 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 = 'v2beta/' + core.Uri.encodeFull('$parent') + '/cases';
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ListCasesResponse.fromJson(
_response as core.Map<core.String, core.dynamic>);
}