<?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- ====================================================================== --><!-- complex_pairing / Coarse BK matching --><!-- ====================================================================== --><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" xmlns:tns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" elementFormDefault="qualified" jaxb:version="3.0" targetNamespace="http://midpoint.evolveum.com/xml/ns/public/common/common-3">


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

    <!-- Request: list of pairs -->
    <xsd:complexType name="SiComplexPairingRequestType">
        <xsd:annotation>
            <xsd:documentation>
                Request payload for coarse, benevolent BK matching across N aligned samples (pairs).
                Each 'pair' contains 1..N records on the midPoint side and 1..N records on the application side.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.11</a:since>
                <!-- intentionally not a container -->
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="pair" type="tns:SiComplexPairingPairType"/>
        </xsd:sequence>
    </xsd:complexType>

    <!-- One aligned sample containing both sides (each side can contain 1..N records) -->
    <xsd:complexType name="SiComplexPairingPairType">
        <xsd:annotation>
            <xsd:documentation>
                One aligned sample containing both sides (each side can contain 1..N records).
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.11</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element maxOccurs="unbounded" minOccurs="1" name="midPoint" type="tns:SiComplexPairingRecordType"/>
            <xsd:element maxOccurs="unbounded" minOccurs="1" name="application" type="tns:SiComplexPairingRecordType"/>
        </xsd:sequence>
    </xsd:complexType>

    <!-- One record on a side, identified by a stable identifier -->
    <xsd:complexType name="SiComplexPairingRecordType">
        <xsd:annotation>
            <xsd:documentation>
                One record on a side (midPoint/application), identified by a stable identifier.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.11</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="identifier" type="xsd:string"/>
            <xsd:element maxOccurs="unbounded" minOccurs="1" name="content" type="tns:SiComplexPairingAttributeValueType"/>
        </xsd:sequence>
    </xsd:complexType>

    <!-- Single attribute-value item within one record -->
    <xsd:complexType name="SiComplexPairingAttributeValueType">
        <xsd:annotation>
            <xsd:documentation>
                Single attribute-value item within one record (instance).
                Missing value is represented by either no 'value' elements or an empty list.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.11</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="attribute" type="xsd:string"/>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="value" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>

    <!-- Response: verdict, rationale, and identifier-to-identifier mappings -->
    <xsd:complexType name="SiComplexPairingResponseType">
        <xsd:annotation>
            <xsd:documentation>
                Verdict (similar), rationale, and MidPoint → Application identifier pairs.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.11</a:since>
                <!-- intentionally not a container -->
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="similar" type="xsd:boolean"/>
            <xsd:element name="rationale" type="xsd:string"/>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="mapping" type="tns:SiComplexPairingIdMappingType"/>
        </xsd:sequence>
    </xsd:complexType>

    <!-- Mapping from one MidPoint record ID to one Application record ID -->
    <xsd:complexType name="SiComplexPairingIdMappingType">
        <xsd:annotation>
            <xsd:documentation>
                Mapping from one MidPoint record ID to one Application record ID.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.11</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="midPointIdentifier" type="xsd:string"/>
            <xsd:element name="applicationIdentifier" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>