{
  "type": "object",
  "properties": {
    "status": {
      "enum": [
        "ok",
        "error"
      ],
      "description": "Whether the operation succeeded."
    },
    "code": {
      "enum": [
        "network",
        "permission"
      ],
      "description": "The cause of the failed operation."
    }
  },
  "required": [
    "status"
  ],
  "additionalProperties": false,
  "if": {
    "properties": {
      "status": {
        "const": "error"
      }
    },
    "required": [
      "status"
    ]
  },
  "then": {
    "required": [
      "code"
    ]
  },
  "else": {
    "not": {
      "required": [
        "code"
      ]
    }
  }
}
