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    public: Union[Unset, bool] = False
 21    """True if livestream viewers can omit specifying a token."""
 22    room_type: Union[Unset, RoomConfigRoomType] = RoomConfigRoomType.CONFERENCE
 23    """The use-case of the room. If not provided, this defaults to conference."""
 24    video_codec: Union[Unset, None, RoomConfigVideoCodec] = UNSET
 25    """Enforces video codec for each peer in the room"""
 26    webhook_url: Union[Unset, None, str] = UNSET
 27    """URL where Fishjam notifications will be sent"""
 28    additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
 29    """@private"""
 30
 31    def to_dict(self) -> Dict[str, Any]:
 32        """@private"""
 33        max_peers = self.max_peers
 34        public = self.public
 35        room_type: Union[Unset, str] = UNSET
 36        if not isinstance(self.room_type, Unset):
 37            room_type = self.room_type.value
 38
 39        video_codec: Union[Unset, None, str] = UNSET
 40        if not isinstance(self.video_codec, Unset):
 41            video_codec = self.video_codec.value if self.video_codec else None
 42
 43        webhook_url = self.webhook_url
 44
 45        field_dict: Dict[str, Any] = {}
 46        field_dict.update(self.additional_properties)
 47        field_dict.update({})
 48        if max_peers is not UNSET:
 49            field_dict["maxPeers"] = max_peers
 50        if public is not UNSET:
 51            field_dict["public"] = public
 52        if room_type is not UNSET:
 53            field_dict["roomType"] = room_type
 54        if video_codec is not UNSET:
 55            field_dict["videoCodec"] = video_codec
 56        if webhook_url is not UNSET:
 57            field_dict["webhookUrl"] = webhook_url
 58
 59        return field_dict
 60
 61    @classmethod
 62    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
 63        """@private"""
 64        d = src_dict.copy()
 65        max_peers = d.pop("maxPeers", UNSET)
 66
 67        public = d.pop("public", UNSET)
 68
 69        _room_type = d.pop("roomType", UNSET)
 70        room_type: Union[Unset, RoomConfigRoomType]
 71        if isinstance(_room_type, Unset):
 72            room_type = UNSET
 73        else:
 74            room_type = RoomConfigRoomType(_room_type)
 75
 76        _video_codec = d.pop("videoCodec", UNSET)
 77        video_codec: Union[Unset, None, RoomConfigVideoCodec]
 78        if _video_codec is None:
 79            video_codec = None
 80        elif isinstance(_video_codec, Unset):
 81            video_codec = UNSET
 82        else:
 83            video_codec = RoomConfigVideoCodec(_video_codec)
 84
 85        webhook_url = d.pop("webhookUrl", UNSET)
 86
 87        room_config = cls(
 88            max_peers=max_peers,
 89            public=public,
 90            room_type=room_type,
 91            video_codec=video_codec,
 92            webhook_url=webhook_url,
 93        )
 94
 95        room_config.additional_properties = d
 96        return room_config
 97
 98    @property
 99    def additional_keys(self) -> List[str]:
100        """@private"""
101        return list(self.additional_properties.keys())
102
103    def __getitem__(self, key: str) -> Any:
104        return self.additional_properties[key]
105
106    def __setitem__(self, key: str, value: Any) -> None:
107        self.additional_properties[key] = value
108
109    def __delitem__(self, key: str) -> None:
110        del self.additional_properties[key]
111
112    def __contains__(self, key: str) -> bool:
113        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>, public: Union[fishjam._openapi_client.types.Unset, bool] = False, room_type: Union[fishjam._openapi_client.types.Unset, RoomConfigRoomType] = <RoomConfigRoomType.CONFERENCE: 'conference'>, 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, 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):
3    self.max_peers = max_peers
4    self.public = public
5    self.room_type = room_type
6    self.video_codec = video_codec
7    self.webhook_url = webhook_url
8    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

public: Union[fishjam._openapi_client.types.Unset, bool]

True if livestream viewers can omit specifying a token.

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

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

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 conference."""
 7
 8    AUDIO_ONLY = "audio_only"
 9    BROADCASTER = "broadcaster"
10    CONFERENCE = "conference"
11    FULL_FEATURE = "full_feature"
12    LIVESTREAM = "livestream"
13
14    def __str__(self) -> str:
15        return str(self.value)

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

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