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

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>)
28def __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):
29    self.max_peers = max_peers
30    self.public = public
31    self.room_type = room_type
32    self.video_codec = video_codec
33    self.webhook_url = webhook_url
34    self.additional_properties = __attr_factory_additional_properties()

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
additional_properties: dict[str, typing.Any]
def to_dict(self) -> dict[str, typing.Any]:
40    def to_dict(self) -> dict[str, Any]:
41        max_peers: Union[None, Unset, int]
42        if isinstance(self.max_peers, Unset):
43            max_peers = UNSET
44        else:
45            max_peers = self.max_peers
46
47        public = self.public
48
49        room_type: Union[Unset, str] = UNSET
50        if not isinstance(self.room_type, Unset):
51            room_type = self.room_type.value
52
53        video_codec: Union[Unset, str] = UNSET
54        if not isinstance(self.video_codec, Unset):
55            video_codec = self.video_codec.value
56
57        webhook_url: Union[None, Unset, str]
58        if isinstance(self.webhook_url, Unset):
59            webhook_url = UNSET
60        else:
61            webhook_url = self.webhook_url
62
63        field_dict: dict[str, Any] = {}
64        field_dict.update(self.additional_properties)
65        field_dict.update({})
66        if max_peers is not UNSET:
67            field_dict["maxPeers"] = max_peers
68        if public is not UNSET:
69            field_dict["public"] = public
70        if room_type is not UNSET:
71            field_dict["roomType"] = room_type
72        if video_codec is not UNSET:
73            field_dict["videoCodec"] = video_codec
74        if webhook_url is not UNSET:
75            field_dict["webhookUrl"] = webhook_url
76
77        return field_dict
@classmethod
def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T:
 79    @classmethod
 80    def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
 81        d = dict(src_dict)
 82
 83        def _parse_max_peers(data: object) -> Union[None, Unset, int]:
 84            if data is None:
 85                return data
 86            if isinstance(data, Unset):
 87                return data
 88            return cast(Union[None, Unset, int], data)
 89
 90        max_peers = _parse_max_peers(d.pop("maxPeers", UNSET))
 91
 92        public = d.pop("public", UNSET)
 93
 94        _room_type = d.pop("roomType", UNSET)
 95        room_type: Union[Unset, RoomType]
 96        if isinstance(_room_type, Unset):
 97            room_type = UNSET
 98        else:
 99            room_type = RoomType(_room_type)
100
101        _video_codec = d.pop("videoCodec", UNSET)
102        video_codec: Union[Unset, VideoCodec]
103        if isinstance(_video_codec, Unset):
104            video_codec = UNSET
105        else:
106            video_codec = VideoCodec(_video_codec)
107
108        def _parse_webhook_url(data: object) -> Union[None, Unset, str]:
109            if data is None:
110                return data
111            if isinstance(data, Unset):
112                return data
113            return cast(Union[None, Unset, str], data)
114
115        webhook_url = _parse_webhook_url(d.pop("webhookUrl", UNSET))
116
117        room_config = cls(
118            max_peers=max_peers,
119            public=public,
120            room_type=room_type,
121            video_codec=video_codec,
122            webhook_url=webhook_url,
123        )
124
125        room_config.additional_properties = d
126        return room_config
additional_keys: list[str]
128    @property
129    def additional_keys(self) -> list[str]:
130        return list(self.additional_properties.keys())
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