describeModelCard method

Future<DescribeModelCardResponse> describeModelCard({
  1. required String modelCardName,
  2. IncludedData? includedData,
  3. int? modelCardVersion,
})

Describes the content, creation time, and security configuration of an Amazon SageMaker Model Card.

May throw ResourceNotFound.

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

Parameter includedData : Specifies the level of model card data to include in the response. Use this parameter to call DescribeModelCard without requiring kms:Decrypt permission on the customer-managed Amazon Web Services KMS key.

  • AllData: Returns the full model card Content. This option requires kms:Decrypt permission on the customer-managed key, if one is associated with the model card. This is the default.
  • MetadataOnly: Returns the model card with sanitized Content that includes only a small set of unencrypted metadata fields. This option does not require kms:Decrypt permission. For the list of fields preserved in the response, see Content.
If you don't specify a value, SageMaker returns AllData.

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

Implementation

Future<DescribeModelCardResponse> describeModelCard({
  required String modelCardName,
  IncludedData? includedData,
  int? modelCardVersion,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.DescribeModelCard'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ModelCardName': modelCardName,
      if (includedData != null) 'IncludedData': includedData.value,
      if (modelCardVersion != null) 'ModelCardVersion': modelCardVersion,
    },
  );

  return DescribeModelCardResponse.fromJson(jsonResponse.body);
}