<?xml version="1.0" encoding="UTF-8"?>
<xs:schema version="1.0"
  
  xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="api" type="api"/>
  <xs:element name="attachment" type="attachment"/>
  <xs:element name="comment" type="comment"/>
  <xs:element name="comment_reference" type="comment_reference"/>
  <xs:element name="global_preferences" type="global_preferences"/>
  <xs:element name="group" type="group"/>
  <xs:element name="history_stamp" type="history_stamp"/>
  <xs:element name="link" type="link"/>
  <xs:element name="notification" type="notification"/>
  <xs:element name="notification_preferences" type="notification_preferences"/>
  <xs:element name="results" type="results"/>
  <xs:element name="principal_reference" type="principal_reference"/>
  <xs:element name="reference" type="reference"/>
  <xs:element name="room" type="room"/>
  <xs:element name="room_feed_item" type="room_feed_item"/>
  <xs:element name="room_membership" type="room_membership"/>
  <xs:element name="room_membership_operation" type="room_membership_operation"/>
  <xs:element name="room_preferences" type="room_preferences"/>
  <xs:element name="room_reference" type="room_reference"/>
  <xs:element name="topic" type="topic"/>
  <xs:element name="topic_reference" type="topic_reference"/>
  <xs:element name="node" type="node"/>
  <xs:element name="user" type="user"/>
  <xs:element name="user_reference" type="user_reference"/>
  <xs:element name="user_room_details" type="user_room_details"/>
<xs:complexType name="api">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A base class for many of the REST data types.]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
              <xs:element name="href" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The path to this resource object.  This is relative to the root of the REST API (https://serveraddress/rest).]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
        <xs:element name="links" minOccurs="0">
          <xs:annotation>
            <xs:documentation>
              <![CDATA[Links to related resources.  These should be used to navigate the REST API (instead of hard-coding the URLs)]]>
            </xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="link" type="link" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Links to related resources.  These should be used to navigate the REST API (instead of hard-coding the URLs)]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="attachment">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Represents a file that is attached to a topic or comment.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="api">
      <xs:sequence>
              <xs:element name="id" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The ID of the attachment.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="name" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The file name.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="creation" type="history_stamp" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The date and time that the comment was created and the user who created it.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="length" type="xs:long" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The file size in bytes.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="md5" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The MD5 checksum.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="comment">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Represents a reply to a topic within a room.

