{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trimble/json-schema/trimble-model-entity-schema.json",
  "title": "ModelEntity",
  "description": "A model entity, which is the basic group of information in a model. It can represent a 3D construction element (such as a wall, column, pipe, etc.) as well as invisible grouping elements, hierarchies, etc.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trimble-connect-model-openapi.yml#/components/schemas/ModelEntity",
  "type": "object",
  "properties": {
    "id": {
      "minLength": 1,
      "type": "string",
      "description": "The entity's source (AKA external) identifier."
    },
    "idc": {
      "minLength": 1,
      "type": "string",
      "description": "The entity's connect identifier. Equal to source identifier if it exists, otherwise generated from the geometry. The generated identifier is not guaranteed to be stable, but in most cases it is."
    },
    "idx": {
      "type": "integer",
      "description": "The entity's index (AKA internal or runtime identifier)."
    },
    "type": {
      "minLength": 1,
      "type": "string",
      "description": "The Entity type."
    },
    "product": {
      "$ref": "#/$defs/Product"
    },
    "psets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PropertySet"
      },
      "description": "The property sets for the entity."
    },
    "boundingBox": {
      "$ref": "#/$defs/BoundingBox"
    },
    "hierarchyInfo": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HierarchyInfo"
      },
      "description": "The Array of all the hierarchy types the entity is part of and the count of children under each type."
    },
    "layerIds": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "The Ids of layers to which the entity belongs. Note that if the collection of layer Ids can also be used to determine whether the entity has geometry (at least one layer Id exists) or not (the collection of layer Ids is empty)."
    }
  },
  "$defs": {
    "BoundingBox": {
      "required": [
        "center",
        "extents",
        "max",
        "min"
      ],
      "type": "object",
      "properties": {
        "min": {
          "$ref": "#/$defs/Vector3"
        },
        "max": {
          "$ref": "#/$defs/Vector3"
        },
        "extents": {
          "$ref": "#/$defs/Vector3"
        },
        "center": {
          "$ref": "#/$defs/Vector3"
        }
      },
      "description": "A bounding box in the 3D space. A bounding box can be specified either with the lower bounds and upper bounds (minimum corner and maximum corner) or with the center point and the extents."
    },
    "HierarchyInfo": {
      "required": [
        "type",
        "count"
      ],
      "type": "object",
      "properties": {
        "type": {
          "minLength": 1,
          "type": "string",
          "description": "The hierarchy type."
        },
        "count": {
          "type": "integer",
          "description": "The count of entities below this(child entities count) in the hierarchy tree."
        }
      },
      "description": "Hierarchy type information."
    },
    "Product": {
      "required": [
        "historyIdx",
        "name",
        "ownerIdx"
      ],
      "type": "object",
      "properties": {
        "name": {
          "minLength": 1,
          "type": "string",
          "description": "The name."
        },
        "description": {
          "type": "string",
          "description": "The description."
        },
        "objectType": {
          "type": "string",
          "description": "The object type."
        },
        "ownerIdx": {
          "type": "integer",
          "description": "The owner index (the internal Id or runtime Id of the owner) of the product."
        },
        "historyIdx": {
          "type": "integer",
          "description": "The index (the internal Id or runtime Id) of the history event the product is related to."
        }
      },
      "description": "Product information."
    },
    "PropertySet": {
      "required": [
        "idx",
        "name",
        "values"
      ],
      "type": "object",
      "properties": {
        "idx": {
          "type": "integer",
          "description": "The pset index (internal identifier)."
        },
        "name": {
          "type": "string",
          "description": "The pset name."
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The ordered collection of property values in a property set. The position of the value in the array corresponds the position of property in the property set definition."
        }
      },
      "description": "A property set values."
    },
    "Vector3": {
      "type": "object",
      "required": [
        "x",
        "y",
        "z"
      ],
      "properties": {
        "x": {
          "type": "number",
          "description": "The X coordinate.",
          "format": "double"
        },
        "y": {
          "type": "number",
          "description": "The Y coordinate.",
          "format": "double"
        },
        "z": {
          "type": "number",
          "description": "The Z coordinate.",
          "format": "double"
        }
      },
      "description": "A vector in the 3D space."
    }
  }
}