search method

Future<SearchCasesResponse> search({
  1. int? pageSize,
  2. String? pageToken,
  3. String? query,
  4. String? $fields,
})

Search cases using the specified query.

Request parameters:

pageSize - The maximum number of cases fetched with each request. The default page size is 10.

pageToken - A token identifying the page of results to return. If unspecified, the first page is retrieved.

query - An expression written in the Cloud filter language. Filter strings can use the following fields: - organization (A name of the form organizations/) - project (A name of the form projects/) - customer (A name of the form customers/) - state (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 key/operator) can be used to search across display_name, description, and comments (e.g. "my search"). One of organization, project, or customer field must be specified.

$fields - Selector specifying which fields to include in a partial response.

Completes with a SearchCasesResponse.

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<SearchCasesResponse> search({
  core.int? pageSize,
  core.String? pageToken,
  core.String? query,
  core.String? $fields,
}) async {
  final _queryParams = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (query != null) 'query': [query],
    if ($fields != null) 'fields': [$fields],
  };

  const _url = 'v2beta/cases:search';

  final _response = await _requester.request(
    _url,
    'GET',
    queryParams: _queryParams,
  );
  return SearchCasesResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}