list method
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.
evaluationType - Optional. The evaluation type of the rules will be
applied to. The Cloud Storage bucket name for custom rules.
Possible string values are:
- "EVALUATION_TYPE_UNSPECIFIED" : Not specified
- "SAP" : SAP best practices
- "SQL_SERVER" : SQL best practices
- "OTHER" : Customized best practices
- "SCC_IAC" : SCC IaC (Infra as Code) best practices.
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? evaluationType,
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'customRulesBucket': ?customRulesBucket == null
? null
: [customRulesBucket],
'evaluationType': ?evaluationType == null ? null : [evaluationType],
'filter': ?filter == null ? null : [filter],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$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>,
);
}