@@ -371,9 +371,9 @@ def create_session(
371
371
372
372
try :
373
373
response = requests .post (
374
- self .endpoints .session_url (),
374
+ self .endpoints .get_session_url (),
375
375
data = options ,
376
- headers = self .headers (),
376
+ headers = self .get_headers (),
377
377
proxies = self .proxies ,
378
378
timeout = self .timeout ,
379
379
)
@@ -412,7 +412,7 @@ def create_session(
412
412
except Exception as e :
413
413
raise OpenTokException ("Failed to generate session: %s" % str (e ))
414
414
415
- def headers (self ):
415
+ def get_headers (self ):
416
416
"""For internal use."""
417
417
return {
418
418
"User-Agent" : "OpenTok-Python-SDK/"
@@ -422,9 +422,9 @@ def headers(self):
422
422
"X-OPENTOK-AUTH" : self ._create_jwt_auth_header (),
423
423
}
424
424
425
- def json_headers (self ):
425
+ def get_json_headers (self ):
426
426
"""For internal use."""
427
- result = self .headers ()
427
+ result = self .get_headers ()
428
428
result ["Content-Type" ] = "application/json"
429
429
return result
430
430
@@ -495,9 +495,9 @@ def start_archive(
495
495
}
496
496
497
497
response = requests .post (
498
- self .endpoints .archive_url (),
498
+ self .endpoints .get_archive_url (),
499
499
data = json .dumps (payload ),
500
- headers = self .json_headers (),
500
+ headers = self .get_json_headers (),
501
501
proxies = self .proxies ,
502
502
timeout = self .timeout ,
503
503
)
@@ -534,8 +534,8 @@ def stop_archive(self, archive_id):
534
534
:rtype: The Archive object corresponding to the archive being stopped.
535
535
"""
536
536
response = requests .post (
537
- self .endpoints .archive_url (archive_id ) + "/stop" ,
538
- headers = self .json_headers (),
537
+ self .endpoints .get_archive_url (archive_id ) + "/stop" ,
538
+ headers = self .get_json_headers (),
539
539
proxies = self .proxies ,
540
540
timeout = self .timeout ,
541
541
)
@@ -562,8 +562,8 @@ def delete_archive(self, archive_id):
562
562
:param String archive_id: The archive ID of the archive to be deleted.
563
563
"""
564
564
response = requests .delete (
565
- self .endpoints .archive_url (archive_id ),
566
- headers = self .json_headers (),
565
+ self .endpoints .get_archive_url (archive_id ),
566
+ headers = self .get_json_headers (),
567
567
proxies = self .proxies ,
568
568
timeout = self .timeout ,
569
569
)
@@ -585,8 +585,8 @@ def get_archive(self, archive_id):
585
585
:rtype: The Archive object.
586
586
"""
587
587
response = requests .get (
588
- self .endpoints .archive_url (archive_id ),
589
- headers = self .json_headers (),
588
+ self .endpoints .get_archive_url (archive_id ),
589
+ headers = self .get_json_headers (),
590
590
proxies = self .proxies ,
591
591
timeout = self .timeout ,
592
592
)
@@ -621,11 +621,11 @@ def get_archives(self, offset=None, count=None, session_id=None):
621
621
if session_id is not None :
622
622
params ["sessionId" ] = session_id
623
623
624
- endpoint = self .endpoints .archive_url () + "?" + urlencode (params )
624
+ endpoint = self .endpoints .get_archive_url () + "?" + urlencode (params )
625
625
626
626
response = requests .get (
627
627
endpoint ,
628
- headers = self .json_headers (),
628
+ headers = self .get_json_headers (),
629
629
proxies = self .proxies ,
630
630
timeout = self .timeout ,
631
631
)
@@ -646,7 +646,7 @@ def list_archives(self, offset=None, count=None, session_id=None):
646
646
"""
647
647
return self .get_archives (offset , count , session_id )
648
648
649
- def signal (self , session_id , payload , connection_id = None ):
649
+ def send_signal (self , session_id , payload , connection_id = None ):
650
650
"""
651
651
Send signals to all participants in an active OpenTok session or to a specific client
652
652
connected to that session.
@@ -662,9 +662,9 @@ def signal(self, session_id, payload, connection_id=None):
662
662
connected to the session
663
663
"""
664
664
response = requests .post (
665
- self .endpoints .signaling_url (session_id , connection_id ),
665
+ self .endpoints .get_signaling_url (session_id , connection_id ),
666
666
data = json .dumps (payload ),
667
- headers = self .json_headers (),
667
+ headers = self .get_json_headers (),
668
668
proxies = self .proxies ,
669
669
timeout = self .timeout ,
670
670
)
@@ -702,7 +702,7 @@ def get_stream(self, session_id, stream_id):
702
702
endpoint = self .endpoints .get_stream_url (session_id , stream_id )
703
703
response = requests .get (
704
704
endpoint ,
705
- headers = self .json_headers (),
705
+ headers = self .get_json_headers (),
706
706
proxies = self .proxies ,
707
707
timeout = self .timeout ,
708
708
)
@@ -732,7 +732,7 @@ def list_streams(self, session_id):
732
732
733
733
response = requests .get (
734
734
endpoint ,
735
- headers = self .json_headers (),
735
+ headers = self .get_json_headers (),
736
736
proxies = self .proxies ,
737
737
timeout = self .timeout ,
738
738
)
@@ -760,7 +760,7 @@ def force_disconnect(self, session_id, connection_id):
760
760
endpoint = self .endpoints .force_disconnect_url (session_id , connection_id )
761
761
response = requests .delete (
762
762
endpoint ,
763
- headers = self .json_headers (),
763
+ headers = self .get_json_headers (),
764
764
proxies = self .proxies ,
765
765
timeout = self .timeout ,
766
766
)
@@ -806,7 +806,7 @@ def set_archive_layout(self, archive_id, layout_type, stylesheet=None):
806
806
response = requests .put (
807
807
endpoint ,
808
808
data = json .dumps (payload ),
809
- headers = self .json_headers (),
809
+ headers = self .get_json_headers (),
810
810
proxies = self .proxies ,
811
811
timeout = self .timeout ,
812
812
)
@@ -877,7 +877,7 @@ def dial(self, session_id, token, sip_uri, options=[]):
877
877
response = requests .post (
878
878
endpoint ,
879
879
data = json .dumps (payload ),
880
- headers = self .json_headers (),
880
+ headers = self .get_json_headers (),
881
881
proxies = self .proxies ,
882
882
timeout = self .timeout ,
883
883
)
@@ -922,7 +922,7 @@ class names (Strings) to apply to the stream. For example:
922
922
response = requests .put (
923
923
endpoint ,
924
924
data = json .dumps (items_payload ),
925
- headers = self .json_headers (),
925
+ headers = self .get_json_headers (),
926
926
proxies = self .proxies ,
927
927
timeout = self .timeout ,
928
928
)
@@ -981,11 +981,11 @@ def start_broadcast(self, session_id, options):
981
981
982
982
payload .update (options )
983
983
984
- endpoint = self .endpoints .broadcast_url ()
984
+ endpoint = self .endpoints .get_broadcast_url ()
985
985
response = requests .post (
986
986
endpoint ,
987
987
data = json .dumps (payload ),
988
- headers = self .json_headers (),
988
+ headers = self .get_json_headers (),
989
989
proxies = self .proxies ,
990
990
timeout = self .timeout ,
991
991
)
@@ -1015,10 +1015,10 @@ def stop_broadcast(self, broadcast_id):
1015
1015
:rtype A Broadcast object, which contains information of the broadcast: id, sessionId
1016
1016
projectId, createdAt, updatedAt and resolution
1017
1017
"""
1018
- endpoint = self .endpoints .broadcast_url (broadcast_id , stop = True )
1018
+ endpoint = self .endpoints .get_broadcast_url (broadcast_id , stop = True )
1019
1019
response = requests .post (
1020
1020
endpoint ,
1021
- headers = self .json_headers (),
1021
+ headers = self .get_json_headers (),
1022
1022
proxies = self .proxies ,
1023
1023
timeout = self .timeout ,
1024
1024
)
@@ -1049,10 +1049,10 @@ def get_broadcast(self, broadcast_id):
1049
1049
:rtype A Broadcast object, which contains information of the broadcast: id, sessionId
1050
1050
projectId, createdAt, updatedAt, resolution, broadcastUrls and status
1051
1051
"""
1052
- endpoint = self .endpoints .broadcast_url (broadcast_id )
1052
+ endpoint = self .endpoints .get_broadcast_url (broadcast_id )
1053
1053
response = requests .get (
1054
1054
endpoint ,
1055
- headers = self .json_headers (),
1055
+ headers = self .get_json_headers (),
1056
1056
proxies = self .proxies ,
1057
1057
timeout = self .timeout ,
1058
1058
)
@@ -1091,11 +1091,11 @@ def set_broadcast_layout(self, broadcast_id, layout_type, stylesheet=None):
1091
1091
if stylesheet is not None :
1092
1092
payload ["stylesheet" ] = stylesheet
1093
1093
1094
- endpoint = self .endpoints .broadcast_url (broadcast_id , layout = True )
1094
+ endpoint = self .endpoints .get_broadcast_url (broadcast_id , layout = True )
1095
1095
response = requests .put (
1096
1096
endpoint ,
1097
1097
data = json .dumps (payload ),
1098
- headers = self .json_headers (),
1098
+ headers = self .get_json_headers (),
1099
1099
proxies = self .proxies ,
1100
1100
timeout = self .timeout ,
1101
1101
)
0 commit comments