{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-connect/json-schema/amazon-connect-create-calculated-attribute-definition-response-schema.json",
  "title": "CreateCalculatedAttributeDefinitionResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-connect-calculated-attributes-api-openapi.yml#/components/schemas/CreateCalculatedAttributeDefinitionResponse",
  "type": "object",
  "properties": {
    "CalculatedAttributeName": {
      "type": "string",
      "description": "The unique name of the calculated attribute."
    },
    "DisplayName": {
      "type": "string",
      "description": "The display name of the calculated attribute."
    },
    "Description": {
      "type": "string",
      "description": "The description of the calculated attribute."
    },
    "AttributeDetails": {
      "$ref": "#/$defs/AttributeDetails"
    },
    "Conditions": {
      "$ref": "#/$defs/Conditions"
    },
    "Filter": {
      "$ref": "#/$defs/Filter"
    },
    "Statistic": {
      "type": "string",
      "enum": [
        "FIRST_OCCURRENCE",
        "LAST_OCCURRENCE",
        "COUNT",
        "SUM",
        "MINIMUM",
        "MAXIMUM",
        "AVERAGE",
        "MAX_OCCURRENCE",
        "RECENT_OCCURRENCES"
      ],
      "description": "The aggregation operation to perform for the calculated attribute."
    },
    "CreatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp of when the calculated attribute definition was created."
    },
    "LastUpdatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp of when the calculated attribute definition was most recently edited."
    },
    "UseHistoricalData": {
      "type": "boolean",
      "description": "Whether historical data ingested before the Calculated Attribute was created should be included in calculations."
    },
    "Status": {
      "type": "string",
      "enum": [
        "PREPARING",
        "IN_PROGRESS",
        "COMPLETED",
        "FAILED"
      ],
      "description": "Status of the Calculated Attribute creation (whether all historical data has been indexed.)"
    },
    "Readiness": {
      "$ref": "#/$defs/Readiness"
    },
    "Tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The tags used to organize, track, or control access for this resource."
    }
  },
  "$defs": {
    "AttributeDetails": {
      "type": "object",
      "properties": {
        "Attributes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AttributeItem"
          },
          "description": "A list of attribute items specified in the mathematical expression."
        },
        "Expression": {
          "type": "string",
          "description": "Mathematical expression that is performed on attribute items provided in the attribute list. Each element in the expression should follow the structure of \\\"{ObjectTypeName.AttributeName}\\\"."
        }
      },
      "required": [
        "Attributes",
        "Expression"
      ]
    },
    "AttributeItem": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name of an attribute defined in a profile object type."
        }
      },
      "required": [
        "Name"
      ]
    },
    "Conditions": {
      "type": "object",
      "properties": {
        "Range": {
          "$ref": "#/$defs/ProfileRange"
        },
        "ObjectCount": {
          "type": "integer",
          "description": "The number of profile objects used for the calculated attribute."
        },
        "Threshold": {
          "$ref": "#/$defs/ProfileThreshold"
        }
      }
    },
    "Filter": {
      "type": "object",
      "properties": {
        "Include": {
          "type": "string",
          "enum": [
            "ALL",
            "ANY",
            "NONE"
          ],
          "description": "Define whether to include or exclude objects for Calculated Attributed calculation that fit the filter groups criteria."
        },
        "Groups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FilterGroup"
          },
          "description": "Holds the list of Filter groups within the Filter definition."
        }
      },
      "required": [
        "Include",
        "Groups"
      ]
    },
    "FilterAttributeDimension": {
      "type": "object",
      "properties": {
        "DimensionType": {
          "type": "string",
          "enum": [
            "INCLUSIVE",
            "EXCLUSIVE",
            "CONTAINS",
            "BEGINS_WITH",
            "ENDS_WITH",
            "BEFORE",
            "AFTER",
            "BETWEEN",
            "NOT_BETWEEN",
            "ON",
            "GREATER_THAN",
            "LESS_THAN",
            "GREATER_THAN_OR_EQUAL",
            "LESS_THAN_OR_EQUAL",
            "EQUAL"
          ],
          "description": "The action to filter with."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The values to apply the DimensionType on."
        }
      },
      "required": [
        "DimensionType",
        "Values"
      ]
    },
    "FilterDimension": {
      "type": "object",
      "properties": {
        "Attributes": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/FilterAttributeDimension"
          },
          "description": "Is the attribute within the FilterDimension map"
        }
      },
      "required": [
        "Attributes"
      ]
    },
    "FilterGroup": {
      "type": "object",
      "properties": {
        "Type": {
          "type": "string",
          "enum": [
            "ALL",
            "ANY",
            "NONE"
          ],
          "description": "The type of logical relationship between the dimensions of the Filter group."
        },
        "Dimensions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FilterDimension"
          },
          "description": "Object that holds the attributes to filter on."
        }
      },
      "required": [
        "Type",
        "Dimensions"
      ]
    },
    "ProfileRange": {
      "type": "object",
      "properties": {
        "Value": {
          "type": "integer",
          "description": "The amount of time of the specified unit."
        },
        "Unit": {
          "type": "string",
          "enum": [
            "DAYS"
          ],
          "description": "The unit of time."
        },
        "ValueRange": {
          "$ref": "#/$defs/ValueRange"
        },
        "TimestampSource": {
          "type": "string",
          "description": "An expression specifying the field in your JSON object from which the date should be parsed. The expression should follow the structure of \\\"{ObjectTypeName.}\\\". E.g. if your object type is MyType and source JSON is {\"generatedAt\": {\"timestamp\": \"1737587945945\"}}, then TimestampSource should be \"{MyType.generatedAt.timestamp}\"."
        },
        "TimestampFormat": {
          "type": "string",
          "description": "The format the timestamp field in your JSON object is specified. This value should be one of EPOCHMILLI (for Unix epoch timestamps with second/millisecond level precision) or ISO_8601 (following ISO_8601 format with second/millisecond level precision, with an optional offset of Z or in the format HH:MM or HHMM.). E.g. if your object type is MyType and source JSON is {\"generatedAt\": {\"timestamp\": \"2001-07-04T12:08:56.235-0700\"}}, then TimestampFormat should be \"ISO_8601\"."
        }
      }
    },
    "ProfileThreshold": {
      "type": "object",
      "properties": {
        "Value": {
          "type": "string",
          "description": "The value of the threshold."
        },
        "Operator": {
          "type": "string",
          "enum": [
            "EQUAL_TO",
            "GREATER_THAN",
            "LESS_THAN",
            "NOT_EQUAL_TO"
          ],
          "description": "The operator of the threshold."
        }
      },
      "required": [
        "Value",
        "Operator"
      ]
    },
    "Readiness": {
      "type": "object",
      "properties": {
        "ProgressPercentage": {
          "type": "integer",
          "description": "Approximately how far the Calculated Attribute creation is from completion."
        },
        "Message": {
          "type": "string",
          "description": "Any customer messaging."
        }
      }
    },
    "ValueRange": {
      "type": "object",
      "properties": {
        "Start": {
          "type": "integer",
          "description": "The start time of when to include objects. Use positive numbers to indicate that the starting point is in the past, and negative numbers to indicate it is in the future."
        },
        "End": {
          "type": "integer",
          "description": "The end time of when to include objects. Use positive numbers to indicate that the starting point is in the past, and negative numbers to indicate it is in the future."
        }
      },
      "required": [
        "Start",
        "End"
      ]
    }
  }
}