listMonitoringSchedules method

Future<ListMonitoringSchedulesResponse> listMonitoringSchedules({
  1. DateTime? creationTimeAfter,
  2. DateTime? creationTimeBefore,
  3. String? endpointName,
  4. DateTime? lastModifiedTimeAfter,
  5. DateTime? lastModifiedTimeBefore,
  6. int? maxResults,
  7. String? monitoringJobDefinitionName,
  8. MonitoringType? monitoringTypeEquals,
  9. String? nameContains,
  10. String? nextToken,
  11. MonitoringScheduleSortKey? sortBy,
  12. SortOrder? sortOrder,
  13. ScheduleStatus? statusEquals,
})

Returns list of all monitoring schedules.

Parameter creationTimeAfter : A filter that returns only monitoring schedules created after a specified time.

Parameter creationTimeBefore : A filter that returns only monitoring schedules created before a specified time.

Parameter endpointName : Name of a specific endpoint to fetch schedules for.

Parameter lastModifiedTimeAfter : A filter that returns only monitoring schedules modified after a specified time.

Parameter lastModifiedTimeBefore : A filter that returns only monitoring schedules modified before a specified time.

Parameter maxResults : The maximum number of jobs to return in the response. The default value is 10.

Parameter monitoringJobDefinitionName : Gets a list of the monitoring schedules for the specified monitoring job definition.

Parameter monitoringTypeEquals : A filter that returns only the monitoring schedules for the specified monitoring type.

Parameter nameContains : Filter for monitoring schedules whose name contains a specified string.

Parameter nextToken : The token returned if the response is truncated. To retrieve the next set of job executions, use it in the next request.

Parameter sortBy : Whether to sort results by Status, CreationTime, ScheduledTime field. The default is CreationTime.

Parameter sortOrder : Whether to sort the results in Ascending or Descending order. The default is Descending.

Parameter statusEquals : A filter that returns only monitoring schedules modified before a specified time.

Implementation

Future<ListMonitoringSchedulesResponse> listMonitoringSchedules({
  DateTime? creationTimeAfter,
  DateTime? creationTimeBefore,
  String? endpointName,
  DateTime? lastModifiedTimeAfter,
  DateTime? lastModifiedTimeBefore,
  int? maxResults,
  String? monitoringJobDefinitionName,
  MonitoringType? monitoringTypeEquals,
  String? nameContains,
  String? nextToken,
  MonitoringScheduleSortKey? sortBy,
  SortOrder? sortOrder,
  ScheduleStatus? statusEquals,
}) async {
  _s.validateStringLength(
    'endpointName',
    endpointName,
    0,
    63,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'monitoringJobDefinitionName',
    monitoringJobDefinitionName,
    1,
    63,
  );
  _s.validateStringLength(
    'nameContains',
    nameContains,
    0,
    63,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    8192,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListMonitoringSchedules'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (creationTimeAfter != null)
        'CreationTimeAfter': unixTimestampToJson(creationTimeAfter),
      if (creationTimeBefore != null)
        'CreationTimeBefore': unixTimestampToJson(creationTimeBefore),
      if (endpointName != null) 'EndpointName': endpointName,
      if (lastModifiedTimeAfter != null)
        'LastModifiedTimeAfter': unixTimestampToJson(lastModifiedTimeAfter),
      if (lastModifiedTimeBefore != null)
        'LastModifiedTimeBefore': unixTimestampToJson(lastModifiedTimeBefore),
      if (maxResults != null) 'MaxResults': maxResults,
      if (monitoringJobDefinitionName != null)
        'MonitoringJobDefinitionName': monitoringJobDefinitionName,
      if (monitoringTypeEquals != null)
        'MonitoringTypeEquals': monitoringTypeEquals.toValue(),
      if (nameContains != null) 'NameContains': nameContains,
      if (nextToken != null) 'NextToken': nextToken,
      if (sortBy != null) 'SortBy': sortBy.toValue(),
      if (sortOrder != null) 'SortOrder': sortOrder.toValue(),
      if (statusEquals != null) 'StatusEquals': statusEquals.toValue(),
    },
  );

  return ListMonitoringSchedulesResponse.fromJson(jsonResponse.body);
}