<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ /*
  ~ * Dump/Restore client - Copyright (C) 2013 National Board of e-Health (NSI)
  ~ *
  ~ * All source code and information supplied as part of 'dump-restore-client' is
  ~ * copyright to National Board of e-Health.
  ~ *
  ~ * The source code has been released under a dual license - meaning you can
  ~ * use either licensed version of the library with your code.
  ~ *
  ~ * It is released under the Common Public License 1.0, a copy of which can
  ~ * be found at the link below.
  ~ * http://www.opensource.org/licenses/cpl1.0.php
  ~ *
  ~ * It is released under the LGPL (GNU Lesser General Public License), either
  ~ * version 2.1 of the License, or (at your option) any later version. A copy
  ~ * of which can be found at the link below.
  ~ * http://www.gnu.org/copyleft/lesser.html
  ~ *
  ~ * $HeadURL$
  ~ * $Id$
  ~ */
  -->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="config">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="environments"/>
                <xs:element ref="services" />
                <xs:element name="cpr-whitelist" type="xs:string" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="environments">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="environment" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="environment" type="xs:string"/>
    <xs:element name="services">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="service" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="service">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="endpoint" maxOccurs="unbounded" />
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="endpoint">
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string">
                    <xs:attribute name="environment" type="xs:string" use="required"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>
</xs:schema>
