﻿<?xml version="1.0" encoding="utf-8" ?>
<schema xmlns:tns="https://webservices.sanctieplatform.nl/document/" elementFormDefault="qualified" targetNamespace="https://webservices.sanctieplatform.nl/document/" xmlns="http://www.w3.org/2001/XMLSchema">
    <group name="OnBehalfUserGroup">
        <annotation>
            <documentation>
                The employee the operation acts for. Specify either OnBehalfUserId or
                OnBehalfUserEmail, not both. One of the two is mandatory; because a schema cannot
                express that, the service enforces it and rejects a request that gives both or
                neither with INVALID_REQUEST.
            </documentation>
        </annotation>
        <sequence>
            <element name="OnBehalfUserId" minOccurs="0" maxOccurs="1" nillable="false">
                <annotation>
                    <documentation>
                        Specify either OnBehalfUserId or OnBehalfUserEmail, not both. One of the two is mandatory.
                        See Reference.GetAllUsersInOwnOrganisation and use users with IsActive = TRUE.
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="OnBehalfUserEmail" minOccurs="0" maxOccurs="1" nillable="false">
                <annotation>
                    <documentation>
                        Specify either OnBehalfUserId or OnBehalfUserEmail, not both. One of the two is mandatory.
                        E-mail address of the user, e.g. name@provider.nl. Unique in the system.
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <whiteSpace value="collapse" />
                        <maxLength value="250" />
                        <minLength value="5" />
                        <pattern value="[_\-a-zA-Z0-9\.\+]+@[a-zA-Z0-9](\.?[\-a-zA-Z0-9]*[a-zA-Z0-9])*" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </group>

    <element name="DownloadDocumentByIdRequest">
        <annotation>
            <documentation>
                This operation can be used to download documents.
                The IsAttached can be used to check if the document has been used (attached) in the system.
            </documentation>
        </annotation>
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <group ref="tns:OnBehalfUserGroup" />
                <element name="DocumentId" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>The technical id of the document to download.</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="int">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
            </sequence>
        </complexType>
    </element>
    <element name="DownloadDocumentByIdResponse">
        <simpleType>
            <restriction base="base64Binary" />
        </simpleType>
    </element>
    <element name="GetDocumentInformationByDocumentIdRequest">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <group ref="tns:OnBehalfUserGroup" />
                <element name="DocumentId" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>The technical id of the document to get information from.</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="int">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
            </sequence>
        </complexType>
    </element>
    <element name="GetDocumentInformationByDocumentIdResponse">
        <annotation>
            <documentation>
                This operation can be used to download documents.
                The IsAttached can be used to check if the document has been used (attached) in the system.
            </documentation>
        </annotation>
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <element name="FileName" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>The complete file name (as shown in link GUI).</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <minLength value="1" />
                            <maxLength value="255" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="DocumentType" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>see Reference.GetAllDocumentTypes</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="int">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="UserId" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>The id of the user who uploaded the document</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="int">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="UploadedOnAt" type="dateTime" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>
                            The date and time when this document was uploaded.
                        </documentation>
                    </annotation>
                </element>
                <element name="IsAttached" type="boolean" minOccurs="1" maxOccurs="1" default="false">
                    <annotation>
                        <documentation>
                            If the document is used (the document has a relation to another entity id and type) the value is true.
                            When uploaded this value is false (=DEFAULT).
                        </documentation>
                    </annotation>
                </element>
            </sequence>
        </complexType>
    </element>
    <element name="UploadDocumentRequest">
        <annotation>
            <documentation>
                Please don't upload identification documents such as passport or ID.
            </documentation>
        </annotation>
        <simpleType>
            <restriction base="base64Binary" />
        </simpleType>
    </element>
    <element name="OnBehalfUserId" type="int">
        <annotation>
            <documentation>
                SOAP header of UploadDocument. Specify either OnBehalfUserId or OnBehalfUserEmail,
                not both. One of the two is mandatory. SOAP headers are not covered by the schema
                validation of this service, so this rule is enforced by the service itself.
                See Reference.GetAllUsersInOwnOrganisation and use users with IsActive = TRUE.
            </documentation>
        </annotation>
    </element>
    <element name="OnBehalfUserEmail" type="string">
        <annotation>
            <documentation>
                SOAP header of UploadDocument. Specify either OnBehalfUserId or OnBehalfUserEmail,
                not both. One of the two is mandatory. SOAP headers are not covered by the schema
                validation of this service, so this rule is enforced by the service itself.
                E-mail address of the user, e.g. name@provider.nl. Unique in the system.
            </documentation>
        </annotation>
    </element>
    <element name="UploadDocumentFileName" nillable="false">
        <simpleType>
            <restriction base="string">
                <minLength value="1" />
                <maxLength value="255" />
            </restriction>
        </simpleType>
    </element>
    <element name="UploadDocumentResponse">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <element name="DocumentId" minOccurs="1" maxOccurs="1">
                    <simpleType>
                        <restriction base="int">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
            </sequence>
        </complexType>
    </element>
    <element name="DownloadZipByInvestigationIdResponse">
        <simpleType>
            <restriction base="base64Binary" />
        </simpleType>
    </element>
    <element name="DownloadZipByInvestigationIdRequest">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <group ref="tns:OnBehalfUserGroup" />
                <element name="InvestigationId" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>The technical id of the investigation to download the zip for.</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="int">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
            </sequence>
        </complexType>
    </element>
</schema>
