list method

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

Lists the Violations in the AssuredWorkload Environment.

Callers may also choose to read across multiple Workloads as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard character instead of workload-id in the parent. Format organizations/{org_id}/locations/{location}/workloads/-

Request parameters:

parent - Required. The Workload name. Format organizations/{org_id}/locations/{location}/workloads/{workload}. Value must have pattern ^organizations/\[^/\]+/locations/\[^/\]+/workloads/\[^/\]+$.

filter - Optional. A custom filter for filtering by the Violations properties.

interval_endTime - The end of the time window.

interval_startTime - The start of the time window.

pageSize - Optional. Page size.

pageToken - Optional. Page token returned from previous request.

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

Completes with a GoogleCloudAssuredworkloadsV1ListViolationsResponse.

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<GoogleCloudAssuredworkloadsV1ListViolationsResponse> list(
  core.String parent, {
  core.String? filter,
  core.String? interval_endTime,
  core.String? interval_startTime,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (filter != null) 'filter': [filter],
    if (interval_endTime != null) 'interval.endTime': [interval_endTime],
    if (interval_startTime != null)
      'interval.startTime': [interval_startTime],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

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

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