searchJobs method

Future<SearchJobsResponse> searchJobs({
  1. String? inputFile,
  2. int? maxResults,
  3. String? nextToken,
  4. Order? order,
  5. String? queue,
  6. JobStatus? status,
})

Retrieve a JSON array that includes job details for up to twenty of your most recent jobs. Optionally filter results further according to input file, queue, or status. To retrieve the twenty next most recent jobs, use the nextToken string returned with the array.

May throw BadRequestException. May throw ConflictException. May throw ForbiddenException. May throw InternalServerErrorException. May throw NotFoundException. May throw ServiceQuotaExceededException. May throw TooManyRequestsException.

Parameter inputFile : Optional. Provide your input file URL or your partial input file name. The maximum length for an input file is 300 characters.

Parameter maxResults : Optional. Number of jobs, up to twenty, that will be returned at one time.

Parameter nextToken : Optional. Use this string, provided with the response to a previous request, to request the next batch of jobs.

Parameter order : Optional. When you request lists of resources, you can specify whether they are sorted in ASCENDING or DESCENDING order. Default varies by resource.

Parameter queue : Optional. Provide a queue name, or a queue ARN, to return only jobs from that queue.

Parameter status : Optional. A job's status can be SUBMITTED, PROGRESSING, COMPLETE, CANCELED, or ERROR.

Implementation

Future<SearchJobsResponse> searchJobs({
  String? inputFile,
  int? maxResults,
  String? nextToken,
  Order? order,
  String? queue,
  JobStatus? status,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    20,
  );
  final $query = <String, List<String>>{
    if (inputFile != null) 'inputFile': [inputFile],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (order != null) 'order': [order.value],
    if (queue != null) 'queue': [queue],
    if (status != null) 'status': [status.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/2017-08-29/search',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return SearchJobsResponse.fromJson(response);
}