Update api spec (#127)
* YOYO NEW API SPEC! * bump version Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * some fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes #128 Signed-off-by: Jess Frazelle <github@jessfraz.com> * mypy fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@ -2,19 +2,23 @@ from typing import Any, Dict, List, Type, TypeVar, Union
|
||||
|
||||
import attr
|
||||
|
||||
from ..models.storage import Storage
|
||||
from ..models.fbx_storage import FbxStorage
|
||||
from ..models.gltf_presentation import GltfPresentation
|
||||
from ..models.gltf_storage import GltfStorage
|
||||
from ..models.ply_storage import PlyStorage
|
||||
from ..models.stl_storage import StlStorage
|
||||
from ..models.system import System
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
OU = TypeVar("OU", bound="gltf")
|
||||
TZ = TypeVar("TZ", bound="fbx")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class gltf:
|
||||
"""glTF 2.0. We refer to this as glTF since that is how our customers refer to it, although by default it will be in binary format and thus technically (glb). If you prefer ascii output, you can set that option for the export.""" # noqa: E501
|
||||
class fbx:
|
||||
"""Autodesk Filmbox (FBX) format.""" # noqa: E501
|
||||
|
||||
storage: Union[Unset, Storage] = UNSET
|
||||
type: str = "gltf"
|
||||
storage: Union[Unset, FbxStorage] = UNSET
|
||||
type: str = "fbx"
|
||||
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
@ -33,10 +37,85 @@ class gltf:
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[OU], src_dict: Dict[str, Any]) -> OU:
|
||||
def from_dict(cls: Type[TZ], src_dict: Dict[str, Any]) -> TZ:
|
||||
d = src_dict.copy()
|
||||
_storage = d.pop("storage", UNSET)
|
||||
storage: Union[Unset, Storage]
|
||||
storage: Union[Unset, FbxStorage]
|
||||
if isinstance(_storage, Unset):
|
||||
storage = UNSET
|
||||
else:
|
||||
storage = _storage # type: ignore[arg-type]
|
||||
|
||||
type = d.pop("type", UNSET)
|
||||
|
||||
fbx = cls(
|
||||
storage=storage,
|
||||
type=type,
|
||||
)
|
||||
|
||||
fbx.additional_properties = d
|
||||
return fbx
|
||||
|
||||
@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
|
||||
|
||||
|
||||
AX = TypeVar("AX", bound="gltf")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class gltf:
|
||||
"""glTF 2.0. We refer to this as glTF since that is how our customers refer to it, although by default it will be in binary format and thus technically (glb). If you prefer ascii output, you can set that option for the export.""" # noqa: E501
|
||||
|
||||
presentation: Union[Unset, GltfPresentation] = UNSET
|
||||
storage: Union[Unset, GltfStorage] = UNSET
|
||||
type: str = "gltf"
|
||||
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
if not isinstance(self.presentation, Unset):
|
||||
presentation = self.presentation
|
||||
if not isinstance(self.storage, Unset):
|
||||
storage = self.storage
|
||||
type = self.type
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if presentation is not UNSET:
|
||||
field_dict["presentation"] = presentation
|
||||
if storage is not UNSET:
|
||||
field_dict["storage"] = storage
|
||||
field_dict["type"] = type
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[AX], src_dict: Dict[str, Any]) -> AX:
|
||||
d = src_dict.copy()
|
||||
_presentation = d.pop("presentation", UNSET)
|
||||
presentation: Union[Unset, GltfPresentation]
|
||||
if isinstance(_presentation, Unset):
|
||||
presentation = UNSET
|
||||
else:
|
||||
presentation = _presentation # type: ignore[arg-type]
|
||||
|
||||
_storage = d.pop("storage", UNSET)
|
||||
storage: Union[Unset, GltfStorage]
|
||||
if isinstance(_storage, Unset):
|
||||
storage = UNSET
|
||||
else:
|
||||
@ -45,6 +124,7 @@ class gltf:
|
||||
type = d.pop("type", UNSET)
|
||||
|
||||
gltf = cls(
|
||||
presentation=presentation,
|
||||
storage=storage,
|
||||
type=type,
|
||||
)
|
||||
@ -69,7 +149,7 @@ class gltf:
|
||||
return key in self.additional_properties
|
||||
|
||||
|
||||
KL = TypeVar("KL", bound="obj")
|
||||
RQ = TypeVar("RQ", bound="obj")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@ -96,7 +176,7 @@ class obj:
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[KL], src_dict: Dict[str, Any]) -> KL:
|
||||
def from_dict(cls: Type[RQ], src_dict: Dict[str, Any]) -> RQ:
|
||||
d = src_dict.copy()
|
||||
_coords = d.pop("coords", UNSET)
|
||||
coords: Union[Unset, System]
|
||||
@ -132,7 +212,7 @@ class obj:
|
||||
return key in self.additional_properties
|
||||
|
||||
|
||||
XI = TypeVar("XI", bound="ply")
|
||||
ZL = TypeVar("ZL", bound="ply")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@ -140,7 +220,7 @@ class ply:
|
||||
"""The PLY Polygon File Format.""" # noqa: E501
|
||||
|
||||
coords: Union[Unset, System] = UNSET
|
||||
storage: Union[Unset, Storage] = UNSET
|
||||
storage: Union[Unset, PlyStorage] = UNSET
|
||||
type: str = "ply"
|
||||
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
@ -164,7 +244,7 @@ class ply:
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[XI], src_dict: Dict[str, Any]) -> XI:
|
||||
def from_dict(cls: Type[ZL], src_dict: Dict[str, Any]) -> ZL:
|
||||
d = src_dict.copy()
|
||||
_coords = d.pop("coords", UNSET)
|
||||
coords: Union[Unset, System]
|
||||
@ -174,7 +254,7 @@ class ply:
|
||||
coords = _coords # type: ignore[arg-type]
|
||||
|
||||
_storage = d.pop("storage", UNSET)
|
||||
storage: Union[Unset, Storage]
|
||||
storage: Union[Unset, PlyStorage]
|
||||
if isinstance(_storage, Unset):
|
||||
storage = UNSET
|
||||
else:
|
||||
@ -208,7 +288,7 @@ class ply:
|
||||
return key in self.additional_properties
|
||||
|
||||
|
||||
PO = TypeVar("PO", bound="step")
|
||||
CM = TypeVar("CM", bound="step")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@ -235,7 +315,7 @@ class step:
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[PO], src_dict: Dict[str, Any]) -> PO:
|
||||
def from_dict(cls: Type[CM], src_dict: Dict[str, Any]) -> CM:
|
||||
d = src_dict.copy()
|
||||
_coords = d.pop("coords", UNSET)
|
||||
coords: Union[Unset, System]
|
||||
@ -271,7 +351,7 @@ class step:
|
||||
return key in self.additional_properties
|
||||
|
||||
|
||||
PS = TypeVar("PS", bound="stl")
|
||||
OS = TypeVar("OS", bound="stl")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@ -279,7 +359,7 @@ class stl:
|
||||
"""*ST**ereo**L**ithography format.""" # noqa: E501
|
||||
|
||||
coords: Union[Unset, System] = UNSET
|
||||
storage: Union[Unset, Storage] = UNSET
|
||||
storage: Union[Unset, StlStorage] = UNSET
|
||||
type: str = "stl"
|
||||
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
@ -303,7 +383,7 @@ class stl:
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[PS], src_dict: Dict[str, Any]) -> PS:
|
||||
def from_dict(cls: Type[OS], src_dict: Dict[str, Any]) -> OS:
|
||||
d = src_dict.copy()
|
||||
_coords = d.pop("coords", UNSET)
|
||||
coords: Union[Unset, System]
|
||||
@ -313,7 +393,7 @@ class stl:
|
||||
coords = _coords # type: ignore[arg-type]
|
||||
|
||||
_storage = d.pop("storage", UNSET)
|
||||
storage: Union[Unset, Storage]
|
||||
storage: Union[Unset, StlStorage]
|
||||
if isinstance(_storage, Unset):
|
||||
storage = UNSET
|
||||
else:
|
||||
@ -347,4 +427,4 @@ class stl:
|
||||
return key in self.additional_properties
|
||||
|
||||
|
||||
OutputFormat = Union[gltf, obj, ply, step, stl]
|
||||
OutputFormat = Union[fbx, gltf, obj, ply, step, stl]
|
||||
|
Reference in New Issue
Block a user