<?xml version="1.0" encoding="UTF-8"?>
<!--
   FILE INFORMATION 
   Description 
   This schema describes RESTful bindings for Parlay X Web Services, Common 
   
   Version: 1.1 (1.1)
   Date: 11 Jan 2011
   
   OMA Permanent Document 
   File: OMA-SUP-XSD_rest_common-V1_1-20110111-C 
   Type: Text 
   
   Public Reachable Information 
   Path: http://www.openmobilealliance.org/tech/profiles 
   Name: rest_common-v1_1.xsd 
   
   NORMATIVE INFORMATION
   
   Information about this file can be found in the latest revision of the specification
   OMA-TS-ParlayREST_Common-V1_1 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 2011 Open Mobile Alliance Ltd.  All Rights Reserved.
   Used with the permission of the Open Mobile Alliance Ltd. under the
   terms set forth above.   
  -->


<!--
   1.0 CHANGE HISTORY 
   20091116 File created by Sune Jakobsson, Telenor ASA
   20091201 Replaced the disclaimer, and added a description
   20091202 Changed Link
   20091203 Added Request error as root element
   20091204 Released version after Vienna meeting
   20091205 Corrected error in Request error
   20091211 Final alignment with all TS's
   20100104 Fixed errors to align with OMA-TS-ParlayREST_Common-V1_0-20091216-D  
   during CONR (see CR OMA-ARC-REST-2010-0001)
   20100131 Changed internal name space from rest to common
   20100203 Corrected the use of choice, removed subversion in name space and the naming convention.
   20100207 Final version after Sorrento meeting
   20100215 Removed Link as a root element
   20100225 Added the Enumeration NotificationFormat and added that to CallbackReference
   20100226 Added ResourceReference type
   20100307 Changed ResourceReference to complex type
   
   1.1 CHANGE HISTORY 
   20100429 File created by Uwe Rauschenbach, NSN, based on OMA-ARC-REST-2010-0190-INP_TS_common_V1_1_baseline_with_3PCC_datastructures
   20100510 Fixed the version attriibute which was still at V 1.0 but must be V 1.1
   20100521 updated by Sichen Wang, Huawei, based on OMA-TS-ParlayREST_Common-V1_1-20100518-D, see OMA-ARC-REST-2010-0252-CR_changes_to_common_xsd_1.1                           
   20100909 CR OMA-ARC-REST-2010-0508-CR_Fixing_Modularization_Confusion_XSD_Common implemented
   20100914 Implemented OMA-ARC-REST-2010-0513-CR_Update_Common_XSD_catering_for_OneAPI_Call_Control_profile
   20100920 Implemented OMA-ARC-REST-2010-0535-INP_Default_Namespaces_Fix_in_Some_XSDs 
   20100928 Updated with the latest OMA legal disclaimer
   20101029 Implemented OMA-ARC-REST-2010-0595-CR_CONRR_LanguageString_XSD_Common 
   20101115 remove TimeMetrics and TimeMetric according to OMA-TS-ParlayREST_Common-V1_1-20101115-D
   20110111 Candidate approval
