listModelImportJobs method

Future<ListModelImportJobsResponse> listModelImportJobs({
  1. DateTime? creationTimeAfter,
  2. DateTime? creationTimeBefore,
  3. int? maxResults,
  4. String? nameContains,
  5. String? nextToken,
  6. SortJobsBy? sortBy,
  7. SortOrder? sortOrder,
  8. ModelImportJobStatus? statusEquals,
})

Returns a list of import jobs you've submitted. You can filter the results to return based on one or more criteria. For more information, see Import a customized model in the Amazon Bedrock User Guide.

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

Parameter creationTimeAfter : Return import jobs that were created after the specified time.

Parameter creationTimeBefore : Return import jobs that were created before the specified time.

Parameter maxResults : The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

Parameter nameContains : Return imported jobs only if the job name contains these characters.

Parameter nextToken : If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Parameter sortBy : The field to sort by in the returned list of imported jobs.

Parameter sortOrder : Specifies whether to sort the results in ascending or descending order.

Parameter statusEquals : Return imported jobs with the specified status.

Implementation

Future<ListModelImportJobsResponse> listModelImportJobs({
  DateTime? creationTimeAfter,
  DateTime? creationTimeBefore,
  int? maxResults,
  String? nameContains,
  String? nextToken,
  SortJobsBy? sortBy,
  SortOrder? sortOrder,
  ModelImportJobStatus? statusEquals,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    if (creationTimeAfter != null)
      'creationTimeAfter': [_s.iso8601ToJson(creationTimeAfter).toString()],
    if (creationTimeBefore != null)
      'creationTimeBefore': [_s.iso8601ToJson(creationTimeBefore).toString()],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nameContains != null) 'nameContains': [nameContains],
    if (nextToken != null) 'nextToken': [nextToken],
    if (sortBy != null) 'sortBy': [sortBy.value],
    if (sortOrder != null) 'sortOrder': [sortOrder.value],
    if (statusEquals != null) 'statusEquals': [statusEquals.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/model-import-jobs',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListModelImportJobsResponse.fromJson(response);
}