python-amazon-ad-api 2.4.7__py3-none-any.whl → 2.4.8__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.
@@ -1,4 +1,9 @@
1
1
  from .custom_models import CustomModels
2
2
  from .administration import Administration
3
+ from .reporting import Reporting
3
4
 
4
- __all__ = ['CustomModels', 'Administration']
5
+ __all__ = [
6
+ 'CustomModels',
7
+ 'Administration',
8
+ 'Reporting'
9
+ ]
@@ -0,0 +1,834 @@
1
+ from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils
2
+
3
+
4
+ class Reporting(Client):
5
+ r"""
6
+ Reporting(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)
7
+
8
+ Amazon Marketing Cloud - Reporting (Workflow Management Service)
9
+
10
+ Endpoints under ``/amc/reporting/{instanceId}/...`` for managing AMC workflows,
11
+ schedules, workflow executions, and data sources.
12
+
13
+ All endpoints require the ``Amazon-Advertising-API-ClientId`` header
14
+ (sent automatically from ``client_id`` in credentials) and the
15
+ ``Amazon-Advertising-API-AdvertiserId`` and ``Amazon-Advertising-API-MarketplaceId`` headers.
16
+
17
+ The ``Amazon-Advertising-API-Scope`` header is optional (from ``profile_id``).
18
+ The ``Amazon-Ads-AccountId`` header is optional (from ``account_id``) for some endpoints.
19
+
20
+ Request/response media types vary by resource:
21
+ - Data sources: ``application/vnd.amcdatasources.v{version}+json``
22
+ - Schedules: ``application/vnd.amcschedules.v{version}+json``
23
+ - Workflow executions: ``application/vnd.amcworkflowexecutions.v{version}+json``
24
+ - Workflows: ``application/vnd.amcworkflows.v{version}+json``
25
+ """
26
+
27
+ # Data Sources
28
+
29
+ @sp_endpoint('/amc/reporting/{}/dataSources', method='GET', headers=[])
30
+ def list_data_sources(self, instance_id: str, version: str = "1", next_token: str = None,
31
+ amazon_advertising_api_advertiser_id: str = None,
32
+ amazon_advertising_api_marketplace_id: str = None,
33
+ **kwargs) -> ApiResponse:
34
+ r"""
35
+ list_data_sources(instance_id: str, version: str = "1", next_token: str = None,
36
+ amazon_advertising_api_advertiser_id: str = None,
37
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
38
+
39
+ Returns a list of available data sources (operationId: listDataSources)
40
+
41
+ Path Parameters
42
+ | **instanceId** (string) [required] The AMC instance ID
43
+
44
+ Query Parameters
45
+ | **nextToken** (string) [optional] Token to retrieve subsequent page of results
46
+
47
+ Headers
48
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
49
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
50
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
51
+
52
+ Returns
53
+ ApiResponse
54
+ | **dataSources** (array)
55
+ | **dataSourceId** (string)
56
+ | **name** (string)
57
+ | **description** (string)
58
+ | **tableName** (string)
59
+ | **category** (string)
60
+ | **version** (string)
61
+ | **createdAt** (string)
62
+ | **updatedAt** (string)
63
+ | **nextToken** (string)
64
+
65
+ """
66
+ media_type = f'application/vnd.amcdatasources.v{version}+json'
67
+ headers = {"Accept": media_type, "Content-Type": media_type}
68
+ if amazon_advertising_api_advertiser_id:
69
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
70
+ if amazon_advertising_api_marketplace_id:
71
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
72
+ path = fill_query_params(kwargs.pop('path'), instance_id)
73
+ params = dict(kwargs)
74
+ if next_token:
75
+ params['nextToken'] = next_token
76
+ return self._request(path, params=params, headers=headers)
77
+
78
+ @sp_endpoint('/amc/reporting/{}/dataSources/{}', method='GET', headers=[])
79
+ def get_data_source(self, instance_id: str, data_source_id: str, version: str = "1",
80
+ amazon_advertising_api_advertiser_id: str = None,
81
+ amazon_advertising_api_marketplace_id: str = None,
82
+ **kwargs) -> ApiResponse:
83
+ r"""
84
+ get_data_source(instance_id: str, data_source_id: str, version: str = "1",
85
+ amazon_advertising_api_advertiser_id: str = None,
86
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
87
+
88
+ Gets information about the requested data source (operationId: getDataSource)
89
+
90
+ Path Parameters
91
+ | **instanceId** (string) [required] The AMC instance ID
92
+ | **dataSourceId** (string) [required] The data source ID
93
+
94
+ Headers
95
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
96
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
97
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
98
+
99
+ Returns
100
+ ApiResponse
101
+ | **dataSourceId** (string)
102
+ | **name** (string)
103
+ | **description** (string)
104
+ | **tableName** (string)
105
+ | **category** (string)
106
+ | **version** (string)
107
+ | **createdAt** (string)
108
+ | **updatedAt** (string)
109
+
110
+ """
111
+ media_type = f'application/vnd.amcdatasources.v{version}+json'
112
+ headers = {"Accept": media_type, "Content-Type": media_type}
113
+ if amazon_advertising_api_advertiser_id:
114
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
115
+ if amazon_advertising_api_marketplace_id:
116
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
117
+ path = fill_query_params(kwargs.pop('path'), instance_id, data_source_id)
118
+ params = dict(kwargs)
119
+ return self._request(path, params=params, headers=headers)
120
+
121
+ # Schedules
122
+
123
+ @sp_endpoint('/amc/reporting/{}/schedules', method='GET', headers=[])
124
+ def list_schedules(self, instance_id: str, version: str = "1", next_token: str = None,
125
+ amazon_advertising_api_advertiser_id: str = None,
126
+ amazon_advertising_api_marketplace_id: str = None,
127
+ selector: str = "account_id",
128
+ **kwargs) -> ApiResponse:
129
+ r"""
130
+ list_schedules(instance_id: str, version: str = "1", next_token: str = None,
131
+ amazon_advertising_api_advertiser_id: str = None,
132
+ amazon_advertising_api_marketplace_id: str = None,
133
+ selector: str = "account_id") -> ApiResponse
134
+
135
+ Returns a list of schedules (operationId: listSchedules)
136
+
137
+ Path Parameters
138
+ | **instanceId** (string) [required] The AMC instance ID
139
+
140
+ Query Parameters
141
+ | **nextToken** (string) [optional] Token to retrieve subsequent page of results
142
+
143
+ Headers
144
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
145
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
146
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
147
+ | **Amazon-Ads-AccountId** (string) [optional] From account_id (via selector)
148
+
149
+ Returns
150
+ ApiResponse
151
+ | **schedules** (array)
152
+ | **scheduleId** (string)
153
+ | **name** (string)
154
+ | **description** (string)
155
+ | **workflowId** (string)
156
+ | **cronExpression** (string)
157
+ | **timezone** (string)
158
+ | **status** (string)
159
+ | **createdAt** (string)
160
+ | **updatedAt** (string)
161
+ | **nextToken** (string)
162
+
163
+ """
164
+ media_type = f'application/vnd.amcschedules.v{version}+json'
165
+ headers = {"Accept": media_type, "Content-Type": media_type}
166
+ if amazon_advertising_api_advertiser_id:
167
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
168
+ if amazon_advertising_api_marketplace_id:
169
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
170
+ path = fill_query_params(kwargs.pop('path'), instance_id)
171
+ params = dict(kwargs)
172
+ if next_token:
173
+ params['nextToken'] = next_token
174
+ return self._request(path, params=params, headers=headers, selector=selector)
175
+
176
+ @sp_endpoint('/amc/reporting/{}/schedules', method='POST', headers=[])
177
+ def create_schedule(self, instance_id: str, body: dict, version: str = "1",
178
+ amazon_advertising_api_advertiser_id: str = None,
179
+ amazon_advertising_api_marketplace_id: str = None,
180
+ selector: str = "account_id",
181
+ **kwargs) -> ApiResponse:
182
+ r"""
183
+ create_schedule(instance_id: str, body: dict, version: str = "1",
184
+ amazon_advertising_api_advertiser_id: str = None,
185
+ amazon_advertising_api_marketplace_id: str = None,
186
+ selector: str = "account_id") -> ApiResponse
187
+
188
+ Creates a new schedule (operationId: createSchedule)
189
+
190
+ Path Parameters
191
+ | **instanceId** (string) [required] The AMC instance ID
192
+
193
+ Request Body (application/vnd.amcschedules.v{version}+json)
194
+ | **name** (string) [required]
195
+ | **description** (string) [optional]
196
+ | **workflowId** (string) [required]
197
+ | **cronExpression** (string) [required]
198
+ | **timezone** (string) [required]
199
+
200
+ Headers
201
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
202
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
203
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
204
+ | **Amazon-Ads-AccountId** (string) [optional] From account_id (via selector)
205
+
206
+ Returns
207
+ ApiResponse
208
+ | **scheduleId** (string)
209
+ | **name** (string)
210
+ | **description** (string)
211
+ | **workflowId** (string)
212
+ | **cronExpression** (string)
213
+ | **timezone** (string)
214
+ | **status** (string)
215
+ | **createdAt** (string)
216
+ | **updatedAt** (string)
217
+
218
+ """
219
+ media_type = f'application/vnd.amcschedules.v{version}+json'
220
+ headers = {"Accept": media_type, "Content-Type": media_type}
221
+ if amazon_advertising_api_advertiser_id:
222
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
223
+ if amazon_advertising_api_marketplace_id:
224
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
225
+ path = fill_query_params(kwargs.pop('path'), instance_id)
226
+ params = dict(kwargs)
227
+ return self._request(
228
+ path,
229
+ data=Utils.convert_body(body, False),
230
+ params=params,
231
+ headers=headers,
232
+ selector=selector
233
+ )
234
+
235
+ @sp_endpoint('/amc/reporting/{}/schedules/{}', method='DELETE', headers=[])
236
+ def delete_schedule(self, instance_id: str, schedule_id: str, version: str = "1",
237
+ amazon_advertising_api_advertiser_id: str = None,
238
+ amazon_advertising_api_marketplace_id: str = None,
239
+ selector: str = "account_id",
240
+ **kwargs) -> ApiResponse:
241
+ r"""
242
+ delete_schedule(instance_id: str, schedule_id: str, version: str = "1",
243
+ amazon_advertising_api_advertiser_id: str = None,
244
+ amazon_advertising_api_marketplace_id: str = None,
245
+ selector: str = "account_id") -> ApiResponse
246
+
247
+ Deletes the requested schedule (operationId: deleteSchedule)
248
+
249
+ Path Parameters
250
+ | **instanceId** (string) [required] The AMC instance ID
251
+ | **scheduleId** (string) [required] The schedule ID
252
+
253
+ Headers
254
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
255
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
256
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
257
+ | **Amazon-Ads-AccountId** (string) [optional] From account_id (via selector)
258
+
259
+ Returns
260
+ ApiResponse (empty on success)
261
+
262
+ """
263
+ media_type = f'application/vnd.amcschedules.v{version}+json'
264
+ headers = {"Accept": media_type, "Content-Type": media_type}
265
+ if amazon_advertising_api_advertiser_id:
266
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
267
+ if amazon_advertising_api_marketplace_id:
268
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
269
+ path = fill_query_params(kwargs.pop('path'), instance_id, schedule_id)
270
+ params = dict(kwargs)
271
+ return self._request(path, params=params, headers=headers, selector=selector)
272
+
273
+ @sp_endpoint('/amc/reporting/{}/schedules/{}', method='GET', headers=[])
274
+ def get_schedule(self, instance_id: str, schedule_id: str, version: str = "1",
275
+ amazon_advertising_api_advertiser_id: str = None,
276
+ amazon_advertising_api_marketplace_id: str = None,
277
+ selector: str = "account_id",
278
+ **kwargs) -> ApiResponse:
279
+ r"""
280
+ get_schedule(instance_id: str, schedule_id: str, version: str = "1",
281
+ amazon_advertising_api_advertiser_id: str = None,
282
+ amazon_advertising_api_marketplace_id: str = None,
283
+ selector: str = "account_id") -> ApiResponse
284
+
285
+ Gets the requested schedule (operationId: getSchedule)
286
+
287
+ Path Parameters
288
+ | **instanceId** (string) [required] The AMC instance ID
289
+ | **scheduleId** (string) [required] The schedule ID
290
+
291
+ Headers
292
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
293
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
294
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
295
+ | **Amazon-Ads-AccountId** (string) [optional] From account_id (via selector)
296
+
297
+ Returns
298
+ ApiResponse
299
+ | **scheduleId** (string)
300
+ | **name** (string)
301
+ | **description** (string)
302
+ | **workflowId** (string)
303
+ | **cronExpression** (string)
304
+ | **timezone** (string)
305
+ | **status** (string)
306
+ | **createdAt** (string)
307
+ | **updatedAt** (string)
308
+
309
+ """
310
+ media_type = f'application/vnd.amcschedules.v{version}+json'
311
+ headers = {"Accept": media_type, "Content-Type": media_type}
312
+ if amazon_advertising_api_advertiser_id:
313
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
314
+ if amazon_advertising_api_marketplace_id:
315
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
316
+ path = fill_query_params(kwargs.pop('path'), instance_id, schedule_id)
317
+ params = dict(kwargs)
318
+ return self._request(path, params=params, headers=headers, selector=selector)
319
+
320
+ @sp_endpoint('/amc/reporting/{}/schedules/{}', method='PUT', headers=[])
321
+ def update_schedule(self, instance_id: str, schedule_id: str, body: dict, version: str = "1",
322
+ amazon_advertising_api_advertiser_id: str = None,
323
+ amazon_advertising_api_marketplace_id: str = None,
324
+ selector: str = "account_id",
325
+ **kwargs) -> ApiResponse:
326
+ r"""
327
+ update_schedule(instance_id: str, schedule_id: str, body: dict, version: str = "1",
328
+ amazon_advertising_api_advertiser_id: str = None,
329
+ amazon_advertising_api_marketplace_id: str = None,
330
+ selector: str = "account_id") -> ApiResponse
331
+
332
+ Updates the requested schedule (operationId: updateSchedule)
333
+
334
+ Path Parameters
335
+ | **instanceId** (string) [required] The AMC instance ID
336
+ | **scheduleId** (string) [required] The schedule ID
337
+
338
+ Request Body (application/vnd.amcschedules.v{version}+json)
339
+ | **name** (string) [optional]
340
+ | **description** (string) [optional]
341
+ | **workflowId** (string) [optional]
342
+ | **cronExpression** (string) [optional]
343
+ | **timezone** (string) [optional]
344
+
345
+ Headers
346
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
347
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
348
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
349
+ | **Amazon-Ads-AccountId** (string) [optional] From account_id (via selector)
350
+
351
+ Returns
352
+ ApiResponse
353
+ | **scheduleId** (string)
354
+ | **name** (string)
355
+ | **description** (string)
356
+ | **workflowId** (string)
357
+ | **cronExpression** (string)
358
+ | **timezone** (string)
359
+ | **status** (string)
360
+ | **createdAt** (string)
361
+ | **updatedAt** (string)
362
+
363
+ """
364
+ media_type = f'application/vnd.amcschedules.v{version}+json'
365
+ headers = {"Accept": media_type, "Content-Type": media_type}
366
+ if amazon_advertising_api_advertiser_id:
367
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
368
+ if amazon_advertising_api_marketplace_id:
369
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
370
+ path = fill_query_params(kwargs.pop('path'), instance_id, schedule_id)
371
+ params = dict(kwargs)
372
+ return self._request(
373
+ path,
374
+ data=Utils.convert_body(body, False),
375
+ params=params,
376
+ headers=headers,
377
+ selector=selector
378
+ )
379
+
380
+ # Workflow Executions
381
+
382
+ @sp_endpoint('/amc/reporting/{}/workflowExecutions', method='GET', headers=[])
383
+ def list_workflow_executions(self, instance_id: str, version: str = "1", next_token: str = None,
384
+ amazon_advertising_api_advertiser_id: str = None,
385
+ amazon_advertising_api_marketplace_id: str = None,
386
+ **kwargs) -> ApiResponse:
387
+ r"""
388
+ list_workflow_executions(instance_id: str, version: str = "1", next_token: str = None,
389
+ amazon_advertising_api_advertiser_id: str = None,
390
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
391
+
392
+ Returns a list of workflow executions (operationId: listWorkflowExecutions)
393
+
394
+ Path Parameters
395
+ | **instanceId** (string) [required] The AMC instance ID
396
+
397
+ Query Parameters
398
+ | **nextToken** (string) [optional] Token to retrieve subsequent page of results
399
+
400
+ Headers
401
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
402
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
403
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
404
+
405
+ Returns
406
+ ApiResponse
407
+ | **workflowExecutions** (array)
408
+ | **workflowExecutionId** (string)
409
+ | **workflowId** (string)
410
+ | **status** (string)
411
+ | **startTime** (string)
412
+ | **endTime** (string)
413
+ | **createdAt** (string)
414
+ | **updatedAt** (string)
415
+ | **nextToken** (string)
416
+
417
+ """
418
+ media_type = f'application/vnd.amcworkflowexecutions.v{version}+json'
419
+ headers = {"Accept": media_type, "Content-Type": media_type}
420
+ if amazon_advertising_api_advertiser_id:
421
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
422
+ if amazon_advertising_api_marketplace_id:
423
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
424
+ path = fill_query_params(kwargs.pop('path'), instance_id)
425
+ params = dict(kwargs)
426
+ if next_token:
427
+ params['nextToken'] = next_token
428
+ return self._request(path, params=params, headers=headers)
429
+
430
+ @sp_endpoint('/amc/reporting/{}/workflowExecutions', method='POST', headers=[])
431
+ def create_workflow_execution(self, instance_id: str, body: dict, version: str = "1",
432
+ amazon_advertising_api_advertiser_id: str = None,
433
+ amazon_advertising_api_marketplace_id: str = None,
434
+ **kwargs) -> ApiResponse:
435
+ r"""
436
+ create_workflow_execution(instance_id: str, body: dict, version: str = "1",
437
+ amazon_advertising_api_advertiser_id: str = None,
438
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
439
+
440
+ Creates a new workflow execution (operationId: createWorkflowExecution)
441
+
442
+ Path Parameters
443
+ | **instanceId** (string) [required] The AMC instance ID
444
+
445
+ Request Body (application/vnd.amcworkflowexecutions.v{version}+json)
446
+ | **workflowId** (string) [required]
447
+ | **parameters** (object) [optional]
448
+
449
+ Headers
450
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
451
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
452
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
453
+
454
+ Returns
455
+ ApiResponse
456
+ | **workflowExecutionId** (string)
457
+ | **workflowId** (string)
458
+ | **status** (string)
459
+ | **startTime** (string)
460
+ | **endTime** (string)
461
+ | **createdAt** (string)
462
+ | **updatedAt** (string)
463
+
464
+ """
465
+ media_type = f'application/vnd.amcworkflowexecutions.v{version}+json'
466
+ headers = {"Accept": media_type, "Content-Type": media_type}
467
+ if amazon_advertising_api_advertiser_id:
468
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
469
+ if amazon_advertising_api_marketplace_id:
470
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
471
+ path = fill_query_params(kwargs.pop('path'), instance_id)
472
+ params = dict(kwargs)
473
+ return self._request(
474
+ path,
475
+ data=Utils.convert_body(body, False),
476
+ params=params,
477
+ headers=headers
478
+ )
479
+
480
+ @sp_endpoint('/amc/reporting/{}/workflowExecutions/{}', method='GET', headers=[])
481
+ def get_workflow_execution(self, instance_id: str, workflow_execution_id: str, version: str = "1",
482
+ amazon_advertising_api_advertiser_id: str = None,
483
+ amazon_advertising_api_marketplace_id: str = None,
484
+ **kwargs) -> ApiResponse:
485
+ r"""
486
+ get_workflow_execution(instance_id: str, workflow_execution_id: str, version: str = "1",
487
+ amazon_advertising_api_advertiser_id: str = None,
488
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
489
+
490
+ Gets status information about the requested workflow execution (operationId: getWorkflowExecution)
491
+
492
+ Path Parameters
493
+ | **instanceId** (string) [required] The AMC instance ID
494
+ | **workflowExecutionId** (string) [required] The workflow execution ID
495
+
496
+ Headers
497
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
498
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
499
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
500
+
501
+ Returns
502
+ ApiResponse
503
+ | **workflowExecutionId** (string)
504
+ | **workflowId** (string)
505
+ | **status** (string)
506
+ | **startTime** (string)
507
+ | **endTime** (string)
508
+ | **createdAt** (string)
509
+ | **updatedAt** (string)
510
+
511
+ """
512
+ media_type = f'application/vnd.amcworkflowexecutions.v{version}+json'
513
+ headers = {"Accept": media_type, "Content-Type": media_type}
514
+ if amazon_advertising_api_advertiser_id:
515
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
516
+ if amazon_advertising_api_marketplace_id:
517
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
518
+ path = fill_query_params(kwargs.pop('path'), instance_id, workflow_execution_id)
519
+ params = dict(kwargs)
520
+ return self._request(path, params=params, headers=headers)
521
+
522
+ @sp_endpoint('/amc/reporting/{}/workflowExecutions/{}', method='PUT', headers=[])
523
+ def update_workflow_execution(self, instance_id: str, workflow_execution_id: str, body: dict, version: str = "1",
524
+ amazon_advertising_api_advertiser_id: str = None,
525
+ amazon_advertising_api_marketplace_id: str = None,
526
+ **kwargs) -> ApiResponse:
527
+ r"""
528
+ update_workflow_execution(instance_id: str, workflow_execution_id: str, body: dict, version: str = "1",
529
+ amazon_advertising_api_advertiser_id: str = None,
530
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
531
+
532
+ Updates the requested workflow execution (operationId: UpdateWorkflowExecution)
533
+
534
+ Path Parameters
535
+ | **instanceId** (string) [required] The AMC instance ID
536
+ | **workflowExecutionId** (string) [required] The workflow execution ID
537
+
538
+ Request Body (application/vnd.amcworkflowexecutions.v{version}+json)
539
+ | **status** (string) [optional] e.g., CANCELLED
540
+
541
+ Headers
542
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
543
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
544
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
545
+
546
+ Returns
547
+ ApiResponse
548
+ | **workflowExecutionId** (string)
549
+ | **workflowId** (string)
550
+ | **status** (string)
551
+ | **startTime** (string)
552
+ | **endTime** (string)
553
+ | **createdAt** (string)
554
+ | **updatedAt** (string)
555
+
556
+ """
557
+ media_type = f'application/vnd.amcworkflowexecutions.v{version}+json'
558
+ headers = {"Accept": media_type, "Content-Type": media_type}
559
+ if amazon_advertising_api_advertiser_id:
560
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
561
+ if amazon_advertising_api_marketplace_id:
562
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
563
+ path = fill_query_params(kwargs.pop('path'), instance_id, workflow_execution_id)
564
+ params = dict(kwargs)
565
+ return self._request(
566
+ path,
567
+ data=Utils.convert_body(body, False),
568
+ params=params,
569
+ headers=headers
570
+ )
571
+
572
+ @sp_endpoint('/amc/reporting/{}/workflowExecutions/{}/downloadUrls', method='GET', headers=[])
573
+ def get_workflow_execution_download_urls(self, instance_id: str, workflow_execution_id: str, version: str = "1",
574
+ amazon_advertising_api_advertiser_id: str = None,
575
+ amazon_advertising_api_marketplace_id: str = None,
576
+ **kwargs) -> ApiResponse:
577
+ r"""
578
+ get_workflow_execution_download_urls(instance_id: str, workflow_execution_id: str, version: str = "1",
579
+ amazon_advertising_api_advertiser_id: str = None,
580
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
581
+
582
+ Retrieves pre-signed URL for downloading workflow execution results (operationId: getWorkflowExecutionDownloadUrls)
583
+
584
+ Path Parameters
585
+ | **instanceId** (string) [required] The AMC instance ID
586
+ | **workflowExecutionId** (string) [required] The workflow execution ID
587
+
588
+ Headers
589
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
590
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
591
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
592
+
593
+ Returns
594
+ ApiResponse
595
+ | **downloadUrls** (array)
596
+ | **url** (string)
597
+ | **expiresAt** (string)
598
+
599
+ """
600
+ media_type = f'application/vnd.amcworkflowexecutions.v{version}+json'
601
+ headers = {"Accept": media_type, "Content-Type": media_type}
602
+ if amazon_advertising_api_advertiser_id:
603
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
604
+ if amazon_advertising_api_marketplace_id:
605
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
606
+ path = fill_query_params(kwargs.pop('path'), instance_id, workflow_execution_id)
607
+ params = dict(kwargs)
608
+ return self._request(path, params=params, headers=headers)
609
+
610
+ # Workflows
611
+
612
+ @sp_endpoint('/amc/reporting/{}/workflows', method='GET', headers=[])
613
+ def list_workflows(self, instance_id: str, version: str = "1", next_token: str = None,
614
+ amazon_advertising_api_advertiser_id: str = None,
615
+ amazon_advertising_api_marketplace_id: str = None,
616
+ **kwargs) -> ApiResponse:
617
+ r"""
618
+ list_workflows(instance_id: str, version: str = "1", next_token: str = None,
619
+ amazon_advertising_api_advertiser_id: str = None,
620
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
621
+
622
+ Returns a list of workflows (operationId: listWorkflows)
623
+
624
+ Path Parameters
625
+ | **instanceId** (string) [required] The AMC instance ID
626
+
627
+ Query Parameters
628
+ | **nextToken** (string) [optional] Token to retrieve subsequent page of results
629
+
630
+ Headers
631
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
632
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
633
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
634
+
635
+ Returns
636
+ ApiResponse
637
+ | **workflows** (array)
638
+ | **workflowId** (string)
639
+ | **name** (string)
640
+ | **description** (string)
641
+ | **query** (string)
642
+ | **createdAt** (string)
643
+ | **updatedAt** (string)
644
+ | **nextToken** (string)
645
+
646
+ """
647
+ media_type = f'application/vnd.amcworkflows.v{version}+json'
648
+ headers = {"Accept": media_type, "Content-Type": media_type}
649
+ if amazon_advertising_api_advertiser_id:
650
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
651
+ if amazon_advertising_api_marketplace_id:
652
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
653
+ path = fill_query_params(kwargs.pop('path'), instance_id)
654
+ params = dict(kwargs)
655
+ if next_token:
656
+ params['nextToken'] = next_token
657
+ return self._request(path, params=params, headers=headers)
658
+
659
+ @sp_endpoint('/amc/reporting/{}/workflows', method='POST', headers=[])
660
+ def create_workflow(self, instance_id: str, body: dict, version: str = "1",
661
+ amazon_advertising_api_advertiser_id: str = None,
662
+ amazon_advertising_api_marketplace_id: str = None,
663
+ **kwargs) -> ApiResponse:
664
+ r"""
665
+ create_workflow(instance_id: str, body: dict, version: str = "1",
666
+ amazon_advertising_api_advertiser_id: str = None,
667
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
668
+
669
+ Creates a new workflow (operationId: createWorkflow)
670
+
671
+ Path Parameters
672
+ | **instanceId** (string) [required] The AMC instance ID
673
+
674
+ Request Body (application/vnd.amcworkflows.v{version}+json)
675
+ | **name** (string) [required]
676
+ | **description** (string) [optional]
677
+ | **query** (string) [required]
678
+
679
+ Headers
680
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
681
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
682
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
683
+
684
+ Returns
685
+ ApiResponse
686
+ | **workflowId** (string)
687
+ | **name** (string)
688
+ | **description** (string)
689
+ | **query** (string)
690
+ | **createdAt** (string)
691
+ | **updatedAt** (string)
692
+
693
+ """
694
+ media_type = f'application/vnd.amcworkflows.v{version}+json'
695
+ headers = {"Accept": media_type, "Content-Type": media_type}
696
+ if amazon_advertising_api_advertiser_id:
697
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
698
+ if amazon_advertising_api_marketplace_id:
699
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
700
+ path = fill_query_params(kwargs.pop('path'), instance_id)
701
+ params = dict(kwargs)
702
+ return self._request(
703
+ path,
704
+ data=Utils.convert_body(body, False),
705
+ params=params,
706
+ headers=headers
707
+ )
708
+
709
+ @sp_endpoint('/amc/reporting/{}/workflows/{}', method='DELETE', headers=[])
710
+ def delete_workflow(self, instance_id: str, workflow_id: str, version: str = "1",
711
+ amazon_advertising_api_advertiser_id: str = None,
712
+ amazon_advertising_api_marketplace_id: str = None,
713
+ **kwargs) -> ApiResponse:
714
+ r"""
715
+ delete_workflow(instance_id: str, workflow_id: str, version: str = "1",
716
+ amazon_advertising_api_advertiser_id: str = None,
717
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
718
+
719
+ Deletes the requested workflow (operationId: deleteWorkflow)
720
+
721
+ Path Parameters
722
+ | **instanceId** (string) [required] The AMC instance ID
723
+ | **workflowId** (string) [required] The workflow ID
724
+
725
+ Headers
726
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
727
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
728
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
729
+
730
+ Returns
731
+ ApiResponse (empty on success)
732
+
733
+ """
734
+ media_type = f'application/vnd.amcworkflows.v{version}+json'
735
+ headers = {"Accept": media_type, "Content-Type": media_type}
736
+ if amazon_advertising_api_advertiser_id:
737
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
738
+ if amazon_advertising_api_marketplace_id:
739
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
740
+ path = fill_query_params(kwargs.pop('path'), instance_id, workflow_id)
741
+ params = dict(kwargs)
742
+ return self._request(path, params=params, headers=headers)
743
+
744
+ @sp_endpoint('/amc/reporting/{}/workflows/{}', method='GET', headers=[])
745
+ def get_workflow(self, instance_id: str, workflow_id: str, version: str = "1",
746
+ amazon_advertising_api_advertiser_id: str = None,
747
+ amazon_advertising_api_marketplace_id: str = None,
748
+ **kwargs) -> ApiResponse:
749
+ r"""
750
+ get_workflow(instance_id: str, workflow_id: str, version: str = "1",
751
+ amazon_advertising_api_advertiser_id: str = None,
752
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
753
+
754
+ Gets the requested workflow (operationId: getWorkflow)
755
+
756
+ Path Parameters
757
+ | **instanceId** (string) [required] The AMC instance ID
758
+ | **workflowId** (string) [required] The workflow ID
759
+
760
+ Headers
761
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
762
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
763
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
764
+
765
+ Returns
766
+ ApiResponse
767
+ | **workflowId** (string)
768
+ | **name** (string)
769
+ | **description** (string)
770
+ | **query** (string)
771
+ | **createdAt** (string)
772
+ | **updatedAt** (string)
773
+
774
+ """
775
+ media_type = f'application/vnd.amcworkflows.v{version}+json'
776
+ headers = {"Accept": media_type, "Content-Type": media_type}
777
+ if amazon_advertising_api_advertiser_id:
778
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
779
+ if amazon_advertising_api_marketplace_id:
780
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
781
+ path = fill_query_params(kwargs.pop('path'), instance_id, workflow_id)
782
+ params = dict(kwargs)
783
+ return self._request(path, params=params, headers=headers)
784
+
785
+ @sp_endpoint('/amc/reporting/{}/workflows/{}', method='PUT', headers=[])
786
+ def update_workflow(self, instance_id: str, workflow_id: str, body: dict, version: str = "1",
787
+ amazon_advertising_api_advertiser_id: str = None,
788
+ amazon_advertising_api_marketplace_id: str = None,
789
+ **kwargs) -> ApiResponse:
790
+ r"""
791
+ update_workflow(instance_id: str, workflow_id: str, body: dict, version: str = "1",
792
+ amazon_advertising_api_advertiser_id: str = None,
793
+ amazon_advertising_api_marketplace_id: str = None) -> ApiResponse
794
+
795
+ Updates the requested workflow (operationId: updateWorkflow)
796
+
797
+ Path Parameters
798
+ | **instanceId** (string) [required] The AMC instance ID
799
+ | **workflowId** (string) [required] The workflow ID
800
+
801
+ Request Body (application/vnd.amcworkflows.v{version}+json)
802
+ | **name** (string) [optional]
803
+ | **description** (string) [optional]
804
+ | **query** (string) [optional]
805
+
806
+ Headers
807
+ | **Amazon-Advertising-API-ClientId** (string) [required] Sent from credentials
808
+ | **Amazon-Advertising-API-AdvertiserId** (string) [required] The AMC Account ID
809
+ | **Amazon-Advertising-API-MarketplaceId** (string) [required] The Marketplace ID
810
+
811
+ Returns
812
+ ApiResponse
813
+ | **workflowId** (string)
814
+ | **name** (string)
815
+ | **description** (string)
816
+ | **query** (string)
817
+ | **createdAt** (string)
818
+ | **updatedAt** (string)
819
+
820
+ """
821
+ media_type = f'application/vnd.amcworkflows.v{version}+json'
822
+ headers = {"Accept": media_type, "Content-Type": media_type}
823
+ if amazon_advertising_api_advertiser_id:
824
+ headers['Amazon-Advertising-API-AdvertiserId'] = amazon_advertising_api_advertiser_id
825
+ if amazon_advertising_api_marketplace_id:
826
+ headers['Amazon-Advertising-API-MarketplaceId'] = amazon_advertising_api_marketplace_id
827
+ path = fill_query_params(kwargs.pop('path'), instance_id, workflow_id)
828
+ params = dict(kwargs)
829
+ return self._request(
830
+ path,
831
+ data=Utils.convert_body(body, False),
832
+ params=params,
833
+ headers=headers
834
+ )
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.4.7"
1
+ __version__ = "2.4.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 2.4.7
3
+ Version: 2.4.8
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=6Ls7f3ZJxdJNWxciT1KkTqmIR_gddzXVDXxBtiav_WI,22
2
+ ad_api/version.py,sha256=glMuOQomGqPeJvn8UHzLa83MujqjNX2vpagybeMit4A,22
3
3
  ad_api/api/__init__.py,sha256=SWgn6NY3NK_Bbh5TPKpM8gXqoQFOL70siho4vJcIzko,3240
