Skip to content

Commit 83ffae3

Browse files
Add room_type to RoomOptions and add test
1 parent bbd2a7d commit 83ffae3

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

fishjam/_openapi_client/models/room_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class RoomConfig:
2121
peerless_purge_timeout: Union[Unset, None, int] = UNSET
2222
"""Duration (in seconds) after which the room will be removed if no peers are connected. If not provided, this feature is disabled."""
2323
room_type: Union[Unset, None, RoomConfigRoomType] = UNSET
24-
"""None"""
24+
"""The use-case of the room. If not provided, this defaults to full_feature."""
2525
video_codec: Union[Unset, None, RoomConfigVideoCodec] = UNSET
2626
"""Enforces video codec for each peer in the room"""
2727
webhook_url: Union[Unset, None, str] = UNSET

fishjam/_openapi_client/models/room_config_room_type.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33

44
class RoomConfigRoomType(str, Enum):
5-
"""None"""
5+
"""The use-case of the room. If not provided, this defaults to full_feature."""
66

77
AUDIO_ONLY = "audio_only"
8+
BROADCASTER = "broadcaster"
89
FULL_FEATURE = "full_feature"
910

1011
def __str__(self) -> str:

fishjam/api/_fishjam_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class RoomOptions:
6262
"""Enforces video codec for each peer in the room"""
6363
webhook_url: str | None = None
6464
"""URL where Fishjam notifications will be sent"""
65+
room_type: Literal["full_feature", "audio_only"] | None = None
66+
"""The use-case of the room. If not provided, this defaults to full_feature."""
6567

6668

6769
@dataclass
@@ -127,6 +129,7 @@ def create_room(self, options: RoomOptions | None = None) -> Room:
127129
peerless_purge_timeout=options.peerless_purge_timeout,
128130
video_codec=codec,
129131
webhook_url=options.webhook_url,
132+
room_type=options.room_type,
130133
)
131134

132135
room = cast(

tests/test_room_api.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from fishjam._openapi_client.models import (
1414
PeerStatus,
1515
RoomConfig,
16+
RoomConfigRoomType,
1617
RoomConfigVideoCodec,
1718
)
1819
from fishjam.api._fishjam_client import Peer, Room
@@ -29,6 +30,7 @@
2930

3031
MAX_PEERS = 10
3132
CODEC_H264 = "h264"
33+
AUDIO_ONLY = "audio_only"
3234

3335

3436
class TestAuthentication:
@@ -76,7 +78,11 @@ def test_no_params(self, room_api):
7678
assert room in room_api.get_all_rooms()
7779

7880
def test_valid_params(self, room_api):
79-
options = RoomOptions(max_peers=MAX_PEERS, video_codec=CODEC_H264)
81+
options = RoomOptions(
82+
max_peers=MAX_PEERS,
83+
video_codec=CODEC_H264,
84+
room_type=AUDIO_ONLY,
85+
)
8086
room = room_api.create_room(options)
8187

8288
config = RoomConfig(
@@ -85,6 +91,7 @@ def test_valid_params(self, room_api):
8591
webhook_url=None,
8692
peerless_purge_timeout=None,
8793
peer_disconnected_timeout=None,
94+
room_type=RoomConfigRoomType(AUDIO_ONLY),
8895
)
8996
config.__setitem__("roomId", room.config.__getitem__("roomId"))
9097

0 commit comments

Comments
 (0)