{
  "$schema" : "https://json-schema.org/draft/2019-09/schema",
  "$defs" : {
    "AllKinds-1" : {
      "type" : "string",
      "enum" : [ "enabled", "disabled" ]
    },
    "AllKinds-2" : {
      "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.",
          "default" : "false"
        },
        "Events" : {
          "$ref" : "#/$defs/Events-1",
          "description" : "The default subscription settings."
        }
      },
      "if" : {
        "properties" : {
          "Name" : {
            "const" : "microsoft-teams"
          }
        }
      },
      "then" : {
        "properties" : {
          "Config" : {
            "$ref" : "/ivy/12.0.13/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" : {
          "description" : "The document storage defines where the workflow documents should be stored.",
          "default" : "local",
          "additionalProperties" : false,
          "type" : "string",
          "enum" : [ "local", "s3" ],
          "examples" : [ "local", "s3" ]
        }
      },
      "allOf" : [ {
        "if" : {
          "properties" : {
            "Name" : {
              "const" : "local"
            }
          }
        },
        "then" : {
          "properties" : {
            "Config" : {
              "$ref" : "/ivy/12.0.13/blob-storage-local.json"
            }
          }
        }
      }, {
        "if" : {
          "properties" : {
            "Name" : {
              "const" : "s3"
            }
          }
        },
        "then" : {
          "properties" : {
            "Config" : {
              "$ref" : "/ivy/12.0.13/blob-storage-s3.json"
            }
          }
        }
      } ]
    },
    "Events-1" : {
      "type" : "object",
      "properties" : {
        "AllKinds" : {
          "$ref" : "#/$defs/AllKinds-1",
          "description" : "Whether all events are enabled or not.",
          "default" : "enabled"
        },
        "Kinds" : {
          "description" : "Array of subscribed events.",
          "type" : "array",
          "items" : {
            "type" : "string"
          },
          "examples" : [ "new-task" ]
        }
      },
      "additionalProperties" : false
    },
    "Events-2" : {
      "type" : "object",
      "properties" : {
        "AllKinds" : {
          "$ref" : "#/$defs/AllKinds-2",
          "description" : "Whether all events are enabled or not.",
          "default" : "enabled"
        },
        "Kinds" : {
          "description" : "Array of subscribed events.",
          "type" : "array",
          "items" : {
            "type" : "string"
          },
          "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", "keycloak", "microsoft-active-directory", "novell-edirectory", "microsoft-entra-id" ]
        }
      },
      "allOf" : [ {
        "if" : {
          "properties" : {
            "Name" : {
              "const" : "keycloak"
            }
          }
        },
        "then" : {
          "properties" : {
            "Config" : {
              "$ref" : "/ivy/12.0.13/security-idp-keycloak.json"
            }
          }
        }
      }, {
        "if" : {
          "properties" : {
            "Name" : {
              "const" : "microsoft-entra-id"
            }
          }
        },
        "then" : {
          "properties" : {
            "Config" : {
              "$ref" : "/ivy/12.0.13/security-idp-microsoft-entra-id.json"
            }
          }
        }
      }, {
        "if" : {
          "properties" : {
            "Name" : {
              "const" : "microsoft-active-directory"
            }
          }
        },
        "then" : {
          "properties" : {
            "Config" : {
              "$ref" : "/ivy/12.0.13/security-idp-msad.json"
            }
          }
        }
      }, {
        "if" : {
          "properties" : {
            "Name" : {
              "const" : "novell-edirectory"
            }
          }
        },
        "then" : {
          "properties" : {
            "Config" : {
              "$ref" : "/ivy/12.0.13/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."
        },
        "NotifyAbsentUser" : {
          "$ref" : "#/$defs/NotifyAbsentUser",
          "description" : "Parameters to disable notifications if a user is absent.\nIs no property set, it will act like NotifyAbsentUser:always.\nIf NotifyAbsentUser is set to:\nalways: Send a notification regardless of the user’s absence.\nnever: Does not send a notification if the user is absent.\nnoActiveSubstitute: Send a notification only the absent user does not have an active substitute.",
          "default" : "always"
        },
        "NotifyPermanentSubstitute" : {
          "$ref" : "#/$defs/NotifyPermanentSubstitute",
          "description" : "Parameters to control notifications to permanent substitutes.\nIf NotifyPermanentSubstitute is set to:\nalways: Send a notification to the permanent substitute regardless of the user's absence.\nonlyIfAbsent: Send a notification to the permanent substitute only if the user is absent.",
          "default" : "always"
        },
        "Channels" : {
          "description" : "Settings for an individual Channel.",
          "type" : "object",
          "properties" : {
            "mail" : {
              "$ref" : "#/$defs/Channel"
            },
            "microsoft-teams" : {
              "$ref" : "#/$defs/Channel"
            },
            "web" : {
              "$ref" : "#/$defs/WebChannel"
            }
          },
          "examples" : [ "web", "mail", "microsoft-teams" ]
        }
      },
      "additionalProperties" : false
    },
    "NotifyAbsentUser" : {
      "type" : "string",
      "enum" : [ "always", "never", "noActiveSubstitute" ]
    },
    "NotifyPermanentSubstitute" : {
      "type" : "string",
      "enum" : [ "always", "onlyIfAbsent" ]
    },
    "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
    },
    "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
    },
    "WebChannel" : {
      "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.",
          "default" : "true"
        },
        "Events" : {
          "$ref" : "#/$defs/Events-2",
          "description" : "The default subscription settings."
        }
      }
    }
  },
  "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."
    },
    "SSO" : {
      "$ref" : "/ivy/12.0.13/sso.json",
      "description" : "Single Sign-on allows to auto login users.\nA reverse proxy has to be installed in front of the Axon Ivy Engine.\nIt is responsible for authenticating the user.\nThe name of the user must then be transmitted as a HTTP header.\n!! Assert exclusive access to the Axon Ivy Engine otherwise attackers can easily login as another user.\nhttps://developer.axonivy.com/doc/12.0/engine-guide/integration/single-sign-on\n[restart required]"
    },
    "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
}
