<?xml version="1.0" encoding="UTF-8"?>
  <!--
    FILE INFORMATION 
    Description 
    This schema describes RESTful bindings for Parlay X Web Services, Terminal Location 
    
    Version: 1.0 (1.0)
    Date: 23 November 2010 
    
    OMA Permanent Document 
      File: OMA-SUP-XSD_rest_terminallocation-V1_0-20101123-C 
      Type: Text 
      
    Public Reachable Information 
      Path: http://www.openmobilealliance.org/tech/profiles 
      Name: rest_terminallocation-v1_0.xsd 
      
    NORMATIVE INFORMATION

      Information about this file can be found in the latest revision of the specification
    
        OMA-TS-ParlayREST_TerminalLocation-V1_0 
      
      available at http://www.openmobilealliance.org/
  
      Send comments to technical-comments@mail.openmobilealliance.org
  
    LEGAL DISCLAIMER

      Use of this document is subject to all of the terms and conditions
      of the Use Agreement located at
      http://www.openmobilealliance.org/UseAgreement.html,
      provided, however, that section (d) under "Documents - Terms 
      of Use" which states, "no modifications are made to such 
      Documents" does not apply to your use.
    
      The Open Mobile Alliance authorizes you to copy this document, 
      provided that you retain all copyright and other proprietary  
      notices contained in the original materials on any copies of the 
      materials and  that you comply strictly with these terms. This 
      copyright permission does not constitute an endorsement of the 
      products or services. The Open Mobile Alliance assumes no 
      responsibility for errors or omissions in this document.
    
    
      Each Open Mobile Alliance member has agreed to use reasonable
      endeavors to inform the Open Mobile Alliance in a timely manner of
      Essential IPR as it becomes aware that the Essential IPR is related
      to the prepared or published specification.  However, the members
      do not have an obligation to conduct IPR searches.  The declared
      Essential IPR is publicly available to members and non-members of
      the Open Mobile Alliance and may be found on the "OMA IPR
      Declarations" list at http://www.openmobilealliance.org/ipr.html.
      The Open Mobile Alliance has not conducted an independent IPR review
      of this document and the information contained herein, and makes no
      representations or warranties regarding third party IPR, including
      without limitation patents, copyrights or trade secret rights.  This
      document may contain inventions for which you must obtain licenses
      from third parties before making, using or selling the inventions.
      Defined terms above are set forth in the schedule to the Open Mobile
      Alliance Application Form.
    
      NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE
      MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER
      OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE "OMA
      IPR DECLARATIONS" LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY,
      COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR
      NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL.
    
      THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY
      DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR
      EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF
      DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS.
    
      Copyright 2010 Open Mobile Alliance Ltd.  All Rights Reserved.
      Used with the permission of the Open Mobile Alliance Ltd. under the
      terms set forth above.

  -->

  <!--
    CHANGE HISTORY 
    20091116 File created by Sune Jakobsson, Telenor ASA
    20091201 Replaced the disclaimer, and added a description
    20091203 Corrected a few typos
    20091204 Released version after Vienna meeting
    20091211 Final alignment with all TS's
    20100104 Fixed errors to align with OMA-TS-ParlayREST_TerminalLocation-V1_0-20091216-D 
        during CONR (see CR OMA-ARC-REST-2009-0179R01)
    20100203 Changed name space and fixed element naming 
    20100210 Cleanup
    20100211 Added missing TerminalLocationList, corrected TerminalLocation
    20100228 Corrected TerminalDistance
    20100309 TerminalDistance OMA-ARC-REST-2010-0098-CR_Rename_terminal_distance changed back distance to terminalDistance (R&A till March 10.)
    20100311 TerminalDistance OMA-ARC-REST-2010-0098-CR_Rename_terminal_distance changed  terminalDistance to distance
    20100329 OMA-ARC-REST-2010-0162R01-CR_Type_of_Representation_returned_in_GetLocation_Query and OMA-ARC-REST-2010-0163R01-CR_Terminal_Location_Notifications_alignment
    20100630 OMA-ARC-REST-2010-0308-CR_TerminalLocation_requester_fix_xsd applied; import declaration fixed. 
    20100701 OMA-ARC-REST-2010-0336-CR_Update_TeminalLocation_XSD_with_ServiceError; use ServiceError as stated in TS
    20100831 Update of LEGAL DISCLAIMER
    20100923 OMA-ARC-REST-2010-0546-CR_TerminalLocation_AI_from_CR_464.doc, REST-2010-A094, removed TimeMetric
    20100930 OMA-ARC-REST-2010-0433-CR_terminalLocation_fix_xsd
    20101123 Candidate	
  -->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:common="urn:oma:xml:rest:common:1"
  xmlns="urn:oma:xml:rest:terminallocation:1"
  targetNamespace="urn:oma:xml:rest:terminallocation:1" version="1.0">

  <xsd:annotation>
    <xsd:documentation>This schema defines the XML for validating data used in the terminal location enabler.</xsd:documentation>
  </xsd:annotation>

  <xsd:import namespace="urn:oma:xml:rest:common:1"
    schemaLocation="http://www.openmobilealliance.org/tech/profiles/rest_common-v1_0.xsd"/>

  <xsd:element name="locationInfo" type="LocationInfo"/>

  <xsd:complexType name="LocationInfo">
    <xsd:sequence>
      <xsd:element name="latitude" type="xsd:float" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="longitude" type="xsd:float" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="altitude" type="xsd:float" minOccurs="0" maxOccurs="1"/>
      <xsd:element name="accuracy" type="xsd:int" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="timestamp" type="xsd:dateTime" maxOccurs="1" minOccurs="1"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="terminalDistance" type="TerminalDistance"/>

  <xsd:complexType name="TerminalDistance">
    <xsd:sequence>
      <xsd:element name="distance" type="xsd:int" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="accuracy" type="xsd:int" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="timestamp" type="xsd:dateTime" maxOccurs="1" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="TerminalLocation">
    <xsd:sequence>
      <xsd:element name="address" type="xsd:anyURI" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="locationRetrievalStatus" type="common:RetrievalStatus" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="currentLocation" type="LocationInfo" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="errorInformation" type="common:ServiceError" maxOccurs="1" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="terminalLocationList" type="TerminalLocationList"/>

  <xsd:complexType name="TerminalLocationList">
    <xsd:sequence>
      <xsd:element name="terminalLocation" type="TerminalLocation" maxOccurs="unbounded" minOccurs="1"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="subscriptionCancellationNotification" type="SubscriptionCancellationNotification"/>

  <xsd:complexType name="SubscriptionCancellationNotification">
    <xsd:sequence>
      <xsd:element name="callbackData" type="xsd:string" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="address" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="reason" type="common:ServiceError" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="link" type="common:Link" maxOccurs="unbounded" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="notificationSubscriptionList" type="NotificationSubscriptionList"/>

  <xsd:complexType name="NotificationSubscriptionList">
    <xsd:sequence>
      <xsd:element name="circleNotificationSubscription" type="CircleNotificationSubscription" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="periodicNotificationSubscription" type="PeriodicNotificationSubscription" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="distanceNotificationSubscription" type="DistanceNotificationSubscription" maxOccurs="unbounded" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:simpleType name="DelayTolerance">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="NoDelay"/>
      <xsd:enumeration value="LowDelay"/>
      <xsd:enumeration value="DelayTolerant"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="EnteringLeavingCriteria">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="Entering"/>
      <xsd:enumeration value="Leaving"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:element name="circleNotificationSubscription" type="CircleNotificationSubscription"/>

  <xsd:complexType name="CircleNotificationSubscription">
    <xsd:sequence>
      <xsd:element name="clientCorrelator" type="xsd:string" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="link" type="common:Link" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="callbackReference" type="common:CallbackReference" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="requester" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
     