<p>Although user can comment on a specific comment within a topic,
it doesn't constitute a nested hierarchy. Instead, the comments
are maintained in flat and sequential manner within the topic.</p>]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="api">
      <xs:sequence>
              <xs:element name="id" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The ID of the comment.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="room" type="room_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="topic" type="topic_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The topic this comment belongs to.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="parent_comment" type="comment_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The parent of this comment.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="creation" type="history_stamp" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The date and time that the comment was created and the user who created it.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="modification" type="history_stamp" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The date and time that the comment was last modified and the user who modified it.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="body" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The comment body.  This is plain text.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="attachments" type="attachment" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Files that are attached to the comment.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="comment_count" type="xs:int" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The total number of sub-comments on this comments, including comments on sub-comments.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
        <xs:element name="directed_to" minOccurs="0">
          <xs:annotation>
            <xs:documentation>
              <![CDATA[List of users to whom the topic is directed.  Currently, this includes just the user who created the parent topic or comment.]]>
            </xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="user" type="user_reference" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[List of users to whom the topic is directed.  Currently, this includes just the user who created the parent topic or comment.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="comment_reference">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A reference to a comment.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="reference">
      <xs:sequence>
              <xs:element name="topic_id" type="xs:string" minOccurs="0">
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="global_preferences">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A user's global preferences.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="api">
      <xs:sequence>
              <xs:element name="user" type="user_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[A reference to the user.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="topic_sort_mode" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Sort order for topics.  Allowed values are <code>ascending</code> and <code>descending</code>.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="show_onboarding" type="xs:boolean" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Whether to show the on-boarding experience on login.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="group">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Metadata of a group.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="api">
      <xs:sequence>
              <xs:element name="id" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The ID of the room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="display_name" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The name of the room.  This must be unique.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="description" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[An optional description of the room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="source" type="principalSource" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The source of this group.  Can be <code>ldap</code> or <code>local</code>.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="history_stamp">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Represents a date and time when a user performed an action.]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
              <xs:element name="user" type="user_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[A reference to the user.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="date" type="xs:string" minOccurs="0">
              </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="link">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A link to a related resource.]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
              <xs:element name="href" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The path to the resource.  This is relative to the root of the REST API (https://serveraddress/rest).]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="rel" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The named relationship of the related link.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="message_counts">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Contains a total number of messages and a number of directed messages.]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
              <xs:element name="directed" type="xs:int" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The number of messages directed to a user.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="total" type="xs:int" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The total number of messages.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="notification">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Contains details of some action that occurred in the system that should be of particular interest
to the recipient of the notification.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="api">
      <xs:sequence>
              <xs:element name="id" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The ID of the notification.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="type" type="notification_type" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[A type representing the performed action.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="date" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The date the action was performed.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="recipient" type="user_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The user who receives notification of the action.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="actor" type="user_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The user who performed the action.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="room" type="room_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[A reference to the room associated with the action.  Not all notification action types are associated with a room.
In those cases, the notification does not contain a room reference.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="referenced_entity" type="xs:anyType" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The entity associated with the notification.  The type of entity depends on the notification action type.
<ul>
<li><code>addMembership</code>: The room to which the user was added.</li>
<li><code>referencedInComment</code>: The comment in which the user was mentioned.</li>
<li><code>replyToTopic</code>: The comment in reply to the user's topic.</li>
<li><code>replyToComment</code>: The comment in reply to the user's comment.</li>
</ul>]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:simpleType name="notification_type">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Represents the type of action that resulted in the generation of a notification.]]>
    </xs:documentation>
  </xs:annotation>
  <xs:restriction base="xs:string">
     
    <xs:enumeration value="addMembership"/>
 
    <xs:enumeration value="referencedInComment"/>
 
    <xs:enumeration value="replyToTopic"/>
 
    <xs:enumeration value="replyToComment"/>
 
    <xs:enumeration value="addTopic"/>
 
    <xs:enumeration value="addComment"/>
 
    <xs:enumeration value="editTopic"/>
 
    <xs:enumeration value="editComment"/>
  </xs:restriction>
</xs:simpleType>

<xs:complexType name="notification_preferences">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Notification preferences.]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
              <xs:element name="email_mode" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Which events should result in email notifications.  Allowed values are <code>all_activity</code>, <code>directed_messages</code> and <code>none</code>.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="in_app_mode" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Which events should result in in-app notifications.  Allowed values are <code>all_activity</code>, <code>directed_messages</code> and <code>none</code>.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="results">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A list of objects or a portion of the full list.]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
              <xs:element name="first" type="xs:int" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The 0-based index of the first result included in the list.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="count" type="xs:int" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The number of results returned.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="total" type="xs:int" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The total number of matching results.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="next" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Path that can be used to retrieve the next page of results.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
        <xs:element name="items" minOccurs="0">
          <xs:annotation>
            <xs:documentation>
              <![CDATA[The list of results.]]>
            </xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="item" type="xs:anyType" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The list of results.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="principal_reference">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A reference to a user or group.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="reference">
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:simpleType name="principalSource">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Created by david on 9/6/17.]]>
    </xs:documentation>
  </xs:annotation>
  <xs:restriction base="xs:string">
     
    <xs:enumeration value="local"/>
 
    <xs:enumeration value="ldap"/>
  </xs:restriction>
</xs:simpleType>

