Skip to content

Commit 7961d38

Browse files
committed
Add switchSubAccountType (RELEASEMINOR)
1 parent 8203269 commit 7961d38

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

tests.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ def test_sub_accounts(self):
228228
self.assertEqual('SUCC', ret['responseCode'])
229229
unmanaged_sub_account = ret['apiKey']
230230

231+
ret = my_voiceit.switch_sub_account_type(ret['apiKey'])
232+
self.assertEqual(200, ret['status'])
233+
self.assertEqual('SUCC', ret['responseCode'])
234+
231235
print(' Testing Create Managed Sub Account')
232236
ret = my_voiceit.create_managed_sub_account("Test", "Python", "", "", "")
233237
self.assertEqual(201, ret['status'])

voiceit2/voiceit2.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class VoiceIt2:
66
base_URL = 'https://api.voiceit.io'
7-
version = '2.5.0'
7+
version = '2.6.0'
88
voiceit_basic_auth_credentials = ''
99
notification_url = ''
1010

@@ -65,6 +65,12 @@ def create_managed_sub_account(self, firstName, lastName, email, password, lang)
6565
except requests.exceptions.HTTPError as e:
6666
return e.read()
6767

68+
def switch_sub_account_type(self, subAccountAPIKey):
69+
try:
70+
response = requests.post(self.base_URL + '/subaccount/' + subAccountAPIKey + '/switchType' + self.notification_url, auth=self.voiceit_basic_auth_credentials, headers=self.headers)
71+
return response.json()
72+
except requests.exceptions.HTTPError as e:
73+
return e.read()
6874

6975
def regenerate_sub_account_api_token(self, sub_account_api_key):
7076
try:

0 commit comments

Comments
 (0)