<?xml version="1.0" encoding="UTF-8"?>

<!--

XML data type definitions for the RESTful Network API for Notification Channel
   Version: 1.0 (1.0)
   Date: 19 Mar 2020

FILE INFORMATION

    OMA Permanent Document
      File: OMA-SUP-XSD_rest_netapi_notificationchannel-V1_0-20200319-C
      Type: Text - Schema Description

    Public Reachable Information
      Path: http://www.openmobilealliance.org/tech/profiles
      Name: rest_netapi_notificationchannel-v1_0.xsd

NORMATIVE INFORMATION

  Information about this file can be found in the latest revision of the specification

    OMA-TS-REST_NetAPI_NotificationChannel-V1_0

  This is available at http://www.openmobilealliance.org/

  Send comments to technical-comments@mail.openmobilealliance.org

CHANGE HISTORY
14062011 File created, based on OMA-ARC-REST-NetAPI-2011-0021R01-INP_XSD_NetAPI_Notification_Channel. AI REST-NetAPI-2011-A031 considered also.
28062011 Added new data type and updated existing data types (see OMA-ARC-REST-NetAPI-20011-0097R01-CR).
25072011 Added 2 elements "channelLifetime" and "remainingDuration" (see OMA-ARC-REST-NetAPI-20011-0136R01-CR).
01092011 Element resourceURL changed to mandatory in NotificationChannelList (see OMA-ARC-REST-NetAPI-20011-0225-CR_NC_resourceURL_xsd_changes)
20122011 Updated after CONR as per OMA-ARC-REST-NetAPI-20011-0452-CR_NC_XSD_alignment_with_TS_changes
17012012 Status changed to Candidate by TP, TP Ref # OMA-TP-2012-0007-INP_REST_NetAPI_NotificationChannel_1_0_ERP_and_ETR_for_Candidate_Approval
02102012 Status changed to Draft due to support of OMA Push notification delivery method as per OMA-ARC-REST-NetAPI-2012-0255-CR_Notification_Channel_XSD_support_for_OMA_Push
30072013 Status changed to Candidate by TP, TP Ref # OMA-TP-2013-0224-INP_REST_NetAPI_NotificationChannel_V1_0_ERP_for_Candidate_re_approval
27092013 Incorporated OMA-ARC-REST-NetAPI-2013-0055R01-CR_Notif_WebSockets_XSD
07022014 Incorporated OMA-ARC-REST-NetAPI-2014-0015R01-CR_Notif_Ping_Pong_XSD
08052014 Incorporated CR OMA-ARC-REST-NetAPI-2014-0041-CR_Notif_XSD_companion_for_39R01
09062015 Incorporated CRs OMA-ARC-REST-NetAPI-2015-0060-CR_NotifChannel_fix_broken_XSD, OMA-ARC-REST-NetAPI-2015-0061-CR_NotifChanne_XSD_Dynamic_Polling_channelURL
21102015 Incorporated CR OMA-ARC-REST-NetAPI-2015-0073-CR_CR_Notification_Channel_maxWaitTime_XSD
03122015 Incorporated CR OMA-ARC-REST-NetAPI-2015-0094-CR_Notification_Channel_fix_XSD
22122015 Status changed to Candidate by TP, TP Ref # OMA-TP-2015-0220-INP_REST_NetAPI_NotificationChannel_V1_0_ERP_for_Candidate_re_approval
06052016 Incorporated CR OMA-ARC-REST-NetAPI-2016-0005-CR_Notification_Channel_NativeChannel_XSD
19032020 Status changed to Candidate by ARC WG, ARC WG Ref # OMA-ARC-2020-0003-INP_REST_NetAPI_NotificationChannel_V1_0_ERP_for_Candidate_Approval

