2023-05-04 00:58:06 -07:00
|
|
|
from typing import Any, Dict, List, Type, TypeVar, Union
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
import attr
|
|
|
|
|
2023-05-23 14:24:13 -07:00
|
|
|
from ..models.point2d import Point2d
|
2023-04-27 13:59:37 -07:00
|
|
|
from ..types import UNSET, Unset
|
2023-05-23 14:24:13 -07:00
|
|
|
from .extrude import Extrude
|
|
|
|
from .line3d import Line3d
|
2023-04-27 13:59:37 -07:00
|
|
|
|
2023-05-23 14:24:13 -07:00
|
|
|
AddLine = Line3d
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
|
2023-05-23 14:24:13 -07:00
|
|
|
K = TypeVar("K", bound="SelectionClick")
|
|
|
|
|
2023-05-04 00:58:06 -07:00
|
|
|
|
2023-05-23 14:24:13 -07:00
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class SelectionClick:
|
|
|
|
at: Union[Unset, Point2d] = UNSET
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
2023-05-23 14:24:13 -07:00
|
|
|
if not isinstance(self.at, Unset):
|
|
|
|
at = self.at
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
2023-05-23 14:24:13 -07:00
|
|
|
if at is not UNSET:
|
|
|
|
field_dict["at"] = at
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
return field_dict
|
|
|
|
|
|
|
|
@classmethod
|
2023-05-23 14:24:13 -07:00
|
|
|
def from_dict(cls: Type[K], src_dict: Dict[str, Any]) -> K:
|
2023-04-27 13:59:37 -07:00
|
|
|
d = src_dict.copy()
|
2023-05-23 14:24:13 -07:00
|
|
|
_at = d.pop("at", UNSET)
|
|
|
|
at: Union[Unset, Point2d]
|
|
|
|
if isinstance(_at, Unset):
|
|
|
|
at = UNSET
|
|
|
|
else:
|
|
|
|
at = Point2d(_at)
|
|
|
|
|
|
|
|
selection_click = cls(
|
|
|
|
at=at,
|
2023-04-27 13:59:37 -07:00
|
|
|
)
|
|
|
|
|
2023-05-23 14:24:13 -07:00
|
|
|
selection_click.additional_properties = d
|
|
|
|
return selection_click
|
2023-04-27 13:59:37 -07:00
|
|
|
|
|
|
|
@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
|
2023-05-23 14:24:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
ModelingCmd = Union[AddLine, Extrude, SelectionClick]
|