Skip to content

Commit 380069a

Browse files
committed
Add all conversation methods to Client and remove ConversationClient
1 parent 5ae0c1f commit 380069a

17 files changed

+128
-138
lines changed

examples/conversation_create_message.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
sys.exit(1)
3737

3838
try:
39-
client = messagebird.ConversationClient(ACCESS_KEY)
39+
client = messagebird.Client(ACCESS_KEY)
4040

41-
msg = client.create_message(CONVERSATION_ID, { 'channelId': CHANNEL_ID, 'type': MESSAGE_TYPE_TEXT, 'content': { 'text': TEXT_MESSAGE } })
41+
msg = client.conversation_create_message(CONVERSATION_ID, { 'channelId': CHANNEL_ID, 'type': MESSAGE_TYPE_TEXT, 'content': { 'text': TEXT_MESSAGE } })
4242

4343
# Print the object information.
4444
print('\nThe following information was returned as a Conversation List object:\n')

examples/conversation_create_webhook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
sys.exit(1)
2525

2626
try:
27-
client = messagebird.ConversationClient(ACCESS_KEY)
27+
client = messagebird.Client(ACCESS_KEY)
2828

29-
webhook = client.create_webhook({
29+
webhook = client.conversation_create_webhook({
3030
'channelId': CHANNEL_ID,
3131
'events': [CONVERSATION_WEBHOOK_EVENT_CONVERSATION_CREATED, CONVERSATION_WEBHOOK_EVENT_CONVERSATION_UPDATED],
3232
'url': 'https://example.com'

examples/conversation_delete_webhook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
sys.exit(1)
2222

2323
try:
24-
client = messagebird.ConversationClient(ACCESS_KEY)
24+
client = messagebird.Client(ACCESS_KEY)
2525

26-
client.delete_webhook(WEBHOOK_ID)
26+
client.conversation_delete_webhook(WEBHOOK_ID)
2727

2828
# Print the object information.
2929
print('\nWebhook has been deleted:\n')

examples/conversation_list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
sys.exit(1)
1515

1616
try:
17-
client = messagebird.ConversationClient(ACCESS_KEY)
17+
client = messagebird.Client(ACCESS_KEY)
1818

19-
conversationList = client.list()
19+
conversationList = client.conversation_list()
2020

2121
itemIds = []
2222
for msgItem in conversationList.items:

examples/conversation_list_messages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
sys.exit(1)
2222

2323
try:
24-
client = messagebird.ConversationClient(ACCESS_KEY)
24+
client = messagebird.Client(ACCESS_KEY)
2525

26-
msg = client.list_messages(CONVERSATION_ID)
26+
msg = client.conversation_list_messages(CONVERSATION_ID)
2727

2828
itemIds = []
2929
for msgItem in msg.items:

examples/conversation_list_webhook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
sys.exit(1)
1515

1616
try:
17-
client = messagebird.ConversationClient(ACCESS_KEY)
17+
client = messagebird.Client(ACCESS_KEY)
1818

19-
webhookList = client.list()
19+
webhookList = client.conversation_list_webhooks()
2020

2121
itemIds = []
2222
for msgItem in webhookList.items:

examples/conversation_read.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
sys.exit(1)
2222

2323
try:
24-
client = messagebird.ConversationClient(ACCESS_KEY)
24+
client = messagebird.Client(ACCESS_KEY)
2525

26-
conversation = client.read(CONVERSATION_ID)
26+
conversation = client.conversation_read(CONVERSATION_ID)
2727

2828
# Print the object information.
2929
print('\nThe following information was returned as a Conversation object:\n')

examples/conversation_read_message.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323

2424
try:
25-
client = messagebird.ConversationClient(ACCESS_KEY)
25+
client = messagebird.Client(ACCESS_KEY)
2626

27-
msg = client.read_message(MESSAGE_ID)
27+
msg = client.conversation_read_message(MESSAGE_ID)
2828

2929
# Print the object information.
3030
print('\nThe following information was returned as a Conversation List object:\n')

examples/conversation_read_webhook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
sys.exit(1)
2222

2323
try:
24-
client = messagebird.ConversationClient(ACCESS_KEY)
24+
client = messagebird.Client(ACCESS_KEY)
2525

26-
webhook = client.read_webhook(WEBHOOK_ID)
26+
webhook = client.conversation_read_webhook(WEBHOOK_ID)
2727

2828
# Print the object information.
2929
print('\nThe following information was returned as a Webhook object:\n')

examples/conversation_start.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
sys.exit(1)
3737

3838
try:
39-
client = messagebird.ConversationClient(ACCESS_KEY)
39+
client = messagebird.Client(ACCESS_KEY)
4040

41-
msg = client.start({ 'channelId': CHANNEL_ID, 'to': PHONE_NUMBER, 'type': MESSAGE_TYPE_TEXT, 'content': { 'text': TEXT_MESSAGE } })
41+
msg = client.conversation_start({ 'channelId': CHANNEL_ID, 'to': PHONE_NUMBER, 'type': MESSAGE_TYPE_TEXT, 'content': { 'text': TEXT_MESSAGE } })
4242

4343
# Print the object information.
4444
print('\nThe following information was returned as a Conversation object:\n')

0 commit comments

Comments
 (0)