listMetrics method
Lists the metrics that can be exported.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ThrottlingException.
May throw ValidationException.
Parameter conditions :
Indicates the list of all the conditions that were applied on the metrics.
Parameter dataSource :
Indicates the data source of the metrics.
Parameter fields :
Indicates the list of fields in the data source.
Parameter maxResults :
Maximum number of results to include in the response. If more results
exist than the specified MaxResults value, a token is
included in the response so that the remaining results can be retrieved.
Parameter nextToken :
Null, or the token from a previous call to get the next set of results.
Parameter sorts :
(Optional) Indicates the order in which you want to sort the fields in the
metrics. By default, the fields are sorted in the ascending order.
Implementation
Future<ListMetricsResponse> listMetrics({
List<Condition>? conditions,
String? dataSource,
List<Field>? fields,
int? maxResults,
String? nextToken,
List<Sort>? sorts,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final $payload = <String, dynamic>{
if (conditions != null) 'conditions': conditions,
if (dataSource != null) 'dataSource': dataSource,
if (fields != null) 'fields': fields,
if (maxResults != null) 'maxResults': maxResults,
if (nextToken != null) 'nextToken': nextToken,
if (sorts != null) 'sorts': sorts,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/list-metrics',
exceptionFnMap: _exceptionFns,
);
return ListMetricsResponse.fromJson(response);
}