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:
@ -5,6 +5,7 @@ import attr
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..models.base64data import Base64Data
|
||||
from ..models.file_export_format import FileExportFormat
|
||||
from ..models.file_import_format import FileImportFormat
|
||||
from ..models.input_format import InputFormat
|
||||
@ -18,7 +19,7 @@ from ..models.unit_volume import UnitVolume
|
||||
from ..models.uuid import Uuid
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
MN = TypeVar("MN", bound="file_conversion")
|
||||
JV = TypeVar("JV", bound="file_conversion")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@ -29,10 +30,10 @@ class file_conversion:
|
||||
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||
error: Union[Unset, str] = UNSET
|
||||
id: Union[Unset, str] = UNSET
|
||||
output: Union[Unset, str] = UNSET
|
||||
output: Union[Unset, Base64Data] = UNSET
|
||||
output_format: Union[Unset, FileExportFormat] = UNSET
|
||||
output_format_options: Union[Unset, OutputFormat] = UNSET
|
||||
outputs: Union[Unset, Any] = UNSET
|
||||
outputs: Union[Unset, Dict[str, Base64Data]] = UNSET
|
||||
src_format: Union[Unset, FileImportFormat] = UNSET
|
||||
src_format_options: Union[Unset, InputFormat] = UNSET
|
||||
started_at: Union[Unset, datetime.datetime] = UNSET
|
||||
@ -52,12 +53,19 @@ class file_conversion:
|
||||
created_at = self.created_at.isoformat()
|
||||
error = self.error
|
||||
id = self.id
|
||||
output = self.output
|
||||
output: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.output, Unset):
|
||||
output = self.output.get_encoded()
|
||||
if not isinstance(self.output_format, Unset):
|
||||
output_format = self.output_format
|
||||
if not isinstance(self.output_format_options, Unset):
|
||||
output_format_options = self.output_format_options
|
||||
outputs = self.outputs
|
||||
outputs: Union[Unset, Dict[str, str]] = UNSET
|
||||
if not isinstance(self.outputs, Unset):
|
||||
new_dict: Dict[str, str] = {}
|
||||
for key, value in self.outputs.items():
|
||||
new_dict[key] = value.get_encoded()
|
||||
outputs = new_dict
|
||||
if not isinstance(self.src_format, Unset):
|
||||
src_format = self.src_format
|
||||
if not isinstance(self.src_format_options, Unset):
|
||||
@ -109,7 +117,7 @@ class file_conversion:
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[MN], src_dict: Dict[str, Any]) -> MN:
|
||||
def from_dict(cls: Type[JV], src_dict: Dict[str, Any]) -> JV:
|
||||
d = src_dict.copy()
|
||||
_completed_at = d.pop("completed_at", UNSET)
|
||||
completed_at: Union[Unset, datetime.datetime]
|
||||
@ -134,7 +142,12 @@ class file_conversion:
|
||||
else:
|
||||
id = _id # type: ignore[arg-type]
|
||||
|
||||
output = d.pop("output", UNSET)
|
||||
_output = d.pop("output", UNSET)
|
||||
output: Union[Unset, Base64Data]
|
||||
if isinstance(_output, Unset):
|
||||
output = UNSET
|
||||
else:
|
||||
output = Base64Data(bytes(_output, "utf-8"))
|
||||
|
||||
_output_format = d.pop("output_format", UNSET)
|
||||
output_format: Union[Unset, FileExportFormat]
|
||||
@ -150,7 +163,15 @@ class file_conversion:
|
||||
else:
|
||||
output_format_options = _output_format_options # type: ignore[arg-type]
|
||||
|
||||
outputs = d.pop("outputs", UNSET)
|
||||
_outputs = d.pop("outputs", UNSET)
|
||||
if isinstance(_outputs, Unset):
|
||||
outputs = UNSET
|
||||
else:
|
||||
new_map: Dict[str, Base64Data] = {}
|
||||
for k, v in _outputs.items():
|
||||
new_map[k] = Base64Data(bytes(v, "utf-8"))
|
||||
outputs = new_map # type: ignore
|
||||
|
||||
_src_format = d.pop("src_format", UNSET)
|
||||
src_format: Union[Unset, FileImportFormat]
|
||||
if isinstance(_src_format, Unset):
|
||||
@ -228,7 +249,7 @@ class file_conversion:
|
||||
return key in self.additional_properties
|
||||
|
||||
|
||||
JV = TypeVar("JV", bound="file_center_of_mass")
|
||||
IO = TypeVar("IO", bound="file_center_of_mass")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@ -306,7 +327,7 @@ class file_center_of_mass:
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[JV], src_dict: Dict[str, Any]) -> JV:
|
||||
def from_dict(cls: Type[IO], src_dict: Dict[str, Any]) -> IO:
|
||||
d = src_dict.copy()
|
||||
_center_of_mass = d.pop("center_of_mass", UNSET)
|
||||
center_of_mass: Union[Unset, Point3d]
|
||||
@ -412,7 +433,7 @@ class file_center_of_mass:
|
||||
return key in self.additional_properties
|
||||
|
||||
|
||||
IO = TypeVar("IO", bound="file_mass")
|
||||
FV = TypeVar("FV", bound="file_mass")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@ -498,7 +519,7 @@ class file_mass:
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[IO], src_dict: Dict[str, Any]) -> IO:
|
||||
def from_dict(cls: Type[FV], src_dict: Dict[str, Any]) -> FV:
|
||||
d = src_dict.copy()
|
||||
_completed_at = d.pop("completed_at", UNSET)
|
||||
completed_at: Union[Unset, datetime.datetime]
|
||||
@ -610,7 +631,7 @@ class file_mass:
|
||||
return key in self.additional_properties
|
||||
|
||||
|
||||
FV = TypeVar("FV", bound="file_volume")
|
||||
LE = TypeVar("LE", bound="file_volume")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@ -687,7 +708,7 @@ class file_volume:
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[FV], src_dict: Dict[str, Any]) -> FV:
|
||||
def from_dict(cls: Type[LE], src_dict: Dict[str, Any]) -> LE:
|
||||
d = src_dict.copy()
|
||||
_completed_at = d.pop("completed_at", UNSET)
|
||||
completed_at: Union[Unset, datetime.datetime]
|
||||
@ -788,7 +809,7 @@ class file_volume:
|
||||
return key in self.additional_properties
|
||||
|
||||
|
||||
LE = TypeVar("LE", bound="file_density")
|
||||
OY = TypeVar("OY", bound="file_density")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@ -874,7 +895,7 @@ class file_density:
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[LE], src_dict: Dict[str, Any]) -> LE:
|
||||
def from_dict(cls: Type[OY], src_dict: Dict[str, Any]) -> OY:
|
||||
d = src_dict.copy()
|
||||
_completed_at = d.pop("completed_at", UNSET)
|
||||
completed_at: Union[Unset, datetime.datetime]
|
||||
@ -986,7 +1007,7 @@ class file_density:
|
||||
return key in self.additional_properties
|
||||
|
||||
|
||||
OY = TypeVar("OY", bound="file_surface_area")
|
||||
HO = TypeVar("HO", bound="file_surface_area")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@ -1063,7 +1084,7 @@ class file_surface_area:
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[OY], src_dict: Dict[str, Any]) -> OY:
|
||||
def from_dict(cls: Type[HO], src_dict: Dict[str, Any]) -> HO:
|
||||
d = src_dict.copy()
|
||||
_completed_at = d.pop("completed_at", UNSET)
|
||||
completed_at: Union[Unset, datetime.datetime]
|
||||
|
Reference in New Issue
Block a user