python-amazon-ad-api 2.3.1__py3-none-any.whl → 2.4.0__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 (38) hide show
  1. ad_api/api/__init__.py +62 -0
  2. ad_api/api/dsp_ad_group_and_campaign.py +139 -0
  3. ad_api/api/dsp_audience_create.py +53 -0
  4. ad_api/api/dsp_bid_adjustments.py +193 -0
  5. ad_api/api/dsp_campaign_flights.py +119 -0
  6. ad_api/api/dsp_campaign_insights.py +59 -0
  7. ad_api/api/dsp_combined_audiences.py +83 -0
  8. ad_api/api/dsp_conversion_tracking_products.py +92 -0
  9. ad_api/api/dsp_conversions.py +442 -0
  10. ad_api/api/dsp_creatives.py +114 -0
  11. ad_api/api/dsp_deal_permissions.py +170 -0
  12. ad_api/api/dsp_deal_proposals.py +440 -0
  13. ad_api/api/dsp_deals.py +204 -0
  14. ad_api/api/dsp_deals_management.py +66 -0
  15. ad_api/api/dsp_discovery_advertised_product_categories.py +35 -0
  16. ad_api/api/dsp_discovery_apps.py +36 -0
  17. ad_api/api/dsp_discovery_domain_lists.py +36 -0
  18. ad_api/api/dsp_discovery_geo_locations.py +42 -0
  19. ad_api/api/dsp_discovery_iab_content.py +37 -0
  20. ad_api/api/dsp_discovery_inventory_source_exchanges.py +36 -0
  21. ad_api/api/dsp_discovery_products.py +102 -0
  22. ad_api/api/dsp_discovery_third_party_target_segments.py +36 -0
  23. ad_api/api/dsp_frequency_associations.py +138 -0
  24. ad_api/api/dsp_frequency_groups.py +112 -0
  25. ad_api/api/dsp_frequency_insights.py +85 -0
  26. ad_api/api/dsp_guidance.py +111 -0
  27. ad_api/api/dsp_inherited_settings.py +133 -0
  28. ad_api/api/dsp_inventory_groups.py +209 -0
  29. ad_api/api/dsp_measurement.py +693 -0
  30. ad_api/api/dsp_seats.py +43 -0
  31. ad_api/api/dsp_target_kpi_recommendations.py +44 -0
  32. ad_api/api/dsp_targeting.py +98 -0
  33. ad_api/version.py +1 -1
  34. {python_amazon_ad_api-2.3.1.dist-info → python_amazon_ad_api-2.4.0.dist-info}/METADATA +1 -1
  35. {python_amazon_ad_api-2.3.1.dist-info → python_amazon_ad_api-2.4.0.dist-info}/RECORD +38 -7
  36. {python_amazon_ad_api-2.3.1.dist-info → python_amazon_ad_api-2.4.0.dist-info}/WHEEL +0 -0
  37. {python_amazon_ad_api-2.3.1.dist-info → python_amazon_ad_api-2.4.0.dist-info}/licenses/LICENSE +0 -0
  38. {python_amazon_ad_api-2.3.1.dist-info → python_amazon_ad_api-2.4.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,43 @@
1
+ """Seats and Seat IDs /dsp/seats.
2
+
3
+ Contract: Seat IDs 3.0, the *Seat IDs* child of *Seats*. One read route,
4
+ ``vnd.dspseats``, and two versions: ``v1`` and ``v2``.
5
+
6
+ ``ClientId`` is required; ``Scope`` and **``Amazon-Ads-Manager-AccountId``**
7
+ are optional: this is one of the few routes that accepts the manager header,
8
+ and there is no ``Amazon-Ads-AccountId`` at all.
9
+ """
10
+
11
+ from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils
12
+
13
+
14
+ class DspSeats(Client):
15
+ r"""Seat IDs - /dsp/seats
16
+
17
+ Documentation: https://advertising.amazon.com/API/docs/en-us/seat-ids
18
+ """
19
+
20
+ @sp_endpoint('/dsp/seats/current/list', method='POST',
21
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Advertising-API-Manager-Account'])
22
+ def list_current_seats(self, version: str = "1", **kwargs) -> ApiResponse:
23
+ r"""
24
+ Lists the seats of the caller. Read only.
25
+
26
+ This is the only route so far that accepts ``Amazon-Ads-Manager-AccountId``
27
+ without an ``Amazon-Ads-AccountId``: the manager replaces the account.
28
+
29
+ Keyword Args
30
+
31
+ - ``version`` (str): the version in the media type, ``1``. [optional]
32
+
33
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
34
+
35
+ Returns
36
+ ApiResponse, ``200``, with the seats.
37
+ """
38
+ media_type = 'application/vnd.dspseats.v' + version + '+json'
39
+ headers = {'Accept': media_type}
40
+ headers['Content-Type'] = media_type
41
+ body = Utils.convert_body(kwargs.pop('body'), False)
42
+ return self._request(kwargs.pop('path'),
43
+ data=body, params=kwargs, headers=headers)
@@ -0,0 +1,44 @@
1
+ """Target KPI recommendations /dsp/campaigns/targetKpi/recommendations.
2
+
3
+ Contract: Goal Seeking Bidder Target KPI Recommendation 3.0. One route, read
4
+ only despite the POST.
5
+
6
+ The two media types do not share a name: the request is
7
+ ``vnd.gsbtargetkpirecommendation.v<n>`` and the answer is
8
+ ``vnd.spinitialbudgetrecommendation.v<n>``. The released version is 3.4, not 1,
9
+ so that is the default here.
10
+
11
+ Only ``ClientId`` and ``Scope`` are declared: no account id header at all.
12
+ """
13
+
14
+ from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils
15
+
16
+
17
+ class DspTargetKpiRecommendations(Client):
18
+ r"""Target KPI recommendations - /dsp/campaigns/targetKpi/recommendations
19
+
20
+ Documentation: https://advertising.amazon.com/API/docs/en-us/target-kpi-recommendations
21
+ """
22
+
23
+ @sp_endpoint('/dsp/campaigns/targetKpi/recommendations', method='POST',
24
+ headers=['Amazon-Advertising-API-Scope'])
25
+ def get_target_kpi_recommendations(self, version: str = "3.4", **kwargs) -> ApiResponse:
26
+ r"""
27
+ Reads the bid and budget Amazon recommends for a KPI target.
28
+
29
+ The answer arrives as ``vnd.spinitialbudgetrecommendation``, a different name
30
+ from the request. That one is the contract.
31
+
32
+ Keyword Args
33
+
34
+ - ``version`` (str): the version in the media type, ``3.4``. [optional]
35
+
36
+ Returns
37
+ ApiResponse, ``200``, with the recommendation.
38
+ """
39
+ media_type = 'application/vnd.gsbtargetkpirecommendation.v' + version + '+json'
40
+ headers = {'Accept': media_type}
41
+ headers['Content-Type'] = media_type
42
+ body = Utils.convert_body(kwargs.pop('body'), False)
43
+ return self._request(kwargs.pop('path'),
44
+ data=body, params=kwargs, headers=headers)
@@ -0,0 +1,98 @@
1
+ """Targeting /dsp/v1/targets.
2
+
3
+ Contract: Amazon Ads DSP API Targets - V1 3.0, *Targeting* under *Campaign
4
+ management*. Four operations, all POST, all ``application/json``: create, the
5
+ two deletes, and the read.
6
+
7
+ Here **all three headers are required**, including ``Scope``:
8
+ ``Amazon-Advertising-API-ClientId``, ``Amazon-Advertising-API-Scope`` and
9
+ ``Amazon-Ads-AccountId``.
10
+
11
+ The create and the two deletes answer 207. ``list`` answers 200.
12
+ """
13
+
14
+ from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils
15
+
16
+
17
+ class DspTargeting(Client):
18
+ r"""Targeting - /dsp/v1/targets
19
+
20
+ Documentation: https://advertising.amazon.com/API/docs/en-us/dsp-universal-targeting
21
+ """
22
+
23
+ @sp_endpoint('/dsp/v1/targets', method='POST',
24
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
25
+ def create_targets(self, **kwargs) -> ApiResponse:
26
+ r"""
27
+ Creates targets on an ad group.
28
+
29
+ Keyword Args
30
+
31
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
32
+
33
+ Returns
34
+ ApiResponse, **207** multi-status, one per target.
35
+ """
36
+ headers = {'Accept': 'application/json'}
37
+ headers['Content-Type'] = 'application/json'
38
+ body = Utils.convert_body(kwargs.pop('body'), False)
39
+ return self._request(kwargs.pop('path'),
40
+ data=body, params=kwargs, headers=headers)
41
+
42
+ @sp_endpoint('/dsp/v1/targets/delete', method='POST',
43
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
44
+ def delete_targets(self, **kwargs) -> ApiResponse:
45
+ r"""
46
+ Deletes targets by id. A POST with ``/delete``: the ids go in the body.
47
+
48
+ Keyword Args
49
+
50
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
51
+
52
+ Returns
53
+ ApiResponse, **207** multi-status.
54
+ """
55
+ headers = {'Accept': 'application/json'}
56
+ headers['Content-Type'] = 'application/json'
57
+ body = Utils.convert_body(kwargs.pop('body'), False)
58
+ return self._request(kwargs.pop('path'),
59
+ data=body, params=kwargs, headers=headers)
60
+
61
+ @sp_endpoint('/dsp/v1/targets/deleteByObject', method='POST',
62
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
63
+ def delete_targets_by_object(self, **kwargs) -> ApiResponse:
64
+ r"""
65
+ Deletes targets by the object they point at, not by id. Use this one when
66
+ what you have is the target expression and not its id.
67
+
68
+ Keyword Args
69
+
70
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
71
+
72
+ Returns
73
+ ApiResponse, **207** multi-status.
74
+ """
75
+ headers = {'Accept': 'application/json'}
76
+ headers['Content-Type'] = 'application/json'
77
+ body = Utils.convert_body(kwargs.pop('body'), False)
78
+ return self._request(kwargs.pop('path'),
79
+ data=body, params=kwargs, headers=headers)
80
+
81
+ @sp_endpoint('/dsp/v1/targets/list', method='POST',
82
+ headers=['Amazon-Advertising-API-Scope', 'Amazon-Ads-AccountId'])
83
+ def list_targets(self, **kwargs) -> ApiResponse:
84
+ r"""
85
+ Lists targets. Read only, POST because the filter goes in the body.
86
+
87
+ Keyword Args
88
+
89
+ - ``selector`` (str): ``profile_id`` or ``account_id``. [optional]
90
+
91
+ Returns
92
+ ApiResponse, ``200``, with the targets.
93
+ """
94
+ headers = {'Accept': 'application/json'}
95
+ headers['Content-Type'] = 'application/json'
96
+ body = Utils.convert_body(kwargs.pop('body'), False)
97
+ return self._request(kwargs.pop('path'),
98
+ data=body, params=kwargs, headers=headers)
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.3.1"
1
+ __version__ = "2.4.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 2.3.1
3
+ Version: 2.4.0
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,6 +1,6 @@
1
1
  ad_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- ad_api/version.py,sha256=neZxeMmEfjhVZM6xetRikrBdHWt5T5ehL72ZYdPtJ-E,22
3
- ad_api/api/__init__.py,sha256=j_tpYAc9Lf_YGZbe8gokZVdaBoqQVF0XL3r0Rb8g9-I,3143
2
+ ad_api/version.py,sha256=yLaFvd-K80rs_ClRVYULStijkok4RfYSaanIt_E-aKM,22
3
+ ad_api/api/__init__.py,sha256=PRRI_D7DmLlZMSBGiIHck4SQ1MyyoRjy2t_ypCbyj5I,5810
4
4
  ad_api/api/account.py,sha256=jNYwfjW8b0HhqP7PjlMev55aXJP3YIuqWhrxri0Pk4Y,4673
5
5
  ad_api/api/account_budgets.py,sha256=jFce5eLWAFK3ydjnYR7_Sv7B0-gHTG5bMTx_TcHyy1A,2319
6
6
  ad_api/api/ad_library.py,sha256=nlTMHhqinZF5QKWtXngmwA8reTnG5ChIwQVCs_URUIk,3270
@@ -16,7 +16,38 @@ ad_api/api/brand_home.py,sha256=IaKKsw2lo5vsmMHs1-tZviHx63t8_cfRFDyWstS-qME,5618
16
16
  ad_api/api/brand_metrics.py,sha256=zEOSPffq8j-2vAz_z77EcKU2sa9i1WzzBqswTmoL5yA,9321
17
17
  ad_api/api/campaign_diagnostics.py,sha256=3yoAhaHzYgoPqJ3aA88DVyI6-4VECUxy1KEkoMkqRhM,2508
18
18
  ad_api/api/creative_assets.py,sha256=u0bCnioUFpGOQO5Z_MO0ErSLcAgSZB5GWM5wm2oW6L0,9687
19
+ ad_api/api/dsp_ad_group_and_campaign.py,sha256=fbV2IhEQSGX30Srxd7lGa0eQBYUogzrv9iW7Q47UDFs,5452
19
20
  ad_api/api/dsp_advertiser.py,sha256=ztSr0s15Z9scQNKElWxRujexsENn84MT-ihNhijLi_M,1427
21
+ ad_api/api/dsp_audience_create.py,sha256=IB8iFeVDt7gjtJ5N2YumDgmArS-IZMFWXPLtR-nd5-Q,2026
22
+ ad_api/api/dsp_bid_adjustments.py,sha256=A3o_cXQ4YGyueVMNw6EP_CxICcLEnwb1L5wTtsVTpvk,7526
23
+ ad_api/api/dsp_campaign_flights.py,sha256=pHSASscr3VcFX0iWCUIqv1g1sSAmf2ixfYSknJF7g-g,4408
24
+ ad_api/api/dsp_campaign_insights.py,sha256=ZeHy6vhhJTd9EeKshnGobM6W2tk2xTDY24LotyKWTTE,2675
25
+ ad_api/api/dsp_combined_audiences.py,sha256=yjvEXI8u3rCH1kaZQfeZS2FYU8iqlo7tIuGT3IL7Gpo,3279
26
+ ad_api/api/dsp_conversion_tracking_products.py,sha256=cZOv8ol5nd58PZnVLHG1srpOgFCBFSLr9M277S4XNek,3584
27
+ ad_api/api/dsp_conversions.py,sha256=eKwqnkZJcCQPsEckzsBSgUIx1rLZHYyWLpu7B_S6EX0,19745
28
+ ad_api/api/dsp_creatives.py,sha256=QFLtTGaFNKWWn7--rJnn35QOdrOMxY0zuLBsJFux9Qc,3979
29
+ ad_api/api/dsp_deal_permissions.py,sha256=LI3NZhZO9_3KUGkkziBGCJJf63FbztmAomaOqfHbXRs,7176
30
+ ad_api/api/dsp_deal_proposals.py,sha256=_4FVHISvENFMMaVQl0HjtK9hm9Ypd30Ph9gvd6Rgsz0,18466
31
+ ad_api/api/dsp_deals.py,sha256=R6iJm-UKKjpVW4DOADLdf0y-CIkufEW941-2z_ksFGw,8183
32
+ ad_api/api/dsp_deals_management.py,sha256=6CSCfQdxIjx-IZM9qaG_scaElMVVyFnXqwGv_SnqnO4,2520
33
+ ad_api/api/dsp_discovery_advertised_product_categories.py,sha256=o3QY7be1OJD4_XV2qV1fLMWKajf_X_bDkVBzVMe0AOM,1353
34
+ ad_api/api/dsp_discovery_apps.py,sha256=fDCaKpTRBA0KUw8SLfme4McGS42OZ3oxfIznDvrJtXU,1216
35
+ ad_api/api/dsp_discovery_domain_lists.py,sha256=631ROR-ADIfflVtqJawdGNcA464_xflJaN87ljHBt7Y,1251
36
+ ad_api/api/dsp_discovery_geo_locations.py,sha256=XTNksxhEQ9WzNtqgta68NxpirM9D0-6lsojKXBXnnHU,1411
37
+ ad_api/api/dsp_discovery_iab_content.py,sha256=9eIZzcIiHB_sR2pJBYBTTKAVMqtYZOH3Wnb1s3Rtrtg,1474
38
+ ad_api/api/dsp_discovery_inventory_source_exchanges.py,sha256=w6G32Z8PYMoFPNTJrKEVMjKKvGE0a2ClpRi_g2eH7to,1369
39
+ ad_api/api/dsp_discovery_products.py,sha256=Cn0FdDwjmYuvbyU4BpRx8s9I7zQQZzuCCtihRw-1rbE,4180
40
+ ad_api/api/dsp_discovery_third_party_target_segments.py,sha256=zleUbD2pGH8ASlL4xrd6iUMviECejQzCp1JSLIyWOCw,1363
41
+ ad_api/api/dsp_frequency_associations.py,sha256=v7WzFgRT_RG-u8tV6eKhYqn7ONkZkL6gRSQnic8_J8k,5641
42
+ ad_api/api/dsp_frequency_groups.py,sha256=oTIotgyeTkq0JxFpZBP_PnneQs4taxutwpwC1xRjP2U,4460
43
+ ad_api/api/dsp_frequency_insights.py,sha256=_K0fwhNUu6xq1N3euQcPXrcB5J6Gy2FQaCFsFxDKHW4,3617
44
+ ad_api/api/dsp_guidance.py,sha256=k2zi1oBENL-B1fNpNVRXfqcL1nzsHpELzgD_96L9vt4,5096
45
+ ad_api/api/dsp_inherited_settings.py,sha256=iOioqjWs_KrbelZoOFL_b4oQugCTB-5xN3l5UmtD4SQ,5046
46
+ ad_api/api/dsp_inventory_groups.py,sha256=0Hapif-8X8bWrOlgcGpYIG9vZjEzy62TOWbSlPfubQo,8288
47
+ ad_api/api/dsp_measurement.py,sha256=nIoJVggWBx1jiQR6U7v6V5dDOqBKIsbma9NRULszQUc,29862
48
+ ad_api/api/dsp_seats.py,sha256=eCOn-KmLHbuRs2jqgCJKu7bsXtVX38-rEkSyUZE5iDk,1655
49
+ ad_api/api/dsp_target_kpi_recommendations.py,sha256=PLjrmxxSs5wJ9yWs_Q0Pqu1ZBiam1wtAPlhSkY3pCyE,1782
50
+ ad_api/api/dsp_targeting.py,sha256=CTR8cns9f3u8sa9r-N4ObR5Yl7duhqQMd6XbGfbx7pM,3733
20
51
  ad_api/api/eligibility.py,sha256=3hKloUciUZ4CplJkaHvrteUEuhv37-sVrQUYnfIMuZU,3824
21
52
  ad_api/api/exports.py,sha256=nHUIn-iQKAL5XS2IW5xwYs8ZbHmk1rutpmfPz7O2UvY,7968
22
53
  ad_api/api/forecast.py,sha256=EwEb71lK7xPEmxzvw-_-VqRx6ZQ73vwX8xYjL6IP5Oc,5582
@@ -161,8 +192,8 @@ ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4
161
192
  ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
162
193
  ad_api/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
163
194
  ad_api/shared/base_client.py,sha256=zOL_LTh-58URWf3ZDlrwmqXXbd6PX66QF5hrr2p83yY,356
164
- python_amazon_ad_api-2.3.1.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
165
- python_amazon_ad_api-2.3.1.dist-info/METADATA,sha256=h-lylLM4G66Zo1gi-TIwRtiJox4lNicvbMWNAKkaLGQ,10678
166
- python_amazon_ad_api-2.3.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
167
- python_amazon_ad_api-2.3.1.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
168
- python_amazon_ad_api-2.3.1.dist-info/RECORD,,
195
+ python_amazon_ad_api-2.4.0.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
196
+ python_amazon_ad_api-2.4.0.dist-info/METADATA,sha256=_are-hboyyU0ef1w8Qkm57NQM50t3PXmr94CwAXNDXM,10678
197
+ python_amazon_ad_api-2.4.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
198
+ python_amazon_ad_api-2.4.0.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
199
+ python_amazon_ad_api-2.4.0.dist-info/RECORD,,