{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/anthid-com/json-schema/anthid-com-evaluate-result-schema.json",
  "title": "EvaluateResult",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/anthid-com-control-evaluation-api-openapi.yml#/components/schemas/EvaluateResult",
  "type": "object",
  "required": [
    "allowed",
    "triggered"
  ],
  "properties": {
    "allowed": {
      "type": "boolean"
    },
    "triggered": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TriggeredControl"
      }
    }
  },
  "$defs": {
    "ControlScope": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "Organization"
          ],
          "properties": {
            "Organization": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "Account"
          ],
          "properties": {
            "Account": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "Symbol"
          ],
          "properties": {
            "Symbol": {
              "type": "object",
              "required": [
                "account_id",
                "symbol"
              ],
              "properties": {
                "account_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "symbol": {
                  "type": "string"
                }
              }
            }
          }
        }
      ]
    },
    "ControlType": {
      "type": "string",
      "enum": [
        "Manual",
        "Time",
        "Risk"
      ]
    },
    "TriggeredControl": {
      "type": "object",
      "required": [
        "scope",
        "control_type",
        "reason"
      ],
      "properties": {
        "control_type": {
          "$ref": "#/$defs/ControlType"
        },
        "reason": {
          "type": "string"
        },
        "scope": {
          "$ref": "#/$defs/ControlScope"
        }
      }
    }
  }
}