getResourcesTrendsV2 method
Returns resource trend data based on the specified criteria. This operation helps you analyze patterns and changes in resource compliance 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 resources trends, in
ISO 8601 format.
Parameter startTime :
The starting timestamp for the time period to analyze resources trends, in
ISO 8601 format.
Parameter filters :
The filters to apply to the resources 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<GetResourcesTrendsV2Response> getResourcesTrendsV2({
required DateTime endTime,
required DateTime startTime,
ResourcesTrendsFilters? 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: '/resourcesTrendsv2',
exceptionFnMap: _exceptionFns,
);
return GetResourcesTrendsV2Response.fromJson(response);
}