<?xml version="1.0" encoding="UTF-8"?>
<!--
   XML schema for the RESTful Network API for OMA Push
   version - 1.0 (1.0)
   date    - 12 Jul 2011
   
   FILE INFORMATION
   
   OMA Permanent Document
   File: OMA-SUP-XSD_rest_netapi_push-V1_0-20110712-C
   Type: Text - Schema Description
   
   Public Reachable Information
   Path: http://www.openmobilealliance.org/tech/profiles
   Name: rest_netapi_push-v1_0.xsd
   
   NORMATIVE INFORMATION
   
   Information about this file can be found in the specification
      OMA-TS-REST_NetAPI_Push-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 2011 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

  20101108 File created see OMA-CD-PUSH-2010-0035 based on PAP DTD and OMA-CD-PUSH-2010-0034 
  20101111 Changes of OMA-CD-PUSH-2010-0036 incorporated
  20101207 Aligned with OMA-TS-PushREST-V1_0-20101206-D, plus changes in CR OMA-CD-PUSH-2010-0044-CR_Replace_Push_Id_solution.
  20110322 Fixed the spelling of "one-shot" to become "oneshot" in line with thePAP technical specification
  20110323 Implemented CR OMA-CD-PUSH-2011-0028-CR_PushREST_B012_resourceURL
  20110419 Implementd CR OMA-CD-PUSH-2011-0038-CR_PushREST_link_XSD
  20110504 Implementd CR OMA-CD-PUSH-2011-0048-CR_PushREST_CR_47_companion_for_XSD 
  20110505 Implementd CR OMA-CD-PUSH-2011-0041-CR_PushREST_new_template_XSD
  20110712 Status changed to Approved by TP ref: OMA-TP-2011-0242-INP_PushREST_V1_0_ERP_for_Candidate_Approval
