{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:orbiplex:schema:operator-extension-safe-mode-action:v1",
  "title": "Operator Extension Safe Mode Action V1",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "schema/v", "action", "operator/binding-ref"],
  "properties": {
    "schema": {"const": "operator-extension-safe-mode-action.v1"},
    "schema/v": {"const": 1},
    "action": {
      "type": "string",
      "enum": [
        "enter",
        "revoke-session-activations",
        "deactivate-package",
        "deactivate-all",
        "restore-distribution-defaults",
        "rebuild-projection",
        "exit"
      ]
    },
    "operator/binding-ref": {"$ref": "#/$defs/ref"},
    "package/ref": {
      "oneOf": [
        {"$ref": "#/$defs/ref"},
        {"type": "null"}
      ]
    }
  },
  "allOf": [
    {
      "if": {"properties": {"action": {"const": "deactivate-package"}}},
      "then": {
        "required": ["package/ref"],
        "properties": {"package/ref": {"$ref": "#/$defs/ref"}}
      },
      "else": {
        "properties": {"package/ref": {"type": "null"}}
      }
    }
  ],
  "$defs": {
    "ref": {"type": "string", "minLength": 1, "maxLength": 256}
  },
  "x-dia-status": "accepted",
  "x-dia-basis": [
    "doc/project/40-proposals/085-operator-sovereign-extensibility-and-experiment-packages.md"
  ]
}
