diff --git a/fishjam/_openapi_client/models/room_config.py b/fishjam/_openapi_client/models/room_config.py index 0183ee0..8fc0c50 100644 --- a/fishjam/_openapi_client/models/room_config.py +++ b/fishjam/_openapi_client/models/room_config.py @@ -16,6 +16,8 @@ class RoomConfig: max_peers: Union[Unset, None, int] = UNSET """Maximum amount of peers allowed into the room""" + public: Union[Unset, bool] = False + """True if livestream viewers can omit specifying a token.""" room_type: Union[Unset, RoomConfigRoomType] = RoomConfigRoomType.CONFERENCE """The use-case of the room. If not provided, this defaults to conference.""" video_codec: Union[Unset, None, RoomConfigVideoCodec] = UNSET @@ -28,6 +30,7 @@ class RoomConfig: def to_dict(self) -> Dict[str, Any]: """@private""" max_peers = self.max_peers + public = self.public room_type: Union[Unset, str] = UNSET if not isinstance(self.room_type, Unset): room_type = self.room_type.value @@ -43,6 +46,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update({}) if max_peers is not UNSET: field_dict["maxPeers"] = max_peers + if public is not UNSET: + field_dict["public"] = public if room_type is not UNSET: field_dict["roomType"] = room_type if video_codec is not UNSET: @@ -58,6 +63,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() max_peers = d.pop("maxPeers", UNSET) + public = d.pop("public", UNSET) + _room_type = d.pop("roomType", UNSET) room_type: Union[Unset, RoomConfigRoomType] if isinstance(_room_type, Unset): @@ -78,6 +85,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: room_config = cls( max_peers=max_peers, + public=public, room_type=room_type, video_codec=video_codec, webhook_url=webhook_url, diff --git a/fishjam/api/_fishjam_client.py b/fishjam/api/_fishjam_client.py index aa077a1..e110220 100644 --- a/fishjam/api/_fishjam_client.py +++ b/fishjam/api/_fishjam_client.py @@ -59,6 +59,8 @@ class RoomOptions: "conference", "audio_only", "livestream", "full_feature", "broadcaster" ] = "conference" """The use-case of the room. If not provided, this defaults to conference.""" + public: bool = False + """True if livestream viewers can omit specifying a token.""" @dataclass @@ -123,6 +125,7 @@ def create_room(self, options: RoomOptions | None = None) -> Room: video_codec=codec, webhook_url=options.webhook_url, room_type=RoomConfigRoomType(options.room_type), + public=options.public, ) room = cast( diff --git a/tests/test_room_api.py b/tests/test_room_api.py index 8cad535..2ca6b29 100644 --- a/tests/test_room_api.py +++ b/tests/test_room_api.py @@ -256,9 +256,10 @@ def test_invalid(self, room_api: FishjamClient): class TestCreateLivestreamViewerToken: def test_valid(self, room_api: FishjamClient): - room = room_api.create_room(RoomOptions(room_type=LIVESTREAM)) + room = room_api.create_room(RoomOptions(room_type=LIVESTREAM, public=True)) viewer_token = room_api.create_livestream_viewer_token(room.id) + assert room.config.public assert isinstance(viewer_token, str) def test_invalid(self, room_api: FishjamClient):