2023-08-17 12:48:13 -07:00
|
|
|
from typing import Any, Dict, List, Type, TypeVar, Union
|
|
|
|
|
|
|
|
import attr
|
|
|
|
|
2023-09-29 15:51:03 -07:00
|
|
|
from ..models.client_metrics import ClientMetrics
|
2023-08-17 12:48:13 -07:00
|
|
|
from ..models.modeling_cmd import ModelingCmd
|
|
|
|
from ..models.modeling_cmd_id import ModelingCmdId
|
|
|
|
from ..models.rtc_ice_candidate_init import RtcIceCandidateInit
|
|
|
|
from ..models.rtc_session_description import RtcSessionDescription
|
|
|
|
from ..types import UNSET, Unset
|
|
|
|
|
2023-10-12 09:02:59 -07:00
|
|
|
RD = TypeVar("RD", bound="trickle_ice")
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class trickle_ice:
|
2023-09-29 16:05:40 -07:00
|
|
|
""" The trickle ICE candidate request. """ # noqa: E501
|
|
|
|
candidate: Union[Unset, RtcIceCandidateInit] = UNSET
|
|
|
|
type: str = "trickle_ice"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if not isinstance(self.candidate, Unset):
|
|
|
|
candidate = self.candidate
|
|
|
|
type = self.type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if candidate is not UNSET:
|
|
|
|
field_dict['candidate'] = candidate
|
|
|
|
field_dict['type'] = type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
return field_dict
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
@classmethod
|
2023-10-12 09:02:59 -07:00
|
|
|
def from_dict(cls: Type[RD], src_dict: Dict[str, Any]) -> RD:
|
2023-09-29 16:05:40 -07:00
|
|
|
d = src_dict.copy()
|
|
|
|
_candidate = d.pop("candidate", UNSET)
|
|
|
|
candidate: Union[Unset, RtcIceCandidateInit]
|
|
|
|
if isinstance(_candidate, Unset):
|
|
|
|
candidate = UNSET
|
|
|
|
else:
|
|
|
|
candidate = _candidate # type: ignore[arg-type]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
type = d.pop("type", UNSET)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
trickle_ice = cls(
|
|
|
|
candidate= candidate,
|
|
|
|
type= type,
|
|
|
|
)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
trickle_ice.additional_properties = d
|
|
|
|
return trickle_ice
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-12 09:02:59 -07:00
|
|
|
JW = TypeVar("JW", bound="sdp_offer")
|
2023-09-29 16:05:40 -07:00
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class sdp_offer:
|
2023-09-29 16:05:40 -07:00
|
|
|
""" The SDP offer request. """ # noqa: E501
|
|
|
|
offer: Union[Unset, RtcSessionDescription] = UNSET
|
|
|
|
type: str = "sdp_offer"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if not isinstance(self.offer, Unset):
|
|
|
|
offer = self.offer
|
|
|
|
type = self.type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if offer is not UNSET:
|
|
|
|
field_dict['offer'] = offer
|
|
|
|
field_dict['type'] = type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
return field_dict
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
@classmethod
|
2023-10-12 09:02:59 -07:00
|
|
|
def from_dict(cls: Type[JW], src_dict: Dict[str, Any]) -> JW:
|
2023-09-29 16:05:40 -07:00
|
|
|
d = src_dict.copy()
|
|
|
|
_offer = d.pop("offer", UNSET)
|
|
|
|
offer: Union[Unset, RtcSessionDescription]
|
|
|
|
if isinstance(_offer, Unset):
|
|
|
|
offer = UNSET
|
|
|
|
else:
|
|
|
|
offer = _offer # type: ignore[arg-type]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
type = d.pop("type", UNSET)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
sdp_offer = cls(
|
|
|
|
offer= offer,
|
|
|
|
type= type,
|
|
|
|
)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
sdp_offer.additional_properties = d
|
|
|
|
return sdp_offer
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
|
|
|
|
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-12 09:02:59 -07:00
|
|
|
KZ = TypeVar("KZ", bound="modeling_cmd_req")
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class modeling_cmd_req:
|
2023-09-29 16:05:40 -07:00
|
|
|
""" The modeling command request. """ # noqa: E501
|
|
|
|
cmd: Union[Unset, ModelingCmd] = UNSET
|
|
|
|
cmd_id: Union[Unset, ModelingCmdId] = UNSET
|
|
|
|
type: str = "modeling_cmd_req"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if not isinstance(self.cmd, Unset):
|
|
|
|
cmd = self.cmd
|
|
|
|
if not isinstance(self.cmd_id, Unset):
|
|
|
|
cmd_id = self.cmd_id
|
|
|
|
type = self.type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if cmd is not UNSET:
|
|
|
|
field_dict['cmd'] = cmd
|
|
|
|
if cmd_id is not UNSET:
|
|
|
|
field_dict['cmd_id'] = cmd_id
|
|
|
|
field_dict['type'] = type
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
return field_dict
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
@classmethod
|
2023-10-12 09:02:59 -07:00
|
|
|
def from_dict(cls: Type[KZ], src_dict: Dict[str, Any]) -> KZ:
|
2023-09-29 16:05:40 -07:00
|
|
|
d = src_dict.copy()
|
|
|
|
_cmd = d.pop("cmd", UNSET)
|
|
|
|
cmd: Union[Unset, ModelingCmd]
|
|
|
|
if isinstance(_cmd, Unset):
|
|
|
|
cmd = UNSET
|
|
|
|
else:
|
|
|
|
cmd = _cmd # type: ignore[arg-type]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
_cmd_id = d.pop("cmd_id", UNSET)
|
|
|
|
cmd_id: Union[Unset, ModelingCmdId]
|
|
|
|
if isinstance(_cmd_id, Unset):
|
|
|
|
cmd_id = UNSET
|
|
|
|
else:
|
|
|
|
cmd_id = _cmd_id # type: ignore[arg-type]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
type = d.pop("type", UNSET)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
modeling_cmd_req = cls(
|
|
|
|
cmd= cmd,
|
|
|
|
cmd_id= cmd_id,
|
|
|
|
type= type,
|
|
|
|
)
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
modeling_cmd_req.additional_properties = d
|
|
|
|
return modeling_cmd_req
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
|
|
|
|
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-08-17 12:48:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-10-12 09:02:59 -07:00
|
|
|
AS = TypeVar("AS", bound="ping")
|
2023-08-30 15:59:51 -07:00
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class ping:
|
2023-09-29 16:05:40 -07:00
|
|
|
""" The client-to-server Ping to ensure the WebSocket stays alive. """ # noqa: E501
|
|
|
|
type: str = "ping"
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
type = self.type
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
field_dict['type'] = type
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
return field_dict
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
@classmethod
|
2023-10-12 09:02:59 -07:00
|
|
|
def from_dict(cls: Type[AS], src_dict: Dict[str, Any]) -> AS:
|
2023-09-29 16:05:40 -07:00
|
|
|
d = src_dict.copy()
|
|
|
|
type = d.pop("type", UNSET)
|
2023-08-30 15:59:51 -07:00
|
|
|
|
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
ping = cls(
|
|
|
|
type= type,
|
|
|
|
)
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
ping.additional_properties = d
|
|
|
|
return ping
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-08-30 15:59:51 -07:00
|
|
|
|
|
|
|
|
2023-09-29 15:51:03 -07:00
|
|
|
|
|
|
|
|
2023-10-12 09:02:59 -07:00
|
|
|
IU = TypeVar("IU", bound="metrics_response")
|
2023-09-29 16:05:40 -07:00
|
|
|
|
2023-09-29 15:51:03 -07:00
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class metrics_response:
|
2023-09-29 16:05:40 -07:00
|
|
|
""" The response to a metrics collection request from the server. """ # noqa: E501
|
|
|
|
metrics: Union[Unset, ClientMetrics] = UNSET
|
|
|
|
type: str = "metrics_response"
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if not isinstance(self.metrics, Unset):
|
|
|
|
metrics = self.metrics
|
|
|
|
type = self.type
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if metrics is not UNSET:
|
|
|
|
field_dict['metrics'] = metrics
|
|
|
|
field_dict['type'] = type
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
return field_dict
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
@classmethod
|
2023-10-12 09:02:59 -07:00
|
|
|
def from_dict(cls: Type[IU], src_dict: Dict[str, Any]) -> IU:
|
2023-09-29 16:05:40 -07:00
|
|
|
d = src_dict.copy()
|
|
|
|
_metrics = d.pop("metrics", UNSET)
|
|
|
|
metrics: Union[Unset, ClientMetrics]
|
|
|
|
if isinstance(_metrics, Unset):
|
|
|
|
metrics = UNSET
|
|
|
|
else:
|
|
|
|
metrics = _metrics # type: ignore[arg-type]
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
type = d.pop("type", UNSET)
|
2023-09-29 15:51:03 -07:00
|
|
|
|
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
metrics_response = cls(
|
|
|
|
metrics= metrics,
|
|
|
|
type= type,
|
|
|
|
)
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
metrics_response.additional_properties = d
|
|
|
|
return metrics_response
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
WebSocketRequest = Union[trickle_ice, sdp_offer, modeling_cmd_req, ping, metrics_response]
|