createModelCardExportJob method

Future<CreateModelCardExportJobResponse> createModelCardExportJob({
  1. required String modelCardExportJobName,
  2. required String modelCardName,
  3. required ModelCardExportOutputConfig outputConfig,
  4. int? modelCardVersion,
})

Creates an Amazon SageMaker Model Card export job.

May throw ConflictException. May throw ResourceLimitExceeded. May throw ResourceNotFound.

Parameter modelCardExportJobName : The name of the model card export job.

Parameter modelCardName : The name or Amazon Resource Name (ARN) of the model card to export.

Parameter outputConfig : The model card output configuration that specifies the Amazon S3 path for exporting.

Parameter modelCardVersion : The version of the model card to export. If a version is not provided, then the latest version of the model card is exported.

Implementation

Future<CreateModelCardExportJobResponse> createModelCardExportJob({
  required String modelCardExportJobName,
  required String modelCardName,
  required ModelCardExportOutputConfig outputConfig,
  int? modelCardVersion,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateModelCardExportJob'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ModelCardExportJobName': modelCardExportJobName,
      'ModelCardName': modelCardName,
      'OutputConfig': outputConfig,
      if (modelCardVersion != null) 'ModelCardVersion': modelCardVersion,
    },
  );

  return CreateModelCardExportJobResponse.fromJson(jsonResponse.body);
}