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