<?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: Configure Reporting Codes - List - response schema</xs:documentation>
    <xs:documentation>A list of reporting codes</xs:documentation>
    <xs:documentation>Version 1.0 : 2018-11-05.  Initial schema creation</xs:documentation>
  </xs:annotation>
  <xs:element name="response">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" maxOccurs="1" name="summary">
          <xs:complexType>
            <xs:all>
              <xs:element minOccurs="0" maxOccurs="1" name="status">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:enumeration value="ValidatedOk" />
                    <xs:enumeration value="ValidationFailed" />
                    <xs:enumeration value="EmptyResult" />
                    <xs:enumeration value="Retrieved" />
                    <xs:enumeration value="Inserted" />
                    <xs:enumeration value="Updated" />
                    <xs:enumeration value="Deleted" />
                    <xs:enumeration value="Error" />
                    <xs:enumeration value="NoAction" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element minOccurs="0" maxOccurs="1" name="action">
                <xs:annotation>
                  <xs:documentation>The Name of the API service action</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="id" type="xs:integer" use="optional">
                        <xs:annotation>
                          <xs:documentation>The Id of the API service action</xs:documentation>
                        </xs:annotation>
                      </xs:attribute>
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" maxOccurs="1" name="messages">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="unbounded" name="message">
                      <xs:annotation>
                        <xs:documentation>The message text.</xs:documentation>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute name="code" type="xs:string" use="optional">
                              <xs:annotation>
                                <xs:documentation>The code associated with the message.</xs:documentation>
                              </xs:annotation>
                            </xs:attribute>
                            <xs:attribute name="for" type="xs:string" use="optional" />
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:all>
            <xs:attribute name="result" type="xs:boolean" use="optional">
              <xs:annotation>
                <xs:documentation>Flag indicating whether the process completed without errors.</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="filtered" type="xs:boolean" use="optional" />
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="1" name="pagination">
          <xs:complexType>
            <xs:all>
              <xs:element minOccurs="0" maxOccurs="1" name="page">
                <xs:annotation>
                  <xs:documentation>The selected page</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:integer">
                    <xs:minInclusive value="1" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element minOccurs="0" maxOccurs="1" name="pagesize">
                <xs:annotation>
                  <xs:documentation>The number of items per page</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:integer">
                    <xs:maxInclusive value="500" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element minOccurs="0" maxOccurs="1" name="totalitemcount" type="xs:integer">
                <xs:annotation>
                  <xs:documentation>The total number of items available to be exported</xs:documentation>
                </xs:annotation>
              </xs:element>
              <xs:element minOccurs="0" maxOccurs="1" name="totalpagecount" type="xs:integer">
                <xs:annotation>
                  <xs:documentation>The total estimated page count, based on the requested page size.</xs:documentation>
                </xs:annotation>
              </xs:element>
            </xs:all>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="1" name="reportingcodes">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="reportingcode">
                <xs:complexType>
                  <xs:all>
                    <xs:element minOccurs="1" maxOccurs="1" name="code">
                      <xs:annotation>
                        <xs:documentation>The unique code for reporting</xs:documentation>
                      </xs:annotation>
                      <xs:simpleType>
                        <xs:restriction base="xs:string">
                          <xs:minLength value="1" />
                          <xs:maxLength value="50" />
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="description">
                      <xs:annotation>
                        <xs:documentation>A description for the reporting code</xs:documentation>
                      </xs:annotation>
                      <xs:simpleType>
                        <xs:restriction base="xs:string">
                          <xs:maxLength value="10000" />
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="statistics">
                      <xs:complexType>
                        <xs:attribute name="created" type="xs:dateTime" use="optional" />
                        <xs:attribute name="createdby" type="xs:string" use="optional" />
                        <xs:attribute name="createdbysource" use="optional">
                          <xs:simpleType>
                            <xs:restriction base="xs:string">
                              <xs:enumeration value="Portal" />
                              <xs:enumeration value="Services" />
                              <xs:enumeration value="CompanyTransfer" />
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="lastupdated" type="xs:dateTime" use="optional" />
                        <xs:attribute name="lastupdatedby" type="xs:string" use="optional" />
                        <xs:attribute name="lastupdatedbysource" use="optional">
                          <xs:simpleType>
                            <xs:restriction base="xs:string">
                              <xs:enumeration value="Portal" />
                              <xs:enumeration value="Services" />
                              <xs:enumeration value="CompanyTransfer" />
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:attribute>
                      </xs:complexType>
                    </xs:element>
                  </xs:all>
                  <xs:attribute name="category" use="required">
                    <xs:annotation>
                      <xs:documentation>The reporting code category</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:enumeration value="Promotion" />
                        <xs:enumeration value="CampaignCoupon" />
                        <xs:enumeration value="MissedPromotion" />
                        <xs:enumeration value="GiftCard" />
                        <xs:enumeration value="GiftCardWithdrawal" />
                        <xs:enumeration value="GiftCardAdjustment" />
                        <xs:enumeration value="GiftCardRedemption" />
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:attribute>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:all>
      <xs:anyAttribute processContents="skip" />
    </xs:complexType>
  </xs:element>
</xs:schema>