Fishjam Python Server SDK
1from fishjam._openapi_client.models import (
2    RoomConfig,
3    RoomType,
4    VideoCodec,
5)
6
7__all__ = ["RoomConfig", "VideoCodec", "RoomType"]
class RoomConfig:
 16@_attrs_define
 17class RoomConfig:
 18    """Room configuration
 19
 20    Attributes:
 21        max_peers (int | None | Unset): Maximum amount of peers allowed into the room Example: 10.
 22        public (bool | Unset): True if livestream viewers can omit specifying a token. Default: False.
 23        room_type (RoomType | Unset): The use-case of the room. If not provided, this defaults to conference.
 24        video_codec (VideoCodec | Unset): Enforces video codec for each peer in the room
 25        webhook_url (None | str | Unset): URL where Fishjam notifications will be sent Example:
 26            https://backend.address.com/fishjam-notifications-endpoint.
 27    """
 28
 29    max_peers: int | None | Unset = UNSET
 30    public: bool | Unset = False
 31    room_type: RoomType | Unset = UNSET
 32    video_codec: VideoCodec | Unset = UNSET
 33    webhook_url: None | str | Unset = UNSET
 34
 35    def to_dict(self) -> dict[str, Any]:
 36        max_peers: int | None | Unset
 37        if isinstance(self.max_peers, Unset):
 38            max_peers = UNSET
 39        else:
 40            max_peers = self.max_peers
 41
 42        public = self.public
 43
 44        room_type: str | Unset = UNSET
 45        if not isinstance(self.room_type, Unset):
 46            room_type = self.room_type.value
 47
 48        video_codec: str | Unset = UNSET
 49        if not isinstance(self.video_codec, Unset):
 50            video_codec = self.video_codec.value
 51
 52        webhook_url: None | str | Unset
 53        if isinstance(self.webhook_url, Unset):
 54            webhook_url = UNSET
 55        else:
 56            webhook_url = self.webhook_url
 57
 58        field_dict: dict[str, Any] = {}
 59
 60        field_dict.update({})
 61        if max_peers is not UNSET:
 62            field_dict["maxPeers"] = max_peers
 63        if public is not UNSET:
 64            field_dict["public"] = public
 65        if room_type is not UNSET:
 66            field_dict["roomType"] = room_type
 67        if video_codec is not UNSET:
 68            field_dict["videoCodec"] = video_codec
 69        if webhook_url is not UNSET:
 70            field_dict["webhookUrl"] = webhook_url
 71
 72        return field_dict
 73
 74    @classmethod
 75    def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
 76        d = dict(src_dict)
 77
 78        def _parse_max_peers(data: object) -> int | None | Unset:
 79            if data is None:
 80                return data
 81            if isinstance(data, Unset):
 82                return data
 83            return cast(int | None | Unset, data)
 84
 85        max_peers = _parse_max_peers(d.pop("maxPeers", UNSET))
 86
 87        public = d.pop("public", UNSET)
 88
 89        _room_type = d.pop("roomType", UNSET)
 90        room_type: RoomType | Unset
 91        if isinstance(_room_type, Unset):
 92            room_type = UNSET
 93        else:
 94            room_type = RoomType(_room_type)
 95
 96        _video_codec = d.pop("videoCodec", UNSET)
 97        video_codec: VideoCodec | Unset
 98        if isinstance(_video_codec, Unset):
 99            video_codec = UNSET
100        else:
101            video_codec = VideoCodec(_video_codec)
102
103        def _parse_webhook_url(data: object) -> None | str | Unset:
104            if data is None:
105                return data
106            if isinstance(data, Unset):
107                return data
108            return cast(None | str | Unset, data)
109
110        webhook_url = _parse_webhook_url(d.pop("webhookUrl", UNSET))
111
112        room_config = cls(
113            max_peers=max_peers,
114            public=public,
115            room_type=room_type,
116            video_codec=video_codec,
117            webhook_url=webhook_url,
118        )
119
120        return room_config

Room configuration

Attributes:

  • max_peers (int | None | Unset): Maximum amount of peers allowed into the room Example: 10.
  • public (bool | Unset): True if livestream viewers can omit specifying a token. Default: False.
  • room_type (RoomType | Unset): The use-case of the room. If not provided, this defaults to conference.
  • video_codec (VideoCodec | Unset): Enforces video codec for each peer in the room
  • webhook_url (None | str | Unset): URL where Fishjam notifications will be sent Example: https://backend.address.com/fishjam-notifications-endpoint.
RoomConfig( max_peers: 'int | None | Unset' = <fishjam._openapi_client.types.Unset object>, public: 'bool | Unset' = False, room_type: 'RoomType | Unset' = <fishjam._openapi_client.types.Unset object>, video_codec: 'VideoCodec | Unset' = <fishjam._openapi_client.types.Unset object>, webhook_url: 'None | str | Unset' = <fishjam._openapi_client.types.Unset object>)
27def __init__(self, max_peers=attr_dict['max_peers'].default, public=attr_dict['public'].default, room_type=attr_dict['room_type'].default, video_codec=attr_dict['video_codec'].default, webhook_url=attr_dict['webhook_url'].default):
28    self.max_peers = max_peers
29    self.public = public
30    self.room_type = room_type
31    self.video_codec = video_codec
32    self.webhook_url = webhook_url

