python-amazon-ad-api 1.2.2__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.
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/PKG-INFO +1 -5
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/README.md +0 -4
- python_amazon_ad_api-1.2.3/ad_api/api/portfolios_v3.py +152 -0
- python_amazon_ad_api-1.2.3/ad_api/version.py +1 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/PKG-INFO +1 -5
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/setup.cfg +1 -1
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/setup.py +1 -1
- python_amazon_ad_api-1.2.2/ad_api/api/portfolios_v3.py +0 -68
- python_amazon_ad_api-1.2.2/ad_api/version.py +0 -1
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/LICENSE +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/__init__.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/__init__.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/account.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/advertising_test_account.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/attribution.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/audiences.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/billing.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/brand_metrics.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/creative_assets.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/eligibility.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/exports.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/history.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/insights.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/invoices.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/localization.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/manager_accounts.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/metadata.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/portfolios.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/profiles.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/reports.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/__init__.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/ad_creatives_v4.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/ad_groups.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/ad_groups_v4.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/ads_v4.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/benchmarks.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/bid_recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/brands.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/budget_rules.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/campaigns.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/campaigns_v4.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/forecast.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/keywords.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/keywords_recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/landing_page_asins.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/media.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/migration.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/negative_keywords.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/negative_product_targeting.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/optimization_rules.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/product_targeting.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/reports.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/stores.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/targeting_categories.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/targeting_recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/themes.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/__init__.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/ad_groups.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/bid_recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/brand_safety.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/budget_rules.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/campaigns.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/campaigns_budget_usage.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/creatives.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/forecast.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/negative_product_targeting.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/product_ads.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/product_targeting.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/reports.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/snapshots.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/targeting_recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/__init__.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/ad_groups_v3.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/bid_recommendations_v3.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/budget_initial_recommendation.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/budget_recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/budget_rules.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/budget_rules_recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaign_consolidated_recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaign_negative_keywords_v3.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaign_negative_targets.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaigns_budget_usage.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaigns_v3.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaings_optimization.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/keywords_v3.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/negative_keywords_v3.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/negative_product_targeting_v3.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/product_ads_v3.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/product_recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/product_targeting_v3.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/ranked_keywords_recommendations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/schedule_based_bid_optimization.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/stores.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/stream.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/v1/__init__.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/v1/ad_groups.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/v1/ads.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/v1/campaigns.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/v1/targets.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/validation_configurations.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/auth/__init__.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/auth/access_token_client.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/auth/access_token_response.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/auth/credentials.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/auth/exceptions.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/base/__init__.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/base/api_response.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/base/base_client.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/base/client.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/base/config.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/base/credential_provider.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/base/exceptions.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/base/helpers.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/base/marketplaces.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/base/utils.py +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/pyproject.toml +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/SOURCES.txt +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/dependency_links.txt +0 -0
- {python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/requires.txt +0 -0
- {python_amazon_ad_api-1.2.2 → 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.
|
|
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)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.3"
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-amazon-ad-api
|
|
3
|
-
Version: 1.2.
|
|
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,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.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/advertising_test_account.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/bid_recommendations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/keywords_recommendations.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/landing_page_asins.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/negative_keywords.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/optimization_rules.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/product_targeting.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/targeting_categories.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sb/targeting_recommendations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/bid_recommendations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/campaigns_budget_usage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/product_targeting.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sd/targeting_recommendations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/bid_recommendations_v3.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/budget_recommendations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaign_negative_targets.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaigns_budget_usage.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/campaings_optimization.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/negative_keywords_v3.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/product_recommendations.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/sp/product_targeting_v3.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/api/validation_configurations.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/auth/access_token_client.py
RENAMED
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/auth/access_token_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/ad_api/base/credential_provider.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{python_amazon_ad_api-1.2.2 → python_amazon_ad_api-1.2.3}/python_amazon_ad_api.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|