listMonitoringAlerts method

Future<ListMonitoringAlertsResponse> listMonitoringAlerts({
  1. required String monitoringScheduleName,
  2. int? maxResults,
  3. String? nextToken,
})

Gets the alerts for a single monitoring schedule.

May throw ResourceNotFound.

Parameter monitoringScheduleName : The name of a monitoring schedule.

Parameter maxResults : The maximum number of results to display. The default is 100.

Parameter nextToken : If the result of the previous ListMonitoringAlerts request was truncated, the response includes a NextToken. To retrieve the next set of alerts in the history, use the token in the next request.

Implementation

Future<ListMonitoringAlertsResponse> listMonitoringAlerts({
  required String monitoringScheduleName,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListMonitoringAlerts'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'MonitoringScheduleName': monitoringScheduleName,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListMonitoringAlertsResponse.fromJson(jsonResponse.body);
}