{
  "typeName" : "AWS::IoTSiteWise::AssetModel",
  "description" : "Resource schema for AWS::IoTSiteWise::AssetModel",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-IoTSiteWise.git",
  "definitions" : {
    "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",
      "additionalProperties" : false,
      "required" : [ "Name", "Type" ],
      "properties" : {
        "Id" : {
          "description" : "The Actual ID of the composite model",
          "type" : "string",
          "minLength" : 36,
          "maxLength" : 36,
          "pattern" : "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "ExternalId" : {
          "description" : "The External ID of the composite model",
          "type" : "string",
          "minLength" : 2,
          "maxLength" : 128,
          "pattern" : "[a-zA-Z0-9_][a-zA-Z_\\-0-9.:]*[a-zA-Z0-9_]+"
        },
        "ComposedAssetModelId" : {
          "description" : "The component model ID for which the composite model is composed of",
          "type" : "string"
        },
        "ParentAssetModelCompositeModelExternalId" : {
          "description" : "The parent composite model External ID",
          "type" : "string",
          "minLength" : 2,
          "maxLength" : 128,
          "pattern" : "[a-zA-Z0-9_][a-zA-Z_\\-0-9.:]*[a-zA-Z0-9_]+"
        },
        "Path" : {
          "description" : "The path of the composite model. This is only for derived composite models",
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "type" : "string"
          }
        },
        "Description" : {
          "description" : "A description for the asset composite model.",
          "type" : "string"
        },
        "Name" : {
          "description" : "A unique, friendly name for the asset composite model.",
          "type" : "string"
        },
        "Type" : {
          "description" : "The type of the composite model. For alarm composite models, this type is AWS/ALARM",
          "type" : "string"
        },
        "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" : "#/definitions/AssetModelProperty"
          }
        }
      }
    },
    "PropertyPathDefinition" : {
      "description" : "The definition for property path which is used to reference properties in transforms/metrics",
      "type" : "object",
      "additionalProperties" : false,
      "required" : [ "Name" ],
      "properties" : {
        "Name" : {
          "description" : "The name of the property",
          "type" : "string"
        }
      }
    },
    "AssetModelProperty" : {
      "description" : "Contains information about an asset model property.",
      "type" : "object",
      "additionalProperties" : false,
      "required" : [ "Name", "DataType", "Type" ],
      "properties" : {
        "LogicalId" : {
          "description" : "Customer provided Logical ID for property.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 256,
          "pattern" : "[^\\u0000-\\u001F\\u007F]+"
        },
        "Id" : {
          "description" : "The ID of the Asset Model Property",
          "type" : "string",
          "minLength" : 36,
          "maxLength" : 36,
          "pattern" : "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "ExternalId" : {
          "description" : "The External ID of the Asset Model Property",
          "type" : "string",
          "minLength" : 2,
          "maxLength" : 128,
          "pattern" : "[a-zA-Z0-9_][a-zA-Z_\\-0-9.:]*[a-zA-Z0-9_]+"
        },
        "Name" : {
          "description" : "The name of the asset model property.",
          "type" : "string"
        },
        "DataType" : {
          "description" : "The data type of the asset model property.",
          "$ref" : "#/definitions/DataType"
        },
        "DataTypeSpec" : {
          "description" : "The data type of the structure for this property.",
          "$ref" : "#/definitions/DataTypeSpec"
        },
        "Unit" : {
          "description" : "The unit of the asset model property, such as Newtons or RPM.",
          "type" : "string"
        },
        "Type" : {
          "description" : "The property type",
          "$ref" : "#/definitions/PropertyType"
        }
      }
    },
    "DataType" : {
      "type" : "string",
      "enum" : [ "STRING", "INTEGER", "DOUBLE", "BOOLEAN", "STRUCT" ]
    },
    "DataTypeSpec" : {
      "type" : "string",
      "enum" : [ "AWS/ALARM_STATE" ]
    },
    "PropertyType" : {
      "description" : "Contains a property type, which can be one of attribute, measurement, metric, or transform.",
      "type" : "object",
      "additionalProperties" : false,
      "required" : [ "TypeName" ],
      "properties" : {
        "TypeName" : {
          "$ref" : "#/definitions/TypeName"
        },
        "Attribute" : {
          "$ref" : "#/definitions/Attribute"
        },
        "Transform" : {
          "$ref" : "#/definitions/Transform"
        },
        "Metric" : {
          "$ref" : "#/definitions/Metric"
        }
      }
    },
    "TypeName" : {
      "type" : "string",
      "enum" : [ "Measurement", "Attribute", "Transform", "Metric" ]
    },
    "Attribute" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "DefaultValue" : {
          "type" : "string"
        }
      }
    },
    "Transform" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Expression" : {
          "description" : "The mathematical expression that defines the transformation function. You can specify up to 10 functions per expression.",
          "type" : "string"
        },
        "Variables" : {
          "description" : "The list of variables used in the expression.",
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/ExpressionVariable"
          }
        }
      },
      "required" : [ "Expression", "Variables" ]
    },
    "Metric" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Expression" : {
          "description" : "The mathematical expression that defines the metric aggregation function. You can specify up to 10 functions per expression.",
          "type" : "string"
        },
        "Variables" : {
          "description" : "The list of variables used in the expression.",
          "insertionOrder" : false,
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/ExpressionVariable"
          }
        },
        "Window" : {
          "description" : "The window (time interval) over which AWS IoT SiteWise computes the metric's aggregation expression",
          "$ref" : "#/definitions/MetricWindow"
        }
      },
      "required" : [ "Expression", "Variables", "Window" ]
    },
    "MetricWindow" : {
      "description" : "Contains a time interval window used for data aggregate computations (for example, average, sum, count, and so on).",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Tumbling" : {
          "$ref" : "#/definitions/TumblingWindow"
        }
      }
    },
    "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",
      "additionalProperties" : false,
      "properties" : {
        "Interval" : {
          "$ref" : "#/definitions/Interval"
        },
        "Offset" : {
          "$ref" : "#/definitions/Offset"
        }
      },
      "required" : [ "Interval" ]
    },
    "Interval" : {
      "description" : "The time interval for the tumbling window.",
      "type" : "string"
    },
    "Offset" : {
      "description" : "The shift or reference point on timeline for the contiguous time intervals.",
      "type" : "string"
    },
    "ExpressionVariable" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Name" : {
          "description" : "The friendly name of the variable to be used in the expression.",
          "type" : "string"
        },
        "Value" : {
          "description" : "The variable that identifies an asset property from which to use values.",
          "$ref" : "#/definitions/VariableValue"
        }
      },
      "required" : [ "Name", "Value" ]
    },
    "VariableValue" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "PropertyLogicalId" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 256,
          "pattern" : "[^\\u0000-\\u001F\\u007F]+"
        },
        "PropertyId" : {
          "description" : "The ID of the property that is trying to be referenced",
          "type" : "string",
          "minLength" : 36,
          "maxLength" : 36,
          "pattern" : "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "PropertyExternalId" : {
          "description" : "The External ID of the property that is trying to be referenced",
          "type" : "string",
          "minLength" : 2,
          "maxLength" : 128,
          "pattern" : "[a-zA-Z0-9_][a-zA-Z_\\-0-9.:]*[a-zA-Z0-9_]+"
        },
        "PropertyPath" : {
          "description" : "The path of the property that is trying to be referenced",
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "$ref" : "#/definitions/PropertyPathDefinition"
          }
        },
        "HierarchyLogicalId" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 256,
          "pattern" : "[^\\u0000-\\u001F\\u007F]+"
        },
        "HierarchyId" : {
          "description" : "The ID of the hierarchy that is trying to be referenced",
          "type" : "string",
          "minLength" : 36,
          "maxLength" : 36,
          "pattern" : "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "HierarchyExternalId" : {
          "description" : "The External ID of the hierarchy that is trying to be referenced",
          "type" : "string",
          "minLength" : 2,
          "maxLength" : 128,
          "pattern" : "[a-zA-Z0-9_][a-zA-Z_\\-0-9.:]*[a-zA-Z0-9_]+"
        }
      }
    },
    "AssetModelHierarchy" : {
      "description" : "Contains information about an asset model hierarchy.",
      "type" : "object",
      "additionalProperties" : false,
      "required" : [ "Name", "ChildAssetModelId" ],
      "properties" : {
        "Id" : {
          "description" : "Customer provided actual ID for hierarchy",
          "type" : "string",
          "minLength" : 36,
          "maxLength" : 36,
          "pattern" : "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "ExternalId" : {
          "description" : "Customer provided external ID for hierarchy",
          "type" : "string",
          "minLength" : 2,
          "maxLength" : 128,
          "pattern" : "[a-zA-Z0-9_][a-zA-Z_\\-0-9.:]*[a-zA-Z0-9_]+"
        },
        "LogicalId" : {
          "description" : "Customer provided logical ID for hierarchy.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 256,
          "pattern" : "[^\\u0000-\\u001F\\u007F]+"
        },
        "Name" : {
          "description" : "The name of the asset model hierarchy.",
          "type" : "string"
        },
        "ChildAssetModelId" : {
          "description" : "The ID of the asset model. All assets in this hierarchy must be instances of the child AssetModelId asset model.",
          "type" : "string"
        }
      }
    },
    "EnforcedAssetModelInterfacePropertyMapping" : {
      "description" : "Contains information about enforced interface property and asset model property",
      "type" : "object",
      "additionalProperties" : false,
      "required" : [ "InterfaceAssetModelPropertyExternalId" ],
      "properties" : {
        "AssetModelPropertyExternalId" : {
          "description" : "The external ID of the enforced asset model property",
          "type" : "string"
        },
        "AssetModelPropertyLogicalId" : {
          "description" : "The logical ID of the enforced asset model property",
          "type" : "string"
        },
        "InterfaceAssetModelPropertyExternalId" : {
          "description" : "The external ID of the enforced interface property",
          "type" : "string"
        }
      }
    },
    "EnforcedAssetModelInterfaceRelationship" : {
      "description" : "Contains information about enforced interface hierarchy and asset model hierarchy",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "InterfaceAssetModelId" : {
          "description" : "The ID of the interface that is enforced to the asset model",
          "type" : "string"
        },
        "PropertyMappings" : {
          "description" : "Contains information about enforced interface property and asset model property",
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "$ref" : "#/definitions/EnforcedAssetModelInterfacePropertyMapping"
          }
        }
      }
    },
    "Tag" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "required" : [ "Value", "Key" ]
    }
  },
  "properties" : {
    "AssetModelId" : {
      "description" : "The ID of the asset model.",
      "type" : "string",
      "minLength" : 36,
      "maxLength" : 36,
      "pattern" : "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    },
    "AssetModelType" : {
      "description" : "The type of the asset model (ASSET_MODEL OR COMPONENT_MODEL or INTERFACE)",
      "type" : "string"
    },
    "AssetModelExternalId" : {
      "description" : "The external ID of the asset model.",
      "type" : "string",
      "minLength" : 2,
      "maxLength" : 128,
      "pattern" : "[a-zA-Z0-9_][a-zA-Z_\\-0-9.:]*[a-zA-Z0-9_]+"
    },
    "AssetModelArn" : {
      "description" : "The ARN of the asset model, which has the following format.",
      "type" : "string"
    },
    "AssetModelName" : {
      "description" : "A unique, friendly name for the asset model.",
      "type" : "string"
    },
    "AssetModelDescription" : {
      "description" : "A description for the asset model.",
      "type" : "string"
    },
    "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" : "#/definitions/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" : "#/definitions/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" : "#/definitions/AssetModelHierarchy"
      }
    },
    "EnforcedAssetModelInterfaceRelationships" : {
      "description" : "a list of asset model and interface relationships",
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/EnforcedAssetModelInterfaceRelationship"
      }
    },
    "Tags" : {
      "description" : "A list of key-value pairs that contain metadata for the asset model.",
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "iotsitewise:TagResource", "iotsitewise:UntagResource", "iotsitewise:ListTagsForResource" ]
  },
  "required" : [ "AssetModelName" ],
  "writeOnlyProperties" : [ "/properties/AssetModelProperties/*/DataTypeSpec", "/properties/AssetModelProperties/*/Type/Transform/Variables/*/Value/HierarchyLogicalId", "/properties/AssetModelProperties/*/Type/Transform/Variables/*/Value/HierarchyId", "/properties/AssetModelProperties/*/Type/Metric/Variables/*/Value/HierarchyId", "/properties/AssetModelProperties/*/Type/Transform/Variables/*/Value/HierarchyExternalId", "/properties/AssetModelProperties/*/Type/Metric/Variables/*/Value/PropertyPath/*/Name", "/properties/AssetModelProperties/*/Type/Transform/Variables/*/Value/PropertyPath/*/Name", "/properties/AssetModelProperties/*/Type/Transform/Variables/*/Value/HierarchyExternalId", "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/Type/Transform/Variables/*/Value/HierarchyId", "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/Type/Metric/Variables/*/Value/HierarchyId", "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/Type/Transform/Variables/*/Value/HierarchyLogicalId", "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/Type/Transform/Variables/*/Value/HierarchyExternalId", "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/Type/Transform/Variables/*/Value/PropertyPath/*/Name", "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/Type/Metric/Variables/*/Value/PropertyPath/*/Name", "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/DataTypeSpec" ],
  "readOnlyProperties" : [ "/properties/AssetModelArn", "/properties/AssetModelId", "/properties/AssetModelProperties/*/Id", "/properties/AssetModelProperties/*/Type/Transform/Variables/*/Value/PropertyId", "/properties/AssetModelProperties/*/Type/Metric/Variables/*/Value/PropertyId", "/properties/AssetModelHierarchies/*/Id", "/properties/AssetModelCompositeModels/*/Id", "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/Id", "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/Type/Transform/Variables/*/Value/PropertyId", "/properties/AssetModelCompositeModels/*/CompositeModelProperties/*/Type/Metric/Variables/*/Value/PropertyId" ],
  "createOnlyProperties" : [ "/properties/AssetModelType" ],
  "primaryIdentifier" : [ "/properties/AssetModelId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "iotsitewise:CreateAssetModel", "iotsitewise:ListTagsForResource", "iotsitewise:TagResource", "iotsitewise:DescribeAssetModel", "iotsitewise:UpdateAssetModel", "iotsitewise:ListAssetModelProperties", "iotsitewise:ListAssetModelCompositeModels", "iotsitewise:UpdateAssetModelCompositeModel", "iotsitewise:DescribeAssetModelCompositeModel", "iotsitewise:CreateAssetModelCompositeModel", "iotsitewise:PutAssetModelInterfaceRelationship", "iotsitewise:DescribeAssetModelInterfaceRelationship" ]
    },
    "read" : {
      "permissions" : [ "iotsitewise:DescribeAssetModel", "iotsitewise:ListAssetModelProperties", "iotsitewise:DescribeAssetModelCompositeModel", "iotsitewise:ListAssetModelCompositeModels", "iotsitewise:ListTagsForResource", "iotsitewise:DescribeAssetModelInterfaceRelationship" ]
    },
    "update" : {
      "permissions" : [ "iotsitewise:DescribeAssetModel", "iotsitewise:ListTagsForResource", "iotsitewise:TagResource", "iotsitewise:UntagResource", "iotsitewise:ListAssetModelProperties", "iotsitewise:ListAssetModelCompositeModels", "iotsitewise:CreateAssetModelCompositeModel", "iotsitewise:UpdateAssetModelCompositeModel", "iotsitewise:DeleteAssetModelCompositeModel", "iotsitewise:DescribeAssetModelCompositeModel", "iotsitewise:UpdateAssetModel", "iotsitewise:PutAssetModelInterfaceRelationship", "iotsitewise:DeleteAssetModelInterfaceRelationship", "iotsitewise:DescribeAssetModelInterfaceRelationship" ]
    },
    "delete" : {
      "permissions" : [ "iotsitewise:DescribeAssetModel", "iotsitewise:DeleteAssetModel", "iotsitewise:ListAssetModelProperties", "iotsitewise:ListAssetModelCompositeModels" ]
    },
    "list" : {
      "permissions" : [ "iotsitewise:DescribeAssetModel", "iotsitewise:ListAssetModels", "iotsitewise:ListTagsForResource", "iotsitewise:ListAssetModelProperties", "iotsitewise:ListAssetModelCompositeModels" ]
    }
  }
}