<!--
		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="alertType">
    <xs:sequence>
      <xs:element name="reporter" type="xs:token" />
      <xs:element name="cause" minOccurs="0" type="xs:token" />
      <xs:element name="exchange">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="REQUEST" />
            <xs:enumeration value="RESPONSE" />
            <xs:enumeration value="EVENT" />
            <xs:enumeration value="TIMEOUT" />
            <xs:enumeration value="OTHER" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="level">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="INFO" />
            <xs:enumeration value="STATECHANGE" />
            <xs:enumeration value="EVENT" />
            <xs:enumeration value="WARNING" />
            <xs:enumeration value="ERROR" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="description" minOccurs="0" type="xs:normalizedString" />
      <xs:element name="messageID" minOccurs="0" type="xs:token" />
      <xs:element name="body" minOccurs="0" type="xs:string" />
      <xs:element name="error" minOccurs="0" type="xs:string" />
      <xs:element name="xpath" minOccurs="0" type="xs:normalizedString" />
      <xs:element name="category" minOccurs="0" type="xs:unsignedInt" />
      <xs:element name="code" minOccurs="0" type="xs:unsignedInt" />
      <xs:element name="internal" minOccurs="0" type="xs:token" />
    </xs:sequence>
    <xs:attribute name="id" use="optional" type="uuidType" />
  </xs:complexType>

  <xs:element name="alert" type="alertType">
    <xs:key name="alertKey1">
      <xs:selector xpath="." />
      <xs:field xpath="@id" />
    </xs:key>
  </xs:element>

  <xs:complexType name="alertCollectionType">
    <xs:sequence>
      <xs:element name="alert" type="alertType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="alerts" type="alertCollectionType" />

</xs:schema>