python-amazon-ad-api 1.4.2__py3-none-any.whl → 1.4.4__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,8 @@ 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
9
+ from .brand_stores import BrandStores
8
10
 
9
11
  __all__ = [
10
12
  "Campaigns",
@@ -14,4 +16,6 @@ __all__ = [
14
16
  "AdExtensions",
15
17
  "AdvertiserAccounts",
16
18
  "AdAssociations",
19
+ "BrandStoreEditionPublishVersions",
20
+ "BrandStores",
17
21
  ]
@@ -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
+ )
@@ -0,0 +1,52 @@
1
+ from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
+
3
+
4
+ class BrandStores(Client):
5
+ r"""
6
+ BrandStores(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)
7
+
8
+ Amazon Ads API v1 - unified BrandStores endpoints
9
+
10
+ One route: the query. A brand store is listed, never created here.
11
+
12
+ Permissions (any one): advertiser_campaign_edit, creatives_view,
13
+ account_view, creatives_edit, account_edit, campaign_view,
14
+ advertiser_campaign_view, campaign_edit.
15
+
16
+ ``storeNameFilter`` is required and takes exactly one name, so this route
17
+ cannot list every store on the account. The answer is the way in to the
18
+ rest of the Stores family: ``storeId`` from here is what
19
+ :class:`~ad_api.api.v1.BrandStoreEditionPublishVersions` needs as
20
+ ``storeIdFilter``.
21
+ """
22
+
23
+ @sp_endpoint('/adsApi/v1/query/brandStores', method='POST')
24
+ def query_brand_stores(self, **kwargs) -> ApiResponse:
25
+ r"""
26
+ query_brand_stores(body: dict) -> ApiResponse
27
+
28
+ Amazon Ads API v1 - Query BrandStores (operationId: QueryBrandStore)
29
+
30
+ Requires one of these permissions: ["advertiser_campaign_edit",
31
+ "creatives_view", "account_view", "creatives_edit", "account_edit",
32
+ "campaign_view", "advertiser_campaign_view", "campaign_edit"]
33
+
34
+ Request Body [Required]
35
+ | **storeNameFilter** (dict) [required]
36
+ | **include** (list<string>) : exactly one store name
37
+ | **maxResults** (int) [optional]
38
+ | **nextToken** (string) [optional]
39
+
40
+ Returns
41
+ ApiResponse. ``payload`` holds ``brandStores`` and ``nextToken``.
42
+ Each store carries ``storeId`` (required), ``storeName`` and
43
+ ``pageInfos``. The ``storeId`` is what the publish-version family
44
+ filters on.
45
+ """
46
+ headers = {"Accept": "application/json", "Content-Type": "application/json"}
47
+ return self._request(
48
+ kwargs.pop('path'),
49
+ data=Utils.convert_body(kwargs.pop('body'), False),
50
+ params=kwargs,
51
+ headers=headers,
52
+ )
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.4.2"
1
+ __version__ = "1.4.4"
@@ -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.4
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,8 @@ 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)
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)
310
312
 
311
313
 
312
314
  ### [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=6stz_YFBRP_lguydVylsTgSmj3VTb6WFq8Sp45WYQyY,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,14 @@ 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=uwEHyVmogxPwXbDqbL2iA2ev6aSamwHXUK4UPUgqFOY,573
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
99
+ ad_api/api/v1/brand_stores.py,sha256=zlBsKiOwmdSiIG9filgdqUlPnV6AX-gE6S5nNyAQACc,2131
98
100
  ad_api/api/v1/campaigns.py,sha256=u5PlvoAhgVhMxbCvYkPgqtbYK3TXXcb7TMie0Qjrgwc,9573
99
101
  ad_api/api/v1/targets.py,sha256=a4BzPjg9m1JJwqphhpQOFkNIcgCw7v4-K0sNzOihMZI,12355
100
102
  ad_api/auth/__init__.py,sha256=B_yKdmsHENQaKfMFAIcSxQqG4aBUmNBm5orKIMUYObk,229
@@ -112,8 +114,8 @@ ad_api/base/exceptions.py,sha256=9D3M40ZIlLS0fA-aQh1BTWPOW-Nvf0tRhbA85jFnDJ4,438
112
114
  ad_api/base/helpers.py,sha256=UK7Q13vZ0mNdF54xzfzoGDn2O_cd2yPrK2X4rOzC41c,2334
113
115
  ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4657
114
116
  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,,
117
+ python_amazon_ad_api-1.4.4.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
118
+ python_amazon_ad_api-1.4.4.dist-info/METADATA,sha256=7VgKYVOOth77rAC4lVNoSsX4sFn7wXq3TEc6-J1uTKU,22472
119
+ python_amazon_ad_api-1.4.4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
120
+ python_amazon_ad_api-1.4.4.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
121
+ python_amazon_ad_api-1.4.4.dist-info/RECORD,,