Skip to content

Commit cf51959

Browse files
authored
Add video api (#288)
* move video module * add video errors * add video host and imports to client * fix tests * Update changelog and readme * Bump version: 3.11.1 → 3.12.0 * add coming soon notice
1 parent 13808e1 commit cf51959

27 files changed

+1306
-7
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.11.1
2+
current_version = 3.12.0
33
commit = True
44
tag = False
55

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 3.12.0
2+
- Add support for the [Vonage Video API](https://developer.vonage.com/en/video/overview)
3+
14
# 3.11.1
25
- Add checks for silent auth workflow optional parameters `redirect_url` and `sandbox`
36

OPENTOK_TO_VONAGE_MIGRATION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Coming soon!

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ need a Vonage account. Sign up [for free at vonage.com][signup].
1818
- [NCCO Builder](#ncco-builder)
1919
- [Verify V2 API](#verify-v2-api)
2020
- [Verify V1 API](#verify-v1-api)
21+
- [Video API](#video-api)
2122
- [Meetings API](#meetings-api)
2223
- [Number Insight API](#number-insight-api)
2324
- [Proactive Connect API](#proactive-connect-api)
@@ -595,6 +596,10 @@ else:
595596
print("Error: %s" % response["error_text"])
596597
```
597598

599+
## Video API
600+
601+
You can make calls to the Vonage Video API from this SDK. See the [Vonage Video API documentation](https://developer.vonage.com/en/video/overview) for detailed information and instructions on how to use the Vonage Python SDK with the Vonage Video API. Have a look at the SDK's [OpenTok to Vonage migration guide](OPENTOK_TO_VONAGE_MIGRATION.md) if you've previously used OpenTok.
602+
598603
## Meetings API
599604

600605
Full docs for the [Meetings API are available here](https://developer.vonage.com/en/meetings/overview).

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name="vonage",
12-
version="3.11.1",
12+
version="3.12.0",
1313
description="Vonage Server SDK for Python",
1414
long_description=long_description,
1515
long_description_content_type="text/markdown",

src/vonage/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .client import *
22
from .ncco_builder.ncco import *
33

4-
__version__ = "3.11.1"
4+
__version__ = "3.12.0"

src/vonage/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from .subaccounts import Subaccounts
1616
from .users import Users
1717
from .ussd import Ussd
18+
from .video import Video
1819
from .voice import Voice
1920
from .verify import Verify
2021
from .verify2 import Verify2
@@ -91,6 +92,8 @@ def __init__(
9192
self.api_key = key or os.environ.get("VONAGE_API_KEY", None)
9293
self.api_secret = secret or os.environ.get("VONAGE_API_SECRET", None)
9394

95+
self.application_id = application_id
96+
9497
self.signature_secret = signature_secret or os.environ.get("VONAGE_SIGNATURE_SECRET", None)
9598
self.signature_method = signature_method or os.environ.get("VONAGE_SIGNATURE_METHOD", None)
9699

@@ -108,6 +111,7 @@ def __init__(
108111
self._jwt_claims = {}
109112
self._host = "rest.nexmo.com"
110113
self._api_host = "api.nexmo.com"
114+
self._video_host = "video.api.vonage.com"
111115
self._meetings_api_host = "api-eu.vonage.com/v1/meetings"
112116
self._proactive_connect_host = "api-eu.vonage.com"
113117

@@ -135,6 +139,7 @@ def __init__(
135139
self.ussd = Ussd(self)
136140
self.verify = Verify(self)
137141
self.verify2 = Verify2(self)
142+
self.video = Video(self)
138143
self.voice = Voice(self)
139144

140145
self.timeout = timeout
@@ -160,6 +165,12 @@ def api_host(self, value=None):
160165
else:
161166
self._api_host = value
162167

168+
def video_host(self, value=None):
169+
if value is None:
170+
return self._video_host
171+
else:
172+
self._video_host = value
173+
163174
# Gets and sets _meetings_api_host attribute
164175
def meetings_api_host(self, value=None):
165176
if value is None:

src/vonage/errors.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,21 @@ class ProactiveConnectError(ClientError):
5252
"""An error relating to the Proactive Connect API."""
5353

5454

55+
class VideoError(ClientError):
56+
"""An error relating to the Video API."""
57+
58+
5559
class UsersError(ClientError):
5660
"""An error relating to the Users API."""
61+
62+
63+
class InvalidRoleError(ClientError):
64+
"""The specified role was invalid."""
65+
66+
67+
class TokenExpiryError(ClientError):
68+
"""The specified token expiry time was invalid."""
69+
70+
71+
class SipError(ClientError):
72+
"""Error related to usage of SIP calls."""

0 commit comments

Comments
 (0)