<xsd:element name="address" type="xsd:anyURI" maxOccurs="unbounded" minOccurs="1"/>
      <xsd:element name="latitude" type="xsd:float" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="longitude" type="xsd:float" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="radius" type="xsd:float" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="trackingAccuracy" type="xsd:float" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="enteringLeavingCriteria" type="EnteringLeavingCriteria" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="checkImmediate" type="xsd:boolean" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="frequency" type="xsd:int" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="duration" type="xsd:int" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="count" type="xsd:int" maxOccurs="1" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="periodicNotificationSubscription" type="PeriodicNotificationSubscription"/>

  <xsd:complexType name="PeriodicNotificationSubscription">
    <xsd:sequence>
      <xsd:element name="clientCorrelator" type="xsd:string" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="link" type="common:Link" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="callbackReference" type="common:CallbackReference" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="requester" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
     
<xsd:element name="address" type="xsd:anyURI" minOccurs="1" maxOccurs="unbounded"/>
      <xsd:element name="requestedAccuracy" type="xsd:int" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="frequency" type="xsd:int" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="duration" type="xsd:int" maxOccurs="1" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:simpleType name="DistanceCriteria">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="AllWithinDistance"/>
      <xsd:enumeration value="AnyWithinDistance"/>
      <xsd:enumeration value="AllBeyondDistance"/>
      <xsd:enumeration value="AnyBeyondDistance"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:element name="distanceNotificationSubscription" type="DistanceNotificationSubscription"/>

  <xsd:complexType name="DistanceNotificationSubscription">
    <xsd:sequence>
      <xsd:element name="clientCorrelator" type="xsd:string" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="link" type="common:Link" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="callbackReference" type="common:CallbackReference" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="requester" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
     
<xsd:element name="referenceAddress" type="xsd:anyURI" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="monitoredAddress" type="xsd:anyURI" maxOccurs="unbounded" minOccurs="1"/>
      <xsd:element name="distance" type="xsd:float" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="trackingAccuracy" type="xsd:float" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="criteria" type="DistanceCriteria" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="checkImmediate" type="xsd:boolean" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="frequency" type="xsd:int" maxOccurs="1" minOccurs="1"/>
      <xsd:element name="duration" type="xsd:int" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="count" type="xsd:int" maxOccurs="1" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="subscriptionNotification" type="SubscriptionNotification"/>

  <xsd:complexType name="SubscriptionNotification">
    <xsd:sequence>
      <xsd:element name="callbackData" type="xsd:string" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="terminalLocation" type="TerminalLocation" maxOccurs="unbounded" minOccurs="1"/>
      <xsd:element name="enteringLeavingCriteria" type="EnteringLeavingCriteria" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="distanceCriteria" type="DistanceCriteria" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="isFinalNotification" type="xsd:boolean" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="link" type="common:Link" maxOccurs="unbounded" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>