I have generated the latest API!
This commit is contained in:
File diff suppressed because one or more lines are too long
129
kittycad/api/unit/get_metric_power_cubed_unit_conversion.py
Normal file
129
kittycad/api/unit/get_metric_power_cubed_unit_conversion.py
Normal file
@ -0,0 +1,129 @@
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.unit_metric_power_cubed_conversion import UnitMetricPowerCubedConversion
|
||||
from ...models.error import Error
|
||||
from ...models.unit_metric_power import UnitMetricPower
|
||||
from ...models.unit_metric_power import UnitMetricPower
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/unit/conversion/metric/cubed/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
|
||||
|
||||
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(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitMetricPowerCubedConversion, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = UnitMetricPowerCubedConversion.from_dict(response.json())
|
||||
return response_200
|
||||
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, UnitMetricPowerCubedConversion, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, UnitMetricPowerCubedConversion, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, UnitMetricPowerCubedConversion, Error]]:
|
||||
""" Convert a metric cubed unit value to another metric cubed unit value. This is a nice endpoint to use for helper functions. """
|
||||
|
||||
return sync_detailed(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, UnitMetricPowerCubedConversion, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, UnitMetricPowerCubedConversion, Error]]:
|
||||
""" Convert a metric cubed unit value to another metric cubed unit value. This is a nice endpoint to use for helper functions. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
129
kittycad/api/unit/get_metric_power_squared_unit_conversion.py
Normal file
129
kittycad/api/unit/get_metric_power_squared_unit_conversion.py
Normal file
@ -0,0 +1,129 @@
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.unit_metric_power_squared_conversion import UnitMetricPowerSquaredConversion
|
||||
from ...models.error import Error
|
||||
from ...models.unit_metric_power import UnitMetricPower
|
||||
from ...models.unit_metric_power import UnitMetricPower
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/unit/conversion/metric/squared/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
|
||||
|
||||
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(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = UnitMetricPowerSquaredConversion.from_dict(response.json())
|
||||
return response_200
|
||||
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, UnitMetricPowerSquaredConversion, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
|
||||
""" Convert a metric squared unit value to another metric squared unit value. This is a nice endpoint to use for helper functions. """
|
||||
|
||||
return sync_detailed(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
|
||||
""" Convert a metric squared unit value to another metric squared unit value. This is a nice endpoint to use for helper functions. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -3,20 +3,20 @@ from typing import Any, Dict, Optional, Union, cast
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.unit_metric_conversion import UnitMetricConversion
|
||||
from ...models.unit_metric_power_conversion import UnitMetricPowerConversion
|
||||
from ...models.error import Error
|
||||
from ...models.unit_metric_format import UnitMetricFormat
|
||||
from ...models.unit_metric_format import UnitMetricFormat
|
||||
from ...models.unit_metric_power import UnitMetricPower
|
||||
from ...models.unit_metric_power import UnitMetricPower
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
output_format: UnitMetricFormat,
|
||||
src_format: UnitMetricFormat,
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/unit/conversion/metric/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
|
||||
url = "{}/unit/conversion/metric/power/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
@ -29,9 +29,9 @@ def _get_kwargs(
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitMetricConversion, Error]]:
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitMetricPowerConversion, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = UnitMetricConversion.from_dict(response.json())
|
||||
response_200 = UnitMetricPowerConversion.from_dict(response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error.from_dict(response.json())
|
||||
@ -42,7 +42,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitMetr
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitMetricConversion, Error]]:
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitMetricPowerConversion, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
@ -52,12 +52,12 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitMetr
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
output_format: UnitMetricFormat,
|
||||
src_format: UnitMetricFormat,
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, UnitMetricConversion, Error]]:
|
||||
) -> Response[Union[Any, UnitMetricPowerConversion, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
@ -74,12 +74,12 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
output_format: UnitMetricFormat,
|
||||
src_format: UnitMetricFormat,
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, UnitMetricConversion, Error]]:
|
||||
) -> Optional[Union[Any, UnitMetricPowerConversion, Error]]:
|
||||
""" Convert a metric unit value to another metric unit value. This is a nice endpoint to use for helper functions. """
|
||||
|
||||
return sync_detailed(
|
||||
@ -91,12 +91,12 @@ def sync(
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
output_format: UnitMetricFormat,
|
||||
src_format: UnitMetricFormat,
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, UnitMetricConversion, Error]]:
|
||||
) -> Response[Union[Any, UnitMetricPowerConversion, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
@ -111,12 +111,12 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
output_format: UnitMetricFormat,
|
||||
src_format: UnitMetricFormat,
|
||||
output_format: UnitMetricPower,
|
||||
src_format: UnitMetricPower,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, UnitMetricConversion, Error]]:
|
||||
) -> Optional[Union[Any, UnitMetricPowerConversion, Error]]:
|
||||
""" Convert a metric unit value to another metric unit value. This is a nice endpoint to use for helper functions. """
|
||||
|
||||
return (
|
@ -106,8 +106,10 @@ from .unit_magnetic_flux_conversion import UnitMagneticFluxConversion
|
||||
from .unit_magnetic_flux_format import UnitMagneticFluxFormat
|
||||
from .unit_mass_conversion import UnitMassConversion
|
||||
from .unit_mass_format import UnitMassFormat
|
||||
from .unit_metric_conversion import UnitMetricConversion
|
||||
from .unit_metric_format import UnitMetricFormat
|
||||
from .unit_metric_power import UnitMetricPower
|
||||
from .unit_metric_power_conversion import UnitMetricPowerConversion
|
||||
from .unit_metric_power_cubed_conversion import UnitMetricPowerCubedConversion
|
||||
from .unit_metric_power_squared_conversion import UnitMetricPowerSquaredConversion
|
||||
from .unit_power_conversion import UnitPowerConversion
|
||||
from .unit_power_format import UnitPowerFormat
|
||||
from .unit_pressure_conversion import UnitPressureConversion
|
||||
|
@ -21,6 +21,7 @@ class ApiCallWithPrice:
|
||||
endpoint: Union[Unset, str] = UNSET
|
||||
id: Union[Unset, str] = UNSET
|
||||
ip_address: Union[Unset, str] = UNSET
|
||||
litterbox: Union[Unset, bool] = False
|
||||
method: Union[Unset, Method] = UNSET
|
||||
minutes: Union[Unset, int] = UNSET
|
||||
origin: Union[Unset, str] = UNSET
|
||||
@ -50,6 +51,7 @@ class ApiCallWithPrice:
|
||||
endpoint = self.endpoint
|
||||
id = self.id
|
||||
ip_address = self.ip_address
|
||||
litterbox = self.litterbox
|
||||
method: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.method, Unset):
|
||||
method = self.method.value
|
||||
@ -88,6 +90,8 @@ class ApiCallWithPrice:
|
||||
field_dict['id'] = id
|
||||
if ip_address is not UNSET:
|
||||
field_dict['ip_address'] = ip_address
|
||||
if litterbox is not UNSET:
|
||||
field_dict['litterbox'] = litterbox
|
||||
if method is not UNSET:
|
||||
field_dict['method'] = method
|
||||
if minutes is not UNSET:
|
||||
@ -146,6 +150,8 @@ class ApiCallWithPrice:
|
||||
|
||||
ip_address = d.pop("ip_address", UNSET)
|
||||
|
||||
litterbox = d.pop("litterbox", UNSET)
|
||||
|
||||
_method = d.pop("method", UNSET)
|
||||
method: Union[Unset, Method]
|
||||
if isinstance(_method, Unset):
|
||||
@ -197,6 +203,7 @@ class ApiCallWithPrice:
|
||||
endpoint=endpoint,
|
||||
id=id,
|
||||
ip_address=ip_address,
|
||||
litterbox=litterbox,
|
||||
method=method,
|
||||
minutes=minutes,
|
||||
origin=origin,
|
||||
|
@ -2,7 +2,10 @@ from enum import Enum
|
||||
|
||||
|
||||
class UnitLengthFormat(str, Enum):
|
||||
MILLIMETER = 'millimeter'
|
||||
CENTIMETER = 'centimeter'
|
||||
METER = 'meter'
|
||||
KILOMTER = 'kilomter'
|
||||
FOOT = 'foot'
|
||||
INCH = 'inch'
|
||||
MILE = 'mile'
|
||||
|
@ -3,6 +3,7 @@ from enum import Enum
|
||||
|
||||
class UnitMassFormat(str, Enum):
|
||||
GRAM = 'gram'
|
||||
KILOGRAM = 'kilogram'
|
||||
METRIC_TON = 'metric_ton'
|
||||
POUND = 'pound'
|
||||
LONG_TON = 'long_ton'
|
||||
|
@ -1,7 +1,7 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class UnitMetricFormat(str, Enum):
|
||||
class UnitMetricPower(str, Enum):
|
||||
ATTO = 'atto'
|
||||
FEMTO = 'femto'
|
||||
PICO = 'pico'
|
@ -5,15 +5,15 @@ import attr
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..models.uuid import Uuid
|
||||
from ..models.unit_metric_format import UnitMetricFormat
|
||||
from ..models.unit_metric_power import UnitMetricPower
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="UnitMetricConversion")
|
||||
T = TypeVar("T", bound="UnitMetricPowerConversion")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class UnitMetricConversion:
|
||||
class UnitMetricPowerConversion:
|
||||
""" """
|
||||
completed_at: Union[Unset, datetime.datetime] = UNSET
|
||||
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||
@ -21,8 +21,8 @@ class UnitMetricConversion:
|
||||
id: Union[Unset, str] = UNSET
|
||||
input: Union[Unset, float] = UNSET
|
||||
output: Union[Unset, float] = UNSET
|
||||
output_format: Union[Unset, UnitMetricFormat] = UNSET
|
||||
src_format: Union[Unset, UnitMetricFormat] = UNSET
|
||||
output_format: Union[Unset, UnitMetricPower] = UNSET
|
||||
src_format: Union[Unset, UnitMetricPower] = UNSET
|
||||
started_at: Union[Unset, datetime.datetime] = UNSET
|
||||
status: Union[Unset, ApiCallStatus] = UNSET
|
||||
updated_at: Union[Unset, datetime.datetime] = UNSET
|
||||
@ -114,18 +114,18 @@ class UnitMetricConversion:
|
||||
output = d.pop("output", UNSET)
|
||||
|
||||
_output_format = d.pop("output_format", UNSET)
|
||||
output_format: Union[Unset, UnitMetricFormat]
|
||||
output_format: Union[Unset, UnitMetricPower]
|
||||
if isinstance(_output_format, Unset):
|
||||
output_format = UNSET
|
||||
else:
|
||||
output_format = UnitMetricFormat(_output_format)
|
||||
output_format = UnitMetricPower(_output_format)
|
||||
|
||||
_src_format = d.pop("src_format", UNSET)
|
||||
src_format: Union[Unset, UnitMetricFormat]
|
||||
src_format: Union[Unset, UnitMetricPower]
|
||||
if isinstance(_src_format, Unset):
|
||||
src_format = UNSET
|
||||
else:
|
||||
src_format = UnitMetricFormat(_src_format)
|
||||
src_format = UnitMetricPower(_src_format)
|
||||
|
||||
_started_at = d.pop("started_at", UNSET)
|
||||
started_at: Union[Unset, datetime.datetime]
|
||||
@ -150,7 +150,7 @@ class UnitMetricConversion:
|
||||
|
||||
user_id = d.pop("user_id", UNSET)
|
||||
|
||||
unit_metric_conversion = cls(
|
||||
unit_metric_power_conversion = cls(
|
||||
completed_at=completed_at,
|
||||
created_at=created_at,
|
||||
error=error,
|
||||
@ -165,8 +165,8 @@ class UnitMetricConversion:
|
||||
user_id=user_id,
|
||||
)
|
||||
|
||||
unit_metric_conversion.additional_properties = d
|
||||
return unit_metric_conversion
|
||||
unit_metric_power_conversion.additional_properties = d
|
||||
return unit_metric_power_conversion
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> List[str]:
|
185
kittycad/models/unit_metric_power_cubed_conversion.py
Normal file
185
kittycad/models/unit_metric_power_cubed_conversion.py
Normal file
@ -0,0 +1,185 @@
|
||||
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.unit_metric_power import UnitMetricPower
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="UnitMetricPowerCubedConversion")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class UnitMetricPowerCubedConversion:
|
||||
""" """
|
||||
completed_at: Union[Unset, datetime.datetime] = UNSET
|
||||
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||
error: Union[Unset, str] = UNSET
|
||||
id: Union[Unset, str] = UNSET
|
||||
input: Union[Unset, float] = UNSET
|
||||
output: Union[Unset, float] = UNSET
|
||||
output_format: Union[Unset, UnitMetricPower] = UNSET
|
||||
src_format: Union[Unset, UnitMetricPower] = 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]:
|
||||
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
|
||||
input = self.input
|
||||
output = self.output
|
||||
output_format: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.output_format, Unset):
|
||||
output_format = self.output_format.value
|
||||
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 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 input is not UNSET:
|
||||
field_dict['input'] = input
|
||||
if output is not UNSET:
|
||||
field_dict['output'] = output
|
||||
if output_format is not UNSET:
|
||||
field_dict['output_format'] = output_format
|
||||
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()
|
||||
_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)
|
||||
|
||||
input = d.pop("input", UNSET)
|
||||
|
||||
output = d.pop("output", UNSET)
|
||||
|
||||
_output_format = d.pop("output_format", UNSET)
|
||||
output_format: Union[Unset, UnitMetricPower]
|
||||
if isinstance(_output_format, Unset):
|
||||
output_format = UNSET
|
||||
else:
|
||||
output_format = UnitMetricPower(_output_format)
|
||||
|
||||
_src_format = d.pop("src_format", UNSET)
|
||||
src_format: Union[Unset, UnitMetricPower]
|
||||
if isinstance(_src_format, Unset):
|
||||
src_format = UNSET
|
||||
else:
|
||||
src_format = UnitMetricPower(_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)
|
||||
|
||||
unit_metric_power_cubed_conversion = cls(
|
||||
completed_at=completed_at,
|
||||
created_at=created_at,
|
||||
error=error,
|
||||
id=id,
|
||||
input=input,
|
||||
output=output,
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
started_at=started_at,
|
||||
status=status,
|
||||
updated_at=updated_at,
|
||||
user_id=user_id,
|
||||
)
|
||||
|
||||
unit_metric_power_cubed_conversion.additional_properties = d
|
||||
return unit_metric_power_cubed_conversion
|
||||
|
||||
@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
|
185
kittycad/models/unit_metric_power_squared_conversion.py
Normal file
185
kittycad/models/unit_metric_power_squared_conversion.py
Normal file
@ -0,0 +1,185 @@
|
||||
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.unit_metric_power import UnitMetricPower
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="UnitMetricPowerSquaredConversion")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class UnitMetricPowerSquaredConversion:
|
||||
""" """
|
||||
completed_at: Union[Unset, datetime.datetime] = UNSET
|
||||
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||
error: Union[Unset, str] = UNSET
|
||||
id: Union[Unset, str] = UNSET
|
||||
input: Union[Unset, float] = UNSET
|
||||
output: Union[Unset, float] = UNSET
|
||||
output_format: Union[Unset, UnitMetricPower] = UNSET
|
||||
src_format: Union[Unset, UnitMetricPower] = 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]:
|
||||
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
|
||||
input = self.input
|
||||
output = self.output
|
||||
output_format: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.output_format, Unset):
|
||||
output_format = self.output_format.value
|
||||
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 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 input is not UNSET:
|
||||
field_dict['input'] = input
|
||||
if output is not UNSET:
|
||||
field_dict['output'] = output
|
||||
if output_format is not UNSET:
|
||||
field_dict['output_format'] = output_format
|
||||
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()
|
||||
_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)
|
||||
|
||||
input = d.pop("input", UNSET)
|
||||
|
||||
output = d.pop("output", UNSET)
|
||||
|
||||
_output_format = d.pop("output_format", UNSET)
|
||||
output_format: Union[Unset, UnitMetricPower]
|
||||
if isinstance(_output_format, Unset):
|
||||
output_format = UNSET
|
||||
else:
|
||||
output_format = UnitMetricPower(_output_format)
|
||||
|
||||
_src_format = d.pop("src_format", UNSET)
|
||||
src_format: Union[Unset, UnitMetricPower]
|
||||
if isinstance(_src_format, Unset):
|
||||
src_format = UNSET
|
||||
else:
|
||||
src_format = UnitMetricPower(_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)
|
||||
|
||||
unit_metric_power_squared_conversion = cls(
|
||||
completed_at=completed_at,
|
||||
created_at=created_at,
|
||||
error=error,
|
||||
id=id,
|
||||
input=input,
|
||||
output=output,
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
started_at=started_at,
|
||||
status=status,
|
||||
updated_at=updated_at,
|
||||
user_id=user_id,
|
||||
)
|
||||
|
||||
unit_metric_power_squared_conversion.additional_properties = d
|
||||
return unit_metric_power_squared_conversion
|
||||
|
||||
@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
|
@ -2,8 +2,9 @@ from enum import Enum
|
||||
|
||||
|
||||
class UnitVolumeFormat(str, Enum):
|
||||
CUBIC_METER = 'cubic_meter'
|
||||
CUBIC_MILLIMETER = 'cubic_millimeter'
|
||||
CUBIC_CENTIMETER = 'cubic_centimeter'
|
||||
CUBIC_METER = 'cubic_meter'
|
||||
CUBIC_KILOMETER = 'cubic_kilometer'
|
||||
LITER = 'liter'
|
||||
CUBIC_FOOT = 'cubic_foot'
|
||||
|
Reference in New Issue
Block a user