2023-08-30 15:59:51 -07:00
|
|
|
from typing import Any, Dict, List, Type, TypeVar, Union
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
import attr
|
|
|
|
|
|
|
|
from ..types import UNSET, Unset
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
DE = TypeVar("DE", bound="ice_server_info")
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
2023-08-30 15:59:51 -07:00
|
|
|
class ice_server_info:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""Information about the ICE servers.""" # noqa: E501
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
data: Union[Unset, Any] = UNSET
|
|
|
|
type: str = "ice_server_info"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
data = self.data
|
|
|
|
type = self.type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if data is not UNSET:
|
|
|
|
field_dict["data"] = data
|
|
|
|
field_dict["type"] = type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[DE], src_dict: Dict[str, Any]) -> DE:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
data = d.pop("data", UNSET)
|
|
|
|
type = d.pop("type", UNSET)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
ice_server_info = cls(
|
|
|
|
data=data,
|
|
|
|
type=type,
|
|
|
|
)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
ice_server_info.additional_properties = d
|
|
|
|
return ice_server_info
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
PU = TypeVar("PU", bound="trickle_ice")
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
@attr.s(auto_attribs=True)
|
2023-08-30 15:59:51 -07:00
|
|
|
class trickle_ice:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""The trickle ICE candidate response.""" # noqa: E501
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
data: Union[Unset, Any] = UNSET
|
|
|
|
type: str = "trickle_ice"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
data = self.data
|
|
|
|
type = self.type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if data is not UNSET:
|
|
|
|
field_dict["data"] = data
|
|
|
|
field_dict["type"] = type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[PU], src_dict: Dict[str, Any]) -> PU:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
data = d.pop("data", UNSET)
|
|
|
|
type = d.pop("type", UNSET)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
trickle_ice = cls(
|
|
|
|
data=data,
|
|
|
|
type=type,
|
|
|
|
)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
trickle_ice.additional_properties = d
|
|
|
|
return trickle_ice
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
AP = TypeVar("AP", bound="sdp_answer")
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
2023-08-30 15:59:51 -07:00
|
|
|
class sdp_answer:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""The SDP answer response.""" # noqa: E501
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
data: Union[Unset, Any] = UNSET
|
|
|
|
type: str = "sdp_answer"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
data = self.data
|
|
|
|
type = self.type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if data is not UNSET:
|
|
|
|
field_dict["data"] = data
|
|
|
|
field_dict["type"] = type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[AP], src_dict: Dict[str, Any]) -> AP:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
data = d.pop("data", UNSET)
|
|
|
|
type = d.pop("type", UNSET)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
sdp_answer = cls(
|
|
|
|
data=data,
|
|
|
|
type=type,
|
|
|
|
)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
sdp_answer.additional_properties = d
|
|
|
|
return sdp_answer
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
AA = TypeVar("AA", bound="modeling")
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class modeling:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""The modeling command response.""" # noqa: E501
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
data: Union[Unset, Any] = UNSET
|
|
|
|
type: str = "modeling"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
data = self.data
|
|
|
|
type = self.type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if data is not UNSET:
|
|
|
|
field_dict["data"] = data
|
|
|
|
field_dict["type"] = type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[AA], src_dict: Dict[str, Any]) -> AA:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
data = d.pop("data", UNSET)
|
|
|
|
type = d.pop("type", UNSET)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
modeling = cls(
|
|
|
|
data=data,
|
|
|
|
type=type,
|
|
|
|
)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
modeling.additional_properties = d
|
|
|
|
return modeling
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
MH = TypeVar("MH", bound="export")
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class export:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""The exported files.""" # noqa: E501
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
data: Union[Unset, Any] = UNSET
|
|
|
|
type: str = "export"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
data = self.data
|
|
|
|
type = self.type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if data is not UNSET:
|
|
|
|
field_dict["data"] = data
|
|
|
|
field_dict["type"] = type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[MH], src_dict: Dict[str, Any]) -> MH:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
data = d.pop("data", UNSET)
|
|
|
|
type = d.pop("type", UNSET)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
export = cls(
|
|
|
|
data=data,
|
|
|
|
type=type,
|
|
|
|
)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
export.additional_properties = d
|
|
|
|
return export
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-09-29 16:05:40 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
OL = TypeVar("OL", bound="metrics_request")
|
2023-09-29 15:51:03 -07:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class metrics_request:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""Request a collection of metrics, to include WebRTC.""" # noqa: E501
|
|
|
|
|
|
|
|
data: Union[Unset, Any] = UNSET
|
|
|
|
type: str = "metrics_request"
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
data = self.data
|
|
|
|
type = self.type
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if data is not UNSET:
|
|
|
|
field_dict["data"] = data
|
|
|
|
field_dict["type"] = type
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[OL], src_dict: Dict[str, Any]) -> OL:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
data = d.pop("data", UNSET)
|
|
|
|
type = d.pop("type", UNSET)
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
metrics_request = cls(
|
|
|
|
data=data,
|
|
|
|
type=type,
|
|
|
|
)
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
metrics_request.additional_properties = d
|
|
|
|
return metrics_request
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-09-29 15:51:03 -07:00
|
|
|
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
GY = TypeVar("GY", bound="OkWebSocketResponseData")
|
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
2023-11-28 14:16:05 -08:00
|
|
|
class OkWebSocketResponseData:
|
|
|
|
|
|
|
|
"""The websocket messages this server sends."""
|
|
|
|
|
|
|
|
type: Union[
|
|
|
|
ice_server_info,
|
|
|
|
trickle_ice,
|
|
|
|
sdp_answer,
|
|
|
|
modeling,
|
|
|
|
export,
|
|
|
|
metrics_request,
|
2023-11-28 14:29:16 -08:00
|
|
|
]
|
2023-11-28 14:16:05 -08:00
|
|
|
|
|
|
|
def __init__(
|
|
|
|
self,
|
|
|
|
type: Union[
|
2023-11-28 14:29:16 -08:00
|
|
|
ice_server_info,
|
|
|
|
trickle_ice,
|
|
|
|
sdp_answer,
|
|
|
|
modeling,
|
|
|
|
export,
|
|
|
|
metrics_request,
|
2023-11-28 14:16:05 -08:00
|
|
|
],
|
|
|
|
):
|
|
|
|
self.type = type
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if isinstance(self.type, ice_server_info):
|
2023-11-28 14:29:16 -08:00
|
|
|
WA: ice_server_info = self.type
|
|
|
|
return WA.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
elif isinstance(self.type, trickle_ice):
|
2023-11-28 14:29:16 -08:00
|
|
|
EP: trickle_ice = self.type
|
|
|
|
return EP.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
elif isinstance(self.type, sdp_answer):
|
2023-11-28 14:29:16 -08:00
|
|
|
JY: sdp_answer = self.type
|
|
|
|
return JY.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
elif isinstance(self.type, modeling):
|
2023-11-28 14:29:16 -08:00
|
|
|
BZ: modeling = self.type
|
|
|
|
return BZ.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
elif isinstance(self.type, export):
|
2023-11-28 14:29:16 -08:00
|
|
|
NL: export = self.type
|
|
|
|
return NL.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
elif isinstance(self.type, metrics_request):
|
2023-11-28 14:29:16 -08:00
|
|
|
MI: metrics_request = self.type
|
|
|
|
return MI.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
|
|
|
|
raise Exception("Unknown type")
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
@classmethod
|
|
|
|
def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY:
|
2023-11-28 14:16:05 -08:00
|
|
|
if d.get("type") == "ice_server_info":
|
2023-11-28 14:29:16 -08:00
|
|
|
LA: ice_server_info = ice_server_info()
|
|
|
|
LA.from_dict(d)
|
|
|
|
return cls(type=LA)
|
2023-11-28 14:16:05 -08:00
|
|
|
elif d.get("type") == "trickle_ice":
|
2023-11-28 14:29:16 -08:00
|
|
|
CJ: trickle_ice = trickle_ice()
|
|
|
|
CJ.from_dict(d)
|
|
|
|
return cls(type=CJ)
|
2023-11-28 14:16:05 -08:00
|
|
|
elif d.get("type") == "sdp_answer":
|
2023-11-28 14:29:16 -08:00
|
|
|
FE: sdp_answer = sdp_answer()
|
|
|
|
FE.from_dict(d)
|
|
|
|
return cls(type=FE)
|
2023-11-28 14:16:05 -08:00
|
|
|
elif d.get("type") == "modeling":
|
2023-11-28 14:29:16 -08:00
|
|
|
NB: modeling = modeling()
|
|
|
|
NB.from_dict(d)
|
|
|
|
return cls(type=NB)
|
2023-11-28 14:16:05 -08:00
|
|
|
elif d.get("type") == "export":
|
2023-11-28 14:29:16 -08:00
|
|
|
TJ: export = export()
|
|
|
|
TJ.from_dict(d)
|
|
|
|
return cls(type=TJ)
|
2023-11-28 14:16:05 -08:00
|
|
|
elif d.get("type") == "metrics_request":
|
2023-11-28 14:29:16 -08:00
|
|
|
KS: metrics_request = metrics_request()
|
|
|
|
KS.from_dict(d)
|
|
|
|
return cls(type=KS)
|
2023-11-28 14:16:05 -08:00
|
|
|
|
|
|
|
raise Exception("Unknown type")
|