getJobRuns method

Future<GetJobRunsResponse> getJobRuns({
  1. required String jobName,
  2. int? maxResults,
  3. String? nextToken,
})

Retrieves metadata for all runs of a given job definition.

May throw InvalidInputException. May throw EntityNotFoundException. May throw InternalServiceException. May throw OperationTimeoutException.

Parameter jobName : The name of the job definition for which to retrieve all job runs.

Parameter maxResults : The maximum size of the response.

Parameter nextToken : A continuation token, if this is a continuation call.

Implementation

Future<GetJobRunsResponse> getJobRuns({
  required String jobName,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(jobName, 'jobName');
  _s.validateStringLength(
    'jobName',
    jobName,
    1,
    255,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.GetJobRuns'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'JobName': jobName,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return GetJobRunsResponse.fromJson(jsonResponse.body);
}