{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thesoftwarelens.com/saacip/0.1/schemas/heartbeat.schema.json",
  "$comment": "SaaCIP 0.1 (https://thesoftwarelens.com/saacip/). Licensed under the Apache License 2.0.",
  "title": "SaaCIP 0.1 Resident binding: heartbeat request",
  "description": "POST <base>/heartbeat/.",
  "type": "object",
  "required": [
    "status"
  ],
  "properties": {
    "status": {
      "enum": [
        "ok",
        "degraded"
      ],
      "description": "ok when every connector is healthy; degraded when any is not."
    },
    "connectors": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "ok"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "detail": {
            "type": "string",
            "description": "A short human-readable note on the connector's health."
          }
        }
      }
    },
    "counters": {
      "type": "object",
      "description": "The current track record, in the shape of statement.track_record."
    },
    "receipt_head": {
      "$ref": "common.schema.json#/$defs/sha256Hex"
    },
    "hire": {
      "type": [
        "object",
        "null"
      ],
      "description": "The capability's view of its hire.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The capability's own identifier for the hire (hire_id)."
        },
        "kind": {
          "$ref": "common.schema.json#/$defs/hireKind"
        },
        "status": {
          "$ref": "common.schema.json#/$defs/hireStatus"
        },
        "expires": {
          "type": [
            "number",
            "null"
          ],
          "description": "When a trial or task ends, as a time (section 4.5); null for a standing hire."
        }
      }
    },
    "ext": {
      "$ref": "common.schema.json#/$defs/ext"
    }
  }
}
