python-amazon-ad-api 1.2.2__py3-none-any.whl → 1.2.4__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.
@@ -7,8 +7,29 @@ class PortfoliosV3(Client):
7
7
  @sp_endpoint('/portfolios/list', method='POST')
8
8
  def list_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
9
9
  r"""
10
+ Lists portfolios. Replaces the retired ``GET /v2/portfolios``.
10
11
 
11
- list_portfolios(body: (str, dict)) -> ApiResponse
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``.
12
33
 
13
34
  """
14
35
 
@@ -25,9 +46,41 @@ class PortfoliosV3(Client):
25
46
  @sp_endpoint('/portfolios', method='POST')
26
47
  def create_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
27
48
  r"""
28
-
29
- create_portfolios(body: (str, dict)) -> ApiResponse
30
-
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. The contract answers ``207``, a
83
+ multi-status, not ``200``.
31
84
 
32
85
  """
33
86
  schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
@@ -41,9 +94,32 @@ class PortfoliosV3(Client):
41
94
  @sp_endpoint('/portfolios', method='PUT')
42
95
  def edit_portfolios(self, version: int = 3, prefer: bool = False, **kwargs) -> ApiResponse:
43
96
  r"""
97
+ Updates portfolios.
98
+
99
+ Keyword Args
44
100
 
45
- edit_portfolios(body: (str, dict)) -> ApiResponse
101
+ - ``prefer`` (bool): send ``Prefer: return=representation`` so the answer
102
+ carries the updated portfolio objects rather than only the ids.
103
+ [optional]
46
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. The contract answers ``207``, a
122
+ multi-status, not ``200``.
47
123
 
48
124
  """
49
125
  schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
@@ -58,9 +134,23 @@ class PortfoliosV3(Client):
58
134
  @sp_endpoint('/portfolios/budget/usage', method='POST')
59
135
  def get_budget_usage_for_portfolios(self, version: int = 1, **kwargs) -> ApiResponse:
60
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.
61
142
 
62
- get_budget_usage_for_portfolios(body: (str, dict)) -> ApiResponse
143
+ Returns
144
+ ApiResponse split into ``success`` and ``error``. A successful entry
145
+ carries ``portfolioId``, ``index``, ``budget``,
146
+ ``budgetUsagePercent`` and ``usageUpdatedTimestamp``. The contract
147
+ answers ``207``, a multi-status, not ``200``.
63
148
 
149
+ A portfolio set to ``NO_CAP`` answers ``9999999999.0`` here rather than
150
+ an absent figure, and ``budgetUsagePercent`` reads ``0.0`` against it.
151
+ The same portfolio carries no ``amount`` at all in ``list_portfolios``.
152
+ Treat that number as no ceiling, not as money, or a sum over the account
153
+ comes out in the billions.
64
154
 
65
155
  """
66
156
  schema_version = 'application/vnd.portfoliobudgetusage.v' + str(version) + '+json'
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.2.2"
1
+ __version__ = "1.2.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 1.2.2
3
+ Version: 1.2.4
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,5 +1,5 @@
1
1
  ad_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- ad_api/version.py,sha256=uuf4VNtTNA93fMhoAur9YafzaKJFnczY-H1SSCSuRVQ,22
2
+ ad_api/version.py,sha256=XBKH8E1LmDxv06U39yqMBbXZapOERFgICEDYZs_kRso,22
3
3
  ad_api/api/__init__.py,sha256=E9c0ZyK4vplMlKKEBF8CV5u7P4uSkTMSQsAuSQu5bfY,1514
4
4
  ad_api/api/account.py,sha256=CmOvCfHoPWaeTUJvtB0pNoNulZVSz4oMMCKIpVTpHos,2931
5
5
  ad_api/api/advertising_test_account.py,sha256=btOVbdk2tBDmyKSJaQbcIFyzNG8KFJVUmTe4p9xMhpU,1507
@@ -17,7 +17,7 @@ ad_api/api/localization.py,sha256=HdkChAawloJ8zj5rCye9NVf7kLnQ7vW6aKsBLZ2W-gI,17
17
17
  ad_api/api/manager_accounts.py,sha256=tnmJxOGIKTuJ3i8wciwfs931REW0aeNKQiqCpBrTZ2Y,5107
18
18
  ad_api/api/metadata.py,sha256=vWPbDGvEB72421fjSu4KrNkTdrIijHTPV8k36hceSbA,2406
19
19
  ad_api/api/portfolios.py,sha256=Oe3LS2HsjMJSq1Id8cwOWrH2AiPMcBb7oTkFHjudnTI,7103
20
- ad_api/api/portfolios_v3.py,sha256=3vOfyz0awonr2NJOCm5SjX_bOz9-4hyQbf67DIY9IQU,2596
20
+ ad_api/api/portfolios_v3.py,sha256=qqIzXmhnb3g2QmTENsgzOayhvOObgI-rD7PTfftgDQg,6842
21
21
  ad_api/api/profiles.py,sha256=mMSCUd5HdR_nFBDFngLY94tIfMCA4yGnjHz-PSMe0rE,7200
22
22
  ad_api/api/recommendations.py,sha256=aVDnnX8GEhdOVSKypIs8lyUJCiFxo9ujMYVXqzHTvBc,4633
23
23
  ad_api/api/reports.py,sha256=gNmDHLULD2uaJgsMpIbCX9kabwhMXRr9WfZBtHUdsOY,6043
@@ -108,8 +108,8 @@ ad_api/base/exceptions.py,sha256=9D3M40ZIlLS0fA-aQh1BTWPOW-Nvf0tRhbA85jFnDJ4,438
108
108
  ad_api/base/helpers.py,sha256=UK7Q13vZ0mNdF54xzfzoGDn2O_cd2yPrK2X4rOzC41c,2334
109
109
  ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4657
110
110
  ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
111
- python_amazon_ad_api-1.2.2.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
112
- python_amazon_ad_api-1.2.2.dist-info/METADATA,sha256=KPanEM-HPMFE2e2jnXwtaE6WqqtTX5u2qJsF3UFzw7M,21778
113
- python_amazon_ad_api-1.2.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
114
- python_amazon_ad_api-1.2.2.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
115
- python_amazon_ad_api-1.2.2.dist-info/RECORD,,
111
+ python_amazon_ad_api-1.2.4.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
112
+ python_amazon_ad_api-1.2.4.dist-info/METADATA,sha256=TYwJLNkevDvojJVYRbb8DDtVtTMUC7FjQZqFxXQ60R0,21479
113
+ python_amazon_ad_api-1.2.4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
114
+ python_amazon_ad_api-1.2.4.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
115
+ python_amazon_ad_api-1.2.4.dist-info/RECORD,,