{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-forecast/json-schema/amazon-forecast-create-what-if-analysis-request-schema.json",
  "title": "CreateWhatIfAnalysisRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-forecast-what-if-analysis-api-openapi.yml#/components/schemas/CreateWhatIfAnalysisRequest",
  "type": "object",
  "properties": {
    "WhatIfAnalysisName": {
      "type": "string",
      "description": "The name of the what-if analysis. Each name must be unique."
    },
    "ForecastArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the baseline forecast."
    },
    "TimeSeriesSelector": {
      "$ref": "#/$defs/TimeSeriesSelector"
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "A list of tags to apply to the what if forecast."
    }
  },
  "required": [
    "WhatIfAnalysisName",
    "ForecastArn"
  ],
  "$defs": {
    "DataSource": {
      "type": "object",
      "properties": {
        "S3Config": {
          "$ref": "#/$defs/S3Config"
        }
      },
      "required": [
        "S3Config"
      ]
    },
    "S3Config": {
      "type": "object",
      "properties": {
        "Path": {
          "type": "string",
          "description": "The path to an Amazon Simple Storage Service (Amazon S3) bucket or file(s) in an Amazon S3 bucket."
        },
        "RoleArn": {
          "type": "string",
          "description": "The ARN of the Identity and Access Management (IAM) role that Amazon Forecast can assume to access the Amazon S3 bucket or files. If you provide a value for the KMSKeyArn key, the role must allow access to the key. Passing a role across Amazon Web Services accounts is not allowed. If you pass a role that isn't in your account, you get an InvalidInputException error."
        },
        "KMSKeyArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of an Key Management Service (KMS) key."
        }
      },
      "required": [
        "Path",
        "RoleArn"
      ]
    },
    "Schema": {
      "type": "object",
      "properties": {
        "Attributes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SchemaAttribute"
          },
          "description": "An array of attributes specifying the name and type of each field in a dataset."
        }
      }
    },
    "SchemaAttribute": {
      "type": "object",
      "properties": {
        "AttributeName": {
          "type": "string",
          "description": "The name of the dataset field."
        },
        "AttributeType": {
          "type": "string",
          "enum": [
            "string",
            "integer",
            "float",
            "timestamp",
            "geolocation"
          ],
          "description": "The data type of the field. For a related time series dataset, other than date, item_id, and forecast dimensions attributes, all attributes should be of numerical type (integer/float)."
        }
      }
    },
    "Tag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values."
        },
        "Value": {
          "type": "string",
          "description": "The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key)."
        }
      },
      "required": [
        "Key",
        "Value"
      ]
    },
    "TimeSeriesIdentifiers": {
      "type": "object",
      "properties": {
        "DataSource": {
          "$ref": "#/$defs/DataSource"
        },
        "Schema": {
          "$ref": "#/$defs/Schema"
        },
        "Format": {
          "type": "string",
          "description": "The format of the data, either CSV or PARQUET."
        }
      }
    },
    "TimeSeriesSelector": {
      "type": "object",
      "properties": {
        "TimeSeriesIdentifiers": {
          "$ref": "#/$defs/TimeSeriesIdentifiers"
        }
      }
    }
  }
}