<?xml version="1.0" encoding="UTF-8"?>
<!--
   XML data type definitions for the RESTful Network API for Converged Address Book (CAB APIs) 
   Version: 1.0 (1.0)
   Date: 02 Jul 2013 
   
   FILE INFORMATION 
   
   OMA Permanent Document 
      File: OMA-SUP-XSD_rest_netapi_convergedaddressbook-V1_0-20130702-A
      Type: Text - Schema Description 
   
   Public Reachable Information 
      Path: http://www.openmobilealliance.org/tech/profiles 
      Name: rest_netapi_convergedaddressbook-v1_0.xsd 
   
   NORMATIVE INFORMATION
   
      Information about this file can be found in the latest revision of the specification
   
         OMA-TS-REST_NetAPI_ConvergedAddressBook-V1_0 
         
      This is available at http://www.openmobilealliance.org/
   
      Send comments to technical-comments@mail.openmobilealliance.org
   
   CHANGE HISTORY 
   02072013 Status changed to Approved by TP, TP Ref # OMA-TP-2013-0208-INP_CAB_APIs_V1_0_ERP_for_Final_Approval
   
   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 2013 Open Mobile Alliance Ltd.  All Rights Reserved.
   Used with the permission of the Open Mobile Alliance Ltd. under the
   terms set forth above.   
-->


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:common="urn:oma:xml:rest:netapi:common:1"
   xmlns:ab="urn:oma:xml:rest:netapi:addressbook:1"
   xmlns="urn:oma:xml:rest:netapi:cab:1"
   xmlns:filter="urn:ietf:params:xml:ns:simple-filter"
   targetNamespace="urn:oma:xml:rest:netapi:cab:1" version="1.0">
   
   <xsd:annotation>
      <xsd:documentation>This schema defines the XML data types for the RESTful Network API for Converged Address Book (CAB)</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:import namespace="urn:oma:xml:rest:netapi:addressbook:1" schemaLocation="http://www.openmobilealliance.org/tech/profiles/rest_netapi_addressbook-v1_0.xsd"/>
 
   <xsd:import namespace="urn:ietf:params:xml:ns:simple-filter" schemaLocation="http://www.iana.org/assignments/xml-registry/schema/simple-filter.xsd"/>
   
   <xsd:import namespace="urn:oma:xml:cab:pcc" schemaLocation="http://www.openmobilealliance.org/tech/profiles/cab_pcc-v1_0.xsd"/>
        
   <!-- Most of the data types used for CAB are imported from Address Book schema. Following are definitions of data types specific for CAB APIs -->
      
    
   <xsd:element name="externalRequest" type="ExternalRequest"/>
   
   <xsd:complexType name="ExternalRequest">
      <xsd:sequence>
        <xsd:choice minOccurs="0" maxOccurs="1">
           <xsd:element name="importNonCAB" type="EmptyType" minOccurs="1" maxOccurs="1"/>
           <xsd:element name="importProfile" type="EmptyType" minOccurs="1" maxOccurs="1"/>
           <xsd:element name="exportProfile" type="EmptyType" minOccurs="1" maxOccurs="1"/>
           <xsd:element name="subscribeProfile" type="EmptyType" minOccurs="1" maxOccurs="1"/>
        </xsd:choice>
        <xsd:element name="nonCABSource" type="xsd:string" minOccurs="1" maxOccurs="1"/>
        <xsd:element name="scheduledInterval" type="xsd:int" minOccurs="1" maxOccurs="1"/>
        <xsd:element name="username" type="xsd:string" minOccurs="0" maxOccurs="1"/>
        <xsd:element name="password" type="xsd:string" minOccurs="0" maxOccurs="1"/>
        <xsd:element name="token" type="xsd:string" minOccurs="0" maxOccurs="1"/>
        <xsd:element name="filterSet" type="filter:FilterSetType" minOccurs="0" maxOccurs="1"/>
        <xsd:element name="clientCorrelator" type="xsd:string" minOccurs="0" maxOccurs="1"/>
        <xsd:element name="applicationTag" type="xsd:string" minOccurs="0" maxOccurs="1"/>
        <xsd:element name="resourceURL" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   <xsd:element name="externalRequestCollection" type="ExternalRequestCollection"/>
   
   <xsd:complexType name="ExternalRequestCollection">
      <xsd:sequence>
         <xsd:element name="externalReq" type="ExternalRequest" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="resourceURL" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
    
   <xsd:complexType name="ProfileCollection">
      <xsd:sequence>
         <xsd:element name="profile" type="Profile" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="resourceURL" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
     
  <xsd:element name="profileCollection" type="ProfileCollection"/>
   
   <xsd:complexType name="Profile">
    <xsd:sequence>
      <xsd:element name="profileId" type="xsd:anyURI" maxOccurs="1" minOccurs="0" />
      <xsd:element name="attributeList" type="ab:AttributeList" maxOccurs="1" minOccurs="0" />
      <xsd:element name="xcapNodeSelector" type="xsd:anyURI" />                        <!-- Extended for Profile -->
    </xsd:sequence>
  </xsd:complexType>
  
 <xsd:element name="profile" type="Profile"/>
 
  <xsd:complexType name="AbChangesSubscriptionCollection">
    <xsd:sequence>
      <xsd:element name="abChangesSubscription" type="AbChangesSubscription" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="1"/>
    </xsd:sequence>
  </xsd:complexType>
  
  <xsd:element name="abChangesSubscriptionCollection" type="AbChangesSubscriptionCollection"/>
  
  <xsd:complexType name="AbChangesSubscription">
    <xsd:sequence>
      <xsd:choice>
        <xsd:element name="anyContacts" type="EmptyType" maxOccurs="1" minOccurs="1"/>
        <xsd:element name="profile" type="EmptyType" maxOccurs="1" minOccurs="1"/>
        <xsd:element name="listId" type="xsd:anyURI" maxOccurs="1" minOccurs="1"/>
      </xsd:choice>
      <xsd:element name="callbackReference" type="common:CallbackReference" maxOccurs="1" minOccurs="1"/>
      <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="duration" type="xsd:int" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="resourceURL" type="xsd:string" maxOccurs="1" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>
  
      <xsd:simpleType name="ListType">
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="URIList"/>
        <xsd:enumeration value="GroupURIList"/>
        <xsd:enumeration value="Group"/>
        <xsd:enumeration value="CABSubscriptionList"/>
      </xsd:restriction>
    </xsd:simpleType>
  
     <xsd:complexType name="ApplicableToProfile">
      <xsd:sequence>
        <xsd:choice>
          <xsd:element name="profileId" type="xsd:anyURI" maxOccurs="unbounded" minOccurs="0"/>
          <xsd:element name="allProfiles" type="EmptyType" maxOccurs="1" minOccurs="1"/>
        </xsd:choice>
      </xsd:sequence>
    </xsd:complexType>
  
   <xsd:complexType name="EmptyType"/>
   
</xsd:schema>
