{
  "$defs": {
    "AlertData": {
      "properties": {
        "alert_count": {
          "minimum": 1.0,
          "title": "Alert Count",
          "type": "integer"
        },
        "alerts": {
          "items": {
            "oneOf": [
              {
                "$ref": "#/$defs/SpikeAlert"
              },
              {
                "$ref": "#/$defs/EmergingAlert"
              },
              {
                "$ref": "#/$defs/NewHirerAlert"
              }
            ]
          },
          "title": "Alerts",
          "type": "array"
        },
        "generated_at": {
          "format": "date-time",
          "title": "Generated At",
          "type": "string"
        }
      },
      "required": [
        "alert_count",
        "alerts",
        "generated_at"
      ],
      "title": "AlertData",
      "type": "object"
    },
    "EmergingAlert": {
      "description": "A watched topic appeared, with no baseline to compare against yet.",
      "properties": {
        "current_mentions": {
          "title": "Current Mentions",
          "type": "integer"
        },
        "sources": {
          "description": "Number of independent sources that observed it.",
          "title": "Sources",
          "type": "integer"
        },
        "topic": {
          "title": "Topic",
          "type": "string"
        },
        "type": {
          "const": "emerging",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type",
        "topic",
        "current_mentions",
        "sources"
      ],
      "title": "EmergingAlert",
      "type": "object"
    },
    "NewHirerAlert": {
      "description": "A watched company appeared in the hiring feed for the first time.",
      "properties": {
        "company": {
          "title": "Company",
          "type": "string"
        },
        "source": {
          "title": "Source",
          "type": "string"
        },
        "title": {
          "title": "Title",
          "type": "string"
        },
        "type": {
          "const": "new_hirer",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type",
        "company",
        "title",
        "source"
      ],
      "title": "NewHirerAlert",
      "type": "object"
    },
    "SpikeAlert": {
      "description": "A watched topic grew past the spike threshold against its baseline.",
      "properties": {
        "change_pct": {
          "title": "Change Pct",
          "type": "number"
        },
        "current_mentions": {
          "title": "Current Mentions",
          "type": "integer"
        },
        "sources": {
          "description": "Number of independent sources that observed it.",
          "title": "Sources",
          "type": "integer"
        },
        "topic": {
          "title": "Topic",
          "type": "string"
        },
        "type": {
          "const": "spike",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type",
        "topic",
        "change_pct",
        "current_mentions",
        "sources"
      ],
      "title": "SpikeAlert",
      "type": "object"
    }
  },
  "$id": "https://gatiflow.io/schemas/AlertEvent.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "The body of every ``intelligence:alert`` delivery.",
  "properties": {
    "data": {
      "$ref": "#/$defs/AlertData"
    },
    "event": {
      "const": "intelligence:alert",
      "title": "Event",
      "type": "string"
    }
  },
  "required": [
    "event",
    "data"
  ],
  "title": "AlertEvent",
  "type": "object",
  "x-provenance": {
    "generated_from": "https://gatiflow.io/openapi.json",
    "method": "published",
    "publisher": "GatiFlow",
    "source": "https://gatiflow.io/schemas/AlertEvent.json"
  }
}
