<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="https://schemas.rutdev.se/xsd/exchange/tenant-snapshot/tenant-snapshot-transfer-1.0.xsd"
    xmlns:category="https://schemas.rutdev.se/xsd/entities/level2/category-1.0.xsd"
    xmlns:codelist="https://schemas.rutdev.se/xsd/entities/level2/code-list-1.0.xsd"
    xmlns:conceptualvariable="https://schemas.rutdev.se/xsd/entities/level2/conceptual-variable-1.0.xsd"
    xmlns:dataset="https://schemas.rutdev.se/xsd/entities/level2/dataset-1.0.xsd"
    xmlns:datasetcollection="https://schemas.rutdev.se/xsd/entities/level2/dataset-collection-1.0.xsd"
    xmlns:exchange="https://schemas.rutdev.se/xsd/exchange/tenant-snapshot/types/exchange-types-1.0.xsd"
    xmlns:instancevariable="https://schemas.rutdev.se/xsd/entities/level2/instance-variable-1.0.xsd"
    xmlns:organization="https://schemas.rutdev.se/xsd/entities/level2/organization-1.0.xsd"
    xmlns:population="https://schemas.rutdev.se/xsd/entities/level2/population-1.0.xsd"
    xmlns:representedvariable="https://schemas.rutdev.se/xsd/entities/level2/represented-variable-1.0.xsd"
    xmlns:statisticalclassification="https://schemas.rutdev.se/xsd/entities/level2/statistical-classification-1.0.xsd"
    xmlns:unittype="https://schemas.rutdev.se/xsd/entities/level2/unit-type-1.0.xsd"
    xmlns:universe="https://schemas.rutdev.se/xsd/entities/level2/universe-1.0.xsd"
    targetNamespace="https://schemas.rutdev.se/xsd/exchange/tenant-snapshot/tenant-snapshot-transfer-1.0.xsd"
    elementFormDefault="qualified"
    version="1.0">

    <!--
      TenantSnapshotTransfer Schema

      Description: TenantSnapshotTransfer is the root element for a complete, non-incremental snapshot of a tenant's full set of DatasetCollections, Datasets, and all their constituent entities. It is a generic format n...
      Version: 1.0
      Generated: 2026-04-22T06:56:45Z
      Source: specs/exchange/tenant-snapshot/tenant-snapshot-transfer-1.0.md
    -->

    <!-- Import entity schemas -->
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/category-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/category-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/code-list-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/code-list-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/conceptual-variable-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/conceptual-variable-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/dataset-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/dataset-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/dataset-collection-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/dataset-collection-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/exchange/tenant-snapshot/types/exchange-types-1.0.xsd"
        schemaLocation="types/exchange-types-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/instance-variable-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/instance-variable-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/organization-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/organization-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/population-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/population-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/represented-variable-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/represented-variable-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/statistical-classification-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/statistical-classification-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/unit-type-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/unit-type-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level2/universe-1.0.xsd"
        schemaLocation="../../entities/level2/1.0/universe-1.0.xsd"
    />

    <!-- Main exchange type -->
    <xsd:complexType name="TenantSnapshotTransferType">
        <xsd:sequence>
            <xsd:element name="Meta" type="exchange:Meta" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Metadata about the snapshot, including when it was extracted, the tenant ID, and the name of the sending system.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="ConceptualVariables" type="conceptualvariable:ConceptualVariableListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Conceptual variables included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="RepresentedVariables" type="representedvariable:RepresentedVariableListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Represented variables included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="InstanceVariables" type="instancevariable:InstanceVariableListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Instance variables included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="Populations" type="population:PopulationListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Populations included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="Universes" type="universe:UniverseListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Universes included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="UnitTypes" type="unittype:UnitTypeListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Unit types included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="Datasets" type="dataset:DatasetListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Datasets included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="DatasetCollections" type="datasetcollection:DatasetCollectionListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Dataset collections included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="Organizations" type="organization:OrganizationListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Organizations included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="StatisticalClassifications" type="statisticalclassification:StatisticalClassificationListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Statistical classifications included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="CodeLists" type="codelist:CodeListListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Code lists included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="Categories" type="category:CategoryListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Categories included in the snapshot.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <!-- Root element -->
    <xsd:element name="TenantSnapshotTransfer" type="tns:TenantSnapshotTransferType"/>

</xsd:schema>