createModelCard method

Future<CreateModelCardResponse> createModelCard({
  1. required String content,
  2. required String modelCardName,
  3. required ModelCardStatus modelCardStatus,
  4. ModelCardSecurityConfig? securityConfig,
  5. List<Tag>? tags,
})

Creates an Amazon SageMaker Model Card.

For information about how to use model cards, see Amazon SageMaker Model Card.

May throw ConflictException. May throw ResourceLimitExceeded.

Parameter content : The content of the model card. Content must be in model card JSON schema and provided as a string.

Parameter modelCardName : The unique name of the model card.

Parameter modelCardStatus : The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.

  • Draft: The model card is a work in progress.
  • PendingReview: The model card is pending review.
  • Approved: The model card is approved.
  • Archived: The model card is archived. No more updates should be made to the model card, but it can still be exported.

Parameter securityConfig : An optional Key Management Service key to encrypt, decrypt, and re-encrypt model card content for regulated workloads with highly sensitive data.

Parameter tags : Key-value pairs used to manage metadata for model cards.

Implementation

Future<CreateModelCardResponse> createModelCard({
  required String content,
  required String modelCardName,
  required ModelCardStatus modelCardStatus,
  ModelCardSecurityConfig? securityConfig,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateModelCard'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Content': content,
      'ModelCardName': modelCardName,
      'ModelCardStatus': modelCardStatus.value,
      if (securityConfig != null) 'SecurityConfig': securityConfig,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateModelCardResponse.fromJson(jsonResponse.body);
}