python-amazon-ad-api 2.1.7__py3-none-any.whl → 2.1.9__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,6 +44,16 @@ class LocationIndexes(Client):
44
44
  """
45
45
  schema_version = 'application/json'
46
46
  headers = {"Accept": schema_version, "Content-Type": schema_version}
47
+
48
+ # Optional account headers, taken from kwargs and removed before the
49
+ # call is built: left in kwargs they would travel in the query string.
50
+ account_id = kwargs.pop('account_id', None)
51
+ manager_account_id = kwargs.pop('manager_account_id', None)
52
+ if account_id:
53
+ headers["Amazon-Ads-AccountId"] = account_id
54
+ if manager_account_id:
55
+ headers["Amazon-Ads-Manager-AccountId"] = manager_account_id
56
+
47
57
  return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
48
58
 
49
59
  @sp_endpoint('/adsApi/v1/locationIndexes', method='GET')
@@ -106,6 +116,16 @@ class LocationIndexes(Client):
106
116
  """
107
117
  schema_version = 'application/json'
108
118
  headers = {"Accept": schema_version, "Content-Type": schema_version}
119
+
120
+ # Optional account headers, taken from kwargs and removed before the
121
+ # call is built: left in kwargs they would travel in the query string.
122
+ account_id = kwargs.pop('account_id', None)
123
+ manager_account_id = kwargs.pop('manager_account_id', None)
124
+ if account_id:
125
+ headers["Amazon-Ads-AccountId"] = account_id
126
+ if manager_account_id:
127
+ headers["Amazon-Ads-Manager-AccountId"] = manager_account_id
128
+
109
129
  return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
110
130
 
111
131
  @sp_endpoint('/adsApi/v1/update/locationIndexes', method='POST')
@@ -128,4 +148,14 @@ class LocationIndexes(Client):
128
148
  """
129
149
  schema_version = 'application/json'
130
150
  headers = {"Accept": schema_version, "Content-Type": schema_version}
151
+
152
+ # Optional account headers, taken from kwargs and removed before the
153
+ # call is built: left in kwargs they would travel in the query string.
154
+ account_id = kwargs.pop('account_id', None)
155
+ manager_account_id = kwargs.pop('manager_account_id', None)
156
+ if account_id:
157
+ headers["Amazon-Ads-AccountId"] = account_id
158
+ if manager_account_id:
159
+ headers["Amazon-Ads-Manager-AccountId"] = manager_account_id
160
+
131
161
  return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
@@ -82,6 +82,13 @@ class Portfolios(Client):
82
82
  schema_version = 'application/json'
83
83
  headers = {"Accept": schema_version, "Content-Type": schema_version}
84
84
  body = kwargs.pop('body', None)
85
+
86
+ # Optional account header, taken from kwargs and removed before the
87
+ # call is built: left in kwargs it would travel in the query string.
88
+ account_id = kwargs.pop('account_id', None)
89
+ if account_id:
90
+ headers['Amazon-Ads-AccountId'] = account_id
91
+
85
92
  return self._request(kwargs.pop('path'), params=kwargs, headers=headers,
86
93
  **({'data': Utils.convert_body(body, False)} if body is not None else {}))
87
94
 
@@ -182,5 +189,12 @@ class Portfolios(Client):
182
189
  schema_version = 'application/json'
183
190
  headers = {"Accept": schema_version, "Content-Type": schema_version}
184
191
  body = kwargs.pop('body', None)
192
+
193
+ # Optional account header, taken from kwargs and removed before the
194
+ # call is built: left in kwargs it would travel in the query string.
195
+ account_id = kwargs.pop('account_id', None)
196
+ if account_id:
197
+ headers['Amazon-Ads-AccountId'] = account_id
198
+
185
199
  return self._request(kwargs.pop('path'), params=kwargs, headers=headers,
186
200
  **({'data': Utils.convert_body(body, False)} if body is not None else {}))
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.1.7"
1
+ __version__ = "2.1.9"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 2.1.7
3
+ Version: 2.1.9
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=f8a2MVmX1Pzg6y0vb9wOlUWlRzaM1t0oaZBemKhaz6M,22
2
+ ad_api/version.py,sha256=Gf0zUMmdRLkPmvwnoP7oCpWn7Ep93jlNIlBD6nifugI,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
@@ -110,9 +110,9 @@ ad_api/api/v1/campaigns.py,sha256=4A-sg1i3N_0DQPXunkNGnRM2iV-hZR-yE041EVejAPQ,10
110
110
  ad_api/api/v1/geo_locations.py,sha256=gH1kR1rPQuIdzStB6wvWI40-XRo5yFyVI9AYYcjN5_8,2641
111
111
  ad_api/api/v1/label_object_associations.py,sha256=zXuD5cUAfqL-PRObvjOM54KC356HFqnzA5ehpGSJPYk,2597
112
112
  ad_api/api/v1/labels.py,sha256=jjPmafIQZTh99Ztj5MCcDC7UyoFFN0YuWdn2syqd3Yg,2438
113
- ad_api/api/v1/location_indexes.py,sha256=F9mV1gBwIcFU4WAsYylgO98T_ZapWb_YoA8etJK2Xvo,5880
113
+ ad_api/api/v1/location_indexes.py,sha256=xV2g8DuNh6ayNwl55YiLEkbAFPfR6AeM92AH7VWC6dg,7266
114
114
  ad_api/api/v1/manager_accounts.py,sha256=iiW0bjS23rn2R_In3Zisn0mSFQsQ6iy6KgkO_JxT-H4,5101
115
- ad_api/api/v1/portfolios.py,sha256=jAbFxPO27laeMhwpzU8_JZJ5sVMdod1eap7Uw88sZIY,8889
115
+ ad_api/api/v1/portfolios.py,sha256=rXyqzP_0fB7aC38eiN3-5xm9dsog3P4MTeP12I59h80,9463
116
116
  ad_api/api/v1/recommendation_types.py,sha256=aEBfXu1EhzcRk9Nhin8_ieFiNnBiusX_vWviJw_qD08,2077
117
117
  ad_api/api/v1/recommendations.py,sha256=lb3Jwtwcmq3L8j0HAUKzOt8o_xQRJRduXcjklX_tFw8,4305
118
118
  ad_api/api/v1/reports.py,sha256=vJmWhIsALkX27HeijTsSUz3zrYhUBm4RodTCieJD8Y8,6657
@@ -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.7.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
138
- python_amazon_ad_api-2.1.7.dist-info/METADATA,sha256=anaa4Gt76VHanXFPSjJEA_F3aKrHW1bcu1hTkhZNPIo,54257
139
- python_amazon_ad_api-2.1.7.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
140
- python_amazon_ad_api-2.1.7.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
141
- python_amazon_ad_api-2.1.7.dist-info/RECORD,,
137
+ python_amazon_ad_api-2.1.9.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
138
+ python_amazon_ad_api-2.1.9.dist-info/METADATA,sha256=3C9w7RBeDq-ssu-QlOHt22duYQ2hrue2-3I-zpsOOBU,54257
139
+ python_amazon_ad_api-2.1.9.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
140
+ python_amazon_ad_api-2.1.9.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
141
+ python_amazon_ad_api-2.1.9.dist-info/RECORD,,