python-amazon-ad-api 1.2.3__py3-none-any.whl → 1.2.5__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.
ad_api/api/history.py CHANGED
@@ -5,26 +5,49 @@ class History(Client):
5
5
  """ """
6
6
 
7
7
  @sp_endpoint('/history', method='POST')
8
- def get_history(self, **kwargs) -> ApiResponse:
8
+ def get_history(self, version: str = "1.0", **kwargs) -> ApiResponse:
9
9
  r"""
10
-
11
- get_history(body: (dict, str, file)) -> ApiResponse
12
-
13
- Returns history of changes for provided event sources that match the filters and time ranges specified. Only events that belong to the authenticated Advertiser can be queried. All times will be in UTC Epoch format. This API accepts identifiers in either the alphamumeric format (default), or the numeric format. If numeric IDs are supplied, then numeric IDs will be returned otherwise, alphanumeric IDs are returned.
14
-
15
- body: | REQUIRED {'description': 'A HistoryQuery}'
16
-
17
- | **from_date** | **int** | Max 90 days of history.
18
- | **to_date** | **int** |
19
- | **event_types**
20
- | HistoryEventType
21
- | **next_token** | **str** | token from previous response to get next set of data. | [optional]
22
- | **page_offset** | **int** | Mutually exclusive with 'nextToken'. Max results with pageOffset is 10000. Use nextToken instead for more results. | [optional]
23
- | **count** | **int** | Requested number of results. Default 100. Minimum 50. Maximum 200. | [optional]
24
- | **sort**
25
- | HistorySortParameter
26
- | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
10
+ Returns the changes made to campaigns, ad groups, ads and the rest of the
11
+ entity tree, within a time range. Only events belonging to the
12
+ authenticated advertiser come back.
13
+
14
+ Keyword Args
15
+
16
+ - ``version`` (string): the ``Accept`` version, ``"1.0"`` by default.
17
+ Pass ``"1.1"`` to query the ``THEME`` event type, which the service
18
+ refuses at 1.0. The other six types work at either. [optional]
19
+
20
+ Request Body (required)
21
+
22
+ - ``fromDate`` (integer): epoch in **milliseconds**, not seconds.
23
+ - ``toDate`` (integer): epoch in milliseconds.
24
+ - ``eventTypes`` (object): one or more of ``AD``, ``AD_GROUP``,
25
+ ``CAMPAIGN``, ``KEYWORD``, ``NEGATIVE_KEYWORD``, ``PRODUCT_TARGETING``
26
+ and ``THEME``. Each carries an object, usually ``{}`` or
27
+ ``{"filters": [...]}``.
28
+ - ``count`` (integer): page size. Default 100, minimum 50, maximum 200.
29
+ - ``nextToken`` (string): token from a previous answer. Mutually
30
+ exclusive with ``pageOffset``.
31
+ - ``pageOffset`` (integer): alternative to ``nextToken``, up to 10000.
32
+ - ``sort`` (object): ``{"direction": "ASC"|"DESC", "key": "DATE"}``.
33
+
34
+ The field names are camelCase and the service rejects anything else: a
35
+ body written with ``from_date`` answers ``400`` naming ``fromDate`` as a
36
+ required field. The dates are counted back from the moment of the
37
+ request, so a window computed once and reused drifts out of range: the
38
+ service measures 90 days from its own clock, and a few seconds of drift
39
+ past the edge answers ``400 fromDate is more than 90 days ago``.
40
+
41
+ This route throttles. Seven calls within twelve seconds answered ``429``.
42
+
43
+ Returns
44
+ ApiResponse with ``events``, ``pageSize``, ``pageOffset``,
45
+ ``maxPageNumber`` and ``totalRecords``. An empty ``events`` with
46
+ ``totalRecords`` at ``0`` means the account saw no change in the
47
+ window, not that the call failed.
27
48
 
28
49
  """
50
+ accept = 'application/vnd.historyresponse.v' + version + '+json'
51
+ headers = {'Accept': accept}
29
52
  body = Utils.convert_body(kwargs.pop('body'), wrap=False)
30
- return self._request(kwargs.pop('path'), data=body, params=kwargs)
53
+ return self._request(kwargs.pop('path'), data=body, params=kwargs, headers=headers)
@@ -79,8 +79,8 @@ class PortfoliosV3(Client):
79
79
 
