Skip to content

Commit 087d07d

Browse files
author
Mark Costello
committed
First commit of report structure
1 parent 52b4e64 commit 087d07d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

zencoder/core.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ def __init__(self, api_key=None, api_version=None, as_xml=False, timeout=None, t
202202
self.job = Job(*args, **kwargs)
203203
self.account = Account(*args, **kwargs)
204204
self.output = Output(*args, **kwargs)
205+
self.report = None
206+
if api_version == 'v2':
207+
self.report = Report(*args, **kwargs)
205208

206209
class Response(object):
207210
"""
@@ -366,3 +369,21 @@ def delete(self, job_id):
366369
"""
367370
return self.cancel(job_id)
368371

372+
class Report(HTTPBackend):
373+
def __init__(self, *args, **kwargs):
374+
"""
375+
Contains all API methods relating to Outputs.
376+
"""
377+
kwargs['resource_name'] = 'reports'
378+
super(Report, self).__init__(*args, **kwargs)
379+
380+
def details(self, start_date=None, end_date=None, grouping=None):
381+
data = {}
382+
if start_date:
383+
data['from'] = start_date
384+
if to:
385+
data['to'] = end_date
386+
if grouping:
387+
data['grouping'] = grouping
388+
url = self.base_url + '/reports/minutes'
389+
self.get(url, data)

0 commit comments

Comments
 (0)