<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="aarExceptionUpdates">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="aarExceptionUpdate" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="aarExceptionUpdate">
    <xs:complexType>
      <xs:all>
        <xs:element name="equipmentId" type="xs:long"/>
        <xs:element ref="comments">
          <xs:annotation>
            <xs:documentation>Use the element newComments or oldComments instead of comments. Can't use newComments and oldComments in the same payload.</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:all>
    </xs:complexType>
  </xs:element>
  <xs:element name="comments" abstract="true"/>
  <xs:element name="newComments" substitutionGroup="comments">
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:maxLength value="500"/>
        <xs:whiteSpace value="preserve"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
  <xs:element name="oldComments" substitutionGroup="comments" type="xs:boolean">
    <xs:annotation>
      <xs:documentation>Whether old comments are still valid</xs:documentation>
    </xs:annotation>
  </xs:element>
</xs:schema>
