listReportJobs method

Future<ListReportJobsOutput> listReportJobs({
  1. DateTime? byCreationAfter,
  2. DateTime? byCreationBefore,
  3. String? byReportPlanName,
  4. String? byStatus,
  5. int? maxResults,
  6. String? nextToken,
})

Returns details about your report jobs.

May throw InvalidParameterValueException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter byCreationAfter : Returns only report jobs that were created after the date and time specified in Unix format and Coordinated Universal Time (UTC). For example, the value 1516925490 represents Friday, January 26, 2018 12:11:30 AM.

Parameter byCreationBefore : Returns only report jobs that were created before the date and time specified in Unix format and Coordinated Universal Time (UTC). For example, the value 1516925490 represents Friday, January 26, 2018 12:11:30 AM.

Parameter byReportPlanName : Returns only report jobs with the specified report plan name.

Parameter byStatus : Returns only report jobs that are in the specified status. The statuses are:

CREATED | RUNNING | COMPLETED | FAILED | COMPLETED_WITH_ISSUES

Please note that only scanning jobs finish with state completed with issues. For backup jobs this is a console interpretation of a job that finishes in completed state and has a status message.

Parameter maxResults : The number of desired results from 1 to 1000. Optional. If unspecified, the query will return 1 MB of data.

Parameter nextToken : An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

Implementation

Future<ListReportJobsOutput> listReportJobs({
  DateTime? byCreationAfter,
  DateTime? byCreationBefore,
  String? byReportPlanName,
  String? byStatus,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    if (byCreationAfter != null)
      'CreationAfter': [_s.iso8601ToJson(byCreationAfter).toString()],
    if (byCreationBefore != null)
      'CreationBefore': [_s.iso8601ToJson(byCreationBefore).toString()],
    if (byReportPlanName != null) 'ReportPlanName': [byReportPlanName],
    if (byStatus != null) 'Status': [byStatus],
    if (maxResults != null) 'MaxResults': [maxResults.toString()],
    if (nextToken != null) 'NextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/audit/report-jobs',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListReportJobsOutput.fromJson(response);
}