Files
kittycad.py/kittycad/models/rtc_session_description.py
Jess Frazelle d9d73522fd fixes
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-28 17:22:38 -08:00

73 lines
2.0 KiB
Python

from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.rtc_sdp_type import RtcSdpType
from ..types import UNSET, Unset
IF = TypeVar("IF", bound="RtcSessionDescription")
@attr.s(auto_attribs=True)
class RtcSessionDescription:
"""SessionDescription is used to expose local and remote session descriptions.""" # noqa: E501
sdp: Union[Unset, str] = UNSET
type: Union[Unset, RtcSdpType] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
sdp = self.sdp
type: Union[Unset, RtcSdpType] = UNSET
if not isinstance(self.type, Unset):
type = self.type
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if sdp is not UNSET:
field_dict["sdp"] = sdp
if type is not UNSET:
field_dict["type"] = type
return field_dict
@classmethod
def from_dict(cls: Type[IF], src_dict: Dict[str, Any]) -> IF:
d = src_dict.copy()
sdp = d.pop("sdp", UNSET)
_type = d.pop("type", UNSET)
type: Union[Unset, RtcSdpType]
if isinstance(_type, Unset):
type = UNSET
if _type is None:
type = UNSET
else:
type = _type
rtc_session_description = cls(
sdp=sdp,
type=type,
)
rtc_session_description.additional_properties = d
return rtc_session_description
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties