update kittycad.py

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2022-08-15 12:58:30 -07:00
parent dec4b2a6e3
commit 667ef08235
11 changed files with 673 additions and 19 deletions

View File

@ -962,10 +962,14 @@ def renderTypeToDict(
elif 'type' in property_schema['items']: elif 'type' in property_schema['items']:
if property_schema['items']['type'] == 'string': if property_schema['items']['type'] == 'string':
property_type = 'str' property_type = 'str'
elif property_schema['items']['type'] == 'number':
property_type = 'float'
elif property_schema['items']['type'] == 'array': elif property_schema['items']['type'] == 'array':
if 'items' in property_schema['items']: if 'items' in property_schema['items']:
if property_schema['items']['items']['type'] == 'string': if property_schema['items']['items']['type'] == 'string':
property_type = 'List[str]' property_type = 'List[str]'
elif property_schema['items']['items']['type'] == 'number':
property_type = 'List[float]'
else: else:
print(" property: ", property_schema) print(" property: ", property_schema)
raise Exception("Unknown property type") raise Exception("Unknown property type")
@ -1112,10 +1116,14 @@ def renderTypeInit(
elif 'type' in property_schema['items']: elif 'type' in property_schema['items']:
if property_schema['items']['type'] == 'string': if property_schema['items']['type'] == 'string':
property_type = 'str' property_type = 'str'
elif property_schema['items']['type'] == 'number':
property_type = 'float'
elif property_schema['items']['type'] == 'array': elif property_schema['items']['type'] == 'array':
if 'items' in property_schema['items']: if 'items' in property_schema['items']:
if property_schema['items']['items']['type'] == 'string': if property_schema['items']['items']['type'] == 'string':
property_type = 'List[str]' property_type = 'List[str]'
elif property_schema['items']['items']['type'] == 'number':
property_type = 'List[float]'
else: else:
print(" property: ", property_schema) print(" property: ", property_schema)
raise Exception("Unknown property type") raise Exception("Unknown property type")
@ -1255,10 +1263,14 @@ def renderTypeFromDict(
elif 'type' in property_schema['items']: elif 'type' in property_schema['items']:
if property_schema['items']['type'] == 'string': if property_schema['items']['type'] == 'string':
property_type = 'str' property_type = 'str'
elif property_schema['items']['type'] == 'number':
property_type = 'float'
elif property_schema['items']['type'] == 'array': elif property_schema['items']['type'] == 'array':
if 'items' in property_schema['items']: if 'items' in property_schema['items']:
if property_schema['items']['items']['type'] == 'string': if property_schema['items']['items']['type'] == 'string':
property_type = 'List[str]' property_type = 'List[str]'
elif property_schema['items']['items']['type'] == 'number':
property_type = 'List[float]'
else: else:
print(" property: ", property_schema) print(" property: ", property_schema)
raise Exception("Unknown property type") raise Exception("Unknown property type")

File diff suppressed because one or more lines are too long

View File

@ -4,9 +4,11 @@ import httpx
from ...client import Client from ...client import Client
from ...models.file_conversion import FileConversion from ...models.file_conversion import FileConversion
from ...models.file_center_of_mass import FileCenterOfMass
from ...models.file_mass import FileMass from ...models.file_mass import FileMass
from ...models.file_volume import FileVolume from ...models.file_volume import FileVolume
from ...models.file_density import FileDensity from ...models.file_density import FileDensity
from ...models.file_surface_area import FileSurfaceArea
from ...models.error import Error from ...models.error import Error
from ...types import Response from ...types import Response
@ -28,7 +30,7 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
if response.status_code == 200: if response.status_code == 200:
data = response.json() data = response.json()
try: try:
@ -38,6 +40,13 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
return option return option
except: except:
pass pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileCenterOfMass.from_dict(data)
return option
except:
pass
try: try:
if not isinstance(data, dict): if not isinstance(data, dict):
raise TypeError() raise TypeError()
@ -57,6 +66,13 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
raise TypeError() raise TypeError()
option = FileDensity.from_dict(data) option = FileDensity.from_dict(data)
return option return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileSurfaceArea.from_dict(data)
return option
except: except:
raise raise
if response.status_code == 400: if response.status_code == 400:
@ -68,7 +84,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
return None return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -81,7 +97,7 @@ def sync_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
@ -99,7 +115,7 @@ def sync(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async operation. """ Get the status and output of an async operation.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user. This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.
If the user is not authenticated to view the specified async operation, then it is not returned. If the user is not authenticated to view the specified async operation, then it is not returned.
@ -115,7 +131,7 @@ async def asyncio_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
@ -131,7 +147,7 @@ async def asyncio(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async operation. """ Get the status and output of an async operation.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user. This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.
If the user is not authenticated to view the specified async operation, then it is not returned. If the user is not authenticated to view the specified async operation, then it is not returned.

View File

@ -0,0 +1,131 @@
from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.file_center_of_mass import FileCenterOfMass
from ...models.error import Error
from ...models.file_source_format import FileSourceFormat
from ...types import Response
def _get_kwargs(
material_density: float,
src_format: FileSourceFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/center-of-mass?material_density={material_density}&src_format={src_format}".format(client.base_url, material_density=material_density, src_format=src_format)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileCenterOfMass, Error]]:
if response.status_code == 201:
response_201 = FileCenterOfMass.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileCenterOfMass, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
material_density: float,
src_format: FileSourceFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileCenterOfMass, Error]]:
kwargs = _get_kwargs(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
material_density: float,
src_format: FileSourceFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileCenterOfMass, Error]]:
""" Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
return sync_detailed(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
material_density: float,
src_format: FileSourceFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileCenterOfMass, Error]]:
kwargs = _get_kwargs(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
material_density: float,
src_format: FileSourceFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileCenterOfMass, Error]]:
""" Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
return (
await asyncio_detailed(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,122 @@
from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.file_surface_area import FileSurfaceArea
from ...models.error import Error
from ...models.file_source_format import FileSourceFormat
from ...types import Response
def _get_kwargs(
src_format: FileSourceFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/surface-area?src_format={src_format}".format(client.base_url, src_format=src_format)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileSurfaceArea, Error]]:
if response.status_code == 201:
response_201 = FileSurfaceArea.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileSurfaceArea, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
src_format: FileSourceFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
src_format: FileSourceFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileSurfaceArea, Error]]:
""" Get the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
return sync_detailed(
src_format=src_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
src_format: FileSourceFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
src_format: FileSourceFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileSurfaceArea, Error]]:
""" Get the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
return (
await asyncio_detailed(
src_format=src_format,
body=body,
client=client,
)
).parsed

View File

@ -4,9 +4,11 @@ import httpx
from ...client import Client from ...client import Client
from ...models.file_conversion import FileConversion from ...models.file_conversion import FileConversion
from ...models.file_center_of_mass import FileCenterOfMass
from ...models.file_mass import FileMass from ...models.file_mass import FileMass
from ...models.file_volume import FileVolume from ...models.file_volume import FileVolume
from ...models.file_density import FileDensity from ...models.file_density import FileDensity
from ...models.file_surface_area import FileSurfaceArea
from ...models.error import Error from ...models.error import Error
from ...types import Response from ...types import Response
@ -28,7 +30,7 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
if response.status_code == 200: if response.status_code == 200:
data = response.json() data = response.json()
try: try:
@ -38,6 +40,13 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
return option return option
except: except:
pass pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileCenterOfMass.from_dict(data)
return option
except:
pass
try: try:
if not isinstance(data, dict): if not isinstance(data, dict):
raise TypeError() raise TypeError()
@ -57,6 +66,13 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
raise TypeError() raise TypeError()
option = FileDensity.from_dict(data) option = FileDensity.from_dict(data)
return option return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileSurfaceArea.from_dict(data)
return option
except: except:
raise raise
if response.status_code == 400: if response.status_code == 400:
@ -68,7 +84,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
return None return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -81,7 +97,7 @@ def sync_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
@ -99,7 +115,7 @@ def sync(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async file conversion. """ Get the status and output of an async file conversion.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
If the user is not authenticated to view the specified file conversion, then it is not returned. If the user is not authenticated to view the specified file conversion, then it is not returned.
@ -115,7 +131,7 @@ async def asyncio_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
@ -131,7 +147,7 @@ async def asyncio(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async file conversion. """ Get the status and output of an async file conversion.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
If the user is not authenticated to view the specified file conversion, then it is not returned. If the user is not authenticated to view the specified file conversion, then it is not returned.

View File

@ -4,9 +4,11 @@ import httpx
from ...client import Client from ...client import Client
from ...models.file_conversion import FileConversion from ...models.file_conversion import FileConversion
from ...models.file_center_of_mass import FileCenterOfMass
from ...models.file_mass import FileMass from ...models.file_mass import FileMass
from ...models.file_volume import FileVolume from ...models.file_volume import FileVolume
from ...models.file_density import FileDensity from ...models.file_density import FileDensity
from ...models.file_surface_area import FileSurfaceArea
from ...models.error import Error from ...models.error import Error
from ...types import Response from ...types import Response
@ -28,7 +30,7 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
if response.status_code == 200: if response.status_code == 200:
data = response.json() data = response.json()
try: try:
@ -38,6 +40,13 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
return option return option
except: except:
pass pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileCenterOfMass.from_dict(data)
return option
except:
pass
try: try:
if not isinstance(data, dict): if not isinstance(data, dict):
raise TypeError() raise TypeError()
@ -57,6 +66,13 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
raise TypeError() raise TypeError()
option = FileDensity.from_dict(data) option = FileDensity.from_dict(data)
return option return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileSurfaceArea.from_dict(data)
return option
except: except:
raise raise
if response.status_code == 400: if response.status_code == 400:
@ -68,7 +84,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
return None return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -81,7 +97,7 @@ def sync_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
@ -99,7 +115,7 @@ def sync(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string. """ Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """ This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
@ -113,7 +129,7 @@ async def asyncio_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
@ -129,7 +145,7 @@ async def asyncio(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, FileDensity, Error]]: ) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string. """ Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """ This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """

View File

@ -35,11 +35,13 @@ from .error import Error
from .executor_metadata import ExecutorMetadata from .executor_metadata import ExecutorMetadata
from .extended_user import ExtendedUser from .extended_user import ExtendedUser
from .extended_user_results_page import ExtendedUserResultsPage from .extended_user_results_page import ExtendedUserResultsPage
from .file_center_of_mass import FileCenterOfMass
from .file_conversion import FileConversion from .file_conversion import FileConversion
from .file_density import FileDensity from .file_density import FileDensity
from .file_mass import FileMass from .file_mass import FileMass
from .file_output_format import FileOutputFormat from .file_output_format import FileOutputFormat
from .file_source_format import FileSourceFormat from .file_source_format import FileSourceFormat
from .file_surface_area import FileSurfaceArea
from .file_system_metadata import FileSystemMetadata from .file_system_metadata import FileSystemMetadata
from .file_volume import FileVolume from .file_volume import FileVolume
from .gateway import Gateway from .gateway import Gateway

View File

@ -4,8 +4,10 @@ from enum import Enum
class AsyncApiCallType(str, Enum): class AsyncApiCallType(str, Enum):
FILE_CONVERSION = 'FileConversion' FILE_CONVERSION = 'FileConversion'
FILE_VOLUME = 'FileVolume' FILE_VOLUME = 'FileVolume'
FILE_CENTER_OF_MASS = 'FileCenterOfMass'
FILE_MASS = 'FileMass' FILE_MASS = 'FileMass'
FILE_DENSITY = 'FileDensity' FILE_DENSITY = 'FileDensity'
FILE_SURFACE_AREA = 'FileSurfaceArea'
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -0,0 +1,173 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from dateutil.parser import isoparse
from ..models.uuid import Uuid
from ..models.file_source_format import FileSourceFormat
from ..models.api_call_status import ApiCallStatus
from ..types import UNSET, Unset
T = TypeVar("T", bound="FileCenterOfMass")
@attr.s(auto_attribs=True)
class FileCenterOfMass:
""" """
center_of_mass: Union[Unset, List[float]] = UNSET
completed_at: Union[Unset, datetime.datetime] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
error: Union[Unset, str] = UNSET
id: Union[Unset, str] = UNSET
material_density: Union[Unset, float] = UNSET
src_format: Union[Unset, FileSourceFormat] = UNSET
started_at: Union[Unset, datetime.datetime] = UNSET
status: Union[Unset, ApiCallStatus] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
user_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
center_of_mass: Union[Unset, List[float]] = UNSET
if not isinstance(self.center_of_mass, Unset):
center_of_mass = self.center_of_mass
completed_at: Union[Unset, str] = UNSET
if not isinstance(self.completed_at, Unset):
completed_at = self.completed_at.isoformat()
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
error = self.error
id = self.id
material_density = self.material_density
src_format: Union[Unset, str] = UNSET
if not isinstance(self.src_format, Unset):
src_format = self.src_format.value
started_at: Union[Unset, str] = UNSET
if not isinstance(self.started_at, Unset):
started_at = self.started_at.isoformat()
status: Union[Unset, str] = UNSET
if not isinstance(self.status, Unset):
status = self.status.value
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
user_id = self.user_id
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if center_of_mass is not UNSET:
field_dict['center_of_mass'] = center_of_mass
if completed_at is not UNSET:
field_dict['completed_at'] = completed_at
if created_at is not UNSET:
field_dict['created_at'] = created_at
if error is not UNSET:
field_dict['error'] = error
if id is not UNSET:
field_dict['id'] = id
if material_density is not UNSET:
field_dict['material_density'] = material_density
if src_format is not UNSET:
field_dict['src_format'] = src_format
if started_at is not UNSET:
field_dict['started_at'] = started_at
if status is not UNSET:
field_dict['status'] = status
if updated_at is not UNSET:
field_dict['updated_at'] = updated_at
if user_id is not UNSET:
field_dict['user_id'] = user_id
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
center_of_mass = cast(List[float], d.pop("center_of_mass", UNSET))
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
if isinstance(_completed_at, Unset):
completed_at = UNSET
else:
completed_at = isoparse(_completed_at)
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
material_density = d.pop("material_density", UNSET)
_src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, FileSourceFormat]
if isinstance(_src_format, Unset):
src_format = UNSET
else:
src_format = FileSourceFormat(_src_format)
_started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime]
if isinstance(_started_at, Unset):
started_at = UNSET
else:
started_at = isoparse(_started_at)
_status = d.pop("status", UNSET)
status: Union[Unset, ApiCallStatus]
if isinstance(_status, Unset):
status = UNSET
else:
status = ApiCallStatus(_status)
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]
if isinstance(_updated_at, Unset):
updated_at = UNSET
else:
updated_at = isoparse(_updated_at)
user_id = d.pop("user_id", UNSET)
file_center_of_mass = cls(
center_of_mass=center_of_mass,
completed_at=completed_at,
created_at=created_at,
error=error,
id=id,
material_density=material_density,
src_format=src_format,
started_at=started_at,
status=status,
updated_at=updated_at,
user_id=user_id,
)
file_center_of_mass.additional_properties = d
return file_center_of_mass
@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

View File

@ -0,0 +1,164 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from dateutil.parser import isoparse
from ..models.uuid import Uuid
from ..models.file_source_format import FileSourceFormat
from ..models.api_call_status import ApiCallStatus
from ..types import UNSET, Unset
T = TypeVar("T", bound="FileSurfaceArea")
@attr.s(auto_attribs=True)
class FileSurfaceArea:
""" """
completed_at: Union[Unset, datetime.datetime] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
error: Union[Unset, str] = UNSET
id: Union[Unset, str] = UNSET
src_format: Union[Unset, FileSourceFormat] = UNSET
started_at: Union[Unset, datetime.datetime] = UNSET
status: Union[Unset, ApiCallStatus] = UNSET
surface_area: Union[Unset, float] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
user_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
completed_at: Union[Unset, str] = UNSET
if not isinstance(self.completed_at, Unset):
completed_at = self.completed_at.isoformat()
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
error = self.error
id = self.id
src_format: Union[Unset, str] = UNSET
if not isinstance(self.src_format, Unset):
src_format = self.src_format.value
started_at: Union[Unset, str] = UNSET
if not isinstance(self.started_at, Unset):
started_at = self.started_at.isoformat()
status: Union[Unset, str] = UNSET
if not isinstance(self.status, Unset):
status = self.status.value
surface_area = self.surface_area
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
user_id = self.user_id
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if completed_at is not UNSET:
field_dict['completed_at'] = completed_at
if created_at is not UNSET:
field_dict['created_at'] = created_at
if error is not UNSET:
field_dict['error'] = error
if id is not UNSET:
field_dict['id'] = id
if src_format is not UNSET:
field_dict['src_format'] = src_format
if started_at is not UNSET:
field_dict['started_at'] = started_at
if status is not UNSET:
field_dict['status'] = status
if surface_area is not UNSET:
field_dict['surface_area'] = surface_area
if updated_at is not UNSET:
field_dict['updated_at'] = updated_at
if user_id is not UNSET:
field_dict['user_id'] = user_id
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
if isinstance(_completed_at, Unset):
completed_at = UNSET
else:
completed_at = isoparse(_completed_at)
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, FileSourceFormat]
if isinstance(_src_format, Unset):
src_format = UNSET
else:
src_format = FileSourceFormat(_src_format)
_started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime]
if isinstance(_started_at, Unset):
started_at = UNSET
else:
started_at = isoparse(_started_at)
_status = d.pop("status", UNSET)
status: Union[Unset, ApiCallStatus]
if isinstance(_status, Unset):
status = UNSET
else:
status = ApiCallStatus(_status)
surface_area = d.pop("surface_area", UNSET)
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]
if isinstance(_updated_at, Unset):
updated_at = UNSET
else:
updated_at = isoparse(_updated_at)
user_id = d.pop("user_id", UNSET)
file_surface_area = cls(
completed_at=completed_at,
created_at=created_at,
error=error,
id=id,
src_format=src_format,
started_at=started_at,
status=status,
surface_area=surface_area,
updated_at=updated_at,
user_id=user_id,
)
file_surface_area.additional_properties = d
return file_surface_area
@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