Files
kittycad.py/kittycad/models/rtc_session_description.py
Jess Frazelle 63824cd04f Update api spec (#132)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-30 18:30:23 -07:00

70 lines
1.9 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
GP = TypeVar("GP", 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
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[GP], src_dict: Dict[str, Any]) -> GP:
d = src_dict.copy()
sdp = d.pop("sdp", UNSET)
_type = d.pop("type", UNSET)
type: Union[Unset, RtcSdpType]
if isinstance(_type, Unset):
type = UNSET
else:
type = _type # type: ignore[arg-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