{
  "type": "object",
  "properties": {
    "alias": {
      "type": "string"
    },
    "load": {
      "type": "boolean",
      "default": true
    },
    "enabled": {
      "type": "boolean",
      "default": true
    },
    "delivery_defaults": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string"
        },
        "debug": {
          "type": "boolean"
        },
        "options": {
          "type": "object",
          "additionalProperties": true
        },
        "data": {
          "type": "object",
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "boolean"
              },
              {
                "type": "number"
              },
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "object",
                "nullable": true,
                "description": "Must be null"
              }
            ]
          }
        },
        "target": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "entity_id": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "device_id": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "area_id": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "floor_id": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "label_id": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "email": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "phone": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "mobile_app_id": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "person_id": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "target_required": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": [
                "always",
                "never",
                "optional"
              ]
            }
          ]
        },
        "target_usage": {
          "type": "string",
          "enum": [
            "no_delivery",
            "no_action",
            "merge_delivery",
            "merge_always",
            "fixed"
          ]
        },
        "inclusion": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "fallback_on_error",
              "explicit",
              "scenario",
              "default",
              "fallback"
            ]
          }
        },
        "priority": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              },
              {
                "type": "string",
                "enum": [
                  "minimum",
                  "low",
                  "medium",
                  "high",
                  "critical"
                ]
              }
            ]
          }
        },
        "selection_rank": {
          "type": "string",
          "enum": [
            "ANY",
            "FIRST",
            "LAST"
          ]
        },
        "alias": {
          "type": "string"
        },
        "template": {
          "type": "string"
        },
        "message": {
          "type": "string",
          "nullable": true
        },
        "title": {
          "type": "string",
          "nullable": true
        },
        "occupancy": {
          "type": "string",
          "enum": [
            "all_in",
            "all_out",
            "any_in",
            "any_out",
            "only_in",
            "only_out",
            "all",
            "none"
          ]
        },
        "conditions": {
          "type": "array",
          "items": {
            "nullable": true,
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "connection": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string"
        },
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535,
          "default": 587
        },
        "encryption": {
          "type": "string",
          "enum": [
            "tls",
            "starttls",
            "none"
          ],
          "default": "starttls"
        },
        "username": {
          "type": "string"
        },
        "password": {
          "type": "string"
        },
        "timeout": {
          "type": "integer",
          "minimum": 0,
          "default": 5
        },
        "verify_ssl": {
          "type": "boolean",
          "default": true
        }
      },
      "required": [
        "host"
      ],
      "additionalProperties": false
    },
    "device_domain": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "device_model_include": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "device_model_exclude": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "device_discovery": {
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "title": "Transport Definition",
  "$id": "https://supernotify.rhizomatics.org.uk/developer/schemas/json/Transport_Definition.schema.json",
  "description": "Voluptuous validation schema for Transport_Definition",
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}