{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-iot-sitewise/json-schema/amazon-iot-sitewise-create-asset-model-composite-model-request-schema.json",
  "title": "CreateAssetModelCompositeModelRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-iot-sitewise-composite-models-api-openapi.yml#/components/schemas/CreateAssetModelCompositeModelRequest",
  "type": "object",
  "properties": {
    "assetModelId": {
      "type": "string",
      "description": "The ID of the asset model this composite model is a part of."
    },
    "assetModelCompositeModelExternalId": {
      "type": "string",
      "description": "An external ID to assign to the composite model. If the composite model is a derived composite model, or one nested inside a component model, you can only set the external ID using UpdateAssetModelCompositeModel and specifying the derived ID of the model or property from the created model it's a part of."
    },
    "parentAssetModelCompositeModelId": {
      "type": "string",
      "description": "The ID of the parent composite model in this asset model relationship."
    },
    "assetModelCompositeModelId": {
      "type": "string",
      "description": "The ID of the composite model. IoT SiteWise automatically generates a unique ID for you, so this parameter is never required. However, if you prefer to supply your own ID instead, you can specify it here in UUID format. If you specify your own ID, it must be globally unique."
    },
    "assetModelCompositeModelDescription": {
      "type": "string",
      "description": "A description for the composite model."
    },
    "assetModelCompositeModelName": {
      "type": "string",
      "description": "A unique name for the composite model."
    },
    "assetModelCompositeModelType": {
      "type": "string",
      "description": "The composite model type. Valid values are AWS/ALARM, CUSTOM, or AWS/L4E_ANOMALY."
    },
    "clientToken": {
      "type": "string",
      "description": "A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required."
    },
    "composedAssetModelId": {
      "type": "string",
      "description": "The ID of a component model which is reused to create this composite model."
    },
    "assetModelCompositeModelProperties": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AssetModelPropertyDefinition"
      },
      "description": "The property definitions of the composite model. For more information, see Inline custom composite models in the IoT SiteWise User Guide. You can specify up to 200 properties per composite model. For more information, see Quotas in the IoT SiteWise User Guide."
    },
    "ifMatch": {
      "type": "string",
      "description": "The expected current entity tag (ETag) for the asset model’s latest or active version (specified using matchForVersionType). The create request is rejected if the tag does not match the latest or active version's current entity tag. See Optimistic locking for asset model writes in the IoT SiteWise User Guide."
    },
    "ifNoneMatch": {
      "type": "string",
      "description": "Accepts * to reject the create request if an active version (specified using matchForVersionType as ACTIVE) already exists for the asset model."
    },
    "matchForVersionType": {
      "type": "string",
      "enum": [
        "LATEST",
        "ACTIVE"
      ],
      "description": "Specifies the asset model version type (LATEST or ACTIVE) used in conjunction with If-Match or If-None-Match headers to determine the target ETag for the create operation."
    }
  },
  "required": [
    "assetModelId",
    "assetModelCompositeModelName",
    "assetModelCompositeModelType"
  ],
  "$defs": {
    "AssetModelPropertyDefinition": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The ID to assign to the asset model property, if desired. IoT SiteWise automatically generates a unique ID for you, so this parameter is never required. However, if you prefer to supply your own ID instead, you can specify it here in UUID format. If you specify your own ID, it must be globally unique."
        },
        "externalId": {
          "type": "string",
          "description": "An external ID to assign to the property definition. The external ID must be unique among property definitions within this asset model. For more information, see Using external IDs in the IoT SiteWise User Guide."
        },
        "name": {
          "type": "string",
          "description": "The name of the property definition."
        },
        "dataType": {
          "type": "string",
          "enum": [
            "STRING",
            "INTEGER",
            "DOUBLE",
            "BOOLEAN",
            "STRUCT",
            "VIDEO",
            "ANNOTATION",
            "JSON"
          ],
          "description": "The data type of the property definition. The VIDEO, ANNOTATION, and JSON data types aren't supported for asset model properties. These types are used only by time series that store data for datasets in a workspace. If you specify STRUCT, you must also specify dataTypeSpec to identify the type of the structure for this property."
        },
        "dataTypeSpec": {
          "type": "string",
          "description": "The data type of the structure for this property. This parameter is required on properties that have the STRUCT data type. The options for this parameter depend on the type of the composite model in which you define this property. Use AWS/ALARM_STATE for alarm state in alarm composite models."
        },
        "unit": {
          "type": "string",
          "description": "The unit of the property definition, such as Newtons or RPM."
        },
        "type": {
          "$ref": "#/$defs/PropertyType"
        }
      },
      "required": [
        "name",
        "dataType",
        "type"
      ]
    },
    "AssetModelPropertyPathSegment": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The ID of the path segment."
        },
        "name": {
          "type": "string",
          "description": "The name of the path segment."
        }
      }
    },
    "Attribute": {
      "type": "object",
      "properties": {
        "defaultValue": {
          "type": "string",
          "description": "The default value of the asset model property attribute. All assets that you create from the asset model contain this attribute value. You can update an attribute's value after you create an asset. For more information, see Updating attribute values in the IoT SiteWise User Guide."
        }
      }
    },
    "ExpressionVariable": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The friendly name of the variable to be used in the expression."
        },
        "value": {
          "$ref": "#/$defs/VariableValue"
        }
      },
      "required": [
        "name",
        "value"
      ]
    },
    "ForwardingConfig": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "DISABLED",
            "ENABLED"
          ],
          "description": "The forwarding state for the given property."
        }
      },
      "required": [
        "state"
      ]
    },
    "Measurement": {
      "type": "object",
      "properties": {
        "processingConfig": {
          "$ref": "#/$defs/MeasurementProcessingConfig"
        }
      }
    },
    "MeasurementProcessingConfig": {
      "type": "object",
      "properties": {
        "forwardingConfig": {
          "$ref": "#/$defs/ForwardingConfig"
        }
      },
      "required": [
        "forwardingConfig"
      ]
    },
    "Metric": {
      "type": "object",
      "properties": {
        "expression": {
          "type": "string",
          "description": "The mathematical expression that defines the metric aggregation function. You can specify up to 10 variables per expression. You can specify up to 10 functions per expression. For more information, see Quotas in the IoT SiteWise User Guide."
        },
        "variables": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExpressionVariable"
          },
          "description": "The list of variables used in the expression."
        },
        "window": {
          "$ref": "#/$defs/MetricWindow"
        },
        "processingConfig": {
          "$ref": "#/$defs/MetricProcessingConfig"
        }
      },
      "required": [
        "window"
      ]
    },
    "MetricProcessingConfig": {
      "type": "object",
      "properties": {
        "computeLocation": {
          "type": "string",
          "enum": [
            "EDGE",
            "CLOUD"
          ],
          "description": "The compute location for the given metric property."
        }
      },
      "required": [
        "computeLocation"
      ]
    },
    "MetricWindow": {
      "type": "object",
      "properties": {
        "tumbling": {
          "$ref": "#/$defs/TumblingWindow"
        }
      }
    },
    "PropertyType": {
      "type": "object",
      "properties": {
        "attribute": {
          "$ref": "#/$defs/Attribute"
        },
        "measurement": {
          "$ref": "#/$defs/Measurement"
        },
        "transform": {
          "$ref": "#/$defs/Transform"
        },
        "metric": {
          "$ref": "#/$defs/Metric"
        }
      }
    },
    "Transform": {
      "type": "object",
      "properties": {
        "expression": {
          "type": "string",
          "description": "The mathematical expression that defines the transformation function. You can specify up to 10 variables per expression. You can specify up to 10 functions per expression. For more information, see Quotas in the IoT SiteWise User Guide."
        },
        "variables": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExpressionVariable"
          },
          "description": "The list of variables used in the expression."
        },
        "processingConfig": {
          "$ref": "#/$defs/TransformProcessingConfig"
        }
      },
      "required": [
        "expression",
        "variables"
      ]
    },
    "TransformProcessingConfig": {
      "type": "object",
      "properties": {
        "computeLocation": {
          "type": "string",
          "enum": [
            "EDGE",
            "CLOUD"
          ],
          "description": "The compute location for the given transform property."
        },
        "forwardingConfig": {
          "$ref": "#/$defs/ForwardingConfig"
        }
      },
      "required": [
        "computeLocation"
      ]
    },
    "TumblingWindow": {
      "type": "object",
      "properties": {
        "interval": {
          "type": "string",
          "description": "The time interval for the tumbling window. The interval time must be between 1 minute and 1 week. IoT SiteWise computes the 1w interval the end of Sunday at midnight each week (UTC), the 1d interval at the end of each day at midnight (UTC), the 1h interval at the end of each hour, and so on. When IoT SiteWise aggregates data points for metric computations, the start of each interval is exclusive and the end of each interval is inclusive. IoT SiteWise places the computed data point at the end of the interval."
        },
        "offset": {
          "type": "string",
          "description": "The offset for the tumbling window. The offset parameter accepts the following: The offset time. For example, if you specify 18h for offset and 1d for interval, IoT SiteWise aggregates data in one of the following ways: If you create the metric before or at 6 PM (UTC), you get the first aggregation result at 6 PM (UTC) on the day when you create the metric. If you create the metric after 6 PM (UTC), you get the first aggregation result at 6 PM (UTC) the next day. The ISO 8601 format. For example, if you specify PT18H for offset and 1d for interval, IoT SiteWise aggregates data in one of the fo"
        }
      },
      "required": [
        "interval"
      ]
    },
    "VariableValue": {
      "type": "object",
      "properties": {
        "propertyId": {
          "type": "string",
          "description": "The ID of the property to use as the variable. You can use the property name if it's from the same asset model. If the property has an external ID, you can specify externalId: followed by the external ID. For more information, see Using external IDs in the IoT SiteWise User Guide."
        },
        "hierarchyId": {
          "type": "string",
          "description": "The ID of the hierarchy to query for the property ID. You can use the hierarchy's name instead of the hierarchy's ID. If the hierarchy has an external ID, you can specify externalId: followed by the external ID. For more information, see Using external IDs in the IoT SiteWise User Guide. You use a hierarchy ID instead of a model ID because you can have several hierarchies using the same model and therefore the same propertyId. For example, you might have separately grouped assets that come from the same asset model. For more information, see Asset hierarchies in the IoT SiteWise User Guide."
        },
        "propertyPath": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssetModelPropertyPathSegment"
          },
          "description": "The path of the property."
        }
      }
    }
  }
}