listJobRuns method

Future<ListJobRunsOutput> listJobRuns({
  1. required String domainIdentifier,
  2. required String jobIdentifier,
  3. int? maxResults,
  4. String? nextToken,
  5. SortOrder? sortOrder,
  6. JobRunStatus? status,
})

Lists job runs.

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

Parameter domainIdentifier : The ID of the domain where you want to list job runs.

Parameter jobIdentifier : The ID of the job run.

Parameter maxResults : The maximum number of job runs to return in a single call to ListJobRuns. When the number of job runs to be listed is greater than the value of MaxResults, the response contains a NextToken value that you can use in a subsequent call to ListJobRuns to list the next set of job runs.

Parameter nextToken : When the number of job runs is greater than the default value for the MaxResults parameter, or if you explicitly specify a value for MaxResults that is less than the number of job runs, the response includes a pagination token named NextToken. You can specify this NextToken value in a subsequent call to ListJobRuns to list the next set of job runs.

Parameter sortOrder : Specifies the order in which job runs are to be sorted.

Parameter status : The status of a job run.

Implementation

Future<ListJobRunsOutput> listJobRuns({
  required String domainIdentifier,
  required String jobIdentifier,
  int? maxResults,
  String? nextToken,
  SortOrder? sortOrder,
  JobRunStatus? status,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (sortOrder != null) 'sortOrder': [sortOrder.value],
    if (status != null) 'status': [status.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/jobs/${Uri.encodeComponent(jobIdentifier)}/runs',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListJobRunsOutput.fromJson(response);
}