{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dregs-com/json-schema/dregs-com-v1-escalation-schema.json",
  "title": "V1Escalation",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dregs-com-openapi.json#/components/schemas/V1Escalation",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "escalationRule": {
      "$ref": "#/$defs/V1Reference"
    },
    "identity": {
      "$ref": "#/$defs/V1Reference"
    },
    "identityName": {
      "type": "string"
    },
    "identityEmail": {
      "type": "string"
    },
    "identityUsername": {
      "type": "string"
    },
    "scoreSnapshot": {
      "$ref": "#/$defs/ScoreSnapshot"
    },
    "badgeSnapshot": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BadgeSnapshot"
      }
    },
    "conditions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RuleCondition"
      }
    },
    "triggeredConditions": {
      "type": "array",
      "items": {
        "type": "boolean"
      }
    },
    "severity": {
      "type": "string",
      "enum": [
        "INFO",
        "WARNING",
        "CRITICAL"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "PENDING",
        "OPEN",
        "ACKNOWLEDGED",
        "CLOSED"
      ]
    },
    "openedAt": {
      "type": "string",
      "format": "date-time"
    },
    "acknowledgedBy": {
      "type": "integer",
      "format": "int64"
    },
    "acknowledgedAt": {
      "type": "string",
      "format": "date-time"
    },
    "closedBy": {
      "type": "integer",
      "format": "int64"
    },
    "closedAt": {
      "type": "string",
      "format": "date-time"
    },
    "channels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "ruleDeleted": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "BadgeSnapshot": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "GOOD",
            "BAD",
            "NEUTRAL"
          ]
        },
        "explanation": {
          "type": "string"
        }
      }
    },
    "RuleCondition": {
      "type": "object",
      "properties": {
        "condition": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "threshold": {
          "type": "integer",
          "format": "int32"
        },
        "badge": {
          "type": "string"
        },
        "seconds": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "ScoreSnapshot": {
      "type": "object",
      "properties": {
        "humanity": {
          "type": "integer",
          "format": "int32"
        },
        "authenticity": {
          "type": "integer",
          "format": "int32"
        },
        "uniqueness": {
          "type": "integer",
          "format": "int32"
        },
        "behavior": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "V1Reference": {
      "type": "object",
      "description": "Reference to another entity with ID, label, and API path",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the entity"
        },
        "label": {
          "type": "string",
          "description": "Human-readable label or name"
        },
        "path": {
          "type": "string",
          "description": "API path to the entity resource"
        }
      }
    }
  }
}