python-amazon-ad-api 1.2.1__tar.gz → 1.2.3__tar.gz

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 (123) hide show
  1. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/PKG-INFO +1 -5
  2. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/README.md +0 -4
  3. python_amazon_ad_api-1.2.3/ad_api/api/portfolios_v3.py +152 -0
  4. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/validation_configurations.py +15 -3
  5. python_amazon_ad_api-1.2.3/ad_api/version.py +1 -0
  6. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/PKG-INFO +1 -5
  7. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/setup.cfg +1 -1
  8. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/setup.py +1 -1
  9. python_amazon_ad_api-1.2.1/ad_api/api/portfolios_v3.py +0 -68
  10. python_amazon_ad_api-1.2.1/ad_api/version.py +0 -1
  11. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/LICENSE +0 -0
  12. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/__init__.py +0 -0
  13. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/__init__.py +0 -0
  14. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/account.py +0 -0
  15. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/advertising_test_account.py +0 -0
  16. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/attribution.py +0 -0
  17. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/audiences.py +0 -0
  18. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/billing.py +0 -0
  19. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/brand_metrics.py +0 -0
  20. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/creative_assets.py +0 -0
  21. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/eligibility.py +0 -0
  22. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/exports.py +0 -0
  23. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/history.py +0 -0
  24. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/insights.py +0 -0
  25. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/invoices.py +0 -0
  26. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/localization.py +0 -0
  27. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/manager_accounts.py +0 -0
  28. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/metadata.py +0 -0
  29. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/portfolios.py +0 -0
  30. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/profiles.py +0 -0
  31. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/recommendations.py +0 -0
  32. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/reports.py +0 -0
  33. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/__init__.py +0 -0
  34. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/ad_creatives_v4.py +0 -0
  35. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/ad_groups.py +0 -0
  36. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/ad_groups_v4.py +0 -0
  37. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/ads_v4.py +0 -0
  38. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/benchmarks.py +0 -0
  39. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/bid_recommendations.py +0 -0
  40. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/brands.py +0 -0
  41. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/budget_rules.py +0 -0
  42. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/campaigns.py +0 -0
  43. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/campaigns_v4.py +0 -0
  44. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/forecast.py +0 -0
  45. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/keywords.py +0 -0
  46. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/keywords_recommendations.py +0 -0
  47. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/landing_page_asins.py +0 -0
  48. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/media.py +0 -0
  49. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/migration.py +0 -0
  50. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/negative_keywords.py +0 -0
  51. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/negative_product_targeting.py +0 -0
  52. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/optimization_rules.py +0 -0
  53. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/product_targeting.py +0 -0
  54. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/recommendations.py +0 -0
  55. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/reports.py +0 -0
  56. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/stores.py +0 -0
  57. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/targeting_categories.py +0 -0
  58. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/targeting_recommendations.py +0 -0
  59. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/themes.py +0 -0
  60. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/__init__.py +0 -0
  61. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/ad_groups.py +0 -0
  62. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/bid_recommendations.py +0 -0
  63. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/brand_safety.py +0 -0
  64. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/budget_rules.py +0 -0
  65. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/campaigns.py +0 -0
  66. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/campaigns_budget_usage.py +0 -0
  67. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/creatives.py +0 -0
  68. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/forecast.py +0 -0
  69. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/negative_product_targeting.py +0 -0
  70. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/product_ads.py +0 -0
  71. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/product_targeting.py +0 -0
  72. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/recommendations.py +0 -0
  73. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/reports.py +0 -0
  74. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/snapshots.py +0 -0
  75. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/targeting_recommendations.py +0 -0
  76. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/__init__.py +0 -0
  77. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/ad_groups_v3.py +0 -0
  78. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/bid_recommendations_v3.py +0 -0
  79. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/budget_initial_recommendation.py +0 -0
  80. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/budget_recommendations.py +0 -0
  81. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/budget_rules.py +0 -0
  82. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/budget_rules_recommendations.py +0 -0
  83. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaign_consolidated_recommendations.py +0 -0
  84. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaign_negative_keywords_v3.py +0 -0
  85. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaign_negative_targets.py +0 -0
  86. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaigns_budget_usage.py +0 -0
  87. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaigns_v3.py +0 -0
  88. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaings_optimization.py +0 -0
  89. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/keywords_v3.py +0 -0
  90. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/negative_keywords_v3.py +0 -0
  91. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/negative_product_targeting_v3.py +0 -0
  92. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/product_ads_v3.py +0 -0
  93. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/product_recommendations.py +0 -0
  94. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/product_targeting_v3.py +0 -0
  95. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/ranked_keywords_recommendations.py +0 -0
  96. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/schedule_based_bid_optimization.py +0 -0
  97. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/stores.py +0 -0
  98. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/stream.py +0 -0
  99. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/v1/__init__.py +0 -0
  100. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/v1/ad_groups.py +0 -0
  101. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/v1/ads.py +0 -0
  102. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/v1/campaigns.py +0 -0
  103. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/api/v1/targets.py +0 -0
  104. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/auth/__init__.py +0 -0
  105. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/auth/access_token_client.py +0 -0
  106. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/auth/access_token_response.py +0 -0
  107. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/auth/credentials.py +0 -0
  108. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/auth/exceptions.py +0 -0
  109. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/base/__init__.py +0 -0
  110. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/base/api_response.py +0 -0
  111. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/base/base_client.py +0 -0
  112. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/base/client.py +0 -0
  113. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/base/config.py +0 -0
  114. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/base/credential_provider.py +0 -0
  115. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/base/exceptions.py +0 -0
  116. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/base/helpers.py +0 -0
  117. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/base/marketplaces.py +0 -0
  118. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/ad_api/base/utils.py +0 -0
  119. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/pyproject.toml +0 -0
  120. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/SOURCES.txt +0 -0
  121. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/dependency_links.txt +0 -0
  122. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/requires.txt +0 -0
  123. {python_amazon_ad_api-1.2.1 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 1.2.1
3
+ Version: 1.2.3
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
@@ -263,10 +263,6 @@ curl \
263
263
  * [Profiles](https://python-amazon-ad-api.readthedocs.io/en/latest/api/profiles.html)
264
264
  * [Manager Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/api/manager_accounts.html)
265
265
 
266
- Warning: [PLANNED DEPRECATION 1/3/2025]
267
- There is a new version 3 Portfolios API, please check the [migration guide](https://advertising.amazon.com/API/docs/en-us/reference/migration-guides/portfolios-v2-v3).
268
-
269
- * [Portfolios](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfolios.html)
270
266
  * [PortfoliosV3](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfoliosV3.html)
271
267
  * [Invoices](https://python-amazon-ad-api.readthedocs.io/en/latest/api/invoices.html)
272
268
  * [Billing](https://python-amazon-ad-api.readthedocs.io/en/latest/api/billing.html)
@@ -235,10 +235,6 @@ curl \
235
235
  * [Profiles](https://python-amazon-ad-api.readthedocs.io/en/latest/api/profiles.html)
236
236
  * [Manager Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/api/manager_accounts.html)
237
237
 
238
- Warning: [PLANNED DEPRECATION 1/3/2025]
239
- There is a new version 3 Portfolios API, please check the [migration guide](https://advertising.amazon.com/API/docs/en-us/reference/migration-guides/portfolios-v2-v3).
240
-
241
- * [Portfolios](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfolios.html)
242
238
  * [PortfoliosV3](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfoliosV3.html)
243
239
  * [Invoices](https://python-amazon-ad-api.readthedocs.io/en/latest/api/invoices.html)
244
240
  * [Billing](https://python-amazon-ad-api.readthedocs.io/en/latest/api/billing.html)
@@ -0,0 +1,152 @@
1
+ from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
+
3
+
4
+ class PortfoliosV3(Client):
5
+ """ """
6
+
7
+ @sp_endpoint('/portfolios/list', method='POST')
8
+ def list_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
9
+ r"""
10
+ Lists portfolios. Replaces the retired ``GET /v2/portfolios``.
11
+
12
+ Keyword Args
13
+
14
+ - ``prefer`` (bool): send ``Prefer: return=representation`` so the answer
15
+ carries the full portfolio objects rather than only the ids. [optional]
16
+
17
+ Request Body (optional)
18
+
19
+ - ``portfolioIdFilter`` (object): narrow to those ids. Carries
20
+ ``include``, a list of portfolio ids.
21
+ - ``nameFilter`` (object): narrow by name. Carries ``include``, a list of
22
+ names, and ``queryTermMatchType``, ``BROAD_MATCH`` or ``EXACT_MATCH``.
23
+ - ``stateFilter`` (object): narrow by state. Carries ``include``, a list
24
+ of states.
25
+ - ``includeExtendedDataFields`` (boolean): also return
26
+ ``creationDateTime``, ``lastUpdateDateTime``, ``servingStatus`` and
27
+ ``statusReasons``.
28
+ - ``nextToken`` (string): pagination token from a previous answer.
29
+
30
+ Returns
31
+ ApiResponse with ``portfolios``, ``totalResults`` and ``nextToken``.
32
+ Answers ``200``.
33
+
34
+ """
35
+
36
+ schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
37
+ headers = {"Accept": schema_version, "Content-Type": schema_version}
38
+ prefer_value = 'return=representation'
39
+ if prefer:
40
+ headers.update({"Prefer": prefer_value})
41
+
42
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
43
+
44
+
45
+
46
+ @sp_endpoint('/portfolios', method='POST')
47
+ def create_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
48
+ r"""
49
+ Creates portfolios.
50
+
51
+ Keyword Args
52
+
53
+ - ``prefer`` (bool): send ``Prefer: return=representation`` so the answer
54
+ carries the created portfolio objects rather than only the ids.
55
+ [optional]
56
+
57
+ Request Body (required)
58
+
59
+ - ``portfolios`` (array): the portfolios to create.
60
+
61
+ Each one carries:
62
+
63
+ - ``name`` (string): required. The portfolio name.
64
+ - ``state`` (string): required. The contract lists ``ENABLED`` as the
65
+ only value.
66
+ - ``budget.amount`` (number): the budget amount. Absent when the policy
67
+ is ``NO_CAP``.
68
+ - ``budget.currencyCode`` (string): one of ``AED``, ``AUD``, ``BRL``,
69
+ ``CAD``, ``CLP``, ``CNY``, ``COP``, ``EGP``, ``EUR``, ``GBP``,
70
+ ``INR``, ``JPY``, ``MXN``, ``NGN``, ``PLN``, ``SAR``, ``SEK``,
71
+ ``SGD``, ``TRY``, ``USD``, ``ZAR``.
72
+ - ``budget.policy`` (string): ``DATE_RANGE``, ``MONTHLY_RECURRING``,
73
+ ``NO_CAP`` or ``OTHER``.
74
+ - ``budget.startDate`` (string): ISO 8601. Required when the policy is
75
+ ``DATE_RANGE``.
76
+ - ``budget.endDate`` (string): ISO 8601. Optional under either policy.
77
+ - ``budgetControls.campaignUnspentBudgetSharing.featureState``
78
+ (string): ``ENABLED`` or ``DISABLED``.
79
+
80
+ Returns
81
+ ApiResponse with ``success`` and ``error`` lists, each item keyed by
82
+ the ``index`` it held in the body. Answers ``207``, a multi-status,
83
+ not ``200``.
84
+
85
+ """
86
+ schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
87
+ headers = {"Accept": schema_version, "Content-Type": schema_version}
88
+ prefer_value = 'return=representation'
89
+ if prefer:
90
+ headers.update({"Prefer": prefer_value})
91
+
92
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
93
+
94
+ @sp_endpoint('/portfolios', method='PUT')
95
+ def edit_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
96
+ r"""
97
+ Updates portfolios.
98
+
99
+ Keyword Args
100
+
101
+ - ``prefer`` (bool): send ``Prefer: return=representation`` so the answer
102
+ carries the updated portfolio objects rather than only the ids.
103
+ [optional]
104
+
105
+ Request Body (required)
106
+
107
+ - ``portfolios`` (array): the portfolios to update.
108
+
109
+ Each one carries ``portfolioId``, which is required, plus any of the
110
+ members ``create_portfolios`` accepts. Only what is sent is changed:
111
+
112
+ - ``portfolioId`` (string): required. The portfolio to update.
113
+ - ``name`` (string): the portfolio name.
114
+ - ``state`` (string): ``ENABLED``.
115
+ - ``budget.amount``, ``budget.currencyCode``, ``budget.policy``,
116
+ ``budget.startDate`` and ``budget.endDate`` as above.
117
+ - ``budgetControls.campaignUnspentBudgetSharing.featureState`` as above.
118
+
119
+ Returns
120
+ ApiResponse with ``success`` and ``error`` lists, each item keyed by
121
+ the ``index`` it held in the body. Answers ``207``, a multi-status,
122
+ not ``200``.
123
+
124
+ """
125
+ schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
126
+ headers = {"Accept": schema_version, "Content-Type": schema_version}
127
+ prefer_value = 'return=representation'
128
+ if prefer:
129
+ headers.update({"Prefer": prefer_value})
130
+
131
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
132
+
133
+
134
+ @sp_endpoint('/portfolios/budget/usage', method='POST')
135
+ def get_budget_usage_for_portfolios(self, version: int = 1, **kwargs) -> ApiResponse:
136
+ r"""
137
+ Reports how much of each portfolio budget has been spent.
138
+
139
+ Request Body (required)
140
+
141
+ - ``portfolioIds`` (array): the portfolios to measure.
142
+
143
+ Returns
144
+ ApiResponse split into ``success`` and ``error``. A successful entry
145
+ carries ``portfolioId``, ``index``, ``budget``,
146
+ ``budgetUsagePercent`` and ``usageUpdatedTimestamp``. Answers
147
+ ``207``, a multi-status, not ``200``.
148
+
149
+ """
150
+ schema_version = 'application/vnd.portfoliobudgetusage.v' + str(version) + '+json'
151
+ headers = {"Accept": schema_version, "Content-Type": schema_version}
152
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
@@ -47,9 +47,21 @@ class ValidationConfigurations(Client):
47
47
  Retrieves the configuration values used in targeting clause validation for the requested inputted marketplace, entityType, and programType context/contexts.
48
48
 
49
49
  Request body
50
- | **countryCodesList** (Array): [optional] The list of countryCode enums defining the marketplaces whose configuration values are requested. When null is selected and no value is attributed to this key, all countryCode options are selected. [ US, CA, MX, BR, UK, DE, FR, ES, IN, IT, NL, AE, SA, SE, TR, PL, EG, JP, AU, SG, CN ]
51
- | **entityTypesList** (Array): [optional] The list of entityType enums defining the marketplaces whose configuration values are requested. When null is selected and no value is attributed to this key, all countryCode options are selected. [ SELLER, VENDOR ]
52
- | **programTypesList** (Array): [optional] The list of programType enums defining the marketplaces whose configuration values are requested. When null is selected and no value is attributed to this key, all countryCode options are selected. [ SB, SP, SD ]
50
+
51
+ - ``countryCodesList`` (Array): [optional] The list of countryCode enums
52
+ defining the marketplaces whose configuration values are requested.
53
+ When null is selected and no value is attributed to this key, all
54
+ countryCode options are selected. [ US, CA, MX, BR, UK, DE, FR, ES, IN,
55
+ IT, NL, AE, SA, SE, TR, PL, EG, JP, AU, SG, CN ]
56
+ - ``entityTypesList`` (Array): [optional] The list of entityType enums
57
+ defining the marketplaces whose configuration values are requested.
58
+ When null is selected and no value is attributed to this key, all
59
+ countryCode options are selected. [ SELLER, VENDOR ]
60
+ - ``programTypesList`` (Array): [optional] The list of programType enums
61
+ defining the marketplaces whose configuration values are requested.
62
+ When null is selected and no value is attributed to this key, all
63
+ countryCode options are selected. [ SB, SP, SD ]
64
+
53
65
  Returns:
54
66
  ApiResponse
55
67
 
@@ -0,0 +1 @@
1
+ __version__ = "1.2.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 1.2.1
3
+ Version: 1.2.3
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
@@ -263,10 +263,6 @@ curl \
263
263
  * [Profiles](https://python-amazon-ad-api.readthedocs.io/en/latest/api/profiles.html)
264
264
  * [Manager Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/api/manager_accounts.html)
265
265
 
266
- Warning: [PLANNED DEPRECATION 1/3/2025]
267
- There is a new version 3 Portfolios API, please check the [migration guide](https://advertising.amazon.com/API/docs/en-us/reference/migration-guides/portfolios-v2-v3).
268
-
269
- * [Portfolios](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfolios.html)
270
266
  * [PortfoliosV3](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfoliosV3.html)
271
267
  * [Invoices](https://python-amazon-ad-api.readthedocs.io/en/latest/api/invoices.html)
272
268
  * [Billing](https://python-amazon-ad-api.readthedocs.io/en/latest/api/billing.html)
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = python-amazon-ad-api
3
- version = 1.2.1
3
+ version = 1.2.3
4
4
  author = Daniel Alvaro
5
5
  author_email = denisneuf@hotmail.com
6
6
  description = Python wrapper for the Amazon Advertising API
@@ -2,7 +2,7 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name='python-amazon-ad-api',
5
- version='1.2.1',
5
+ version='1.2.3',
6
6
  install_requires=[
7
7
  "requests>=2.27.1,<2.35.0",
8
8
  "six>=1.16,<1.18",
@@ -1,68 +0,0 @@
1
- from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
-
3
-
4
- class PortfoliosV3(Client):
5
- """ """
6
-
7
- @sp_endpoint('/portfolios/list', method='POST')
8
- def list_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
9
- r"""
10
-
11
- list_portfolios(body: (str, dict)) -> ApiResponse
12
-
13
- """
14
-
15
- schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
16
- headers = {"Accept": schema_version, "Content-Type": schema_version}
17
- prefer_value = 'return=representation'
18
- if prefer:
19
- headers.update({"Prefer": prefer_value})
20
-
21
- return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
22
-
23
-
24
-
25
- @sp_endpoint('/portfolios', method='POST')
26
- def create_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
27
- r"""
28
-
29
- create_portfolios(body: (str, dict)) -> ApiResponse
30
-
31
-
32
- """
33
- schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
34
- headers = {"Accept": schema_version, "Content-Type": schema_version}
35
- prefer_value = 'return=representation'
36
- if prefer:
37
- headers.update({"Prefer": prefer_value})
38
-
39
- return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
40
-
41
- @sp_endpoint('/portfolios', method='PUT')
42
- def edit_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
43
- r"""
44
-
45
- edit_portfolios(body: (str, dict)) -> ApiResponse
46
-
47
-
48
- """
49
- schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
50
- headers = {"Accept": schema_version, "Content-Type": schema_version}
51
- prefer_value = 'return=representation'
52
- if prefer:
53
- headers.update({"Prefer": prefer_value})
54
-
55
- return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
56
-
57
-
58
- @sp_endpoint('/portfolios/budget/usage', method='POST')
59
- def get_budget_usage_for_portfolios(self, version: int = 1, **kwargs) -> ApiResponse:
60
- r"""
61
-
62
- get_budget_usage_for_portfolios(body: (str, dict)) -> ApiResponse
63
-
64
-
65
- """
66
- schema_version = 'application/vnd.portfoliobudgetusage.v' + str(version) + '+json'
67
- headers = {"Accept": schema_version, "Content-Type": schema_version}
68
- return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
@@ -1 +0,0 @@
1
- __version__ = "1.2.1"