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

Room configuration

Attributes:

  • max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10.
  • public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False.
  • room_type (Union[Unset, RoomType]): The use-case of the room. If not provided, this defaults to conference.
  • video_codec (Union[Unset, VideoCodec]): Enforces video codec for each peer in the room
  • webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: https://backend.address.com/fishjam-notifications-endpoint.
RoomConfig( max_peers: None | fishjam._openapi_client.types.Unset | int = <fishjam._openapi_client.types.Unset object>, public: fishjam._openapi_client.types.Unset | bool = False, room_type: fishjam._openapi_client.types.Unset | RoomType = <fishjam._openapi_client.types.Unset object>, video_codec: fishjam._openapi_client.types.Unset | VideoCodec = <fishjam._openapi_client.types.Unset object>, webhook_url: None | fishjam._openapi_client.types.Unset | str = <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: None | fishjam._openapi_client.types.Unset | int
public: fishjam._openapi_client.types.Unset | bool
room_type: fishjam._openapi_client.types.Unset | RoomType
video_codec: fishjam._openapi_client.types.Unset | VideoCodec
webhook_url: None | fishjam._openapi_client.types.Unset | str
def to_dict(self) -> dict[str, typing.Any]:
38    def to_dict(self) -> dict[str, Any]:
39        max_peers: Union[None, Unset, int]
40        if isinstance(self.max_peers, Unset):
41            max_peers = UNSET
42        else:
43            max_peers = self.max_peers
44
45        public = self.public
46
47        room_type: Union[Unset, str] = UNSET
48        if not isinstance(self.room_type, Unset):
49            room_type = self.room_type.value
50
51        video_codec: Union[Unset, str] = UNSET
52        if not isinstance(self.video_codec, Unset):
53            video_codec = self.video_codec.value
54
55        webhook_url: Union[None, Unset, str]
56        if isinstance(self.webhook_url, Unset):
57            webhook_url = UNSET
58        else:
59            webhook_url = self.webhook_url
60
61        field_dict: dict[str, Any] = {}
62
63        field_dict.update({})
64        if max_peers is not UNSET:
65            field_dict["maxPeers"] = max_peers
66        if public is not UNSET:
67            field_dict["public"] = public
68        if room_type is not UNSET:
69            field_dict["roomType"] = room_type
70        if video_codec is not UNSET:
71            field_dict["videoCodec"] = video_codec
72        if webhook_url is not UNSET:
73            field_dict["webhookUrl"] = webhook_url
74
75        return field_dict
@classmethod
def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T:
 77    @classmethod
 78    def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
 79        d = dict(src_dict)
 80
 81        def _parse_max_peers(data: object) -> Union[None, Unset, int]:
 82            if data is None:
 83                return data
 84            if isinstance(data, Unset):
 85                return data
 86            return cast(Union[None, Unset, int], data)
 87
 88        max_peers = _parse_max_peers(d.pop("maxPeers", UNSET))
 89
 90        public = d.pop("public", UNSET)
 91
 92        _room_type = d.pop("roomType", UNSET)
 93        room_type: Union[Unset, RoomType]
 94        if isinstance(_room_type, Unset):
 95            room_type = UNSET
 96        else:
 97            room_type = RoomType(_room_type)
 98
 99        _video_codec = d.pop("videoCodec", UNSET)
100        video_codec: Union[Unset, VideoCodec]
101        if isinstance(_video_codec, Unset):
102            video_codec = UNSET
103        else:
104            video_codec = VideoCodec(_video_codec)
105
106        def _parse_webhook_url(data: object) -> Union[None, Unset, str]:
107            if data is None:
108                return data
109            if isinstance(data, Unset):
110                return data
111            return cast(Union[None, Unset, str], data)
112
113        webhook_url = _parse_webhook_url(d.pop("webhookUrl", UNSET))
114
115        room_config = cls(
116            max_peers=max_peers,
117            public=public,
118            room_type=room_type,
119            video_codec=video_codec,
120            webhook_url=webhook_url,
121        )
122
123        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