<?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: Export Attributes - response schema</xs:documentation>
    <xs:documentation>Provides details for attributes.</xs:documentation>
    <xs:documentation>Version 1.0 : 2017-10-04.  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="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:attribute name="processingdate" type="xs:dateTime" 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="attributes">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="attribute">
                <xs:complexType>
                  <xs:all>
                    <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="lastupdated" type="xs:dateTime" use="optional" />
                        <xs:attribute name="lastupdatedby" type="xs:string" use="optional" />
                      </xs:complexType>
                    </xs:element>
                  </xs:all>
                  <xs:attribute name="entity" use="required">
                    <xs:annotation>
                      <xs:documentation>The entity against which the attribute is defined.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:enumeration value="Basket" />
                        <xs:enumeration value="Product" />
                        <xs:enumeration value="Campaign" />
                        <xs:enumeration value="Collateral" />
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:attribute>
                  <xs:attribute name="token" type="xs:string" use="required">
                    <xs:annotation>
                      <xs:documentation>The token used to uniquely identify the attribute. The token is provided when importing and exporting values and when submitting values with products or baskets.</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="display" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation>A display name for the attribute</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="system" type="xs:boolean" use="optional">
                    <xs:annotation>
                      <xs:documentation>Flag indicating whether the attribute is created by the system.</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="showinproductlist" type="xs:boolean" use="optional">
                    <xs:annotation>
                      <xs:documentation>For Product attributes only, flag indicating whether to show values with products in product selection lists.</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="canoverridefrombasketline" type="xs:boolean" use="optional">
                    <xs:annotation>
                      <xs:documentation>For Product attributes only, flag indicating whether values provided with basket lines should be used to override values defined against the product.</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:all>
      <xs:anyAttribute processContents="skip" />
    </xs:complexType>
  </xs:element>
</xs:schema>