{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trimble/json-schema/trimble-query-entities-response-schema.json",
  "title": "QueryEntitiesResponse",
  "description": "A response which contains a collection of model entities.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trimble-connect-model-openapi.yml#/components/schemas/QueryEntitiesResponse",
  "type": "object",
  "required": [
    "tolerances",
    "items",
    "total",
    "count",
    "offset"
  ],
  "properties": {
    "tolerances": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tolerances"
      },
      "description": "The tolerances that were applied for comparing the property values."
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ModelEntity"
      },
      "description": "The Collection of ModelEntity items."
    },
    "offset": {
      "type": "integer",
      "description": "The offset of the first item returned in this page."
    },
    "offsetNext": {
      "type": "integer",
      "description": "The first item of the next page. If null, then this is the last page in the result set. If not null, then this value must be passed in the `offset` query parameter to fetch the next page."
    },
    "total": {
      "type": "integer",
      "description": "The total number of items in the result set."
    },
    "count": {
      "type": "integer",
      "description": "The number of items on the current page."
    }
  },
  "$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."
    },
    "DateTimeCompareOptions": {
      "type": "object",
      "properties": {
        "maxDelta": {
          "type": "string",
          "description": "The acceptable duration tolerance when comparing datetime properties. If not specified a default tolerance is used.",
          "format": "iso8601",
          "pattern": "^P(?=\\d+[YMD])(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d+[HMS])(\\d+H)?(\\d+M)?(\\d+S)?)?$"
        }
      }
    },
    "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."
    },
    "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)."
        }
      },
      "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."
    },
    "NumberCompareOptions": {
      "type": "object",
      "properties": {
        "maxDelta": {
          "type": "number",
          "description": "The absolute tolerance when comparing numerical properties. If not specified a default tolerance is used specific for the property type.",
          "format": "double"
        }
      }
    },
    "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."
    },
    "StringCompareOptions": {
      "type": "object",
      "properties": {
        "compare": {
          "type": "string",
          "description": "The case sensitivity rule to be applied for string properties comparison. if not specified a case sensitive comparison is used by default.",
          "enum": [
            "caseSensitive",
            "caseInsensitive"
          ],
          "default": "caseSensitive"
        }
      }
    },
    "Tolerances": {
      "type": "object",
      "properties": {
        "lengthMeasure": {
          "$ref": "#/$defs/NumberCompareOptions"
        },
        "areaMeasure": {
          "$ref": "#/$defs/NumberCompareOptions"
        },
        "volumeMeasure": {
          "$ref": "#/$defs/NumberCompareOptions"
        },
        "massMeasure": {
          "$ref": "#/$defs/NumberCompareOptions"
        },
        "angleMeasure": {
          "$ref": "#/$defs/NumberCompareOptions"
        },
        "number": {
          "$ref": "#/$defs/NumberCompareOptions"
        },
        "string": {
          "$ref": "#/$defs/StringCompareOptions"
        },
        "dateTime": {
          "$ref": "#/$defs/DateTimeCompareOptions"
        }
      },
      "description": "A structure used to specify the comparison options (e.g. tolerances) for property values of various types. Comparison options specified in the request will override the default service level comparison options and tolerance value. If for a property type the tolerance value is not specified in the request, then for that type the service level default tolerance value will be applied."
    },
    "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."
    }
  }
}