Method generated by attrs for class RoomConfig.

max_peers: 'int | None | Unset'
public: 'bool | Unset'
room_type: 'RoomType | Unset'
video_codec: 'VideoCodec | Unset'
webhook_url: 'None | str | Unset'
def to_dict(self) -> 'dict[str, Any]':
35    def to_dict(self) -> dict[str, Any]:
36        max_peers: int | None | Unset
37        if isinstance(self.max_peers, Unset):
38            max_peers = UNSET
39        else:
40            max_peers = self.max_peers
41
42        public = self.public
43
44        room_type: str | Unset = UNSET
45        if not isinstance(self.room_type, Unset):
46            room_type = self.room_type.value
47
48        video_codec: str | Unset = UNSET
49        if not isinstance(self.video_codec, Unset):
50            video_codec = self.video_codec.value
51
52        webhook_url: None | str | Unset
53        if isinstance(self.webhook_url, Unset):
54            webhook_url = UNSET
55        else:
56            webhook_url = self.webhook_url
57
58        field_dict: dict[str, Any] = {}
59
60        field_dict.update({})
61        if max_peers is not UNSET:
62            field_dict["maxPeers"] = max_peers
63        if public is not UNSET:
64            field_dict["public"] = public
65        if room_type is not UNSET:
66            field_dict["roomType"] = room_type
67        if video_codec is not UNSET:
68            field_dict["videoCodec"] = video_codec
69        if webhook_url is not UNSET:
70            field_dict["webhookUrl"] = webhook_url
71
72        return field_dict
@classmethod
def from_dict(cls: 'type[T]', src_dict: 'Mapping[str, Any]') -> 'T':
 74    @classmethod
 75    def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
 76        d = dict(src_dict)
 77
 78        def _parse_max_peers(data: object) -> int | None | Unset:
 79            if data is None:
 80                return data
 81            if isinstance(data, Unset):
 82                return data
 83            return cast(int | None | Unset, data)
 84
 85        max_peers = _parse_max_peers(d.pop("maxPeers", UNSET))
 86
 87        public = d.pop("public", UNSET)
 88
 89        _room_type = d.pop("roomType", UNSET)
 90        room_type: RoomType | Unset
 91        if isinstance(_room_type, Unset):
 92            room_type = UNSET
 93        else:
 94            room_type = RoomType(_room_type)
 95
 96        _video_codec = d.pop("videoCodec", UNSET)
 97        video_codec: VideoCodec | Unset
 98        if isinstance(_video_codec, Unset):
 99            video_codec = UNSET
100        else:
101            video_codec = VideoCodec(_video_codec)
102
103        def _parse_webhook_url(data: object) -> None | str | Unset:
104            if data is None:
105                return data
106            if isinstance(data, Unset):
107                return data
108            return cast(None | str | Unset, data)
109
110        webhook_url = _parse_webhook_url(d.pop("webhookUrl", UNSET))
111
112        room_config = cls(
113            max_peers=max_peers,
114            public=public,
115            room_type=room_type,
116            video_codec=video_codec,
117            webhook_url=webhook_url,
118        )
119
120        return room_config
class VideoCodec(builtins.str, enum.Enum):
 5class VideoCodec(str, Enum):
 6    """Enforces video codec for each peer in the room"""
 7
 8    H264 = "h264"
 9    VP8 = "vp8"
10
11    def __str__(self) -> str:
12        return str(self.value)

Enforces video codec for each peer in the room

H264 = <VideoCodec.H264: 'h264'>
VP8 = <VideoCodec.VP8: 'vp8'>
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
removeprefix
removesuffix
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
class RoomType(builtins.str, enum.Enum):
 5class RoomType(str, Enum):
 6    """The use-case of the room. If not provided, this defaults to conference."""
 7
 8    AUDIO_ONLY = "audio_only"
 9    AUDIO_ONLY_LIVESTREAM = "audio_only_livestream"
10    BROADCASTER = "broadcaster"
11    CONFERENCE = "conference"
12    FULL_FEATURE = "full_feature"
13    LIVESTREAM = "livestream"
14
15    def __str__(self) -> str:
16        return str(self.value)

The use-case of the room. If not provided, this defaults to conference.

AUDIO_ONLY = <RoomType.AUDIO_ONLY: 'audio_only'>
AUDIO_ONLY_LIVESTREAM = <RoomType.AUDIO_ONLY_LIVESTREAM: 'audio_only_livestream'>
BROADCASTER = <RoomType.BROADCASTER: 'broadcaster'>
CONFERENCE = <RoomType.CONFERENCE: 'conference'>
FULL_FEATURE = <RoomType.FULL_FEATURE: 'full_feature'>
LIVESTREAM = <RoomType.LIVESTREAM: 'livestream'>
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
removeprefix
removesuffix
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans