Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b4f8a28

Browse filesBrowse files
committed
implement all Accounts related API commands
1 parent 09bfe4a commit b4f8a28
Copy full SHA for b4f8a28

File tree

Expand file treeCollapse file tree

1 file changed

+38
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+38
-1
lines changed

‎zencoder/zencoder.py

Copy file name to clipboardExpand all lines: zencoder/zencoder.py
+38-1Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,46 @@ class Notification(object):
189189

190190
class Account(HTTPBackend):
191191
""" Account object """
192-
def __init__(self, api_key, as_xml=False):
192+
def __init__(self, api_key=None, as_xml=False):
193193
"""
194194
Initializes an Account object
195195
"""
196196
super(Account, self).__init__(api_key, as_xml, 'account')
197197

198+
def create(self, email, tos=True, options=None):
199+
"""
200+
Creates an account with Zencoder, no API Key necessary.
201+
"""
202+
data = {'email': email,
203+
'terms_of_service': int(tos)}
204+
if options:
205+
data.update(options)
206+
207+
return self.post(self.base_url, body=self.encode(data))
208+
209+
def details(self):
210+
"""
211+
Gets your account details.
212+
"""
213+
data = {'api_key': self.api_key}
214+
215+
return self.get(self.base_url, params=urlencode(data))
216+
217+
def integration(self):
218+
"""
219+
Puts your account into integration mode.
220+
"""
221+
data = {'api_key': self.api_key}
222+
223+
return self.get(self.base_url + '/integration',
224+
params=urlencode(data))
225+
226+
def live(self):
227+
"""
228+
Puts your account into live mode."
229+
"""
230+
data = {'api_key': self.api_key}
231+
232+
return self.get(self.base_url + '/live',
233+
params=urlencode(data))
234+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.