80
80
  Returns
81
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``.
82
+ the ``index`` it held in the body. The contract answers ``207``, a
83
+ multi-status, not ``200``.
84
84
 
85
85
  """
86
86
  schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
@@ -118,8 +118,8 @@ class PortfoliosV3(Client):
118
118
 
119
119
  Returns
120
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``.
121
+ the ``index`` it held in the body. The contract answers ``207``, a
122
+ multi-status, not ``200``.
123
123
 
124
124
  """
125
125
  schema_version = 'application/vnd.spPortfolio.v' + str(version) + '+json'
@@ -143,8 +143,14 @@ class PortfoliosV3(Client):
143
143
  Returns
144
144
  ApiResponse split into ``success`` and ``error``. A successful entry
145
145
  carries ``portfolioId``, ``index``, ``budget``,
146
- ``budgetUsagePercent`` and ``usageUpdatedTimestamp``. Answers
147
- ``207``, a multi-status, not ``200``.
146
+ ``budgetUsagePercent`` and ``usageUpdatedTimestamp``. The contract
147
+ answers ``207``, a multi-status, not ``200``.
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.
148
154
 
149
155
  """
150
156
  schema_version = 'application/vnd.portfoliobudgetusage.v' + str(version) + '+json'
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.2.3"
1
+ __version__ = "1.2.5"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 1.2.3
3
+ Version: 1.2.5
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=C-D_WWrVkBDmQmApLcm0sWNh2CgIrwWfc8_sB5vvU-Q,22
2
+ ad_api/version.py,sha256=jBmZf3HLbiQlWiolOsAA6J5-BbxXD2bqFqEqDH3lfqo,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
@@ -10,14 +10,14 @@ ad_api/api/brand_metrics.py,sha256=IlOlVJ2t6cL5DA49RaM3M1AW_3KFEyal08e0ZcnLdVE,6
10
10
  ad_api/api/creative_assets.py,sha256=EzxrQbxMe5Y1b6qONJ3zi8cwoorCZAqSmHhiug6d87E,6671
11
11
  ad_api/api/eligibility.py,sha256=xbHMNxpRqToQDlG8y7nhhSr55ZZIJ_ZA304rmWa7Jx0,3680
12
12
  ad_api/api/exports.py,sha256=Y59C99axCAltMgu3gbfzdnoLKjNTsJ7s1z18yzcxzls,2788
13
- ad_api/api/history.py,sha256=KmpUodvxTQPSeJ1kyOSm_uHnfaR23Y6SUvB3gYn5uh4,1727
13
+ ad_api/api/history.py,sha256=tB4XawmQNxDMolaubDUjuIHtrYXRFuhOr4WCB8OJ1t8,2568
14
14
  ad_api/api/insights.py,sha256=Z4h00erksU58yjGm5qX_sHKDAv5UuJagqCA0d3rUlJU,2932
15
15
  ad_api/api/invoices.py,sha256=EwSUVPOTxu1zYPSh0Bg6sCQ22evnUrMJBgU8ZttWN4w,1579
16
16
  ad_api/api/localization.py,sha256=HdkChAawloJ8zj5rCye9NVf7kLnQ7vW6aKsBLZ2W-gI,17158
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=eoVCO0UzJZ9L2nGKkEh8nq-V8wANJsXb4bdM2asuk1A,6447
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.3.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
112
- python_amazon_ad_api-1.2.3.dist-info/METADATA,sha256=On7nRch4tuPN_bwIc7Zz4kSZR0lRbtX1mVJqqR181yU,21479
113
- python_amazon_ad_api-1.2.3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
114
- python_amazon_ad_api-1.2.3.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
115
- python_amazon_ad_api-1.2.3.dist-info/RECORD,,
111
+ python_amazon_ad_api-1.2.5.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
112
+ python_amazon_ad_api-1.2.5.dist-info/METADATA,sha256=d0ANyn2SfwsIwQhEhdzfFUXzkTonM4Y94nwyDhdyCAU,21479
113
+ python_amazon_ad_api-1.2.5.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
114
+ python_amazon_ad_api-1.2.5.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
115
+ python_amazon_ad_api-1.2.5.dist-info/RECORD,,