listImportedModels method

Future<ListImportedModelsResponse> listImportedModels({
  1. DateTime? creationTimeAfter,
  2. DateTime? creationTimeBefore,
  3. int? maxResults,
  4. String? nameContains,
  5. String? nextToken,
  6. SortModelsBy? sortBy,
  7. SortOrder? sortOrder,
})

Returns a list of models you've imported. 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 imported models that were created after the specified time.

Parameter creationTimeBefore : Return imported models that 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 models only if the model 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 models.

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

Implementation

Future<ListImportedModelsResponse> listImportedModels({
  DateTime? creationTimeAfter,
  DateTime? creationTimeBefore,
  int? maxResults,
  String? nameContains,
  String? nextToken,
  SortModelsBy? sortBy,
  SortOrder? sortOrder,
}) 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],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/imported-models',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListImportedModelsResponse.fromJson(response);
}