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

  <xs:simpleType name="InformationClassEnum">
    <xs:restriction base="xs:NCName">
      <xs:enumeration value="User"/>
      <xs:enumeration value="Computer"/>
      <xs:enumeration value="VirtualSession"/>
      <xs:enumeration value="Ticket"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="PolicyEnum">
    <xs:restriction base="xs:NCName">
      <xs:enumeration value="Default"/>
      <xs:enumeration value="Mandatory"/>
      <xs:enumeration value="Hidden"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="TicketTypeEnum">
    <xs:restriction base="xs:NCName">
      <xs:enumeration value="Ticket"/>
      <xs:enumeration value="UnclassifiedTicket"/>
      <xs:enumeration value="Incident"/>
      <xs:enumeration value="ServiceRequest"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="TicketCompletitionPolicyEnum">
    <xs:restriction base="xs:NCName">
      <xs:enumeration value="ifRequired"/>
      <xs:enumeration value="IfRequired"/>
      <xs:enumeration value="never"/>
      <xs:enumeration value="always"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="TicketProcessingEnum">
    <xs:restriction base="xs:NCName">
      <xs:enumeration value="intern"/>
      <xs:enumeration value="extern"/>
      <xs:enumeration value="both"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="TicketExternalOpenModeEnum">
    <xs:restriction base="xs:NCName">
      <xs:enumeration value="None"/>
      <xs:enumeration value="Preview"/>
      <xs:enumeration value="Edit"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="HorizontalAlignmentEnum">
    <xs:restriction base="xs:NCName">
      <xs:enumeration value="Default"/>
      <xs:enumeration value="Right"/>
      <xs:enumeration value="Center"/>
      <xs:enumeration value="Left"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="StringNode">
    <xs:attribute name="Policy" type="PolicyEnum" use="required"/>
    <xs:attribute name="Value" type="xs:string" use="required"/>
  </xs:complexType>

  <xs:complexType name="IntegerNode">
    <xs:attribute name="Policy" type="PolicyEnum" use="required"/>
    <xs:attribute name="Value" type="xs:integer" use="required"/>
  </xs:complexType>

  <xs:complexType name="BoolNode">
    <xs:attribute name="Policy" type="PolicyEnum" use="required"/>
    <xs:attribute name="Value" type="xs:boolean" use="required"/>
  </xs:complexType>

  <xs:complexType name="PolicyNode">
    <xs:attribute name="Policy" type="PolicyEnum" use="required"/>
  </xs:complexType>

  <xs:element name="F4SD-Global-Configuration">
    <xs:complexType>
      <xs:all>
        <xs:element name="ShouldSkipSlimView" minOccurs="0" maxOccurs="1">
          <xs:complexType><xs:complexContent><xs:extension base="BoolNode"></xs:extension></xs:complexContent></xs:complexType>
        </xs:element>
        <xs:element name="SmallViewAlignment" minOccurs="0" maxOccurs="1">
          <xs:complexType> <xs:complexContent><xs:extension base="PolicyNode">
                <xs:attribute name="Value" type="HorizontalAlignmentEnum" use="required"/>
          </xs:extension></xs:complexContent></xs:complexType>
        </xs:element>
        <xs:element name="FavouriteBarAlignment" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="PolicyNode">
                <xs:attribute name="Value" type="HorizontalAlignmentEnum" use="required"/>
              </xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
        <xs:element ref="InformationClassSearchPriority" minOccurs="0" maxOccurs="1"/>
        <xs:element ref="TicketConfiguration" minOccurs="0" maxOccurs="1"/>
        <xs:element name="UseGamification" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="BoolNode"></xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
        <xs:element ref="IntuneConfiguration" minOccurs="0" maxOccurs="1" />
      </xs:all>
    </xs:complexType>
  </xs:element>

  <xs:element name="InformationClassSearchPriority">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="PolicyNode">
          <xs:sequence>
            <xs:element ref="InformationClass" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:element name="InformationClass">
    <xs:complexType>
        <xs:attribute name="Type" type="InformationClassEnum" use="required"/>
    </xs:complexType>
    </xs:element>

  <xs:simpleType name="TicketFilterMatchEnum">
    <xs:restriction base="xs:string">
      <xs:enumeration value="include"/>
      <xs:enumeration value="exclude"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="TicketFilterEmptyHandlingEnum">
    <xs:restriction base="xs:string">
      <xs:enumeration value="include"/>
      <xs:enumeration value="exclude"/>
      <xs:enumeration value="only"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="TicketConfiguration">
    <xs:complexType>
      <xs:all>
        <xs:element name="NotesMandatory" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="BoolNode"></xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="DisableAutomaticTimeTracking" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="BoolNode"></xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="CompletitionPolicy" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="PolicyNode">
                <xs:attribute name="Value" type="TicketCompletitionPolicyEnum" use="required"/>
              </xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="UseSimplifiedCaseCompletionDialog" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="BoolNode"></xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="SimplifiedCaseCompletionTicketOpenMode" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="PolicyNode">
                <xs:attribute name="Value" type="TicketExternalOpenModeEnum" use="required"/>
              </xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="ShowOverview" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="BoolNode"></xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>

        <xs:element name="TicketFilters" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Filter" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="Value" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:attribute name="ID" type="xs:string" use="optional"/>
                        <xs:attribute name="Name" type="xs:string" use="optional"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="Provider" type="xs:string" use="optional"/>
                  <xs:attribute name="Field" type="xs:string" use="required"/>
                  <xs:attribute name="Enabled" type="xs:boolean" use="optional" default="false"/>
                  <xs:attribute name="Match" type="TicketFilterMatchEnum" use="optional" default="exclude"/>
                  <xs:attribute name="EmptyHandling" type="TicketFilterEmptyHandlingEnum" use="optional" default="include"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>

        <xs:element name="TicketProcessing" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="TicketTypeProcessing" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="Type" type="TicketTypeEnum" use="required"/>
                  <xs:attribute name="Value" type="TicketProcessingEnum" use="required"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="Policy" type="PolicyEnum" use="required"/>
            <xs:attribute name="Value" type="TicketProcessingEnum" use="required"/>
          </xs:complexType>
        </xs:element>

        <xs:element name="OpenActivitiesExternally" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="OpenActivityOverride" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="ActivityType" type="xs:string" use="required"/>
                  <xs:attribute name="Value" type="xs:boolean" use="required"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="Policy" type="PolicyEnum" use="required"/>
            <xs:attribute name="Value" type="xs:boolean" use="required"/>
          </xs:complexType>
        </xs:element>

        <xs:element name="OverviewPollingPersonal" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="PolicyNode">
                <xs:attribute name="Value" type="xs:positiveInteger" use="required"/>
              </xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="OverviewPollingRole" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="PolicyNode">
                <xs:attribute name="Value" type="xs:positiveInteger" use="required"/>
              </xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
      </xs:all>
    </xs:complexType>
  </xs:element>

<xs:element name="IntuneConfiguration">
	<xs:complexType>
		<xs:all>
			<xs:element name="TAPLifeTimeInMinutes" minOccurs="0" maxOccurs="1">
				<xs:complexType>
					<xs:complexContent>
						<xs:extension base="PolicyNode">
							<xs:attribute name="Value" type="xs:positiveInteger" use="required"/>
						</xs:extension>
					</xs:complexContent>
				</xs:complexType>
			</xs:element>

			<xs:element name="TAPIsUsableOnce" minOccurs="0" maxOccurs="1">
				<xs:complexType>
					<xs:complexContent>
						<xs:extension base="BoolNode"/>
					</xs:complexContent>
				</xs:complexType>
			</xs:element>

		</xs:all>
	</xs:complexType>
</xs:element>
</xs:schema>
