{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thesoftwarelens.com/saacip/0.1/schemas/enrol-response.schema.json",
  "$comment": "SaaCIP 0.1 (https://thesoftwarelens.com/saacip/). Licensed under the Apache License 2.0.",
  "title": "SaaCIP 0.1 Resident binding: enrol response",
  "description": "201 response to POST <base>/enrol/.",
  "type": "object",
  "required": [
    "protocol",
    "profile",
    "agent_id",
    "agent_token",
    "settings"
  ],
  "properties": {
    "protocol": {
      "$ref": "common.schema.json#/$defs/protocol"
    },
    "profile": {
      "$ref": "common.schema.json#/$defs/profile"
    },
    "agent_id": {
      "type": "string",
      "description": "The hub's identifier for this capability instance in this hire."
    },
    "agent_token": {
      "type": "string",
      "minLength": 40,
      "description": "The credential for every later call, shown once. At least 256 bits of randomness (section 11)."
    },
    "settings": {
      "type": "object",
      "required": [
        "autonomy_level",
        "hire_kind"
      ],
      "properties": {
        "autonomy_level": {
          "$ref": "common.schema.json#/$defs/autonomyLevel"
        },
        "hire_kind": {
          "$ref": "common.schema.json#/$defs/hireKind"
        },
        "trial_days": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The trial length the hub holds, for a trial hire."
        },
        "poll_seconds": {
          "type": "integer",
          "minimum": 1,
          "default": 60,
          "description": "How often the capability should collect its inbox."
        }
      },
      "description": "What the hub asks of the capability. autonomy_level never raises the capability above the ceiling in its terms."
    }
  }
}