-->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   targetNamespace="urn:oma:xml:rest:common:1" xmlns="urn:oma:xml:rest:common:1" version="1.1">
   
   <!-- Importing xml default declarations (fo xml:lang) -->
   <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
   
   <xsd:annotation>
      <xsd:documentation>This schema defines the XML for validating data used in the common part of all REST enablers.</xsd:documentation>
   </xsd:annotation>
   

   <xsd:simpleType name="NotificationFormat">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="XML"/>
         <xsd:enumeration value="JSON"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   
   <xsd:element name="requestError" type="RequestError"/>
   
   <xsd:complexType name="RequestError">
      <xsd:sequence>
         <xsd:element name="link" type="Link" maxOccurs="unbounded" minOccurs="0"/>
         <xsd:choice>
            <xsd:element name="serviceException" type="ServiceException"/>
            <xsd:element name="policyException" type="PolicyException"/>
         </xsd:choice>
      </xsd:sequence>
   </xsd:complexType>
   
   <xsd:complexType name="PolicyException">
      <xsd:sequence>
         <xsd:element name="messageId" type="xsd:string" maxOccurs="1" minOccurs="1"/>
         <xsd:element name="text" type="xsd:string" maxOccurs="1" minOccurs="1"/>
         <xsd:element maxOccurs="unbounded" minOccurs="0" name="variables" type="xsd:string"/>
      </xsd:sequence>
   </xsd:complexType>
   
   <xsd:complexType name="ServiceException">
      <xsd:sequence>
         <xsd:element name="messageId" type="xsd:string" maxOccurs="1" minOccurs="1"/>
         <xsd:element name="text" type="xsd:string" maxOccurs="1" minOccurs="1"/>
         <xsd:element maxOccurs="unbounded" minOccurs="0" name="variables" type="xsd:string"/>
      </xsd:sequence>
   </xsd:complexType>
   
   <xsd:complexType name="ChargingInformation">
      <xsd:sequence>
         <xsd:element name="description" type="xsd:string" maxOccurs="unbounded" minOccurs="1"/>
         <xsd:element name="currency" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="amount" type="xsd:decimal" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="code" type="xsd:string" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   <xsd:complexType name="CallbackReference">
      <xsd:sequence>
         <xsd:element name="notifyURL" type="xsd:anyURI" maxOccurs="1" minOccurs="1"/>
         <xsd:element name="callbackData" type="xsd:string" maxOccurs="1" minOccurs="0"/>
         <xsd:element name="notificationFormat" type="NotificationFormat" maxOccurs="1" minOccurs="0"/>
      </xsd:sequence>
   </xsd:complexType>
   
   <xsd:complexType name="Link">
      <xsd:attribute name="rel" type="xsd:string" use="required"/>
      <xsd:attribute name="href" type="xsd:anyURI" use="required"/>
   </xsd:complexType>
   
   <xsd:element name="resourceReference" type="ResourceReference"/>
   
   <xsd:complexType name="ResourceReference">
      <xsd:sequence>
         <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   <xsd:complexType name="ServiceError">
      <xsd:sequence>
         <xsd:element name="messageId" type="xsd:string" maxOccurs="1" minOccurs="1"/>
         <xsd:element name="text" type="xsd:string" maxOccurs="1" minOccurs="1"/>
         <xsd:element name="variables" type="xsd:string" maxOccurs="unbounded" minOccurs="0"/>
      </xsd:sequence>
   </xsd:complexType>   
   
   <xsd:simpleType name="RetrievalStatus">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="Retrieved"/>
         <xsd:enumeration value="NotRetrieved"/>
         <xsd:enumeration value="Error"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   
   <!-- Start of ParlayREST V 1.1 part -->
   <xsd:complexType name="CallSessionInformation">
      <xsd:sequence>
         <xsd:element name="participant" type="CallParticipantInformation" minOccurs="1" maxOccurs="unbounded"/>
         <xsd:element name="participantAnnouncement" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="originatorAnnouncement" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="callbackReference" type="CallbackReference" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="terminated" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="charging" type="ChargingInformation" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="mediaInfo" type="MediaInfo" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="changeMediaNotAllowed" type="xsd:boolean" minOccurs="0" maxOccurs="1" default="true"/>
         <xsd:element name="link" type="Link" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="clientCorrelator" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="resourceURL" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:complexType name="CallParticipantInformation">
      <xsd:sequence>
         <xsd:element name="participantAddress" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="participantName" type="xsd:string" minOccurs="0" maxOccurs="1" />
         <xsd:element name="participantStatus" type="CallParticipantStatus" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="startTime" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="duration" type="xsd:int" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="terminationCause" type="CallParticipantTerminationCause" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="mediaInfo" type="MediaInfo" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="link" type="Link" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="clientCorrelator" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="resourceURL"	type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:complexType name="MediaInfo">
      <xsd:sequence>
         <xsd:element name="media" type="Media" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="mediaDirection" type="MediaDirection" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:simpleType name="Media">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="Audio"/>
         <xsd:enumeration value="Video"/>
         <xsd:enumeration value="Chat"/>
         <xsd:enumeration value="Data"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   <xsd:simpleType name="MediaDirection">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="In"/>
         <xsd:enumeration value="Out"/>
         <xsd:enumeration value="InOut"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   <xsd:simpleType name="CallParticipantStatus">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="CallParticipantInitial"/>
         <xsd:enumeration value="CallParticipantConnected"/>
         <xsd:enumeration value="CallParticipantTerminated"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   <xsd:simpleType name="CallParticipantTerminationCause">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="CallParticipantNoAnswer"/>
         <xsd:enumeration value="CallParticipantBusy"/>
         <xsd:enumeration value="CallParticipantNotReachable"/>
         <xsd:enumeration value="CallParticipantHangUp"/>
         <xsd:enumeration value="CallParticipantAborted"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   <xsd:complexType name="LanguageString">
      <xsd:simpleContent>
         <xsd:extension base="xsd:string">
            <xsd:attribute ref="xml:lang" use="optional"/>
         </xsd:extension>
      </xsd:simpleContent>
   </xsd:complexType>
   
</xsd:schema>