list method

Future<ListCasesResponse> list(
  1. String parent, {
  2. String? filter,
  3. int? pageSize,
  4. String? pageToken,
  5. String? $fields,
})

Retrieve all cases under a parent, but not its children.

For example, listing cases under an organization only returns the cases that are directly parented by that organization. To retrieve cases under an organization and its projects, use cases.search. EXAMPLES: cURL:

Bearer $(gcloud auth print-access-token)" \
"https://cloudsupport.googleapis.com/v2/$parent/cases" ``` Python:
```python import googleapiclient.discovery api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport", version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
) request = supportApiService.cases().list(parent="projects/some-project")
print(request.execute()) ```

Request parameters:

[parent] - Required. The name of a parent to list cases under.
Value must have pattern `^\[^/\]+/\[^/\]+$`.

[filter] - An expression used to filter cases. If it's an empty string,
then no filtering happens. Otherwise, the endpoint returns the cases that
match the filter. Expressions use the following fields separated by `AND`
and specified with `=`: - `state`: Can be `OPEN` or `CLOSED`. -
`priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You can specify
multiple values for priority using the `OR` operator. For example,
`priority=P1 OR priority=P2`. - `creator.email`: The email address of the
case creator. EXAMPLES: - `state=CLOSED` - `state=OPEN AND
creator.email="[email protected]"` - `state=OPEN AND (priority=P0 OR
priority=P1)`

[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_ = 'v2/' + 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>);
}