<?xml version="1.0" encoding="UTF-8"?>
<!--
   Common XML data type definitions for RESTful Network APIs 
   Version: 1.0 (1.0)
   Date: 16 Jan 2018
   
   FILE INFORMATION 
   
      OMA Permanent Document 
         File: OMA-SUP-XSD_rest_netapi_common-V1_0-20180116-A 
         Type: Text 
   
      Public Reachable Information 
         Path: http://www.openmobilealliance.org/tech/profiles 
         Name: rest_netapi_common-v1_0.xsd 
   
   NORMATIVE INFORMATION
   
      Information about this file can be found in the latest revision of the specification
   
         OMA-TS-REST_NetAPI_Common-V1_0 
         
         This is available at http://www.openmobilealliance.org/
   
         Send comments to technical-comments@mail.openmobilealliance.org
   
   CHANGE HISTORY 
   16012018   Status changed to Approved by TP, TP Ref # OMA-TP-2018-0001-INP_REST_NetAPI_Common_V1_0_RRP_for_final_Approval
      
   LEGAL DISCLAIMER

   Copyright 2018 Open Mobile Alliance  All rights reserved.

   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:
   http://www.openmobilealliance.org/ipr.html
  
  -->



<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   targetNamespace="urn:oma:xml:rest:netapi:common:1" xmlns="urn:oma:xml:rest:netapi:common:1" version="1.0">
   
   <!-- 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 common XML data types for RESTful Network APIs.</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>
   
   <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:complexType name="VersionedResource">
      <xsd:sequence>
         <xsd:element name="apiVersion" type="xsd:string" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="resourceURL" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/> 
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:element name="versionedResourceList" type="VersionedResourceList"/>  
   
   <xsd:complexType name="VersionedResourceList">
      <xsd:sequence>
         <xsd:element name="resourceReference" type="VersionedResource" minOccurs="1" maxOccurs="unbounded"/> 
      </xsd:sequence>
   </xsd:complexType>
   
   
</xsd:schema>