Fishjam Python Server SDK
1from fishjam._openapi_client.models import (
2    RoomConfig,
3    RoomConfigRoomType,
4    RoomConfigVideoCodec,
5)
6
7__all__ = ["RoomConfig", "RoomConfigVideoCodec", "RoomConfigRoomType"]
class RoomConfig:
 14@_attrs_define
 15class RoomConfig:
 16    """Room configuration"""
 17
 18    max_peers: Union[Unset, None, int] = UNSET
 19    """Maximum amount of peers allowed into the room"""
 20    peer_disconnected_timeout: Union[Unset, None, int] = UNSET
 21    """Duration (in seconds) after which the peer will be removed if it is disconnected. If not provided, this feature is disabled."""
 22    peerless_purge_timeout: Union[Unset, None, int] = UNSET
 23    """Duration (in seconds) after which the room will be removed if no peers are connected. If not provided, this feature is disabled."""
 24    room_type: Union[Unset, RoomConfigRoomType] = RoomConfigRoomType.FULL_FEATURE
 25    """The use-case of the room. If not provided, this defaults to full_feature."""
 26    video_codec: Union[Unset, None, RoomConfigVideoCodec] = UNSET
 27    """Enforces video codec for each peer in the room"""
 28    webhook_url: Union[Unset, None, str] = UNSET
 29    """URL where Fishjam notifications will be sent"""
 30    additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
 31    """@private"""
 32
 33    def to_dict(self) -> Dict[str, Any]:
 34        """@private"""
 35        max_peers = self.max_peers
 36        peer_disconnected_timeout = self.peer_disconnected_timeout
 37        peerless_purge_timeout = self.peerless_purge_timeout
 38        room_type: Union[Unset, str] = UNSET
 39        if not isinstance(self.room_type, Unset):
 40            room_type = self.room_type.value
 41
 42        video_codec: Union[Unset, None, str] = UNSET
 43        if not isinstance(self.video_codec, Unset):
 44            video_codec = self.video_codec.value if self.video_codec else None
 45
 46        webhook_url = self.webhook_url
 47
 48        field_dict: Dict[str, Any] = {}
 49        field_dict.update(self.additional_properties)
 50        field_dict.update({})
 51        if max_peers is not UNSET:
 52            field_dict["maxPeers"] = max_peers
 53        if peer_disconnected_timeout is not UNSET:
 54            field_dict["peerDisconnectedTimeout"] = peer_disconnected_timeout
 55        if peerless_purge_timeout is not UNSET:
 56            field_dict["peerlessPurgeTimeout"] = peerless_purge_timeout
 57        if room_type is not UNSET:
 58            field_dict["roomType"] = room_type
 59        if video_codec is not UNSET:
 60            field_dict["videoCodec"] = video_codec
 61        if webhook_url is not UNSET:
 62            field_dict["webhookUrl"] = webhook_url
 63
 64        return field_dict
 65
 66    @classmethod
 67    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
 68        """@private"""
 69        d = src_dict.copy()
 70        max_peers = d.pop("maxPeers", UNSET)
 71
 72        peer_disconnected_timeout = d.pop("peerDisconnectedTimeout", UNSET)
 73
 74        peerless_purge_timeout = d.pop("peerlessPurgeTimeout", UNSET)
 75
 76        _room_type = d.pop("roomType", UNSET)
 77        room_type: Union[Unset, RoomConfigRoomType]
 78        if isinstance(_room_type, Unset):
 79            room_type = UNSET
 80        else:
 81            room_type = RoomConfigRoomType(_room_type)
 82
 83        _video_codec = d.pop("videoCodec", UNSET)
 84        video_codec: Union[Unset, None, RoomConfigVideoCodec]
 85        if _video_codec is None:
 86            video_codec = None
 87        elif isinstance(_video_codec, Unset):
 88            video_codec = UNSET
 89        else:
 90            video_codec = RoomConfigVideoCodec(_video_codec)
 91
 92        webhook_url = d.pop("webhookUrl", UNSET)
 93
 94        room_config = cls(
 95            max_peers=max_peers,
 96            peer_disconnected_timeout=peer_disconnected_timeout,
 97            peerless_purge_timeout=peerless_purge_timeout,
 98            room_type=room_type,
 99            video_codec=video_codec,
100            webhook_url=webhook_url,
101        )
102
103        room_config.additional_properties = d
104        return room_config
105
106    @property
107    def additional_keys(self) -> List[str]:
108        """@private"""
109        return list(self.additional_properties.keys())
110
111    def __getitem__(self, key: str) -> Any:
112        return self.additional_properties[key]
113
114    def __setitem__(self, key: str, value: Any) -> None:
115        self.additional_properties[key] = value
116
117    def __delitem__(self, key: str) -> None:
118        del self.additional_properties[key]
119
120    def __contains__(self, key: str) -> bool:
121        return key in self.additional_properties

