python-amazon-ad-api 2.1.11__py3-none-any.whl → 2.1.12__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.
@@ -44,9 +44,24 @@ class Recommendations(Client):
44
44
  | **recommendations** (list<Recommendation>) : 0..300
45
45
  | **totalResults** (int)
46
46
  | **nextToken** (string)
47
+
48
+ Headers
49
+ | **Amazon-Ads-ClientId** (string) [required] sent by the base Client
50
+ on every call.
51
+
52
+ The accounts travel in the body through ``accessRequestedAccounts``,
53
+ each item naming an ``advertiserAccountId`` or a ``managerAccountId``.
54
+ The contract also declares Amazon-Ads-AccountId as optional here.
47
55
  """
48
56
  schema_version = 'application/json'
49
57
  headers = {"Accept": schema_version, "Content-Type": schema_version}
58
+
59
+ # Optional account header, taken from kwargs and removed before the
60
+ # call is built: left in kwargs it would travel in the query string.
61
+ account_id = kwargs.pop('account_id', None)
62
+ if account_id:
63
+ headers["Amazon-Ads-AccountId"] = account_id
64
+
50
65
  return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
51
66
 
52
67
  @sp_endpoint('/adsApi/v1/recommendations', method='GET')
@@ -58,14 +73,17 @@ class Recommendations(Client):
58
73
 
59
74
  A GET with query parameters, not a body.
60
75
 
76
+ Headers
77
+ | **Amazon-Ads-AccountId** (string) [optional] advertiser account
78
+ | **Amazon-Ads-Manager-AccountId** (string) [optional] manager account
61
79
  Parameters
62
- | **Amazon-Ads-AccountId** (string) : advertiser account, optional
63
- | **Amazon-Ads-Manager-AccountId** (string) : manager account, optional
64
80
  | **nextToken**, **maxResults** (1..300), **adProduct**, **marketplace**, **language**, **recommendationType**
65
81
 
66
82
  The account travels in the headers, and since 2026-11-11 the contract
67
83
  marks both of them optional: the list can be read for an advertiser
68
- account or for a manager account.
84
+ account or for a manager account. Pass ``account_id=`` or
85
+ ``manager_id=``; each becomes its own header and neither reaches the
86
+ query string.
69
87
 
70
88
  Returns
71
89
  | **recommendations** (list<Recommendation>) : 0..300
@@ -73,7 +91,19 @@ class Recommendations(Client):
73
91
  | **nextToken** (string)
74
92
  """
75
93
  path = kwargs.pop('path')
76
- return self._request(path, params=kwargs)
94
+ params = dict(kwargs)
95
+
96
+ # Optional account headers, taken from kwargs and removed before the
97
+ # call is built: left in kwargs they would travel in the query string.
98
+ account_id = params.pop('account_id', None)
99
+ manager_id = params.pop('manager_id', None)
100
+ headers = {}
101
+ if account_id:
102
+ headers["Amazon-Ads-AccountId"] = account_id
103
+ if manager_id:
104
+ headers["Amazon-Ads-Manager-AccountId"] = manager_id
105
+
106
+ return self._request(path, params=params, headers=headers or None)
77
107
 
78
108
  @sp_endpoint('/adsApi/v1/create/recommendations/sb', method='POST')
79
109
  def create_recommendations_sb(self, **kwargs) -> ApiResponse:
@@ -93,4 +123,11 @@ class Recommendations(Client):
93
123
  """
94
124
  schema_version = 'application/json'
95
125
  headers = {"Accept": schema_version, "Content-Type": schema_version}
126
+
127
+ # Optional advertiser account header, taken from kwargs and removed
128
+ # before the call is built: left in kwargs it would travel in the query.
129
+ account_id = kwargs.pop('account_id', None)
130
+ if account_id:
131
+ headers["Amazon-Ads-AccountId"] = account_id
132
+
96
133
  return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.1.11"
1
+ __version__ = "2.1.12"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 2.1.11
3
+ Version: 2.1.12
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
@@ -1,5 +1,5 @@
1
1
  ad_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- ad_api/version.py,sha256=zcHMV6HbszEZFZ1gDEpbHxTYg8dJ5fCYdeDd-O6IPP4,23
2
+ ad_api/version.py,sha256=2ZypnXz9pLMxwCwfHNJV9M24HPgZwt56lxlCb2BYeEA,23
3
3
  ad_api/api/__init__.py,sha256=Ain-1s6B4eywYsw3CdYQc2C1KTQdAZy2L3T90KJDYdI,1995
4
4
  ad_api/api/account.py,sha256=X6VPoPsEfGwuABUYVWJATiUpgHSCAz0BreQOHCze9To,4613
5
5
  ad_api/api/account_budgets.py,sha256=jFce5eLWAFK3ydjnYR7_Sv7B0-gHTG5bMTx_TcHyy1A,2319
@@ -114,7 +114,7 @@ ad_api/api/v1/location_indexes.py,sha256=xV2g8DuNh6ayNwl55YiLEkbAFPfR6AeM92AH7VW
114
114
  ad_api/api/v1/manager_accounts.py,sha256=iiW0bjS23rn2R_In3Zisn0mSFQsQ6iy6KgkO_JxT-H4,5101
115
115
  ad_api/api/v1/portfolios.py,sha256=mDrx3xo72BN_ltk3eefVm9A4kR7g_sbFMr2JTfuJpOM,9647
116
116
  ad_api/api/v1/recommendation_types.py,sha256=zw546ssLqFwKShZ9MNkG0I7DWKTnQs3yptcCsgHi-pA,2576
117
- ad_api/api/v1/recommendations.py,sha256=lb3Jwtwcmq3L8j0HAUKzOt8o_xQRJRduXcjklX_tFw8,4305
117
+ ad_api/api/v1/recommendations.py,sha256=P01hbXzDoyY6HpyBeFkJTd_CsZAvaKl-EQVMtvQvBdA,5885
118
118
  ad_api/api/v1/reports.py,sha256=vJmWhIsALkX27HeijTsSUz3zrYhUBm4RodTCieJD8Y8,6657
119
119
  ad_api/api/v1/selling_accounts.py,sha256=0_R4yzvXGp_gFyfcZeWJyeIr7Wh4eGpLfK12podXqGA,1941
120
120
  ad_api/api/v1/targets.py,sha256=Oyuh7r8Tj3VrwOulCYkYGoONfTH0ve9XdfLK86DZB3U,13503
@@ -134,8 +134,8 @@ ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4
134
134
  ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
135
135
  ad_api/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
136
136
  ad_api/shared/base_client.py,sha256=zOL_LTh-58URWf3ZDlrwmqXXbd6PX66QF5hrr2p83yY,356
137
- python_amazon_ad_api-2.1.11.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
138
- python_amazon_ad_api-2.1.11.dist-info/METADATA,sha256=qU8Y9rQFVP-_1_8LP2ZPVF6HqRqWSAoiHH2uc9mpN4g,54258
139
- python_amazon_ad_api-2.1.11.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
140
- python_amazon_ad_api-2.1.11.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
141
- python_amazon_ad_api-2.1.11.dist-info/RECORD,,
137
+ python_amazon_ad_api-2.1.12.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
138
+ python_amazon_ad_api-2.1.12.dist-info/METADATA,sha256=gFI5nAzMDfzIBf0P9brvrBjw_GO9X9GY4MjlWk7zaa8,54258
139
+ python_amazon_ad_api-2.1.12.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
140
+ python_amazon_ad_api-2.1.12.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
141
+ python_amazon_ad_api-2.1.12.dist-info/RECORD,,