<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
  ~ Copyright (C) 2010-2022 Evolveum and contributors
  ~
  ~ Licensed under the EUPL-1.2 or later.
  --><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3" xmlns:tns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" elementFormDefault="qualified" jaxb:extensionBindingPrefixes="xjc" jaxb:version="3.0" targetNamespace="http://midpoint.evolveum.com/xml/ns/public/common/common-3">

    <xsd:annotation>
        <xsd:documentation>
            TODO
        </xsd:documentation>
    </xsd:annotation>

    <!-- Don't provide schemaLocation here, as it causes xjc to really contact the URIs (!) -->
    <xsd:import namespace="http://prism.evolveum.com/xml/ns/public/annotation-3" schemaLocation="../annotation-3.xsd"/>
    <xsd:import namespace="http://prism.evolveum.com/xml/ns/public/types-3" schemaLocation="../types-3.xsd"/>

    <xsd:include schemaLocation="common-core-3.xsd"/>

    <!-- region persistent objects/containers -->
    <!--
    TODO: Can this fully replace NotificationMessageType? It better does. Not-planned for 4.5.
    See: https://docs.evolveum.com/midpoint/projects/idmatch/notification-hypo-design/
    <xsd:complexType name="MessageType">
        <xsd:annotation>
            <xsd:documentation>
                Message to be send via some transport.
                Structure is a container stored in the repository.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
                <a:displayName>MessageType.details</a:displayName>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
             transport/deliver related properties
            <xsd:element name="transportName" type="xsd:string" minOccurs="0"/>
            <xsd:element name="deliveryState" type="tns:MessageDeliveryStateType" minOccurs="0"/>
            <xsd:element name="deliveryRetries" type="xsd:int" minOccurs="0"/>
            <xsd:element name="deliveryErrorMessage" type="xsd:string" minOccurs="0"/>
             message content properties
            <xsd:element name="from" type="xsd:string" minOccurs="0"/>
            <xsd:element name="to" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="cc" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="bcc" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="subject" type="xsd:string" minOccurs="0"/>
            <xsd:element name="body" type="xsd:string" minOccurs="0"/>
            <xsd:element name="contentType" type="xsd:string" minOccurs="0"/>
            <xsd:element name="attachment" type="tns:NotificationMessageAttachmentType" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="MessageDeliveryStateType">
        <xsd:annotation>
            <xsd:documentation>
                Enumeration of possible delivery states of the message.
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="unsent">
                <xsd:annotation>
                    <xsd:documentation>
                        Message waiting for sending or resending (retry).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="UNSENT"/>
                        <a:displayName>MessageDeliveryStateType.unsent</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="sent">
                <xsd:annotation>
                    <xsd:documentation>
                        Message was sent - this is considered an ideal final state.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="SENT"/>
                        <a:displayName>MessageDeliveryStateType.sent</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="failed">
                <xsd:annotation>
                    <xsd:documentation>
                        Message delivery failed, even after retries - this is a final state.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="FAILED"/>
                        <a:displayName>MessageDeliveryStateType.failed</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>
    -->

    <xsd:complexType name="MessageTemplateContentType">
        <xsd:annotation>
            <xsd:documentation>
                Specifies the content of the message used with a transport mechanism, for instance mail.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
                <a:displayName>MessageTemplateContentType.details</a:displayName>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element minOccurs="0" name="subjectExpression" type="c:ExpressionType">
                <xsd:annotation>
                    <xsd:documentation>
                        How to construct the subject of the message that is to be sent.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>MessageTemplateContentType.subjectExpression</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="bodyExpression" type="c:ExpressionType">
                <xsd:annotation>
                    <xsd:documentation>
                        How to construct the body (text) of the message that is to be sent.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>MessageTemplateContentType.bodyExpression</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="contentType" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Body content type, e.g. text/plain (the default), text/html, and so on.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>MessageTemplateContentType.contentType</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="attachment" type="tns:NotificationMessageAttachmentType">
                <xsd:annotation>
                    <xsd:documentation>
                        Message attachment(s) to be sent out.
                        Can be combined with `attachmentExpression`.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>MessageTemplateContentType.attachment</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="attachmentExpression" type="tns:ExpressionType">
                <xsd:annotation>
                    <xsd:documentation>
                        An expression that returns message attachment(s) to be sent out.
                        Returned objects should be of type NotificationMessageAttachmentType.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>MessageTemplateContentType.attachmentExpression</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="LocalizedMessageTemplateContentType">
        <xsd:annotation>
            <xsd:documentation>
                Single language localization for the message template.
                If `attachmentExpression` is not specified, the one from the default content will be used.
                If no `attachment` is specified, the ones from the default content will be used.
                This allows for language specific attachments without the need to re-specify the ones that
                are not language specific.
                It is also possible to override `attachmentExpression` for language specific one and leave
                out `attachment` to use the ones defined in `attachment` element of the default content.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
                <a:displayName>LocalizedMessageTemplateContentType.details</a:displayName>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:MessageTemplateContentType">
                <xsd:sequence>
                    <xsd:element minOccurs="0" name="language" type="xsd:string">
                        <xsd:annotation>
                            <xsd:documentation>
                                Indicates the language used for the message template content.
                                The format is IETF language tag defined in BCP 47, where underscore is used as a subtag separator.
                                This is usually a ISO 639-1 two-letter language code optionally followed by ISO 3166-1
                                two-letter country code separated by underscore.
                                The languages that do not have country-specific variants are usually specified by using
                                a two-letter country code ("sk", "cs", "tr").
                                Languages with country-specific variants have country-specific subtags ("pt_BR", "zn_CN").
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:displayName>LocalizedMessageTemplateContentType.language</a:displayName>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="localizedMessageTemplateContentType" type="tns:LocalizedMessageTemplateContentType"/>

    <xsd:complexType name="MessageTemplateType">
        <xsd:annotation>
            <xsd:documentation>
                Localizable template of the message used with a transport mechanism, for instance mail.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="c:AssignmentHolderType">
                <xsd:sequence>
                    <xsd:element minOccurs="0" name="defaultContent" type="tns:MessageTemplateContentType">
                        <xsd:annotation>
                            <xsd:documentation>
                                The default message content if localization is not used or not found.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="localizedContent" type="tns:LocalizedMessageTemplateContentType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Set of other localized contents, which is content extended with a language tag.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="messageTemplate" type="tns:MessageTemplateType"/>
    <!-- endregion -->

    <!-- region Pre-4.5 transport configuration, inside the notification config (DEPRECATED) -->
    <!--
    These notifiers also use "name" attribute, which is not our typical style,
    so the new types were created with name element.
    -->
    <xsd:complexType name="NotificationTransportConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                Configuration that is common to all notification transports.

                DEPRECATED: Use new messageTransportConfiguration instead.
            </xsd:documentation>
            <xsd:appinfo>
                <a:deprecated>true</a:deprecated>
                <a:deprecatedSince>4.5</a:deprecatedSince>
                <a:plannedRemoval>4.7</a:plannedRemoval>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element minOccurs="0" name="debug" type="xsd:boolean">
                <xsd:annotation>
                    <xsd:documentation>
                        Enables debugging specific for a given transport (if supported by it). For example, when used for
                        mail transport it enables debugging of javamail - sending diagnostics to standard output (console).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>NotificationTransportConfigurationType.debug</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="redirectToFile" type="xsd:string">
                <xsd:annotation>
                    <!-- TODO: check implementation and reconsider, redirectToFile should not depend on black/whiteLists -->
                    <xsd:documentation>
                        When this transport don't have definition blackList, whiteList or recipient FilterExpression,
                        instead of sending message via this transport, writes it to a file. Useful for debugging.
                        When is defined one of whiteList, blackList or recipientFilterExpression, the messages
                        for allowed recipient are sent, and the messages for forbidden recipients are written to a file.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>NotificationTransportConfigurationType.redirectToFile</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="logToFile" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        In addition to sending message via this transport, writes it to a file. Useful for debugging.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>NotificationTransportConfigurationType.logToFile</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="blackList" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Addresses that are on a "black list". If a message contains one or more addresses that are blacklisted,
                        it is stored into file specified in "redirectToFile" and either not sent at all (if no other addresses
                        remain) or sent without blacklisted addresses.

                        An address can contain "*" character, that matches any substring, e.g. "*@acme.org".

                        At most one of "blackList", "whiteList" and "recipientFilterExpression" can be used.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>NotificationTransportConfigurationType.blackList</a:displayName>
                        <a:since>4.0</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="whiteList" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Addresses that are on a "white list". If specified, then all addresses are blacklisted, except for
                        those that match a white list entry.

                        An address can contain "*" character, that matches any substring, e.g. "*@acme.org".

                        At most one of "blackList", "whiteList" and "recipientFilterExpression" can be used.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>NotificationTransportConfigurationType.whiteList</a:displayName>
                        <a:since>4.0</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="recipientFilterExpression" type="tns:ExpressionType">
                <xsd:annotation>
                    <xsd:documentation>
                        An expression that decides whether the recipient address is allowed to pass through or it should
                        be blacklisted. The expression expects input value in "recipientAddress" variable (usually a String),
                        and should provide a boolean value: "true" means "pass through", "false" means "block".

                        At most one of "blackList", "whiteList" and "recipientFilterExpression" can be used.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>NotificationTransportConfigurationType.recipientFilterExpression</a:displayName>
                        <a:since>4.0</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string"/>
    </xsd:complexType>

    <xsd:complexType name="MailConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                Where and how to send mail notifications (or any other mail messages).

                DEPRECATED: Use new messageTransportConfiguration instead.
            </xsd:documentation>
            <xsd:appinfo>
                <a:displayName>MailConfigurationType.details</a:displayName>
                <a:deprecated>true</a:deprecated>
                <a:deprecatedSince>4.5</a:deprecatedSince>
                <a:plannedRemoval>4.7</a:plannedRemoval>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:NotificationTransportConfigurationType">
                <xsd:sequence>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="server" type="tns:MailServerConfigurationType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Configuration of a particular mail server host. If there are more of them, they are tried
                                one after another. If there is none, mail notifications are not sent.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:displayName>MailConfigurationType.server</a:displayName>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="defaultFrom" type="xsd:string">
                        <xsd:annotation>
                            <xsd:documentation>
                                What to put into "From" field of mail messages (unless overridden by specific situation).
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:displayName>MailConfigurationType.defaultFrom</a:displayName>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <!-- If changed to container, order is needed + fix the docs saying that servers are tried in the specified order. -->
    <xsd:complexType name="MailServerConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                Configuration of a particular mail server host.
            </xsd:documentation>
            <xsd:appinfo>
                <!-- Causes NPE TestCryptoUtil in mail.getServer().get(0).getPassword() returns value that returns null for getEncryptedDataType() -->
                <!--<a:container/>-->
                <a:displayName>MailServerConfigurationType.details</a:displayName>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="host" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Mail server host (FQDN or IP address).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>MailServerConfigurationType.host</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="port" type="xsd:int">
                <xsd:annotation>
                    <xsd:documentation>
                        Mail server port (25 by default).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>MailServerConfigurationType.port</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="username" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        How to authenticate to the mail server.

                        DEPRECATED: use new BasicAuthenticationType instead.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>MailServerConfigurationType.username</a:displayName>
                        <a:deprecated>true</a:deprecated>
                        <a:deprecatedSince>4.10</a:deprecatedSince>
                        <a:plannedRemoval>5.0</a:plannedRemoval><!-- TODO: check version or remove -->
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="password" type="t:ProtectedStringType">
                <xsd:annotation>
                    <xsd:documentation>
                        How to authenticate to the mail server.

                        DEPRECATED: use new BasicAuthenticationType instead.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>MailServerConfigurationType.password</a:displayName>
                        <a:deprecated>true</a:deprecated>
                        <a:deprecatedSince>4.10</a:deprecatedSince>
                        <a:plannedRemoval>5.0</a:plannedRemoval><!-- TODO: check version or remove -->
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="transportSecurity" type="tns:MailTransportSecurityType">
                <xsd:annotation>
                    <xsd:documentation>
                        How to ensure transport-level security when sending the message.

                        Defaults to none for basic auth, and tls for oauth2.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>MailServerConfigurationType.transportSecurity</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:choice>
                <xsd:element name="basicAuthentication" type="tns:BasicAuthenticationType"/>
                <xsd:element name="oauth2Authentication" type="tns:OAuth2CredentialsType"/>
            </xsd:choice>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="BasicAuthenticationType">
        <xsd:annotation>
            <xsd:documentation>
                Configuration of a username/password based authentication.
            </xsd:documentation>
            <xsd:appinfo>
                <a:displayName>BasicAuthenticationType.details</a:displayName>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element minOccurs="0" name="username" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        How to authenticate to the mail server.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>BasicAuthenticationType.username</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="password" type="t:ProtectedStringType">
                <xsd:annotation>
                    <xsd:documentation>
                        How to authenticate to the mail server.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>BasicAuthenticationType.password</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="OAuth2CredentialsType">
        <xsd:annotation>
            <xsd:documentation>
                Configuration of OAuth 2.0 authentication.

                EXPERIMENTAL, tested for O365.
            </xsd:documentation>
            <xsd:appinfo>
                <a:displayName>OAuth2CredentialsType.details</a:displayName>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="username" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        User on the authentication server.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>OAuth2CredentialsType.username</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="clientId" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Client ID from the authentication server.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>OAuth2CredentialsType.clientId</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="clientSecret" type="t:ProtectedStringType">
                <xsd:annotation>
                    <xsd:documentation>
                        Client secret from the authentication server.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>OAuth2CredentialsType.clientSecret</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="tokenEndpoint" type="xsd:anyURI">
                <xsd:annotation>
                    <xsd:documentation>
                        URL where midpoint can obtain access tokens.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>OAuth2CredentialsType.tokenEndpoint</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="scope" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Scope to be requested, for example "https://outlook.office365.com/.default" for o365.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>OAuth2CredentialsType.scope</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="MailTransportSecurityType">
        <xsd:annotation>
            <xsd:documentation>
                How to ensure transport-level security when sending the message.
                SSL/STARTTLS settings are currently EXPERIMENTAL (e.g. there is no support
                for setting certificate validation-related properties; default behavior
                of javax.mail implementation is used).
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="none">
                <xsd:annotation>
                    <xsd:documentation>
                        No attempts to ensure transport security.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="NONE"/>
                        <a:displayName>MailTransportSecurityType.none</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="starttlsEnabled">
                <xsd:annotation>
                    <xsd:documentation>
                        Uses STARTTLS feature, if available on the server.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="STARTTLS_ENABLED"/>
                        <a:displayName>MailTransportSecurityType.starttlsEnabled</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="starttlsRequired">
                <xsd:annotation>
                    <xsd:documentation>
                        Uses STARTTLS feature. If it is not available on the server, the message sending fails.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="STARTTLS_REQUIRED"/>
                        <a:displayName>MailTransportSecurityType.starttlsRequired</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="ssl">
                <xsd:annotation>
                    <xsd:documentation>
                        Employs (older) mechanism of using SSL/TLS - wraps whole SMTP connection in SSL/TLS.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="SSL"/>
                        <a:displayName>MailTransportSecurityType.ssl</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="SmsConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                Where and how to send SMS notifications (or any other SMS).
            </xsd:documentation>
            <xsd:appinfo>
                <a:deprecated>true</a:deprecated>
                <a:deprecatedSince>4.5</a:deprecatedSince>
                <a:plannedRemoval>4.7</a:plannedRemoval>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:NotificationTransportConfigurationType">
                <xsd:sequence>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="gateway" type="tns:SmsGatewayConfigurationType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Configuration of a particular mail server host. If there are more of them, they are tried
                                one after another. If there is none, mail notifications are not sent.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="defaultFrom" type="xsd:string">
                        <xsd:annotation>
                            <xsd:documentation>
                                What to put into "From" field of SMS, if supported by the gateway.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="FileConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                Where and how to store "file" notifications.
            </xsd:documentation>
            <xsd:appinfo>
                <a:displayName>FileConfigurationType.details</a:displayName>
                <a:deprecated>true</a:deprecated>
                <a:deprecatedSince>4.5</a:deprecatedSince>
                <a:plannedRemoval>5.0</a:plannedRemoval>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:NotificationTransportConfigurationType">
                <xsd:sequence>
                    <xsd:element minOccurs="0" name="file" type="xsd:string">
                        <xsd:annotation>
                            <xsd:documentation>
                                File to store notifications into.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:displayName>FileConfigurationType.f</a:displayName>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="LegacyCustomTransportConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:deprecated>true</a:deprecated>
                <a:deprecatedSince>4.5</a:deprecatedSince>
                <a:plannedRemoval>4.7</a:plannedRemoval>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:NotificationTransportConfigurationType">
                <xsd:sequence>
                    <xsd:element minOccurs="0" name="expression" type="tns:ExpressionType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Expression that processes incoming message.
                                Expects a single-valued "message" variable. (If really needed, "event" variable is also available.)
                                Should not return anything.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SmsGatewayConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                Configuration of a particular SMS gateway.

                Currently, we only support sending via HTTP GET method.
            </xsd:documentation>
            <xsd:appinfo>
                <a:schemaMigration>
                    <a:element>tns:url</a:element>
                    <a:version>4.0</a:version>
                    <a:operation>removed</a:operation>
                </a:schemaMigration>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element minOccurs="0" name="method" type="c:HttpMethodType">
                <xsd:annotation>
                    <xsd:documentation>
                        Which HTTP method is used to send SMS. Currently, "get" and "post" are supported.
                        If not specified, "get" is assumed.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>3.7.1</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="urlExpression" type="c:ExpressionType">
                <xsd:annotation>
                    <xsd:documentation>
                        Expression that returns URL used to send SMS.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>3.7.1</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="headersExpression" type="c:ExpressionType">
                <xsd:annotation>
                    <xsd:documentation>
                        Expression that returns HTTP request headers. The expression should return 0, 1 or more string values
                        that will be used as request HTTP headers. Each value is in the form of "name: value", i.e.
                        a header name followed by comma, space and a header value. If one header has to have more values,
                        such name-value pair should be present more times for the given header name.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>3.7.1</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="bodyExpression" type="c:ExpressionType">
                <xsd:annotation>
                    <xsd:documentation>
                        Expression that returns request body used to send SMS (as a string).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>3.7.1</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="bodyEncoding" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Encoding to be used for the message body. ISO 8859-1 is the default.
                        Note that if you use any other encoding, your responsibility is to provide appropriate
                        Content-Type header (see headersExpression item). This requirement might change in the future.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>3.7.1</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="username" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        How to authenticate to the SMS gateway.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="password" type="t:ProtectedStringType">
                <xsd:annotation>
                    <xsd:documentation>
                        How to authenticate to the SMS gateway.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="proxyHost" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Proxy host.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.0</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="proxyPort" type="xsd:int">
                <xsd:annotation>
                    <xsd:documentation>
                        Proxy port.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.0</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="proxyUsername" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        How to authenticate to the proxy.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.0</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="proxyPassword" type="t:ProtectedStringType">
                <xsd:annotation>
                    <xsd:documentation>
                        How to authenticate to the proxy.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.0</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="redirectToFile" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Instead of opening HTTP connection, writes the URL to this file. Useful for debugging.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="logToFile" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        In addition to executing the expression, writes all messages to a file. Useful for debugging.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>3.7.1</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string"/>
    </xsd:complexType>
    <!-- endregion -->

    <xsd:complexType name="NotificationConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                A configuration for user notifications. It defines how should be notifications created in various
                situations, e.g. when an account is created or removed.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
                <a:displayName>NotificationConfigurationType.details</a:displayName>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="handler" type="tns:EventHandlerType"/> <!-- implicit fork -->

            <!-- Left for compatibility, but use new messageTransportConfiguration. -->
            <xsd:element minOccurs="0" name="mail" type="tns:MailConfigurationType">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:displayName>NotificationConfigurationType.mail</a:displayName>
                        <a:deprecated>true</a:deprecated>
                        <a:deprecatedSince>4.5</a:deprecatedSince>
                        <a:plannedRemoval>5.0</a:plannedRemoval>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="sms" type="tns:SmsConfigurationType">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:deprecated>true</a:deprecated>
                        <a:deprecatedSince>4.5</a:deprecatedSince>
                        <a:plannedRemoval>4.7</a:plannedRemoval>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="file" type="tns:FileConfigurationType">
                <xsd:annotation>
                    <xsd:appinfo>
                        <!-- TODO: not deprecated yet because it breaks old GUI, see comments in NotificationConfigTabPanel -->
                        <a:deprecated>true</a:deprecated>
                        <a:deprecatedSince>4.5</a:deprecatedSince>
                        <a:plannedRemoval>5.0</a:plannedRemoval>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="customTransport" type="tns:LegacyCustomTransportConfigurationType">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:deprecated>true</a:deprecated>
                        <a:deprecatedSince>4.5</a:deprecatedSince>
                        <a:plannedRemoval>5.0</a:plannedRemoval>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>

            <!-- TODO: currently disabled, support not implemented in 4.5, use global transport configuration instead.
            <xsd:element name="transportConfig" type="tns:NotificationTransportConfigType" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation>
                        Notification specific transport configuration.
                        It does not need to be there, but allows for notification specific redirections, logging, etc.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.5</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            -->
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="notificationConfiguration" type="tns:NotificationConfigurationType"/>

    <xsd:complexType name="BaseEventHandlerType">
        <xsd:annotation>
            <xsd:documentation>
                Common base type for handler and notifiers - filtering and common information.
                It can contain conditions - general expressions or lists of event categories, operation types,
                success/failure statuses, and so on.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element minOccurs="0" name="name" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Symbolic name, used either as a comment or (in the future) maybe to reference the filter.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="description" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        A note about the notifier and its filters, e.g. for the administrator.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" ref="tns:documentation"/>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="category" type="tns:EventCategoryType">
                <xsd:annotation>
                    <xsd:documentation>
                        Event categories supported by this handler. (Default: all)
                        Categories not listed are filtered out: not handled by this handler nor any of its successors.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="operation" type="tns:EventOperationType">
                <xsd:annotation>
                    <xsd:documentation>
                        Operations supported by this handler. (Default: all)
                        Operations not listed are filtered out: not handled by this handler nor any of its successors.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="status" type="tns:EventStatusType">
                <xsd:annotation>
                    <xsd:documentation>
                        Result statuses supported by this handler. (Default: all)
                        Statuses not listed are filtered out: not handled by this handler nor any of its successors.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="objectKind" type="tns:ShadowKindType">
                <xsd:annotation>
                    <xsd:documentation>
                        Resource object kinds supported by this handler. (Default: all)
                        Kinds not listed are filtered out: not handled by this handler nor any of its successors.
                        (Relevant only for account-related events.)
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="objectIntent" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Resource object intents supported by this handler. (Default: all)
                        Intents not listed are filtered out: not handled by this handler nor any of its successors.
                        (Relevant only for account-related events.)
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="focusType" type="xsd:QName">
                <xsd:annotation>
                    <xsd:documentation>
                        Focus types supported by this handler. (Default: all)
                        Types not listed are filtered out: not handled by this handler nor any of its successors.
                        (Relevant only for model-generated events.)
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="expressionFilter" type="tns:ExpressionType">
                <xsd:annotation>
                    <xsd:documentation>
                        Expression that returns true (if the event is to be processed and passed further) or false (if it has to be thrown off).
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="EventHandlerType">
        <xsd:annotation>
            <xsd:documentation>
                An event handler type - extends common handler with filter/info
                and additionally can contain one or more notifiers of various kinds.
                Each notifier is considered and multiple of them can be used, if not filtered out.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:BaseEventHandlerType">
                <xsd:sequence>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simpleUserNotifier" type="tns:SimpleUserNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="timeValidityNotifier" type="tns:TimeValidityNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simpleFocalObjectNotifier" type="tns:SimpleFocalObjectNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simpleResourceObjectNotifier" type="tns:SimpleResourceObjectNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simpleWorkflowNotifier" type="tns:SimpleWorkflowNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simpleCaseManagementNotifier" type="tns:SimpleCaseManagementNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="userPasswordNotifier" type="tns:UserPasswordNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="userRegistrationNotifier" type="tns:RegistrationConfirmationNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="passwordResetNotifier" type="tns:PasswordResetNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="accountActivationNotifier" type="tns:AccountActivationNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="accountPasswordNotifier" type="tns:AccountPasswordNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simpleCampaignNotifier" type="tns:SimpleCampaignNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simpleCampaignStageNotifier" type="tns:SimpleCampaignStageNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simpleReviewerNotifier" type="tns:SimpleReviewerNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simpleTaskNotifier" type="tns:SimpleTaskNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simpleReportNotifier" type="tns:SimpleReportNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simplePolicyRuleNotifier" type="tns:SimplePolicyRuleNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:since>3.6</a:since>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="generalNotifier" type="tns:GeneralNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Here can go any notifiers (that extend GeneralNotifierType).
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="simpleActivityPolicyRuleNotifier" type="tns:SimpleActivityPolicyRuleNotifierType">
                        <xsd:annotation>
                            <xsd:appinfo>
                                <a:since>4.10</a:since>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="customNotifier" type="tns:CustomNotifierType">
                        <xsd:annotation>
                            <xsd:documentation>
                                TODO EXPERIMENTAL
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:simpleType name="EventCategoryType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="resourceObjectEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="RESOURCE_OBJECT_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="modelEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="MODEL_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="workItemEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="WORK_ITEM_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="workItemLifecycleEvent">
                <xsd:annotation>
                    <xsd:documentation>
                        Subtype of workItemEvent. Represents the fact that a work item was created or deleted.
                        Operation of ADD means that the work item was created.
                        Operation of DELETE means that the work item was deleted (usually because it was completed).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="WORK_ITEM_LIFECYCLE_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="workItemAllocationEvent">
                <xsd:annotation>
                    <xsd:documentation>
                        Subtype of workItemEvent. Represents the fact that a work item was allocated to a user.
                        (Either automatically when it is created or delegated, or manually when the user has claimed the item.)
                        Operation of ADD means that the allocation was created.
                        Operation of MODIFY means that the allocation is about to be deleted (probably as part of timed
                        delegation/escalation or timed completion).
                        Operation of DELETE means that the allocation was deleted (because of task completion/deletion or delegation).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="WORK_ITEM_ALLOCATION_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="workItemCustomEvent">
                <xsd:annotation>
                    <xsd:documentation>
                        Subtype of workItemEvent. Custom notification event emitted by "notify" timed action.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="WORK_ITEM_CUSTOM_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="workflowProcessEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="WORKFLOW_PROCESS_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="workflowEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="WORKFLOW_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="caseWorkItemEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="CASE_WORK_ITEM_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="accessCertificationEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="ACCESS_CERTIFICATION_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="certCampaignEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="CERT_CAMPAIGN_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="certCampaignStageEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="CERT_CAMPAIGN_STAGE_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="certCaseEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="CERT_CASE_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="caseManagementEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="CASE_MANAGEMENT_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="taskEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="TASK_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="activityEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="ACTIVITY_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="customEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="CUSTOM_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="policyRuleEvent">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="POLICY_RULE_EVENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="EventStatusType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="success">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="SUCCESS"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="alsoSuccess">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="ALSO_SUCCESS"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="failure">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="FAILURE"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="onlyFailure">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="ONLY_FAILURE"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="inProgress">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="IN_PROGRESS"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="EventOperationType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="add">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="ADD"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="modify">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="MODIFY"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="delete">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="DELETE"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>


    <!-- region Notifiers -->
    <xsd:complexType name="GeneralNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                General notifier that can handle any type of event.
                There is little implicit behavior, no default body, etc.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:BaseEventHandlerType">
                <xsd:sequence>
                    <!-- Addressing configuration elements -->
                    <xsd:element minOccurs="0" name="fromExpression" type="c:ExpressionType">
                        <xsd:annotation>
                            <xsd:documentation>
                                from address
                                overwrites notificationConfiguration/mail/defaultFrom
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="recipientExpression" type="c:ExpressionType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Recipient(s) that should get the notifications.
                                Expression should preferably return a focus object that can be later used by a transport
                                to extract the address and also to determine language for multi-language message templates.
                                Alternatively, an address as a string can be returned directly - mail address, phone number, etc.
                                Obviously, this is not flexible enough for notifiers sending messages with multiple different transports.
                                Expression can return multiple values and multiple expressions can be specified.
                                The results of all the values are merged and message for each recipient (or address) is sent.
                                <!-- TODO Should OID be treated as a focus object? Currently it is not. -->
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="ccExpression" type="c:ExpressionType">
                        <xsd:annotation>
                            <xsd:documentation>
                                cc Recipient(s) that should get the notifications.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="bccExpression" type="c:ExpressionType">
                        <xsd:annotation>
                            <xsd:documentation>
                                bcc Recipient(s) that should get the notifications.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <!-- Content related elements -->
                    <xsd:element minOccurs="0" name="messageTemplateRef" type="c:ObjectReferenceType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Reference to the message template that produces the content of the message.
                                If other content related expressions are used they override the ones from the message template.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:objectReferenceTargetType>tns:MessageTemplateType</a:objectReferenceTargetType>
                                <a:displayName>GeneralNotifierType.template</a:displayName>
                                <a:since>4.5</a:since>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="subjectExpression" type="c:ExpressionType">
                        <xsd:annotation>
                            <xsd:documentation>
                                How to construct the subject of the message that is to be sent.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="subjectPrefix" type="xsd:string">
                        <xsd:annotation>
                            <xsd:documentation>
                                Simpler alternative to subjectExpression: the subject itself will be constructed by the notifier,
                                but it will be prefixed by value specified here.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="bodyExpression" type="c:ExpressionType">
                        <xsd:annotation>
                            <xsd:documentation>
                                How to construct the body (text) of the message that is to be sent.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="contentType" type="xsd:string">
                        <xsd:annotation>
                            <xsd:documentation>
                                Body content type, e.g. text/plain (the default), text/html, and so on.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="contentTypeExpression" type="c:ExpressionType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Body content type, e.g. text/plain (the default), text/html, and so on - specified as expression.
                                If `contentType` element is used, this one is ignored.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="attachment" type="tns:NotificationMessageAttachmentType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Message attachment(s) to be sent out.
                                Can be combined with `attachmentExpression`.
                                If message template is used, its `attachment` are also added to the final list of attachments.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:since>4.0</a:since>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="attachmentExpression" type="tns:ExpressionType">
                        <xsd:annotation>
                            <xsd:documentation>
                                An expression that returns message attachment(s) to be sent out.
                                Returned objects should be of type NotificationMessageAttachmentType.
                                If message template is used, its `attachmentExpression` is ignored.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:since>4.0</a:since>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                    <!-- Other attributes (not content and addressing) -->
                    <xsd:element minOccurs="0" name="watchAuxiliaryAttributes" type="xsd:boolean">
                        <xsd:annotation>
                            <xsd:documentation>
                                Whether to send a notification when only auxiliary attributes (namely: validityStatus,
                                validityChangeTimestamp, effectiveStatus, disableTimestamp, modifyChannel, modifyTimestamp,
                                modifierRef and maybe others) are modified. If set to false (default), these attributes
                                are hidden from list of modified attributes as well.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="showModifiedValues" type="xsd:boolean">
                        <xsd:annotation>
                            <xsd:documentation>
                                Whether to show modified values (or only names of changed attributes). Default: true. (NOT IMPLEMENTED YET. THE NAME MIGHT CHANGE.)
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="showTechnicalInformation" type="xsd:boolean">
                        <xsd:annotation>
                            <xsd:documentation>
                                Whether to show technical information (e.g. model context or account operation details).
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="transport" type="xsd:string"/>
                    <!-- TODO Later, implementation support wasn't finished in 4.5
                    <xsd:element name="transportConfig" type="tns:NotifierTransportConfigType" minOccurs="0" maxOccurs="unbounded">
                        <xsd:annotation>
                            <xsd:documentation>
                                More expressive version of `transport` element that allows also customizing
                                template per transport.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:since>TODO</a:since>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                    -->
                    <xsd:element default="separateNotificationToEachRecipient" minOccurs="0" name="notificationSendingStrategy" type="c:NotificationSendingStrategyType">
                        <xsd:annotation>
                            <xsd:documentation>
                                How to send notification to individual recipients, e.g. one message to all recipients,
                                or separate message to each one?
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:since>4.9</a:since>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="RecipientExpressionResultType">
        <xsd:annotation>
            <xsd:documentation>
                Type for recipient expression, which can be either a focus or a string.
                Focus can be returned as FocusObject directly or wrapped in PrismObject.
                This is an internal structure to support multiple return types for recipient.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element minOccurs="0" name="address" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Final recipient address as a string - there will not be any other processing on this.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="recipientRef" type="c:ObjectReferenceType">
                <xsd:annotation>
                    <xsd:documentation>
                        Reference object to the focus object of the recipient.
                        The reference will actually contain the focus object after the result of the expression
                        is processed internally.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:objectReferenceTargetType>tns:FocusType</a:objectReferenceTargetType>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="NotifierTransportConfigType">
        <xsd:annotation>
            <xsd:documentation>
                Type for more descriptive message transport declaration inside notifiers.
                Enables the transport for the notifier, the `transport` element with the same name is not necessary.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="name" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        References unique name of the configured message transport.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>NotifierTransportConfigType.name</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="messageTemplateRef" type="c:ObjectReferenceType">
                <xsd:annotation>
                    <xsd:documentation>
                        Reference to the message template that produces the content of the message for this transport.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:objectReferenceTargetType>tns:MessageTemplateType</a:objectReferenceTargetType>
                        <a:displayName>NotifierTransportConfigType.template</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <!--
            TODO: Do we want to override other content and/or addressing related attributes here?
            TODO: What is the relation of the template ref here and more specific content expressions in the notifier?
            -->
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="CustomNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                Custom notifier which uses expression to produce the message object.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:BaseEventHandlerType">
                <xsd:sequence>
                    <xsd:element minOccurs="0" name="expression" type="c:ExpressionType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Generates resulting NotificationMessageType object. Expects an "event" variable.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="transport" type="xsd:string"/>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="transportConfig" type="tns:NotifierTransportConfigType">
                        <xsd:annotation>
                            <xsd:documentation>
                                More expressive version of `transport` element that allows also customizing
                                template per transport.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:since>4.5</a:since>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimpleResourceObjectNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
                <xsd:sequence>
                    <xsd:element minOccurs="0" name="watchSynchronizationAttributes" type="xsd:boolean">
                        <xsd:annotation>
                            <xsd:documentation>
                                Whether to send a notification when only auxiliary attributes related to synchronization situation
                                (synchronizationSituationDescription, synchronizationSituation) are modified.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimpleUserNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:SimpleFocalObjectNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="TimeValidityNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:SimplePolicyRuleNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimpleFocalObjectNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimpleWorkflowNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimpleCaseManagementNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="UserPasswordNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>


    <xsd:complexType name="ConfirmationNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
                <xsd:sequence>
                    <xsd:element minOccurs="0" name="confirmationMethod" type="tns:RegistrationConfirmationMethodType">
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="RegistrationConfirmationNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:ConfirmationNotifierType">

            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="PasswordResetNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:ConfirmationNotifierType">

            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="AccountActivationNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:ConfirmationNotifierType">

            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="AccountPasswordNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimpleCampaignNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimpleCampaignStageNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimpleReviewerNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimpleTaskNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimpleReportNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimpleActivityPolicyRuleNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                Simple notifier for activity policy rules.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.10</a:since>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SimplePolicyRuleNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>3.6</a:since>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="DummyNotifierType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralNotifierType">
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:simpleType name="RegistrationConfirmationMethodType">
        <xsd:annotation>
            <xsd:documentation>
                How to ensure transport-level security when sending the message.
                SSL/STARTTLS settings are currently EXPERIMENTAL (e.g. there is no support
                for setting certificate validation-related properties; default behavior
                of javax.mail implementation is used).
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="none">
                <xsd:annotation>
                    <xsd:documentation>
                        No validation method
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="NONE"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="link">
                <xsd:annotation>
                    <xsd:documentation>
                        Append LINK to the confirmation message which will be used to validate users
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="LINK"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="pin">
                <xsd:annotation>
                    <xsd:documentation>
                        Append PIN to the confirmation message which will be used to validate users
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="PIN"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- endregion -->

    <!-- TODO remove after complete migration to persistent MessageType OR just rename it to (Transport)MessageType? -->
    <xsd:complexType name="NotificationMessageType">
        <xsd:annotation>
            <xsd:documentation>
                XML version of Message (in notifications module).
                Introduced in order to provide custom notifiers.
                EXPERIMENTAL
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>3.6</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element minOccurs="0" name="from" type="xsd:string"/>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="to" type="xsd:string"/>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="cc" type="xsd:string"/>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="bcc" type="xsd:string"/>
            <xsd:element minOccurs="0" name="subject" type="xsd:string"/>
            <xsd:element minOccurs="0" name="body" type="xsd:string"/>
            <xsd:element minOccurs="0" name="contentType" type="xsd:string"/>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="attachment" type="tns:NotificationMessageAttachmentType"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="NotificationMessageAttachmentType">
        <xsd:annotation>
            <xsd:documentation>
                Message attachment for notifications. The content might be provided either directly (as arbitrary object)
                or by referencing a file.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.0</a:since>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="contentType" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Content type for the attachment, e.g. image/png or text/html.
                        It is required.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:choice>
                <xsd:element name="content" type="xsd:anyType">
                    <xsd:annotation>
                        <xsd:documentation>
                            Content of the attachment.
                        </xsd:documentation>
                        <xsd:appinfo>
                            <a:rawType/>
                        </xsd:appinfo>
                    </xsd:annotation>
                </xsd:element>
                <xsd:element name="contentFromFile" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation>
                            Name of the file that provides the content for this attachment.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:element>
                <!-- TODO some other option like referencing a library of objects? -->
            </xsd:choice>
            <xsd:element minOccurs="0" name="fileName" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        File name for the attachment. E.g. in the case of the mail transport it should be put into Content-Disposition header field.
                        If omitted and if contentFromFile is used, it should be derived from the name of that file.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="contentId" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Value of the Content-ID header of MIME body part for this attachment.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.1</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="NotificationTransportConfigType">
        <xsd:annotation>
            <xsd:documentation>
                Type for notification specific transport configuration.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
                <a:displayName>NotificationTransportConfigType.details</a:displayName>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="name" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        References unique name of the configured message transport.
                        If the transport does not exist, warning is logged and this config block is ignored.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>NotificationTransportConfigType.name</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="redirectToFile" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        All the notification messages are redirected into a specified file. Useful for debugging.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>NotificationTransportConfigType.redirectToFile</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="logToFile" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        In addition to sending notification messages, they are also written to a file. Useful for debugging.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>NotificationTransportConfigType.logToFile</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <!--
            TODO: Add override for recipientAddressExpression? First it must work in main transport config anyway.
            TODO: What else, disable/enable? Blacklisting/filtering here as well? That's probably too much.
            TODO: Adding cc/bcc for all messages generated by notifications for this transport?
            -->
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="NotificationSendingStrategyType">
        <xsd:annotation>
            <xsd:documentation>
                Defines how the notification should be generated and sent.
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
                <a:since>4.9</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="sameNotificationToAllRecipients">
                <xsd:annotation>
                    <xsd:documentation>
                        A notification message is generated once, and sent to all the recipients in the same form.
                        This strategy doesn't allow customizing the message (e.g., taking locale settings into account)
                        for individual recipients.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="SAME_NOTIFICATION_TO_ALL_RECIPIENTS"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="separateNotificationToEachRecipient">
                <xsd:annotation>
                    <xsd:documentation>
                        A notification message is generated and sent to every recipient separately, taking individual
                        recipient settings (e.g., locale) into account.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="SEPARATE_NOTIFICATION_TO_EACH_RECIPIENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <!-- region Newer 4.5 message transport schema -->
    <!-- TODO add translation for added displayName-s -->
    <xsd:complexType name="MessageTransportConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                A configuration for message transports.
                It defines various transports through which the midPoint can send messages, e.g. reports, notifications, etc.

                NOTE: This replaces the configuration previously placed inside NotificationConfigurationType.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
                <a:displayName>MessageTransportConfigurationType.details</a:displayName>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="mail" type="tns:MailTransportConfigurationType">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:displayName>MessageTransportConfigurationType.mail</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="sms" type="tns:SmsTransportConfigurationType"/>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="file" type="tns:FileTransportConfigurationType"/>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="customTransport" type="tns:CustomTransportConfigurationType"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="messageTransportConfiguration" type="tns:MessageTransportConfigurationType"/>

    <xsd:complexType name="GeneralTransportConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                Configuration that is common to all transport configurations.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="name" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Mandatory name of the transport - MUST be unique for each configured message transport.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>GeneralTransportConfigurationType.name</a:displayName>
                        <a:displayOrder>1</a:displayOrder>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <!--
            TODO add recipientAddressExpression (FocusType -> string).
             This will allow the processing of the event with notifiers only returning recipient user
             with common logic how to obtain the address for them left to the transport configuration.
             Notifier (or other mechanism using the transport) still may return the recipient address
             (as a string), in which case it is used directly.
            -->
            <xsd:element minOccurs="0" name="redirectToFile" type="xsd:string">
                <xsd:annotation>
                    <!-- TODO: check implementation and reconsider the original comment, redirectToFile should not depend on black/whiteLists -->
                    <xsd:documentation>
                        All the messages are redirected into a specified file - useful for debugging.
                        Messages that are blacklisted are indicated so, but are still written to the file as well.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>GeneralTransportConfigurationType.redirectToFile</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="logToFile" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        In addition to sending message via this transport, writes it to a file. Useful for debugging.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>GeneralTransportConfigurationType.logToFile</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="blackList" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Addresses that are on a "black list". If a message contains one or more addresses that are blacklisted,
                        it is stored into file specified in "redirectToFile" and either not sent at all (if no other addresses
                        remain) or sent without blacklisted addresses.

                        An address can contain "*" character, that matches any substring, e.g. "*@acme.org".

                        At most one of "blackList", "whiteList" and "recipientFilterExpression" can be used.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>GeneralTransportConfigurationType.blackList</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="whiteList" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Addresses that are on a "white list". If specified, then all addresses are blacklisted, except for
                        those that match a white list entry.

                        An address can contain "*" character, that matches any substring, e.g. "*@acme.org".

                        At most one of "blackList", "whiteList" and "recipientFilterExpression" can be used.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>GeneralTransportConfigurationType.whiteList</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="recipientFilterExpression" type="tns:ExpressionType">
                <xsd:annotation>
                    <xsd:documentation>
                        An expression that decides whether the recipient address is allowed to pass through or it should
                        be blacklisted. The expression expects input value in "recipientAddress" variable (usually a String),
                        and should provide a boolean value: "true" means "pass through", "false" means "block".

                        At most one of "blackList", "whiteList" and "recipientFilterExpression" can be used.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>GeneralTransportConfigurationType.recipientFilterExpression</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="recipientAddressExpression" type="tns:ExpressionType">
                <xsd:annotation>
                    <xsd:documentation>
                        Optional expression for recipient address returned as a String.
                        This is useful when the recipient is provided as a Focus object (e.g. from the notifier),
                        this object is available as `recipient` input variable into the expression.
                        This is not used if the recipient address was already resolved and is available
                        only as a String instead of a Focus.
                        If this expression is not specified, the default conversion provided by the method
                        `getDefaultRecipientAddress(Focus)` in the `Transport` implementation will be used.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>GeneralTransportConfigurationType.recipientAddressExpression</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="debug" type="xsd:boolean">
                <xsd:annotation>
                    <xsd:documentation>
                        Enables debugging specific for a given transport (if supported by it).
                        For example, when used for mail transport it enables debugging of javamail - sending
                        diagnostics to standard output (console).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>GeneralTransportConfigurationType.debug</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="MailTransportConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                Where and how to send mail messages (or any other mail messages).
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
                <a:displayName>MailTransportConfigurationType.details</a:displayName>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralTransportConfigurationType">
                <xsd:sequence>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="server" type="tns:MailServerConfigurationType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Configuration of a particular smtp server host. If there are more of them, they are tried
                                one after another. If there is none, mail messages are not sent.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:displayOrder>100</a:displayOrder>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="defaultFrom" type="xsd:string">
                        <xsd:annotation>
                            <xsd:documentation>
                                What to put into "From" field of mail messages (unless overridden by specific situation).
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:displayName>MailTransportConfigurationType.defaultFrom</a:displayName>
                            </xsd:appinfo>
                            <xsd:appinfo>
                                <a:displayOrder>101</a:displayOrder>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="SmsTransportConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                Where and how to send SMS messages (or any other SMS).
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralTransportConfigurationType">
                <xsd:sequence>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="gateway" type="tns:SmsGatewayConfigurationType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Configuration of a particular mail server host. If there are more of them, they are tried
                                one after another. If there is none, mail messages are not sent.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:displayOrder>100</a:displayOrder>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="defaultFrom" type="xsd:string">
                        <xsd:annotation>
                            <xsd:documentation>
                                What to put into "From" field of SMS, if supported by the gateway.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:displayOrder>101</a:displayOrder>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="FileTransportConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                Where and how to store "file" messages.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
                <a:displayName>FileTransportConfigurationType.details</a:displayName>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralTransportConfigurationType">
                <xsd:sequence>
                    <xsd:element minOccurs="0" name="file" type="xsd:string">
                        <xsd:annotation>
                            <xsd:documentation>
                                File that stores all the "sent" messages.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:displayName>FileTransportConfigurationType.file</a:displayName>
                                <a:displayOrder>100</a:displayOrder>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <!-- TODO: first rename the original to Legacy, this is a good name and we want to use it -->
    <xsd:complexType name="CustomTransportConfigurationType">
        <xsd:annotation>
            <xsd:documentation>
                Custom type transport that can be realized either as a Java class (e.g. using overlay
                mechanism) specified in `type` element or via `expression`.
                If both are used, the `type` element takes preference.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
                <a:since>4.5</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:GeneralTransportConfigurationType">
                <xsd:sequence>
                    <xsd:element minOccurs="0" name="type" type="xsd:string">
                        <xsd:annotation>
                            <xsd:documentation>
                                Fully qualified class name of the transport implementation.
                                <!-- TODO: extending from what, etc... -->
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:displayName>CustomTransportConfigurationType.type</a:displayName>
                                <a:displayOrder>100</a:displayOrder>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element minOccurs="0" name="expression" type="tns:ExpressionType">
                        <xsd:annotation>
                            <xsd:documentation>
                                Expression that processes incoming message, typically a script that sends the message.
                                Inside the expression a single-valued `message` variable is available.
                                For maximum flexibility, `event` (in case of notifications) or other contextual variable
                                may be available too, but it is preferred to work only with the provided `message`.
                                Should not return anything.
                            </xsd:documentation>
                            <xsd:appinfo>
                                <a:displayName>CustomTransportConfigurationType.expression</a:displayName>
                                <a:displayOrder>101</a:displayOrder>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <!-- endregion -->
</xsd:schema>