<xsd:schema targetNamespace="http://www.ivoa.net/xml/VOSIAvailability/v1.0"
            xmlns:tns="http://www.ivoa.net/xml/VOSIAvailability/v1.0"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            version="1.0">

  <xsd:annotation>
     <xsd:documentation>
       A schema for formatting availability metadata as returned by an
       availability resource defined in the IVOA Support Interfaces 
       specification (VOSI). 
       See http://www.ivoa.net/Documents/latest/VOSI.html.  
     </xsd:documentation>
  </xsd:annotation>

  <!--
    -  the root element for a VOSI availability (section 2.3)
    -->
  <xsd:element name="availability" type="tns:Availability"/>

  <xsd:complexType name="Availability">
    <xsd:sequence>
      
      <xsd:element name="available" type="xsd:boolean">
        <xsd:annotation>
          <xsd:documentation>
             Indicates whether the service is currently available.
           </xsd:documentation>
        </xsd:annotation>
      </xsd:element>

      <xsd:element name="upSince" type="xsd:dateTime" minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>
            The instant at which the service last became available.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>

      <xsd:element name="downAt" type="xsd:dateTime" minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>
            The instant at which the service is next scheduled to become
            unavailable.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>

      <xsd:element name="backAt" type="xsd:dateTime" minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>
            The instant at which the service is scheduled to become available 
            again after a period of unavailability.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>

      <xsd:element name="note" type="xsd:string" 
                   minOccurs="0" maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>
            A textual note concerning availability.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>

    </xsd:sequence>
  </xsd:complexType>

</xsd:schema>
