{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-forecast/json-schema/amazon-forecast-create-what-if-forecast-request-schema.json",
  "title": "CreateWhatIfForecastRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-forecast-what-if-forecast-api-openapi.yml#/components/schemas/CreateWhatIfForecastRequest",
  "type": "object",
  "properties": {
    "WhatIfForecastName": {
      "type": "string",
      "description": "The name of the what-if forecast. Names must be unique within each what-if analysis."
    },
    "WhatIfAnalysisArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the what-if analysis."
    },
    "TimeSeriesTransformations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TimeSeriesTransformation"
      },
      "description": "The transformations that are applied to the baseline time series. Each transformation contains an action and a set of conditions. An action is applied only when all conditions are met. If no conditions are provided, the action is applied to all items."
    },
    "TimeSeriesReplacementsDataSource": {
      "$ref": "#/$defs/TimeSeriesReplacementsDataSource"
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "A list of tags to apply to the what if forecast."
    }
  },
  "required": [
    "WhatIfForecastName",
    "WhatIfAnalysisArn"
  ],
  "$defs": {
    "Action": {
      "type": "object",
      "properties": {
        "AttributeName": {
          "type": "string",
          "description": "The related time series that you are modifying. This value is case insensitive."
        },
        "Operation": {
          "type": "string",
          "enum": [
            "ADD",
            "SUBTRACT",
            "MULTIPLY",
            "DIVIDE"
          ],
          "description": "The operation that is applied to the provided attribute. Operations include: ADD - adds Value to all rows of AttributeName. SUBTRACT - subtracts Value from all rows of AttributeName. MULTIPLY - multiplies all rows of AttributeName by Value. DIVIDE - divides all rows of AttributeName by Value."
        },
        "Value": {
          "type": "number",
          "description": "The value that is applied for the chosen Operation."
        }
      },
      "required": [
        "AttributeName",
        "Operation",
        "Value"
      ]
    },
    "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"
      ]
    },
    "TimeSeriesCondition": {
      "type": "object",
      "properties": {
        "AttributeName": {
          "type": "string",
          "description": "The item_id, dimension name, IM name, or timestamp that you are modifying."
        },
        "AttributeValue": {
          "type": "string",
          "description": "The value that is applied for the chosen Condition."
        },
        "Condition": {
          "type": "string",
          "enum": [
            "EQUALS",
            "NOT_EQUALS",
            "LESS_THAN",
            "GREATER_THAN"
          ],
          "description": "The condition to apply. Valid values are EQUALS, NOT_EQUALS, LESS_THAN and GREATER_THAN."
        }
      },
      "required": [
        "AttributeName",
        "AttributeValue",
        "Condition"
      ]
    },
    "TimeSeriesReplacementsDataSource": {
      "type": "object",
      "properties": {
        "S3Config": {
          "$ref": "#/$defs/S3Config"
        },
        "Schema": {
          "$ref": "#/$defs/Schema"
        },
        "Format": {
          "type": "string",
          "description": "The format of the replacement data, CSV or PARQUET."
        },
        "TimestampFormat": {
          "type": "string",
          "description": "The timestamp format of the replacement data."
        }
      },
      "required": [
        "S3Config",
        "Schema"
      ]
    },
    "TimeSeriesTransformation": {
      "type": "object",
      "properties": {
        "Action": {
          "$ref": "#/$defs/Action"
        },
        "TimeSeriesConditions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TimeSeriesCondition"
          },
          "description": "An array of conditions that define which members of the related time series are transformed."
        }
      }
    }
  }
}