listJobRuns method
Lists job runs based on a set of parameters.
May throw InternalServerException.
May throw ValidationException.
Parameter applicationId :
The ID of the application for which to list the job run.
Parameter createdAtAfter :
The lower bound of the option to filter by creation date and time.
Parameter createdAtBefore :
The upper bound of the option to filter by creation date and time.
Parameter maxResults :
The maximum number of job runs that can be listed.
Parameter mode :
The mode of the job runs to list.
Parameter nextToken :
The token for the next set of job run results.
Parameter states :
An optional filter for job run states. Note that if this filter contains
multiple states, the resulting list will be grouped by the state.
Implementation
Future<ListJobRunsResponse> listJobRuns({
required String applicationId,
DateTime? createdAtAfter,
DateTime? createdAtBefore,
int? maxResults,
JobRunMode? mode,
String? nextToken,
List<JobRunState>? states,
}) async {
final $query = <String, List<String>>{
if (createdAtAfter != null)
'createdAtAfter': [_s.iso8601ToJson(createdAtAfter).toString()],
if (createdAtBefore != null)
'createdAtBefore': [_s.iso8601ToJson(createdAtBefore).toString()],
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (mode != null) 'mode': [mode.value],
if (nextToken != null) 'nextToken': [nextToken],
if (states != null) 'states': states.map((e) => e.value).toList(),
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/applications/${Uri.encodeComponent(applicationId)}/jobruns',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListJobRunsResponse.fromJson(response);
}