python-amazon-ad-api 1.4.6__py3-none-any.whl → 1.4.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ad_api/api/v1/__init__.py CHANGED
@@ -8,6 +8,7 @@ from .ad_associations import AdAssociations
8
8
  from .brand_store_edition_publish_versions import BrandStoreEditionPublishVersions
9
9
  from .brand_stores import BrandStores
10
10
  from .brand_store_editions import BrandStoreEditions
11
+ from .brand_store_pages import BrandStorePages
11
12
 
12
13
  __all__ = [
13
14
  "Campaigns",
@@ -20,4 +21,5 @@ __all__ = [
20
21
  "BrandStoreEditionPublishVersions",
21
22
  "BrandStores",
22
23
  "BrandStoreEditions",
24
+ "BrandStorePages",
23
25
  ]
@@ -28,6 +28,15 @@ class BrandStoreEditionPublishVersions(Client):
28
28
 
29
29
  Unlike the rest of v1, the query has no fully optional body: store, edition
30
30
  and publish status are all required, each accepting exactly one value.
31
+
32
+ ``StorePublishStatus`` declares two values but the service accepts only one:
33
+ asking for ``REVIEW_IN_PROGRESS`` answers ``400 Only DRAFT status query is
34
+ supported``. The enum is honest about what exists in the data model, not
35
+ about what can be queried.
36
+
37
+ The ``storeEditionPublishId`` in the answer is not a plain identifier but a
38
+ base64 token holding the schema version, the store, ``editionIdVersion`` and
39
+ the status -- pass it back to update unchanged.
31
40
  """
32
41
 
33
42
  @sp_endpoint('/adsApi/v1/query/brandStoreEditionPublishVersions', method='POST')
@@ -45,8 +54,10 @@ class BrandStoreEditionPublishVersions(Client):
45
54
  | **storeIdFilter** (dict) [required]
46
55
  | **include** (list<string>) : exactly one store id
47
56
  | **publishStatusFilter** (dict) [required]
48
- | **include** (list<StorePublishStatus>) : exactly one of
49
- Enum [ DRAFT, REVIEW_IN_PROGRESS ]
57
+ | **include** (list<StorePublishStatus>) : exactly one value.
58
+ The contract declares [ DRAFT, REVIEW_IN_PROGRESS ] but the
59
+ service rejects the second one with
60
+ "400 Only DRAFT status query is supported". Send DRAFT.
50
61
  | **maxResults** (int) [optional]
51
62
  | **nextToken** (string) [optional]
52
63
 
@@ -0,0 +1,63 @@
1
+ from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
+
3
+
4
+ class BrandStorePages(Client):
5
+ r"""
6
+ BrandStorePages(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)
7
+
8
+ Amazon Ads API v1 - unified BrandStorePages endpoints
9
+
10
+ One route, the query:
11
+
12
+ POST /adsApi/v1/query/brandStorePages
13
+
14
+ Permissions (either): ``amazon_stores_edit`` or ``amazon_stores_view``.
15
+
16
+ Three filters are required and each accepts exactly one value:
17
+ ``storeIdFilter``, ``editionIdFilter`` and ``pageIdFilter``. There is no way to
18
+ list every page of a store through this route -- the page identifiers come
19
+ from :class:`~ad_api.api.v1.BrandStores`, whose ``pageInfos`` carries one
20
+ ``tag`` per page, and that tag is the ``pageId`` used here.
21
+
22
+ A fourth filter, ``storeEditionPublishIdFilter``, is optional and takes the
23
+ base64 token from BrandStoreEditionPublishVersions.
24
+
25
+ The answer carries ``content``, the page body itself, which is why this
26
+ contract is far larger than its siblings. Read the shape before dumping it.
27
+ """
28
+
29
+ @sp_endpoint('/adsApi/v1/query/brandStorePages', method='POST')
30
+ def query_brand_store_pages(self, **kwargs) -> ApiResponse:
31
+ r"""
32
+ query_brand_store_pages(body: dict) -> ApiResponse
33
+
34
+ Amazon Ads API v1 - Query BrandStorePages (operationId: QueryBrandStorePage)
35
+
36
+ Requires one of these permissions: ["amazon_stores_edit", "amazon_stores_view"]
37
+
38
+ Request Body [Required]
39
+ | **storeIdFilter** (dict) [required]
40
+ | **include** (list<string>) : exactly one store id
41
+ | **editionIdFilter** (dict) [required]
42
+ | **include** (list<string>) : exactly one edition id, "default"
43
+ for a store's default edition
44
+ | **pageIdFilter** (dict) [required]
45
+ | **include** (list<string>) : exactly one page id, the tag seen
46
+ in BrandStores' pageInfos
47
+ | **storeEditionPublishIdFilter** (dict) [optional]
48
+ | **include** (list<string>) : one base64 publish token
49
+ | **maxResults** (int) [optional]
50
+ | **nextToken** (string) [optional]
51
+
52
+ Returns
53
+ ApiResponse. ``payload`` holds ``brandStorePages`` and ``nextToken``.
54
+ Each page carries ``storeId``, ``editionId``, ``pageId``, ``pageType``,
55
+ ``content`` and, when published, ``storeEditionPublishId`.
56
+ """
57
+ headers = {"Accept": "application/json", "Content-Type": "application/json"}
58
+ return self._request(
59
+ kwargs.pop('path'),
60
+ data=Utils.convert_body(kwargs.pop('body'), False),
61
+ params=kwargs,
62
+ headers=headers,
63
+ )
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.4.6"
1
+ __version__ = "1.4.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 1.4.6
3
+ Version: 1.4.8
4
4
  Summary: Python wrapper for the Amazon Advertising API
5
5
  Home-page: https://github.com/denisneuf/python-amazon-ad-api
6
6
  Author: Daniel Alvaro
@@ -310,6 +310,7 @@ The v1 API lives under `/adsApi/v1/` and is **not** split by product: every call
310
310
  * [Brand Store Edition Publish Versions](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/brand_store_edition_publish_versions.html#ad_api.api.v1.BrandStoreEditionPublishVersions.BrandStoreEditionPublishVersions.query_brand_store_edition_publish_versions)
311
311
  * [Brand Stores](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/brand_stores.html#ad_api.api.v1.BrandStores.BrandStores.query_brand_stores)
312
312
  * [Brand Store Editions](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/brand_store_editions.html#ad_api.api.v1.BrandStoreEditions.BrandStoreEditions.list_brand_store_editions)
313
+ * [Brand Store Pages](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/brand_store_pages.html#ad_api.api.v1.BrandStorePages.BrandStorePages.query_brand_store_pages)
313
314
 
314
315
 
315
316
  ### [Modules Available Sponsored Products](https://python-amazon-ad-api.readthedocs.io/en/latest/sp.html)
@@ -1,5 +1,5 @@
1
1
  ad_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- ad_api/version.py,sha256=0optyte4cOxIRRV4Vdh_XYGrxTLJSuPWvhUDQkXvb4U,22
2
+ ad_api/version.py,sha256=F1u2mSK8Wly-J_mt7oHk_RJLir3nEN_Ri1OneijYSlc,22
3
3
  ad_api/api/__init__.py,sha256=TLMefdmuyrj3-vtxGlzX4Sl-lHmE3Rs6daYgw3zwO0c,1600
4
4
  ad_api/api/account.py,sha256=CmOvCfHoPWaeTUJvtB0pNoNulZVSz4oMMCKIpVTpHos,2931
5
5
  ad_api/api/account_budgets.py,sha256=jFce5eLWAFK3ydjnYR7_Sv7B0-gHTG5bMTx_TcHyy1A,2319
@@ -89,14 +89,15 @@ ad_api/api/sp/product_recommendations.py,sha256=vXoZIRqcFc5bo9MUprArKndxcEYe_Puy
89
89
  ad_api/api/sp/product_targeting_v3.py,sha256=vk_T0piHzP5uwt8HSHm5hFKP_0sXJD8nbyooPtM-BTs,9567
90
90
  ad_api/api/sp/ranked_keywords_recommendations.py,sha256=QYFje19TFmwhedh7sn5VJIypL8gp6d6tpBQCpf_SIXw,13094
91
91
  ad_api/api/sp/schedule_based_bid_optimization.py,sha256=G8VkS7iP1lTIAxZgbfRCLz8njw1DkVH9HQPOZ63pWNU,2371
92
- ad_api/api/v1/__init__.py,sha256=Z4bhSFEyWu6SaSLH4kuYw_wAnp0tOR-KO2zqwqhAf0w,652
92
+ ad_api/api/v1/__init__.py,sha256=leVUKT8N-3DriGfI-VDKFnIEtcqNSyFiHfeN2dfBAVQ,722
93
93
  ad_api/api/v1/ad_associations.py,sha256=g5L8hAIagmsb-yQ09hP7z1zbVVe868NlpOOokv-Mouc,5812
94
94
  ad_api/api/v1/ad_extensions.py,sha256=kL-7xHaXXqb2jXTwZrY0oGttLAG0CW_IjBAqL_CI92U,5519
95
95
  ad_api/api/v1/ad_groups.py,sha256=pQhCVdve_O6kbL4mBA5bxxhKcKNl_BKqa7z9DvrxwaM,12626
96
96
  ad_api/api/v1/ads.py,sha256=YwZGQ-4WuYquleELtwRI9L8w0fGw7FBRejQE-tZ5hKY,7941
97
97
  ad_api/api/v1/advertiser_accounts.py,sha256=_Y8GTHgQ2G-RhNg4cuvvfXvjIhLzstQAGSyr1WMRRfg,5405
98
- ad_api/api/v1/brand_store_edition_publish_versions.py,sha256=Q8smB7zJJ1cEkYrCEo3_Ws9QICUcBOvB03eM77rlF4I,4258
98
+ ad_api/api/v1/brand_store_edition_publish_versions.py,sha256=QFmcWMPwi0f7eW0Ox4pZCvMWHEzeeQc8dIq7_3eeg6Y,4898
99
99
  ad_api/api/v1/brand_store_editions.py,sha256=xW4z2jDWhNJn86tWlT3eLIRr0NEpxLhW1eA-T_hiXcI,2160
100
+ ad_api/api/v1/brand_store_pages.py,sha256=TrSQbqlXqFv7i7RooxlFZOBrwYfEMPLvRPSJ9FjO87o,2765
100
101
  ad_api/api/v1/brand_stores.py,sha256=zlBsKiOwmdSiIG9filgdqUlPnV6AX-gE6S5nNyAQACc,2131
101
102
  ad_api/api/v1/campaigns.py,sha256=u5PlvoAhgVhMxbCvYkPgqtbYK3TXXcb7TMie0Qjrgwc,9573
102
103
  ad_api/api/v1/targets.py,sha256=a4BzPjg9m1JJwqphhpQOFkNIcgCw7v4-K0sNzOihMZI,12355
@@ -115,8 +116,8 @@ ad_api/base/exceptions.py,sha256=9D3M40ZIlLS0fA-aQh1BTWPOW-Nvf0tRhbA85jFnDJ4,438
115
116
  ad_api/base/helpers.py,sha256=UK7Q13vZ0mNdF54xzfzoGDn2O_cd2yPrK2X4rOzC41c,2334
116
117
  ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4657
117
118
  ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
118
- python_amazon_ad_api-1.4.6.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
119
- python_amazon_ad_api-1.4.6.dist-info/METADATA,sha256=iZZY2_uz3F3hsgJ33h4d5JUYJ86RDeftOAeDLp70q2I,22659
120
- python_amazon_ad_api-1.4.6.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
121
- python_amazon_ad_api-1.4.6.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
122
- python_amazon_ad_api-1.4.6.dist-info/RECORD,,
119
+ python_amazon_ad_api-1.4.8.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
120
+ python_amazon_ad_api-1.4.8.dist-info/METADATA,sha256=J5eizsL_okNqaRHdrfPb-y4IOyhQCxsGfUrbuxOlDXo,22832
121
+ python_amazon_ad_api-1.4.8.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
122
+ python_amazon_ad_api-1.4.8.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
123
+ python_amazon_ad_api-1.4.8.dist-info/RECORD,,