<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2020 Evolveum
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<xsd:schema targetNamespace="http://midpoint.evolveum.com/xml/ns/samples/metadata"
            xmlns:tns="http://midpoint.evolveum.com/xml/ns/samples/metadata"
            xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3"
            xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
            xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
            xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:s="http://midpoint.evolveum.com/xml/ns/public/model/scripting/extension-3"
            elementFormDefault="qualified"
            xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
            xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
            jaxb:extensionBindingPrefixes="xjc"
            jaxb:version="2.0">

    <xsd:import namespace="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
                schemaLocation="http://midpoint.evolveum.com/xml/ns/public/common/common-3"/>

    <xsd:import namespace="http://midpoint.evolveum.com/xml/ns/public/model/scripting/extension-3"
                schemaLocation="http://midpoint.evolveum.com/xml/ns/public/model/scripting/extension-3"/>

    <xsd:import namespace="http://prism.evolveum.com/xml/ns/public/query-3"
                schemaLocation="http://prism.evolveum.com/xml/ns/public/query-3"/>

    <xsd:import namespace="http://prism.evolveum.com/xml/ns/public/types-3"
                schemaLocation="http://prism.evolveum.com/xml/ns/public/types-3"/>

    <xsd:complexType name="ValueMetadataExtensionType">
        <xsd:annotation>
            <xsd:appinfo>
                <a:extension ref="c:ValueMetadataType"/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="assurance" type="tns:AssuranceMetadataType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Assurance metadata: an example of deployment-specific metadata.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="AssuranceMetadataType">
        <xsd:annotation>
            <xsd:documentation>
            </xsd:documentation>
            <xsd:appinfo>
                <a:operational>true</a:operational>
                <a:container/>
                <a:displayName>Assurance metadata</a:displayName>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="loa" type="xsd:int">
                <xsd:annotation>
                    <xsd:documentation>
                        Level of assurance
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>LoA</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="assurance" type="tns:AssuranceMetadataType" />


    <xsd:complexType name="UserTypeExtensionType">
        <xsd:annotation>
            <xsd:appinfo>
                <a:extension ref="c:UserType"/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="assuredOrganization" type="t:PolyStringType" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

</xsd:schema>