{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/viridi-parente/main/json-schema/viridi-parente-entity-relation-info-schema.json",
  "title": "EntityRelationInfo",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/viridi-parente-entity-relation-controller-api-openapi.yml#/components/schemas/EntityRelationInfo",
  "properties": {
    "from": {
      "$ref": "#/$defs/EntityId",
      "description": "JSON object with [from] Entity Id.",
      "readOnly": true
    },
    "to": {
      "$ref": "#/$defs/EntityId",
      "description": "JSON object with [to] Entity Id.",
      "readOnly": true
    },
    "type": {
      "type": "string",
      "description": "String value of relation type."
    },
    "typeGroup": {
      "type": "string",
      "description": "Represents the type group of the relation.",
      "enum": [
        "COMMON",
        "DASHBOARD",
        "RULE_CHAIN",
        "RULE_NODE",
        "EDGE",
        "EDGE_AUTO_ASSIGN_RULE_CHAIN"
      ]
    },
    "fromName": {
      "type": "string",
      "description": "Name of the entity for [from] direction.",
      "readOnly": true
    },
    "toName": {
      "type": "string",
      "description": "Name of the entity for [to] direction.",
      "readOnly": true
    },
    "additionalInfo": {
      "$ref": "#/$defs/JsonNode",
      "description": "Additional parameters of the relation"
    }
  },
  "$defs": {
    "EntityId": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "ID of the entity, time-based UUID v1"
        },
        "entityType": {
          "type": "string",
          "enum": [
            "TENANT",
            "CUSTOMER",
            "USER",
            "DASHBOARD",
            "ASSET",
            "DEVICE",
            "ALARM",
            "RULE_CHAIN",
            "RULE_NODE",
            "ROLE",
            "ENTITY_VIEW",
            "WIDGETS_BUNDLE",
            "WIDGET_TYPE",
            "TENANT_PROFILE",
            "DEVICE_PROFILE",
            "ASSET_PROFILE",
            "API_USAGE_STATE",
            "TB_RESOURCE",
            "OTA_PACKAGE",
            "EDGE",
            "RPC",
            "QUEUE",
            "NOTIFICATION_TARGET",
            "NOTIFICATION_TEMPLATE",
            "NOTIFICATION_REQUEST",
            "NOTIFICATION",
            "NOTIFICATION_RULE",
            "QUEUE_STATS"
          ]
        }
      },
      "required": [
        "entityType",
        "id"
      ]
    },
    "JsonNode": {
      "description": "A value representing the any type (object or primitive)"
    }
  }
}