{
  "$schema" : "https://json-schema.org/draft/2019-09/schema",
  "$defs" : {
    "AllKinds" : {
      "type" : "string",
      "enum" : [ "enabled", "disabled" ]
    },
    "Channel" : {
      "type" : "object",
      "properties" : {
        "Name" : {
          "description" : "Name of the channel.",
          "additionalProperties" : false,
          "type" : "string",
          "examples" : [ "web", "mail", "microsoft-teams" ]
        },
        "Enabled" : {
          "type" : "boolean",
          "description" : "Whether the channel is enabled or not."
        },
        "Events" : {
          "$ref" : "#/$defs/Events",
          "description" : "The default subscription settings."
        }
      },
      "if" : {
        "properties" : {
          "Name" : {
            "const" : "microsoft-teams"
          }
        }
      },
      "then" : {
        "properties" : {
          "Config" : {
            "$ref" : "/ivy/11.3.14/notification-channel-microsoft-teams.json"
          }
        }
      }
    },
    "Cleanup" : {
      "type" : "object",
      "properties" : {
        "DaysUntilDeletion" : {
          "type" : "integer",
          "description" : "Notifications older than this will be deleted on a daily basis.",
          "default" : "90"
        }
      },
      "additionalProperties" : false
    },
    "DocumentStorage" : {
      "type" : "object",
      "properties" : {
        "Name" : {
          "$ref" : "#/$defs/StorageProvider",
          "description" : "The document storage defines where the workflow documents should be stored.",
          "default" : "local"
        }
      },
      "additionalProperties" : false
    },
    "Events" : {
      "type" : "object",
      "properties" : {
        "AllKinds" : {
          "$ref" : "#/$defs/AllKinds",
          "description" : "Whether all events are enabled or not.",
          "default" : "disabled"
        },
        "Kinds" : {
          "description" : "Array of subscribed events.",
          "type" : "array",
          "items" : {
            "type" : "string",
            "examples" : [ "new-task" ]
          },
          "examples" : [ "new-task" ]
        }
      },
      "additionalProperties" : false
    },
    "IdentityProvider" : {
      "type" : "object",
      "properties" : {
        "Name" : {
          "description" : "The Security System manages the user and roles in the system database.\nFor the Ivy Security System, no additional configuration is needed.\nFor any other Security System, further configuration is need to integrate such a system.",
          "default" : "ivy",
          "additionalProperties" : false,
          "type" : "string",
          "examples" : [ "ivy", "microsoft-active-directory", "novell-edirectory", "microsoft-entra-id" ]
        }
      },
      "allOf" : [ {
        "if" : {
          "properties" : {
            "Name" : {
              "const" : "microsoft-entra-id"
            }
          }
        },
        "then" : {
          "properties" : {
            "Config" : {
              "$ref" : "/ivy/11.3.14/security-idp-microsoft-entra-id.json"
            }
          }
        }
      }, {
        "if" : {
          "properties" : {
            "Name" : {
              "const" : "microsoft-active-directory"
            }
          }
        },
        "then" : {
          "properties" : {
            "Config" : {
              "$ref" : "/ivy/11.3.14/security-idp-msad.json"
            }
          }
        }
      }, {
        "if" : {
          "properties" : {
            "Name" : {
              "const" : "novell-edirectory"
            }
          }
        },
        "then" : {
          "properties" : {
            "Config" : {
              "$ref" : "/ivy/11.3.14/security-idp-novell-edir.json"
            }
          }
        }
      } ]
    },
    "Language" : {
      "type" : "object",
      "properties" : {
        "Content" : {
          "description" : "Content is displayed in this language if the content exists in this language. A locale (language[_COUNTRY])",
          "default" : "en",
          "additionalProperties" : false,
          "type" : "string",
          "examples" : [ "en", "en_GB", "en_US", "de", "de_CH", "de_AT", "de_DE", "fr", "vi" ]
        },
        "Formatting" : {
          "description" : "Data like numbers, dates, times and much more are formatted according to this language. A locale (language[_COUNTRY])",
          "default" : "en_GB",
          "additionalProperties" : false,
          "type" : "string",
          "examples" : [ "en", "en_GB", "en_US", "de", "de_CH", "de_AT", "de_DE", "fr", "vi" ]
        }
      },
      "additionalProperties" : false
    },
    "Notification" : {
      "type" : "object",
      "properties" : {
        "Cleanup" : {
          "$ref" : "#/$defs/Cleanup",
          "description" : "Settings for cleaning up notifications."
        },
        "Channels" : {
          "description" : "Settings for an individual Channel.",
          "type" : "object",
          "properties" : {
            "mail" : {
              "$ref" : "#/$defs/Channel"
            },
            "microsoft-teams" : {
              "$ref" : "#/$defs/Channel"
            },
            "web" : {
              "$ref" : "#/$defs/Channel"
            }
          },
          "examples" : [ "web", "mail", "microsoft-teams" ]
        }
      },
      "additionalProperties" : false
    },
    "Schedule" : {
      "type" : "object",
      "properties" : {
        "Cron" : {
          "type" : "string",
          "description" : "Unix Cron expression for the user synchronization.\nFormat is: minutes, hours, day of month, month, day of the week. e.g. \"32 13 * * *\" is everyday at 13:32",
          "default" : "0 0 * * *"
        },
        "Enabled" : {
          "type" : "boolean",
          "description" : "Shall we run the daily Identity Provider user synchronization job?\nWhen the synchronization runs is defined by 'Cron'.",
          "default" : "true"
        },
        "ImportUsers" : {
          "type" : "boolean",
          "description" : "Shall we import NEW users with the Identity Provider on schedule?\nThis setting does not affect synchronization of existing users.\nIf ImportUsers is set to:\ntrue:  NEW users are imported on schedule.\n       If a user has not yet been imported by the user synchronization job, she is also imported the first time she logs in.\nfalse: NEW users are not imported on schedule.\n       Instead, a NEW user is only imported the first time she logs in.",
          "default" : "true"
        }
      },
      "additionalProperties" : false
    },
    "StorageProvider" : {
      "type" : "string",
      "enum" : [ "local", "s3" ]
    },
    "UserSync" : {
      "type" : "object",
      "properties" : {
        "OnLogin" : {
          "type" : "boolean",
          "description" : "Shall we synchronize a user with the Identity Provider at login?\nIf the user does not exist yet, he will be synchronized anyway.\nIn case of slow Identity Provider connections, it can make sense to set this to false.",
          "default" : "true"
        },
        "OnSchedule" : {
          "$ref" : "#/$defs/Schedule"
        }
      },
      "additionalProperties" : false
    }
  },
  "type" : "object",
  "properties" : {
    "UrlPath" : {
      "type" : "string",
      "description" : "The security system slug name which will be used in URL as prefix for all resources which are part of the security system.\nIf not set, then the security system name will be choosen.\nOnly for the default security context this is empty, by default.",
      "default" : "null"
    },
    "IdentityProvider" : {
      "$ref" : "#/$defs/IdentityProvider"
    },
    "Notification" : {
      "$ref" : "#/$defs/Notification",
      "description" : "The notification channel settings including their default subscription settings which apply to all users."
    },
    "UserSynch" : {
      "$ref" : "#/$defs/UserSync"
    },
    "DocumentStorage" : {
      "$ref" : "#/$defs/DocumentStorage"
    },
    "Language" : {
      "$ref" : "#/$defs/Language",
      "description" : "The default language settings, which applies to all users, who have not explicitly set this in their profile settings."
    }
  },
  "additionalProperties" : false
}
