Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions fishjam/_openapi_client/models/room_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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):
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions fishjam/api/_fishjam_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion tests/test_room_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down