<?xml version="1.0" encoding="UTF-8"?>

<!--
FILE INFORMATION

Description
   This schema describes various PAL message payload types utilized
   by the PAL V1.0 Enabler.

Version: 1.0  
Date:    29 June 2010

OMA Permanent Document
   File: OMA-SUP-XSD_pal_messagePayloads-V1_0-20100629-D
   Type: text/xml

Public Reachable Information
   Path: http://www.openmobilealliance.org/tech/profiles
   Name: pal_messagePayloads-v1_0.xsd

NORMATIVE INFORMATION

Information about this file can be found in the latest revision of the specification
OMA-TS-PAL_XDM-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

You may use this document or any part of the document for internal
or educational purposes only, provided you do not modify, edit or
take out of context the information in this document in any manner.
Information contained in this document may be used, at your sole
risk, for any purposes.

You may not use this document in any other manner without the prior
written permission of the Open Mobile Alliance.  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 2010 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 targetNamespace="urn:oma:xml:prs:pal:payloads:1.0"
            xmlns:pa="urn:oma:xml:prs:pal:payloads:1.0"
            xmlns:pp="urn:oma:xml:xdm:pal-profile:1.0"
            xmlns:pd="urn:ietf:params:xml:ns:pidf"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified" attributeFormDefault="unqualified">

     <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
	 <xsd:import namespace="urn:ietf:params:xml:ns:pidf" schemaLocation="pidf.xsd"/>
	 <xsd:import namespace="urn:oma:xml:xdm:pal-profile:1.0" schemaLocation="xdm_palProfile-V1_0.xsd"/>

     <xsd:complexType name="aspectValueType">
	    <xsd:annotation>
		   <xsd:documentation xml:lang="en">
		     PAL aspect value type.
			 A data type for providing Presence Aspect value(s).
		   </xsd:documentation>
		</xsd:annotation>

		<xsd:sequence>
		    <xsd:element name="contact" type="pd:contact" minOccurs="0"/>
            <xsd:element name="item"    type="pa:aspectValueListType" minOccurs="1" maxOccurs="unbounded"/>
		</xsd:sequence>

		<xsd:attribute name="uri" type="xsd:anyURI" use="required"/>
	 </xsd:complexType>

	 <xsd:complexType name="aspectValueListType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL aspect value request list type.
		     A list data type for bundling one or more Presence Aspect value requests.
		   </xsd:documentation>
        </xsd:annotation>

		<xsd:attribute name="aspect" type="xsd:QName" use="required"/>
	 </xsd:complexType>

     <xsd:complexType name="presentityType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL presentity type. A data type which models a presentity within the PAL Enabler.
		   </xsd:documentation>
        </xsd:annotation>

	    <xsd:attribute name="uri" type="xsd:anyURI"/>
		<xsd:attribute name="pres-list" type="xsd:token"/>
		<xsd:attribute name="interestLevel" type="pa:interestEnum"/>
		<xsd:attribute name="priority" type="pa:priorityEnum"/>
	 </xsd:complexType>

     <xsd:simpleType name="qosEnum">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL 'QoS' enumeration values as detailed in PAL V1.0 Enabler
			 Technical Specification, section "PAL Client/Server Interaction".
		   </xsd:documentation>
        </xsd:annotation>

	    <xsd:restriction base="xsd:token">
		   <xsd:enumeration value="Bronze"/>
           <xsd:enumeration value="Silver"/>
		   <xsd:enumeration value="Gold"/>
		</xsd:restriction>
	 </xsd:simpleType>

     <xsd:simpleType name="interestEnum">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL 'InterestLevel' parameter enumeration values as detailed in PAL V1.0 Enabler
			 Technical Specification, section "PAL Client/Server Interaction".
		   </xsd:documentation>
        </xsd:annotation>

	    <xsd:restriction base="xsd:token">
		   <xsd:enumeration value="LessInterested"/>
           <xsd:enumeration value="ModeratelyInterested"/>
		   <xsd:enumeration value="VeryInterested"/>
		</xsd:restriction>
	 </xsd:simpleType>

     <xsd:simpleType name="priorityEnum">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL 'Priority' parameter enumeration values as detailed in PAL V1.0 Enabler
			 Technical Specification, section "PAL Client/Server Interaction".
		   </xsd:documentation>
        </xsd:annotation>

	    <xsd:restriction base="xsd:token">
		   <xsd:enumeration value="Low"/>
           <xsd:enumeration value="Medium"/>
		   <xsd:enumeration value="High"/>
		</xsd:restriction>
	 </xsd:simpleType>

     <xsd:simpleType name="suspEventHandlingEnum">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL 'SuspendEventHandling' enumeration values as detailed in PAL V1.0 Enabler
			 Technical Specification, section "PAL Client/Server Interaction".
		   </xsd:documentation>
        </xsd:annotation>

	    <xsd:restriction base="xsd:token">
		   <xsd:enumeration value="Ignore"/>
           <xsd:enumeration value="Capture"/>
		</xsd:restriction>
	 </xsd:simpleType>

     <xsd:complexType name="basePresenceContextType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL Presence Context base type.
		   </xsd:documentation>
        </xsd:annotation>

		<xsd:sequence>
		   <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>

        <xsd:attribute name="service-id" type="xsd:anyURI" use="required"/>
     </xsd:complexType>

     <xsd:complexType name="establishPresenceContextType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL Presence Context type.
		     A data element provided as an input for requesting a PAL Server to establish a
		     PAL Presence Context on behalf of a PAL Client.
		   </xsd:documentation>
        </xsd:annotation>

		<xsd:complexContent>
		    <xsd:extension base="pa:basePresenceContextType">
                <xsd:sequence>
					<xsd:element name="presentity" type="pa:aspectRequestType" minOccurs="0" maxOccurs="unbounded"/>
				</xsd:sequence>

        		<xsd:attribute name="pal-client-id" type="xsd:anyURI" use="required"/>
				<xsd:attribute name="quality-of-service" type="pa:qosEnum"/>
				<xsd:attribute name="verbose" type="xsd:boolean" default="false"/>
	    		<xsd:anyAttribute processContents="lax"/>
			</xsd:extension>
		</xsd:complexContent>
     </xsd:complexType>

     <xsd:complexType name="briefPresenceContextType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL Presence Context brief (i.e. non-verbose) type.
		     A data element returned as a result of a request to establish a
		     PAL Presence Context on behalf of a PAL Client with an indicator
		     to provide only a brief or non-verbose PAL Presence Context result.
		   </xsd:documentation>
        </xsd:annotation>

		<xsd:complexContent>
		    <xsd:extension base="pa:basePresenceContextType">
			    <xsd:sequence>
				   <xsd:element name="aspect-response" type="pa:aspectResponseType" minOccurs="0" maxOccurs="unbounded"/>
				</xsd:sequence>

        		<xsd:attribute name="presence-context-id" type="xsd:anyURI" use="required"/>
	    		<xsd:attribute name="version" type="xsd:token"/>
	    		<xsd:anyAttribute processContents="lax"/>
			</xsd:extension>
		</xsd:complexContent>
     </xsd:complexType>

     <xsd:complexType name="verbosePresenceContextType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL Presence Context extended (i.e. verbose) type.
		     A data element returned as a result of a request to establish a
		     PAL Presence Context on behalf of a PAL Client with an indicator
		     to provide a more detailed PAL Presence Context result.
		   </xsd:documentation>
        </xsd:annotation>

		<xsd:complexContent>
		    <xsd:extension base="pa:briefPresenceContextType">
               <xsd:sequence>
       			  <xsd:element name="aspects" type="pp:palAspects"/>
       			  <xsd:element name="triggers" type="pp:palTriggers" minOccurs="0"/>
			   </xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	 </xsd:complexType>

     <xsd:complexType name="presenceContextActionEntryType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL Presence Context action-entry type.
		     A data element utilized as input for an 'action' request 
			 or response (e.g. to suspend one or more Presence Contexts).
		   </xsd:documentation>
        </xsd:annotation>

    	<xsd:attribute name="presence-context-id" type="xsd:anyURI" use="required"/>
       	<xsd:attribute name="duration" type="xsd:integer"/>
		<xsd:attribute name="suspend-event-handling" type="pa:suspEventHandlingEnum"/>
	 </xsd:complexType>

     <xsd:complexType name="presenceContextRequestListType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL Presence Context request type.
		     A data element provided as an input for requesting actions against 
			 one or more PAL Presence Contexts on behalf of a PAL Client.
		   </xsd:documentation>
        </xsd:annotation>

        <xsd:sequence>
			<xsd:element name="pcEntry" type="pa:presenceContextActionEntryType" minOccurs="1" maxOccurs="unbounded"/>
		</xsd:sequence>
     </xsd:complexType>

     <xsd:complexType name="presenceContextResponseListType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL Presence Context response type.
		     A data element provided as a result of requesting actions against 
			 one or more PAL Presence Contexts on behalf of a PAL Client.
		   </xsd:documentation>
        </xsd:annotation>

        <xsd:sequence>
			<xsd:element name="pcEntry" type="pa:presenceContextActionEntryType" minOccurs="1" maxOccurs="unbounded"/>
		</xsd:sequence>
     </xsd:complexType>

	 <xsd:complexType name="errorResponseType">
	    <xsd:annotation>
		   <xsd:documentation xml:lang="en">
		     PAL error response type.
			 A data element provided as a result of a non-protocol (i.e. PAL Service level)
			 error.
		   </xsd:documentation>
		</xsd:annotation>

		<xsd:sequence>
		   <xsd:element name="status-code" type="xsd:integer"/>
		   <xsd:element name="message" type="xsd:normalizedString"/>
		</xsd:sequence>

        <xsd:attribute name="pal-client-id" type="xsd:anyURI" use="required"/>
	    <xsd:attribute name="presence-context-id" type="xsd:anyURI"/>
	    <xsd:anyAttribute processContents="lax"/>
	 </xsd:complexType>

     <xsd:complexType name="aspectRequestType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL Presence Aspect request type.
		     A data element used to request Presence Aspects relative to a 
			 given Presence Context on behalf of a PAL Client.
		   </xsd:documentation>
        </xsd:annotation>

		<xsd:sequence>
		   <xsd:element name="aspectPresentity" type="pa:presentityType" minOccurs="1" maxOccurs="unbounded"/>
		   <xsd:element name="aspectValueRequest" type="pa:aspectValueListType" maxOccurs="unbounded"/>
		</xsd:sequence>

	    <xsd:attribute name="presence-context-id" type="xsd:anyURI"/>
	    <xsd:anyAttribute processContents="lax"/>
	 </xsd:complexType>

     <xsd:complexType name="aspectResponseType">
	    <xsd:annotation>
		   <xsd:documentation xml:lang="en">
		     PAL Presence Aspect response type.
			 A data element used to return Presence Aspects relative to a 
			 Presence entity for a given Presence Context (i.e. Presence Aware Service or
			 Class of Service).
		   </xsd:documentation>
		</xsd:annotation>

	    <xsd:sequence>
		    <xsd:element name="entity" type="pa:aspectValueType" maxOccurs="unbounded"/>
		</xsd:sequence>

		<xsd:attribute name="presence-context-id" type="xsd:anyURI"/>
	 </xsd:complexType>

     <xsd:complexType name="palRequestType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL request type of which a PAL Client chooses exactly one of the
			 possible PAL Client request types.  
		   </xsd:documentation>
        </xsd:annotation>

		<xsd:choice>
		   <xsd:element name="establish-pres-context" type="pa:establishPresenceContextType"/>
		   <xsd:element name="terminate-pres-context" type="pa:presenceContextRequestListType"/>
		   <xsd:element name="pres-aspect"            type="pa:aspectRequestType"/>
		   <xsd:element name="suspend-pres-context"   type="pa:presenceContextRequestListType"/>
		   <xsd:element name="resume-pres-context"    type="pa:presenceContextRequestListType"/>
		</xsd:choice>

	    <xsd:anyAttribute processContents="lax"/>
	 </xsd:complexType>

     <xsd:complexType name="palResponseType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL response type of which a PAL Server chooses exactly one of the
			 possible PAL Client response types.  A PAL Server may also choose exactly one of
			 these response types for a pre-defined action corresponding to a Presence Trigger.  
		   </xsd:documentation>
        </xsd:annotation>

		<xsd:choice>
		   <xsd:element name="bpres-context"              type="pa:briefPresenceContextType"/>
           <xsd:element name="pres-context"               type="pa:verbosePresenceContextType"/>
		   <xsd:element name="terminate-pres-context-ack" type="pa:presenceContextResponseListType"/>
		   <xsd:element name="pres-aspect-resp"           type="pa:aspectResponseType"/>
		   <xsd:element name="suspend-pres-context-ack"   type="pa:presenceContextResponseListType"/>
		   <xsd:element name="resume-pres-context-ack"    type="pa:presenceContextResponseListType"/>
		   <xsd:element name="pres-trigger-async-notify"  type="pa:aspectResponseType"/>
		   <xsd:element name="err-response"               type="pa:errorResponseType"/>
		</xsd:choice>

	    <xsd:anyAttribute processContents="lax"/>
	 </xsd:complexType>

     <xsd:complexType name="msgPayloadType">
        <xsd:annotation>
	       <xsd:documentation xml:lang="en">
		     PAL message payload type.  A PAL Client or Server chooses exactly one of either a request or
			 response type.  A PAL message payload type corresponds to
			 a message payload of the 'application/vnd.oma.pal+xml' MIME-type.
		   </xsd:documentation>
        </xsd:annotation>

		<xsd:choice>
		   <xsd:element name="pal-request" type="pa:palRequestType"/>
		   <xsd:element name="pal-response" type="pa:palResponseType"/>
		</xsd:choice>
	    <xsd:anyAttribute processContents="lax"/>
	 </xsd:complexType>

	 <xsd:element name="pal-message" type="pa:msgPayloadType"/>
</xsd:schema>