4
4
  ad_api/api/account.py,sha256=jNYwfjW8b0HhqP7PjlMev55aXJP3YIuqWhrxri0Pk4Y,4673
5
5
  ad_api/api/account_budgets.py,sha256=jFce5eLWAFK3ydjnYR7_Sv7B0-gHTG5bMTx_TcHyy1A,2319
@@ -45,9 +45,10 @@ ad_api/api/stores.py,sha256=BiwqOldK9zEsNjQzcII1DgBxQkDNsGP20aBx5i5Dmg8,2709
45
45
  ad_api/api/stream.py,sha256=Ga1VHOR_z2YAZY3kRhDvzwEDad3P260g1lWfc4OAjGk,9338
46
46
  ad_api/api/targetable_entities.py,sha256=bbdayyuYOnu1r4FutfmNcT23OtuAa0S_Rws59Z2uQVI,4075
47
47
  ad_api/api/validation_configurations.py,sha256=Qaxy_J67Fqw0ecS4f1sK9lGdiOLsq323RXeZO0_2KV0,4092
48
- ad_api/api/amc/__init__.py,sha256=tmb5-8jCGWegzDL3O9ceEggrTs2zG5d3DfFG4tZldfA,129
48
+ ad_api/api/amc/__init__.py,sha256=9z35-QFRcpHlktCV10xIGVEKpidEd1NJhZE2Bg9LPfU,188
49
49
  ad_api/api/amc/administration.py,sha256=xaD0kVaYKFHAWRc96VblZdbf4DzpIvKIeMmr8iW27yE,48757
