<?xml version="1.0" encoding="UTF-8"?>
<schema
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:distributor="http://minameddelanden.gov.se/service/Distributor/schema/v4"
    xmlns:common="http://minameddelanden.gov.se/schema/Common/v4"
    xmlns:sig="http://www.w3.org/2000/09/xmldsig#"
    targetNamespace="http://minameddelanden.gov.se/service/Mailbox/schema/v4"
    elementFormDefault="qualified"
    version="4.0">

    <import namespace="http://minameddelanden.gov.se/service/Distributor/schema/v4"
            schemaLocation="Distributor.xsd"/>
    <import namespace="http://minameddelanden.gov.se/schema/Common/v4"
            schemaLocation="Common.xsd"/>
    <import namespace="http://www.w3.org/2000/09/xmldsig#"
            schemaLocation="../xmldsig-core-schema.xsd"/>

    <element name="sealedDelivery">
        <complexType>
            <sequence>
                <element ref="distributor:signedDelivery"/>
                <element ref="sig:Signature"/>
            </sequence>
            <attribute name="Id" type="ID"/>
        </complexType>
    </element>

    <element name="deliveryStatus">
        <complexType>
            <sequence>
                <element ref="common:recipientId">
                    <annotation>
                        <documentation xml:lang="sv">Mottagaridentitet.</documentation>
                    </annotation>
                </element>
                <element name="deliveredFlag" type="boolean">
                    <annotation>
                        <documentation xml:lang="en">The flag represents whether the message
                            was delivered (true) or not (false).
                        </documentation>
                        <documentation xml:lang="sv">Anger ’true’ om försändelsen/läskvittot
                            levererats till mottagarens brevlåda och ’false’ om brevlådan
                            saknas hos denna leverantör eller om mottagaren valt bort
                            elektroniska utskick från avsändaren.
                        </documentation>
                    </annotation>
                </element>
                <element name="notifiedByChannel" minOccurs="0" maxOccurs="2">
                    <annotation>
                        <documentation xml:lang="en">The notification channel is represented by the type (SMS and/or
                            eMail) if present. This can only be set if the message is delivered, i.e. the
                            "DeliveredFlag" = True.
                        </documentation>
                        <documentation xml:lang="sv">Anger ”SMS” om avisering lyckas via SMS.
                            Anger ”Email” om avisering lyckas via email.
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <enumeration value="SMS"/>
                            <enumeration value="EMail"/>
                        </restriction>
                    </simpleType>
                </element>
            </sequence>
        </complexType>
    </element>

</schema>
