<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:documentation>Title: Generate Voucher Codes Import Request Schema</xs:documentation>
    <xs:documentation>The details to control the generation of voucher codes through the services</xs:documentation>
    <xs:documentation>Version 1.0 : 2017-12-01.  Initial schema creation.</xs:documentation>
    <xs:documentation>Version 1.1 : 2018-04-18.  Company key is now optional as it is provided in the REST url (though required for WCF).</xs:documentation>
  </xs:annotation>
  <xs:element name="import">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="1" maxOccurs="1" name="generatecodes">
          <xs:complexType>
            <xs:all>
              <xs:element minOccurs="0" maxOccurs="1" name="couponname" type="xs:string">
                <xs:annotation>
                  <xs:documentation>Optionally provide a coupon name.  Either the coupon key attribute or Coupon Name element must be supplied.</xs:documentation>
                </xs:annotation>
              </xs:element>
            </xs:all>
            <xs:attribute name="generatecount" use="required">
              <xs:annotation>
                <xs:documentation>The number of codes to generate.</xs:documentation>
              </xs:annotation>
              <xs:simpleType>
                <xs:restriction base="xs:integer">
                  <xs:maxInclusive value="100000" />
                  <xs:minInclusive value="1" />
                </xs:restriction>
              </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="issuenow" type="xs:boolean" use="optional">
              <xs:annotation>
                <xs:documentation>Indicate whether the generated codes should be generated with a status of 'Issued' or not.  By default codes will be generated with a status of 'Created' - in which case they are not available for use until they have been issued.</xs:documentation>
              </xs:annotation>
            </xs:attribute>
          </xs:complexType>
        </xs:element>
      </xs:all>
      <xs:attribute name="couponkey" use="optional">
        <xs:annotation>
          <xs:documentation>The unique coupon key assigned to the coupon for which codes will be generated.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:maxLength value="200" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="companykey" type="xs:string" use="optional">
        <xs:annotation>
          <xs:documentation>The company key assigned to your company.  To view the company key navigate to Configuration / Manage Company.</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:anyAttribute processContents="skip" />
    </xs:complexType>
  </xs:element>
</xs:schema>