listJobSchemaVersions method

Future<ListJobSchemaVersionsResponse> listJobSchemaVersions({
  1. required JobCategory jobCategory,
  2. int? maxResults,
  3. String? nextToken,
})

Lists available configuration schema versions for a specified job category. Use the schema versions with DescribeJobSchemaVersion to retrieve the full schema document.

The following operations are related to ListJobSchemaVersions:

  • DescribeJobSchemaVersion
  • CreateJob

May throw ResourceNotFound.

Parameter jobCategory : The category of job schemas to list.

Parameter maxResults : The maximum number of schema versions to return in the response. The default value is 5.

Parameter nextToken : If the previous response was truncated, this token retrieves the next set of results.

Implementation

Future<ListJobSchemaVersionsResponse> listJobSchemaVersions({
  required JobCategory jobCategory,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListJobSchemaVersions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'JobCategory': jobCategory.value,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListJobSchemaVersionsResponse.fromJson(jsonResponse.body);
}