Skip to content

Commit

Permalink
add more methods to work with sends
Browse files Browse the repository at this point in the history
  • Loading branch information
vipod committed Jul 17, 2010
1 parent 0d9ac8d commit a3b9d32
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions icontact/client.py
Expand Up @@ -423,10 +423,10 @@ def messages(self, account_id=None, client_folder_id=None):
result = self._do_request('a/%s/c/%s/messages/' % (account_id, client_folder_id)) result = self._do_request('a/%s/c/%s/messages/' % (account_id, client_folder_id))
return result return result


def send(self, messageId, includeListIds, account_id=None, def create_send(self, messageId, includeListIds, account_id=None,
client_folder_id=None, **kwargs): client_folder_id=None, **kwargs):
""" """
Sends a message. Creates a send.
""" """
account_id, client_folder_id = self._required_values(account_id, client_folder_id) account_id, client_folder_id = self._required_values(account_id, client_folder_id)
alert = dict(messageId=messageId, includeListIds=','.join(includeListIds)) alert = dict(messageId=messageId, includeListIds=','.join(includeListIds))
Expand All @@ -438,6 +438,30 @@ def send(self, messageId, includeListIds, account_id=None,
method='post') method='post')
return result return result


def delete_send(self, sendId, account_id=None, client_folder_id=None):
"""
Deletes send.
"""
account_id, client_folder_id = self._required_values(account_id,
client_folder_id)

result = self._do_request('a/%s/c/%s/sends/%s' %
(account_id, client_folder_id, sendId),
method='delete')
return result

def get_send(self, sendId, account_id=None, client_folder_id=None):
"""
Gets send.
"""
account_id, client_folder_id = self._required_values(account_id,
client_folder_id)

result = self._do_request('a/%s/c/%s/sends/%s' %
(account_id, client_folder_id, sendId),
method='get')
return result

class FixedOffset(tzinfo): class FixedOffset(tzinfo):
""" """
Fixed offset value that extends the `datetime.tzinfo` object to Fixed offset value that extends the `datetime.tzinfo` object to
Expand Down

0 comments on commit a3b9d32

Please sign in to comment.