<s> try : <EOL> import json <EOL> except ImportError : <EOL> import simplejson as json <EOL> from createsend import CreateSendBase , BadRequest <EOL> from utils import json_to_py <EOL> class Administrator ( CreateSendBase ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , auth = None , email_address = None ) : <EOL> self . email_address = email_address <EOL> super ( Administrator , self ) . __init__ ( auth ) <EOL> def get ( self , email_address = None ) : <EOL> """<STR_LIT>""" <EOL> params = { "<STR_LIT:email>" : email_address or self . email_address } <EOL> response = self . _get ( "<STR_LIT>" , params = params ) <EOL> return json_to_py ( response ) <EOL> def add ( self , email_address , name ) : <EOL> """<STR_LIT>""" <EOL> body = { <EOL> "<STR_LIT>" : email_address , <EOL> "<STR_LIT:Name>" : name } <EOL> response = self . _post ( "<STR_LIT>" , json . dumps ( body ) ) <EOL> return json_to_py ( response ) <EOL> def update ( self , new_email_address , name ) : <EOL> """<STR_LIT>""" <EOL> params = { "<STR_LIT:email>" : self . email_address } <EOL> body = { <EOL> "<STR_LIT>" : new_email_address , <EOL> "<STR_LIT:Name>" : name } <EOL> response = self . _put ( "<STR_LIT>" , <EOL> body = json . dumps ( body ) , params = params ) <EOL> self . email_address = new_email_address <EOL> def delete ( self ) : <EOL> """<STR_LIT>""" <EOL> params = { "<STR_LIT:email>" : self . email_address } <EOL> response = self . _delete ( "<STR_LIT>" , params = params ) </s>
