listAIBenchmarkJobs method

Future<ListAIBenchmarkJobsResponse> listAIBenchmarkJobs({
  1. DateTime? creationTimeAfter,
  2. DateTime? creationTimeBefore,
  3. int? maxResults,
  4. String? nameContains,
  5. String? nextToken,
  6. ListAIBenchmarkJobsSortBy? sortBy,
  7. SortOrder? sortOrder,
  8. AIBenchmarkJobStatus? statusEquals,
})

Returns a list of AI benchmark jobs in your account. You can filter the results by name, status, and creation time, and sort the results. The response is paginated.

Parameter creationTimeAfter : A filter that returns only jobs created after the specified time.

Parameter creationTimeBefore : A filter that returns only jobs created before the specified time.

Parameter maxResults : The maximum number of benchmark jobs to return in the response.

Parameter nameContains : A string in the job name. This filter returns only jobs whose name contains the specified string.

Parameter nextToken : If the previous call to ListAIBenchmarkJobs didn't return the full set of jobs, the call returns a token for getting the next set.

Parameter sortBy : The field to sort results by. The default is CreationTime.

Parameter sortOrder : The sort order for results. The default is Descending.

Parameter statusEquals : A filter that returns only benchmark jobs with the specified status.

Implementation

Future<ListAIBenchmarkJobsResponse> listAIBenchmarkJobs({
  DateTime? creationTimeAfter,
  DateTime? creationTimeBefore,
  int? maxResults,
  String? nameContains,
  String? nextToken,
  ListAIBenchmarkJobsSortBy? sortBy,
  SortOrder? sortOrder,
  AIBenchmarkJobStatus? statusEquals,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListAIBenchmarkJobs'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (creationTimeAfter != null)
        'CreationTimeAfter': unixTimestampToJson(creationTimeAfter),
      if (creationTimeBefore != null)
        'CreationTimeBefore': unixTimestampToJson(creationTimeBefore),
      if (maxResults != null) 'MaxResults': maxResults,
      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,
    },
  );

  return ListAIBenchmarkJobsResponse.fromJson(jsonResponse.body);
}