<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="types"
		elementFormDefault="qualified"
		version="Exchange2007_SP1"
		xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
		targetNamespace="http://schemas.microsoft.com/exchange/services/2006/types"
		xmlns:tns="http://schemas.microsoft.com/exchange/services/2006/types"
		xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:import namespace="http://www.w3.org/XML/1998/namespace"/>

  <!-- SOAP header to indicate language for mailbox interaction-->
  <xs:element name="MailboxCulture" type="xs:language"/>

  <!-- Server to Server auth SOAP header information -->
  <xs:complexType name="SidAndAttributesType">
    <xs:sequence>
      <xs:element name="SecurityIdentifier" type="xs:string"/>
    </xs:sequence>
    <xs:attribute name="Attributes" type="xs:unsignedInt" use="required"/>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfGroupIdentifiersType">
    <xs:sequence>
      <xs:element name="GroupIdentifier" type="t:SidAndAttributesType" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfRestrictedGroupIdentifiersType">
    <xs:sequence>
      <xs:element name="RestrictedGroupIdentifier" type="t:SidAndAttributesType" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="SerializedSecurityContextType">
    <xs:sequence>
      <xs:element name="UserSid" type="xs:string"/>
      <xs:element name="GroupSids" type="t:NonEmptyArrayOfGroupIdentifiersType" minOccurs="0"/>
      <xs:element name="RestrictedGroupSids" type="t:NonEmptyArrayOfRestrictedGroupIdentifiersType" minOccurs="0"/>
      <xs:element name="PrimarySmtpAddress" type="xs:string" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="SerializedSecurityContext" type="t:SerializedSecurityContextType"/>

  <xs:complexType name="ConnectingSIDType">
    <xs:sequence>
      <xs:element name="PrincipalName" type="xs:string" minOccurs="0"/>
      <xs:element name="SID" type="xs:string" minOccurs="0"/>
      <xs:element name="PrimarySmtpAddress" type="xs:string" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ExchangeImpersonationType">
    <xs:sequence>
      <xs:element name="ConnectingSID" type="t:ConnectingSIDType" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ExchangeImpersonation" type="t:ExchangeImpersonationType" />

  <!-- Enumeration of Exchange Server versions -->
  <xs:simpleType name="ExchangeVersionType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Exchange2007" />
      <xs:enumeration value="Exchange2007_SP1" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="ProxySecurityContextType">
    <xs:simpleContent>
      <xs:extension base="xs:base64Binary">
        <xs:anyAttribute namespace="http://schemas.xmlsoap.org/soap/envelope/">
          <xs:annotation>
            <xs:documentation>Allow attributes in the soap namespace to be used here</xs:documentation>
          </xs:annotation>
        </xs:anyAttribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:element name="ProxySecurityContext" type="t:ProxySecurityContextType"/>
  <xs:element name="ProxySuggesterSid" type="t:ProxySecurityContextType"/>

  <!-- Used in the SOAP header of responses for diagnostics purposes. -->
  <xs:element name="ServerVersionInfo">
    <xs:complexType>
      <xs:attribute name="MajorVersion" type="xs:int" use="optional"/>
      <xs:attribute name="MinorVersion" type="xs:int" use="optional"/>
      <xs:attribute name="MajorBuildNumber" type="xs:int" use="optional"/>
      <xs:attribute name="MinorBuildNumber" type="xs:int" use="optional"/>
      <xs:attribute name="Version" type="xs:string" use="optional"/>
    </xs:complexType>
  </xs:element>

  <!-- Used in the SOAP header of requests to specify version for request. -->
  <xs:element name="RequestServerVersion">
    <xs:complexType>
      <xs:attribute name="Version" type="t:ExchangeVersionType" fixed="Exchange2007_SP1" use="required"/>
      <xs:anyAttribute namespace="http://schemas.xmlsoap.org/soap/envelope/">
        <xs:annotation>
          <xs:documentation>Allow attributes in the soap namespace to be used here</xs:documentation>
        </xs:annotation>
      </xs:anyAttribute>
    </xs:complexType>
  </xs:element>

  <!-- Email address/participant types -->

  <xs:simpleType name="NonEmptyStringType">
    <xs:restriction base="xs:string">
      <xs:minLength value="1" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="BaseEmailAddressType" />

  <xs:simpleType name="MailboxTypeType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Mailbox" />
      <xs:enumeration value="PublicDL" />
      <xs:enumeration value="PrivateDL" />
      <xs:enumeration value="Contact" />
      <xs:enumeration value="PublicFolder"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="EmailAddressType">
    <xs:annotation>
      <xs:documentation>Identifier for a fully resolved email address</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:BaseEmailAddressType">
        <xs:sequence>
          <xs:element name="Name" type="xs:string" minOccurs="0"/>
          <xs:element name="EmailAddress" type="t:NonEmptyStringType" minOccurs="0"/>
          <xs:element name="RoutingType" type="t:NonEmptyStringType" minOccurs="0"/>
          <xs:element name="MailboxType" type="t:MailboxTypeType" minOccurs="0" />
          <xs:element name="ItemId" type="t:ItemIdType" minOccurs="0" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- - - - - - - - - - - - - - - - - - - -->
  <!--            Recipient List           -->
  <!-- - - - - - - - - - - - - - - - - - - -->
  <xs:complexType name="ArrayOfRecipientsType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Mailbox" type="t:EmailAddressType"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="SingleRecipientType">
    <xs:choice>
      <xs:element name="Mailbox" type="t:EmailAddressType"/>
    </xs:choice>
  </xs:complexType>

  <!-- URIs for frequently referenced types -->
  <xs:simpleType name="UnindexedFieldURIType">
    <xs:restriction base="xs:string">
      <!-- Folder fields -->

      <xs:enumeration value="folder:FolderId"/>
      <xs:enumeration value="folder:ParentFolderId"/>
      <xs:enumeration value="folder:DisplayName" />
      <xs:enumeration value="folder:UnreadCount" />
      <xs:enumeration value="folder:TotalCount" />
      <xs:enumeration value="folder:ChildFolderCount" />
      <xs:enumeration value="folder:FolderClass" />
      <xs:enumeration value="folder:SearchParameters"/>
      <xs:enumeration value="folder:ManagedFolderInformation"/>
      <xs:enumeration value="folder:PermissionSet"/>
      <xs:enumeration value="folder:EffectiveRights"/>
      <!-- Item fields -->

      <xs:enumeration value="item:ItemId"/>
      <xs:enumeration value="item:ParentFolderId"/>
      <xs:enumeration value="item:ItemClass" />
      <xs:enumeration value="item:MimeContent"/>
      <xs:enumeration value="item:Attachments" />
      <xs:enumeration value="item:Subject" />
      <xs:enumeration value="item:DateTimeReceived" />
      <xs:enumeration value="item:Size" />
      <xs:enumeration value="item:Categories" />
      <xs:enumeration value="item:HasAttachments"/>
      <xs:enumeration value="item:Importance"/>
      <xs:enumeration value="item:InReplyTo"/>
      <xs:enumeration value="item:InternetMessageHeaders" />
      <xs:enumeration value="item:IsDraft" />
      <xs:enumeration value="item:IsFromMe" />
      <xs:enumeration value="item:IsResend" />
      <xs:enumeration value="item:IsSubmitted" />
      <xs:enumeration value="item:IsUnmodified" />
      <xs:enumeration value="item:DateTimeSent" />
      <xs:enumeration value="item:DateTimeCreated" />
      <xs:enumeration value="item:Body" />
      <xs:enumeration value="item:ResponseObjects"/>
      <xs:enumeration value="item:Sensitivity"/>

      <xs:enumeration value="item:ReminderDueBy"/>
      <xs:enumeration value="item:ReminderIsSet"/>
      <xs:enumeration value="item:ReminderMinutesBeforeStart"/>

      <xs:enumeration value="item:DisplayTo"/>
      <xs:enumeration value="item:DisplayCc"/>

      <xs:enumeration value="item:Culture"/>
      <xs:enumeration value="item:EffectiveRights"/>

      <xs:enumeration value="item:LastModifiedName"/>
      <xs:enumeration value="item:LastModifiedTime"/>

      <!-- Messages -->

      <xs:enumeration value="message:ConversationIndex"/>
      <xs:enumeration value="message:ConversationTopic"/>
      <xs:enumeration value="message:InternetMessageId"/>
      <xs:enumeration value="message:IsRead"/>
      <xs:enumeration value="message:IsResponseRequested"/>
      <xs:enumeration value="message:IsReadReceiptRequested"/>
      <xs:enumeration value="message:IsDeliveryReceiptRequested"/>
      <xs:enumeration value="message:ReceivedBy"/>
      <xs:enumeration value="message:ReceivedRepresenting"/>
      <xs:enumeration value="message:References"/>
      <xs:enumeration value="message:ReplyTo"/>
      <xs:enumeration value="message:From" />
      <xs:enumeration value="message:Sender" />
      <xs:enumeration value="message:ToRecipients" />
      <xs:enumeration value="message:CcRecipients" />
      <xs:enumeration value="message:BccRecipients" />

      <!-- Meeting Message -->

      <xs:enumeration value="meeting:AssociatedCalendarItemId"/>
      <xs:enumeration value="meeting:IsDelegated"/>
      <xs:enumeration value="meeting:IsOutOfDate"/>
      <xs:enumeration value="meeting:HasBeenProcessed"/>
      <xs:enumeration value="meeting:ResponseType"/>

      <!-- Meeting Request -->

      <xs:enumeration value="meetingRequest:MeetingRequestType"/>
      <xs:enumeration value="meetingRequest:IntendedFreeBusyStatus"/>

      <!-- Calendar items and appointments -->

      <xs:enumeration value="calendar:Start"/>
      <xs:enumeration value="calendar:End"/>
      <xs:enumeration value="calendar:OriginalStart"/>
      <xs:enumeration value="calendar:IsAllDayEvent"/>
      <xs:enumeration value="calendar:LegacyFreeBusyStatus"/>
      <xs:enumeration value="calendar:Location"/>
      <xs:enumeration value="calendar:When"/>
      <xs:enumeration value="calendar:IsMeeting"/>
      <xs:enumeration value="calendar:IsCancelled"/>
      <xs:enumeration value="calendar:IsRecurring"/>
      <xs:enumeration value="calendar:MeetingRequestWasSent"/>
      <xs:enumeration value="calendar:IsResponseRequested"/>
      <xs:enumeration value="calendar:CalendarItemType"/>
      <xs:enumeration value="calendar:MyResponseType"/>
      <xs:enumeration value="calendar:Organizer"/>
      <xs:enumeration value="calendar:RequiredAttendees"/>
      <xs:enumeration value="calendar:OptionalAttendees"/>
      <xs:enumeration value="calendar:Resources"/>
      <xs:enumeration value="calendar:ConflictingMeetingCount"/>
      <xs:enumeration value="calendar:AdjacentMeetingCount"/>
      <xs:enumeration value="calendar:ConflictingMeetings"/>
      <xs:enumeration value="calendar:AdjacentMeetings"/>

      <xs:enumeration value="calendar:Duration"/>
      <xs:enumeration value="calendar:TimeZone"/>
      <xs:enumeration value="calendar:AppointmentReplyTime"/>
      <xs:enumeration value="calendar:AppointmentSequenceNumber"/>
      <xs:enumeration value="calendar:AppointmentState"/>

      <xs:enumeration value="calendar:Recurrence"/>
      <xs:enumeration value="calendar:FirstOccurrence"/>
      <xs:enumeration value="calendar:LastOccurrence"/>
      <xs:enumeration value="calendar:ModifiedOccurrences"/>
      <xs:enumeration value="calendar:DeletedOccurrences"/>
      <xs:enumeration value="calendar:MeetingTimeZone"/>

      <xs:enumeration value="calendar:ConferenceType"/>
      <xs:enumeration value="calendar:AllowNewTimeProposal"/>
      <xs:enumeration value="calendar:IsOnlineMeeting"/>
      <xs:enumeration value="calendar:MeetingWorkspaceUrl"/>
      <xs:enumeration value="calendar:NetShowUrl"/>

      <xs:enumeration value="calendar:UID"/>
      <xs:enumeration value="calendar:RecurrenceId"/>
      <xs:enumeration value="calendar:DateTimeStamp"/>

      <!-- Task properties -->

      <xs:enumeration value="task:ActualWork"/>
      <xs:enumeration value="task:AssignedTime"/>
      <xs:enumeration value="task:BillingInformation"/>
      <xs:enumeration value="task:ChangeCount"/>
      <xs:enumeration value="task:Companies"/>
      <xs:enumeration value="task:CompleteDate"/>
      <xs:enumeration value="task:Contacts"/>
      <xs:enumeration value="task:DelegationState"/>
      <xs:enumeration value="task:Delegator"/>
      <xs:enumeration value="task:DueDate"/>
      <xs:enumeration value="task:IsAssignmentEditable"/>
      <xs:enumeration value="task:IsComplete"/>
      <xs:enumeration value="task:IsRecurring"/>
      <xs:enumeration value="task:IsTeamTask"/>
      <xs:enumeration value="task:Mileage"/>
      <xs:enumeration value="task:Owner"/>
      <xs:enumeration value="task:PercentComplete"/>
      <xs:enumeration value="task:Recurrence"/>
      <xs:enumeration value="task:StartDate"/>
      <xs:enumeration value="task:Status"/>
      <xs:enumeration value="task:StatusDescription"/>
      <xs:enumeration value="task:TotalWork"/>

      <!-- Contacts -->

      <xs:enumeration value="contacts:AssistantName" />
      <xs:enumeration value="contacts:Birthday" />
      <xs:enumeration value="contacts:BusinessHomePage" />
      <xs:enumeration value="contacts:Children" />
      <xs:enumeration value="contacts:Companies" />
      <xs:enumeration value="contacts:CompanyName" />
      <xs:enumeration value="contacts:CompleteName" />
      <xs:enumeration value="contacts:ContactSource" />
      <xs:enumeration value="contacts:Culture" />
      <xs:enumeration value="contacts:Department" />
      <xs:enumeration value="contacts:DisplayName" />
      <xs:enumeration value="contacts:EmailAddresses" />
      <xs:enumeration value="contacts:FileAs" />
      <xs:enumeration value="contacts:FileAsMapping" />
      <xs:enumeration value="contacts:Generation" />
      <xs:enumeration value="contacts:GivenName" />
      <xs:enumeration value="contacts:ImAddresses" />
      <xs:enumeration value="contacts:Initials" />
      <xs:enumeration value="contacts:JobTitle" />
      <xs:enumeration value="contacts:Manager" />
      <xs:enumeration value="contacts:MiddleName" />
      <xs:enumeration value="contacts:Mileage" />
      <xs:enumeration value="contacts:Nickname" />
      <xs:enumeration value="contacts:OfficeLocation" />
      <xs:enumeration value="contacts:PhoneNumbers" />
      <xs:enumeration value="contacts:PhysicalAddresses" />
      <xs:enumeration value="contacts:PostalAddressIndex" />
      <xs:enumeration value="contacts:Profession" />
      <xs:enumeration value="contacts:SpouseName" />
      <xs:enumeration value="contacts:Surname" />
      <xs:enumeration value="contacts:WeddingAnniversary" />

      <!-- Post item -->
      <xs:enumeration value="postitem:PostedTime"/>
      <!-- Note: The following message Field URIs are also valid for a postitem:
                             message:ConversationIndex
                             message:ConversationTopic
                             message:From
                             message:InternetMessageId
                             message:References
                             message:Sender
      -->

    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DictionaryURIType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="item:InternetMessageHeader" />
      <xs:enumeration value="contacts:ImAddress" />
      <xs:enumeration value="contacts:PhysicalAddress:Street" />
      <xs:enumeration value="contacts:PhysicalAddress:City" />
      <xs:enumeration value="contacts:PhysicalAddress:State" />
      <xs:enumeration value="contacts:PhysicalAddress:CountryOrRegion" />
      <xs:enumeration value="contacts:PhysicalAddress:PostalCode" />
      <xs:enumeration value="contacts:PhoneNumber" />
      <xs:enumeration value="contacts:EmailAddress" />
    </xs:restriction>
  </xs:simpleType>

  <!-- URIs for property types used in MessageXml -->
  <xs:simpleType name="ExceptionPropertyURIType">
    <xs:restriction base="xs:string">
      <!-- Attachment fields -->

      <xs:enumeration value="attachment:Name"/>
      <xs:enumeration value="attachment:ContentType"/>
      <xs:enumeration value="attachment:Content" />

      <!-- Recurrence fields -->

      <xs:enumeration value="recurrence:Month"/>
      <xs:enumeration value="recurrence:DayOfWeekIndex"/>
      <xs:enumeration value="recurrence:DaysOfWeek" />
      <xs:enumeration value="recurrence:DayOfMonth"/>
      <xs:enumeration value="recurrence:Interval" />
      <xs:enumeration value="recurrence:NumberOfOccurrences" />

      <xs:enumeration value="timezone:Offset" />

    </xs:restriction>
  </xs:simpleType>

  <!-- path types -->
  <xs:simpleType name="GuidType">
    <xs:annotation>
      <xs:documentation>
        The regular expression captures the standard representation of a GUID
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DistinguishedPropertySetType">
    <xs:annotation>
      <xs:documentation>
        Defines the well known property set ids for extended properties.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="Meeting"/>
      <xs:enumeration value="Appointment"/>
      <xs:enumeration value="Common"/>
      <xs:enumeration value="PublicStrings"/>
      <xs:enumeration value="Address"/>
      <xs:enumeration value="InternetHeaders"/>
      <xs:enumeration value="CalendarAssistant"/>
      <xs:enumeration value="UnifiedMessaging"/>
      <xs:enumeration value="Task"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="MapiPropertyTypeType">
    <xs:annotation>
      <xs:documentation>
        Includes all of the extended property types that we support.  Note that Error, Null,
        Object and Object array can not be used in restrictions, or for setting/getting values.
        They are only there for error reporting purposes.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="ApplicationTime"/>
      <xs:enumeration value="ApplicationTimeArray"/>
      <xs:enumeration value="Binary"/>
      <xs:enumeration value="BinaryArray"/>
      <xs:enumeration value="Boolean"/>
      <xs:enumeration value="CLSID"/>
      <xs:enumeration value="CLSIDArray"/>
      <xs:enumeration value="Currency"/>
      <xs:enumeration value="CurrencyArray"/>
      <xs:enumeration value="Double"/>
      <xs:enumeration value="DoubleArray"/>
      <xs:enumeration value="Error"/>
      <xs:enumeration value="Float"/>
      <xs:enumeration value="FloatArray"/>
      <xs:enumeration value="Integer"/>
      <xs:enumeration value="IntegerArray"/>
      <xs:enumeration value="Long"/>
      <xs:enumeration value="LongArray"/>
      <xs:enumeration value="Null"/>
      <xs:enumeration value="Object"/>
      <xs:enumeration value="ObjectArray"/>
      <xs:enumeration value="Short"/>
      <xs:enumeration value="ShortArray"/>
      <xs:enumeration value="SystemTime"/>
      <xs:enumeration value="SystemTimeArray"/>
      <xs:enumeration value="String"/>
      <xs:enumeration value="StringArray"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="BasePathToElementType" abstract="true"/>

  <xs:complexType name="PathToUnindexedFieldType">
    <xs:complexContent>
      <xs:extension base="t:BasePathToElementType">
        <xs:attribute name="FieldURI" type="t:UnindexedFieldURIType" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PathToIndexedFieldType">
    <xs:complexContent>
      <xs:extension base="t:BasePathToElementType">
        <xs:attribute name="FieldURI" type="t:DictionaryURIType" use="required" />
        <xs:attribute name="FieldIndex" type="xs:string" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PathToExceptionFieldType">
    <xs:complexContent>
      <xs:extension base="t:BasePathToElementType">
        <xs:attribute name="FieldURI" type="t:ExceptionPropertyURIType" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:simpleType name="PropertyTagType">
    <xs:annotation>
      <xs:documentation>
        This type represents the property tag (MINUS the type part).  There are two options
        for representation:
        1.  Hex ==> 0x3fa4
        2.  Decimal ==> 0-65535
      </xs:documentation>
    </xs:annotation>
    <xs:union memberTypes ="xs:unsignedShort">
      <xs:simpleType id="HexPropertyTagType">
        <xs:restriction base="xs:string">
          <xs:pattern value="(0x|0X)[0-9A-Fa-f]{1,4}"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>

  <xs:complexType name="PathToExtendedFieldType">
    <xs:annotation>
      <xs:documentation>
        Represents an extended property.  Note that there are only a couple of valid attribute
        combinations.  Note that all occurrences require the PropertyType attribute.

        1.  (DistinguishedPropertySetId || PropertySetId) + (PropertyName || Property Id)
        2.  PropertyTag

      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:BasePathToElementType">
        <xs:attribute name="DistinguishedPropertySetId" type="t:DistinguishedPropertySetType" use="optional"/>
        <xs:attribute name="PropertySetId" type="t:GuidType" use="optional"/>
        <xs:attribute name="PropertyTag" type="t:PropertyTagType" use="optional"/>
        <xs:attribute name="PropertyName" type="xs:string" use="optional"/>
        <xs:attribute name="PropertyId" type="xs:int" use="optional"/>
        <xs:attribute name="PropertyType" type="t:MapiPropertyTypeType" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="Path" abstract="true" type="t:BasePathToElementType"/>
  <xs:element name="FieldURI" type="t:PathToUnindexedFieldType" substitutionGroup="t:Path"/>
  <xs:element name="IndexedFieldURI" type="t:PathToIndexedFieldType" substitutionGroup="t:Path" />
  <xs:element name="ExtendedFieldURI" type="t:PathToExtendedFieldType" substitutionGroup="t:Path"/>

  <!-- For errors only, identifies fields that do not have a uri. -->
  <xs:element name="ExceptionFieldURI" type="t:PathToExceptionFieldType" />

  <!-- Arrays of paths -->
  <xs:complexType name="NonEmptyArrayOfPathsToElementType">
    <!-- using choice here so that proxy generator will not flatten the array and thus lose the
		item element names -->
    <xs:choice maxOccurs ="unbounded">
      <xs:element ref="t:Path"/>
    </xs:choice>
  </xs:complexType>

  <!-- ExtendedProperty value instances -->

  <xs:complexType name="NonEmptyArrayOfPropertyValuesType">
    <xs:choice>
      <xs:element name="Value" type="xs:string" maxOccurs="unbounded"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="ExtendedPropertyType">
    <xs:annotation>
      <xs:documentation>
        Represents an extended property instance (both its path identifier along with its
        associated value).
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="ExtendedFieldURI" type="t:PathToExtendedFieldType"/>
      <xs:choice>
        <xs:element name="Value" type="xs:string"/>
        <xs:element name="Values" type="t:NonEmptyArrayOfPropertyValuesType"/>
      </xs:choice>
    </xs:sequence>
  </xs:complexType>

  <!-- Query Traversal types -->
  <xs:simpleType name="FolderQueryTraversalType">
    <xs:annotation>
      <xs:documentation>Types of sub-tree traversal for deletion and enumeration</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="Shallow" />
      <xs:enumeration value="Deep" />
      <xs:enumeration value="SoftDeleted" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="SearchFolderTraversalType">
    <xs:annotation>
      <xs:documentation>Types of sub-tree traversal for deletion and enumeration</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="Shallow" />
      <xs:enumeration value="Deep" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ItemQueryTraversalType">
    <xs:annotation>
      <xs:documentation>Types of sub-tree traversal for deletion and enumeration</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="Shallow" />
      <xs:enumeration value="SoftDeleted" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Default shape names for response shapes -->
  <xs:simpleType name="DefaultShapeNamesType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="IdOnly" />
      <xs:enumeration value="Default" />
      <xs:enumeration value="AllProperties" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="BodyTypeResponseType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Best" />
      <xs:enumeration value="HTML" />
      <xs:enumeration value="Text" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Placeholder type from which all folder shape properties are to be derived -->
  <xs:complexType name="FolderResponseShapeType">
    <xs:sequence>
      <xs:element name="BaseShape" type="t:DefaultShapeNamesType" />
      <xs:element name="AdditionalProperties" type="t:NonEmptyArrayOfPathsToElementType" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ItemResponseShapeType">
    <xs:sequence>
      <xs:element name="BaseShape" type="t:DefaultShapeNamesType" />
      <xs:element name="IncludeMimeContent" type="xs:boolean" minOccurs="0" />
      <xs:element name="BodyType" type="t:BodyTypeResponseType" minOccurs="0" />
      <xs:element name="AdditionalProperties" type="t:NonEmptyArrayOfPathsToElementType" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="AttachmentResponseShapeType">
    <xs:sequence>
      <xs:element name="IncludeMimeContent" type="xs:boolean" minOccurs="0" />
      <xs:element name="BodyType" type="t:BodyTypeResponseType" minOccurs="0" />
      <xs:element name="AdditionalProperties" type="t:NonEmptyArrayOfPathsToElementType" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="DisposalType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="HardDelete" />
      <xs:enumeration value="SoftDelete" />
      <xs:enumeration value="MoveToDeletedItems" />
    </xs:restriction>
  </xs:simpleType>

  <!-- auto-conflict resolution levels -->
  <xs:simpleType name="ConflictResolutionType">
    <xs:annotation>
      <xs:documentation>Type of conflict resolution to attempt during update</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="NeverOverwrite" />
      <xs:enumeration value="AutoResolve" />
      <xs:enumeration value="AlwaysOverwrite" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ResponseClassType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Success" />
      <xs:enumeration value="Warning" />
      <xs:enumeration value="Error" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Core update operations -->
  <xs:complexType name="ChangeDescriptionType" abstract="true">
    <!-- This path element needs some explanation.  For update operations, only ONE
			property can be modified within a single request.  That single property must be
			referenced in the Path element.  The Item/Folder element in the derived classes
			can then only hold a single property that is in agreement with the single path
			element-->
    <xs:sequence>
      <xs:element ref="t:Path"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ItemChangeDescriptionType">
    <xs:complexContent>
      <xs:extension base="t:ChangeDescriptionType"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="FolderChangeDescriptionType">
    <xs:complexContent>
      <xs:extension base="t:ChangeDescriptionType"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="SetItemFieldType">
    <xs:complexContent>
      <xs:extension base="t:ItemChangeDescriptionType">
        <xs:choice>
          <xs:element name="Item" type="t:ItemType"/>
          <xs:element name="Message" type="t:MessageType"/>
          <xs:element name="CalendarItem" type="t:CalendarItemType"/>
          <xs:element name="Contact" type="t:ContactItemType"/>
          <xs:element name="DistributionList" type="t:DistributionListType"/>
          <xs:element name="MeetingMessage" type="t:MeetingMessageType"/>
          <xs:element name="MeetingRequest" type="t:MeetingRequestMessageType"/>
          <xs:element name="MeetingResponse" type="t:MeetingResponseMessageType"/>
          <xs:element name="MeetingCancellation" type="t:MeetingCancellationMessageType"/>
          <xs:element name="Task" type="t:TaskType"/>
          <xs:element name="PostItem" type="t:PostItemType"/>
        </xs:choice>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="SetFolderFieldType">
    <xs:complexContent>
      <xs:extension base="t:FolderChangeDescriptionType">
        <xs:choice>
          <xs:element name="Folder" type="t:FolderType"/>
          <xs:element name="CalendarFolder" type="t:CalendarFolderType"/>
          <xs:element name="ContactsFolder" type="t:ContactsFolderType"/>
          <xs:element name="SearchFolder" type="t:SearchFolderType"/>
          <xs:element name="TasksFolder" type="t:TasksFolderType"/>
        </xs:choice>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="DeleteItemFieldType">
    <xs:complexContent>
      <xs:extension base="t:ItemChangeDescriptionType">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DeleteFolderFieldType">
    <xs:complexContent>
      <xs:extension base="t:FolderChangeDescriptionType">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="AppendToItemFieldType">
    <xs:complexContent>
      <xs:extension base="t:ItemChangeDescriptionType">
        <xs:choice>
          <xs:element name="Item" type="t:ItemType"/>
          <xs:element name="Message" type="t:MessageType"/>
          <xs:element name="CalendarItem" type="t:CalendarItemType"/>
          <xs:element name="Contact" type="t:ContactItemType"/>
          <xs:element name="DistributionList" type="t:DistributionListType"/>
          <xs:element name="MeetingMessage" type="t:MeetingMessageType"/>
          <xs:element name="MeetingRequest" type="t:MeetingRequestMessageType"/>
          <xs:element name="MeetingResponse" type="t:MeetingResponseMessageType"/>
          <xs:element name="MeetingCancellation" type="t:MeetingCancellationMessageType"/>
          <xs:element name="Task" type="t:TaskType"/>
          <xs:element name="PostItem" type="t:PostItemType"/>
        </xs:choice>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="AppendToFolderFieldType">
    <xs:complexContent>
      <xs:extension base="t:FolderChangeDescriptionType">
        <xs:sequence>
          <xs:choice>
            <xs:element name="Folder" type="t:FolderType"/>
            <xs:element name="CalendarFolder" type="t:CalendarFolderType"/>
            <xs:element name="ContactsFolder" type="t:ContactsFolderType"/>
            <xs:element name="SearchFolder" type="t:SearchFolderType"/>
            <xs:element name="TasksFolder" type="t:TasksFolderType"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfItemChangeDescriptionsType">
    <xs:choice maxOccurs="unbounded">
      <xs:element name="AppendToItemField" type="t:AppendToItemFieldType"/>
      <xs:element name="SetItemField" type="t:SetItemFieldType"/>
      <xs:element name="DeleteItemField" type="t:DeleteItemFieldType"/>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="NonEmptyArrayOfFolderChangeDescriptionsType">
    <xs:choice maxOccurs="unbounded">
      <xs:element name="AppendToFolderField" type="t:AppendToFolderFieldType"/>
      <xs:element name="SetFolderField" type="t:SetFolderFieldType"/>
      <xs:element name="DeleteFolderField" type="t:DeleteFolderFieldType"/>
    </xs:choice>
  </xs:complexType>

  <!-- Updating an item. -->

  <xs:complexType name="ItemChangeType">
    <xs:sequence>
      <xs:choice>
        <xs:element name="ItemId" type="t:ItemIdType" />
        <xs:element name="OccurrenceItemId" type="t:OccurrenceItemIdType"/>
        <xs:element name="RecurringMasterItemId" type="t:RecurringMasterItemIdType"/>
      </xs:choice>
      <xs:element name="Updates" type="t:NonEmptyArrayOfItemChangeDescriptionsType" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfItemChangesType">
    <xs:sequence>
      <xs:element name="ItemChange" type="t:ItemChangeType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <!-- Other headers -->
  <xs:complexType name="InternetHeaderType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="HeaderName" type="xs:string" use="required"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfInternetHeadersType">
    <xs:sequence>
      <xs:element name="InternetMessageHeader" type="t:InternetHeaderType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <!-- Attachments -->

  <!-- This type is used in GetAttachment -->
  <xs:complexType name="RequestAttachmentIdType">
    <xs:complexContent>
      <xs:extension base="t:BaseItemIdType">
        <xs:attribute name="Id" type="xs:string" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- This type is used in CreateAttachment responses. CreateAttachment modifies the
		change key of the root item of the created attachment. We have to return that new
		change key.-->
  <xs:complexType name="AttachmentIdType">
    <xs:complexContent>
      <xs:extension base="t:RequestAttachmentIdType">
        <xs:attribute name="RootItemId" type="xs:string" use="optional"/>
        <xs:attribute name="RootItemChangeKey" type="xs:string" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- This type is used solely in DeleteAttachment responses. -->
  <xs:complexType name="RootItemIdType">
    <xs:complexContent>
      <xs:extension base="t:BaseItemIdType">
        <xs:attribute name="RootItemId" type="xs:string" use="required"/>
        <xs:attribute name="RootItemChangeKey" type="xs:string" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfRequestAttachmentIdsType">
    <xs:choice minOccurs="1" maxOccurs="unbounded">
      <xs:element name="AttachmentId" type="t:RequestAttachmentIdType"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="AttachmentType">
    <xs:sequence>
      <xs:element name="AttachmentId" type="t:AttachmentIdType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="Name" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="ContentType" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="ContentId" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="ContentLocation" type="xs:string" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ItemAttachmentType">
    <xs:complexContent>
      <xs:extension base="t:AttachmentType">
        <xs:choice minOccurs="0" maxOccurs="1">
          <xs:element name="Item" type="t:ItemType"/>
          <xs:element name="Message" type="t:MessageType"/>
          <xs:element name="CalendarItem" type="t:CalendarItemType"/>
          <xs:element name="Contact" type="t:ContactItemType"/>
          <xs:element name="MeetingMessage" type="t:MeetingMessageType"/>
          <xs:element name="MeetingRequest" type="t:MeetingRequestMessageType"/>
          <xs:element name="MeetingResponse" type="t:MeetingResponseMessageType"/>
          <xs:element name="MeetingCancellation" type="t:MeetingCancellationMessageType"/>
          <xs:element name="Task" type="t:TaskType"/>
          <xs:element name="PostItem" type="t:PostItemType"/>
        </xs:choice>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="SyncFolderItemsCreateOrUpdateType">
    <xs:choice>
      <xs:element name="Item" type="t:ItemType"/>
      <xs:element name="Message" type="t:MessageType"/>
      <xs:element name="CalendarItem" type="t:CalendarItemType"/>
      <xs:element name="Contact" type="t:ContactItemType"/>
      <xs:element name="DistributionList" type="t:DistributionListType"/>
      <xs:element name="MeetingMessage" type="t:MeetingMessageType"/>
      <xs:element name="MeetingRequest" type="t:MeetingRequestMessageType"/>
      <xs:element name="MeetingResponse" type="t:MeetingResponseMessageType"/>
      <xs:element name="MeetingCancellation" type="t:MeetingCancellationMessageType"/>
      <xs:element name="Task" type="t:TaskType"/>
      <xs:element name="PostItem" type="t:PostItemType"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="FileAttachmentType">
    <xs:complexContent>
      <xs:extension base="t:AttachmentType">
        <xs:sequence>
          <xs:element name="Content" type="xs:base64Binary" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="ArrayOfAttachmentsType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="ItemAttachment" type="t:ItemAttachmentType"/>
      <xs:element name="FileAttachment" type="t:FileAttachmentType"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfAttachmentsType">
    <xs:choice minOccurs="1" maxOccurs="unbounded">
      <xs:element name="ItemAttachment" type="t:ItemAttachmentType"/>
      <xs:element name="FileAttachment" type="t:FileAttachmentType"/>
    </xs:choice>
  </xs:complexType>

  <!-- Sensitivity enumeration -->
  <xs:simpleType name="SensitivityChoicesType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Normal" />
      <xs:enumeration value="Personal" />
      <xs:enumeration value="Private" />
      <xs:enumeration value="Confidential" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Importance enumeration -->
  <xs:simpleType name="ImportanceChoicesType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Low" />
      <xs:enumeration value="Normal" />
      <xs:enumeration value="High" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Type of body returned -->
  <xs:simpleType name="BodyTypeType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="HTML" />
      <xs:enumeration value="Text" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Body content with body type attribute -->
  <xs:complexType name="BodyType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="BodyType" type="t:BodyTypeType" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <!-- Folder Service types. -->
  <!-- Folder Ids -->
  <xs:complexType name="BaseFolderIdType" abstract="true">
    <xs:annotation>
      <xs:documentation>Utility type which should never appear in user documents</xs:documentation>
    </xs:annotation>
  </xs:complexType>

  <!-- Folder classes -->
  <xs:simpleType name="FolderClassType">
    <xs:restriction base="xs:string" />
  </xs:simpleType>

  <xs:simpleType name="DistinguishedFolderIdNameType">
    <xs:annotation>
      <xs:documentation>URIs for the distinguished folders accessible from a mailbox</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="calendar" />
      <xs:enumeration value="contacts" />
      <xs:enumeration value="deleteditems" />
      <xs:enumeration value="drafts" />
      <xs:enumeration value="inbox" />
      <xs:enumeration value="journal" />
      <xs:enumeration value="notes" />
      <xs:enumeration value="outbox" />
      <xs:enumeration value="sentitems" />
      <xs:enumeration value="tasks" />
      <xs:enumeration value="msgfolderroot" />
      <xs:enumeration value="publicfoldersroot" />
      <xs:enumeration value="root" />
      <xs:enumeration value="junkemail" />
      <xs:enumeration value="searchfolders" />
      <xs:enumeration value="voicemail" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="DistinguishedFolderIdType">
    <xs:annotation>
      <xs:documentation>Identifier for a distinguished folder</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:BaseFolderIdType">
        <xs:sequence>
          <xs:element name="Mailbox" type="t:EmailAddressType" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="Id" type="t:DistinguishedFolderIdNameType" use="required" />
        <xs:attribute name="ChangeKey" type="xs:string" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="FolderIdType">
    <xs:annotation>
      <xs:documentation>Identifier for a fully resolved folder</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:BaseFolderIdType">
        <xs:attribute name="Id" type="xs:string" use="required" />
        <xs:attribute name="ChangeKey" type="xs:string" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfBaseFolderIdsType">
    <xs:choice maxOccurs="unbounded" minOccurs="1">
      <xs:element name="FolderId" type="t:FolderIdType"/>
      <xs:element name="DistinguishedFolderId" type="t:DistinguishedFolderIdType"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="TargetFolderIdType">
    <xs:choice>
      <xs:element name="FolderId" type="t:FolderIdType"/>
      <xs:element name="DistinguishedFolderId" type="t:DistinguishedFolderIdType"/>
    </xs:choice>
  </xs:complexType>

  <!-- Find Folder/Item/Search supporting types -->
  <!-- When returning offset information for FindFolder/FindItem, we need to indicate where we
	are in the result set.  For the different paging mechanisms we need to indicate this in
	different ways.  The only common paging types between FindFolder and FindItem are indexed and
	fractional.
	-->
  <xs:attributeGroup name="FindResponsePagingAttributes">
    <xs:attribute name="IndexedPagingOffset" type="xs:int" use="optional"/>
    <xs:attribute name="NumeratorOffset" type="xs:int" use="optional"/>
    <xs:attribute name="AbsoluteDenominator" type="xs:int" use="optional"/>
    <xs:attribute name="IncludesLastItemInRange" type="xs:boolean" use="optional"/>
    <xs:attribute name="TotalItemsInView" type="xs:int" use="optional"/>
  </xs:attributeGroup>

  <!-- FindFolder response element for holding the results from a single parent -->
  <xs:complexType name="FindFolderParentType">
    <xs:sequence>
      <xs:element name="Folders" type="t:ArrayOfFoldersType" minOccurs="0"/>
    </xs:sequence>
    <xs:attributeGroup ref="t:FindResponsePagingAttributes"/>
  </xs:complexType>

  <!-- Basic information in a folder definition -->
  <xs:complexType name="BaseFolderType" abstract ="true">
    <xs:sequence>
      <xs:element name="FolderId" type="t:FolderIdType" minOccurs="0"/>
      <xs:element name="ParentFolderId" type="t:FolderIdType" minOccurs="0"/>
      <xs:element name="FolderClass" type="xs:string" minOccurs="0"/>
      <xs:element name="DisplayName" type="xs:string" minOccurs="0"/>
      <xs:element name="TotalCount" type="xs:int" minOccurs="0"/>
      <xs:element name="ChildFolderCount" type="xs:int" minOccurs="0"/>
      <xs:element name="ExtendedProperty" type="t:ExtendedPropertyType" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="ManagedFolderInformation" type="t:ManagedFolderInformationType" minOccurs="0"/>
      <xs:element name="EffectiveRights" type="t:EffectiveRightsType" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <!-- ManagedFolderInformation property type -->
  <xs:complexType name="ManagedFolderInformationType">
    <xs:annotation>
      <xs:documentation>Compound property for Managed Folder related information for Managed Folders.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="CanDelete" type="xs:boolean" minOccurs="0"/>
      <xs:element name="CanRenameOrMove" type="xs:boolean" minOccurs="0"/>
      <xs:element name="MustDisplayComment" type="xs:boolean" minOccurs="0"/>
      <xs:element name="HasQuota" type="xs:boolean" minOccurs="0"/>
      <xs:element name="IsManagedFoldersRoot" type="xs:boolean" minOccurs="0"/>
      <xs:element name="ManagedFolderId" type="xs:string" minOccurs="0"/>
      <xs:element name="Comment" type="xs:string" minOccurs="0"/>
      <xs:element name="StorageQuota" type="xs:int" minOccurs="0"/>
      <xs:element name="FolderSize" type="xs:int" minOccurs="0"/>
      <xs:element name="HomePage" type="xs:string" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="FolderType">
    <xs:complexContent>
      <xs:extension base="t:BaseFolderType">
        <xs:sequence>
          <xs:element name="PermissionSet" type="t:PermissionSetType" minOccurs="0"/>
          <xs:element name="UnreadCount" type="xs:int" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Calendar Folder Type-->
  <xs:complexType name="CalendarFolderType">
    <xs:complexContent>
      <xs:extension base="t:BaseFolderType">
        <xs:sequence>
          <xs:element name="PermissionSet" type="t:CalendarPermissionSetType" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Contacts Folder Type-->
  <xs:complexType name="ContactsFolderType">
    <xs:complexContent>
      <xs:extension base="t:BaseFolderType">
        <xs:sequence>
          <xs:element name="PermissionSet" type="t:PermissionSetType" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Search Folder Type-->
  <xs:complexType name="SearchFolderType">
    <xs:complexContent>
      <xs:extension base="t:FolderType">
        <xs:sequence>
          <xs:element name="SearchParameters" type="t:SearchParametersType" minOccurs="0" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Tasks Folder Type-->
  <xs:complexType name="TasksFolderType">
    <xs:complexContent>
      <xs:extension base="t:FolderType"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfFoldersType">
    <xs:choice minOccurs="1" maxOccurs="unbounded">
      <xs:element name="Folder" type="t:FolderType"/>
      <xs:element name="CalendarFolder" type="t:CalendarFolderType"/>
      <xs:element name="ContactsFolder" type="t:ContactsFolderType"/>
      <xs:element name="SearchFolder" type="t:SearchFolderType"/>
      <xs:element name="TasksFolder" type="t:TasksFolderType"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="ArrayOfFoldersType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Folder" type="t:FolderType"/>
      <xs:element name="CalendarFolder" type="t:CalendarFolderType"/>
      <xs:element name="ContactsFolder" type="t:ContactsFolderType"/>
      <xs:element name="SearchFolder" type="t:SearchFolderType"/>
      <xs:element name="TasksFolder" type="t:TasksFolderType"/>
    </xs:choice>
  </xs:complexType>

  <!-- Item Service types. -->
  <xs:complexType name="BaseItemIdType" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstract base type for item identifiers.  Should never be used in web service calls</xs:documentation>
    </xs:annotation>
  </xs:complexType>
  <xs:element name="BaseItemId" type="t:BaseItemIdType" />

  <xs:simpleType name="DerivedItemIdType">
    <xs:restriction base="xs:string" />
  </xs:simpleType>

  <xs:complexType name="ItemIdType">
    <xs:annotation>
      <xs:documentation>Identifier for a fully resolved item</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:BaseItemIdType">
        <xs:attribute name="Id" type="xs:string" use="required" />
        <xs:attribute name="ChangeKey" type="xs:string" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfBaseItemIdsType">
    <xs:choice minOccurs="1" maxOccurs="unbounded">
      <xs:element name="ItemId" type="t:ItemIdType"/>
      <xs:element name="OccurrenceItemId" type="t:OccurrenceItemIdType"/>
      <xs:element name="RecurringMasterItemId" type="t:RecurringMasterItemIdType"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="ArrayOfBaseItemIdsType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="ItemId" type="t:ItemIdType"/>
    </xs:choice>
  </xs:complexType>

  <!-- Item classes -->
  <xs:simpleType name="ItemClassType">
    <xs:restriction base="xs:string" />
  </xs:simpleType>

  <!--Reply objects-->
  <xs:complexType name="ResponseObjectCoreType" abstract="true">
    <xs:annotation>
      <xs:documentation>
        Internal abstract base type for reply objects.
        Should not appear in client code
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:MessageType">
        <xs:sequence>
          <xs:element name="ReferenceItemId" type="t:ItemIdType" minOccurs="0" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="ResponseObjectType" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstract base type for reply objects</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:ResponseObjectCoreType">
        <xs:attribute name="ObjectName" type="xs:string" use="optional">
          <xs:annotation>
            <xs:documentation>
              The name of this reply object class as an English string.  The client
              application is required to translate it if it's running in a different locale
            </xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!--The wrapper around all reply object types-->
  <xs:complexType name="NonEmptyArrayOfResponseObjectsType">
    <xs:choice maxOccurs="unbounded" minOccurs="0">
      <xs:element name="AcceptItem" type="t:AcceptItemType"/>
      <xs:element name="TentativelyAcceptItem" type="t:TentativelyAcceptItemType"/>
      <xs:element name="DeclineItem" type="t:DeclineItemType"/>
      <xs:element name="ReplyToItem" type="t:ReplyToItemType" />
      <xs:element name="ForwardItem" type="t:ForwardItemType" />
      <xs:element name="ReplyAllToItem" type="t:ReplyAllToItemType" />
      <xs:element name="CancelCalendarItem" type="t:CancelCalendarItemType" />
      <xs:element name="RemoveItem" type="t:RemoveItemType" />
      <xs:element name="SuppressReadReceipt" type="t:SuppressReadReceiptType" />
      <xs:element name="PostReplyItem" type="t:PostReplyItemType" />
    </xs:choice>
  </xs:complexType>

  <!-- Updating an folder.  Represents a set of changes to a single folder -->
  <xs:complexType name="FolderChangeType">
    <xs:sequence>
      <xs:choice>
        <xs:element name="FolderId" type="t:FolderIdType" />
        <xs:element name="DistinguishedFolderId" type="t:DistinguishedFolderIdType"/>
      </xs:choice>
      <xs:element name="Updates" type="t:NonEmptyArrayOfFolderChangeDescriptionsType" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfFolderChangesType">
    <xs:sequence>
      <xs:element name="FolderChange" type="t:FolderChangeType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <!-- Generic response to deleting a folder -->
  <!-- Some well-known reply objects -->
  <xs:complexType name="WellKnownResponseObjectType">
    <xs:complexContent>
      <xs:restriction base="t:ResponseObjectType">
        <xs:sequence>
          <xs:element name="ItemClass" type="t:ItemClassType" minOccurs="0" />
          <xs:element name="Sensitivity" type="t:SensitivityChoicesType" minOccurs="0" />
          <xs:element name="Body" type="t:BodyType" minOccurs="0" />
          <xs:element name="Attachments" type="t:NonEmptyArrayOfAttachmentsType" minOccurs="0" />
          <xs:element
							name="InternetMessageHeaders"
							type="t:NonEmptyArrayOfInternetHeadersType"
							minOccurs="0" />
          <xs:element name="Sender" type="t:SingleRecipientType" minOccurs="0" />
          <xs:element name="ToRecipients" type="t:ArrayOfRecipientsType" minOccurs="0" />
          <xs:element name="CcRecipients" type="t:ArrayOfRecipientsType" minOccurs="0" />
          <xs:element name="BccRecipients" type="t:ArrayOfRecipientsType" minOccurs="0" />
          <xs:element name="IsReadReceiptRequested" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsDeliveryReceiptRequested" type="xs:boolean" minOccurs="0" />
          <xs:element name="From" type="t:SingleRecipientType" minOccurs="0" />
          <xs:element name="ReferenceItemId" type="t:ItemIdType" minOccurs="0" />
        </xs:sequence>
        <xs:attribute name="ObjectName" type="xs:string" use="prohibited" />
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <!-- Smart responses: ReplyToItem, ReplyAllToItem, ForwardItem-->
  <xs:complexType name="SmartResponseBaseType">
    <xs:complexContent>
      <xs:restriction base="t:ResponseObjectType">
        <xs:sequence>
          <xs:element name="Subject" type="xs:string" minOccurs="0" />
          <xs:element name="Body" type="t:BodyType" minOccurs="0" />
          <xs:element name="ToRecipients" type="t:ArrayOfRecipientsType" minOccurs="0" />
          <xs:element name="CcRecipients" type="t:ArrayOfRecipientsType" minOccurs="0" />
          <xs:element name="BccRecipients" type="t:ArrayOfRecipientsType" minOccurs="0" />
          <xs:element name="IsReadReceiptRequested" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsDeliveryReceiptRequested" type="xs:boolean" minOccurs="0" />
          <xs:element name="From" type="t:SingleRecipientType" minOccurs="0" />
          <xs:element name="ReferenceItemId" type="t:ItemIdType" minOccurs="0" />
        </xs:sequence>
        <xs:attribute name="ObjectName" type="xs:string" use="prohibited" />
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SmartResponseType">
    <xs:complexContent>
      <xs:extension base="t:SmartResponseBaseType">
        <xs:sequence>
          <xs:element name="NewBodyContent" type="t:BodyType" minOccurs="0" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <!-- Distinguish the various kinds of responses which differ only in name by making them -->
  <!-- have types which all extend the same base types trivially -->
  <xs:complexType name="ReplyToItemType">
    <xs:complexContent>
      <xs:extension base="t:SmartResponseType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ReplyAllToItemType">
    <xs:complexContent>
      <xs:extension base="t:SmartResponseType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ForwardItemType">
    <xs:complexContent>
      <xs:extension base="t:SmartResponseType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CancelCalendarItemType">
    <xs:complexContent>
      <xs:extension base="t:SmartResponseType" />
    </xs:complexContent>
  </xs:complexType>

  <!-- Reference Item response object  -->

  <xs:complexType name="ReferenceItemResponseType">
    <xs:complexContent>
      <xs:restriction base="t:ResponseObjectType">
        <xs:sequence>
          <xs:element name="ReferenceItemId" type="t:ItemIdType" minOccurs="0" />
        </xs:sequence>
        <xs:attribute name="ObjectName" type="xs:string" use="prohibited" />
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="SuppressReadReceiptType">
    <xs:complexContent>
      <xs:extension base="t:ReferenceItemResponseType" />
    </xs:complexContent>
  </xs:complexType>

  <!-- FindItem response element for holding the results from a single parent -->
  <xs:complexType name="FindItemParentType">
    <xs:choice>
      <xs:element name="Items" type="t:ArrayOfRealItemsType"/>
      <xs:element name="Groups" type="t:ArrayOfGroupedItemsType"/>
    </xs:choice>
    <xs:attributeGroup ref="t:FindResponsePagingAttributes"/>
  </xs:complexType>

  <!-- Core contents of an item. -->
  <xs:complexType name="ItemType">
    <xs:sequence>
      <xs:element name="MimeContent" type="t:MimeContentType" minOccurs="0" />
      <xs:element name="ItemId" type="t:ItemIdType" minOccurs="0" />
      <xs:element name="ParentFolderId" type="t:FolderIdType" minOccurs="0"/>
      <xs:element name="ItemClass" type="t:ItemClassType" minOccurs="0" />
      <xs:element name="Subject" type="xs:string" minOccurs="0" />
      <xs:element name="Sensitivity" type="t:SensitivityChoicesType" minOccurs="0" />
      <xs:element name="Body" type="t:BodyType" minOccurs="0" />
      <xs:element name="Attachments" type="t:NonEmptyArrayOfAttachmentsType" minOccurs="0" />
      <xs:element name="DateTimeReceived" type="xs:dateTime" minOccurs="0" />
      <xs:element name="Size" type="xs:int" minOccurs="0" />
      <xs:element name="Categories" type="t:ArrayOfStringsType" minOccurs="0" />
      <xs:element name="Importance" type="t:ImportanceChoicesType" minOccurs="0" />
      <xs:element name="InReplyTo" type="xs:string" minOccurs="0" />
      <xs:element name="IsSubmitted" type="xs:boolean" minOccurs="0" />
      <xs:element name="IsDraft" type="xs:boolean" minOccurs="0" />
      <xs:element name="IsFromMe" type="xs:boolean" minOccurs="0" />
      <xs:element name="IsResend" type="xs:boolean" minOccurs="0" />
      <xs:element name="IsUnmodified" type="xs:boolean" minOccurs="0" />
      <xs:element name="InternetMessageHeaders" type="t:NonEmptyArrayOfInternetHeadersType" minOccurs="0" />
      <xs:element name="DateTimeSent" type="xs:dateTime" minOccurs="0" />
      <xs:element name="DateTimeCreated" type="xs:dateTime" minOccurs="0" />
      <xs:element name="ResponseObjects" type="t:NonEmptyArrayOfResponseObjectsType" minOccurs="0" />
      <xs:element name="ReminderDueBy" type="xs:dateTime" minOccurs="0" />
      <xs:element name="ReminderIsSet" type="xs:boolean" minOccurs="0" />
      <xs:element name="ReminderMinutesBeforeStart" type="t:ReminderMinutesBeforeStartType" minOccurs="0" />
      <xs:element name="DisplayCc" type="xs:string" minOccurs="0" />
      <xs:element name="DisplayTo" type="xs:string" minOccurs="0" />
      <xs:element name="HasAttachments" type="xs:boolean" minOccurs="0"/>
      <xs:element name="ExtendedProperty" type="t:ExtendedPropertyType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="Culture" type="xs:language" minOccurs="0"/>
      <xs:element name="EffectiveRights" type="t:EffectiveRightsType" minOccurs="0" />
      <xs:element name="LastModifiedName" type="xs:string" minOccurs="0" />
      <xs:element name="LastModifiedTime" type="xs:dateTime" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ArrayOfStringsType">
    <xs:sequence>
      <xs:element name="String" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ArrayOfRealItemsType">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Item" type="t:ItemType"/>
        <xs:element name="Message" type="t:MessageType"/>
        <xs:element name="CalendarItem" type="t:CalendarItemType"/>
        <xs:element name="Contact" type="t:ContactItemType"/>
        <xs:element name="DistributionList" type="t:DistributionListType"/>
        <xs:element name="MeetingMessage" type="t:MeetingMessageType"/>
        <xs:element name="MeetingRequest" type="t:MeetingRequestMessageType"/>
        <xs:element name="MeetingResponse" type="t:MeetingResponseMessageType"/>
        <xs:element name="MeetingCancellation" type="t:MeetingCancellationMessageType"/>
        <xs:element name="Task" type="t:TaskType"/>
        <xs:element name="PostItem" type="t:PostItemType"/>
      </xs:choice>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfAllItemsType">
    <xs:sequence>
      <xs:choice minOccurs="1" maxOccurs="unbounded">
        <xs:element name="Item" type="t:ItemType"/>
        <xs:element name="Message" type="t:MessageType"/>
        <xs:element name="CalendarItem" type="t:CalendarItemType"/>
        <xs:element name="Contact" type="t:ContactItemType"/>
        <xs:element name="DistributionList" type="t:DistributionListType"/>
        <xs:element name="MeetingMessage" type="t:MeetingMessageType"/>
        <xs:element name="MeetingRequest" type="t:MeetingRequestMessageType"/>
        <xs:element name="MeetingResponse" type="t:MeetingResponseMessageType"/>
        <xs:element name="MeetingCancellation" type="t:MeetingCancellationMessageType"/>
        <xs:element name="Task" type="t:TaskType"/>
        <xs:element name="PostItem" type="t:PostItemType"/>
        <xs:element name="ReplyToItem" type="t:ReplyToItemType"/>
        <xs:element name="ForwardItem" type="t:ForwardItemType"/>
        <xs:element name="ReplyAllToItem" type="t:ReplyAllToItemType"/>
        <xs:element name="AcceptItem" type="t:AcceptItemType"/>
        <xs:element name="TentativelyAcceptItem" type="t:TentativelyAcceptItemType"/>
        <xs:element name="DeclineItem" type="t:DeclineItemType"/>
        <xs:element name="CancelCalendarItem" type="t:CancelCalendarItemType" />
        <xs:element name="RemoveItem" type="t:RemoveItemType" />
        <xs:element name="SuppressReadReceipt" type="t:SuppressReadReceiptType" />
        <xs:element name="PostReplyItem" type="t:PostReplyItemType" />
      </xs:choice>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="AcceptItemType">
    <xs:complexContent>
      <xs:extension base="t:WellKnownResponseObjectType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TentativelyAcceptItemType">
    <xs:complexContent>
      <xs:extension base="t:WellKnownResponseObjectType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DeclineItemType">
    <xs:complexContent>
      <xs:extension base="t:WellKnownResponseObjectType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="RemoveItemType">
    <xs:complexContent>
      <xs:extension base="t:ResponseObjectType"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="PostReplyItemBaseType">
    <xs:complexContent>
      <xs:restriction base="t:ResponseObjectType">
        <xs:sequence>
          <xs:element name="Subject" type="xs:string" minOccurs="0" />
          <xs:element name="Body" type="t:BodyType" minOccurs="0" />
          <xs:element name="ReferenceItemId" type="t:ItemIdType"
            minOccurs="0" />
        </xs:sequence>
        <xs:attribute name="ObjectName" type="xs:string" use="prohibited" />
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PostReplyItemType">
    <xs:complexContent>
      <xs:extension base="t:PostReplyItemBaseType">
        <xs:sequence>
          <xs:element name="NewBodyContent" type="t:BodyType" minOccurs="0" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Mime content support -->
  <xs:complexType name="MimeContentType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="CharacterSet" type="xs:string" use="optional" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <!-- Special items for creating and updating items -->

  <xs:simpleType name="MessageDispositionType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="SaveOnly" />
      <xs:enumeration value="SendOnly" />
      <xs:enumeration value="SendAndSaveCopy" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="CalendarItemCreateOrDeleteOperationType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="SendToNone" />
      <xs:enumeration value="SendOnlyToAll" />
      <xs:enumeration value="SendToAllAndSaveCopy" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="CalendarItemUpdateOperationType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="SendToNone" />
      <xs:enumeration value="SendOnlyToAll" />
      <xs:enumeration value="SendOnlyToChanged" />
      <xs:enumeration value="SendToAllAndSaveCopy" />
      <xs:enumeration value="SendToChangedAndSaveCopy" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="AffectedTaskOccurrencesType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="AllOccurrences"/>
      <xs:enumeration value="SpecifiedOccurrenceOnly"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- - - - - - - - - - - - - - - - - - - -->
  <!--   Message type: derived from item   -->
  <!-- - - - - - - - - - - - - - - - - - - -->
  <xs:complexType name="MessageType">
    <xs:complexContent>
      <xs:extension base="t:ItemType">
        <xs:sequence>
          <xs:element name="Sender" minOccurs="0" type="t:SingleRecipientType" />
          <xs:element name="ToRecipients" type="t:ArrayOfRecipientsType" minOccurs="0" />
          <xs:element name="CcRecipients" type="t:ArrayOfRecipientsType" minOccurs="0" />
          <xs:element name="BccRecipients" type="t:ArrayOfRecipientsType" minOccurs="0" />
          <xs:element name="IsReadReceiptRequested" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsDeliveryReceiptRequested" type="xs:boolean" minOccurs="0" />
          <xs:element name="ConversationIndex" type="xs:base64Binary" minOccurs="0" />
          <xs:element name="ConversationTopic" type="xs:string" minOccurs="0" />
          <xs:element name="From" type="t:SingleRecipientType" minOccurs="0" />
          <xs:element name="InternetMessageId" type="xs:string" minOccurs="0" />
          <xs:element name="IsRead" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsResponseRequested" type="xs:boolean" minOccurs="0" />
          <xs:element name="References" type="xs:string" minOccurs="0" />
          <xs:element name="ReplyTo" type="t:ArrayOfRecipientsType" minOccurs="0" />
          <xs:element name="ReceivedBy" type="t:SingleRecipientType" minOccurs="0" />
          <xs:element name="ReceivedRepresenting" type="t:SingleRecipientType" minOccurs="0" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:simpleType name="TaskStatusType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="NotStarted" />
      <xs:enumeration value="InProgress" />
      <xs:enumeration value="Completed" />
      <xs:enumeration value="WaitingOnOthers" />
      <xs:enumeration value="Deferred" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="TaskDelegateStateType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="NoMatch" />
      <xs:enumeration value="OwnNew" />
      <xs:enumeration value="Owned" />
      <xs:enumeration value="Accepted" />
      <xs:enumeration value="Declined" />
      <xs:enumeration value="Max" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="TaskType">
    <xs:complexContent>
      <xs:extension base="t:ItemType">
        <xs:sequence>
          <xs:element name="ActualWork" type="xs:int" minOccurs="0" />
          <xs:element name="AssignedTime" type="xs:dateTime" minOccurs="0" />
          <xs:element name="BillingInformation" type="xs:string" minOccurs="0" />
          <xs:element name="ChangeCount" type="xs:int" minOccurs="0" />
          <xs:element name="Companies" type="t:ArrayOfStringsType" minOccurs="0" />
          <xs:element name="CompleteDate" type="xs:dateTime" minOccurs="0" />
          <xs:element name="Contacts" type="t:ArrayOfStringsType" minOccurs="0" />
          <xs:element name="DelegationState" type="t:TaskDelegateStateType" minOccurs="0" />
          <xs:element name="Delegator" type="xs:string" minOccurs="0" />
          <xs:element name="DueDate" type="xs:dateTime" minOccurs="0" />
          <xs:element name="IsAssignmentEditable" type="xs:int" minOccurs="0" />
          <xs:element name="IsComplete" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsRecurring" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsTeamTask" type="xs:boolean" minOccurs="0" />
          <xs:element name="Mileage" type="xs:string" minOccurs="0" />
          <xs:element name="Owner" type="xs:string" minOccurs="0" />
          <xs:element name="PercentComplete" type="xs:double" minOccurs="0" />
          <xs:element name="Recurrence" type="t:TaskRecurrenceType" minOccurs="0" />
          <xs:element name="StartDate" type="xs:dateTime" minOccurs="0" />
          <xs:element name="Status" type="t:TaskStatusType" minOccurs="0" />
          <xs:element name="StatusDescription" type="xs:string" minOccurs="0" />
          <xs:element name="TotalWork" type="xs:int" minOccurs="0" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="PostItemType">
    <xs:complexContent>
      <xs:extension base="t:ItemType">
        <xs:sequence>
          <xs:element name="ConversationIndex" type="xs:base64Binary" minOccurs="0"/>
          <xs:element name="ConversationTopic" type="xs:string" minOccurs="0"/>
          <!-- From property can only be set at creation time -->
          <xs:element name="From" type="t:SingleRecipientType" minOccurs="0"/>
          <xs:element name="InternetMessageId" type="xs:string" minOccurs="0"/>
          <xs:element name="IsRead" type="xs:boolean" minOccurs="0" />
          <!-- PostedTime is read only -->
          <xs:element name="PostedTime" type="xs:dateTime" minOccurs="0"/>
          <xs:element name="References" type="xs:string" minOccurs="0" />
          <!-- Sender can only be set at creation time -->
          <xs:element name="Sender" type="t:SingleRecipientType" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Paging specification -->
  <xs:complexType name="BasePagingType" abstract="true">
    <xs:attribute name="MaxEntriesReturned" type="xs:int" use="optional"/>
  </xs:complexType>

  <xs:simpleType name="IndexBasePointType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Beginning" />
      <xs:enumeration value="End" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="IndexedPageViewType">
    <xs:complexContent>
      <xs:extension base="t:BasePagingType">
        <xs:attribute name="Offset" type="xs:int" use="required"/>
        <xs:attribute name="BasePoint" type="t:IndexBasePointType" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="FractionalPageViewType">
    <xs:complexContent>
      <xs:extension base="t:BasePagingType">
        <xs:attribute name="Numerator" type="xs:int" use="required" />
        <xs:attribute name="Denominator" type="xs:int" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="CalendarViewType">
    <xs:complexContent>
      <xs:extension base="t:BasePagingType">
        <xs:attribute name="StartDate" type="xs:dateTime" use="required" />
        <xs:attribute name="EndDate" type="xs:dateTime" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="ContactsViewType">
    <xs:complexContent>
      <xs:extension base="t:BasePagingType">
        <xs:attribute name="InitialName" type="xs:string" use="optional"/>
        <xs:attribute name="FinalName" type="xs:string" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Util Service Types. -->


  <!-- ResolveNames request -->

  <xs:simpleType name="ResolveNamesSearchScopeType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ActiveDirectory" />
      <xs:enumeration value="ActiveDirectoryContacts" />
      <xs:enumeration value="Contacts" />
      <xs:enumeration value="ContactsActiveDirectory" />
    </xs:restriction>
  </xs:simpleType>

  <!-- ResolveNames response -->

  <xs:complexType name="ResolutionType">
    <xs:sequence>
      <xs:element name="Mailbox" type="t:EmailAddressType" />
      <xs:element name="Contact" type="t:ContactItemType" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ArrayOfResolutionType">
    <xs:sequence>
      <xs:element name="Resolution" type="t:ResolutionType" minOccurs="0" maxOccurs="100" />
    </xs:sequence>
    <xs:attributeGroup ref="t:FindResponsePagingAttributes" />
  </xs:complexType>

  <!-- DLExpansion response -->

  <xs:complexType name="ArrayOfDLExpansionType">
    <xs:sequence>
      <xs:element name="Mailbox" type="t:EmailAddressType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attributeGroup ref="t:FindResponsePagingAttributes" />
  </xs:complexType>

  <!-- end of DLExpansion -->

  <!-- MeetingMessage types -->

  <xs:simpleType name="MeetingRequestTypeType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="FullUpdate" />
      <xs:enumeration value="InformationalUpdate" />
      <xs:enumeration value="NewMeetingRequest" />
      <xs:enumeration value="Outdated" />
      <xs:enumeration value="SilentUpdate" />
      <xs:enumeration value="PrincipalWantsCopy" />
    </xs:restriction>
  </xs:simpleType>

  <!-- CalendarItem Types -->

  <xs:simpleType name="ReminderMinutesBeforeStartType">
    <xs:union>
      <xs:simpleType id="ReminderMinutesBeforeStartType" >
        <xs:restriction base="xs:int">
          <xs:minInclusive value="0" />
          <xs:maxInclusive value="2629800" />
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType id="ReminderMinutesBeforeStartMarkerType">
        <xs:restriction base="xs:int">
          <xs:minInclusive value="1525252321" />
          <xs:maxInclusive value="1525252321" />
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>

  <!-- Enumeration types -->

  <xs:simpleType name="LegacyFreeBusyType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Free" />
      <xs:enumeration value="Tentative" />
      <xs:enumeration value="Busy" />
      <xs:enumeration value="OOF" />
      <xs:enumeration value="NoData" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="CalendarItemTypeType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Single" />
      <xs:enumeration value="Occurrence" />
      <xs:enumeration value="Exception" />
      <xs:enumeration value="RecurringMaster" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ResponseTypeType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Unknown" />
      <xs:enumeration value="Organizer" />
      <xs:enumeration value="Tentative" />
      <xs:enumeration value="Accept" />
      <xs:enumeration value="Decline" />
      <xs:enumeration value="NoResponseReceived" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Representation of attendees -->

  <xs:complexType name="AttendeeType">
    <xs:sequence>
      <xs:element name="Mailbox" type="t:EmailAddressType" />
      <xs:element name="ResponseType" type="t:ResponseTypeType" minOccurs="0" />
      <xs:element name="LastResponseTime" type="xs:dateTime" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfAttendeesType">
    <xs:sequence>
      <xs:element name="Attendee" type="t:AttendeeType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <!-- Special item ids for interconverting between instances and masters -->

  <xs:complexType name="OccurrenceItemIdType">
    <xs:complexContent>
      <xs:extension base="t:BaseItemIdType">
        <xs:attribute name="RecurringMasterId" type="t:DerivedItemIdType" use="required" />
        <xs:attribute name="ChangeKey" type="xs:string" use="optional" />
        <xs:attribute name="InstanceIndex" type="xs:int" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="RecurringMasterItemIdType">
    <xs:complexContent>
      <xs:extension base="t:BaseItemIdType">
        <xs:attribute name="OccurrenceId" type="t:DerivedItemIdType" use="required" />
        <xs:attribute name="ChangeKey" type="xs:string" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Days of the week and months-->

  <xs:simpleType name="DayOfWeekType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Sunday" />
      <xs:enumeration value="Monday" />
      <xs:enumeration value="Tuesday" />
      <xs:enumeration value="Wednesday" />
      <xs:enumeration value="Thursday" />
      <xs:enumeration value="Friday" />
      <xs:enumeration value="Saturday" />
      <xs:enumeration value="Day" />
      <xs:enumeration value="Weekday" />
      <xs:enumeration value="WeekendDay" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DaysOfWeekType">
    <xs:list itemType="t:DayOfWeekType" />
  </xs:simpleType>

  <xs:simpleType name="DayOfWeekIndexType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="First" />
      <xs:enumeration value="Second" />
      <xs:enumeration value="Third" />
      <xs:enumeration value="Fourth" />
      <xs:enumeration value="Last" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="MonthNamesType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="January" />
      <xs:enumeration value="February" />
      <xs:enumeration value="March" />
      <xs:enumeration value="April" />
      <xs:enumeration value="May" />
      <xs:enumeration value="June" />
      <xs:enumeration value="July" />
      <xs:enumeration value="August" />
      <xs:enumeration value="September" />
      <xs:enumeration value="October" />
      <xs:enumeration value="November" />
      <xs:enumeration value="December" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Recurrence pattern types -->

  <xs:complexType name="RecurrencePatternBaseType" abstract="true" />

  <xs:complexType name="IntervalRecurrencePatternBaseType" abstract="true">
    <xs:complexContent>
      <xs:extension base="t:RecurrencePatternBaseType">
        <xs:sequence>
          <xs:element name="Interval" type="xs:int" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!--
	Base regeneration pattern type for tasks.
	-->

  <xs:complexType name="RegeneratingPatternBaseType" abstract="true">
    <xs:complexContent>
      <xs:extension base="t:IntervalRecurrencePatternBaseType"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="DailyRegeneratingPatternType">
    <xs:complexContent>
      <xs:extension base="t:RegeneratingPatternBaseType"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="WeeklyRegeneratingPatternType">
    <xs:complexContent>
      <xs:extension base="t:RegeneratingPatternBaseType"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="MonthlyRegeneratingPatternType">
    <xs:complexContent>
      <xs:extension base="t:RegeneratingPatternBaseType"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="YearlyRegeneratingPatternType">
    <xs:complexContent>
      <xs:extension base="t:RegeneratingPatternBaseType"/>
    </xs:complexContent>
  </xs:complexType>

  <!-- Realizable Recurrence pattern types -->

  <xs:complexType name="RelativeYearlyRecurrencePatternType">
    <xs:complexContent>
      <xs:extension base="t:RecurrencePatternBaseType">
        <xs:sequence>
          <xs:element name="DaysOfWeek" type="t:DayOfWeekType" />
          <xs:element name="DayOfWeekIndex" type="t:DayOfWeekIndexType" />
          <xs:element name="Month" type="t:MonthNamesType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="AbsoluteYearlyRecurrencePatternType">
    <xs:complexContent>
      <xs:extension base="t:RecurrencePatternBaseType">
        <xs:sequence>
          <xs:element name="DayOfMonth" type="xs:int" />
          <xs:element name="Month" type="t:MonthNamesType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="RelativeMonthlyRecurrencePatternType">
    <xs:complexContent>
      <xs:extension base="t:IntervalRecurrencePatternBaseType">
        <xs:sequence>
          <xs:element name="DaysOfWeek" type="t:DayOfWeekType" />
          <xs:element name="DayOfWeekIndex" type="t:DayOfWeekIndexType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="AbsoluteMonthlyRecurrencePatternType">
    <xs:complexContent>
      <xs:extension base="t:IntervalRecurrencePatternBaseType">
        <xs:sequence>
          <xs:element name="DayOfMonth" type="xs:int" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="WeeklyRecurrencePatternType">
    <xs:complexContent>
      <xs:extension base="t:IntervalRecurrencePatternBaseType">
        <xs:sequence>
          <xs:element name="DaysOfWeek" type="t:DaysOfWeekType"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="DailyRecurrencePatternType">
    <xs:complexContent>
      <xs:extension base="t:IntervalRecurrencePatternBaseType" />
    </xs:complexContent>
  </xs:complexType>

  <!-- Description of a time zone -->

  <xs:group name="TimeChangePatternTypes">
    <xs:sequence>
      <xs:choice>
        <xs:element name="RelativeYearlyRecurrence" type="t:RelativeYearlyRecurrencePatternType" />
        <xs:element name="AbsoluteDate" type="xs:date" />
      </xs:choice>
    </xs:sequence>
  </xs:group>

  <xs:complexType name="TimeChangeType">
    <xs:sequence>
      <xs:element name="Offset" type="xs:duration" />
      <xs:group ref="t:TimeChangePatternTypes" minOccurs="0"/>
      <xs:element name="Time" type="xs:time" />
    </xs:sequence>
    <xs:attribute name="TimeZoneName" type="xs:string" use="optional" />
  </xs:complexType>

  <xs:complexType name="TimeZoneType">
    <xs:sequence minOccurs="0" >
      <xs:element name="BaseOffset" type="xs:duration" />
      <xs:sequence minOccurs="0">
        <xs:element name="Standard" type="t:TimeChangeType"/>
        <xs:element name="Daylight" type="t:TimeChangeType"/>
      </xs:sequence>
    </xs:sequence>
    <xs:attribute name="TimeZoneName" type="xs:string" use="optional" />
  </xs:complexType>

  <!-- Recurrence range types -->

  <xs:complexType name="RecurrenceRangeBaseType" abstract="true">
    <xs:sequence>
      <xs:element name="StartDate" type="xs:date" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="NoEndRecurrenceRangeType">
    <xs:complexContent>
      <xs:extension base="t:RecurrenceRangeBaseType" />
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="EndDateRecurrenceRangeType">
    <xs:complexContent>
      <xs:extension base="t:RecurrenceRangeBaseType">
        <xs:sequence>
          <xs:element name="EndDate" type="xs:date" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="NumberedRecurrenceRangeType">
    <xs:complexContent>
      <xs:extension base="t:RecurrenceRangeBaseType">
        <xs:sequence>
          <xs:element name="NumberOfOccurrences" type="xs:int" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- The real Recurrence type -->

  <xs:group name="RecurrencePatternTypes">
    <xs:sequence>
      <xs:choice>
        <xs:element name="RelativeYearlyRecurrence" type="t:RelativeYearlyRecurrencePatternType" />
        <xs:element name="AbsoluteYearlyRecurrence" type="t:AbsoluteYearlyRecurrencePatternType" />
        <xs:element name="RelativeMonthlyRecurrence" type="t:RelativeMonthlyRecurrencePatternType" />
        <xs:element name="AbsoluteMonthlyRecurrence" type="t:AbsoluteMonthlyRecurrencePatternType" />
        <xs:element name="WeeklyRecurrence" type="t:WeeklyRecurrencePatternType" />
        <xs:element name="DailyRecurrence" type="t:DailyRecurrencePatternType" />
      </xs:choice>
    </xs:sequence>
  </xs:group>

  <xs:group name="TaskRecurrencePatternTypes">
    <xs:sequence>
      <xs:choice>
        <xs:element name="RelativeYearlyRecurrence" type="t:RelativeYearlyRecurrencePatternType"/>
        <xs:element name="AbsoluteYearlyRecurrence" type="t:AbsoluteYearlyRecurrencePatternType"/>
        <xs:element name="RelativeMonthlyRecurrence" type="t:RelativeMonthlyRecurrencePatternType"/>
        <xs:element name="AbsoluteMonthlyRecurrence" type="t:AbsoluteMonthlyRecurrencePatternType"/>
        <xs:element name="WeeklyRecurrence" type="t:WeeklyRecurrencePatternType"/>
        <xs:element name="DailyRecurrence" type="t:DailyRecurrencePatternType"/>
        <xs:element name="DailyRegeneration" type="t:DailyRegeneratingPatternType"/>
        <xs:element name="WeeklyRegeneration" type="t:WeeklyRegeneratingPatternType"/>
        <xs:element name="MonthlyRegeneration" type="t:MonthlyRegeneratingPatternType"/>
        <xs:element name="YearlyRegeneration" type="t:YearlyRegeneratingPatternType"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>

  <xs:group name="RecurrenceRangeTypes">
    <xs:sequence>
      <xs:choice>
        <xs:element name="NoEndRecurrence" type="t:NoEndRecurrenceRangeType" />
        <xs:element name="EndDateRecurrence" type="t:EndDateRecurrenceRangeType" />
        <xs:element name="NumberedRecurrence" type="t:NumberedRecurrenceRangeType" />
      </xs:choice>
    </xs:sequence>
  </xs:group>

  <xs:complexType name="RecurrenceType">
    <xs:sequence>
      <xs:group ref="t:RecurrencePatternTypes" />
      <xs:group ref="t:RecurrenceRangeTypes" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="TaskRecurrenceType">
    <xs:sequence>
      <xs:group ref="t:TaskRecurrencePatternTypes"/>
      <xs:group ref="t:RecurrenceRangeTypes"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Individual occurrences of an expanded Recurrence -->

  <xs:complexType name="OccurrenceInfoType">
    <xs:sequence>
      <xs:element name="ItemId" type="t:ItemIdType" />
      <xs:element name="Start" type="xs:dateTime" />
      <xs:element name="End" type="xs:dateTime" />
      <xs:element name="OriginalStart" type="xs:dateTime" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfOccurrenceInfoType">
    <xs:sequence>
      <xs:element name="Occurrence" type="t:OccurrenceInfoType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="DeletedOccurrenceInfoType">
    <xs:sequence>
      <xs:element name="Start" type="xs:dateTime" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfDeletedOccurrencesType">
    <xs:sequence>
      <xs:element name="DeletedOccurrence" type="t:DeletedOccurrenceInfoType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <!-- The main calendar item from which all others derive -->

  <xs:complexType name="CalendarItemType">
    <xs:complexContent>
      <xs:extension base="t:ItemType">
        <xs:sequence>

          <!-- iCalendar properties -->

          <xs:element name="UID" type="xs:string" minOccurs="0" />
          <xs:element name="RecurrenceId" type="xs:dateTime" minOccurs="0" />
          <xs:element name="DateTimeStamp" type="xs:dateTime" minOccurs="0" />

          <!-- Single and Occurrence only -->

          <xs:element name="Start" type="xs:dateTime" minOccurs="0" />
          <xs:element name="End" type="xs:dateTime" minOccurs="0" />

          <!-- Occurrence only -->

          <xs:element name="OriginalStart" type="xs:dateTime" minOccurs="0" />

          <xs:element name="IsAllDayEvent" type="xs:boolean" minOccurs="0" />
          <xs:element name="LegacyFreeBusyStatus" type="t:LegacyFreeBusyType" minOccurs="0" />
          <xs:element name="Location" type="xs:string" minOccurs="0" />
          <xs:element name="When" type="xs:string" minOccurs="0" />
          <xs:element name="IsMeeting" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsCancelled" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsRecurring" type="xs:boolean" minOccurs="0" />
          <xs:element name="MeetingRequestWasSent" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsResponseRequested" type="xs:boolean" minOccurs="0" />
          <xs:element name="CalendarItemType" type="t:CalendarItemTypeType" minOccurs="0" />
          <xs:element name="MyResponseType" type="t:ResponseTypeType" minOccurs="0" />
          <xs:element name="Organizer" type="t:SingleRecipientType" minOccurs="0" />
          <xs:element name="RequiredAttendees" type="t:NonEmptyArrayOfAttendeesType" minOccurs="0" />
          <xs:element name="OptionalAttendees" type="t:NonEmptyArrayOfAttendeesType" minOccurs="0" />
          <xs:element name="Resources" type="t:NonEmptyArrayOfAttendeesType" minOccurs="0" />

          <!-- Conflicting and adjacent meetings -->

          <xs:element name="ConflictingMeetingCount" type="xs:int" minOccurs="0" />
          <xs:element name="AdjacentMeetingCount" type="xs:int" minOccurs="0" />
          <xs:element name="ConflictingMeetings" type="t:NonEmptyArrayOfAllItemsType" minOccurs="0" />
          <xs:element name="AdjacentMeetings" type="t:NonEmptyArrayOfAllItemsType" minOccurs="0" />

          <xs:element name="Duration" type="xs:string" minOccurs="0" />
          <xs:element name="TimeZone" type="xs:string" minOccurs="0" />

          <xs:element name="AppointmentReplyTime" type="xs:dateTime" minOccurs="0" />
          <xs:element name="AppointmentSequenceNumber" type="xs:int" minOccurs="0" />
          <xs:element name="AppointmentState" type="xs:int" minOccurs="0" />

          <!-- Recurrence specific data, only valid if CalendarItemType is RecurringMaster -->

          <xs:element name="Recurrence" type="t:RecurrenceType" minOccurs="0" />
          <xs:element name="FirstOccurrence" type="t:OccurrenceInfoType" minOccurs="0" />
          <xs:element name="LastOccurrence" type="t:OccurrenceInfoType" minOccurs="0" />
          <xs:element name="ModifiedOccurrences" type="t:NonEmptyArrayOfOccurrenceInfoType" minOccurs="0" />
          <xs:element name="DeletedOccurrences" type="t:NonEmptyArrayOfDeletedOccurrencesType" minOccurs="0" />
          <xs:element name="MeetingTimeZone" type="t:TimeZoneType" minOccurs="0"/>

          <xs:element name="ConferenceType" type="xs:int" minOccurs="0" />
          <xs:element name="AllowNewTimeProposal" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsOnlineMeeting" type="xs:boolean" minOccurs="0" />
          <xs:element name="MeetingWorkspaceUrl" type="xs:string" minOccurs="0" />
          <xs:element name="NetShowUrl" type="xs:string" minOccurs="0" />

        </xs:sequence>

      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Getting occurrences from Recurring masters and vice versa -->

  <!--Meeting invitation-->

  <xs:complexType name="MeetingMessageType">
    <xs:complexContent>
      <xs:extension base="t:MessageType">
        <xs:sequence>
          <xs:element name="AssociatedCalendarItemId" type="t:ItemIdType" minOccurs="0"/>
          <xs:element name="IsDelegated" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsOutOfDate" type="xs:boolean" minOccurs="0" />
          <xs:element name="HasBeenProcessed" type="xs:boolean" minOccurs="0" />

          <!-- Meeting response related properties -->

          <xs:element name="ResponseType" type="t:ResponseTypeType" minOccurs="0" />

          <!-- iCalendar properties -->

          <xs:element name="UID" type="xs:string" minOccurs="0" />
          <xs:element name="RecurrenceId" type="xs:dateTime" minOccurs="0" />
          <xs:element name="DateTimeStamp" type="xs:dateTime" minOccurs="0" />

        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="MeetingRequestMessageType">
    <xs:complexContent>
      <xs:extension base="t:MeetingMessageType">
        <xs:sequence>
          <!--- MeetingRequest properties -->

          <xs:element name="MeetingRequestType" type="t:MeetingRequestTypeType" minOccurs="0" />
          <xs:element name="IntendedFreeBusyStatus" type="t:LegacyFreeBusyType" minOccurs="0" />

          <!-- Calendar Properties of the associated meeting request -->

          <!-- Single and Occurrence only -->

          <xs:element name="Start" type="xs:dateTime" minOccurs="0" />
          <xs:element name="End" type="xs:dateTime" minOccurs="0" />

          <!-- Occurrence only -->

          <xs:element name="OriginalStart" type="xs:dateTime" minOccurs="0" />

          <xs:element name="IsAllDayEvent" type="xs:boolean" minOccurs="0" />
          <xs:element name="LegacyFreeBusyStatus" type="t:LegacyFreeBusyType" minOccurs="0" />
          <xs:element name="Location" type="xs:string" minOccurs="0" />
          <xs:element name="When" type="xs:string" minOccurs="0" />
          <xs:element name="IsMeeting" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsCancelled" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsRecurring" type="xs:boolean" minOccurs="0" />
          <xs:element name="MeetingRequestWasSent" type="xs:boolean" minOccurs="0" />
          <xs:element name="CalendarItemType" type="t:CalendarItemTypeType" minOccurs="0" />
          <xs:element name="MyResponseType" type="t:ResponseTypeType" minOccurs="0" />
          <xs:element name="Organizer" type="t:SingleRecipientType" minOccurs="0" />
          <xs:element name="RequiredAttendees" type="t:NonEmptyArrayOfAttendeesType" minOccurs="0" />
          <xs:element name="OptionalAttendees" type="t:NonEmptyArrayOfAttendeesType" minOccurs="0" />
          <xs:element name="Resources" type="t:NonEmptyArrayOfAttendeesType" minOccurs="0" />

          <!-- Conflicting and adjacent meetings -->

          <xs:element name="ConflictingMeetingCount" type="xs:int" minOccurs="0" />
          <xs:element name="AdjacentMeetingCount" type="xs:int" minOccurs="0" />
          <xs:element name="ConflictingMeetings" type="t:NonEmptyArrayOfAllItemsType" minOccurs="0" />
          <xs:element name="AdjacentMeetings" type="t:NonEmptyArrayOfAllItemsType" minOccurs="0" />

          <xs:element name="Duration" type="xs:string" minOccurs="0" />
          <xs:element name="TimeZone" type="xs:string" minOccurs="0" />

          <xs:element name="AppointmentReplyTime" type="xs:dateTime" minOccurs="0" />
          <xs:element name="AppointmentSequenceNumber" type="xs:int" minOccurs="0" />
          <xs:element name="AppointmentState" type="xs:int" minOccurs="0" />

          <!-- Recurrence specific data, only valid if CalendarItemType is RecurringMaster -->

          <xs:element name="Recurrence" type="t:RecurrenceType" minOccurs="0" />
          <xs:element name="FirstOccurrence" type="t:OccurrenceInfoType" minOccurs="0" />
          <xs:element name="LastOccurrence" type="t:OccurrenceInfoType" minOccurs="0" />
          <xs:element name="ModifiedOccurrences" type="t:NonEmptyArrayOfOccurrenceInfoType" minOccurs="0" />
          <xs:element name="DeletedOccurrences" type="t:NonEmptyArrayOfDeletedOccurrencesType" minOccurs="0" />
          <xs:element name="MeetingTimeZone" type="t:TimeZoneType" minOccurs="0" />

          <xs:element name="ConferenceType" type="xs:int" minOccurs="0" />
          <xs:element name="AllowNewTimeProposal" type="xs:boolean" minOccurs="0" />
          <xs:element name="IsOnlineMeeting" type="xs:boolean" minOccurs="0" />
          <xs:element name="MeetingWorkspaceUrl" type="xs:string" minOccurs="0" />
          <xs:element name="NetShowUrl" type="xs:string" minOccurs="0" />

        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="MeetingResponseMessageType">
    <xs:complexContent>
      <xs:extension base="t:MeetingMessageType"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="MeetingCancellationMessageType">
    <xs:complexContent>
      <xs:extension base="t:MeetingMessageType"/>
    </xs:complexContent>
  </xs:complexType>

  <!-- End of CalendarItem Types -->

  <!-- Contacts Types -->

  <xs:simpleType name="ImAddressKeyType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ImAddress1" />
      <xs:enumeration value="ImAddress2" />
      <xs:enumeration value="ImAddress3" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="EmailAddressKeyType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="EmailAddress1" />
      <xs:enumeration value="EmailAddress2" />
      <xs:enumeration value="EmailAddress3" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="PhoneNumberKeyType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="AssistantPhone" />
      <xs:enumeration value="BusinessFax" />
      <xs:enumeration value="BusinessPhone" />
      <xs:enumeration value="BusinessPhone2" />
      <xs:enumeration value="Callback" />
      <xs:enumeration value="CarPhone" />
      <xs:enumeration value="CompanyMainPhone" />
      <xs:enumeration value="HomeFax" />
      <xs:enumeration value="HomePhone" />
      <xs:enumeration value="HomePhone2" />
      <xs:enumeration value="Isdn" />
      <xs:enumeration value="MobilePhone" />
      <xs:enumeration value="OtherFax" />
      <xs:enumeration value="OtherTelephone" />
      <xs:enumeration value="Pager" />
      <xs:enumeration value="PrimaryPhone" />
      <xs:enumeration value="RadioPhone" />
      <xs:enumeration value="Telex" />
      <xs:enumeration value="TtyTddPhone" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="PhysicalAddressIndexType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="Business" />
      <xs:enumeration value="Home" />
      <xs:enumeration value="Other" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="PhysicalAddressKeyType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Business" />
      <xs:enumeration value="Home" />
      <xs:enumeration value="Other" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="FileAsMappingType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="LastCommaFirst" />
      <xs:enumeration value="FirstSpaceLast" />
      <xs:enumeration value="Company" />
      <xs:enumeration value="LastCommaFirstCompany" />
      <xs:enumeration value="CompanyLastFirst" />
      <xs:enumeration value="LastFirst" />
      <xs:enumeration value="LastFirstCompany" />
      <xs:enumeration value="CompanyLastCommaFirst" />
      <xs:enumeration value="LastFirstSuffix" />
      <xs:enumeration value="LastSpaceFirstCompany" />
      <xs:enumeration value="CompanyLastSpaceFirst" />
      <xs:enumeration value="LastSpaceFirst" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Contact source -->

  <xs:simpleType name="ContactSourceType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ActiveDirectory" />
      <xs:enumeration value="Store" />
    </xs:restriction>
  </xs:simpleType>

  <!-- complete name for a contact -->

  <xs:complexType name="CompleteNameType">
    <xs:sequence>
      <xs:element name="Title" type="xs:string" minOccurs="0" />
      <xs:element name="FirstName" type="xs:string" minOccurs="0" />
      <xs:element name="MiddleName" type="xs:string" minOccurs="0" />
      <xs:element name="LastName" type="xs:string" minOccurs="0" />
      <xs:element name="Suffix" type="xs:string" minOccurs="0" />
      <xs:element name="Initials" type="xs:string" minOccurs="0" />
      <xs:element name="FullName" type="xs:string" minOccurs="0" />
      <xs:element name="Nickname" type="xs:string" minOccurs="0" />
      <xs:element name="YomiFirstName" type="xs:string" minOccurs="0" />
      <xs:element name="YomiLastName" type="xs:string" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <!-- Dictionary types for items -->

  <xs:complexType name="ImAddressDictionaryEntryType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="Key" type="t:ImAddressKeyType" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="EmailAddressDictionaryEntryType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="Key" type="t:EmailAddressKeyType" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="PhoneNumberDictionaryEntryType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="Key" type="t:PhoneNumberKeyType" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="PhysicalAddressDictionaryEntryType">
    <xs:sequence>
      <xs:element name="Street" type="xs:string" minOccurs="0" />
      <xs:element name="City" type="xs:string" minOccurs="0" />
      <xs:element name="State" type="xs:string" minOccurs="0" />
      <xs:element name="CountryOrRegion" type="xs:string" minOccurs="0" />
      <xs:element name="PostalCode" type="xs:string" minOccurs="0" />
    </xs:sequence>
    <xs:attribute name="Key" type="t:PhysicalAddressKeyType" use="required" />
  </xs:complexType>

  <!-- The actual dictionaries -->

  <xs:complexType name="ImAddressDictionaryType">
    <xs:sequence>
      <xs:element name="Entry" type="t:ImAddressDictionaryEntryType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="EmailAddressDictionaryType">
    <xs:sequence>
      <xs:element name="Entry" type="t:EmailAddressDictionaryEntryType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="PhoneNumberDictionaryType">
    <xs:sequence>
      <xs:element name="Entry" type="t:PhoneNumberDictionaryEntryType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="PhysicalAddressDictionaryType">
    <xs:sequence>
      <xs:element name="Entry" type="t:PhysicalAddressDictionaryEntryType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <!-- ContactItemType -->

  <xs:complexType name="ContactItemType">
    <xs:complexContent>
      <xs:extension base="t:ItemType">
        <xs:sequence>
          <xs:element name="FileAs" type="xs:string" minOccurs="0" />
          <xs:element name="FileAsMapping" type="t:FileAsMappingType" minOccurs="0" />
          <xs:element name="DisplayName" type="xs:string" minOccurs="0" />
          <xs:element name="GivenName" type="xs:string" minOccurs="0" />
          <xs:element name="Initials" type="xs:string" minOccurs="0" />
          <xs:element name="MiddleName" type="xs:string" minOccurs="0" />
          <xs:element name="Nickname" type="xs:string" minOccurs="0" />
          <xs:element name="CompleteName" type="t:CompleteNameType" minOccurs="0" />
          <xs:element name="CompanyName" type="xs:string" minOccurs="0" />
          <xs:element name="EmailAddresses" type="t:EmailAddressDictionaryType" minOccurs="0" />
          <xs:element name="PhysicalAddresses" type="t:PhysicalAddressDictionaryType" minOccurs="0" />
          <xs:element name="PhoneNumbers" type="t:PhoneNumberDictionaryType" minOccurs="0" />
          <xs:element name="AssistantName" type="xs:string" minOccurs="0" />
          <xs:element name="Birthday" type="xs:dateTime" minOccurs="0" />
          <xs:element name="BusinessHomePage" type="xs:anyURI" minOccurs="0" />
          <xs:element name="Children" type="t:ArrayOfStringsType" minOccurs="0" />
          <xs:element name="Companies" type="t:ArrayOfStringsType" minOccurs="0" />
          <xs:element name="ContactSource" type="t:ContactSourceType" minOccurs="0" />
          <xs:element name="Department" type="xs:string" minOccurs="0" />
          <xs:element name="Generation" type="xs:string" minOccurs="0" />
          <xs:element name="ImAddresses" type="t:ImAddressDictionaryType" minOccurs="0" />
          <xs:element name="JobTitle" type="xs:string" minOccurs="0" />
          <xs:element name="Manager" type="xs:string" minOccurs="0" />
          <xs:element name="Mileage" type="xs:string" minOccurs="0" />
          <xs:element name="OfficeLocation" type="xs:string" minOccurs="0" />
          <xs:element name="PostalAddressIndex" type="t:PhysicalAddressIndexType" minOccurs="0" />
          <xs:element name="Profession" type="xs:string" minOccurs="0" />
          <xs:element name="SpouseName" type="xs:string" minOccurs="0" />
          <xs:element name="Surname" type="xs:string" minOccurs="0" />
          <xs:element name="WeddingAnniversary" type="xs:dateTime" minOccurs="0" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- ContactItemType -->

  <xs:complexType name="DistributionListType">
    <xs:complexContent>
      <xs:extension base="t:ItemType">
        <xs:sequence>
          <xs:element name="DisplayName" type="xs:string" minOccurs="0" />
          <xs:element name="FileAs" type="xs:string" minOccurs="0" />
          <xs:element name="ContactSource" type="t:ContactSourceType" minOccurs="0" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- End of Contacts Types-->

  <!-- Description of a search folder -->

  <xs:complexType name="SearchParametersType">
    <xs:sequence>
      <xs:element name="Restriction" type="t:RestrictionType" />
      <xs:element name="BaseFolderIds" type="t:NonEmptyArrayOfBaseFolderIdsType" />
    </xs:sequence>
    <xs:attribute name="Traversal" type="t:SearchFolderTraversalType" use="optional"/>
  </xs:complexType>

  <!-- Search expressions -->
  <xs:complexType name="ConstantValueType">
    <xs:attribute name="Value" type="xs:string" use="required" />
  </xs:complexType>

  <!-- Search expression type -->
  <xs:complexType name="SearchExpressionType" abstract="true" />
  <xs:element name="SearchExpression" type="t:SearchExpressionType" />

  <!-- GroupBy types for FindItem -->
  <xs:simpleType name="AggregateType">
    <xs:annotation>
      <xs:documentation>
        This max/min evaluation is applied to the field specified within the group by
        instance for EACH item within that group.  This determines which item from each group
        is to be selected as the representative for that group.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="Minimum"/>
      <xs:enumeration value="Maximum"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="AggregateOnType">
    <xs:annotation>
      <xs:documentation>
        Represents the field of each item to aggregate on and the qualifier to apply to that
        field in determining which item will represent the group.
      </xs:documentation>
    </xs:annotation>
    <xs:choice>
      <!-- Note that the property path here determines which property to examine on each item
			in the group for the aggregation function.  This has nothing to do with definition what
			is in each group.  That determination has already been made via the GroupBy property path.
			-->
      <xs:element name="FieldURI" type="t:PathToUnindexedFieldType"/>
      <xs:element name="IndexedFieldURI" type="t:PathToIndexedFieldType"/>
      <xs:element name="ExtendedFieldURI" type="t:PathToExtendedFieldType"/>
    </xs:choice>
    <xs:attribute name="Aggregate" type="t:AggregateType" use="required"/>
  </xs:complexType>

  <xs:complexType name="BaseGroupByType" abstract ="true">
    <xs:attribute name="Order" type="t:SortDirectionType" use="required"/>
  </xs:complexType>

  <xs:complexType name="GroupByType">
    <xs:annotation>
      <xs:documentation>
        Allows consumers to specify arbitrary groupings for FindItem queries.
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:BaseGroupByType">
        <xs:sequence>
          <!-- This property path represents the property that defines what is in each group.
					All items within a given group will have the same value for this property. -->
          <xs:choice>
            <xs:element name="FieldURI" type="t:PathToUnindexedFieldType"/>
            <xs:element name="IndexedFieldURI" type="t:PathToIndexedFieldType"/>
            <xs:element name="ExtendedFieldURI" type="t:PathToExtendedFieldType"/>
          </xs:choice>
          <xs:element name="AggregateOn" type="t:AggregateOnType"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:simpleType name="StandardGroupByType">
    <xs:annotation>
      <xs:documentation>
        Represents standard groupings for GroupBy queries.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="ConversationTopic"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="DistinguishedGroupByType">
    <xs:annotation>
      <xs:documentation>
        Allows consumers to access standard groupings for FindItem queries.  This is in
        contrast to the arbitrary (custom) groupings available via the t:GroupByType
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:BaseGroupByType">
        <xs:sequence>
          <xs:element name="StandardGroupBy" type="t:StandardGroupByType"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- GroupBy result types -->

  <xs:complexType name="GroupedItemsType">
    <xs:sequence>
      <xs:element name="GroupIndex" type="xs:string"/>
      <xs:element name="Items" type="t:ArrayOfRealItemsType"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ArrayOfGroupedItemsType">
    <xs:choice>
      <xs:element name="GroupedItems" type="t:GroupedItemsType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:choice>
  </xs:complexType>

  <!-- Basic arithmetic operations -->

  <xs:complexType name="ExistsType">
    <xs:complexContent>
      <xs:extension base="t:SearchExpressionType">
        <xs:sequence>
          <xs:element ref="t:Path"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Exists" type="t:ExistsType" substitutionGroup="t:SearchExpression"/>

  <xs:complexType name="FieldURIOrConstantType">
    <xs:choice>
      <xs:element ref="t:Path"/>
      <xs:element name="Constant" type="t:ConstantValueType" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="TwoOperandExpressionType" abstract="true">
    <xs:complexContent>
      <xs:extension base="t:SearchExpressionType">
        <xs:sequence>
          <xs:element ref="t:Path"/>
          <xs:element name="FieldURIOrConstant" type="t:FieldURIOrConstantType"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Excludes patterns can either be hex (starting with 0x or 0X) or integers -->
  <xs:simpleType name="ExcludesAttributeType">
    <xs:restriction base="xs:string">
      <xs:pattern value="((0x|0X)[0-9A-Fa-f]*)|([0-9]*)"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="ExcludesValueType">
    <xs:attribute name="Value" type="t:ExcludesAttributeType" use="required" />
  </xs:complexType>

  <xs:complexType name="ExcludesType">
    <xs:complexContent>
      <xs:extension base="t:SearchExpressionType">
        <xs:sequence>
          <xs:element ref="t:Path"/>
          <xs:element name="Bitmask" type="t:ExcludesValueType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Excludes" type="t:ExcludesType" substitutionGroup ="t:SearchExpression"/>


  <xs:complexType name="IsEqualToType">
    <xs:complexContent>
      <xs:extension base="t:TwoOperandExpressionType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="IsEqualTo" type="t:IsEqualToType" substitutionGroup ="t:SearchExpression"/>
  <xs:complexType name="IsNotEqualToType">
    <xs:complexContent>
      <xs:extension base="t:TwoOperandExpressionType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="IsNotEqualTo" type="t:IsNotEqualToType" substitutionGroup="t:SearchExpression"/>
  <xs:complexType name="IsGreaterThanType">
    <xs:complexContent>
      <xs:extension base="t:TwoOperandExpressionType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="IsGreaterThan" type="t:IsGreaterThanType" substitutionGroup ="t:SearchExpression"/>
  <xs:complexType name="IsGreaterThanOrEqualToType">
    <xs:complexContent>
      <xs:extension base="t:TwoOperandExpressionType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="IsGreaterThanOrEqualTo" type="t:IsGreaterThanOrEqualToType" substitutionGroup ="t:SearchExpression"/>
  <xs:complexType name="IsLessThanType">
    <xs:complexContent>
      <xs:extension base="t:TwoOperandExpressionType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="IsLessThan" type="t:IsLessThanType" substitutionGroup ="t:SearchExpression"/>
  <xs:complexType name="IsLessThanOrEqualToType">
    <xs:complexContent>
      <xs:extension base="t:TwoOperandExpressionType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="IsLessThanOrEqualTo" type="t:IsLessThanOrEqualToType" substitutionGroup ="t:SearchExpression"/>


  <!-- Content indexing comparison -->
  <xs:simpleType name="ContainmentModeType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="FullString" />
      <xs:enumeration value="Prefixed" />
      <xs:enumeration value="Substring" />
      <xs:enumeration value="PrefixOnWords" />
      <xs:enumeration value="ExactPhrase" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ContainmentComparisonType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Exact" />
      <xs:enumeration value="IgnoreCase" />
      <xs:enumeration value="IgnoreNonSpacingCharacters" />
      <xs:enumeration value="Loose"/>
      <xs:enumeration value="IgnoreCaseAndNonSpacingCharacters" />
      <xs:enumeration value="LooseAndIgnoreCase"/>
      <xs:enumeration value="LooseAndIgnoreNonSpace"/>
      <xs:enumeration value="LooseAndIgnoreCaseAndIgnoreNonSpace"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="ContainsExpressionType">
    <xs:complexContent>
      <xs:extension base="t:SearchExpressionType">
        <xs:sequence>
          <xs:element ref="t:Path"/>
          <xs:element name="Constant" type="t:ConstantValueType" />
        </xs:sequence>
        <xs:attribute name="ContainmentMode" type="t:ContainmentModeType" use="optional" />
        <xs:attribute name="ContainmentComparison" type="t:ContainmentComparisonType" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Contains" type="t:ContainsExpressionType" substitutionGroup="t:SearchExpression"/>

  <!-- Boolean operations -->
  <xs:complexType name="NotType">
    <xs:complexContent>
      <xs:extension base="t:SearchExpressionType">
        <xs:sequence>
          <xs:element ref="t:SearchExpression"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Not" type="t:NotType" substitutionGroup="t:SearchExpression"/>

  <xs:complexType name="MultipleOperandBooleanExpressionType" abstract="true">
    <xs:complexContent>
      <xs:extension base="t:SearchExpressionType">
        <xs:sequence>
          <xs:element ref="t:SearchExpression" minOccurs="2" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="AndType">
    <xs:complexContent>
      <xs:extension base="t:MultipleOperandBooleanExpressionType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="And" type="t:AndType" substitutionGroup="t:SearchExpression"/>

  <xs:complexType name="OrType">
    <xs:complexContent>
      <xs:extension base="t:MultipleOperandBooleanExpressionType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Or" type="t:OrType" substitutionGroup="t:SearchExpression"/>

  <!-- The type of object which actually encodes a restriction -->
  <xs:complexType name="RestrictionType">
    <xs:sequence>
      <xs:element ref="t:SearchExpression"/>
    </xs:sequence>
  </xs:complexType>
  <!-- Sort order specification -->
  <xs:simpleType name="SortDirectionType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Ascending" />
      <xs:enumeration value="Descending" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="FieldOrderType">
    <xs:sequence>
      <xs:element ref="t:Path"/>
    </xs:sequence>
    <xs:attribute name="Order" type="t:SortDirectionType" use="required" />
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfFieldOrdersType">
    <xs:sequence>
      <xs:element name="FieldOrder" type="t:FieldOrderType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <!-- Data type needed by CreateManagedFolder. -->
  <xs:complexType name="NonEmptyArrayOfFolderNamesType">
    <xs:sequence>
      <xs:element name="FolderName" type="xs:string" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>


  <!-- Notification types -->

  <xs:simpleType name="WatermarkType">
    <xs:restriction base="t:NonEmptyStringType"/>
  </xs:simpleType>

  <xs:simpleType name="SubscriptionIdType">
    <xs:restriction base="t:NonEmptyStringType"/>
  </xs:simpleType>

  <xs:complexType name="BaseNotificationEventType">
    <xs:sequence>
      <xs:element name="Watermark" type="t:WatermarkType" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="BaseObjectChangedEventType">
    <xs:complexContent>
      <xs:extension base="t:BaseNotificationEventType">
        <xs:sequence>
          <xs:element name="TimeStamp" type="xs:dateTime" />
          <xs:choice>
            <xs:element name="FolderId" type="t:FolderIdType" />
            <xs:element name="ItemId" type="t:ItemIdType"/>
          </xs:choice>
          <xs:element name="ParentFolderId" type="t:FolderIdType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="ModifiedEventType">
    <xs:complexContent>
      <xs:extension base="t:BaseObjectChangedEventType">
        <xs:sequence>
          <xs:element name="UnreadCount" type="xs:int" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="MovedCopiedEventType">
    <xs:complexContent>
      <xs:extension base="t:BaseObjectChangedEventType">
        <xs:sequence>
          <xs:choice>
            <xs:element name="OldFolderId" type="t:FolderIdType" />
            <xs:element name="OldItemId" type="t:ItemIdType"/>
          </xs:choice>
          <xs:element name="OldParentFolderId" type="t:FolderIdType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="NotificationType">
    <xs:sequence>
      <xs:element name="SubscriptionId" type="t:SubscriptionIdType" />
      <xs:element name="PreviousWatermark" type="t:WatermarkType" />
      <xs:element name="MoreEvents" type="xs:boolean" />
      <xs:choice maxOccurs="unbounded" minOccurs="1">
        <xs:element name="CopiedEvent" type="t:MovedCopiedEventType"/>
        <xs:element name="CreatedEvent" type="t:BaseObjectChangedEventType"/>
        <xs:element name="DeletedEvent" type="t:BaseObjectChangedEventType"/>
        <xs:element name="ModifiedEvent" type="t:ModifiedEventType"/>
        <xs:element name="MovedEvent" type="t:MovedCopiedEventType"/>
        <xs:element name="NewMailEvent" type="t:BaseObjectChangedEventType"/>
        <xs:element name="StatusEvent" type="t:BaseNotificationEventType"/>
      </xs:choice>
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="NotificationEventTypeType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="CopiedEvent" />
      <xs:enumeration value="CreatedEvent" />
      <xs:enumeration value="DeletedEvent" />
      <xs:enumeration value="ModifiedEvent" />
      <xs:enumeration value="MovedEvent" />
      <xs:enumeration value="NewMailEvent" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="NonEmptyArrayOfNotificationEventTypesType">
    <xs:choice maxOccurs="unbounded" minOccurs="1">
      <xs:element name="EventType" type="t:NotificationEventTypeType"/>
    </xs:choice>
  </xs:complexType>

  <xs:simpleType name="SubscriptionTimeoutType">
    <xs:restriction base="xs:int">
      <xs:minInclusive value="1" />
      <xs:maxInclusive value="1440" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="SubscriptionStatusFrequencyType">
    <xs:restriction base="xs:int">
      <xs:minInclusive value="1" />
      <xs:maxInclusive value="1440" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="BaseSubscriptionRequestType" abstract="true">
    <xs:sequence>
      <xs:element name="FolderIds" type="t:NonEmptyArrayOfBaseFolderIdsType"/>
      <xs:element name="EventTypes" type="t:NonEmptyArrayOfNotificationEventTypesType"/>
      <xs:element name="Watermark" type="t:WatermarkType" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="PushSubscriptionRequestType">
    <xs:complexContent>
      <xs:extension base="t:BaseSubscriptionRequestType">
        <xs:sequence>
          <xs:element name="StatusFrequency" type="t:SubscriptionStatusFrequencyType"/>
          <xs:element name="URL" type="xs:string"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PullSubscriptionRequestType">
    <xs:complexContent>
      <xs:extension base="t:BaseSubscriptionRequestType">
        <xs:sequence>
          <xs:element name="Timeout" type="t:SubscriptionTimeoutType"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:simpleType name="SubscriptionStatusType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="OK" />
      <xs:enumeration value="Unsubscribe" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="SyncFolderItemsDeleteType">
    <xs:sequence>
      <xs:element name="ItemId" type="t:ItemIdType"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="SyncFolderItemsReadFlagType">
    <xs:sequence>
      <xs:element name="ItemId" type="t:ItemIdType"/>
      <xs:element name="IsRead" type="xs:boolean"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="SyncFolderItemsChangesType">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded" minOccurs="0">
        <xs:element name="Create" type="t:SyncFolderItemsCreateOrUpdateType"/>
        <xs:element name="Update" type="t:SyncFolderItemsCreateOrUpdateType"/>
        <xs:element name="Delete" type="t:SyncFolderItemsDeleteType"/>
        <xs:element name="ReadFlagChange" type="t:SyncFolderItemsReadFlagType"/>
      </xs:choice>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="SyncFolderHierarchyCreateOrUpdateType">
    <xs:choice>
      <xs:element name="Folder" type="t:FolderType"/>
      <xs:element name="CalendarFolder" type="t:CalendarFolderType"/>
      <xs:element name="ContactsFolder" type="t:ContactsFolderType"/>
      <xs:element name="SearchFolder" type="t:SearchFolderType"/>
      <xs:element name="TasksFolder" type="t:TasksFolderType"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="SyncFolderHierarchyDeleteType">
    <xs:sequence>
      <xs:element name="FolderId" type="t:FolderIdType"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="SyncFolderHierarchyChangesType">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded" minOccurs="0">
        <xs:element name="Create" type="t:SyncFolderHierarchyCreateOrUpdateType"/>
        <xs:element name="Update" type="t:SyncFolderHierarchyCreateOrUpdateType"/>
        <xs:element name="Delete" type="t:SyncFolderHierarchyDeleteType"/>
      </xs:choice>
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="MaxSyncChangesReturnedType">
    <xs:restriction base="xs:int">
      <xs:minInclusive value="1" />
      <xs:maxInclusive value="512" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Availability Service types -->

  <xs:simpleType name="AvailabilityProxyRequestType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="CrossSite" />
      <xs:enumeration value="CrossForest" />
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="ProxyRequestTypeHeader" type="t:AvailabilityProxyRequestType"/>

  <xs:simpleType name="MeetingAttendeeType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Organizer"/>
      <xs:enumeration value="Required"/>
      <xs:enumeration value="Optional"/>
      <xs:enumeration value="Room"/>
      <xs:enumeration value="Resource"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="CalendarEventDetails">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="ID" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="Subject" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="Location" type="xs:string" />
      <xs:element minOccurs="1" maxOccurs="1" name="IsMeeting" type="xs:boolean" />
      <xs:element minOccurs="1" maxOccurs="1" name="IsRecurring" type="xs:boolean" />
      <xs:element minOccurs="1" maxOccurs="1" name="IsException" type="xs:boolean" />
      <xs:element minOccurs="1" maxOccurs="1" name="IsReminderSet" type="xs:boolean" />
      <xs:element minOccurs="1" maxOccurs="1" name="IsPrivate" type="xs:boolean" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="CalendarEvent">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="StartTime" type="xs:dateTime" />
      <xs:element minOccurs="1" maxOccurs="1" name="EndTime" type="xs:dateTime" />
      <xs:element minOccurs="1" maxOccurs="1" name="BusyType" type="t:LegacyFreeBusyType" />
      <xs:element minOccurs="0" maxOccurs="1" name="CalendarEventDetails" type="t:CalendarEventDetails" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ArrayOfCalendarEvent">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="CalendarEvent" type="t:CalendarEvent" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="Duration">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="StartTime" type="xs:dateTime" />
      <xs:element minOccurs="1" maxOccurs="1" name="EndTime" type="xs:dateTime" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="EmailAddress">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="Name" type="xs:string" />
      <xs:element minOccurs="1" maxOccurs="1" name="Address" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="RoutingType" type="xs:string" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="Mailbox" type="t:EmailAddress" />

  <xs:simpleType name="FreeBusyViewType">
    <xs:list>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="None" />
          <xs:enumeration value="MergedOnly" />
          <xs:enumeration value="FreeBusy" />
          <xs:enumeration value="FreeBusyMerged" />
          <xs:enumeration value="Detailed" />
          <xs:enumeration value="DetailedMerged" />
        </xs:restriction>
      </xs:simpleType>
    </xs:list>
  </xs:simpleType>

  <xs:complexType name="FreeBusyViewOptionsType">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="TimeWindow" type="t:Duration" />
      <xs:element minOccurs="0" maxOccurs="1" name="MergedFreeBusyIntervalInMinutes" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" name="RequestedView" type="t:FreeBusyViewType" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="FreeBusyViewOptions" type="t:FreeBusyViewOptionsType" />

  <xs:complexType name="WorkingPeriod">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="DayOfWeek" type="t:DaysOfWeekType" />
      <xs:element minOccurs="1" maxOccurs="1" name="StartTimeInMinutes" type="xs:int" />
      <xs:element minOccurs="1" maxOccurs="1" name="EndTimeInMinutes" type="xs:int" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ArrayOfWorkingPeriod">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="WorkingPeriod" type="t:WorkingPeriod" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="SerializableTimeZoneTime">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="Bias" type="xs:int" />
      <xs:element minOccurs="1" maxOccurs="1" name="Time" type="xs:string" />
      <xs:element minOccurs="1" maxOccurs="1" name="DayOrder" type="xs:short" />
      <xs:element minOccurs="1" maxOccurs="1" name="Month" type="xs:short" />
      <xs:element minOccurs="1" maxOccurs="1" name="DayOfWeek" type="t:DayOfWeekType" />
      <xs:element minOccurs="0" maxOccurs="1" name="Year" type="xs:string" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="SerializableTimeZone">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="Bias" type="xs:int" />
      <xs:element minOccurs="1" maxOccurs="1" name="StandardTime" type="t:SerializableTimeZoneTime" />
      <xs:element minOccurs="1" maxOccurs="1" name="DaylightTime" type="t:SerializableTimeZoneTime" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="TimeZone" type="t:SerializableTimeZone" />

  <xs:complexType name="WorkingHours">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="TimeZone" type="t:SerializableTimeZone" />
      <xs:element minOccurs="1" maxOccurs="1" name="WorkingPeriodArray" type="t:ArrayOfWorkingPeriod" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="FreeBusyView">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="FreeBusyViewType" type="t:FreeBusyViewType" />
      <xs:element minOccurs="0" maxOccurs="1" name="MergedFreeBusy" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="CalendarEventArray" type="t:ArrayOfCalendarEvent" />
      <xs:element minOccurs="0" maxOccurs="1" name="WorkingHours" type="t:WorkingHours" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="MailboxData">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="Email" type="t:EmailAddress" />
      <xs:element minOccurs="1" maxOccurs="1" name="AttendeeType" type="t:MeetingAttendeeType" />
      <xs:element minOccurs="0" maxOccurs="1" name="ExcludeConflicts" type="xs:boolean" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ArrayOfMailboxData">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="MailboxData" nillable="true" type="t:MailboxData" />
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="SuggestionQuality">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Excellent" />
      <xs:enumeration value="Good" />
      <xs:enumeration value="Fair" />
      <xs:enumeration value="Poor" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="SuggestionsViewOptionsType">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="GoodThreshold" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" name="MaximumResultsByDay" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" name="MaximumNonWorkHourResultsByDay" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" name="MeetingDurationInMinutes" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" name="MinimumSuggestionQuality" type="t:SuggestionQuality" />
      <xs:element minOccurs="1" maxOccurs="1" name="DetailedSuggestionsWindow" type="t:Duration" />
      <xs:element minOccurs="0" maxOccurs="1" name="CurrentMeetingTime" type="xs:dateTime" />
      <xs:element minOccurs="0" maxOccurs="1" name="GlobalObjectId" type="xs:string" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="SuggestionsViewOptions" type="t:SuggestionsViewOptionsType" />

  <xs:complexType name="ArrayOfAttendeeConflictData">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element minOccurs="1" maxOccurs="1" name="UnknownAttendeeConflictData" nillable="true" type="t:UnknownAttendeeConflictData" />
      <xs:element minOccurs="1" maxOccurs="1" name="IndividualAttendeeConflictData" nillable="true" type="t:IndividualAttendeeConflictData" />
      <xs:element minOccurs="1" maxOccurs="1" name="TooBigGroupAttendeeConflictData" nillable="true" type="t:TooBigGroupAttendeeConflictData" />
      <xs:element minOccurs="1" maxOccurs="1" name="GroupAttendeeConflictData" nillable="true" type="t:GroupAttendeeConflictData" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="AttendeeConflictData" abstract="true"/>

  <xs:complexType name="UnknownAttendeeConflictData">
    <xs:complexContent mixed="false">
      <xs:extension base="t:AttendeeConflictData" />
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="TooBigGroupAttendeeConflictData">
    <xs:complexContent mixed="false">
      <xs:extension base="t:AttendeeConflictData" />
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="IndividualAttendeeConflictData">
    <xs:complexContent mixed="false">
      <xs:extension base="t:AttendeeConflictData">
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1" name="BusyType" type="t:LegacyFreeBusyType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="GroupAttendeeConflictData">
    <xs:complexContent mixed="false">
      <xs:extension base="t:AttendeeConflictData">
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1" name="NumberOfMembers" type="xs:int" />
          <xs:element minOccurs="1" maxOccurs="1" name="NumberOfMembersAvailable" type="xs:int" />
          <xs:element minOccurs="1" maxOccurs="1" name="NumberOfMembersWithConflict" type="xs:int" />
          <xs:element minOccurs="1" maxOccurs="1" name="NumberOfMembersWithNoData" type="xs:int" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Suggestion">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="MeetingTime" type="xs:dateTime" />
      <xs:element minOccurs="1" maxOccurs="1" name="IsWorkTime" type="xs:boolean" />
      <xs:element minOccurs="1" maxOccurs="1" name="SuggestionQuality" type="t:SuggestionQuality" />
      <xs:element minOccurs="0" maxOccurs="1" name="AttendeeConflictDataArray" type="t:ArrayOfAttendeeConflictData" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ArrayOfSuggestion">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Suggestion" type="t:Suggestion" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="SuggestionDayResult">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="Date" type="xs:dateTime" />
      <xs:element minOccurs="1" maxOccurs="1" name="DayQuality" type="t:SuggestionQuality" />
      <xs:element minOccurs="0" maxOccurs="1" name="SuggestionArray" type="t:ArrayOfSuggestion" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ArrayOfSuggestionDayResult">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="SuggestionDayResult" type="t:SuggestionDayResult" />
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="OofState">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Disabled" />
      <xs:enumeration value="Enabled" />
      <xs:enumeration value="Scheduled" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ExternalAudience">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="Known" />
      <xs:enumeration value="All" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="ReplyBody">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="Message" type="xs:string" />
    </xs:sequence>

    <xs:attribute ref="xml:lang" use="optional" />
  </xs:complexType>

  <xs:complexType name="UserOofSettings">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="OofState" type="t:OofState" />
      <xs:element minOccurs="1" maxOccurs="1" name="ExternalAudience" type="t:ExternalAudience" />
      <xs:element minOccurs="0" maxOccurs="1" name="Duration" type="t:Duration" />
      <xs:element minOccurs="0" maxOccurs="1" name="InternalReply" type="t:ReplyBody" />
      <xs:element minOccurs="0" maxOccurs="1" name="ExternalReply" type="t:ReplyBody" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="OofSettings" type="t:UserOofSettings" />
  <xs:element name="UserOofSettings" type="t:UserOofSettings" />

  <!-- Value used in Message Xml -->
  <xs:complexType name="Value">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="Name" type="xs:string" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:element name="Value" type="t:Value"/>

  <!-- SP1 Id Conversion types -->
  <xs:simpleType name="IdFormatType">
    <xs:annotation>
      <xs:documentation>Surfaces the various id types that are supported for conversion</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="EwsLegacyId"/>
      <xs:enumeration value="EwsId"/>
      <xs:enumeration value="EntryId"/>
      <xs:enumeration value="HexEntryId"/>
      <xs:enumeration value="StoreId"/>
      <xs:enumeration value="OwaId"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="AlternateIdBaseType" abstract="true">
    <xs:annotation>
      <xs:documentation>
        Surfaces alternate representations of an item or folder id. No change key is included.
      </xs:documentation>
    </xs:annotation>
    <xs:attribute name="Format" type="t:IdFormatType" use="required"/>
  </xs:complexType>

  <xs:complexType name="AlternateIdType">
    <xs:annotation>
      <xs:documentation>
        Represents an alternate mailbox folder or item Id.
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:AlternateIdBaseType">
        <xs:attribute name="Id" type="xs:string" use="required"/>
        <xs:attribute name="Mailbox" type="t:NonEmptyStringType" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="AlternatePublicFolderIdType">
    <xs:annotation>
      <xs:documentation>
        Represents an alternate public folder Id.
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:AlternateIdBaseType">
        <xs:attribute name="FolderId" type="xs:string" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="AlternatePublicFolderItemIdType">
    <xs:annotation>
      <xs:documentation>
        Represents an alternate public folder item Id.
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:AlternatePublicFolderIdType">
        <xs:attribute name="ItemId" type="xs:string" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="NonEmptyArrayOfAlternateIdsType">
    <xs:annotation>
      <xs:documentation>
        A non-empty array of alternate Ids.
      </xs:documentation>
    </xs:annotation>
    <xs:choice minOccurs="1" maxOccurs="unbounded">
      <xs:element name="AlternateId" type="t:AlternateIdType"/>
      <xs:element name="AlternatePublicFolderId" type="t:AlternatePublicFolderIdType"/>
      <xs:element name="AlternatePublicFolderItemId" type="t:AlternatePublicFolderItemIdType"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="UserIdType">
    <xs:sequence>
      <xs:element name="SID" type="xs:string" minOccurs="0" maxOccurs="1" />
      <xs:element name="PrimarySmtpAddress" type="xs:string" minOccurs="0" maxOccurs="1" />
      <xs:element name="DisplayName" type="xs:string" minOccurs="0" maxOccurs="1" />
      <xs:element name="DistinguishedUser" type="t:DistinguishedUserType" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="DistinguishedUserType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Default" />
      <xs:enumeration value="Anonymous" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="ArrayOfPermissionsType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Permission" type="t:PermissionType" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="ArrayOfCalendarPermissionsType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="CalendarPermission" type="t:CalendarPermissionType" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="ArrayOfUnknownEntriesType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="UnknownEntry" type="xs:string" />
    </xs:choice>
  </xs:complexType>

  <xs:simpleType name="PermissionReadAccessType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="FullDetails" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="CalendarPermissionReadAccessType">
    <xs:restriction base ="xs:string">
      <xs:enumeration value="None"/>
      <xs:enumeration value="TimeOnly"/>
      <xs:enumeration value="TimeAndSubjectAndLocation"/>
      <xs:enumeration value="FullDetails"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="BasePermissionType" abstract="true">
    <xs:annotation>
      <xs:documentation>A permission on a folder</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="UserId" type="t:UserIdType" minOccurs="1" maxOccurs="1" />
      <xs:element name="CanCreateItems" type="xs:boolean" minOccurs="0" maxOccurs="1" />
      <xs:element name="CanCreateSubFolders" type="xs:boolean" minOccurs="0" maxOccurs="1" />
      <xs:element name="IsFolderOwner" type="xs:boolean" minOccurs="0" maxOccurs="1" />
      <xs:element name="IsFolderVisible" type="xs:boolean" minOccurs="0" maxOccurs="1" />
      <xs:element name="IsFolderContact" type="xs:boolean" minOccurs="0" maxOccurs="1" />
      <xs:element name="EditItems" type="t:PermissionActionType" minOccurs="0" maxOccurs="1" />
      <xs:element name="DeleteItems" type="t:PermissionActionType" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="PermissionType">
    <xs:annotation>
      <xs:documentation>A permission on a folder</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="t:BasePermissionType">
        <xs:sequence>
          <xs:element name="ReadItems" type="t:PermissionReadAccessType" minOccurs="0" maxOccurs="1" />
          <xs:element name="PermissionLevel" type="t:PermissionLevelType" minOccurs="1" maxOccurs="1" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="CalendarPermissionType">
    <xs:complexContent>
      <xs:extension base="t:BasePermissionType">
        <xs:sequence>
          <xs:element name="ReadItems" type="t:CalendarPermissionReadAccessType" minOccurs="0" maxOccurs="1" />
          <xs:element name="CalendarPermissionLevel" type="t:CalendarPermissionLevelType" minOccurs="1" maxOccurs="1" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:simpleType name="PermissionActionType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="Owned" />
      <xs:enumeration value="All" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="PermissionLevelType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="Owner" />
      <xs:enumeration value="PublishingEditor" />
      <xs:enumeration value="Editor" />
      <xs:enumeration value="PublishingAuthor" />
      <xs:enumeration value="Author" />
      <xs:enumeration value="NoneditingAuthor" />
      <xs:enumeration value="Reviewer" />
      <xs:enumeration value="Contributor" />
      <xs:enumeration value="Custom" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="CalendarPermissionLevelType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="Owner" />
      <xs:enumeration value="PublishingEditor" />
      <xs:enumeration value="Editor" />
      <xs:enumeration value="PublishingAuthor" />
      <xs:enumeration value="Author" />
      <xs:enumeration value="NoneditingAuthor" />
      <xs:enumeration value="Reviewer" />
      <xs:enumeration value="Contributor" />
      <xs:enumeration value="FreeBusyTimeOnly" />
      <xs:enumeration value="FreeBusyTimeAndSubjectAndLocation" />
      <xs:enumeration value="Custom" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="PermissionSetType">
    <xs:annotation>
      <xs:documentation>The set of permissions on a folder</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Permissions" type="t:ArrayOfPermissionsType" />
      <xs:element name="UnknownEntries" type="t:ArrayOfUnknownEntriesType" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="CalendarPermissionSetType">
    <xs:annotation>
      <xs:documentation>The set of permissions on a folder</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="CalendarPermissions" type="t:ArrayOfCalendarPermissionsType" />
      <xs:element name="UnknownEntries" type="t:ArrayOfUnknownEntriesType" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="EffectiveRightsType">
    <xs:sequence>
      <xs:element name="CreateAssociated" type="xs:boolean" />
      <xs:element name="CreateContents" type="xs:boolean" />
      <xs:element name="CreateHierarchy" type="xs:boolean" />
      <xs:element name="Delete" type="xs:boolean" />
      <xs:element name="Modify" type="xs:boolean" />
      <xs:element name="Read" type="xs:boolean" />
    </xs:sequence>
  </xs:complexType>

  <!-- Delegate Management types -->

  <xs:complexType name="ArrayOfDelegateUserType">
    <xs:sequence>
      <xs:element name="DelegateUser" type="t:DelegateUserType" minOccurs="1" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ArrayOfUserIdType">
    <xs:sequence>
      <xs:element name="UserId" type="t:UserIdType" minOccurs="1" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="DeliverMeetingRequestsType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="DelegatesOnly"/>
      <xs:enumeration value="DelegatesAndMe"/>
      <xs:enumeration value="DelegatesAndSendInformationToMe"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="DelegateUserType">
    <xs:sequence>
      <xs:element name="UserId" type="t:UserIdType" minOccurs="1" maxOccurs="1" />
      <xs:element name="DelegatePermissions" type="t:DelegatePermissionsType" minOccurs="0" maxOccurs="1" />
      <xs:element name="ReceiveCopiesOfMeetingMessages" type="xs:boolean" minOccurs="0" maxOccurs="1" />
      <xs:element name="ViewPrivateItems" type="xs:boolean" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="DelegatePermissionsType">
    <xs:sequence>
      <xs:element name="CalendarFolderPermissionLevel" type="t:DelegateFolderPermissionLevelType" minOccurs="0" maxOccurs="1" />
      <xs:element name="TasksFolderPermissionLevel" type="t:DelegateFolderPermissionLevelType" minOccurs="0" maxOccurs="1" />
      <xs:element name="InboxFolderPermissionLevel" type="t:DelegateFolderPermissionLevelType" minOccurs="0" maxOccurs="1" />
      <xs:element name="ContactsFolderPermissionLevel" type="t:DelegateFolderPermissionLevelType" minOccurs="0" maxOccurs="1" />
      <xs:element name="NotesFolderPermissionLevel" type="t:DelegateFolderPermissionLevelType" minOccurs="0" maxOccurs="1" />
      <xs:element name="JournalFolderPermissionLevel" type="t:DelegateFolderPermissionLevelType" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="DelegateFolderPermissionLevelType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None"/>
      <xs:enumeration value="Editor"/>
      <xs:enumeration value="Reviewer"/>
      <xs:enumeration value="Author"/>
      <xs:enumeration value="Custom"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="ConflictResultsType">
    <xs:sequence>
      <xs:element name="Count" type="xs:int"/>
    </xs:sequence>
  </xs:complexType>

</xs:schema>
