Skip to content

Commit

Permalink
Update the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
damien.rabois committed Jun 29, 2023
1 parent 13db2ee commit f86269d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog`_ and this project adheres to
`Semantic Versioning`_.

[1.4.0] - 2023-06-29
--------------------
Changed
*******
* Allow `update_offers` to accept more code types when passing a dictionary

[1.3.0] - 2021-01-07
--------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
author = u'Taurus Olson'

# The short X.Y version
version = u'1.1.8'
version = u'1.4.0'
# The full version, including alpha/beta/rc tags
release = u'1.1.8'
release = u'1.4.0'


# -- General configuration ---------------------------------------------------
Expand Down
34 changes: 33 additions & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,24 @@ Let's create some offers in our catalog::
'offer_reference':'B067-F0D-75E',
'price':20, 'product_state':11, 'quantity':16,
'description': 'New product - 2-3 days shipping, from France'}
offer_data3 = {'product_reference':{'value': '9780262510875', 'type': 'Ean'},
'offer_reference':'B76A-CD5-444',
'price':80.0, 'product_state':11, 'quantity':10,
'description': 'New product - 2-3 days shipping, from France'}
offer_data4 = {'product_reference': {'value': '1593275919', 'type': 'Isbn'},
'offer_reference': 'A31F-B6C-95F',
'price': 30.0, 'product_state': 11, 'quantity': 1,
'description': 'New product - 2-3 days shipping, from France'
}

response = manager.update_offers([offers_data1, offer_data2, offer_data3, offer_data4])


response = manager.update_offers([offers_data1, offer_data2])
.. note::
Note that the `product_reference` key can be a string (by default an EAN) or
a dictionary which allows you to specify the code value and its type.
(cf https://partners-test.mp.fnacdarty.com/docs/api/2.6/services/type/state.html#product-reference-type
for a detailed list)

Behind the scene, the manager sent an XML request to the `offers_update`
service. We can have a look at this request with the attribute `offers_update_request`::
Expand All @@ -61,6 +77,22 @@ service. We can have a look at this request with the attribute `offers_update_re
<quantity>16</quantity>
<description><![CDATA[New product - 2-3 days shipping, from France]]></description>
</offer>
<offer>
<product_reference type="Ean">9780262510875</product_reference>
<offer_reference type="SellerSku"><![CDATA[B76A-CD5-444]]></offer_reference>
<price>80.0</price>
<product_state>11</product_state>
<quantity>10</quantity>
<description><![CDATA[New product - 2-3 days shipping, from France]]></description>
</offer>
<offer>
<product_reference type="Isbn">1593275919</product_reference>
<offer_reference type="SellerSku"><![CDATA[A31F-B6C-95F]]></offer_reference>
<price>30.0</price>
<product_state>11</product_state>
<quantity>1</quantity>
<description><![CDATA[New product - 2-3 days shipping, from France]]></description>
</offer>
</offers_update>

Actually this request is an instance of the :class:`Request <Request>` class.
Expand Down

0 comments on commit f86269d

Please sign in to comment.