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

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