50
50
  ad_api/api/amc/custom_models.py,sha256=WoLF3caj3em82DNazhsbuCgp0atymlssllmxKja08j4,43311
51
+ ad_api/api/amc/reporting.py,sha256=ZwF6LRsYf6zcOHAck5oWH_dSa7PYcyUsIkFTyVnhkHw,41084
51
52
  ad_api/api/dsp/__init__.py,sha256=h1EMo5LInemVA5rCujXZJkWc-CAJbsD86asEdfgQ8mI,3082
52
53
  ad_api/api/dsp/ad_creative_association.py,sha256=u0hvFlLCLYfmgEMCqhzxlqH9SJhH4ZC96KuRX7ZSJ0c,6481
53
54
  ad_api/api/dsp/ad_group_and_campaign.py,sha256=fbV2IhEQSGX30Srxd7lGa0eQBYUogzrv9iW7Q47UDFs,5452
@@ -199,8 +200,8 @@ ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4
199
200
  ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
200
201
  ad_api/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
201
202
  ad_api/shared/base_client.py,sha256=zOL_LTh-58URWf3ZDlrwmqXXbd6PX66QF5hrr2p83yY,356
202
- python_amazon_ad_api-2.4.7.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
203
- python_amazon_ad_api-2.4.7.dist-info/METADATA,sha256=RnL-cx-aFbf_bXGtEuUOfSndakgRSuL9J_sz68pKwfc,10678
204
- python_amazon_ad_api-2.4.7.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
205
- python_amazon_ad_api-2.4.7.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
206
- python_amazon_ad_api-2.4.7.dist-info/RECORD,,
203
+ python_amazon_ad_api-2.4.8.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
204
+ python_amazon_ad_api-2.4.8.dist-info/METADATA,sha256=til0ohJYsXyx-i_kfEZiE23kfKtMYhVDIFDE1fI6XRw,10678
205
+ python_amazon_ad_api-2.4.8.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
206
+ python_amazon_ad_api-2.4.8.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
207
+ python_amazon_ad_api-2.4.8.dist-info/RECORD,,