Skip to content

Commit 36fd888

Browse files
Update openapi (#30)
* Update openapi * Update test * Update openapi * Update RoomOptions * Forward argument
1 parent d11c0d9 commit 36fd888

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

fishjam/_openapi_client/models/room_config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class RoomConfig:
1616

1717
max_peers: Union[Unset, None, int] = UNSET
1818
"""Maximum amount of peers allowed into the room"""
19+
public: Union[Unset, bool] = False
20+
"""True if livestream viewers can omit specifying a token."""
1921
room_type: Union[Unset, RoomConfigRoomType] = RoomConfigRoomType.CONFERENCE
2022
"""The use-case of the room. If not provided, this defaults to conference."""
2123
video_codec: Union[Unset, None, RoomConfigVideoCodec] = UNSET
@@ -28,6 +30,7 @@ class RoomConfig:
2830
def to_dict(self) -> Dict[str, Any]:
2931
"""@private"""
3032
max_peers = self.max_peers
33+
public = self.public
3134
room_type: Union[Unset, str] = UNSET
3235
if not isinstance(self.room_type, Unset):
3336
room_type = self.room_type.value
@@ -43,6 +46,8 @@ def to_dict(self) -> Dict[str, Any]:
4346
field_dict.update({})
4447
if max_peers is not UNSET:
4548
field_dict["maxPeers"] = max_peers
49+
if public is not UNSET:
50+
field_dict["public"] = public
4651
if room_type is not UNSET:
4752
field_dict["roomType"] = room_type
4853
if video_codec is not UNSET:
@@ -58,6 +63,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
5863
d = src_dict.copy()
5964
max_peers = d.pop("maxPeers", UNSET)
6065

66+
public = d.pop("public", UNSET)
67+
6168
_room_type = d.pop("roomType", UNSET)
6269
room_type: Union[Unset, RoomConfigRoomType]
6370
if isinstance(_room_type, Unset):
@@ -78,6 +85,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
7885

7986
room_config = cls(
8087
max_peers=max_peers,
88+
public=public,
8189
room_type=room_type,
8290
video_codec=video_codec,
8391
webhook_url=webhook_url,

fishjam/api/_fishjam_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class RoomOptions:
5959
"conference", "audio_only", "livestream", "full_feature", "broadcaster"
6060
] = "conference"
6161
"""The use-case of the room. If not provided, this defaults to conference."""
62+
public: bool = False
63+
"""True if livestream viewers can omit specifying a token."""
6264

6365

6466
@dataclass
@@ -123,6 +125,7 @@ def create_room(self, options: RoomOptions | None = None) -> Room:
123125
video_codec=codec,
124126
webhook_url=options.webhook_url,
125127
room_type=RoomConfigRoomType(options.room_type),
128+
public=options.public,
126129
)
127130

128131
room = cast(

tests/test_room_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,10 @@ def test_invalid(self, room_api: FishjamClient):
256256

257257
class TestCreateLivestreamViewerToken:
258258
def test_valid(self, room_api: FishjamClient):
259-
room = room_api.create_room(RoomOptions(room_type=LIVESTREAM))
259+
room = room_api.create_room(RoomOptions(room_type=LIVESTREAM, public=True))
260260
viewer_token = room_api.create_livestream_viewer_token(room.id)
261261

262+
assert room.config.public
262263
assert isinstance(viewer_token, str)
263264

264265
def test_invalid(self, room_api: FishjamClient):

0 commit comments

Comments
 (0)