listRestoreJobs method

Future<ListRestoreJobsOutput> listRestoreJobs({
  1. String? byAccountId,
  2. DateTime? byCreatedAfter,
  3. DateTime? byCreatedBefore,
  4. RestoreJobStatus? byStatus,
  5. int? maxResults,
  6. String? nextToken,
})

Returns a list of jobs that AWS Backup initiated to restore a saved resource, including metadata about the recovery process.

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

Parameter byAccountId : The account ID to list the jobs from. Returns only restore jobs associated with the specified account ID.

Parameter byCreatedAfter : Returns only restore jobs that were created after the specified date.

Parameter byCreatedBefore : Returns only restore jobs that were created before the specified date.

Parameter byStatus : Returns only restore jobs associated with the specified job status.

Parameter maxResults : The maximum number of items to be returned.

Parameter nextToken : The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

Implementation

Future<ListRestoreJobsOutput> listRestoreJobs({
  String? byAccountId,
  DateTime? byCreatedAfter,
  DateTime? byCreatedBefore,
  RestoreJobStatus? byStatus,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    if (byAccountId != null) 'accountId': [byAccountId],
    if (byCreatedAfter != null)
      'createdAfter': [_s.iso8601ToJson(byCreatedAfter).toString()],
    if (byCreatedBefore != null)
      'createdBefore': [_s.iso8601ToJson(byCreatedBefore).toString()],
    if (byStatus != null) 'status': [byStatus.toValue()],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/restore-jobs/',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListRestoreJobsOutput.fromJson(response);
}