-->


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" 
   targetNamespace="urn:oma:xml:rest:netapi:push:1" version="1.0" xmlns:push="urn:oma:xml:rest:netapi:push:1"
   xmlns:common="urn:oma:xml:rest:netapi:common:1">
   
   <xsd:import namespace="urn:oma:xml:rest:netapi:common:1"
      schemaLocation="http://www.openmobilealliance.org/tech/profiles/rest_netapi_common-v1_1.xsd"/>
   
   
   <!-- ========================================= -->
   <!-- Enumerations                                                                       -->
   <!-- ========================================= -->
   
   <!-- Push Request state enumeration type -->
   <xsd:simpleType name="State">
    <xsd:restriction base="xsd:token">
      <xsd:enumeration value="rejected"/>
      <xsd:enumeration value="pending"/>
      <xsd:enumeration value="delivered"/>
      <xsd:enumeration value="undeliverable"/>
      <xsd:enumeration value="expired"/>
      <xsd:enumeration value="aborted"/>
      <xsd:enumeration value="timeout"/>
      <xsd:enumeration value="cancelled"/>
      <xsd:enumeration value="unknown"/>
    </xsd:restriction>
  </xsd:simpleType>
  

   <!-- replace method enumeration type -->
   <xsd:simpleType name="replace-method-type">
      <xsd:restriction base="xsd:token">
         <xsd:enumeration value="pending-only"/>
         <xsd:enumeration value="all"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   
   <!-- delivery method enumeration type -->
   <xsd:simpleType name="delivery-method-type">
      <xsd:restriction base="xsd:token">
         <xsd:enumeration value="confirmed"/>
         <xsd:enumeration value="preferconfirmed"/>
         <xsd:enumeration value="confirmed-with-response"/>
         <xsd:enumeration value="oneshot"/>
         <xsd:enumeration value="unconfirmed"/>
         <xsd:enumeration value="notspecified"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   
   <!-- priority enumeration  -->
   <xsd:simpleType name="priority-type">
      <xsd:restriction base="xsd:token">
         <xsd:enumeration value="high"/>
         <xsd:enumeration value="medium"/>
         <xsd:enumeration value="low"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   
   <!-- network-type enumeration  -->
   <xsd:simpleType name="network-type">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="WWAN"/>
         <xsd:enumeration value="WLAN"/>
         <xsd:enumeration value="GSM"/>
         <xsd:enumeration value="IS-95 CDMA"/>
      </xsd:restriction>
   </xsd:simpleType>
   

   <!-- bearer-type enumeration  -->
   <xsd:simpleType name="bearer-type">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="SMS"/>
         <xsd:enumeration value="CBS"/>
         <xsd:enumeration value="IP"/>
         <xsd:enumeration value="SIP"/>
         <xsd:enumeration value="MBMS"/>
         <xsd:enumeration value="BCAST"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   
   <!-- ========================================= -->
   <!-- Shared complex types                                                        -->
   <!-- ========================================= -->
   
   <!-- address structure -->
   <xsd:complexType name="address-type">
      <xsd:attribute name="address-value" type="xsd:string" use="required"/>
   </xsd:complexType>

   <!-- QoS structure -->
   <xsd:complexType name="quality-of-service-type">
      <xsd:attribute name="priority" default="medium" type="push:priority-type" use="optional"/>
      <xsd:attribute name="delivery-method" default="notspecified" type="push:delivery-method-type" use="optional"/>
      <xsd:attribute name="network" type="push:network-type" use="optional"/>
      <xsd:attribute name="network-required" default="false" type="xsd:boolean" use="optional"/>
      <xsd:attribute name="bearer" type="push:bearer-type" use="optional"/>
      <xsd:attribute name="bearer-required" default="false" type="xsd:boolean" use="optional"/>
   </xsd:complexType>
   
   
  <!-- ========================================= -->
  <!-- Declaration of push request message -->
  <!-- ========================================= -->
  <!-- this structure goes into the HTTP request to create a new Push Request resource -->
   <xsd:element name="push-message" type="push:push-message-type"/>
   <xsd:complexType name="push-message-type">
      <xsd:sequence>
         <xsd:element maxOccurs="unbounded" name="address" type="push:address-type"/>
         <xsd:element minOccurs="0" name="quality-of-service" type="push:quality-of-service-type"/>
      </xsd:sequence>
      <xsd:attribute name="replace-push-message" type="xsd:anyURI" use="optional"/> 
      <xsd:attribute name="replace-method" default="all" type="push:replace-method-type" use="optional"/> 
      <xsd:attribute name="deliver-before-timestamp" type="xsd:dateTime" use="optional"/>
      <xsd:attribute name="deliver-after-timestamp" type="xsd:dateTime" use="optional"/>
      <xsd:attribute name="source-reference" type="xsd:string" use="optional"/>
      <xsd:attribute name="ppg-notify-requested-to" type="xsd:anyURI" use="optional"/>
      <xsd:attribute name="progress-notes-requested" default="false" type="xsd:boolean" use="optional"/>
   </xsd:complexType>
   
    
   <!-- this structure is provided as the response to creating a new Push Request resource -->
   <xsd:element name="push-response" type="push:push-response-type"/>
   <xsd:complexType name="push-response-type">
      <xsd:sequence>
         <xsd:element minOccurs="0" maxOccurs="unbounded" name="progress-note" type="push:progress-note-type"/>
         <xsd:element name="response-result" type="push:response-result-type"/>        
         <xsd:element name="resourceURL" type="xsd:anyURI"/>        
      </xsd:sequence>
      <xsd:attribute name="sender-address" type="xsd:string" use="optional"/>
      <xsd:attribute name="sender-name" type="xsd:string" use="optional"/>
      <xsd:attribute name="reply-time" type="xsd:dateTime" use="optional"/>
   </xsd:complexType>
   
   
  <!-- local complex types -->
   <xsd:complexType name="progress-note-type">
      <xsd:attribute name="stage" type="xsd:string" use="required"/>
      <xsd:attribute name="note" type="xsd:string" use="optional"/>
      <xsd:attribute name="time" type="xsd:dateTime" use="optional"/>
   </xsd:complexType>
      
   <xsd:complexType name="response-result-type">
      <xsd:attribute name="code" type="xsd:string" use="required"/>
      <xsd:attribute name="desc" type="xsd:string" use="optional"/>
   </xsd:complexType>
   
   
  <!-- ========================================= -->
  <!-- Declaration of cancel operation -->
  <!-- ========================================= -->
   <!-- this structure goes into the HTTP request to cancel a Push Request -->
  <xsd:element name="cancel-message" type="push:cancel-message-type"/>
   <xsd:complexType name="cancel-message-type">
      <xsd:sequence>
         <xsd:element minOccurs="0" maxOccurs="unbounded" name="address" type="push:address-type"/>
      </xsd:sequence>
   </xsd:complexType>

   <!-- this structure is provided as the response to cancelling a Push Request -->
   <xsd:element name="cancel-response" type="push:cancel-response-type"/>
   <xsd:complexType name="cancel-response-type">
      <xsd:sequence>
         <xsd:element maxOccurs="unbounded" name="cancel-result" type="push:cancel-result-type"/>
         <xsd:element name="resourceURL" type="xsd:anyURI"/>        
      </xsd:sequence>
   </xsd:complexType>
   
   <!-- local complex types -->
   <xsd:complexType name="cancel-result-type">
      <xsd:sequence>
         <xsd:element minOccurs="0" maxOccurs="unbounded" name="address" type="push:address-type"/>
      </xsd:sequence>
      <xsd:attribute name="code" type="xsd:string" use="required"/>
      <xsd:attribute name="desc" type="xsd:string" use="optional"/>
   </xsd:complexType>
      
   
   <!-- ========================================= -->
   <!-- Declaration of statusquery operation -->
   <!-- ========================================= -->
   <!-- this structure is provided as the response to reading the status of a Push Request -->
   <xsd:element name="statusquery-response" type="push:statusquery-response-type"/>
   <xsd:complexType name="statusquery-response-type">
      <xsd:sequence>
         <xsd:element maxOccurs="unbounded" name="statusquery-result" type="push:statusquery-result-type"/>
         <xsd:element name="resourceURL" type="xsd:anyURI"/>        
      </xsd:sequence>
   </xsd:complexType>
      
   <!-- local complex types -->
   <xsd:complexType name="statusquery-result-type">
      <xsd:sequence>
         <xsd:element minOccurs="0" maxOccurs="unbounded" name="address" type="push:address-type"/>
         <xsd:element minOccurs="0" name="quality-of-service" type="push:quality-of-service-type"/>
      </xsd:sequence>
      <xsd:attribute name="event-time" type="xsd:dateTime" use="optional"/>
      <xsd:attribute name="message-state" type="push:State" use="required" />
      <xsd:attribute name="code" type="xsd:string" use="required"/>
      <xsd:attribute name="desc" type="xsd:string" use="optional"/>
   </xsd:complexType>
      
   
   <!-- ========================================= -->
  <!-- Declaration of notify result operation -->
  <!-- ========================================= -->
  <!-- this structure goes into the notification HTTP request from the Push Proxy Gateway to the Push Initiator -->
  <!-- Successful-recipients, unsuccessful-recipients elements added in PAP 2.3 -->
   <xsd:element name="resultnotification-message" type="push:resultnotification-message-type"/>
   <xsd:complexType name="resultnotification-message-type">
      <xsd:sequence>
         <xsd:element name="address" type="push:address-type"/>
         <xsd:element name="link" type="common:Link"/>
         <xsd:element minOccurs="0" name="quality-of-service" type="push:quality-of-service-type"/>
         <xsd:element minOccurs="0" name="successful-recipients" type="push:address-type"/>
         <xsd:element minOccurs="0" name="unsuccessful-recipients" type="push:address-type"/>
      </xsd:sequence>
      <xsd:attribute name="sender-address" type="xsd:string" use="optional"/>
      <xsd:attribute name="sender-name" type="xsd:string" use="optional"/>
      <xsd:attribute name="received-time" type="xsd:dateTime" use="optional"/>
      <xsd:attribute name="event-time" type="xsd:dateTime" use="optional"/>
      <xsd:attribute name="message-state" type="push:State" use="required" />
      <xsd:attribute name="code" type="xsd:string" use="required"/>
      <xsd:attribute name="desc" type="xsd:string" use="optional"/>
   </xsd:complexType>
   
   <!-- this structure goes into the notification HTTP response from the Push Initiator to the Push Proxy Gateway -->
   <xsd:element name="resultnotification-response" type="push:resultnotification-response-type"/>
   <xsd:complexType name="resultnotification-response-type">
      <xsd:attribute name="code" type="xsd:string" use="required"/>
      <xsd:attribute name="desc" type="xsd:string" use="optional"/>
   </xsd:complexType>
   
   
   <!-- ============================================== -->
  <!-- Declaration of capabilities query operation -->
  <!-- ============================================== -->
   <!-- this structure goes into the HTTP response to a Capability Query Request -->
   <xsd:element name="ccq-response" type="push:ccq-response-type"/>
   <xsd:complexType name="ccq-response-type">
      <xsd:sequence>
         <xsd:element name="address" type="push:address-type"/>
         <xsd:element name="resourceURL" type="xsd:anyURI"/>
      </xsd:sequence>
      <xsd:attribute name="code" type="xsd:string" use="required"/>
      <xsd:attribute name="desc" type="xsd:string" use="optional"/>
   </xsd:complexType>
   
   
  <!-- ============================================== -->
  <!-- Declaration of bad message response message -->
  <!-- ============================================== -->
   <!-- this structure goes into the HTTP response to failed requests -->
   <xsd:element name="badmessage-response" type="push:badmessage-response-type"/>
   <xsd:complexType name="badmessage-response-type">
      <xsd:attribute name="code" type="xsd:string" use="required"/>
      <xsd:attribute name="desc" type="xsd:string" use="optional"/>
      <xsd:attribute name="bad-message-fragment" type="xsd:string" use="optional"/>
   </xsd:complexType>
   
</xsd:schema>
