<!--
		SIF Implementation Specification (Australia) 3.4.3


		(April 5, 2018)
		
		Infrastructure Version: v3
	-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sifassociation.org/datamodel/au/3.4" targetNamespace="http://www.sifassociation.org/datamodel/au/3.4" elementFormDefault="qualified" version="3.4.3">
  <xs:complexType name="ResourceBookingType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>Low</privacyRating>
      </xs:appinfo>
      <xs:documentation>
          This object represents a booking for any resource for a single contiguous time period. This could be either a room or another resource, such as equipment.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="ResourceRefId" minOccurs="0" nillable="true">
        <xs:complexType>
          <xs:annotation>
            <xs:appinfo>
              <sifChar>O</sifChar>
              <privacyRating>Low</privacyRating>
            </xs:appinfo>
            <xs:documentation>The ID (GUID) of the resource being booked. Provided only if the resource being booked is a SIF object with a GUID.</xs:documentation>
          </xs:annotation>
          <xs:simpleContent>
            <xs:extension base="IdRefTypeOrEmpty">
              <xs:attribute name="SIF_RefObject" use="required">
                <xs:annotation>
                  <xs:appinfo>
                    <sifChar>M</sifChar>
                    <privacyRating>Low</privacyRating>
                  </xs:appinfo>
                  <xs:documentation>The type of SIF object that the ResourceRefId element identifies.</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:token">
                    <xs:enumeration value="RoomInfo" />
                    <xs:enumeration value="EquipmentInfo" />
                    <xs:enumeration value="LearningResource" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:attribute>
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
      <xs:element name="ResourceLocalId" minOccurs="0" type="LocalIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The Local Id of the resource being booked. Provided whether the resource is a SIF object or not.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StartDateTime" minOccurs="0" type="xs:dateTime">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Starting date and time for booking.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="FinishDateTime" minOccurs="0" type="xs:dateTime">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Finish date and time for booking.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="FromPeriod" minOccurs="0" nillable="true" type="LocalIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Starting period for booking. If specified, the booking is intended to align with bell times.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ToPeriod" minOccurs="0" nillable="true" type="LocalIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Finish period for booking. If specified, the booking is intended to align with bell times.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Booker" minOccurs="0" type="IdRefType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Indicates who booked the room. Points to a StaffPersonal record. This will normally (but not necessarily) be the teacher who will be occupying the room.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Reason" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A free-text explanation of the reason for the room booking.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ScheduledActivityRefId" minOccurs="0" nillable="true" type="IdRefType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Links the room-booking to a ScheduledActivity.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="KeepOld" minOccurs="0" nillable="true" type="xs:boolean">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>If ScheduledActivity is provided, 'true' means the booker wishes to retain all rooms already specified for the ScheduledActivity. 'false' means that room(s)/resources are now available for other uses.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SIF_Metadata" minOccurs="0" nillable="true" type="SIF_MetadataType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
      <xs:element name="SIF_ExtendedElements" minOccurs="0" nillable="true" type="SIF_ExtendedElementsType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="RefId" use="required" type="RefIdType">
      <xs:annotation>
        <xs:appinfo>
          <sifChar>M</sifChar>
          <privacyRating>Low</privacyRating>
        </xs:appinfo>
        <xs:documentation>The GUID of the Object</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="ResourceBooking" type="ResourceBookingType">
    <xs:unique name="ResourceBookingKey1">
      <xs:selector xpath="./ResourceBooking" />
      <xs:field xpath="@RefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="ResourceBookingCollectionType">
    <xs:sequence>
      <xs:element name="ResourceBooking" type="ResourceBookingType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ResourceBookings" type="ResourceBookingCollectionType" />

</xs:schema>