<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:simpleType name="SupportedApiVersions">
    <xs:restriction base="xs:string">
      <xs:enumeration value="No">
        <xs:annotation>
          <xs:documentation>Service version dedicated to internal plugins, can't be used outside of the iiko.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="V5">
        <xs:annotation>
          <xs:documentation>API V5.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="V6">
        <xs:annotation>
          <xs:documentation>API V6.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="V7">
        <xs:annotation>
          <xs:documentation>API V7.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="V7Preview7">
        <xs:annotation>
          <xs:documentation>API V7Preview7.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="V8">
        <xs:annotation>
          <xs:documentation>API V8.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="AnyUnsupportedApiVersion">
    <xs:restriction base="xs:string" />
  </xs:simpleType>
  <xs:simpleType name="ApiVersion">
    <xs:union memberTypes="SupportedApiVersions AnyUnsupportedApiVersion"/>
  </xs:simpleType>
  <xs:simpleType name="ClassLibraryFileName">
    <xs:restriction base="xs:string">
      <xs:pattern value=".*\.dll"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="Manifest">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded">
        <xs:element name="FileName" type="ClassLibraryFileName" minOccurs="1" maxOccurs="1">
          <xs:annotation>
            <xs:documentation>Plugin file name. That file have to be a .Net assembly (class library, *.dll) containing a class implementing IFrontPlugin interface.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="TypeName" type="xs:string" minOccurs="1" maxOccurs="1">
          <xs:annotation>
            <xs:documentation>Plugin class name, including namespace. That class have to implement IFrontPlugin interface and expose public default constructor.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="ApiVersion" type="ApiVersion" minOccurs="1" maxOccurs="1">
          <xs:annotation>
            <xs:documentation>API version which is used by the plugin. Is determined by IFrontPlugin interface, which the plugin class (specified in TypeName) implements.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="LicenseModuleId" type="xs:int" minOccurs="0" maxOccurs="1">
          <xs:annotation>
            <xs:documentation>Specifies plugin's licensable module identifier.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="IsSingleInstance" type="xs:boolean" minOccurs="0" maxOccurs="1">
          <xs:annotation>
            <xs:documentation>Specifies plugin which allows only single instance per iikoFront group. While all plugin instances are loaded by each iikoFront by default, this attribute restricts only one iikoFront to load single plugin instance.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="RestartOnCrash" type="xs:boolean" minOccurs="0" maxOccurs="1">
          <xs:annotation>
            <xs:documentation>Whether iikoFront app should restart the plugin if it crashes.</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
