Permalink
Browse files

add more methods to work with sends

  • Loading branch information...
1 parent 0d9ac8d commit a3b9d327f7a7de8a36db60a706528088bd52f419 @vipod committed Jul 17, 2010
Showing with 26 additions and 2 deletions.
  1. +26 −2 icontact/client.py
View
28 icontact/client.py
@@ -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))
return result
- def send(self, messageId, includeListIds, account_id=None,
+ def create_send(self, messageId, includeListIds, account_id=None,
client_folder_id=None, **kwargs):
"""
- Sends a message.
+ Creates a send.
"""
account_id, client_folder_id = self._required_values(account_id, client_folder_id)
alert = dict(messageId=messageId, includeListIds=','.join(includeListIds))
@@ -438,6 +438,30 @@ def send(self, messageId, includeListIds, account_id=None,
method='post')
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):
"""
Fixed offset value that extends the `datetime.tzinfo` object to

0 comments on commit a3b9d32

Please sign in to comment.