<xs:complexType name="reference">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A reference to another resource.]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
              <xs:element name="href" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The path to the resource.  This is relative to the root of the REST API (https://serveraddress/rest).]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="id" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The ID of the resource]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="type" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The type of the resource]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="room">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Metadata of a room.


<p>A room represents a place where users can have discussions and keep files.</p>

<p>There are two types of rooms:
<ul>
<li>public: open for all users to see and participate in</li>
<li>private: only visible to the room members</li>
</ul>
</p>]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="api">
      <xs:sequence>
              <xs:element name="id" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The ID of the room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="display_name" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The name of the room.  This must be unique.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="description" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[An optional description of the room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="type" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The type of room.  Valid types are 'public' and 'private'.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="creation" type="history_stamp" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The date and time that the topic was created and the user who created it.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="owner" type="user_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The owner of the room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="room_feed_item">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A room feed item, consisting of a topic and new message counts since the user last visited the room.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="api">
      <xs:sequence>
              <xs:element name="topic" type="topic" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The Topic.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="last_visit_date" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Date and time the user last visited the room.  It is the responsibility of clients to set this date
when the user visits the room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="messages_since_last_visit" type="message_counts" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[New comment counts since the user last visited the room.  The counts are only present if the user's
<count>last_visit_date</count> has been set for the room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="room_membership">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Represents a user's or group's membership in a room.]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
              <xs:element name="href" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The path to this resource object.  This is relative to the root of the REST API (https://serveraddress/rest).]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="room" type="room_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[A reference to the Room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="member" type="principal_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[A reference to the user or group.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="role" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The role the user or group has been assigned in the room.  Valid values are <code>admin</code>, <code>member</code> and <code>public_participant</code>.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="room_membership_operation">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[An operation to apply to a room's membership.]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
              <xs:element name="membership" type="room_membership" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The membership object to create, update or delete.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="method" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The method.  Valid values are <code>POST</code>(create) and <code>DELETE</code>]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="room_preferences">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A user's room-specific preferences.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="api">
      <xs:sequence>
              <xs:element name="room" type="room_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[A reference to the Room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="member" type="principal_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[A reference to the user.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="notifications" type="notification_preferences" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The user's notification preferences.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="room_reference">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A reference to a room.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="reference">
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="topic">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Topic represents a top level message within a room.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="api">
      <xs:sequence>
              <xs:element name="id" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The ID of the topic.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="room" type="room_reference" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="creation" type="history_stamp" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The date and time that the topic was created and the user who created it.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="modification" type="history_stamp" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The date and time that the topic was last modified and the user who modified it.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="last_activity_date" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[A date representing the last time activity occurred in this topic or a child comment.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="body" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The topic body.  This is plain text.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="attachments" type="attachment" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Files that are attached to the topic.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="comment_count" type="xs:int" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The total number of comments in this topic, including comments on other comments.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
        <xs:element name="directed_to" minOccurs="0">
          <xs:annotation>
            <xs:documentation>
              <![CDATA[List of users to whom the topic is directed.]]>
            </xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="user" type="user_reference" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[List of users to whom the topic is directed.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="topic_reference">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A reference to a topic.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="reference">
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="node">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Node in a <code>Tree</code>.]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
        <xs:element name="children" minOccurs="0">
          <xs:annotation>
            <xs:documentation>
              <![CDATA[Child nodes.]]>
            </xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="node" type="node" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Child nodes.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
              <xs:element name="entity" type="xs:anyType" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The entity associated with this node.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="user">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A user]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="api">
      <xs:sequence>
              <xs:element name="first_name" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The user's first name.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="display_name" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The user's full display name.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="id" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[A unique ID for the user.  This is assigned by the system.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="last_name" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The user's last name.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="login_name" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The user's login name.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="email" type="xs:string" minOccurs="0">
              </xs:element>
              <xs:element name="file_size_limit" type="xs:long" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The maximum file size, in bytes, that the user is allowed to upload.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="avatar" type="api" minOccurs="0">
              </xs:element>
              <xs:element name="source" type="principalSource" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The source of this user.  Can be <code>ldap</code> or <code>local</code>.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="user_reference">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[A reference to a user.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="principal_reference">
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="user_room_details">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[User-specific details for a room, including the last time the user visited the room and the number of new messages in the room
since the user last visited.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="api">
      <xs:sequence>
              <xs:element name="room" type="room" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[The Room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="last_visit_date" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Date and time the user last visited the room.  It is the responsibility of clients to set this date
when the user visits the room.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="messages_since_last_visit" type="message_counts" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Message counts since the user last visited the room.  The message counts are only present if the user's
<count>last_visit_date</count> has been set.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

</xs:schema>