{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-clean-rooms/json-schema/amazon-clean-rooms-create-analysis-template-input-schema.json",
  "title": "CreateAnalysisTemplateInput",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-clean-rooms-analysistemplates-api-openapi.yml#/components/schemas/CreateAnalysisTemplateInput",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "The description of the analysis template."
    },
    "membershipIdentifier": {
      "type": "string",
      "description": "The identifier for a membership resource."
    },
    "name": {
      "type": "string",
      "description": "The name of the analysis template."
    },
    "format": {
      "type": "string",
      "enum": [
        "SQL",
        "PYSPARK_1_0"
      ],
      "description": "The format of the analysis template."
    },
    "source": {
      "$ref": "#/$defs/AnalysisSource"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "An optional label that you can assign to a resource when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to this resource."
    },
    "analysisParameters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AnalysisParameter"
      },
      "description": "The parameters of the analysis template."
    },
    "schema": {
      "$ref": "#/$defs/AnalysisSchema"
    },
    "errorMessageConfiguration": {
      "$ref": "#/$defs/ErrorMessageConfiguration"
    },
    "syntheticDataParameters": {
      "$ref": "#/$defs/SyntheticDataParameters"
    }
  },
  "required": [
    "membershipIdentifier",
    "name",
    "format",
    "source"
  ],
  "$defs": {
    "AnalysisParameter": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the parameter. The name must use only alphanumeric or underscore (_) characters."
        },
        "type": {
          "type": "string",
          "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"
          ],
          "description": "The type of parameter."
        },
        "defaultValue": {
          "type": "string",
          "description": "Optional. The default value that is applied in the analysis template. The member who can query can override this value in the query editor."
        }
      },
      "required": [
        "name",
        "type"
      ]
    },
    "AnalysisSchema": {
      "type": "object",
      "properties": {
        "referencedTables": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The tables referenced in the analysis schema."
        }
      }
    },
    "AnalysisSource": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "description": "The query text."
        },
        "artifacts": {
          "$ref": "#/$defs/AnalysisTemplateArtifacts"
        }
      },
      "description": "Exactly one member is set."
    },
    "AnalysisTemplateArtifact": {
      "type": "object",
      "properties": {
        "location": {
          "$ref": "#/$defs/S3Location"
        }
      },
      "required": [
        "location"
      ]
    },
    "AnalysisTemplateArtifacts": {
      "type": "object",
      "properties": {
        "entryPoint": {
          "$ref": "#/$defs/AnalysisTemplateArtifact"
        },
        "additionalArtifacts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AnalysisTemplateArtifact"
          },
          "description": "Additional artifacts for the analysis template."
        },
        "roleArn": {
          "type": "string",
          "description": "The role ARN for the analysis template artifacts."
        }
      },
      "required": [
        "entryPoint",
        "roleArn"
      ]
    },
    "ColumnClassificationDetails": {
      "type": "object",
      "properties": {
        "columnMapping": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SyntheticDataColumnProperties"
          },
          "description": "A mapping that defines the classification of data columns for synthetic data generation and specifies how each column should be handled during the privacy-preserving data synthesis process."
        }
      },
      "required": [
        "columnMapping"
      ]
    },
    "ErrorMessageConfiguration": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "DETAILED"
          ],
          "description": "The level of detail for error messages returned by the PySpark job. When set to DETAILED, error messages include more information to help troubleshoot issues with your PySpark job. Because this setting may expose sensitive data, it is recommended for development and testing environments."
        }
      },
      "required": [
        "type"
      ]
    },
    "MLSyntheticDataParameters": {
      "type": "object",
      "properties": {
        "epsilon": {
          "type": "number",
          "description": "The epsilon value for differential privacy when generating synthetic data. Lower values provide stronger privacy guarantees but may reduce data utility."
        },
        "maxMembershipInferenceAttackScore": {
          "type": "number",
          "description": "The maximum acceptable score for membership inference attack vulnerability. Synthetic data generation fails if the score for the resulting data exceeds this threshold."
        },
        "columnClassification": {
          "$ref": "#/$defs/ColumnClassificationDetails"
        }
      },
      "required": [
        "epsilon",
        "maxMembershipInferenceAttackScore",
        "columnClassification"
      ]
    },
    "S3Location": {
      "type": "object",
      "properties": {
        "bucket": {
          "type": "string",
          "description": "The bucket name."
        },
        "key": {
          "type": "string",
          "description": "The object key."
        }
      },
      "required": [
        "bucket",
        "key"
      ]
    },
    "SyntheticDataColumnProperties": {
      "type": "object",
      "properties": {
        "columnName": {
          "type": "string",
          "description": "The name of the data column as it appears in the dataset."
        },
        "columnType": {
          "type": "string",
          "enum": [
            "CATEGORICAL",
            "NUMERICAL"
          ],
          "description": "The data type of the column, which determines how the synthetic data generation algorithm processes and synthesizes values for this column."
        },
        "isPredictiveValue": {
          "type": "boolean",
          "description": "Indicates if this column contains predictive values that should be treated as target variables in machine learning models. This affects how the synthetic data generation preserves statistical relationships."
        }
      },
      "required": [
        "columnName",
        "columnType",
        "isPredictiveValue"
      ]
    },
    "SyntheticDataParameters": {
      "type": "object",
      "properties": {
        "mlSyntheticDataParameters": {
          "$ref": "#/$defs/MLSyntheticDataParameters"
        }
      },
      "description": "Exactly one member is set."
    }
  }
}