Room configuration

RoomConfig( max_peers: Union[fishjam._openapi_client.types.Unset, NoneType, int] = <fishjam._openapi_client.types.Unset object>, peer_disconnected_timeout: Union[fishjam._openapi_client.types.Unset, NoneType, int] = <fishjam._openapi_client.types.Unset object>, peerless_purge_timeout: Union[fishjam._openapi_client.types.Unset, NoneType, int] = <fishjam._openapi_client.types.Unset object>, room_type: Union[fishjam._openapi_client.types.Unset, RoomConfigRoomType] = <RoomConfigRoomType.FULL_FEATURE: 'full_feature'>, video_codec: Union[fishjam._openapi_client.types.Unset, NoneType, RoomConfigVideoCodec] = <fishjam._openapi_client.types.Unset object>, webhook_url: Union[fishjam._openapi_client.types.Unset, NoneType, str] = <fishjam._openapi_client.types.Unset object>)
2def __init__(self, max_peers=attr_dict['max_peers'].default, peer_disconnected_timeout=attr_dict['peer_disconnected_timeout'].default, peerless_purge_timeout=attr_dict['peerless_purge_timeout'].default, room_type=attr_dict['room_type'].default, video_codec=attr_dict['video_codec'].default, webhook_url=attr_dict['webhook_url'].default):
3    self.max_peers = max_peers
4    self.peer_disconnected_timeout = peer_disconnected_timeout
5    self.peerless_purge_timeout = peerless_purge_timeout
6    self.room_type = room_type
7    self.video_codec = video_codec
8    self.webhook_url = webhook_url
9    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class RoomConfig.

max_peers: Union[fishjam._openapi_client.types.Unset, NoneType, int]

Maximum amount of peers allowed into the room

peer_disconnected_timeout: Union[fishjam._openapi_client.types.Unset, NoneType, int]

Duration (in seconds) after which the peer will be removed if it is disconnected. If not provided, this feature is disabled.

peerless_purge_timeout: Union[fishjam._openapi_client.types.Unset, NoneType, int]

Duration (in seconds) after which the room will be removed if no peers are connected. If not provided, this feature is disabled.

room_type: Union[fishjam._openapi_client.types.Unset, RoomConfigRoomType]

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

video_codec: Union[fishjam._openapi_client.types.Unset, NoneType, RoomConfigVideoCodec]

Enforces video codec for each peer in the room

webhook_url: Union[fishjam._openapi_client.types.Unset, NoneType, str]

URL where Fishjam notifications will be sent

class RoomConfigVideoCodec(builtins.str, enum.Enum):
 5class RoomConfigVideoCodec(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 = <RoomConfigVideoCodec.H264: 'h264'>
VP8 = <RoomConfigVideoCodec.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 RoomConfigRoomType(builtins.str, enum.Enum):
 5class RoomConfigRoomType(str, Enum):
 6    """The use-case of the room. If not provided, this defaults to full_feature."""
 7
 8    AUDIO_ONLY = "audio_only"
 9    BROADCASTER = "broadcaster"
10    FULL_FEATURE = "full_feature"
11
12    def __str__(self) -> str:
13        return str(self.value)

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

AUDIO_ONLY = <RoomConfigRoomType.AUDIO_ONLY: 'audio_only'>
BROADCASTER = <RoomConfigRoomType.BROADCASTER: 'broadcaster'>
FULL_FEATURE = <RoomConfigRoomType.FULL_FEATURE: 'full_feature'>
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