Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def read_message(self, message_id):
uri = CONVERSATION_MESSAGES_PATH + '/' + str(message_id)
return ConversationMessage().load(self.client.request(uri))
def create_message(self, conversation_id, message_create_request):
uri = CONVERSATION_PATH + '/' + str(conversation_id) + '/' + CONVERSATION_MESSAGES_PATH
return ConversationMessage().load(self.client.request(uri, 'POST', message_create_request))
def conversation_read_message(self, message_id):
uri = CONVERSATION_MESSAGES_PATH + '/' + str(message_id)
return ConversationMessage().load(self.request(uri, 'GET', None, CONVERSATION_TYPE))
def conversation_create_message(self, conversation_id, message_create_request):
uri = CONVERSATION_PATH + '/' + str(conversation_id) + '/' + CONVERSATION_MESSAGES_PATH
return ConversationMessage().load(self.request(uri, 'POST', message_create_request, CONVERSATION_TYPE))
def items(self, value):
items = []
if isinstance(value, list):
for item in value:
items.append(ConversationMessage().load(item))
self._items = items