Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def voice_update_webhook(self, id, update_webhook_request):
""" Update a voice webhook. """
if update_webhook_request is None:
raise ValidationError('Update request is empty')
uri = VOICE_API_ROOT + '/' + VOICE_WEB_HOOKS_PATH + '/' + str(id)
return VoiceWebhook().load(self.request(uri, 'PUT', update_webhook_request.__dict__(), VOICE_TYPE))
def data(self, value):
if isinstance(value, list):
self._items = []
for item in value:
self._items.append(VoiceWebhook().load(item))
def voice_create_webhook(self, create_webhook_request):
""" Create a voice webhook. """
if create_webhook_request is None:
raise ValidationError('Create request is empty')
uri = VOICE_API_ROOT + '/' + VOICE_WEB_HOOKS_PATH
return VoiceWebhook().load(self.request(uri, 'POST', create_webhook_request.__dict__(), VOICE_TYPE))
def voice_read_webhook(self, id):
"""
Retrieve a voice webhook
API Reference: https://developers.messagebird.com/api/voice-calling/#webhooks
"""
uri = VOICE_API_ROOT + '/' + VOICE_WEB_HOOKS_PATH + '/' + str(id)
return VoiceWebhook().load(self.request(uri, 'GET', None, VOICE_TYPE))