Skip to content

Commit 399688b

Browse files
author
marcel corso gonzalez
authored
Merge pull request #63 from rjelierse/master
Revert "Merge pull request #41 from mariuspot/master"
2 parents c5e6bf2 + 876841d commit 399688b

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@ To run examples with arguments, try:
7878
$ python ./examples/voice_create_webhook.py --accessKey accessKeyWhichNotExist --url https://example.com --title HELLO_WEBHOOK --token HELLO_TOKEN
7979
```
8080

81-
Conversations WhatsApp Sandbox
82-
-------------
83-
To use the whatsapp sandbox you need to add `messagebird.Feature.ENABLE_CONVERSATIONS_API_WHATSAPP_SANDBOX` to the list of features you want enabled. Don't forget to replace `YOUR_ACCESS_KEY` with your actual access key.
84-
85-
```python
86-
client = messagebird.Client('1ekjMs368KTRlP0z6zfG9P70z', features=[messagebird.Feature.ENABLE_CONVERSATIONS_API_WHATSAPP_SANDBOX])
87-
```
88-
8981
Documentation
9082
-------------
9183
Complete documentation, instructions, and examples are available at:

messagebird/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
from messagebird.client import Client, ErrorException, Feature
1+
from messagebird.client import Client, ErrorException
22
from messagebird.signed_request import SignedRequest

messagebird/client.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import sys
22
import json
33
import io
4-
import enum
54

65
from messagebird.balance import Balance
76
from messagebird.call import Call
@@ -32,8 +31,6 @@
3231
REST_TYPE = 'rest'
3332

3433
CONVERSATION_API_ROOT = 'https://conversations.messagebird.com/v1/'
35-
CONVERSATION_API_WHATSAPP_SANDBOX_ROOT = 'https://whatsapp-sandbox.messagebird.com/v1/'
36-
3734
CONVERSATION_PATH = 'conversations'
3835
CONVERSATION_MESSAGES_PATH = 'messages'
3936
CONVERSATION_WEB_HOOKS_PATH = 'webhooks'
@@ -65,24 +62,17 @@ def __init__(self, errorMessage):
6562
super(SignleErrorException, self).__init__(errorMessage)
6663

6764

68-
class Feature(enum.Enum):
69-
ENABLE_CONVERSATIONS_API_WHATSAPP_SANDBOX = 1
70-
71-
7265
class Client(object):
73-
74-
def __init__(self, access_key, http_client=None, features=[]):
66+
def __init__(self, access_key, http_client=None):
7567
self.access_key = access_key
7668
self.http_client = http_client
7769

78-
self.conversation_api_root = CONVERSATION_API_WHATSAPP_SANDBOX_ROOT if Feature.ENABLE_CONVERSATIONS_API_WHATSAPP_SANDBOX in features else CONVERSATION_API_ROOT
79-
8070
def _get_http_client(self, type=REST_TYPE):
8171
if self.http_client:
8272
return self.http_client
8373

8474
if type == CONVERSATION_TYPE:
85-
return HttpClient(self.conversation_api_root, self.access_key, USER_AGENT)
75+
return HttpClient(CONVERSATION_API_ROOT, self.access_key, USER_AGENT)
8676

8777
if type == VOICE_TYPE:
8878
return HttpClient(VOICE_API_ROOT, self.access_key, USER_AGENT)

0 commit comments

Comments
 (0)