Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def conversation_create_webhook(self, webhook_create_request):
return ConversationWebhook().load(
self.request(CONVERSATION_WEB_HOOKS_PATH, 'POST', webhook_create_request, CONVERSATION_TYPE))
def conversation_read_webhook(self, id):
uri = CONVERSATION_WEB_HOOKS_PATH + '/' + str(id)
return ConversationWebhook().load(self.request(uri, 'GET', None, CONVERSATION_TYPE))
def conversation_update_webhook(self, id, update_request):
"""
Updates a webhook with the supplied parameters.
API Reference: https://developers.messagebird.com/api/conversations/#webhooks
"""
uri = CONVERSATION_WEB_HOOKS_PATH + '/' + str(id)
web_hook = self.request(uri, 'PATCH', update_request, CONVERSATION_TYPE)
return ConversationWebhook().load(web_hook)
def items(self, value):
items = []
if isinstance(value, list):
for item in value:
items.append(ConversationWebhook().load(item))
self._items = items