list method

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

Lists rules in a given project.

Request parameters:

parent - Required. The [project] on which to execute the request. The format is: projects/{project_id}/locations/{location} Currently, the pre-defined rules are global available to all projects and all regions Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

customRulesBucket - The Cloud Storage bucket name for custom rules.

filter - Filter based on primary_category, secondary_category

pageSize - Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

pageToken - A token identifying a page of results the server should return.

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

Completes with a ListRulesResponse.

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<ListRulesResponse> list(
  core.String parent, {
  core.String? customRulesBucket,
  core.String? filter,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (customRulesBucket != null) 'customRulesBucket': [customRulesBucket],
    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') + '/rules';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return ListRulesResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}