@@ -864,26 +864,27 @@ def add_archive_stream(
864
864
)
865
865
866
866
if response :
867
- return Archive (self , response .json ())
868
- elif response .status_code == 403 :
869
- raise AuthError ()
870
- elif response .status_code == 400 :
871
- """
872
- The HTTP response has a 400 status code in the following cases:
873
- You do not pass in a session ID or you pass in an invalid session ID.
874
- No clients are actively connected to the OpenTok session.
875
- You specify an invalid resolution value.
876
- The outputMode property is set to "individual" and you set the resolution property and (which is not supported in individual stream archives).
877
- """
878
- raise RequestError (response .json ().get ("message" ))
879
- elif response .status_code == 404 :
880
- raise NotFoundError ("Archive or Stream not found" )
881
- elif response .status_code == 405 :
882
- raise ArchiveStreamModeError (
883
- "Your archive is configured with a streamMode that does not support stream manipulation."
884
- )
885
- elif response .status_code == 409 :
886
- raise ArchiveError (response .json ().get ("message" ))
867
+ if response .status_code == 204 :
868
+ return None
869
+ elif response .status_code == 403 :
870
+ raise AuthError ()
871
+ elif response .status_code == 400 :
872
+ """
873
+ The HTTP response has a 400 status code in the following cases:
874
+ You do not pass in a session ID or you pass in an invalid session ID.
875
+ No clients are actively connected to the OpenTok session.
876
+ You specify an invalid resolution value.
877
+ The outputMode property is set to "individual" and you set the resolution property and (which is not supported in individual stream archives).
878
+ """
879
+ raise RequestError (response .json ().get ("message" ))
880
+ elif response .status_code == 404 :
881
+ raise NotFoundError ("Archive or Stream not found" )
882
+ elif response .status_code == 405 :
883
+ raise ArchiveStreamModeError (
884
+ "Your archive is configured with a streamMode that does not support stream manipulation."
885
+ )
886
+ elif response .status_code == 409 :
887
+ raise ArchiveError (response .json ().get ("message" ))
887
888
else :
888
889
raise RequestError ("An unexpected error occurred" , response .status_code )
889
890
@@ -910,26 +911,27 @@ def remove_archive_stream(
910
911
)
911
912
912
913
if response :
913
- return Archive (self , response .json ())
914
- elif response .status_code == 403 :
915
- raise AuthError ()
916
- elif response .status_code == 400 :
917
- """
918
- The HTTP response has a 400 status code in the following cases:
919
- You do not pass in a session ID or you pass in an invalid session ID.
920
- No clients are actively connected to the OpenTok session.
921
- You specify an invalid resolution value.
922
- The outputMode property is set to "individual" and you set the resolution property and (which is not supported in individual stream archives).
923
- """
924
- raise RequestError (response .json ().get ("message" ))
925
- elif response .status_code == 404 :
926
- raise NotFoundError ("Archive or Stream not found" )
927
- elif response .status_code == 405 :
928
- raise ArchiveStreamModeError (
929
- "Your archive is configured with a streamMode that does not support stream manipulation."
930
- )
931
- elif response .status_code == 409 :
932
- raise ArchiveError (response .json ().get ("message" ))
914
+ if response .status_code == 204 :
915
+ return None
916
+ elif response .status_code == 403 :
917
+ raise AuthError ()
918
+ elif response .status_code == 400 :
919
+ """
920
+ The HTTP response has a 400 status code in the following cases:
921
+ You do not pass in a session ID or you pass in an invalid session ID.
922
+ No clients are actively connected to the OpenTok session.
923
+ You specify an invalid resolution value.
924
+ The outputMode property is set to "individual" and you set the resolution property and (which is not supported in individual stream archives).
925
+ """
926
+ raise RequestError (response .json ().get ("message" ))
927
+ elif response .status_code == 404 :
928
+ raise NotFoundError ("Archive or Stream not found" )
929
+ elif response .status_code == 405 :
930
+ raise ArchiveStreamModeError (
931
+ "Your archive is configured with a streamMode that does not support stream manipulation."
932
+ )
933
+ elif response .status_code == 409 :
934
+ raise ArchiveError (response .json ().get ("message" ))
933
935
else :
934
936
raise RequestError ("An unexpected error occurred" , response .status_code )
935
937
0 commit comments