LEGAL DISCLAIMER

  Copyright 2020 Open Mobile Alliance.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:

  1. Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in the
  documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its
  contributors may be used to endorse or promote products derived
  from this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.

  The above license is used as a license under copyright only.  Please
  reference the OMA IPR Policy for patent licensing terms:
  https://www.omaspecworks.org/about/intellectual-property-rights/
  
-->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:common="urn:oma:xml:rest:netapi:common:1"
   xmlns="urn:oma:xml:rest:netapi:notificationchannel:1"
   targetNamespace="urn:oma:xml:rest:netapi:notificationchannel:1" version="1.0">
   
   <xsd:annotation>
      <xsd:documentation>
         This schema defines the XML data types for the RESTful Network API for Notification Channel
      </xsd:documentation>
   </xsd:annotation>
   
   <xsd:import namespace="urn:oma:xml:rest:netapi:common:1" schemaLocation="http://www.openmobilealliance.org/tech/profiles/rest_netapi_common-v1_0.xsd" />
   
   <xsd:element name="notificationChannelList" type="NotificationChannelList"/>
  
   <xsd:complexType name="NotificationChannelList">
     <xsd:sequence>
        <xsd:element name="notificationChannel" type="NotificationChannel" maxOccurs="unbounded" minOccurs="0"/>
        <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="1"/>
     </xsd:sequence>
   </xsd:complexType>
  
   <xsd:element name="notificationChannel" type="NotificationChannel"/> 
 
   <xsd:complexType name="NotificationChannel">
      <xsd:sequence>
        <xsd:element name="clientCorrelator" type="xsd:string" maxOccurs="1" minOccurs="0" />
        <xsd:element name="applicationTag" type="xsd:string" maxOccurs="1" minOccurs="0" />
        <xsd:element name="channelType" type="ChannelType" />
        <xsd:element name="channelData" type="ChannelData" maxOccurs="1" minOccurs="0" />
        <xsd:element name="channelLifetime" type="xsd:int" maxOccurs="1" minOccurs="0" />
        <xsd:element name="callbackURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0" />
        <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
      </xsd:sequence>
   </xsd:complexType>
 
   <xsd:element name="notificationChannelLifetime" type="NotificationChannelLifetime"/> 

   <xsd:complexType name="NotificationChannelLifetime">
      <xsd:sequence>
        <xsd:element name="channelLifetime" type="xsd:int" maxOccurs="1" minOccurs="0" />
      </xsd:sequence>
   </xsd:complexType>

   <xsd:element name="notificationList" type="NotificationList"/> 
 
   <xsd:complexType name="NotificationList">
      <xsd:sequence>
         <xsd:any namespace="##other" processContents="lax" maxOccurs="unbounded" minOccurs="0" />
         <xsd:element name="ncListComplete " type="xsd:boolean" maxOccurs="1" minOccurs="0" />
      </xsd:sequence>
   </xsd:complexType>
   
   <xsd:complexType name="ChannelData" abstract="true">
      <xsd:sequence>
      </xsd:sequence>
   </xsd:complexType>
   
   <xsd:complexType name="LongPollingData" >
     <xsd:complexContent>
       <xsd:extension base="ChannelData">
         <xsd:sequence>
            <xsd:element name="channelURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0" />
            <xsd:element name="maxNotifications" type="xsd:int" maxOccurs="1" minOccurs="0" /> 
            <xsd:element name="maxWaitTime" type="xsd:int" maxOccurs="1" minOccurs="0" />                    
         </xsd:sequence>
       </xsd:extension>
     </xsd:complexContent>
   </xsd:complexType>

   <xsd:complexType name="OMAPushData" >
     <xsd:complexContent>
       <xsd:extension base="ChannelData">
         <xsd:sequence>
            <xsd:element name="appId" type="xsd:string" maxOccurs="1" minOccurs="0" />
            <xsd:element name="maxNotifications" type="xsd:int" maxOccurs="1" minOccurs="0" />
            <xsd:element name="largeDataPolling" type="LargeDataPolling" maxOccurs="1" minOccurs="0" />
         </xsd:sequence>
       </xsd:extension>
     </xsd:complexContent>
   </xsd:complexType>

   <xsd:complexType name="WebSocketsData" >
     <xsd:complexContent>
       <xsd:extension base="ChannelData">
         <xsd:sequence>
            <xsd:element name="channelURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0" />
            <xsd:element name="maxNotifications" type="xsd:int" maxOccurs="1" minOccurs="0" />       
         </xsd:sequence>
       </xsd:extension>
     </xsd:complexContent>
   </xsd:complexType>


   <xsd:complexType name="NativeChannelData" >
     <xsd:complexContent>
       <xsd:extension base="ChannelData">
         <xsd:sequence>
            <xsd:element name="channelSubType" type="NativeChannelSubType" maxOccurs="1" minOccurs="1" />
            <xsd:element name="registrationToken" type="xsd:string" maxOccurs="1" minOccurs="1" />
            <xsd:element name="channelSubTypeVersion" type="xsd:string" maxOccurs="1" minOccurs="0" />
            <xsd:element name="maxNotifications" type="xsd:int" maxOccurs="1" minOccurs="0" />
            <xsd:element name="largeDataPolling" type="LargeDataPolling" maxOccurs="1" minOccurs="0" />
         </xsd:sequence>
       </xsd:extension>
     </xsd:complexContent>
   </xsd:complexType>

         
   <!-- Connectivity checks -->

   <xsd:element name="connCheck" type="ConnCheck"/>
   <xsd:complexType name="ConnCheck">
     <xsd:sequence>
        <xsd:element name="checkInterval" type="xsd:int" maxOccurs="1" minOccurs="0"/>
        <xsd:element name="newChannelLifetime" type="xsd:int" maxOccurs="1" minOccurs="0"/>
     </xsd:sequence>        
   </xsd:complexType>

   <xsd:element name="connAck" type="ConnAck"/>
   <xsd:complexType name="ConnAck">
     <xsd:sequence>
        <xsd:element name="channelLifetime" type="xsd:int" maxOccurs="1" minOccurs="0"/>
     </xsd:sequence>
   </xsd:complexType>

   
   <xsd:element name="longPollingRequestParameters" type="LongPollingRequestParameters"/> 
   
   <!-- in this version, just an empty complex type -->
   <xsd:complexType name="LongPollingRequestParameters"/>
   
      <!-- Large Data Polling -->
   
   <xsd:complexType name="LargeDataPolling">
     <xsd:sequence>
        <xsd:element name="pollingEnabled" type="xsd:boolean" maxOccurs="1" minOccurs="0" />
        <xsd:element name="maxPollingNotifications" type="xsd:int" maxOccurs="1" minOccurs="0" />
     </xsd:sequence>   
   </xsd:complexType>
   
   <xsd:element name="largePollingNotification" type="LargePollingNotification" /> 
   
   <xsd:complexType name="LargePollingNotification">
     <xsd:sequence>
        <xsd:element name="channelURL" type="xsd:anyURI" maxOccurs="1" minOccurs="1" />
        <xsd:element name="channelExpiry" type="xsd:dateTimeStamp" maxOccurs="1" minOccurs="1" />
     </xsd:sequence>   
   </xsd:complexType>



   <!-- ==================================== -->
   <!--            Enumerations              -->
   <!-- ==================================== -->

      
   <xsd:simpleType name="ChannelType">
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="LongPolling" />
        <xsd:enumeration value="OMAPush" />
        <xsd:enumeration value="WebSockets" />  
        <xsd:enumeration value="NativeChannel" />  
      </xsd:restriction>
   </xsd:simpleType>
   
      
   <xsd:simpleType name="NativeChannelSubType">
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="GCM" />
        <xsd:enumeration value="APNS" />
        <xsd:enumeration value="WNS" />   
      </xsd:restriction>
   </xsd:simpleType>
   
</xsd:schema>
