batchGetRumMetricDefinitions method

Future<BatchGetRumMetricDefinitionsResponse> batchGetRumMetricDefinitions({
  1. required String appMonitorName,
  2. required MetricDestination destination,
  3. String? destinationArn,
  4. int? maxResults,
  5. String? nextToken,
})

Retrieves the list of metrics and dimensions that a RUM app monitor is sending to a single destination.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter appMonitorName : The name of the CloudWatch RUM app monitor that is sending the metrics.

Parameter destination : The type of destination that you want to view metrics for. Valid values are CloudWatch and Evidently.

Parameter destinationArn : This parameter is required if Destination is Evidently. If Destination is CloudWatch, do not use this parameter.

This parameter specifies the ARN of the Evidently experiment that corresponds to the destination.

Parameter maxResults : The maximum number of results to return in one operation. The default is 50. The maximum that you can specify is 100.

To retrieve the remaining results, make another call with the returned NextToken value.

Parameter nextToken : Use the token returned by the previous operation to request the next page of results.

Implementation

Future<BatchGetRumMetricDefinitionsResponse> batchGetRumMetricDefinitions({
  required String appMonitorName,
  required MetricDestination destination,
  String? destinationArn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    'destination': [destination.value],
    if (destinationArn != null) 'destinationArn': [destinationArn],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/rummetrics/${Uri.encodeComponent(appMonitorName)}/metrics',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return BatchGetRumMetricDefinitionsResponse.fromJson(response);
}