python-amazon-ad-api 2.1.5__py3-none-any.whl → 2.1.6__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.
@@ -63,9 +63,7 @@ class AdGroups(Client):
63
63
  if account_id:
64
64
  headers["Amazon-Ads-AccountId"] = account_id
65
65
 
66
- body = kwargs.pop('body', None)
67
- return self._request(kwargs.pop('path'), params=kwargs, headers=headers,
68
- **({'data': Utils.convert_body(body, False)} if body is not None else {}))
66
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
69
67
 
70
68
  @sp_endpoint('/adsApi/v1/create/adGroups', method='POST')
71
69
  def create_ad_groups(self, **kwargs) -> ApiResponse:
@@ -139,6 +137,13 @@ class AdGroups(Client):
139
137
  """
140
138
  schema_version = 'application/json'
141
139
  headers = {"Accept": schema_version, "Content-Type": schema_version}
140
+
141
+ # Optional account header, taken from kwargs and removed before the
142
+ # call is built: left in kwargs it would travel in the query string.
143
+ account_id = kwargs.pop('account_id', None)
144
+ if account_id:
145
+ headers["Amazon-Ads-AccountId"] = account_id
146
+
142
147
  return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
143
148
 
144
149
  @sp_endpoint('/adsApi/v1/update/adGroups', method='POST')
@@ -187,6 +192,13 @@ class AdGroups(Client):
187
192
  """
188
193
  schema_version = 'application/json'
189
194
  headers = {"Accept": schema_version, "Content-Type": schema_version}
195
+
196
+ # Optional account header, taken from kwargs and removed before the
197
+ # call is built: left in kwargs it would travel in the query string.
198
+ account_id = kwargs.pop('account_id', None)
199
+ if account_id:
200
+ headers["Amazon-Ads-AccountId"] = account_id
201
+
190
202
  return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
191
203
 
192
204
  @sp_endpoint('/adsApi/v1/delete/adGroups', method='POST')
@@ -210,4 +222,11 @@ class AdGroups(Client):
210
222
  """
211
223
  schema_version = 'application/json'
212
224
  headers = {"Accept": schema_version, "Content-Type": schema_version}
225
+
226
+ # Optional account header, taken from kwargs and removed before the
227
+ # call is built: left in kwargs it would travel in the query string.
228
+ account_id = kwargs.pop('account_id', None)
229
+ if account_id:
230
+ headers["Amazon-Ads-AccountId"] = account_id
231
+
213
232
  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.5"
1
+ __version__ = "2.1.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 2.1.5
3
+ Version: 2.1.6
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=Ol8KeLnnX1kAXAFgJsZj4d_cZMypHQtaiyICJpuzp64,22
2
+ ad_api/version.py,sha256=Z4RaxSmfOjvKssLeOljGX3Csb8I17J-Dc7pSVg3Hb2U,22
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
@@ -99,7 +99,7 @@ ad_api/api/sp/target_promotion_groups.py,sha256=g5QbnFFRvzKdmS9blrD9IJcHtq2RtT9C
99
99
  ad_api/api/v1/__init__.py,sha256=K7rmsKJnWebiarPZknUIcXJKvoIDPI5dBVNrIJGWa2I,1370
100
100
  ad_api/api/v1/ad_associations.py,sha256=g5L8hAIagmsb-yQ09hP7z1zbVVe868NlpOOokv-Mouc,5812
101
101
  ad_api/api/v1/ad_extensions.py,sha256=kL-7xHaXXqb2jXTwZrY0oGttLAG0CW_IjBAqL_CI92U,5519
102
- ad_api/api/v1/ad_groups.py,sha256=n6YiMVYm_TK93CYWmxJIkGFwNSUaRUQRO8LjbDV4Xc0,13170
102
+ ad_api/api/v1/ad_groups.py,sha256=SN2NRzs9P-IvSe_OWyKZoX2Nvcx9afqoELi96ZKOB1k,13939
103
103
  ad_api/api/v1/ads.py,sha256=YwZGQ-4WuYquleELtwRI9L8w0fGw7FBRejQE-tZ5hKY,7941
104
104
  ad_api/api/v1/advertiser_accounts.py,sha256=Y_QqOIt6ggmysEBT59JhrdvTlZ5OQnPduMKX43JTdDU,5468
105
105
  ad_api/api/v1/brand_store_edition_publish_versions.py,sha256=HVeO4ZiPdtjVoVoxQk2xIa8fhcLXSMCquSO1CP4Hbu4,4894
@@ -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.5.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
138
- python_amazon_ad_api-2.1.5.dist-info/METADATA,sha256=IPtVshFjjiVzYSJxjwGbviUHOJbrVSPkPFftrmYRblw,54257
139
- python_amazon_ad_api-2.1.5.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
140
- python_amazon_ad_api-2.1.5.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
141
- python_amazon_ad_api-2.1.5.dist-info/RECORD,,
137
+ python_amazon_ad_api-2.1.6.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
138
+ python_amazon_ad_api-2.1.6.dist-info/METADATA,sha256=JA2WUd5Mitw8LwW6pZnTkDl6YKn3JYAB9G5XxsxVdlM,54257
139
+ python_amazon_ad_api-2.1.6.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
140
+ python_amazon_ad_api-2.1.6.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
141
+ python_amazon_ad_api-2.1.6.dist-info/RECORD,,