python-amazon-ad-api 1.4.0__py3-none-any.whl → 1.4.1__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
@@ -3,6 +3,7 @@ from .ad_groups import AdGroups
3
3
  from .ads import Ads
4
4
  from .targets import Targets
5
5
  from .ad_extensions import AdExtensions
6
+ from .advertiser_accounts import AdvertiserAccounts
6
7
 
7
8
  __all__ = [
8
9
  "Campaigns",
@@ -10,4 +11,5 @@ __all__ = [
10
11
  "Ads",
11
12
  "Targets",
12
13
  "AdExtensions",
14
+ "AdvertiserAccounts",
13
15
  ]
@@ -0,0 +1,122 @@
1
+ from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
+
3
+
4
+ class AdvertiserAccounts(Client):
5
+ r"""
6
+ AdvertiserAccounts(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)
7
+
8
+ Amazon Ads API v1 - unified AdvertiserAccounts endpoints
9
+
10
+ Three routes and no delete, like the rest of the account family:
11
+
12
+ - ``create_advertiser_accounts`` -- 1 to 100 accounts per call.
13
+ - ``query_advertiser_accounts`` -- filter by identifier or by global flag.
14
+ - ``update_advertiser_accounts`` -- here the mutable fields really are
15
+ mutable: currency, time zone, display name, industry, manager link.
16
+
17
+ Unlike Ads, Targets or AdExtensions this is not an ad-product resource, so
18
+ there is no ``adProductFilter```; querying is by ``advertiserAccountIdFilter``
19
+ or ``isGlobalAccountFilter``.
20
+
21
+ ``managerAccountId`` decides what the account can run: without it the account
22
+ is created for Sponsored Ads only, and DSP needs it set.
23
+ """
24
+
25
+ @sp_endpoint('/adsApi/v1/query/advertiserAccounts', method='POST')
26
+ def query_advertiser_accounts(self, **kwargs) -> ApiResponse:
27
+ r"""
28
+ query_advertiser_accounts(body: dict) -> ApiResponse
29
+
30
+ Amazon Ads API v1 - Query AdvertiserAccounts (operationId: QueryAdvertiserAccount)
31
+
32
+ Request Body
33
+ | **advertiserAccountIdFilter** (dict) [optional]
34
+ | **include** (list<string>) : advertiser account identifiers
35
+ | **isGlobalAccountFilter** (dict) [optional]
36
+ | **include** (list<boolean>) : true for global accounts
37
+ | **maxResults** (int) [optional] Maximum number of records in the response
38
+ | **nextToken** (string) [optional] Token to navigate to the next page
39
+
40
+ Returns
41
+ ApiResponse. ``payload`` holds ``advertiserAccounts`` and ``nextToken``.
42
+ """
43
+ headers = {"Accept": "application/json", "Content-Type": "application/json"}
44
+ return self._request(
45
+ kwargs.pop('path'),
46
+ data=Utils.convert_body(kwargs.pop('body'), False),
47
+ params=kwargs,
48
+ headers=headers,
49
+ )
50
+
51
+ @sp_endpoint('/adsApi/v1/create/advertiserAccounts', method='POST')
52
+ def create_advertiser_accounts(self, **kwargs) -> ApiResponse:
53
+ r"""
54
+ create_advertiser_accounts(body: dict) -> ApiResponse
55
+
56
+ Amazon Ads API v1 - Create AdvertiserAccounts (operationId: CreateAdvertiserAccount)
57
+
58
+ Request Body [Required]
59
+ | **advertiserAccounts** (list, 1..100) [required]
60
+
61
+ Each element:
62
+ | **businessDetails** (list, exactly 1) [required]
63
+ Carries either ``addressToken`` for an existing selling account
64
+ address, or ``address`` when that account has none. Also accepts
65
+ ``businessRegistrationNumber`` and ``website`.
66
+ | **currencyCode** (string) [optional] Enum of 34 ISO codes,
67
+ including ``EUR``, ``USD``, ``GBP`
68
+ | **displayName** (string) [optional] name shown for the account
69
+ | **industryVertical** (string) [optional] Enum of 19 sectors
70
+ | **isGlobalAccount** (boolean) [optional]
71
+ | **isTestAccount** (boolean) [optional]
72
+ | **managerAccountId** (string) [optional] Required for
73
+ ADSP-enabled accounts; without it the account is created for
74
+ Sponsored Ads only.
75
+ | **sellingAccountLinkRequests** (list, 0..1) [optional]
76
+ | **timeZoneIana** (string) [optional] Enum of 42 IANA zones
77
+
78
+ The full enum lists live in the contract; they are not repeated here.
79
+
80
+ Returns
81
+ ApiResponse
82
+ """
83
+ headers = {"Accept": "application/json", "Content-Type": "application/json"}
84
+ return self._request(
85
+ kwargs.pop('path'),
86
+ data=Utils.convert_body(kwargs.pop('body'), False),
87
+ params=kwargs,
88
+ headers=headers,
89
+ )
90
+
91
+ @sp_endpoint('/adsApi/v1/update/advertiserAccounts', method='POST')
92
+ def update_advertiser_accounts(self, **kwargs) -> ApiResponse:
93
+ r"""
94
+ update_advertiser_accounts(body: dict) -> ApiResponse
95
+
96
+ Amazon Ads API v1 - Update AdvertiserAccounts (operationId: UpdateAdvertiserAccount)
97
+
98
+ Request Body [Required]
99
+ | **advertiserAccounts** (list) [required]
100
+
101
+ Each element:
102
+ | **advertiserAccountId** (string) [required] account to update
103
+ | **businessDetails** (list) [optional]
104
+ | **currencyCode** (string) [optional]
105
+ | **displayName** (string) [optional]
106
+ | **industryVertical** (string) [optional]
107
+ | **isGlobalAccount** (boolean) [optional]
108
+ | **isTestAccount** (boolean) [optional]
109
+ | **managerAccountId** (string) [optional]
110
+ | **sellingAccountLinkRequests** (list) [optional]
111
+ | **timeZoneIana** (string) [optional]
112
+
113
+ Returns
114
+ ApiResponse
115
+ """
116
+ headers = {"Accept": "application/json", "Content-Type": "application/json"}
117
+ return self._request(
118
+ kwargs.pop('path'),
119
+ data=Utils.convert_body(kwargs.pop('body'), False),
120
+ params=kwargs,
121
+ headers=headers,
122
+ )
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.4.0"
1
+ __version__ = "1.4.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 1.4.0
3
+ Version: 1.4.1
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
@@ -305,6 +305,7 @@ The v1 API lives under `/adsApi/v1/` and is **not** split by product: every call
305
305
  * [Ads](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/ads.html#ad_api.api.v1.Ads.Ads.query_ads)
306
306
  * [Targets](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/targets.html#ad_api.api.v1.Targets.Targets.query_targets)
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
+ * [Advertiser Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/advertiser_accounts.html#ad_api.api.v1.AdvertiserAccounts.AdvertiserAccounts.query_advertiser_accounts)
308
309
 
309
310
 
310
311
  ### [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=8UhoYEXHs1Oai7BW_ExBmuwWnRI-yMG_u1fQAXMizHQ,22
2
+ ad_api/version.py,sha256=BqOI5y46o1G1RWC9bF1DPL-YM68lGYPmZt1pn6FZFZs,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,10 +89,11 @@ 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=DRSUR1Qk9I5oL6c_VqUZpOu5hHOcOd08NnJ8B26paso,249
92
+ ad_api/api/v1/__init__.py,sha256=PZUV64EpTwGeZaEJQO5GBr4WKloUaFPh2H55IidNscM,327
93
93
  ad_api/api/v1/ad_extensions.py,sha256=kL-7xHaXXqb2jXTwZrY0oGttLAG0CW_IjBAqL_CI92U,5519
94
94
  ad_api/api/v1/ad_groups.py,sha256=pQhCVdve_O6kbL4mBA5bxxhKcKNl_BKqa7z9DvrxwaM,12626
95
95
  ad_api/api/v1/ads.py,sha256=YwZGQ-4WuYquleELtwRI9L8w0fGw7FBRejQE-tZ5hKY,7941
96
+ ad_api/api/v1/advertiser_accounts.py,sha256=_Y8GTHgQ2G-RhNg4cuvvfXvjIhLzstQAGSyr1WMRRfg,5405
96
97
  ad_api/api/v1/campaigns.py,sha256=u5PlvoAhgVhMxbCvYkPgqtbYK3TXXcb7TMie0Qjrgwc,9573
97
98
  ad_api/api/v1/targets.py,sha256=a4BzPjg9m1JJwqphhpQOFkNIcgCw7v4-K0sNzOihMZI,12355
98
99
  ad_api/auth/__init__.py,sha256=B_yKdmsHENQaKfMFAIcSxQqG4aBUmNBm5orKIMUYObk,229
@@ -110,8 +111,8 @@ ad_api/base/exceptions.py,sha256=9D3M40ZIlLS0fA-aQh1BTWPOW-Nvf0tRhbA85jFnDJ4,438
110
111
  ad_api/base/helpers.py,sha256=UK7Q13vZ0mNdF54xzfzoGDn2O_cd2yPrK2X4rOzC41c,2334
111
112
  ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4657
112
113
  ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
113
- python_amazon_ad_api-1.4.0.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
114
- python_amazon_ad_api-1.4.0.dist-info/METADATA,sha256=GozMi00VyHrkz9Hz8AGmsBNOL8yurYhF0PQrzdnfHEI,21708
115
- python_amazon_ad_api-1.4.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
116
- python_amazon_ad_api-1.4.0.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
117
- python_amazon_ad_api-1.4.0.dist-info/RECORD,,
114
+ python_amazon_ad_api-1.4.1.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
115
+ python_amazon_ad_api-1.4.1.dist-info/METADATA,sha256=60IbkJFCBtnuSn85xriw-jm_P-9LPPXvSvY9FmktSEw,21893
116
+ python_amazon_ad_api-1.4.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
117
+ python_amazon_ad_api-1.4.1.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
118
+ python_amazon_ad_api-1.4.1.dist-info/RECORD,,