Fishjam Python Server SDK
 1from fishjam._openapi_client.models import (
 2    PeerMetadata,
 3    PeerStatus,
 4    PeerType,
 5)
 6
 7__all__ = [
 8    "PeerMetadata",
 9    "PeerStatus",
10    "PeerType",
11]
class PeerMetadata:
11@_attrs_define
12class PeerMetadata:
13    """Custom metadata set by the peer
14
15    Example:
16        {'name': 'FishjamUser'}
17
18    """
19
20    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
21
22    def to_dict(self) -> dict[str, Any]:
23        field_dict: dict[str, Any] = {}
24        field_dict.update(self.additional_properties)
25
26        return field_dict
27
28    @classmethod
29    def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
30        d = dict(src_dict)
31        peer_metadata = cls()
32
33        peer_metadata.additional_properties = d
34        return peer_metadata
35
36    @property
37    def additional_keys(self) -> list[str]:
38        return list(self.additional_properties.keys())
39
40    def __getitem__(self, key: str) -> Any:
41        return self.additional_properties[key]
42
43    def __setitem__(self, key: str, value: Any) -> None:
44        self.additional_properties[key] = value
45
46    def __delitem__(self, key: str) -> None:
47        del self.additional_properties[key]
48
49    def __contains__(self, key: str) -> bool:
50        return key in self.additional_properties

Custom metadata set by the peer

Example: {'name': 'FishjamUser'}

PeerMetadata()
2def __init__(self, ):
3    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class PeerMetadata.

additional_properties: dict[str, typing.Any]
def to_dict(self) -> dict[str, typing.Any]:
22    def to_dict(self) -> dict[str, Any]:
23        field_dict: dict[str, Any] = {}
24        field_dict.update(self.additional_properties)
25
26        return field_dict
@classmethod
def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T:
28    @classmethod
29    def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
30        d = dict(src_dict)
31        peer_metadata = cls()
32
33        peer_metadata.additional_properties = d
34        return peer_metadata
additional_keys: list[str]
36    @property
37    def additional_keys(self) -> list[str]:
38        return list(self.additional_properties.keys())
class PeerStatus(builtins.str, enum.Enum):
 5class PeerStatus(str, Enum):
 6    """Informs about the peer status"""
 7
 8    CONNECTED = "connected"
 9    DISCONNECTED = "disconnected"
10
11    def __str__(self) -> str:
12        return str(self.value)

Informs about the peer status

CONNECTED = <PeerStatus.CONNECTED: 'connected'>
DISCONNECTED = <PeerStatus.DISCONNECTED: 'disconnected'>
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 PeerType(builtins.str, enum.Enum):
 5class PeerType(str, Enum):
 6    """Peer type"""
 7
 8    AGENT = "agent"
 9    WEBRTC = "webrtc"
10
11    def __str__(self) -> str:
12        return str(self.value)

Peer type

AGENT = <PeerType.AGENT: 'agent'>
WEBRTC = <PeerType.WEBRTC: 'webrtc'>
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