python-amazon-ad-api 2.3.1__py3-none-any.whl → 2.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.
Files changed (41) hide show
  1. ad_api/api/__init__.py +68 -0
  2. ad_api/api/dsp_ad_creative_association.py +147 -0
  3. ad_api/api/dsp_ad_group_and_campaign.py +139 -0
  4. ad_api/api/dsp_audience_create.py +53 -0
  5. ad_api/api/dsp_bid_adjustments.py +193 -0
  6. ad_api/api/dsp_campaign_flights.py +119 -0
  7. ad_api/api/dsp_campaign_insights.py +59 -0
  8. ad_api/api/dsp_combined_audiences.py +83 -0
  9. ad_api/api/dsp_conversion_tracking_products.py +92 -0
  10. ad_api/api/dsp_conversions.py +442 -0
  11. ad_api/api/dsp_creatives.py +114 -0
  12. ad_api/api/dsp_deal_permissions.py +170 -0
  13. ad_api/api/dsp_deal_proposals.py +440 -0
  14. ad_api/api/dsp_deals.py +204 -0
  15. ad_api/api/dsp_deals_management.py +66 -0
  16. ad_api/api/dsp_discovery_advertised_product_categories.py +35 -0
  17. ad_api/api/dsp_discovery_apps.py +36 -0
  18. ad_api/api/dsp_discovery_domain_lists.py +36 -0
  19. ad_api/api/dsp_discovery_geo_locations.py +42 -0
  20. ad_api/api/dsp_discovery_iab_content.py +37 -0
  21. ad_api/api/dsp_discovery_inventory_source_exchanges.py +36 -0
  22. ad_api/api/dsp_discovery_products.py +102 -0
  23. ad_api/api/dsp_discovery_third_party_target_segments.py +36 -0
  24. ad_api/api/dsp_frequency_associations.py +138 -0
  25. ad_api/api/dsp_frequency_groups.py +112 -0
  26. ad_api/api/dsp_frequency_insights.py +85 -0
  27. ad_api/api/dsp_guidance.py +111 -0
  28. ad_api/api/dsp_inherited_settings.py +133 -0
  29. ad_api/api/dsp_inventory_groups.py +209 -0
  30. ad_api/api/dsp_measurement.py +693 -0
  31. ad_api/api/dsp_quick_actions.py +177 -0
  32. ad_api/api/dsp_seats.py +43 -0
  33. ad_api/api/dsp_seats_management.py +84 -0
  34. ad_api/api/dsp_target_kpi_recommendations.py +44 -0
  35. ad_api/api/dsp_targeting.py +98 -0
  36. ad_api/version.py +1 -1
  37. {python_amazon_ad_api-2.3.1.dist-info → python_amazon_ad_api-2.4.1.dist-info}/METADATA +1 -1
  38. {python_amazon_ad_api-2.3.1.dist-info → python_amazon_ad_api-2.4.1.dist-info}/RECORD +41 -7
  39. {python_amazon_ad_api-2.3.1.dist-info → python_amazon_ad_api-2.4.1.dist-info}/WHEEL +0 -0
  40. {python_amazon_ad_api-2.3.1.dist-info → python_amazon_ad_api-2.4.1.dist-info}/licenses/LICENSE +0 -0
  41. {python_amazon_ad_api-2.3.1.dist-info → python_amazon_ad_api-2.4.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,170 @@
1
+ """Deal advertiser permissions /dsp/inventory/deals/{dealId}/advertiserPermissions.
2
+
3
+ Contract: Deal Advertiser Permissions 3.0. Eight operations over seven paths,
4
+ all scoped to one deal.
5
+
6
+ **Four success codes:** ``201`` on the create, ``207`` on the two bulk writes,
7
+ ``200`` on the reads, and ``200`` **with no body** on the two DELETEs.
8
+
9
+ ``ClientId`` and ``Scope`` are required, and **there is no account id header**.
10
+ The media types have capital letters: ``dspDealAdvertiserPermissionsResource``.
11
+ """
12
+
13
+ from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils
14
+
15
+
16
+ class DspDealAdvertiserPermissions(Client):
17
+ r"""Deal advertiser permissions - /dsp/inventory/deals/{dealId}/advertiserPermissions
18
+
19
+ Documentation: https://advertising.amazon.com/API/docs/en-us/deal-advertiser-permissions
20
+ """
21
+
22
+ @sp_endpoint('/dsp/inventory/deals/{}/advertiserPermissions', method='GET',
23
+ headers=['Amazon-Advertising-API-Scope'])
24
+ def get_permissions(self, dealId, version: str = "1", **kwargs) -> ApiResponse:
25
+ r"""
26
+ Reads the advertiser permissions of a deal. Read only.
27
+
28
+ Keyword Args
29
+
30
+ - ``version`` (str): the version in the media type, ``1``. [optional]
31
+
32
+ Returns
33
+ ApiResponse, ``200``, with the permissions.
34
+ """
35
+ media_type = 'application/vnd.dspDealAdvertiserPermissionsResource.v' + version + '+json'
36
+ headers = {'Accept': media_type}
37
+ return self._request(fill_query_params(kwargs.pop('path'), dealId),
38
+ params=kwargs, headers=headers)
39
+
40
+ @sp_endpoint('/dsp/inventory/deals/{}/advertiserPermissions', method='POST',
41
+ headers=['Amazon-Advertising-API-Scope'])
42
+ def create_permissions(self, dealId, version: str = "1", **kwargs) -> ApiResponse:
43
+ r"""
44
+ Grants advertiser permissions on a deal. Answers 201 with no body.
45
+
46
+ Keyword Args
47
+
48
+ - ``version`` (str): the version in the media type, ``1``. [optional]
49
+
50
+ Returns
51
+ ApiResponse, **201 created**, with **no body**.
52
+ """
53
+ media_type = 'application/vnd.dspDealAdvertiserPermissionsResource.v' + version + '+json'
54
+ headers = {'Accept': media_type}
55
+ headers['Content-Type'] = media_type
56
+ body = Utils.convert_body(kwargs.pop('body'), False)
57
+ return self._request(fill_query_params(kwargs.pop('path'), dealId),
58
+ data=body, params=kwargs, headers=headers)
59
+
60
+ @sp_endpoint('/dsp/inventory/deals/{}/advertiserPermissions', method='DELETE',
61
+ headers=['Amazon-Advertising-API-Scope'])
62
+ def delete_permissions(self, dealId, **kwargs) -> ApiResponse:
63
+ r"""
64
+ Removes the advertiser permissions of a deal.
65
+
66
+ Keyword Args
67
+
68
+ Returns
69
+ ApiResponse, ``200``, with **no body**.
70
+ """
71
+ headers = {'Accept': 'application/json'}
72
+ return self._request(fill_query_params(kwargs.pop('path'), dealId),
73
+ params=kwargs, headers=headers)
74
+
75
+ @sp_endpoint('/dsp/inventory/deals/{}/advertiserPermissions/advertiserList', method='GET',
76
+ headers=['Amazon-Advertising-API-Scope'])
77
+ def list_deal_advertisers(self, dealId, version: str = "1", **kwargs) -> ApiResponse:
78
+ r"""
79
+ Lists the advertisers permitted on a deal. Read only.
80
+
81
+ Query Params
82
+
83
+ - ``pageSize``, ``nextToken``. [optional]
84
+
85
+ Keyword Args
86
+
87
+ - ``version`` (str): the version in the media type, ``1``. [optional]
88
+
89
+ Returns
90
+ ApiResponse, ``200``, with the advertisers.
91
+ """
92
+ media_type = 'application/vnd.dspAdvertiserListResource.v' + version + '+json'
93
+ headers = {'Accept': media_type}
94
+ return self._request(fill_query_params(kwargs.pop('path'), dealId),
95
+ params=kwargs, headers=headers)
96
+
97
+ @sp_endpoint('/dsp/inventory/deals/{}/advertiserPermissions/advertiserList', method='PUT',
98
+ headers=['Amazon-Advertising-API-Scope'])
99
+ def update_deal_advertisers(self, dealId, version: str = "1", **kwargs) -> ApiResponse:
100
+ r"""
101
+ Replaces the advertiser list of a deal.
102
+
103
+ Keyword Args
104
+
105
+ - ``version`` (str): the version in the media type, ``1``. [optional]
106
+
107
+ Returns
108
+ ApiResponse, **207** multi-status.
109
+ """
110
+ media_type = 'application/vnd.dspAdvertiserListResource.v' + version + '+json'
111
+ headers = {'Accept': media_type}
112
+ headers['Content-Type'] = media_type
113
+ body = Utils.convert_body(kwargs.pop('body'), False)
114
+ return self._request(fill_query_params(kwargs.pop('path'), dealId),
115
+ data=body, params=kwargs, headers=headers)
116
+
117
+ @sp_endpoint('/dsp/inventory/deals/{}/advertiserPermissions/recommendedAdvertiser/list', method='POST',
118
+ headers=['Amazon-Advertising-API-Scope'])
119
+ def list_recommended_advertisers(self, dealId, version: str = "1", **kwargs) -> ApiResponse:
120
+ r"""
121
+ Lists the advertisers Amazon recommends for a deal. Read only.
122
+
123
+ Keyword Args
124
+
125
+ - ``version`` (str): the version in the media type, ``1``. [optional]
126
+
127
+ Returns
128
+ ApiResponse, ``200``, with the recommendations.
129
+ """
130
+ media_type = 'application/vnd.dspDealRecommendedAdvertiser.v' + version + '+json'
131
+ headers = {'Accept': media_type}
132
+ headers['Content-Type'] = media_type
133
+ body = Utils.convert_body(kwargs.pop('body'), False)
134
+ return self._request(fill_query_params(kwargs.pop('path'), dealId),
135
+ data=body, params=kwargs, headers=headers)
136
+
137
+ @sp_endpoint('/dsp/inventory/deals/{}/advertiserPermissions/recommendedAdvertisers', method='PUT',
138
+ headers=['Amazon-Advertising-API-Scope'])
139
+ def update_recommended_advertisers(self, dealId, version: str = "1", **kwargs) -> ApiResponse:
140
+ r"""
141
+ Applies recommended advertisers to a deal.
142
+
143
+ Keyword Args
144
+
145
+ - ``version`` (str): the version in the media type, ``1``. [optional]
146
+
147
+ Returns
148
+ ApiResponse, **207** multi-status.
149
+ """
150
+ media_type = 'application/vnd.dspDealRecommendedAdvertiser.v' + version + '+json'
151
+ headers = {'Accept': media_type}
152
+ headers['Content-Type'] = media_type
153
+ body = Utils.convert_body(kwargs.pop('body'), False)
154
+ return self._request(fill_query_params(kwargs.pop('path'), dealId),
155
+ data=body, params=kwargs, headers=headers)
156
+
157
+ @sp_endpoint('/dsp/inventory/deals/{}/advertiserPermissions/recommendedAdvertisers', method='DELETE',
158
+ headers=['Amazon-Advertising-API-Scope'])
159
+ def delete_recommended_advertisers(self, dealId, **kwargs) -> ApiResponse:
160
+ r"""
161
+ Clears the recommended advertisers of a deal.
162
+
163
+ Keyword Args
164
+
165
+ Returns
166
+ ApiResponse, ``200``, with **no body**.
167
+ """
168
+ headers = {'Accept': 'application/json'}
169
+ return self._request(fill_query_params(kwargs.pop('path'), dealId),
170
+ params=kwargs, headers=headers)
@@ -0,0 +1,440 @@
1
+ """Deal proposals /dsp/inventory/proposal*.
2
+
3
+ Contract: Deal Proposals 3.0. Eighteen operations over sixteen paths, in two
4
+ families: proposals (``dspproposalResource``) and proposed deals
5
+ (``dspproposedDealResource``). Signals have a third,
6
+ ``dspsignalCollectionsResource``.
7
+
8
+ **207 on the writes**, 200 on the reads and on the status updates.
9
+ ``Amazon-Advertising-API-ClientId`` and ``Amazon-Ads-AccountId`` are required,
10
+ ``Scope`` is optional.
11
+ """
12
+
13
+ from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils
14
+
15
+
16
+ class DspDealProposals(Client):
17
+ r"""Deal proposals - /dsp/inventory/proposal*
18
+
19
+ Documentation: https://advertising.amazon.com/API/docs/en-us/deal-proposals
20
+ """
21
+
22
+ @sp_endpoint('/dsp/inventory/proposals/list', method='POST',
23
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
24
+ def list_proposals(self, version: str = "1", **kwargs) -> ApiResponse:
25
+ r"""
26
+ Lists proposals. Read only.
27
+
28
+ Keyword Args
29
+
30
+ - ``version`` (str): the version in the media type, ``1``. [optional]
31
+
32
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
33
+
34
+ Returns
35
+ ApiResponse, ``200``, with the proposals.
36
+ """
37
+ media_type = 'application/vnd.dspproposalResource.v' + version + '+json'
38
+ headers = {'Accept': media_type}
39
+ headers['Content-Type'] = media_type
40
+ body = Utils.convert_body(kwargs.pop('body'), False)
41
+ return self._request(kwargs.pop('path'),
42
+ data=body, params=kwargs, headers=headers)
43
+
44
+ @sp_endpoint('/dsp/inventory/proposals', method='POST',
45
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
46
+ def create_proposals(self, version: str = "1", **kwargs) -> ApiResponse:
47
+ r"""
48
+ Creates proposals.
49
+
50
+ Keyword Args
51
+
52
+ - ``version`` (str): the version in the media type, ``1``. [optional]
53
+
54
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
55
+
56
+ Returns
57
+ ApiResponse, **207** multi-status.
58
+ """
59
+ media_type = 'application/vnd.dspproposalResource.v' + version + '+json'
60
+ headers = {'Accept': media_type}
61
+ headers['Content-Type'] = media_type
62
+ body = Utils.convert_body(kwargs.pop('body'), False)
63
+ return self._request(kwargs.pop('path'),
64
+ data=body, params=kwargs, headers=headers)
65
+
66
+ @sp_endpoint('/dsp/inventory/proposals', method='PUT',
67
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
68
+ def update_proposals(self, version: str = "1", **kwargs) -> ApiResponse:
69
+ r"""
70
+ Updates proposals in bulk.
71
+
72
+ Keyword Args
73
+
74
+ - ``version`` (str): the version in the media type, ``1``. [optional]
75
+
76
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
77
+
78
+ Returns
79
+ ApiResponse, **207** multi-status.
80
+ """
81
+ media_type = 'application/vnd.dspproposalResource.v' + version + '+json'
82
+ headers = {'Accept': media_type}
83
+ headers['Content-Type'] = media_type
84
+ body = Utils.convert_body(kwargs.pop('body'), False)
85
+ return self._request(kwargs.pop('path'),
86
+ data=body, params=kwargs, headers=headers)
87
+
88
+ @sp_endpoint('/dsp/inventory/proposals/buyer/batchTransaction', method='POST',
89
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
90
+ def batch_transaction_proposals(self, version: str = "1", **kwargs) -> ApiResponse:
91
+ r"""
92
+ Applies a batch transaction to proposals: accept, reject or counter in bulk.
93
+
94
+ Keyword Args
95
+
96
+ - ``version`` (str): the version in the media type, ``1``. [optional]
97
+
98
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
99
+
100
+ Returns
101
+ ApiResponse, **207** multi-status.
102
+ """
103
+ media_type = 'application/vnd.dspproposalResource.v' + version + '+json'
104
+ headers = {'Accept': media_type}
105
+ headers['Content-Type'] = media_type
106
+ body = Utils.convert_body(kwargs.pop('body'), False)
107
+ return self._request(kwargs.pop('path'),
108
+ data=body, params=kwargs, headers=headers)
109
+
110
+ @sp_endpoint('/dsp/inventory/proposal/{}/status', method='PUT',
111
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
112
+ def update_proposal_status(self, proposalId, version: str = "1", **kwargs) -> ApiResponse:
113
+ r"""
114
+ Moves a proposal to a new status.
115
+
116
+ Path Parameters
117
+
118
+ - ``proposalId`` (str): the proposal. [required]
119
+
120
+ Keyword Args
121
+
122
+ - ``version`` (str): the version in the media type, ``1``. [optional]
123
+
124
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
125
+
126
+ Returns
127
+ ApiResponse, ``200``.
128
+ """
129
+ media_type = 'application/vnd.dspproposalResource.v' + version + '+json'
130
+ headers = {'Accept': media_type}
131
+ headers['Content-Type'] = media_type
132
+ body = Utils.convert_body(kwargs.pop('body'), False)
133
+ return self._request(fill_query_params(kwargs.pop('path'), proposalId),
134
+ data=body, params=kwargs, headers=headers)
135
+
136
+ @sp_endpoint('/dsp/inventory/proposalSources/list', method='POST',
137
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
138
+ def list_proposal_sources(self, version: str = "1", **kwargs) -> ApiResponse:
139
+ r"""
140
+ Lists the sources a proposal can come from. Read only.
141
+
142
+ Keyword Args
143
+
144
+ - ``version`` (str): the version in the media type, ``1``. [optional]
145
+
146
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
147
+
148
+ Returns
149
+ ApiResponse, ``200``, with the sources.
150
+ """
151
+ media_type = 'application/vnd.dspproposalSourceResource.v' + version + '+json'
152
+ headers = {'Accept': media_type}
153
+ headers['Content-Type'] = media_type
154
+ body = Utils.convert_body(kwargs.pop('body'), False)
155
+ return self._request(kwargs.pop('path'),
156
+ data=body, params=kwargs, headers=headers)
157
+
158
+ @sp_endpoint('/dsp/inventory/proposalSource/{}/publishers/list', method='POST',
159
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
160
+ def list_proposal_source_publishers(self, sourceId, version: str = "1", **kwargs) -> ApiResponse:
161
+ r"""
162
+ Lists the publishers of a source. Read only.
163
+
164
+ Keyword Args
165
+
166
+ - ``version`` (str): the version in the media type, ``1``. [optional]
167
+
168
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
169
+
170
+ Returns
171
+ ApiResponse, ``200``, with the publishers.
172
+ """
173
+ media_type = 'application/vnd.dspproposalSourceResource.v' + version + '+json'
174
+ headers = {'Accept': media_type}
175
+ headers['Content-Type'] = media_type
176
+ body = Utils.convert_body(kwargs.pop('body'), False)
177
+ return self._request(fill_query_params(kwargs.pop('path'), sourceId),
178
+ data=body, params=kwargs, headers=headers)
179
+
180
+ @sp_endpoint('/dsp/inventory/proposalSource/{}/publisherProducts/list', method='POST',
181
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
182
+ def list_proposal_source_products(self, sourceId, version: str = "1", **kwargs) -> ApiResponse:
183
+ r"""
184
+ Lists the publisher products of a source. Read only.
185
+
186
+ Keyword Args
187
+
188
+ - ``version`` (str): the version in the media type, ``1``. [optional]
189
+
190
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
191
+
192
+ Returns
193
+ ApiResponse, ``200``, with the products.
194
+ """
195
+ media_type = 'application/vnd.dspproposalSourceResource.v' + version + '+json'
196
+ headers = {'Accept': media_type}
197
+ headers['Content-Type'] = media_type
198
+ body = Utils.convert_body(kwargs.pop('body'), False)
199
+ return self._request(fill_query_params(kwargs.pop('path'), sourceId),
200
+ data=body, params=kwargs, headers=headers)
201
+
202
+ @sp_endpoint('/dsp/inventory/proposalSource/{}/publisherOfferings/list', method='POST',
203
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
204
+ def list_proposal_source_offerings(self, sourceId, version: str = "1", **kwargs) -> ApiResponse:
205
+ r"""
206
+ Lists the publisher offerings of a source. Read only.
207
+
208
+ Keyword Args
209
+
210
+ - ``version`` (str): the version in the media type, ``1``. [optional]
211
+
212
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
213
+
214
+ Returns
215
+ ApiResponse, ``200``, with the offerings.
216
+ """
217
+ media_type = 'application/vnd.dspproposalSourceResource.v' + version + '+json'
218
+ headers = {'Accept': media_type}
219
+ headers['Content-Type'] = media_type
220
+ body = Utils.convert_body(kwargs.pop('body'), False)
221
+ return self._request(fill_query_params(kwargs.pop('path'), sourceId),
222
+ data=body, params=kwargs, headers=headers)
223
+
224
+ @sp_endpoint('/dsp/inventory/proposalSource/{}/publisherProduct/{}/rate', method='POST',
225
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
226
+ def rate_publisher_product(self, sourceId, publisherProductId, version: str = "1", **kwargs) -> ApiResponse:
227
+ r"""
228
+ Reads the rate of a publisher product. Read only despite the POST.
229
+
230
+ Keyword Args
231
+
232
+ - ``version`` (str): the version in the media type, ``1``. [optional]
233
+
234
+ Returns
235
+ ApiResponse, ``200``, with the rate.
236
+ """
237
+ media_type = 'application/vnd.dspproposalSourceResource.v' + version + '+json'
238
+ headers = {'Accept': media_type}
239
+ headers['Content-Type'] = media_type
240
+ body = Utils.convert_body(kwargs.pop('body'), False)
241
+ return self._request(fill_query_params(kwargs.pop('path'), sourceId, publisherProductId),
242
+ data=body, params=kwargs, headers=headers)
243
+
244
+ @sp_endpoint('/dsp/inventory/proposalSources/amazonMedia/{}/signals/collections/list', method='POST',
245
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
246
+ def list_amazon_media_signal_collections(self, amazonMediaPublisherId, version: str = "1", **kwargs) -> ApiResponse:
247
+ r"""
248
+ Lists the signal collections of an Amazon Media publisher. Read only.
249
+
250
+ Its media type is ``dspsignalCollectionsResource``, not the proposal one.
251
+
252
+ Keyword Args
253
+
254
+ - ``version`` (str): the version in the media type, ``1``. [optional]
255
+
256
+ Returns
257
+ ApiResponse, ``200``, with the collections.
258
+ """
259
+ media_type = 'application/vnd.dspsignalCollectionsResource.v' + version + '+json'
260
+ headers = {'Accept': media_type}
261
+ headers['Content-Type'] = media_type
262
+ body = Utils.convert_body(kwargs.pop('body'), False)
263
+ return self._request(fill_query_params(kwargs.pop('path'), amazonMediaPublisherId),
264
+ data=body, params=kwargs, headers=headers)
265
+
266
+ @sp_endpoint('/dsp/inventory/proposedDeals/list', method='POST',
267
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
268
+ def list_proposed_deals(self, version: str = "1", **kwargs) -> ApiResponse:
269
+ r"""
270
+ Lists proposed deals. Read only.
271
+
272
+ Keyword Args
273
+
274
+ - ``version`` (str): the version in the media type, ``1``. [optional]
275
+
276
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
277
+
278
+ Returns
279
+ ApiResponse, ``200``, with the deals.
280
+ """
281
+ media_type = 'application/vnd.dspproposedDealResource.v' + version + '+json'
282
+ headers = {'Accept': media_type}
283
+ headers['Content-Type'] = media_type
284
+ body = Utils.convert_body(kwargs.pop('body'), False)
285
+ return self._request(kwargs.pop('path'),
286
+ data=body, params=kwargs, headers=headers)
287
+
288
+ @sp_endpoint('/dsp/inventory/proposedDeals', method='POST',
289
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
290
+ def create_proposed_deals(self, version: str = "1", **kwargs) -> ApiResponse:
291
+ r"""
292
+ Creates proposed deals.
293
+
294
+ Keyword Args
295
+
296
+ - ``version`` (str): the version in the media type, ``1``. [optional]
297
+
298
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
299
+
300
+ Returns
301
+ ApiResponse, **207** multi-status.
302
+ """
303
+ media_type = 'application/vnd.dspproposedDealResource.v' + version + '+json'
304
+ headers = {'Accept': media_type}
305
+ headers['Content-Type'] = media_type
306
+ body = Utils.convert_body(kwargs.pop('body'), False)
307
+ return self._request(kwargs.pop('path'),
308
+ data=body, params=kwargs, headers=headers)
309
+
310
+ @sp_endpoint('/dsp/inventory/proposedDeals', method='PUT',
311
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
312
+ def update_proposed_deals(self, version: str = "1", **kwargs) -> ApiResponse:
313
+ r"""
314
+ Updates proposed deals in bulk.
315
+
316
+ Keyword Args
317
+
318
+ - ``version`` (str): the version in the media type, ``1``. [optional]
319
+
320
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
321
+
322
+ Returns
323
+ ApiResponse, **207** multi-status.
324
+ """
325
+ media_type = 'application/vnd.dspproposedDealResource.v' + version + '+json'
326
+ headers = {'Accept': media_type}
327
+ headers['Content-Type'] = media_type
328
+ body = Utils.convert_body(kwargs.pop('body'), False)
329
+ return self._request(kwargs.pop('path'),
330
+ data=body, params=kwargs, headers=headers)
331
+
332
+ @sp_endpoint('/dsp/inventory/proposedDeals/amazonMedia/calculateImpressions', method='POST',
333
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
334
+ def calculate_deal_impressions(self, version: str = "1", **kwargs) -> ApiResponse:
335
+ r"""
336
+ Estimates the impressions of a proposed deal. Read only.
337
+
338
+ Keyword Args
339
+
340
+ - ``version`` (str): the version in the media type, ``1``. [optional]
341
+
342
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
343
+
344
+ Returns
345
+ ApiResponse, ``200``, with the impression estimate.
346
+ """
347
+ media_type = 'application/vnd.dspproposedDealResource.v' + version + '+json'
348
+ headers = {'Accept': media_type}
349
+ headers['Content-Type'] = media_type
350
+ body = Utils.convert_body(kwargs.pop('body'), False)
351
+ return self._request(kwargs.pop('path'),
352
+ data=body, params=kwargs, headers=headers)
353
+
354
+ @sp_endpoint('/dsp/inventory/proposedDeals/status', method='PUT',
355
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
356
+ def update_proposed_deal_status(self, version: str = "1", **kwargs) -> ApiResponse:
357
+ r"""
358
+ Moves proposed deals to a new status.
359
+
360
+ Keyword Args
361
+
362
+ - ``version`` (str): the version in the media type, ``1``. [optional]
363
+
364
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
365
+
366
+ Returns
367
+ ApiResponse, **207** multi-status.
368
+ """
369
+ media_type = 'application/vnd.dspproposedDealResource.v' + version + '+json'
370
+ headers = {'Accept': media_type}
371
+ headers['Content-Type'] = media_type
372
+ body = Utils.convert_body(kwargs.pop('body'), False)
373
+ return self._request(kwargs.pop('path'),
374
+ data=body, params=kwargs, headers=headers)
375
+
376
+ @sp_endpoint('/dsp/inventory/proposedDeals/revisions', method='POST',
377
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
378
+ def create_deal_revisions(self, version: str = "1", **kwargs) -> ApiResponse:
379
+ r"""
380
+ Creates revisions of proposed deals.
381
+
382
+ Keyword Args
383
+
384
+ - ``version`` (str): the version in the media type, ``1``. [optional]
385
+
386
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
387
+
388
+ Returns
389
+ ApiResponse, **207** multi-status.
390
+ """
391
+ media_type = 'application/vnd.dspproposedDealResource.v' + version + '+json'
392
+ headers = {'Accept': media_type}
393
+ headers['Content-Type'] = media_type
394
+ body = Utils.convert_body(kwargs.pop('body'), False)
395
+ return self._request(kwargs.pop('path'),
396
+ data=body, params=kwargs, headers=headers)
397
+
398
+ @sp_endpoint('/dsp/inventory/proposedDeals/revisions', method='PUT',
399
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
400
+ def update_deal_revisions(self, version: str = "1", **kwargs) -> ApiResponse:
401
+ r"""
402
+ Updates deal revisions.
403
+
404
+ Keyword Args
405
+
406
+ - ``version`` (str): the version in the media type, ``1``. [optional]
407
+
408
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
409
+
410
+ Returns
411
+ ApiResponse, **207** multi-status.
412
+ """
413
+ media_type = 'application/vnd.dspproposedDealResource.v' + version + '+json'
414
+ headers = {'Accept': media_type}
415
+ headers['Content-Type'] = media_type
416
+ body = Utils.convert_body(kwargs.pop('body'), False)
417
+ return self._request(kwargs.pop('path'),
418
+ data=body, params=kwargs, headers=headers)
419
+
420
+ @sp_endpoint('/dsp/inventory/proposedDeals/revisions/delete', method='POST',
421
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
422
+ def delete_deal_revisions(self, version: str = "1", **kwargs) -> ApiResponse:
423
+ r"""
424
+ Deletes deal revisions. A POST with ``/delete``.
425
+
426
+ Keyword Args
427
+
428
+ - ``version`` (str): the version in the media type, ``1``. [optional]
429
+
430
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
431
+
432
+ Returns
433
+ ApiResponse, **207** multi-status.
434
+ """
435
+ media_type = 'application/vnd.dspproposedDealResource.v' + version + '+json'
436
+ headers = {'Accept': media_type}
437
+ headers['Content-Type'] = media_type
438
+ body = Utils.convert_body(kwargs.pop('body'), False)
439
+ return self._request(kwargs.pop('path'),
440
+ data=body, params=kwargs, headers=headers)