{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/Name",
  "/properties/MembershipIdentifier",
  "/properties/Source",
  "/properties/Source/Text",
  "/properties/Format",
  "/properties/AnalysisParameters"
 ],
 "definitions": {
  "AnalysisParameter": {
   "additionalProperties": false,
   "properties": {
    "DefaultValue": {
     "maxLength": 250,
     "minLength": 0,
     "type": "string"
    },
    "Name": {
     "maxLength": 100,
     "minLength": 1,
     "pattern": "[0-9a-zA-Z_]+",
     "type": "string"
    },
    "Type": {
     "enum": [
      "SMALLINT",
      "INTEGER",
      "BIGINT",
      "DECIMAL",
      "REAL",
      "DOUBLE_PRECISION",
      "BOOLEAN",
      "CHAR",
      "VARCHAR",
      "DATE",
      "TIMESTAMP",
      "TIMESTAMPTZ",
      "TIME",
      "TIMETZ",
      "VARBYTE",
      "BINARY",
      "BYTE",
      "CHARACTER",
      "DOUBLE",
      "FLOAT",
      "INT",
      "LONG",
      "NUMERIC",
      "SHORT",
      "STRING",
      "TIMESTAMP_LTZ",
      "TIMESTAMP_NTZ",
      "TINYINT"
     ],
     "type": "string"
    }
   },
   "required": [
    "Name",
    "Type"
   ],
   "type": "object"
  },
  "AnalysisSchema": {
   "additionalProperties": false,
   "properties": {
    "ReferencedTables": {
     "$ref": "#/definitions/ReferencedTables"
    }
   },
   "required": [
    "ReferencedTables"
   ],
   "type": "object"
  },
  "AnalysisSource": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "Text": {
       "maxLength": 90000,
       "minLength": 0,
       "type": "string"
      }
     },
     "required": [
      "Text"
     ],
     "title": "Text",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "Artifacts": {
       "$ref": "#/definitions/AnalysisTemplateArtifacts"
      }
     },
     "required": [
      "Artifacts"
     ],
     "title": "Artifacts",
     "type": "object"
    }
   ]
  },
  "AnalysisSourceMetadata": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "Artifacts": {
       "$ref": "#/definitions/AnalysisTemplateArtifactMetadata"
      }
     },
     "required": [
      "Artifacts"
     ],
     "title": "Artifacts",
     "type": "object"
    }
   ]
  },
  "AnalysisTemplateArtifact": {
   "additionalProperties": false,
   "properties": {
    "Location": {
     "$ref": "#/definitions/S3Location"
    }
   },
   "required": [
    "Location"
   ],
   "type": "object"
  },
  "AnalysisTemplateArtifactMetadata": {
   "additionalProperties": false,
   "properties": {
    "AdditionalArtifactHashes": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/Hash"
     },
     "type": "array"
    },
    "EntryPointHash": {
     "$ref": "#/definitions/Hash"
    }
   },
   "required": [
    "EntryPointHash"
   ],
   "type": "object"
  },
  "AnalysisTemplateArtifacts": {
   "additionalProperties": false,
   "properties": {
    "AdditionalArtifacts": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/AnalysisTemplateArtifact"
     },
     "maxItems": 1,
     "minItems": 1,
     "type": "array"
    },
    "EntryPoint": {
     "$ref": "#/definitions/AnalysisTemplateArtifact"
    },
    "RoleArn": {
     "format": "AWS::IAM::Role.Arn",
     "maxLength": 512,
     "minLength": 32,
     "type": "string"
    }
   },
   "required": [
    "EntryPoint",
    "RoleArn"
   ],
   "type": "object"
  },
  "ColumnClassificationDetails": {
   "additionalProperties": false,
   "properties": {
    "ColumnMapping": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/SyntheticDataColumnProperties"
     },
     "maxItems": 1000,
     "minItems": 5,
     "type": "array"
    }
   },
   "required": [
    "ColumnMapping"
   ],
   "type": "object"
  },
  "ErrorMessageConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Type": {
     "enum": [
      "DETAILED"
     ],
     "type": "string"
    }
   },
   "required": [
    "Type"
   ],
   "type": "object"
  },
  "Hash": {
   "additionalProperties": false,
   "properties": {
    "Sha256": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "MLSyntheticDataParameters": {
   "additionalProperties": false,
   "properties": {
    "ColumnClassification": {
     "$ref": "#/definitions/ColumnClassificationDetails"
    },
    "Epsilon": {
     "maximum": 10,
     "minimum": 0.0001,
     "type": "number"
    },
    "MaxMembershipInferenceAttackScore": {
     "maximum": 1,
     "minimum": 0.5,
     "type": "number"
    }
   },
   "required": [
    "Epsilon",
    "MaxMembershipInferenceAttackScore",
    "ColumnClassification"
   ],
   "type": "object"
  },
  "ReferencedTables": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/TableName"
   },
   "minItems": 0,
   "type": "array"
  },
  "S3Location": {
   "additionalProperties": false,
   "properties": {
    "Bucket": {
     "maxLength": 63,
     "minLength": 3,
     "type": "string"
    },
    "Key": {
     "type": "string"
    }
   },
   "required": [
    "Bucket",
    "Key"
   ],
   "type": "object"
  },
  "SyntheticDataColumnProperties": {
   "additionalProperties": false,
   "properties": {
    "ColumnName": {
     "maxLength": 128,
     "pattern": "^[a-z0-9_](([a-z0-9_]+-)*([a-z0-9_]+))?$",
     "type": "string"
    },
    "ColumnType": {
     "enum": [
      "CATEGORICAL",
      "NUMERICAL"
     ],
     "type": "string"
    },
    "IsPredictiveValue": {
     "type": "boolean"
    }
   },
   "required": [
    "ColumnName",
    "ColumnType",
    "IsPredictiveValue"
   ],
   "type": "object"
  },
  "SyntheticDataParameters": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "MlSyntheticDataParameters": {
       "$ref": "#/definitions/MLSyntheticDataParameters"
      }
     },
     "required": [
      "MlSyntheticDataParameters"
     ],
     "title": "MlSyntheticDataParameters",
     "type": "object"
    }
   ]
  },
  "TableName": {
   "maxLength": 128,
   "pattern": "^[a-zA-Z0-9_](([a-zA-Z0-9_ ]+-)*([a-zA-Z0-9_ ]+))?$",
   "type": "string"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 128,
     "minLength": 1,
     "type": "string"
    },
    "Value": {
     "maxLength": 256,
     "minLength": 1,
     "type": "string"
    }
   },
   "required": [
    "Value",
    "Key"
   ],
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/AnalysisTemplateIdentifier",
  "/properties/MembershipIdentifier"
 ],
 "properties": {
  "AnalysisParameters": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/AnalysisParameter"
   },
   "maxItems": 10,
   "minItems": 0,
   "type": "array"
  },
  "AnalysisTemplateIdentifier": {
   "maxLength": 36,
   "minLength": 36,
   "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
   "type": "string"
  },
  "Arn": {
   "maxLength": 200,
   "type": "string"
  },
  "CollaborationArn": {
   "maxLength": 100,
   "type": "string"
  },
  "CollaborationIdentifier": {
   "maxLength": 36,
   "minLength": 36,
   "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
   "type": "string"
  },
  "Description": {
   "maxLength": 255,
   "pattern": "^[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDBFF-\\uDC00\\uDFFF\\t\\r\\n]*$",
   "type": "string"
  },
  "ErrorMessageConfiguration": {
   "$ref": "#/definitions/ErrorMessageConfiguration"
  },
  "Format": {
   "enum": [
    "SQL",
    "PYSPARK_1_0"
   ],
   "type": "string"
  },
  "MembershipArn": {
   "maxLength": 100,
   "type": "string"
  },
  "MembershipIdentifier": {
   "maxLength": 36,
   "minLength": 36,
   "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
   "type": "string"
  },
  "Name": {
   "maxLength": 128,
   "pattern": "^[a-zA-Z0-9_](([a-zA-Z0-9_ ]+-)*([a-zA-Z0-9_ ]+))?$",
   "type": "string"
  },
  "Schema": {
   "$ref": "#/definitions/AnalysisSchema"
  },
  "Source": {
   "$ref": "#/definitions/AnalysisSource"
  },
  "SourceMetadata": {
   "$ref": "#/definitions/AnalysisSourceMetadata"
  },
  "SyntheticDataParameters": {
   "$ref": "#/definitions/SyntheticDataParameters"
  },
  "Tags": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "type": "array"
  }
 },
 "readOnlyProperties": [
  "/properties/CollaborationArn",
  "/properties/CollaborationIdentifier",
  "/properties/AnalysisTemplateIdentifier",
  "/properties/Arn",
  "/properties/MembershipArn"
 ],
 "replacementStrategy": "delete_then_create",
 "required": [
  "Source",
  "Format",
  "Name",
  "MembershipIdentifier"
 ],
 "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-cleanrooms",
 "tagging": {
  "cloudFormationSystemTags": true,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::CleanRooms::AnalysisTemplate"
}
