@@ -189,9 +189,46 @@ class Notification(object):
189
189
190
190
class Account (HTTPBackend ):
191
191
""" Account object """
192
- def __init__ (self ,api_key ,as_xml = False ):
192
+ def __init__ (self ,api_key = None ,as_xml = False ):
193
193
"""
194
194
Initializes an Account object
195
195
"""
196
196
super (Account ,self ).__init__ (api_key ,as_xml ,'account' )
197
197
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
+