Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self):
# We're expecting items of type Message
super(MessageList, self).__init__(Message)
def message_create(self, originator, recipients, body, params=None):
"""Create a new message."""
if params is None:
params = {}
if type(recipients) == list:
recipients = ','.join(recipients)
params.update({'originator': originator, 'body': body, 'recipients': recipients})
return Message().load(self.request('messages', 'POST', params))
def message(self, id):
"""Retrieve the information of a specific message."""
return Message().load(self.request('messages/' + str(id)))