{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/ModelCardName",
  "/properties/SecurityConfig"
 ],
 "definitions": {
  "AdditionalInformation": {
   "additionalProperties": false,
   "properties": {
    "CaveatsAndRecommendations": {
     "maxLength": 2048,
     "type": "string"
    },
    "CustomDetails": {
     "additionalProperties": false,
     "patternProperties": {
      "[a-zA-Z_][a-zA-Z0-9_]*": {
       "maxLength": 1024,
       "type": "string"
      }
     },
     "type": "object"
    },
    "EthicalConsiderations": {
     "maxLength": 2048,
     "type": "string"
    }
   },
   "type": "object"
  },
  "AxisNameArray": {
   "insertionOrder": true,
   "items": {
    "maxLength": 63,
    "type": "string"
   },
   "type": "array"
  },
  "AxisNameString": {
   "maxLength": 63,
   "type": "string"
  },
  "BarChartMetric": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "pattern": ".{1,255}",
     "type": "string"
    },
    "Notes": {
     "maxLength": 1024,
     "type": "string"
    },
    "Type": {
     "enum": [
      "bar_chart"
     ],
     "type": "string"
    },
    "Value": {
     "anyOf": [
      {
       "insertionOrder": true,
       "items": {
        "type": "number"
       },
       "minItems": 1,
       "type": "array"
      }
     ]
    },
    "XAxisName": {
     "$ref": "#/definitions/AxisNameArray"
    },
    "YAxisName": {
     "$ref": "#/definitions/AxisNameString"
    }
   },
   "required": [
    "Name",
    "Type",
    "Value"
   ],
   "type": "object"
  },
  "BusinessDetails": {
   "additionalProperties": false,
   "properties": {
    "BusinessProblem": {
     "maxLength": 2048,
     "type": "string"
    },
    "BusinessStakeholders": {
     "maxLength": 2048,
     "type": "string"
    },
    "LineOfBusiness": {
     "maxLength": 2048,
     "type": "string"
    }
   },
   "type": "object"
  },
  "Container": {
   "additionalProperties": false,
   "properties": {
    "Image": {
     "maxLength": 255,
     "type": "string"
    },
    "ModelDataUrl": {
     "maxLength": 1024,
     "type": "string"
    },
    "NearestModelName": {
     "type": "string"
    }
   },
   "required": [
    "Image"
   ],
   "type": "object"
  },
  "Content": {
   "additionalProperties": false,
   "maxLength": 100000,
   "minLength": 0,
   "properties": {
    "AdditionalInformation": {
     "$ref": "#/definitions/AdditionalInformation"
    },
    "BusinessDetails": {
     "$ref": "#/definitions/BusinessDetails"
    },
    "EvaluationDetails": {
     "$ref": "#/definitions/EvaluationDetails"
    },
    "IntendedUses": {
     "$ref": "#/definitions/IntendedUses"
    },
    "ModelOverview": {
     "$ref": "#/definitions/ModelOverview"
    },
    "ModelPackageDetails": {
     "$ref": "#/definitions/ModelPackageDetails"
    },
    "TrainingDetails": {
     "$ref": "#/definitions/TrainingDetails"
    }
   },
   "type": "object"
  },
  "EvaluationDetail": {
   "additionalProperties": false,
   "properties": {
    "Datasets": {
     "insertionOrder": true,
     "items": {
      "maxLength": 1024,
      "type": "string"
     },
     "maxItems": 10,
     "type": "array"
    },
    "EvaluationJobArn": {
     "maxLength": 256,
     "type": "string"
    },
    "EvaluationObservation": {
     "maxLength": 2096,
     "type": "string"
    },
    "Metadata": {
     "additionalProperties": false,
     "patternProperties": {
      "[a-zA-Z_][a-zA-Z0-9_]*": {
       "maxLength": 1024,
       "type": "string"
      }
     },
     "type": "object"
    },
    "MetricGroups": {
     "default": [],
     "insertionOrder": true,
     "items": {
      "$ref": "#/definitions/MetricGroup"
     },
     "type": "array"
    },
    "Name": {
     "pattern": ".{1,63}",
     "type": "string"
    }
   },
   "required": [
    "Name"
   ],
   "type": "object"
  },
  "EvaluationDetails": {
   "default": [],
   "insertionOrder": true,
   "items": {
    "$ref": "#/definitions/EvaluationDetail"
   },
   "type": "array"
  },
  "InferenceSpecification": {
   "additionalProperties": false,
   "properties": {
    "Containers": {
     "insertionOrder": true,
     "items": {
      "$ref": "#/definitions/Container"
     },
     "maxItems": 15,
     "minItems": 1,
     "type": "array"
    }
   },
   "required": [
    "Containers"
   ],
   "type": "object"
  },
  "IntendedUses": {
   "additionalProperties": false,
   "properties": {
    "ExplanationsForRiskRating": {
     "maxLength": 2048,
     "type": "string"
    },
    "FactorsAffectingModelEfficiency": {
     "maxLength": 2048,
     "type": "string"
    },
    "IntendedUses": {
     "maxLength": 2048,
     "type": "string"
    },
    "PurposeOfModel": {
     "maxLength": 2048,
     "type": "string"
    },
    "RiskRating": {
     "$ref": "#/definitions/RiskRating"
    }
   },
   "type": "object"
  },
  "LinearGraphMetric": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "pattern": ".{1,255}",
     "type": "string"
    },
    "Notes": {
     "maxLength": 1024,
     "type": "string"
    },
    "Type": {
     "enum": [
      "linear_graph"
     ],
     "type": "string"
    },
    "Value": {
     "anyOf": [
      {
       "insertionOrder": true,
       "items": {
        "insertionOrder": true,
        "items": {
         "type": "number"
        },
        "maxItems": 2,
        "minItems": 2,
        "type": "array"
       },
       "minItems": 1,
       "type": "array"
      }
     ]
    },
    "XAxisName": {
     "$ref": "#/definitions/AxisNameString"
    },
    "YAxisName": {
     "$ref": "#/definitions/AxisNameString"
    }
   },
   "required": [
    "Name",
    "Type",
    "Value"
   ],
   "type": "object"
  },
  "MatrixMetric": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "pattern": ".{1,255}",
     "type": "string"
    },
    "Notes": {
     "maxLength": 1024,
     "type": "string"
    },
    "Type": {
     "enum": [
      "matrix"
     ],
     "type": "string"
    },
    "Value": {
     "anyOf": [
      {
       "insertionOrder": true,
       "items": {
        "insertionOrder": true,
        "items": {
         "type": "number"
        },
        "maxItems": 20,
        "minItems": 1,
        "type": "array"
       },
       "maxItems": 20,
       "minItems": 1,
       "type": "array"
      }
     ]
    },
    "XAxisName": {
     "$ref": "#/definitions/AxisNameArray"
    },
    "YAxisName": {
     "$ref": "#/definitions/AxisNameArray"
    }
   },
   "required": [
    "Name",
    "Type",
    "Value"
   ],
   "type": "object"
  },
  "MetricGroup": {
   "additionalProperties": false,
   "properties": {
    "MetricData": {
     "insertionOrder": true,
     "items": {
      "anyOf": [
       {
        "$ref": "#/definitions/SimpleMetric"
       },
       {
        "$ref": "#/definitions/LinearGraphMetric"
       },
       {
        "$ref": "#/definitions/BarChartMetric"
       },
       {
        "$ref": "#/definitions/MatrixMetric"
       }
      ]
     },
     "type": "array"
    },
    "Name": {
     "pattern": ".{1,63}",
     "type": "string"
    }
   },
   "required": [
    "Name",
    "MetricData"
   ],
   "type": "object"
  },
  "ModelOverview": {
   "additionalProperties": false,
   "properties": {
    "AlgorithmType": {
     "maxLength": 1024,
     "type": "string"
    },
    "InferenceEnvironment": {
     "additionalProperties": false,
     "properties": {
      "ContainerImage": {
       "insertionOrder": true,
       "items": {
        "maxLength": 1024,
        "type": "string"
       },
       "maxItems": 15,
       "type": "array"
      }
     },
     "type": "object"
    },
    "ModelArtifact": {
     "insertionOrder": true,
     "items": {
      "maxLength": 1024,
      "type": "string"
     },
     "maxItems": 15,
     "type": "array"
    },
    "ModelCreator": {
     "maxLength": 1024,
     "type": "string"
    },
    "ModelDescription": {
     "maxLength": 1024,
     "type": "string"
    },
    "ModelId": {
     "maxLength": 1024,
     "type": "string"
    },
    "ModelName": {
     "maxLength": 1024,
     "type": "string"
    },
    "ModelOwner": {
     "maxLength": 1024,
     "type": "string"
    },
    "ModelVersion": {
     "minimum": 1,
     "type": "number"
    },
    "ProblemType": {
     "maxLength": 1024,
     "type": "string"
    }
   },
   "type": "object"
  },
  "ModelPackageCreator": {
   "additionalProperties": false,
   "properties": {
    "UserProfileName": {
     "maxLength": 63,
     "type": "string"
    }
   },
   "type": "object"
  },
  "ModelPackageDetails": {
   "additionalProperties": false,
   "properties": {
    "ApprovalDescription": {
     "maxLength": 1024,
     "type": "string"
    },
    "CreatedBy": {
     "$ref": "#/definitions/ModelPackageCreator"
    },
    "Domain": {
     "type": "string"
    },
    "InferenceSpecification": {
     "$ref": "#/definitions/InferenceSpecification"
    },
    "ModelApprovalStatus": {
     "enum": [
      "Approved",
      "Rejected",
      "PendingManualApproval"
     ],
     "type": "string"
    },
    "ModelPackageArn": {
     "maxLength": 2048,
     "minLength": 1,
     "type": "string"
    },
    "ModelPackageDescription": {
     "maxLength": 1024,
     "type": "string"
    },
    "ModelPackageGroupName": {
     "maxLength": 63,
     "minLength": 1,
     "type": "string"
    },
    "ModelPackageName": {
     "maxLength": 63,
     "minLength": 1,
     "type": "string"
    },
    "ModelPackageStatus": {
     "enum": [
      "Pending",
      "InProgress",
      "Completed",
      "Failed",
      "Deleting"
     ],
     "type": "string"
    },
    "ModelPackageVersion": {
     "minimum": 1.0,
     "type": "number"
    },
    "SourceAlgorithms": {
     "$ref": "#/definitions/SourceAlgorithms"
    },
    "Task": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "ObjectiveFunction": {
   "additionalProperties": false,
   "properties": {
    "Function": {
     "additionalProperties": false,
     "properties": {
      "Condition": {
       "maxLength": 63,
       "type": "string"
      },
      "Facet": {
       "maxLength": 63,
       "type": "string"
      },
      "Function": {
       "enum": [
        "Maximize",
        "Minimize"
       ],
       "type": "string"
      }
     },
     "type": "object"
    },
    "Notes": {
     "maxLength": 1024,
     "type": "string"
    }
   },
   "type": "object"
  },
  "RiskRating": {
   "enum": [
    "High",
    "Medium",
    "Low",
    "Unknown"
   ],
   "type": "string"
  },
  "SecurityConfig": {
   "additionalProperties": false,
   "properties": {
    "KmsKeyId": {
     "anyOf": [
      {
       "format": "AWS::KMS::Key.Arn"
      },
      {
       "format": "AWS::KMS::Key.Id"
      },
      {
       "format": "AWS::KMS::Alias.AliasName"
      }
     ],
     "maxLength": 2048,
     "minLength": 0,
     "pattern": ".*",
     "type": "string"
    }
   },
   "type": "object"
  },
  "SimpleMetric": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "pattern": ".{1,255}",
     "type": "string"
    },
    "Notes": {
     "maxLength": 1024,
     "type": "string"
    },
    "Type": {
     "enum": [
      "number",
      "string",
      "boolean"
     ],
     "type": "string"
    },
    "Value": {
     "anyOf": [
      {
       "type": "number"
      },
      {
       "maxLength": 63,
       "type": "string"
      },
      {
       "type": "boolean"
      }
     ]
    },
    "XAxisName": {
     "$ref": "#/definitions/AxisNameString"
    },
    "YAxisName": {
     "$ref": "#/definitions/AxisNameString"
    }
   },
   "required": [
    "Name",
    "Type",
    "Value"
   ],
   "type": "object"
  },
  "SourceAlgorithm": {
   "additionalProperties": false,
   "properties": {
    "AlgorithmName": {
     "maxLength": 170,
     "type": "string"
    },
    "ModelDataUrl": {
     "maxLength": 1024,
     "type": "string"
    }
   },
   "required": [
    "AlgorithmName"
   ],
   "type": "object"
  },
  "SourceAlgorithms": {
   "insertionOrder": true,
   "items": {
    "$ref": "#/definitions/SourceAlgorithm"
   },
   "maxItems": 1,
   "minItems": 1,
   "type": "array"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 128,
     "minLength": 1,
     "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$",
     "type": "string"
    },
    "Value": {
     "maxLength": 256,
     "minLength": 0,
     "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$",
     "type": "string"
    }
   },
   "required": [
    "Key",
    "Value"
   ],
   "type": "object"
  },
  "TrainingDetails": {
   "additionalProperties": false,
   "properties": {
    "ObjectiveFunction": {
     "$ref": "#/definitions/ObjectiveFunction"
    },
    "TrainingJobDetails": {
     "additionalProperties": false,
     "properties": {
      "HyperParameters": {
       "insertionOrder": true,
       "items": {
        "$ref": "#/definitions/TrainingHyperParameter",
        "maxItems": 100
       },
       "type": "array"
      },
      "TrainingArn": {
       "maxLength": 1024,
       "type": "string"
      },
      "TrainingDatasets": {
       "insertionOrder": true,
       "items": {
        "maxLength": 1024,
        "type": "string"
       },
       "maxItems": 15,
       "type": "array"
      },
      "TrainingEnvironment": {
       "additionalProperties": false,
       "properties": {
        "ContainerImage": {
         "insertionOrder": true,
         "items": {
          "maxLength": 1024,
          "type": "string"
         },
         "maxItems": 15,
         "type": "array"
        }
       },
       "type": "object"
      },
      "TrainingMetrics": {
       "insertionOrder": true,
       "items": {
        "$ref": "#/definitions/TrainingMetric",
        "maxItems": 50
       },
       "type": "array"
      },
      "UserProvidedHyperParameters": {
       "insertionOrder": true,
       "items": {
        "$ref": "#/definitions/TrainingHyperParameter",
        "maxItems": 100
       },
       "type": "array"
      },
      "UserProvidedTrainingMetrics": {
       "insertionOrder": true,
       "items": {
        "$ref": "#/definitions/TrainingMetric",
        "maxItems": 50
       },
       "type": "array"
      }
     },
     "type": "object"
    },
    "TrainingObservations": {
     "maxLength": 1024,
     "type": "string"
    }
   },
   "type": "object"
  },
  "TrainingHyperParameter": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "pattern": ".{1,255}",
     "type": "string"
    },
    "Value": {
     "pattern": ".{1,255}",
     "type": "string"
    }
   },
   "required": [
    "Name",
    "Value"
   ],
   "type": "object"
  },
  "TrainingMetric": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "pattern": ".{1,255}",
     "type": "string"
    },
    "Notes": {
     "maxLength": 1024,
     "type": "string"
    },
    "Value": {
     "type": "number"
    }
   },
   "required": [
    "Name",
    "Value"
   ],
   "type": "object"
  },
  "UserContext": {
   "additionalProperties": false,
   "properties": {
    "DomainId": {
     "default": "UnsetValue",
     "type": "string"
    },
    "UserProfileArn": {
     "default": "UnsetValue",
     "type": "string"
    },
    "UserProfileName": {
     "default": "UnsetValue",
     "type": "string"
    }
   },
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/ModelCardName"
 ],
 "properties": {
  "Content": {
   "$ref": "#/definitions/Content"
  },
  "CreatedBy": {
   "$ref": "#/definitions/UserContext"
  },
  "CreationTime": {
   "type": "string"
  },
  "LastModifiedBy": {
   "$ref": "#/definitions/UserContext"
  },
  "LastModifiedTime": {
   "type": "string"
  },
  "ModelCardArn": {
   "maxLength": 256,
   "minLength": 1,
   "pattern": "^arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]{9,16}:[0-9]{12}:model-card/[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}$",
   "type": "string"
  },
  "ModelCardName": {
   "maxLength": 63,
   "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}$",
   "type": "string"
  },
  "ModelCardProcessingStatus": {
   "default": "UnsetValue",
   "enum": [
    "UnsetValue",
    "DeleteInProgress",
    "DeletePending",
    "ContentDeleted",
    "ExportJobsDeleted",
    "DeleteCompleted",
    "DeleteFailed"
   ],
   "type": "string"
  },
  "ModelCardStatus": {
   "enum": [
    "Draft",
    "PendingReview",
    "Approved",
    "Archived"
   ],
   "type": "string"
  },
  "ModelCardVersion": {
   "minimum": 1,
   "type": "integer"
  },
  "SecurityConfig": {
   "$ref": "#/definitions/SecurityConfig"
  },
  "Tags": {
   "insertionOrder": true,
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "maxItems": 50,
   "minItems": 1,
   "type": "array"
  }
 },
 "readOnlyProperties": [
  "/properties/ModelCardArn",
  "/properties/ModelCardVersion",
  "/properties/CreatedBy/DomainId",
  "/properties/CreatedBy/UserProfileArn",
  "/properties/CreatedBy/UserProfileName",
  "/properties/LastModifiedBy/DomainId",
  "/properties/LastModifiedBy/UserProfileArn",
  "/properties/LastModifiedBy/UserProfileName",
  "/properties/CreationTime",
  "/properties/LastModifiedTime",
  "/properties/ModelCardProcessingStatus"
 ],
 "required": [
  "ModelCardName",
  "Content",
  "ModelCardStatus"
 ],
 "tagging": {
  "cloudFormationSystemTags": true,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::SageMaker::ModelCard"
}
