python-amazon-ad-api 1.4.2__py3-none-any.whl → 1.4.3__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
@@ -5,6 +5,7 @@ from .targets import Targets
5
5
  from .ad_extensions import AdExtensions
6
6
  from .advertiser_accounts import AdvertiserAccounts
7
7
  from .ad_associations import AdAssociations
8
+ from .brand_store_edition_publish_versions import BrandStoreEditionPublishVersions
8
9
 
9
10
  __all__ = [
10
11
  "Campaigns",
@@ -14,4 +15,5 @@ __all__ = [
14
15
  "AdExtensions",
15
16
  "AdvertiserAccounts",
16
17
  "AdAssociations",
18
+ "BrandStoreEditionPublishVersions",
17
19
  ]
@@ -0,0 +1,98 @@
1
+ from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
+
3
+
4
+ class BrandStoreEditionPublishVersions(Client):
5
+ r"""
6
+ BrandStoreEditionPublishVersions(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)
7
+
8
+ Amazon Ads API v1 - unified BrandStoreEditionPublishVersions endpoints
9
+
10
+ Two routes, neither of which creates or deletes anything: a store edition
11
+ publish version is queried, and its state is moved between draft and
12
+ publish.
13
+
14
+ Permissions: ``amazon_stores_view`` or ``amazon_stores_edit`` for the
15
+ query, ``amazon_stores_edit`` alone for the update. This is Amazon Stores,
16
+ not DSP.
17
+
18
+ Two enums live here and they are not interchangeable:
19
+
20
+ - ``StorePublishState`` -- ``DRAFT`` or ``PUBLISH``. What the caller
21
+ decides, and the only one the update accepts.
22
+ - ``StorePublishStatus`` -- ``DRAFT`` or ``REVIEW_IN_PROGRESS``. Where
23
+ the content currently sits, and the only one the query filters on.
24
+
25
+ The two differ by one letter in the name and share the ``DRAFT`` value, so
26
+ sending one where the other belongs is a rejected request rather than a
27
+ silent mismatch.
28
+
29
+ Unlike the rest of v1, the query has no fully optional body: store, edition
30
+ and publish status are all required, each accepting exactly one value.
31
+ """
32
+
33
+ @sp_endpoint('/adsApi/v1/query/brandStoreEditionPublishVersions', method='POST')
34
+ def query_brand_store_edition_publish_versions(self, **kwargs) -> ApiResponse:
35
+ r"""
36
+ query_brand_store_edition_publish_versions(body: dict) -> ApiResponse
37
+
38
+ Amazon Ads API v1 - Query (operationId: QueryBrandStoreEditionPublishVersion)
39
+
40
+ Requires one of these permissions: ["amazon_stores_edit", "amazon_stores_view"]
41
+
42
+ Request Body [Required]
43
+ | **editionIdFilter** (dict) [required]
44
+ | **include** (list<string>) : exactly one edition id
45
+ | **storeIdFilter** (dict) [required]
46
+ | **include** (list<string>) : exactly one store id
47
+ | **publishStatusFilter** (dict) [required]
48
+ | **include** (list<StorePublishStatus>) : exactly one of
49
+ Enum [ DRAFT, REVIEW_IN_PROGRESS ]
50
+ | **maxResults** (int) [optional]
51
+ | **nextToken** (string) [optional]
52
+
53
+ Returns
54
+ ApiResponse. ``payload`` holds ``brandStoreEditionPublishVersions``
55
+ and ``nextToken``. Each entry carries ``editionId``, ``storeId``,
56
+ ``storeEditionPublishId``, ``publishState``, ``publishStatus`` and
57
+ ``pages`` -- the last one appears only in the answer.
58
+ """
59
+ headers = {"Accept": "application/json", "Content-Type": "application/json"}
60
+ return self._request(
61
+ kwargs.pop('path'),
62
+ data=Utils.convert_body(kwargs.pop('body'), False),
63
+ params=kwargs,
64
+ headers=headers,
65
+ )
66
+
67
+ @sp_endpoint('/adsApi/v1/update/brandStoreEditionPublishVersions', method='POST')
68
+ def update_brand_store_edition_publish_versions(self, **kwargs) -> ApiResponse:
69
+ r"""
70
+ update_brand_store_edition_publish_versions(body: dict) -> ApiResponse
71
+
72
+ Amazon Ads API v1 - Update (operationId: UpdateBrandStoreEditionPublishVersion)
73
+
74
+ Requires one of these permissions: ["amazon_stores_edit"]
75
+
76
+ The array holds exactly one element, not a range.
77
+
78
+ Request Body [Required]
79
+ | **brandStoreEditionPublishVersions** (list, exactly 1) [required]
80
+
81
+ Each element:
82
+ | **storeEditionPublishId** (string) [required] version to move
83
+ | **editionId** (string) [optional]
84
+ | **storeId** (string) [optional]
85
+ | **publishState** (string) [optional]
86
+ Enum [ DRAFT, PUBLISH ] -- this is StorePublishState, not the
87
+ StorePublishStatus the query filters on.
88
+
89
+ Returns
90
+ ApiResponse
91
+ """
92
+ headers = {"Accept": "application/json", "Content-Type": "application/json"}
93
+ return self._request(
94
+ kwargs.pop('path'),
95
+ data=Utils.convert_body(kwargs.pop('body'), False),
96
+ params=kwargs,
97
+ headers=headers,
98
+ )
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.4.2"
1
+ __version__ = "1.4.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 1.4.2
3
+ Version: 1.4.3
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
@@ -307,6 +307,7 @@ The v1 API lives under `/adsApi/v1/` and is **not** split by product: every call
307
307
  * [Ad Extensions](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/ad_extensions.html#ad_api.api.v1.AdExtensions.AdExtensions.query_ad_extensions)
308
308
  * [Advertiser Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/advertiser_accounts.html#ad_api.api.v1.AdvertiserAccounts.AdvertiserAccounts.query_advertiser_accounts)
309
309
  * [Ad Associations](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/ad_associations.html#ad_api.api.v1.AdAssociations.AdAssociations.query_ad_associations)
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)
310
311
 
311
312
 
312
313
  ### [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=qjngKmjcwKn1c_BwAouVdai-TbnuKZo56EbqRdILxaI,22
2
+ ad_api/version.py,sha256=rxvQUWSe6nvSADkIyuziyi8Irk70s2DZSxOB9c8cpAQ,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,12 +89,13 @@ 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=3fJ65Nj9aLyfLME_jXs6uAm7PlhfxBN4q-HDHmPuPcc,393
92
+ ad_api/api/v1/__init__.py,sha256=urUrRHuaMCMOnMSyF52tWrQFQ8MybwuRzY9hcPaq3d4,516
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
99
  ad_api/api/v1/campaigns.py,sha256=u5PlvoAhgVhMxbCvYkPgqtbYK3TXXcb7TMie0Qjrgwc,9573
99
100
  ad_api/api/v1/targets.py,sha256=a4BzPjg9m1JJwqphhpQOFkNIcgCw7v4-K0sNzOihMZI,12355
100
101
  ad_api/auth/__init__.py,sha256=B_yKdmsHENQaKfMFAIcSxQqG4aBUmNBm5orKIMUYObk,229
@@ -112,8 +113,8 @@ ad_api/base/exceptions.py,sha256=9D3M40ZIlLS0fA-aQh1BTWPOW-Nvf0tRhbA85jFnDJ4,438
112
113
  ad_api/base/helpers.py,sha256=UK7Q13vZ0mNdF54xzfzoGDn2O_cd2yPrK2X4rOzC41c,2334
113
114
  ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4657
114
115
  ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
115
- python_amazon_ad_api-1.4.2.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
116
- python_amazon_ad_api-1.4.2.dist-info/METADATA,sha256=TZgn0q-QwBVCAt_0gsLvXBZEsGjZ9UaGp6OFzlnk_aI,22058
117
- python_amazon_ad_api-1.4.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
118
- python_amazon_ad_api-1.4.2.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
119
- python_amazon_ad_api-1.4.2.dist-info/RECORD,,
116
+ python_amazon_ad_api-1.4.3.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
117
+ python_amazon_ad_api-1.4.3.dist-info/METADATA,sha256=C-pDcGUkG-E0yIsUSDk6jTrSpM1ZlEOTIRvdliVnYMU,22322
118
+ python_amazon_ad_api-1.4.3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
119
+ python_amazon_ad_api-1.4.3.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
120
+ python_amazon_ad_api-1.4.3.dist-info/RECORD,,