list method

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

Lists the audit reports for the organization, folder, or project that you specify as the parent scope.

Request parameters:

parent - Required. Parent organization, folder, or project to list reports for, in one of the following formats: * projects/{project}/locations/{location} * folders/{folder}/locations/{location} * organizations/{organization}/locations/{location} Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

pageSize - Optional. Maximum number of items to return in a single page. The service might return fewer items than this value. If unspecified, the service picks an appropriate default. The maximum value is 100; values above 100 are reduced to 100.

pageToken - Optional. A page token, received from a previous call, to retrieve the next page of results.

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

Completes with a ListAuditReportsResponse.

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<ListAuditReportsResponse> list(
  core.String parent, {
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'pageSize': ?pageSize == null ? null : ['${pageSize}'],
    'pageToken': ?pageToken == null ? null : [pageToken],
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/auditReports';

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