<?xml version="1.0" encoding="UTF-8"?>
  <!--
    FILE INFORMATION 
    Description 
    This schema describes RESTful bindings for Parlay X Web Services, Common 
    
    Version: 1.0 (1.0)
    Date: 23 November 2010 
    
    OMA Permanent Document 
      File: OMA-SUP-XSD_rest_common-V1_0-20101123-C 
      Type: Text 
      
    Public Reachable Information 
      Path: http://www.openmobilealliance.org/tech/profiles 
      Name: rest_common-v1_0.xsd 
      
    NORMATIVE INFORMATION

    Information about this file can be found in the latest revision of the specification
    OMA-TS-ParlayREST_Common-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
    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 
    20100701 OMA-ARC-REST-2010-0342-CR_ServiceError_in_common_XSD_1_0
    20100824 Candidate
    20100830 Updated with the latest OMA legal disclaimer
    20100928 Re-created with new date due to issues with the 20100830 permdoc. No change to content. 
    20101007 Aligned with change in OMA-ARC-REST-2010-0251-CR_common_1.0_RetrievalStatus.
    20101123 Candidate	
  -->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  targetNamespace="urn:oma:xml:rest:common:1" xmlns:common="urn:oma:xml:rest:common:1" version="1.0">

  <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:complexType name="TimeMetric">
    <xsd:sequence>
      <xsd:element name="metric" type="common:TimeMetrics"/>
      <xsd:element name="units" type="xsd:int"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:simpleType name="TimeMetrics">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="Millisecond"/>
      <xsd:enumeration value="Second"/>
      <xsd:enumeration value="Minute"/>
      <xsd:enumeration value="Hour"/>
      <xsd:enumeration value="Day"/>
      <xsd:enumeration value="Week"/>
      <xsd:enumeration value="Month"/>
      <xsd:enumeration value="Year"/>
    </xsd:restriction>
  </xsd:simpleType>

  <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="common:RequestError"/>

  <xsd:complexType name="RequestError">
    <xsd:sequence>
      <xsd:element name="link" type="common:Link" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:choice>
        <xsd:element name="serviceException" type="common:ServiceException"/>
        <xsd:element name="policyException" type="common: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="common: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="common: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>
   
</xsd:schema>
