Skip to content

Commit 595c5d7

Browse files
committed
renaming webhook_audio_connection module -> websocket_audio_connection
1 parent bf7849e commit 595c5d7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

opentok/websocket_audio_connection.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import json
2+
from six import iteritems
3+
4+
class WebsocketAudioConnection:
5+
"""Represents information about the audio streaming of an OpenTok session to a websocket."""
6+
7+
def __init__(self, kwargs):
8+
self.id = kwargs.get("id")
9+
self.connectionId = kwargs.get("connectionId")
10+
11+
def json(self):
12+
"""Returns a JSON representation of the websocket audio connection information."""
13+
return json.dumps(self, default=lambda o: o.__dict__, sort_keys=True, indent=4)
14+
15+
def attrs(self):
16+
"""
17+
Returns a dictionary of the websocket audio connection's attributes.
18+
"""
19+
return dict((k, v) for k, v in iteritems(self.__dict__))
20+

0 commit comments

Comments
 (0)