getFindingsTrendsV2 method

Future<GetFindingsTrendsV2Response> getFindingsTrendsV2({
  1. required DateTime endTime,
  2. required DateTime startTime,
  3. FindingsTrendsFilters? filters,
  4. int? maxResults,
  5. String? nextToken,
})

Returns findings trend data based on the specified criteria. This operation helps you analyze patterns and changes in findings over time.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter endTime : The ending timestamp for the time period to analyze findings trends, in ISO 8601 format.

Parameter startTime : The starting timestamp for the time period to analyze findings trends, in ISO 8601 format.

Parameter filters : The filters to apply to the findings trend data.

Parameter maxResults : The maximum number of trend data points to return in a single response.

Parameter nextToken : The token to use for paginating results. This value is returned in the response if more results are available.

Implementation

Future<GetFindingsTrendsV2Response> getFindingsTrendsV2({
  required DateTime endTime,
  required DateTime startTime,
  FindingsTrendsFilters? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    'EndTime': iso8601ToJson(endTime),
    'StartTime': iso8601ToJson(startTime),
    if (filters != null) 'Filters': filters,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/findingsTrendsv2',
    exceptionFnMap: _exceptionFns,
  );
  return GetFindingsTrendsV2Response.fromJson(response);
}