<?xml version="1.0" encoding="UTF-8"?>
  <!--
    FILE INFORMATION 
    Description 
    This schema describes RESTful bindings for Parlay X Web Services, Address List Management 
    
    Version: 1.0 (1.0)
    Date: 11 Jan 2011 
    
    OMA Permanent Document 
      File: OMA-SUP-XSD_rest_addresslistmgt-V1_0-20110111-C 
      Type: Text 
      
    Public Reachable Information 
      Path: http://www.openmobilealliance.org/tech/profiles 
      Name: rest_addresslistmgt-v1_0.xsd 
      
    NORMATIVE INFORMATION

      Information about this file can be found in the latest revision of the specification
    
        OMA-TS-ParlayREST_AddressListManagement-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 
    20100509 File created by Sune Jakobsson, Telenor ASA
    20100517 Revised document with Ericsson contribution
    20100831 Update of LEGAL DISCLAIMER
    20100928 Update from OMA-ARC-REST-2010-0547-CR_ALM_xsd_changes_to_match_519
    20100929 Changed addresslistmanagment to addresslistmgt
    20100930 Updated contactListChangeNotification, and changed Attribute to use xsd:attribute
    20101207 Updated with new ALM
    20101217 Updated schemaLocation parameter in the import statement to point to the file from OMA site
	20110111 Candidate approval
  -->

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

  <xsd:annotation>
    <xsd:documentation>This schema defines the XML for validating data used in the Address List Management REST enabler.</xsd:documentation>
  </xsd:annotation>

  <xsd:import namespace="urn:oma:xml:rest:common:1" 
       schemaLocation="http://www.openmobilealliance.org/tech/profiles/rest_common-v1_1.xsd"/>
  
  <xsd:complexType name="ContactCollection">
    <xsd:sequence>
      <xsd:element name="contact" type="Contact" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>
  
  <xsd:element name="contactCollection" type="ContactCollection"/>
  
  <xsd:complexType name="Contact">
    <xsd:sequence>
    	<xsd:element name="sharedIdentity" type="SharedIdentity" maxOccurs="1" minOccurs="0" />
    	<xsd:element name="attributeList" type="AttributeList" maxOccurs="1" minOccurs="0" />
    	<xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0" />
    	<xsd:element name="link" type="common:Link" maxOccurs="unbounded" minOccurs="0" />
    </xsd:sequence>
    	<xsd:attribute name="contactId" type="xsd:anyURI"/>
  </xsd:complexType>
  
  <xsd:element name="contact" type="Contact"/>
  
  <xsd:complexType name="MemberListCollection">
    <xsd:sequence>
      <xsd:element name="memberList" type="MemberList" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>
  
  <xsd:element name="memberListCollection" type="MemberListCollection"/>
  
  <xsd:complexType name="ContactList">
    <xsd:sequence>
      <xsd:element name="contactListId" type="xsd:string" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="memberList" type="MemberList" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="contactListReferenceCollection" type="MemberListReferenceCollection" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="attributeList" type="AttributeList" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>
  
  <xsd:element name="contactList" type="ContactList"/>
  
  <xsd:complexType name="AttributeList">
  	<xsd:sequence>
  		<xsd:element name="attribute" type="Attribute"
  			maxOccurs="unbounded" minOccurs="0" />
  		<xsd:element name="resourceURL" type="xsd:anyURI"
  			maxOccurs="1" minOccurs="0" />
  	</xsd:sequence>
  </xsd:complexType>

  <xsd:element name="attributeList" type="AttributeList"/>
  
  <xsd:complexType name="Attribute">
  	<xsd:sequence>
  		<xsd:element name="value"></xsd:element>
  	</xsd:sequence>
  	<xsd:attribute name="name" type="xsd:string"/>
  </xsd:complexType>

  <xsd:element name="attribute" type="Attribute"/>
  
  <xsd:complexType name="MemberList">
    <xsd:sequence>
      <xsd:element name="memberCollection" 				type="MemberCollection" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="memberListReferenceCollection" type="MemberListReferenceCollection" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="category" 						type="MemberListType" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="sharedListIdentity" 			type="SharedIdentity" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="attributeList" 				type="AttributeList" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="resourceURL" 					type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
    </xsd:sequence>
    <xsd:attribute name="memberListId" type="xsd:anyURI"/>
  </xsd:complexType>
  
  <xsd:element name="memberList" type="MemberList"/>
  
  <xsd:complexType name="Member">
    <xsd:sequence>
      <xsd:element name="memberId" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="attributeList" type="AttributeList" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="link" type="common:Link" maxOccurs="unbounded" minOccurs="0"/>
    </xsd:sequence>
    <xsd:attribute name="memberId" type="xsd:anyURI"/>
  </xsd:complexType>
  
  <xsd:element name="member" type="Member"/>
  
  <xsd:complexType name="MemberListReferenceCollection">
    <xsd:sequence>
      <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="link" type="common:Link" maxOccurs="unbounded" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>
  
  <xsd:element name="memberListReferenceCollection" type="MemberListReferenceCollection"/>
  
  <xsd:complexType name="ListChangesSubscriptionCollection">
    <xsd:sequence>
      <xsd:element name="listChangesSubscription" type="ListChangesSubscription" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>
  
  <xsd:element name="listChangesSubscriptionCollection" type="ListChangesSubscriptionCollection"/>
  
  <xsd:complexType name="ListChangesSubscription">
    <xsd:sequence>
      <xsd:choice>
    	<xsd:element name="anyContacts"></xsd:element>
    	<xsd:element name="memberListId" type="xsd:anyURI" maxOccurs="1" minOccurs="0"></xsd:element>
      </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:element name="listChangesSubscription" type="ListChangesSubscription"/>
  
  <xsd:complexType name="ListChangeNotification">
    <xsd:sequence>
      <xsd:element name="callbackData" type="xsd:string" maxOccurs="unbounded" minOccurs="0"/>
      <xsd:element name="resourceStatus" type="ResourceStatus" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="duration" type="xsd:int" maxOccurs="1" minOccurs="0"/>
      <xsd:element name="link" type="common:Link" maxOccurs="unbounded" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>
  
  <xsd:element name="listChangeNotification" type="ListChangeNotification"/>

  <xsd:complexType name="MemberCollection">
  	<xsd:sequence>
  		<xsd:element name="member" type="Member" maxOccurs="unbounded" minOccurs="0"></xsd:element>
  		<xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"></xsd:element>
  	</xsd:sequence>
  </xsd:complexType>
  
    <xsd:complexType name="Rule">
  	<xsd:sequence>
   		<xsd:element name="clientCorrelator" type="xsd:string" maxOccurs="1" minOccurs="0"></xsd:element>
  		<xsd:element name="applicationTag" type="xsd:string" maxOccurs="1" minOccurs="0"></xsd:element>
  		<xsd:element name="applToContacts" type="ApplicableToContacts"	maxOccurs="1" minOccurs="0"></xsd:element>
  		<xsd:element name="applToMemLists" type="ApplicableToMemberLists" maxOccurs="1" minOccurs="0"></xsd:element>
  		<xsd:element name="applToMemListsAndContacts" type="ApplicableToMemberListsAndLinkedContacts" maxOccurs="1" minOccurs="0"></xsd:element>
  		<xsd:element name="authorizedTo" type="AuthorizedTo" maxOccurs="1" minOccurs="1"></xsd:element>
  		<xsd:element name="listFilter" type="xsd:string" maxOccurs="unbounded" minOccurs="0"></xsd:element>
  		<xsd:element name="indivFilter" type="xsd:string" maxOccurs="unbounded" minOccurs="0"></xsd:element>
  		<xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"></xsd:element>
  	</xsd:sequence>
  	<xsd:attribute name="ruleName" type="xsd:ID"/>
    </xsd:complexType>

  <xsd:element name="rule" type="Rule"/>

    <xsd:complexType name="RuleList">
  	<xsd:sequence>
  		<xsd:element name="rule" type="Rule" maxOccurs="unbounded" minOccurs="0"></xsd:element>
  		<xsd:element name="resourceURL" type="xsd:anyURI" maxOccurs="1" minOccurs="0"></xsd:element>
  	</xsd:sequence>
    </xsd:complexType>

  <xsd:element name="ruleList" type="RuleList"/>

    <xsd:complexType name="SharedIdentity">
        <xsd:sequence>
      <xsd:element name="sharedId" type="xsd:anyURI" maxOccurs="unbounded" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="ApplicableToContacts">
    	<xsd:sequence>
    		<xsd:choice>
    			<xsd:element name="contactId" type="xsd:anyURI" maxOccurs="unbounded" minOccurs="0"></xsd:element>
    			<xsd:element name="allContacts"></xsd:element>
    		</xsd:choice>
    	</xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="ApplicableToMemberLists">
    	<xsd:sequence>
    		<xsd:choice>
    			<xsd:element name="memberListId" type="xsd:anyURI" maxOccurs="unbounded" minOccurs="0"></xsd:element>
    			<xsd:element name="allMemberLists"></xsd:element>
    		</xsd:choice>
    	</xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="ApplicableToMemberListsAndLinkedContacts">
    	<xsd:sequence>
    		<xsd:choice>
    			<xsd:element name="memberListId" type="xsd:anyURI" maxOccurs="unbounded" minOccurs="0"></xsd:element>
    			<xsd:element name="allMemberLists"></xsd:element>
    		</xsd:choice>
    	</xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="AuthorizedTo">
    	<xsd:sequence>
    		<xsd:choice>
    			<xsd:element name="userId" type="xsd:anyURI" maxOccurs="unbounded" minOccurs="0"></xsd:element>
    			<xsd:element name="allSharedIdentities"></xsd:element>
    			<xsd:element name="memberListId" type="xsd:anyURI" maxOccurs="unbounded" minOccurs="0"></xsd:element>
    			<xsd:element name="allMemberLists"></xsd:element>
    			<xsd:element name="link" type="common:Link" maxOccurs="unbounded" minOccurs="0"></xsd:element>
    			<xsd:element name="domainName" type="xsd:string" maxOccurs="unbounded" minOccurs="0"></xsd:element>
    			<xsd:element name="otherUser"></xsd:element>
    		</xsd:choice>
    	</xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="MemberListType">
    	<xsd:restriction base="xsd:string">
    	 <xsd:enumeration value="URIList"/>
         <xsd:enumeration value="GroupURIList"/>
         <xsd:enumeration value="Group"/>
    	</xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="ResourceStatus">
    	<xsd:restriction base="xsd:string">
    	 <xsd:enumeration value="Active"/>
    	 <xsd:enumeration value="TerminatedTimeout"/>
         <xsd:enumeration value="TerminatedNoResource"/>
         <xsd:enumeration value="TerminatedOther"/>
    	</xsd:restriction>
    </xsd:simpleType>

    <xsd:element name="memberCollection" type="MemberCollection"></xsd:element>
    
      <!-- Following are definitions for root elements for light-weight resources -->
  <xsd:element name="link" type="common:Link"/>
  <xsd:element name="resourceURL" type="xsd:anyURI"/>
  <xsd:element name="userId" type="xsd:anyURI"/>
  <xsd:element name="allSharedIdentities"/>
  <xsd:element name="memberListId" type="xsd:anyURI"/>
  <xsd:element name="allMemberList"/>
  <xsd:element name="domainName" type="xsd:string"/>
  <xsd:element name="otherUser"/>
    
</xsd:schema>