<!--
		SIF Infrastructure Specification 3.7

		(January 21, 2025)
		
		Infrastructure Version: 3.7
		
		license: 
		    name: Apache  2.0
        identifier: Apache-2.0
        url: 'https://home.a4l.org/legal/'
	-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sifassociation.org/infrastructure/3.7" targetNamespace="http://www.sifassociation.org/infrastructure/3.7" elementFormDefault="qualified" version="3.7">
  <xs:complexType name="environmentType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating />
      </xs:appinfo>
      <xs:documentation>The Consumer Environment Service is the gateway to all other services. It scopes the Consumer's possible interactions with the infrastructure and any Provider Services accessible from it. The Environment Service provides the set of (possibly customized) information the Application needs to interoperate successfully.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="fingerprint" minOccurs="0" type="xs:token">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>Unique environment identifier that can be safely shared with others. In order to not compromise security it MUST NOT match the environment's refId, sessionToken, userToken, or applicationKey.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="sessionToken" minOccurs="0" type="xs:token">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
      <xs:element name="solutionId" minOccurs="0" type="xs:token">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>The solution the Application would like to participate in. This is optional only, is advisory, and may be ignored by the Administrator. If processed it may be reflected in the URLs of the infrastructure services which are provided in the consumerEnvironment.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="defaultZone" minOccurs="0" type="defaultZoneType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
      <xs:element name="authenticationMethod" minOccurs="0" type="xs:token">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>Defines the way in which the applicationKey can be used to enforce security.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="instanceId" minOccurs="0" type="xs:token">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
      <xs:element name="userToken" minOccurs="0" type="xs:string">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
      <xs:element name="consumerName" minOccurs="0" type="xs:string">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation>A descriptive name for the application that will be readily identifiable to Zone Administrators if it becomes a Registered Consumer</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="applicationInfo" minOccurs="0" type="applicationInfoType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
      <xs:element name="infrastructureServices" minOccurs="0" type="infrastructureServicesType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
      <xs:element name="provisionedZones" minOccurs="0" type="provisionedZonesType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating />
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="type" use="optional" type="environmentTypeType">
      <xs:annotation>
        <xs:appinfo>
          <sifChar>O</sifChar>
          <privacyRating />
        </xs:appinfo>
        <xs:documentation />
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="id" use="optional" type="uuidType">
      <xs:annotation>
        <xs:appinfo>
          <sifChar>O</sifChar>
          <privacyRating />
        </xs:appinfo>
        <xs:documentation />
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="environment" type="environmentType">
    <xs:key name="environmentKey1">
      <xs:selector xpath="." />
      <xs:field xpath="@id" />
    </xs:key>
  </xs:element>

  <xs:complexType name="environmentCollectionType">
    <xs:sequence>
      <xs:element name="environment" type="environmentType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="environments" type="environmentCollectionType" />

</xs:schema>