listScheduledQueries method

Future<ListScheduledQueriesResponse> listScheduledQueries({
  1. int? maxResults,
  2. String? nextToken,
  3. ScheduleType? scheduleType,
  4. ScheduledQueryState? state,
})

Lists all scheduled queries in your account and region. You can filter results by state to show only enabled or disabled queries.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter maxResults : The maximum number of scheduled queries to return. Valid range is 1 to 1000.

Parameter scheduleType : Filter scheduled queries by schedule type. Valid values are CUSTOMER_MANAGED and AWS_MANAGED. If not specified, scheduled queries of all schedule types are returned.

Parameter state : Filter scheduled queries by state. Valid values are ENABLED and DISABLED. If not specified, all scheduled queries are returned.

Implementation

Future<ListScheduledQueriesResponse> listScheduledQueries({
  int? maxResults,
  String? nextToken,
  ScheduleType? scheduleType,
  ScheduledQueryState? state,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Logs_20140328.ListScheduledQueries'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (scheduleType != null) 'scheduleType': scheduleType.value,
      if (state != null) 'state': state.value,
    },
  );

  return ListScheduledQueriesResponse.fromJson(jsonResponse.body);
}