# Path: messagebird/voice_webhook.py
# class VoiceUpdateWebhookRequest(Base):
# 
#     def __init__(self, title=None, token=None):
#         self.title = title
#         self.token = token
# 
#     def __dict__(self):
#         return {
#             'title': self.title,
#             'token': self.token
#         }
# 
#     def __str__(self):
#         return "\n".join([
#             'title  : %s' % self.title,
#             'token  : %s' % self.token,
#         ])


import argparse
import messagebird
from messagebird.voice_webhook import VoiceUpdateWebhookRequest
#!/usr/bin/env python

parser = argparse.ArgumentParser()
parser.add_argument('--accessKey', help='access key for MessageBird API', type=str, required=True)
parser.add_argument('--webhookId', help='webhook that you want to update', type=str, required=True)
parser.add_argument('--title', help='title for the webhook', type=str)
parser.add_argument('--token', help='token for the webhook', type=str)

args = vars(parser.parse_args())

try:
    client = messagebird.Client(args['accessKey'])

    update_webhook_request = VoiceUpdateWebhookRequest(title=args['title'], token=args['token'])

# Path: messagebird/voice_webhook.py
# class VoiceUpdateWebhookRequest(Base):
# 
#     def __init__(self, title=None, token=None):
#         self.title = title
#         self.token = token
# 
#     def __dict__(self):
#         return {
#             'title': self.title,
#             'token': self.token
#         }
# 
#     def __str__(self):
#         return "\n".join([
#             'title  : %s' % self.title,
#             'token  : %s' % self.token,
#         ])


# Path: examples/voice_update_webhook.py
import argparse
import messagebird
from messagebird.voice_webhook import VoiceUpdateWebhookRequest

#!/usr/bin/env python

parser = argparse.ArgumentParser()
parser.add_argument('--accessKey', help='access key for MessageBird API', type=str, required=True)
parser.add_argument('--webhookId', help='webhook that you want to update', type=str, required=True)
parser.add_argument('--title', help='title for the webhook', type=str)
parser.add_argument('--token', help='token for the webhook', type=str)

args = vars(parser.parse_args())

try:
    client = messagebird.Client(args['accessKey'])

    update_webhook_request = VoiceUpdateWebhookRequest(title=args['title'], token=args['token'])

    webhook = client.voice_update_webhook(args['webhookId'], update_webhook_request)