<?xml version="1.0" encoding="UTF-8"?>
<xs:schema version="1.0" targetNamespace="com.adition.dbt.product.async"
  xmlns:ns1="com.adition.dbt.product.async"
  
  xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:complexType name="addOrUpdateCategoryOperation">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Add a category if not exists, otherwise update it.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="ns1:batchOperation">
      <xs:sequence>
              <xs:element name="parentExternalId" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the parent externalId of this category. If category does not exist, creates category with externalId but without a name
or parent.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="name" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the name of this category]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="addOrUpdateCustomAttributeOperation">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Add a custom attribute to a product if it doesn't exist, otherwise update it. The attribute must be defined.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="ns1:batchOperation">
      <xs:sequence>
              <xs:element name="attributeName" type="xs:string" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the name of the attribute, corresponds to the name in the AttributeDefinition]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="attributeValue" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the value of the attribute.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="addOrUpdateProductOperation">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Add a product if it doesn't exist, otherwise update it.]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="ns1:batchOperation">
      <xs:sequence>
              <xs:element name="parentExternalId" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the parent products externalId. Parent product has to exist, otherwise this will not be stored.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="ean" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the EAN code]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="name" type="xs:string" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the name of the product]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="description" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the description]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="deeplink" type="xs:string" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the deeplink for the product]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="price" type="xs:decimal" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the price of the product]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="oldPrice" type="xs:decimal" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the previous price of the product]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="stock" type="xs:int" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the stock of the product]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="image" type="xs:string" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the products image]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="topSeller" type="xs:boolean" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Check if this product is a topseller]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="novelty" type="xs:boolean" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Check if this product is a novelty]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="validFrom" type="xs:dateTime" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get date from which this product is valid from]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="validTo" type="xs:dateTime" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the date until which this product is valid]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="categoryExternalIds" type="xs:string" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the externalIds of the categories this product is attached to.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="customAttributes" type="ns1:customAttribute" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the custom attributes attached to this product]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="batchOperation" abstract="true">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Base class for all batch operations]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
              <xs:element name="externalId" type="xs:string" minOccurs="1">
              </xs:element>
              <xs:element name="operationId" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get optional id for this operation, as provided by the client. Clients can use this to make an operation identifiable by them
in case of failure.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="customAttribute" final="#all">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Custom product attribute]]>
    </xs:documentation>
  </xs:annotation>
       <xs:sequence>
              <xs:element name="attributeName" type="xs:string" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the name of the attribute, corresponds to the name in the AttributeDefinition]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="attributeValue" type="xs:string" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the value of the attribute.]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
</xs:complexType>

<xs:complexType name="deleteCategoryOperation">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Delete a category]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="ns1:batchOperation">
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="deleteCustomAttributeOperation">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Delete a custom attribute]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="ns1:batchOperation">
      <xs:sequence>
              <xs:element name="attributeName" type="xs:string" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the name of the attribute, corresponds to the name in the AttributeDefinition]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="deleteProductOperation">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Delete a product]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="ns1:batchOperation">
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="updateProductInventoryOperation">
  <xs:annotation>
    <xs:documentation>
      <![CDATA[Update common volatile product attributes]]>
    </xs:documentation>
  </xs:annotation>
   <xs:complexContent>
    <xs:extension base="ns1:batchOperation">
      <xs:sequence>
              <xs:element name="price" type="xs:decimal" minOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the price of the product]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="oldPrice" type="xs:decimal" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the previous price of the product]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="stock" type="xs:int" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Get the stock of the product]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="topSeller" type="xs:boolean" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Check if this product is a topseller]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
              <xs:element name="novelty" type="xs:boolean" minOccurs="0">
              <xs:annotation>
                <xs:documentation>
                  <![CDATA[Check if this product is a novelty]]>
                </xs:documentation>
              </xs:annotation>
              </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

</xs:schema>