{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--aws-iotsitewise-assetmodel.json",
  "title": "AWSIoTSiteWiseAssetModelProperties",
  "description": "Resource schema for AWS::IoTSiteWise::AssetModel. Source:- <https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-IoTSiteWise.git>",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/resources/cloudformation-modified/aws-iotsitewise-assetmodel.json",
    "sourceSha256": "992f620c94186b6bfe8be574354f3391ed5271ab097808965a0d7737358aa14e"
  },
  "type": "object",
  "properties": {
    "AssetModelName": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "A unique, friendly name for the asset model."
    },
    "AssetModelDescription": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "A description for the asset model."
    },
    "AssetModelProperties": {
      "description": "The property definitions of the asset model. You can specify up to 200 properties per asset model.",
      "type": "array",
      "insertionOrder": false,
      "items": {
        "$ref": "#/$defs/AssetModelProperty"
      }
    },
    "AssetModelCompositeModels": {
      "description": "The composite asset models that are part of this asset model. Composite asset models are asset models that contain specific properties.",
      "type": "array",
      "insertionOrder": false,
      "items": {
        "$ref": "#/$defs/AssetModelCompositeModel"
      }
    },
    "AssetModelHierarchies": {
      "description": "The hierarchy definitions of the asset model. Each hierarchy specifies an asset model whose assets can be children of any other assets created from this asset model. You can specify up to 10 hierarchies per asset model.",
      "type": "array",
      "insertionOrder": false,
      "items": {
        "$ref": "#/$defs/AssetModelHierarchy"
      }
    },
    "Tags": {
      "description": "A list of key-value pairs that contain metadata for the asset model.",
      "type": "array",
      "insertionOrder": false,
      "items": {
        "$ref": "#/$defs/Tag"
      }
    }
  },
  "typeName": "AWS::IoTSiteWise::AssetModel",
  "primaryIdentifier": [
    "/properties/AssetModelId"
  ],
  "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-IoTSiteWise.git",
  "additionalProperties": false,
  "readOnlyProperties": [
    "/properties/AssetModelArn",
    "/properties/AssetModelId"
  ],
  "$defs": {
    "AssetModelCompositeModel": {
      "description": "Contains a composite model definition in an asset model. This composite model definition is applied to all assets created from the asset model.",
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelAssetModelCompositeModelDefinition",
      "required": [
        "Name",
        "Type"
      ],
      "properties": {
        "Description": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "A description for the asset composite model."
        },
        "Name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "A unique, friendly name for the asset composite model."
        },
        "Type": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The type of the composite model. For alarm composite models, this type is AWS/ALARM"
        },
        "CompositeModelProperties": {
          "description": "The property definitions of the asset model. You can specify up to 200 properties per asset model.",
          "type": "array",
          "insertionOrder": false,
          "items": {
            "$ref": "#/$defs/AssetModelProperty"
          }
        }
      },
      "additionalProperties": false
    },
    "AssetModelProperty": {
      "description": "Contains information about an asset model property.",
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelAssetModelPropertyDefinition",
      "required": [
        "LogicalId",
        "Name",
        "DataType",
        "Type"
      ],
      "properties": {
        "LogicalId": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "[^\\u0000-\\u001F\\u007F]+"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "Customer provided ID for property."
        },
        "Name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The name of the asset model property."
        },
        "DataType": {
          "description": "The data type of the asset model property.",
          "$ref": "#/$defs/DataType"
        },
        "DataTypeSpec": {
          "description": "The data type of the structure for this property.",
          "$ref": "#/$defs/DataTypeSpec"
        },
        "Unit": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The unit of the asset model property, such as Newtons or RPM."
        },
        "Type": {
          "description": "The property type",
          "$ref": "#/$defs/PropertyType"
        }
      },
      "additionalProperties": false
    },
    "DataType": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "STRING",
            "INTEGER",
            "DOUBLE",
            "BOOLEAN",
            "STRUCT"
          ]
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "title": "AWSIoTSiteWiseAssetModelDataTypeDefinition"
    },
    "DataTypeSpec": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "AWS/ALARM_STATE"
          ]
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "title": "AWSIoTSiteWiseAssetModelDataTypeSpecDefinition"
    },
    "PropertyType": {
      "description": "Contains a property type, which can be one of attribute, measurement, metric, or transform.",
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelPropertyTypeDefinition",
      "required": [
        "TypeName"
      ],
      "properties": {
        "TypeName": {
          "$ref": "#/$defs/TypeName"
        },
        "Attribute": {
          "$ref": "#/$defs/Attribute"
        },
        "Transform": {
          "$ref": "#/$defs/Transform"
        },
        "Metric": {
          "$ref": "#/$defs/Metric"
        }
      },
      "additionalProperties": false
    },
    "TypeName": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "Measurement",
            "Attribute",
            "Transform",
            "Metric"
          ]
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "title": "AWSIoTSiteWiseAssetModelTypeNameDefinition"
    },
    "Attribute": {
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelAttributeDefinition",
      "properties": {
        "DefaultValue": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "Transform": {
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelTransformDefinition",
      "properties": {
        "Expression": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The mathematical expression that defines the transformation function. You can specify up to 10 functions per expression."
        },
        "Variables": {
          "description": "The list of variables used in the expression.",
          "type": "array",
          "insertionOrder": false,
          "items": {
            "$ref": "#/$defs/ExpressionVariable"
          }
        }
      },
      "required": [
        "Expression",
        "Variables"
      ],
      "additionalProperties": false
    },
    "Metric": {
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelMetricDefinition",
      "properties": {
        "Expression": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The mathematical expression that defines the metric aggregation function. You can specify up to 10 functions per expression."
        },
        "Variables": {
          "description": "The list of variables used in the expression.",
          "insertionOrder": false,
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExpressionVariable"
          }
        },
        "Window": {
          "description": "The window (time interval) over which AWS IoT SiteWise computes the metric's aggregation expression",
          "$ref": "#/$defs/MetricWindow"
        }
      },
      "required": [
        "Expression",
        "Variables",
        "Window"
      ],
      "additionalProperties": false
    },
    "MetricWindow": {
      "description": "Contains a time interval window used for data aggregate computations (for example, average, sum, count, and so on).",
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelMetricWindowDefinition",
      "properties": {
        "Tumbling": {
          "$ref": "#/$defs/TumblingWindow"
        }
      },
      "additionalProperties": false
    },
    "TumblingWindow": {
      "description": "Contains a tumbling window, which is a repeating fixed-sized, non-overlapping, and contiguous time interval. This window is used in metric and aggregation computations.",
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelTumblingWindowDefinition",
      "properties": {
        "Interval": {
          "$ref": "#/$defs/Interval"
        },
        "Offset": {
          "$ref": "#/$defs/Offset"
        }
      },
      "required": [
        "Interval"
      ],
      "additionalProperties": false
    },
    "Interval": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The time interval for the tumbling window.",
      "title": "AWSIoTSiteWiseAssetModelIntervalDefinition"
    },
    "Offset": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The shift or reference point on timeline for the contiguous time intervals.",
      "title": "AWSIoTSiteWiseAssetModelOffsetDefinition"
    },
    "ExpressionVariable": {
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelExpressionVariableDefinition",
      "properties": {
        "Name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The friendly name of the variable to be used in the expression."
        },
        "Value": {
          "description": "The variable that identifies an asset property from which to use values.",
          "$ref": "#/$defs/VariableValue"
        }
      },
      "required": [
        "Name",
        "Value"
      ],
      "additionalProperties": false
    },
    "VariableValue": {
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelVariableValueDefinition",
      "properties": {
        "PropertyLogicalId": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "[^\\u0000-\\u001F\\u007F]+"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "HierarchyLogicalId": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "[^\\u0000-\\u001F\\u007F]+"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        }
      },
      "required": [
        "PropertyLogicalId"
      ],
      "additionalProperties": false
    },
    "AssetModelHierarchy": {
      "description": "Contains information about an asset model hierarchy.",
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelAssetModelHierarchyDefinition",
      "required": [
        "LogicalId",
        "Name",
        "ChildAssetModelId"
      ],
      "properties": {
        "LogicalId": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "[^\\u0000-\\u001F\\u007F]+"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "Customer provided ID for hierarchy."
        },
        "Name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The name of the asset model hierarchy."
        },
        "ChildAssetModelId": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The ID of the asset model. All assets in this hierarchy must be instances of the child AssetModelId asset model."
        }
      },
      "additionalProperties": false
    },
    "Tag": {
      "type": "object",
      "title": "AWSIoTSiteWiseAssetModelTagDefinition",
      "properties": {
        "Key": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "Value": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        }
      },
      "required": [
        "Value",
        "Key"
      ],
      "additionalProperties": false
    }
  },
  "taggable": true,
  "required": [
    "AssetModelName"
  ],
  "writeOnlyProperties": [
    "/properties/AssetModelProperties/*/DataTypeSpec",
    "/properties/AssetModelProperties/*/Type/Transform/Variables/*/Value/HierarchyLogicalId",
    "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/Type/Transform",
    "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/Type/Metric"
  ]
}
