Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 4db5091

Browse files
committed
Add emails parameter to :meth:atomx.Atomx.report
1 parent 703746c commit 4db5091

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

CHANGES.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
1.3 (unreleased)
22
----------------
33

4-
- add :meth:`atomx.Atomx.delete` to send a ``HTTP DELETE`` request to the api
4+
- Add :meth:`atomx.Atomx.delete` to send a ``HTTP DELETE`` request to the api
55
- :meth:`atomx.Atomx.get` and :meth:`atomx.Atomx.delete` accept non-keyword arguments
6-
that are used to compute the final resource path.
6+
that are used to compute the final resource path
7+
- Add `emails` parameter to :meth:`atomx.Atomx.report`
8+
79

810
1.2
911
---
1012

11-
- you can now remove model attributes with `del`
12-
- add :meth:`atomx.models.Report.csv` property that returns the report content as a list
13-
- save logged in user as `user` property to :class:`atomx.Atomx`
14-
- add network reports
15-
- try to determine report scope from user access rights if no scope was specified
13+
- You can now remove model attributes with `del`
14+
- Add :meth:`atomx.models.Report.csv` property that returns the report content as a list
15+
- Save logged in user as `user` property to :class:`atomx.Atomx`
16+
- Add network reports
17+
- Try to determine report scope from user access rights if no scope was specified
1618

1719

1820
1.1
1921
---
2022

21-
- fix: setup.py not working under some environments (`open` used wrong codec)
22-
- add SellerProfile model
23-
- add `offset` parameter to report.get
23+
- Fix: setup.py not working under some environments (`open` used wrong codec)
24+
- Add SellerProfile model
25+
- Add `offset` parameter to :meth:`atomx.models.Report.get`
2426

2527

2628
1.0

atomx/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def search(self, query):
121121
return search_result
122122

123123
def report(self, scope=None, groups=None, metrics=None, where=None,
124-
from_=None, to=None, timezone='UTC', fast=True):
124+
from_=None, to=None, timezone='UTC', emails=None, fast=True):
125125
"""Create a report.
126126
127127
See the `reporting atomx wiki <http://wiki.atomx.com/doku.php?id=reporting>`_
@@ -147,6 +147,9 @@ def report(self, scope=None, groups=None, metrics=None, where=None,
147147
should end (exclusive). (defaults to `datetime.now()` if undefined)
148148
:param str timezone: Timezone used for all times. (defaults to `UTC`)
149149
For a supported list see http://wiki.atomx.com/doku.php?id=timezones
150+
:param emails: One or multiple email addresses that should get
151+
notified once the report is finished and ready to download.
152+
:type emails: str or list
150153
:param bool fast: if `False` the report will always be run against the low level data.
151154
This is useful for billing reports for example.
152155
The default is `True` which means it will always try to use aggregate data
@@ -198,6 +201,11 @@ def report(self, scope=None, groups=None, metrics=None, where=None,
198201
else:
199202
report_json['to'] = to
200203

204+
if emails:
205+
if not isinstance(emails, list):
206+
emails = [emails]
207+
report_json['emails'] = emails
208+
201209
r = self.session.post(self.api_endpoint + 'report', json=report_json)
202210
if not r.ok:
203211
raise APIError(r.json()['error'])

0 commit comments

Comments
 (0)