Update api spec (#93)

* YOYO NEW API SPEC!

* update

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* I have generated the latest API!

---------

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:
Jess Frazelle
2023-05-23 14:24:13 -07:00
committed by GitHub
parent 42f173783f
commit c111c3813f
105 changed files with 2109 additions and 1155 deletions

View File

@ -269,7 +269,11 @@ def generateTypeAndExamplePython(
) = generateTypeAndExamplePython("", prop, data, None)
example_imports = example_imports + prop_imports
parameter_example = parameter_example + (
"\n" + property_name + "=" + prop_example + ",\n"
"\n"
+ clean_parameter_name(property_name)
+ "="
+ prop_example
+ ",\n"
)
parameter_example = parameter_example + ")"
@ -298,6 +302,8 @@ def generateTypeAndExamplePython(
break
return generateTypeAndExamplePython(name, schema["oneOf"][0], data, None)
elif "allOf" in schema and len(schema["allOf"]) == 1:
return generateTypeAndExamplePython(name, schema["allOf"][0], data, None)
elif "$ref" in schema:
parameter_type = schema["$ref"].replace("#/components/schemas/", "")
# Get the schema for the reference.
@ -381,14 +387,17 @@ from kittycad.types import Response
if "nullable" in parameter["schema"] and parameter["schema"]["nullable"]:
parameter_type = "Optional[" + parameter_type + "]"
optional_args.append(
camel_to_snake(parameter_name)
clean_parameter_name(parameter_name)
+ "= None, # "
+ parameter_type
+ "\n"
)
else:
params_str += (
camel_to_snake(parameter_name) + "=" + parameter_example + ",\n"
clean_parameter_name(parameter_name)
+ "="
+ parameter_example
+ ",\n"
)
for optional_arg in optional_args:
@ -429,7 +438,9 @@ from kittycad.types import Response
+ endpoint_ref.replace("List[", "").replace("]", "")
+ "\n"
)
example_imports = example_imports + "from typing import Union, Any, Optional\n"
example_imports = (
example_imports + "from typing import Union, Any, Optional, List\n"
)
example_variable = "result: " + response_type + " = "
example_imports = example_imports + "from kittycad.types import Response\n"
@ -638,7 +649,7 @@ async def test_"""
formatTemplate = (
formatTemplate
+ ", "
+ parameter_name
+ clean_parameter_name(parameter_name)
+ "="
+ camel_to_snake(parameter_name)
)
@ -894,7 +905,7 @@ async def test_"""
f.write("\tkwargs = _get_kwargs(\n")
params = get_function_parameters(endpoint, request_body_type)
for param in params:
f.write("\t\t" + param + "=" + param + ",\n")
f.write("\t\t" + clean_parameter_name(param) + "=" + param + ",\n")
f.write("\t\tclient=client,\n")
f.write("\t)\n")
f.write("\n")
@ -973,7 +984,7 @@ async def test_"""
f.write("\treturn sync_detailed(\n")
params = get_function_parameters(endpoint, request_body_type)
for param in params:
f.write("\t\t" + param + "=" + param + ",\n")
f.write("\t\t" + clean_parameter_name(param) + "=" + param + ",\n")
f.write("\t\tclient=client,\n")
f.write("\t).parsed\n")
@ -1042,7 +1053,7 @@ async def test_"""
f.write("\tkwargs = _get_kwargs(\n")
params = get_function_parameters(endpoint, request_body_type)
for param in params:
f.write("\t\t" + param + "=" + param + ",\n")
f.write("\t\t" + clean_parameter_name(param) + "=" + param + ",\n")
f.write("\t\tclient=client,\n")
f.write("\t)\n")
f.write("\n")
@ -1120,7 +1131,7 @@ async def test_"""
f.write("\t\tawait asyncio_detailed(\n")
params = get_function_parameters(endpoint, request_body_type)
for param in params:
f.write("\t\t" + param + "=" + param + ",\n")
f.write("\t\t" + clean_parameter_name(param) + "=" + param + ",\n")
f.write("\t\t\tclient=client,\n")
f.write("\t\t)\n")
f.write("\t).parsed\n")
@ -1439,8 +1450,14 @@ def generateObjectTypeCode(name: str, schema: dict, type_name: str, data: dict)
# Iternate over the properties.
for property_name in schema["properties"]:
# Write the property.
f.write("\t\tif " + property_name + " is not UNSET:\n")
f.write("\t\t\tfield_dict['" + property_name + "'] = " + property_name + "\n")
f.write("\t\tif " + clean_parameter_name(property_name) + " is not UNSET:\n")
f.write(
"\t\t\tfield_dict['"
+ property_name
+ "'] = "
+ clean_parameter_name(property_name)
+ "\n"
)
f.write("\n")
f.write("\t\treturn field_dict\n")
@ -1468,7 +1485,13 @@ def generateObjectTypeCode(name: str, schema: dict, type_name: str, data: dict)
# Iternate over the properties.
for property_name in schema["properties"]:
# Write the property.
f.write("\t\t\t" + property_name + "= " + property_name + ",\n")
f.write(
"\t\t\t"
+ clean_parameter_name(property_name)
+ "= "
+ clean_parameter_name(property_name)
+ ",\n"
)
# Close the class.
f.write("\t\t)\n")
@ -1531,25 +1554,51 @@ def renderTypeToDict(f, property_name: str, property_schema: dict, data: dict):
):
f.write("\t\t" + property_name + ": Union[Unset, str] = UNSET\n")
f.write(
"\t\tif not isinstance(self." + property_name + ", Unset):\n"
"\t\tif not isinstance(self."
+ clean_parameter_name(property_name)
+ ", Unset):\n"
)
f.write(
"\t\t\t"
+ property_name
+ clean_parameter_name(property_name)
+ " = self."
+ property_name
+ clean_parameter_name(property_name)
+ ".isoformat()\n"
)
# return early
return
f.write("\t\t" + property_name + " = self." + property_name + "\n")
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ "\n"
)
elif property_type == "integer":
f.write("\t\t" + property_name + " = self." + property_name + "\n")
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ "\n"
)
elif property_type == "number":
f.write("\t\t" + property_name + " = self." + property_name + "\n")
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ "\n"
)
elif property_type == "boolean":
f.write("\t\t" + property_name + " = self." + property_name + "\n")
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ "\n"
)
elif property_type == "array":
if "items" in property_schema:
if "$ref" in property_schema["items"]:
@ -1594,14 +1643,40 @@ def renderTypeToDict(f, property_name: str, property_schema: dict, data: dict):
+ property_type
+ "]] = UNSET\n"
)
f.write("\t\tif not isinstance(self." + property_name + ", Unset):\n")
f.write("\t\t\t" + property_name + " = self." + property_name + "\n")
f.write(
"\t\tif not isinstance(self."
+ clean_parameter_name(property_name)
+ ", Unset):\n"
)
f.write(
"\t\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ "\n"
)
else:
f.write("\t\t" + property_name + " = self." + property_name + "\n")
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ "\n"
)
elif "$ref" in property_schema:
ref = property_schema["$ref"].replace("#/components/schemas/", "")
f.write("\t\tif not isinstance(self." + property_name + ", Unset):\n")
f.write("\t\t\t" + property_name + " = self." + property_name + "\n")
f.write(
"\t\tif not isinstance(self."
+ clean_parameter_name(property_name)
+ ", Unset):\n"
)
f.write(
"\t\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ "\n"
)
elif "allOf" in property_schema:
thing = property_schema["allOf"][0]
if "$ref" in thing:
@ -1610,15 +1685,32 @@ def renderTypeToDict(f, property_name: str, property_schema: dict, data: dict):
return renderTypeToDict(
f, property_name, data["components"]["schemas"][ref], data
)
f.write("\t\tif not isinstance(self." + property_name + ", Unset):\n")
f.write("\t\t\t" + property_name + " = self." + property_name + "\n")
f.write(
"\t\tif not isinstance(self."
+ clean_parameter_name(property_name)
+ ", Unset):\n"
)
f.write(
"\t\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ "\n"
)
else:
raise Exception("unknown allOf type: ", property_schema)
else:
f.write("\t\t" + property_name + " = self." + property_name + "\n")
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ "\n"
)
def renderTypeInit(f, property_name: str, property_schema: dict, data: dict):
property_name = clean_parameter_name(property_name)
if "type" in property_schema:
property_type = property_schema["type"]
@ -1726,22 +1818,30 @@ def renderTypeFromDict(f, property_name: str, property_schema: dict, data: dict)
):
f.write(
"\t\t_"
+ property_name
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
f.write(
"\t\t" + property_name + ": Union[Unset, datetime.datetime]\n"
"\t\t"
+ clean_parameter_name(property_name)
+ ": Union[Unset, datetime.datetime]\n"
)
f.write(
"\t\tif isinstance(_"
+ clean_parameter_name(property_name)
+ ", Unset):\n"
)
f.write(
"\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n"
)
f.write("\t\tif isinstance(_" + property_name + ", Unset):\n")
f.write("\t\t\t" + property_name + " = UNSET\n")
f.write("\t\telse:\n")
f.write(
"\t\t\t"
+ property_name
+ clean_parameter_name(property_name)
+ " = isoparse(_"
+ property_name
+ clean_parameter_name(property_name)
+ ")\n"
)
f.write("\n")
@ -1749,22 +1849,38 @@ def renderTypeFromDict(f, property_name: str, property_schema: dict, data: dict)
return
f.write(
"\t\t" + property_name + ' = d.pop("' + property_name + '", UNSET)\n'
"\t\t"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
f.write("\n")
elif property_type == "integer":
f.write(
"\t\t" + property_name + ' = d.pop("' + property_name + '", UNSET)\n'
"\t\t"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
f.write("\n")
elif property_type == "number":
f.write(
"\t\t" + property_name + ' = d.pop("' + property_name + '", UNSET)\n'
"\t\t"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
f.write("\n")
elif property_type == "boolean":
f.write(
"\t\t" + property_name + ' = d.pop("' + property_name + '", UNSET)\n'
"\t\t"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
f.write("\n")
elif property_type == "array":
@ -1808,7 +1924,7 @@ def renderTypeFromDict(f, property_name: str, property_schema: dict, data: dict)
f.write(
"\t\t"
+ property_name
+ clean_parameter_name(property_name)
+ " = cast(List["
+ property_type
+ '], d.pop("'
@ -1818,62 +1934,70 @@ def renderTypeFromDict(f, property_name: str, property_schema: dict, data: dict)
f.write("\n")
else:
f.write(
"\t\t" + property_name + ' = d.pop("' + property_name + '", UNSET)\n'
"\t\t"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
elif "$ref" in property_schema:
ref = property_schema["$ref"].replace("#/components/schemas/", "")
# Get the type for the reference.
ref_schema = data["components"]["schemas"][ref]
f.write("\t\t_" + property_name + ' = d.pop("' + property_name + '", UNSET)\n')
f.write("\t\t" + property_name + ": Union[Unset, " + ref + "]\n")
f.write("\t\tif isinstance(_" + property_name + ", Unset):\n")
f.write("\t\t\t" + property_name + " = UNSET\n")
f.write(
"\t\t_"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ ": Union[Unset, "
+ ref
+ "]\n"
)
f.write(
"\t\tif isinstance(_" + clean_parameter_name(property_name) + ", Unset):\n"
)
f.write("\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n")
f.write("\t\telse:\n")
nested_objects = False
if "oneOf" in ref_schema and len(ref_schema["oneOf"]) > 0:
# Check if the nested_object is a object.
for one_of in ref_schema["oneOf"]:
if "type" in one_of and one_of["type"] == "object":
nested_objects = True
break
if nested_objects:
if isNestedObjectOneOf(ref_schema):
f.write(
"\t\t\t"
+ property_name
+ clean_parameter_name(property_name)
+ " = _"
+ property_name
+ clean_parameter_name(property_name)
+ " # type: ignore[arg-type]\n"
)
else:
f.write(
"\t\t\t" + property_name + " = " + ref + "(_" + property_name + ")\n"
"\t\t\t"
+ clean_parameter_name(property_name)
+ " = "
+ ref
+ "(_"
+ clean_parameter_name(property_name)
+ ")\n"
)
f.write("\n")
elif "allOf" in property_schema:
if len(property_schema["allOf"]) != 1:
print(property_schema)
raise Exception("Unknown allOf")
thing = property_schema["allOf"][0]
if "$ref" in thing:
ref = thing["$ref"].replace("#/components/schemas/", "")
if ref == "Uuid":
return renderTypeFromDict(
f, property_name, data["components"]["schemas"][ref], data
)
f.write(
"\t\t_" + property_name + ' = d.pop("' + property_name + '", UNSET)\n'
)
f.write("\t\t" + property_name + ": Union[Unset, " + ref + "]\n")
f.write("\t\tif isinstance(_" + property_name + ", Unset):\n")
f.write("\t\t\t" + property_name + " = UNSET\n")
f.write("\t\telse:\n")
f.write(
"\t\t\t" + property_name + " = " + ref + "(_" + property_name + ")\n"
)
f.write("\n")
renderTypeFromDict(f, property_name, thing, data)
else:
raise Exception("unknown allOf type: ", property_schema)
else:
f.write("\t\t" + property_name + ' = d.pop("' + property_name + '", UNSET)\n')
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
def hasDateTime(schema: dict) -> bool:
@ -2089,6 +2213,10 @@ def to_camel_case(s: str):
return "".join([s[0].lower(), s[1:]])
def clean_parameter_name(name: str):
return camel_to_snake(name).replace("from", "from_")
def camel_to_snake(name: str):
name = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name)
return re.sub("([a-z0-9])([A-Z])", r"\1_\2", name).lower().replace("-", "_")

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
""" Contains methods for accessing the drawing API paths: Drawing API for updating your 3D files using the KittyCAD engine. """ # noqa: E501

View File

@ -86,7 +86,10 @@ def sync(
*,
client: Client,
) -> Optional[Union[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.
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
Currently, this endpoint returns the cartesian co-ordinate in world space measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
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.""" # noqa: E501
return sync_detailed(
@ -120,7 +123,10 @@ async def asyncio(
*,
client: Client,
) -> Optional[Union[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.
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
Currently, this endpoint returns the cartesian co-ordinate in world space measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
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.""" # noqa: E501
return (

View File

@ -93,7 +93,10 @@ def sync(
*,
client: Client,
) -> Optional[Union[FileDensity, Error]]:
"""Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
Currently, this endpoint assumes if you are giving a material mass in a specific mass units, we return a density in mass unit per cubic measure unit.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the density 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.""" # noqa: E501
return sync_detailed(
@ -131,7 +134,10 @@ async def asyncio(
*,
client: Client,
) -> Optional[Union[FileDensity, Error]]:
"""Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
Currently, this endpoint assumes if you are giving a material mass in a specific mass units, we return a density in mass unit per cubic measure unit.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the density 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.""" # noqa: E501
return (

View File

@ -93,7 +93,10 @@ def sync(
*,
client: Client,
) -> Optional[Union[FileMass, Error]]:
"""Get the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
Currently, this endpoint assumes if you are giving a material density in a specific mass unit per cubic measure unit, we return a mass in mass units. The same mass units as passed in the material density.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the 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.""" # noqa: E501
return sync_detailed(
@ -131,7 +134,10 @@ async def asyncio(
*,
client: Client,
) -> Optional[Union[FileMass, Error]]:
"""Get the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
Currently, this endpoint assumes if you are giving a material density in a specific mass unit per cubic measure unit, we return a mass in mass units. The same mass units as passed in the material density.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the 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.""" # noqa: E501
return (

View File

@ -86,7 +86,10 @@ def sync(
*,
client: Client,
) -> Optional[Union[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.
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
Currently, this endpoint returns the square measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
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.""" # noqa: E501
return sync_detailed(
@ -120,7 +123,10 @@ async def asyncio(
*,
client: Client,
) -> Optional[Union[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.
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
Currently, this endpoint returns the square measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
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.""" # noqa: E501
return (

View File

@ -84,7 +84,10 @@ def sync(
*,
client: Client,
) -> Optional[Union[FileVolume, Error]]:
"""Get the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
Currently, this endpoint returns the cubic measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the volume 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.""" # noqa: E501
return sync_detailed(
@ -118,7 +121,10 @@ async def asyncio(
*,
client: Client,
) -> Optional[Union[FileVolume, Error]]:
"""Get the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
Currently, this endpoint returns the cubic measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the volume 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.""" # noqa: E501
return (

View File

@ -0,0 +1 @@
""" Contains methods for accessing the modeling API paths: Modeling API for updating your 3D files using the KittyCAD engine. """ # noqa: E501

View File

@ -3,17 +3,17 @@ from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.drawing_cmd_req import DrawingCmdReq
from ...models.error import Error
from ...models.modeling_cmd_req import ModelingCmdReq
from ...types import Response
def _get_kwargs(
body: DrawingCmdReq,
body: ModelingCmdReq,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/drawing/cmd".format(client.base_url) # noqa: E501
url = "{}/modeling/cmd".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
@ -52,7 +52,7 @@ def _build_response(
def sync_detailed(
body: DrawingCmdReq,
body: ModelingCmdReq,
*,
client: Client,
) -> Response[Optional[Union[dict, Error]]]:
@ -70,7 +70,7 @@ def sync_detailed(
def sync(
body: DrawingCmdReq,
body: ModelingCmdReq,
*,
client: Client,
) -> Optional[Union[dict, Error]]:
@ -83,7 +83,7 @@ def sync(
async def asyncio_detailed(
body: DrawingCmdReq,
body: ModelingCmdReq,
*,
client: Client,
) -> Response[Optional[Union[dict, Error]]]:
@ -99,7 +99,7 @@ async def asyncio_detailed(
async def asyncio(
body: DrawingCmdReq,
body: ModelingCmdReq,
*,
client: Client,
) -> Optional[Union[dict, Error]]:

View File

@ -3,18 +3,18 @@ from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.drawing_cmd_req_batch import DrawingCmdReqBatch
from ...models.drawing_outcomes import DrawingOutcomes
from ...models.error import Error
from ...models.modeling_cmd_req_batch import ModelingCmdReqBatch
from ...models.modeling_outcomes import ModelingOutcomes
from ...types import Response
def _get_kwargs(
body: DrawingCmdReqBatch,
body: ModelingCmdReqBatch,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/drawing/cmd_batch".format(client.base_url) # noqa: E501
url = "{}/modeling/cmd_batch".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
@ -30,9 +30,9 @@ def _get_kwargs(
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[DrawingOutcomes, Error]]:
) -> Optional[Union[ModelingOutcomes, Error]]:
if response.status_code == 200:
response_200 = DrawingOutcomes.from_dict(response.json())
response_200 = ModelingOutcomes.from_dict(response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
@ -45,7 +45,7 @@ def _parse_response(
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[DrawingOutcomes, Error]]]:
) -> Response[Optional[Union[ModelingOutcomes, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -55,10 +55,10 @@ def _build_response(
def sync_detailed(
body: DrawingCmdReqBatch,
body: ModelingCmdReqBatch,
*,
client: Client,
) -> Response[Optional[Union[DrawingOutcomes, Error]]]:
) -> Response[Optional[Union[ModelingOutcomes, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
@ -73,10 +73,10 @@ def sync_detailed(
def sync(
body: DrawingCmdReqBatch,
body: ModelingCmdReqBatch,
*,
client: Client,
) -> Optional[Union[DrawingOutcomes, Error]]:
) -> Optional[Union[ModelingOutcomes, Error]]:
return sync_detailed(
body=body,
@ -85,10 +85,10 @@ def sync(
async def asyncio_detailed(
body: DrawingCmdReqBatch,
body: ModelingCmdReqBatch,
*,
client: Client,
) -> Response[Optional[Union[DrawingOutcomes, Error]]]:
) -> Response[Optional[Union[ModelingOutcomes, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
@ -101,10 +101,10 @@ async def asyncio_detailed(
async def asyncio(
body: DrawingCmdReqBatch,
body: ModelingCmdReqBatch,
*,
client: Client,
) -> Optional[Union[DrawingOutcomes, Error]]:
) -> Optional[Union[ModelingOutcomes, Error]]:
return (
await asyncio_detailed(

View File

@ -0,0 +1,90 @@
from typing import Any, Dict
import httpx
from ...client import Client
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/ws/modeling/commands".format(client.base_url) # noqa: E501
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):
return
def _build_response(*, response: httpx.Response) -> Response[Any]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Any]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
):
"""Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Any]:
kwargs = _get_kwargs(
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(
*,
client: Client,
):
"""Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -25,7 +25,6 @@ from kittycad.api.apps import (
apps_github_webhook,
)
from kittycad.api.constant import get_physics_constant
from kittycad.api.drawing import cmd, cmd_batch
from kittycad.api.executor import create_executor_term, create_file_execution
from kittycad.api.file import (
create_file_center_of_mass,
@ -44,6 +43,7 @@ from kittycad.api.meta import (
get_schema,
ping,
)
from kittycad.api.modeling import cmd, cmd_batch, modeling_commands_ws
from kittycad.api.payments import (
create_payment_information_for_user,
create_payment_intent_for_user,
@ -113,7 +113,6 @@ from kittycad.models import (
CodeOutput,
Customer,
CustomerBalance,
DrawingOutcomes,
Error,
ExtendedUser,
ExtendedUserResultsPage,
@ -126,6 +125,7 @@ from kittycad.models import (
Invoice,
Mesh,
Metadata,
ModelingOutcomes,
Onboarding,
PaymentIntent,
PaymentMethod,
@ -170,15 +170,16 @@ from kittycad.models.api_call_status import ApiCallStatus
from kittycad.models.billing_info import BillingInfo
from kittycad.models.code_language import CodeLanguage
from kittycad.models.created_at_sort_mode import CreatedAtSortMode
from kittycad.models.drawing_cmd import DrawCircle
from kittycad.models.drawing_cmd_id import DrawingCmdId
from kittycad.models.drawing_cmd_req import DrawingCmdReq
from kittycad.models.drawing_cmd_req_batch import DrawingCmdReqBatch
from kittycad.models.email_authentication_form import EmailAuthenticationForm
from kittycad.models.file_export_format import FileExportFormat
from kittycad.models.file_import_format import FileImportFormat
from kittycad.models.image_type import ImageType
from kittycad.models.line3d import Line3d
from kittycad.models.modeling_cmd_id import ModelingCmdId
from kittycad.models.modeling_cmd_req import ModelingCmdReq
from kittycad.models.modeling_cmd_req_batch import ModelingCmdReqBatch
from kittycad.models.physics_constant_name import PhysicsConstantName
from kittycad.models.point3d import Point3d
from kittycad.models.unit_acceleration_format import UnitAccelerationFormat
from kittycad.models.unit_angle_format import UnitAngleFormat
from kittycad.models.unit_angular_velocity_format import UnitAngularVelocityFormat
@ -1022,189 +1023,6 @@ async def test_get_physics_constant_async():
)
@pytest.mark.skip
def test_cmd():
# Create our client.
client = ClientFromEnv()
cmd.sync(
client=client,
body=DrawingCmdReq(
cmd=DrawCircle(
center=[
3.14,
3.14,
],
radius=3.14,
),
cmd_id=DrawingCmdId("<uuid>"),
file_id="<string>",
),
)
# OR if you need more info (e.g. status_code)
cmd.sync_detailed(
client=client,
body=DrawingCmdReq(
cmd=DrawCircle(
center=[
3.14,
3.14,
],
radius=3.14,
),
cmd_id=DrawingCmdId("<uuid>"),
file_id="<string>",
),
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_cmd_async():
# Create our client.
client = ClientFromEnv()
await cmd.asyncio(
client=client,
body=DrawingCmdReq(
cmd=DrawCircle(
center=[
3.14,
3.14,
],
radius=3.14,
),
cmd_id=DrawingCmdId("<uuid>"),
file_id="<string>",
),
)
# OR run async with more info
await cmd.asyncio_detailed(
client=client,
body=DrawingCmdReq(
cmd=DrawCircle(
center=[
3.14,
3.14,
],
radius=3.14,
),
cmd_id=DrawingCmdId("<uuid>"),
file_id="<string>",
),
)
@pytest.mark.skip
def test_cmd_batch():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[DrawingOutcomes, Error]] = cmd_batch.sync(
client=client,
body=DrawingCmdReqBatch(
cmds={
"<string>": DrawingCmdReq(
cmd=DrawCircle(
center=[
3.14,
3.14,
],
radius=3.14,
),
cmd_id=DrawingCmdId("<uuid>"),
file_id="<string>",
)
},
file_id="<string>",
),
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: DrawingOutcomes = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[
Optional[Union[DrawingOutcomes, Error]]
] = cmd_batch.sync_detailed(
client=client,
body=DrawingCmdReqBatch(
cmds={
"<string>": DrawingCmdReq(
cmd=DrawCircle(
center=[
3.14,
3.14,
],
radius=3.14,
),
cmd_id=DrawingCmdId("<uuid>"),
file_id="<string>",
)
},
file_id="<string>",
),
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_cmd_batch_async():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[DrawingOutcomes, Error]] = await cmd_batch.asyncio(
client=client,
body=DrawingCmdReqBatch(
cmds={
"<string>": DrawingCmdReq(
cmd=DrawCircle(
center=[
3.14,
3.14,
],
radius=3.14,
),
cmd_id=DrawingCmdId("<uuid>"),
file_id="<string>",
)
},
file_id="<string>",
),
)
# OR run async with more info
response: Response[
Optional[Union[DrawingOutcomes, Error]]
] = await cmd_batch.asyncio_detailed(
client=client,
body=DrawingCmdReqBatch(
cmds={
"<string>": DrawingCmdReq(
cmd=DrawCircle(
center=[
3.14,
3.14,
],
radius=3.14,
),
cmd_id=DrawingCmdId("<uuid>"),
file_id="<string>",
)
},
file_id="<string>",
),
)
@pytest.mark.skip
def test_create_file_center_of_mass():
# Create our client.
@ -1625,6 +1443,229 @@ async def test_logout_async():
)
@pytest.mark.skip
def test_cmd():
# Create our client.
client = ClientFromEnv()
cmd.sync(
client=client,
body=ModelingCmdReq(
cmd=Line3d(
from_=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>",
),
)
# OR if you need more info (e.g. status_code)
cmd.sync_detailed(
client=client,
body=ModelingCmdReq(
cmd=Line3d(
from_=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>",
),
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_cmd_async():
# Create our client.
client = ClientFromEnv()
await cmd.asyncio(
client=client,
body=ModelingCmdReq(
cmd=Line3d(
from_=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>",
),
)
# OR run async with more info
await cmd.asyncio_detailed(
client=client,
body=ModelingCmdReq(
cmd=Line3d(
from_=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>",
),
)
@pytest.mark.skip
def test_cmd_batch():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[ModelingOutcomes, Error]] = cmd_batch.sync(
client=client,
body=ModelingCmdReqBatch(
cmds={
"<string>": ModelingCmdReq(
cmd=Line3d(
from_=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>",
)
},
file_id="<string>",
),
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: ModelingOutcomes = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[
Optional[Union[ModelingOutcomes, Error]]
] = cmd_batch.sync_detailed(
client=client,
body=ModelingCmdReqBatch(
cmds={
"<string>": ModelingCmdReq(
cmd=Line3d(
from_=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>",
)
},
file_id="<string>",
),
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_cmd_batch_async():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[ModelingOutcomes, Error]] = await cmd_batch.asyncio(
client=client,
body=ModelingCmdReqBatch(
cmds={
"<string>": ModelingCmdReq(
cmd=Line3d(
from_=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>",
)
},
file_id="<string>",
),
)
# OR run async with more info
response: Response[
Optional[Union[ModelingOutcomes, Error]]
] = await cmd_batch.asyncio_detailed(
client=client,
body=ModelingCmdReqBatch(
cmds={
"<string>": ModelingCmdReq(
cmd=Line3d(
from_=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>",
)
},
file_id="<string>",
),
)
@pytest.mark.skip
def test_get_openai_schema():
# Create our client.
@ -4792,3 +4833,35 @@ async def test_create_executor_term_async():
await create_executor_term.asyncio_detailed(
client=client,
)
@pytest.mark.skip
def test_modeling_commands_ws():
# Create our client.
client = ClientFromEnv()
modeling_commands_ws.sync(
client=client,
)
# OR if you need more info (e.g. status_code)
modeling_commands_ws.sync_detailed(
client=client,
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_modeling_commands_ws_async():
# Create our client.
client = ClientFromEnv()
await modeling_commands_ws.asyncio(
client=client,
)
# OR run async with more info
await modeling_commands_ws.asyncio_detailed(
client=client,
)

View File

@ -36,13 +36,6 @@ from .device_access_token_request_form import DeviceAccessTokenRequestForm
from .device_auth_request_form import DeviceAuthRequestForm
from .device_auth_verify_params import DeviceAuthVerifyParams
from .docker_system_info import DockerSystemInfo
from .drawing_cmd import DrawingCmd
from .drawing_cmd_id import DrawingCmdId
from .drawing_cmd_req import DrawingCmdReq
from .drawing_cmd_req_batch import DrawingCmdReqBatch
from .drawing_error import DrawingError
from .drawing_outcome import DrawingOutcome
from .drawing_outcomes import DrawingOutcomes
from .email_authentication_form import EmailAuthenticationForm
from .engine_metadata import EngineMetadata
from .environment import Environment
@ -50,6 +43,7 @@ from .error import Error
from .executor_metadata import ExecutorMetadata
from .extended_user import ExtendedUser
from .extended_user_results_page import ExtendedUserResultsPage
from .extrude import Extrude
from .file_center_of_mass import FileCenterOfMass
from .file_conversion import FileConversion
from .file_density import FileDensity
@ -70,10 +64,18 @@ from .jetstream_api_stats import JetstreamApiStats
from .jetstream_config import JetstreamConfig
from .jetstream_stats import JetstreamStats
from .leaf_node import LeafNode
from .line3d import Line3d
from .mesh import Mesh
from .meta_cluster_info import MetaClusterInfo
from .metadata import Metadata
from .method import Method
from .modeling_cmd import ModelingCmd
from .modeling_cmd_id import ModelingCmdId
from .modeling_cmd_req import ModelingCmdReq
from .modeling_cmd_req_batch import ModelingCmdReqBatch
from .modeling_error import ModelingError
from .modeling_outcome import ModelingOutcome
from .modeling_outcomes import ModelingOutcomes
from .new_address import NewAddress
from .o_auth2_client_info import OAuth2ClientInfo
from .o_auth2_grant_type import OAuth2GrantType
@ -86,6 +88,8 @@ from .payment_method_type import PaymentMethodType
from .physics_constant import PhysicsConstant
from .physics_constant_name import PhysicsConstantName
from .plugins_info import PluginsInfo
from .point2d import Point2d
from .point3d import Point3d
from .point_e_metadata import PointEMetadata
from .pong import Pong
from .registry_service_config import RegistryServiceConfig

View File

@ -5,6 +5,7 @@ import attr
from dateutil.parser import isoparse
from ..models.method import Method
from ..models.uuid import Uuid
from ..types import UNSET, Unset
S = TypeVar("S", bound="ApiCallWithPrice")
@ -147,7 +148,12 @@ class ApiCallWithPrice:
endpoint = d.pop("endpoint", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
ip_address = d.pop("ip_address", UNSET)
@ -183,7 +189,12 @@ class ApiCallWithPrice:
stripe_invoice_item_id = d.pop("stripe_invoice_item_id", UNSET)
token = d.pop("token", UNSET)
_token = d.pop("token", UNSET)
token: Union[Unset, Uuid]
if isinstance(_token, Unset):
token = UNSET
else:
token = Uuid(_token)
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]

View File

@ -4,6 +4,7 @@ from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from ..models.uuid import Uuid
from ..types import UNSET, Unset
G = TypeVar("G", bound="ApiToken")
@ -68,7 +69,12 @@ class ApiToken:
is_valid = d.pop("is_valid", UNSET)
token = d.pop("token", UNSET)
_token = d.pop("token", UNSET)
token: Union[Unset, Uuid]
if isinstance(_token, Unset):
token = UNSET
else:
token = Uuid(_token)
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]

View File

@ -6,6 +6,7 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.async_api_call_type import AsyncApiCallType
from ..models.uuid import Uuid
from ..types import UNSET, Unset
Z = TypeVar("Z", bound="AsyncApiCall")
@ -103,7 +104,12 @@ class AsyncApiCall:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)
output = d.pop("output", UNSET)

View File

@ -7,6 +7,7 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.file_export_format import FileExportFormat
from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
F = TypeVar("F", bound="FileConversion")
@ -105,7 +106,12 @@ class FileConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
output = d.pop("output", UNSET)
@ -278,7 +284,12 @@ class FileCenterOfMass:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
_src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, FileImportFormat]
@ -441,7 +452,12 @@ class FileMass:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
mass = d.pop("mass", UNSET)
@ -605,7 +621,12 @@ class FileVolume:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
_src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, FileImportFormat]
@ -772,7 +793,12 @@ class FileDensity:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
material_mass = d.pop("material_mass", UNSET)
@ -934,7 +960,12 @@ class FileSurfaceArea:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
_src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, FileImportFormat]

View File

@ -4,6 +4,7 @@ from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from ..models.uuid import Uuid
from ..types import UNSET, Unset
N = TypeVar("N", bound="CustomerBalance")
@ -72,7 +73,12 @@ class CustomerBalance:
else:
created_at = isoparse(_created_at)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
monthly_credits_remaining = d.pop("monthly_credits_remaining", UNSET)

View File

@ -1,128 +0,0 @@
from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from ..models.drawing_cmd_id import DrawingCmdId
from ..types import UNSET, Unset
J = TypeVar("J", bound="DrawCircle")
@attr.s(auto_attribs=True)
class DrawCircle:
center: Union[Unset, List[float]] = UNSET
radius: Union[Unset, float] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
center: Union[Unset, List[float]] = UNSET
if not isinstance(self.center, Unset):
center = self.center
radius = self.radius
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if center is not UNSET:
field_dict["center"] = center
if radius is not UNSET:
field_dict["radius"] = radius
return field_dict
@classmethod
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
d = src_dict.copy()
center = cast(List[float], d.pop("center", UNSET))
radius = d.pop("radius", UNSET)
draw_circle = cls(
center=center,
radius=radius,
)
draw_circle.additional_properties = d
return draw_circle
@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
V = TypeVar("V", bound="Extrude")
@attr.s(auto_attribs=True)
class Extrude:
distance: Union[Unset, float] = UNSET
sketch: Union[Unset, DrawingCmdId] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
distance = self.distance
if not isinstance(self.sketch, Unset):
sketch = self.sketch
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if distance is not UNSET:
field_dict["distance"] = distance
if sketch is not UNSET:
field_dict["sketch"] = sketch
return field_dict
@classmethod
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
d = src_dict.copy()
distance = d.pop("distance", UNSET)
_sketch = d.pop("sketch", UNSET)
sketch: Union[Unset, DrawingCmdId]
if isinstance(_sketch, Unset):
sketch = UNSET
else:
sketch = DrawingCmdId(_sketch)
extrude = cls(
distance=distance,
sketch=sketch,
)
extrude.additional_properties = d
return extrude
@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
DrawingCmd = Union[DrawCircle, Extrude]

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
M = TypeVar("M", bound="EmailAuthenticationForm")
J = TypeVar("J", bound="EmailAuthenticationForm")
@attr.s(auto_attribs=True)
@ -31,7 +31,7 @@ class EmailAuthenticationForm:
return field_dict
@classmethod
def from_dict(cls: Type[M], src_dict: Dict[str, Any]) -> M:
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
d = src_dict.copy()
callback_url = d.pop("callback_url", UNSET)

View File

@ -8,7 +8,7 @@ from ..models.environment import Environment
from ..models.file_system_metadata import FileSystemMetadata
from ..types import UNSET, Unset
B = TypeVar("B", bound="EngineMetadata")
V = TypeVar("V", bound="EngineMetadata")
@attr.s(auto_attribs=True)
@ -57,7 +57,7 @@ class EngineMetadata:
return field_dict
@classmethod
def from_dict(cls: Type[B], src_dict: Dict[str, Any]) -> B:
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
d = src_dict.copy()
async_jobs_running = d.pop("async_jobs_running", UNSET)

View File

@ -4,8 +4,11 @@ from enum import Enum
class Environment(str, Enum):
"""The environment the server is running in.""" # noqa: E501
"""# The development environment. This is for running locally. """ # noqa: E501
DEVELOPMENT = "DEVELOPMENT"
"""# The preview environment. This is when PRs are created and a service is deployed for testing. """ # noqa: E501
PREVIEW = "PREVIEW"
"""# The production environment. """ # noqa: E501
PRODUCTION = "PRODUCTION"
def __str__(self) -> str:

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
S = TypeVar("S", bound="Error")
L = TypeVar("L", bound="Error")
@attr.s(auto_attribs=True)
@ -35,7 +35,7 @@ class Error:
return field_dict
@classmethod
def from_dict(cls: Type[S], src_dict: Dict[str, Any]) -> S:
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
d = src_dict.copy()
error_code = d.pop("error_code", UNSET)

View File

@ -6,7 +6,7 @@ from ..models.docker_system_info import DockerSystemInfo
from ..models.environment import Environment
from ..types import UNSET, Unset
A = TypeVar("A", bound="ExecutorMetadata")
E = TypeVar("E", bound="ExecutorMetadata")
@attr.s(auto_attribs=True)
@ -41,7 +41,7 @@ class ExecutorMetadata:
return field_dict
@classmethod
def from_dict(cls: Type[A], src_dict: Dict[str, Any]) -> A:
def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
d = src_dict.copy()
_docker_info = d.pop("docker_info", UNSET)
docker_info: Union[Unset, DockerSystemInfo]

View File

@ -6,7 +6,7 @@ from dateutil.parser import isoparse
from ..types import UNSET, Unset
H = TypeVar("H", bound="ExtendedUser")
Y = TypeVar("Y", bound="ExtendedUser")
@attr.s(auto_attribs=True)
@ -97,7 +97,7 @@ class ExtendedUser:
return field_dict
@classmethod
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
d = src_dict.copy()
company = d.pop("company", UNSET)

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
E = TypeVar("E", bound="ExtendedUserResultsPage")
H = TypeVar("H", bound="ExtendedUserResultsPage")
@attr.s(auto_attribs=True)
@ -37,7 +37,7 @@ class ExtendedUserResultsPage:
return field_dict
@classmethod
def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
d = src_dict.copy()
from ..models.extended_user import ExtendedUser

View File

@ -0,0 +1,69 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.modeling_cmd_id import ModelingCmdId
from ..types import UNSET, Unset
T = TypeVar("T", bound="Extrude")
@attr.s(auto_attribs=True)
class Extrude:
"""Command for extruding a solid.""" # noqa: E501
distance: Union[Unset, float] = UNSET
target: Union[Unset, ModelingCmdId] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
distance = self.distance
if not isinstance(self.target, Unset):
target = self.target
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if distance is not UNSET:
field_dict["distance"] = distance
if target is not UNSET:
field_dict["target"] = target
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
distance = d.pop("distance", UNSET)
_target = d.pop("target", UNSET)
target: Union[Unset, ModelingCmdId]
if isinstance(_target, Unset):
target = UNSET
else:
target = ModelingCmdId(_target)
extrude = cls(
distance=distance,
target=target,
)
extrude.additional_properties = d
return extrude
@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

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
G = TypeVar("G", bound="FileCenterOfMass")
M = TypeVar("M", bound="FileCenterOfMass")
@attr.s(auto_attribs=True)
@ -79,7 +80,7 @@ class FileCenterOfMass:
return field_dict
@classmethod
def from_dict(cls: Type[G], src_dict: Dict[str, Any]) -> G:
def from_dict(cls: Type[M], src_dict: Dict[str, Any]) -> M:
d = src_dict.copy()
center_of_mass = cast(List[float], d.pop("center_of_mass", UNSET))
@ -99,7 +100,12 @@ class FileCenterOfMass:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
_src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, FileImportFormat]

View File

@ -7,9 +7,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.file_export_format import FileExportFormat
from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
J = TypeVar("J", bound="FileConversion")
B = TypeVar("B", bound="FileConversion")
@attr.s(auto_attribs=True)
@ -83,7 +84,7 @@ class FileConversion:
return field_dict
@classmethod
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
def from_dict(cls: Type[B], src_dict: Dict[str, Any]) -> B:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -101,7 +102,12 @@ class FileConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
output = d.pop("output", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
R = TypeVar("R", bound="FileDensity")
S = TypeVar("S", bound="FileDensity")
@attr.s(auto_attribs=True)
@ -81,7 +82,7 @@ class FileDensity:
return field_dict
@classmethod
def from_dict(cls: Type[R], src_dict: Dict[str, Any]) -> R:
def from_dict(cls: Type[S], src_dict: Dict[str, Any]) -> S:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -101,7 +102,12 @@ class FileDensity:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
material_mass = d.pop("material_mass", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
L = TypeVar("L", bound="FileMass")
A = TypeVar("A", bound="FileMass")
@attr.s(auto_attribs=True)
@ -81,7 +82,7 @@ class FileMass:
return field_dict
@classmethod
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
def from_dict(cls: Type[A], src_dict: Dict[str, Any]) -> A:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -99,7 +100,12 @@ class FileMass:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
mass = d.pop("mass", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
Y = TypeVar("Y", bound="FileSurfaceArea")
H = TypeVar("H", bound="FileSurfaceArea")
@attr.s(auto_attribs=True)
@ -77,7 +78,7 @@ class FileSurfaceArea:
return field_dict
@classmethod
def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -95,7 +96,12 @@ class FileSurfaceArea:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
_src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, FileImportFormat]

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
H = TypeVar("H", bound="FileSystemMetadata")
E = TypeVar("E", bound="FileSystemMetadata")
@attr.s(auto_attribs=True)
@ -29,7 +29,7 @@ class FileSystemMetadata:
return field_dict
@classmethod
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
d = src_dict.copy()
ok = d.pop("ok", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
K = TypeVar("K", bound="FileVolume")
G = TypeVar("G", bound="FileVolume")
@attr.s(auto_attribs=True)
@ -77,7 +78,7 @@ class FileVolume:
return field_dict
@classmethod
def from_dict(cls: Type[K], src_dict: Dict[str, Any]) -> K:
def from_dict(cls: Type[G], src_dict: Dict[str, Any]) -> G:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -95,7 +96,12 @@ class FileVolume:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
_src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, FileImportFormat]

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
V = TypeVar("V", bound="Gateway")
J = TypeVar("J", bound="Gateway")
@attr.s(auto_attribs=True)
@ -43,7 +43,7 @@ class Gateway:
return field_dict
@classmethod
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
d = src_dict.copy()
auth_timeout = d.pop("auth_timeout", UNSET)

View File

@ -8,7 +8,7 @@ from ..models.currency import Currency
from ..models.invoice_status import InvoiceStatus
from ..types import UNSET, Unset
N = TypeVar("N", bound="Invoice")
L = TypeVar("L", bound="Invoice")
@attr.s(auto_attribs=True)
@ -133,7 +133,7 @@ class Invoice:
return field_dict
@classmethod
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
d = src_dict.copy()
amount_due = d.pop("amount_due", UNSET)

View File

@ -5,7 +5,7 @@ import attr
from ..models.currency import Currency
from ..types import UNSET, Unset
P = TypeVar("P", bound="InvoiceLineItem")
Y = TypeVar("Y", bound="InvoiceLineItem")
@attr.s(auto_attribs=True)
@ -49,7 +49,7 @@ class InvoiceLineItem:
return field_dict
@classmethod
def from_dict(cls: Type[P], src_dict: Dict[str, Any]) -> P:
def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
d = src_dict.copy()
amount = d.pop("amount", UNSET)

View File

@ -7,7 +7,7 @@ from ..models.jetstream_stats import JetstreamStats
from ..models.meta_cluster_info import MetaClusterInfo
from ..types import UNSET, Unset
C = TypeVar("C", bound="Jetstream")
H = TypeVar("H", bound="Jetstream")
@attr.s(auto_attribs=True)
@ -41,7 +41,7 @@ class Jetstream:
return field_dict
@classmethod
def from_dict(cls: Type[C], src_dict: Dict[str, Any]) -> C:
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
d = src_dict.copy()
_config = d.pop("config", UNSET)
config: Union[Unset, JetstreamConfig]

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
U = TypeVar("U", bound="JetstreamApiStats")
K = TypeVar("K", bound="JetstreamApiStats")
@attr.s(auto_attribs=True)
@ -35,7 +35,7 @@ class JetstreamApiStats:
return field_dict
@classmethod
def from_dict(cls: Type[U], src_dict: Dict[str, Any]) -> U:
def from_dict(cls: Type[K], src_dict: Dict[str, Any]) -> K:
d = src_dict.copy()
errors = d.pop("errors", UNSET)

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
S = TypeVar("S", bound="JetstreamConfig")
V = TypeVar("V", bound="JetstreamConfig")
@attr.s(auto_attribs=True)
@ -39,7 +39,7 @@ class JetstreamConfig:
return field_dict
@classmethod
def from_dict(cls: Type[S], src_dict: Dict[str, Any]) -> S:
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
d = src_dict.copy()
domain = d.pop("domain", UNSET)

View File

@ -5,7 +5,7 @@ import attr
from ..models.jetstream_api_stats import JetstreamApiStats
from ..types import UNSET, Unset
K = TypeVar("K", bound="JetstreamStats")
R = TypeVar("R", bound="JetstreamStats")
@attr.s(auto_attribs=True)
@ -53,7 +53,7 @@ class JetstreamStats:
return field_dict
@classmethod
def from_dict(cls: Type[K], src_dict: Dict[str, Any]) -> K:
def from_dict(cls: Type[R], src_dict: Dict[str, Any]) -> R:
d = src_dict.copy()
accounts = d.pop("accounts", UNSET)

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
Q = TypeVar("Q", bound="LeafNode")
N = TypeVar("N", bound="LeafNode")
@attr.s(auto_attribs=True)
@ -39,7 +39,7 @@ class LeafNode:
return field_dict
@classmethod
def from_dict(cls: Type[Q], src_dict: Dict[str, Any]) -> Q:
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
d = src_dict.copy()
auth_timeout = d.pop("auth_timeout", UNSET)

75
kittycad/models/line3d.py Normal file
View File

@ -0,0 +1,75 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.point3d import Point3d
from ..types import UNSET, Unset
P = TypeVar("P", bound="Line3d")
@attr.s(auto_attribs=True)
class Line3d:
"""Command for adding a line.""" # noqa: E501
from_: Union[Unset, Point3d] = UNSET
to: Union[Unset, Point3d] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
if not isinstance(self.from_, Unset):
from_ = self.from_
if not isinstance(self.to, Unset):
to = self.to
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if from_ is not UNSET:
field_dict["from"] = from_
if to is not UNSET:
field_dict["to"] = to
return field_dict
@classmethod
def from_dict(cls: Type[P], src_dict: Dict[str, Any]) -> P:
d = src_dict.copy()
_from_ = d.pop("from", UNSET)
from_: Union[Unset, Point3d]
if isinstance(_from_, Unset):
from_ = UNSET
else:
from_ = Point3d(_from_)
_to = d.pop("to", UNSET)
to: Union[Unset, Point3d]
if isinstance(_to, Unset):
to = UNSET
else:
to = Point3d(_to)
line3d = cls(
from_=from_,
to=to,
)
line3d.additional_properties = d
return line3d
@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

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
F = TypeVar("F", bound="Mesh")
C = TypeVar("C", bound="Mesh")
@attr.s(auto_attribs=True)
@ -25,7 +25,7 @@ class Mesh:
return field_dict
@classmethod
def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
def from_dict(cls: Type[C], src_dict: Dict[str, Any]) -> C:
d = src_dict.copy()
mesh = d.pop("mesh", UNSET)

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
H = TypeVar("H", bound="MetaClusterInfo")
U = TypeVar("U", bound="MetaClusterInfo")
@attr.s(auto_attribs=True)
@ -35,7 +35,7 @@ class MetaClusterInfo:
return field_dict
@classmethod
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
def from_dict(cls: Type[U], src_dict: Dict[str, Any]) -> U:
d = src_dict.copy()
cluster_size = d.pop("cluster_size", UNSET)

View File

@ -11,7 +11,7 @@ from ..models.file_system_metadata import FileSystemMetadata
from ..models.point_e_metadata import PointEMetadata
from ..types import UNSET, Unset
N = TypeVar("N", bound="Metadata")
S = TypeVar("S", bound="Metadata")
@attr.s(auto_attribs=True)
@ -71,7 +71,7 @@ class Metadata:
return field_dict
@classmethod
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
def from_dict(cls: Type[S], src_dict: Dict[str, Any]) -> S:
d = src_dict.copy()
_cache = d.pop("cache", UNSET)
cache: Union[Unset, CacheMetadata]

View File

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

View File

@ -1,3 +1,3 @@
class DrawingCmdId(str):
class ModelingCmdId(str):
def __str__(self) -> str:
return self

View File

@ -2,19 +2,19 @@ from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.drawing_cmd import DrawingCmd
from ..models.drawing_cmd_id import DrawingCmdId
from ..models.modeling_cmd import ModelingCmd
from ..models.modeling_cmd_id import ModelingCmdId
from ..types import UNSET, Unset
L = TypeVar("L", bound="DrawingCmdReq")
Q = TypeVar("Q", bound="ModelingCmdReq")
@attr.s(auto_attribs=True)
class DrawingCmdReq:
"""A graphics command submitted to the KittyCAD engine via the Drawing API.""" # noqa: E501
class ModelingCmdReq:
"""A graphics command submitted to the KittyCAD engine via the Modeling API.""" # noqa: E501
cmd: Union[Unset, DrawingCmd] = UNSET
cmd_id: Union[Unset, DrawingCmdId] = UNSET
cmd: Union[Unset, ModelingCmd] = UNSET
cmd_id: Union[Unset, ModelingCmdId] = UNSET
file_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
@ -39,32 +39,32 @@ class DrawingCmdReq:
return field_dict
@classmethod
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
def from_dict(cls: Type[Q], src_dict: Dict[str, Any]) -> Q:
d = src_dict.copy()
_cmd = d.pop("cmd", UNSET)
cmd: Union[Unset, DrawingCmd]
cmd: Union[Unset, ModelingCmd]
if isinstance(_cmd, Unset):
cmd = UNSET
else:
cmd = _cmd # type: ignore[arg-type]
_cmd_id = d.pop("cmd_id", UNSET)
cmd_id: Union[Unset, DrawingCmdId]
cmd_id: Union[Unset, ModelingCmdId]
if isinstance(_cmd_id, Unset):
cmd_id = UNSET
else:
cmd_id = DrawingCmdId(_cmd_id)
cmd_id = ModelingCmdId(_cmd_id)
file_id = d.pop("file_id", UNSET)
drawing_cmd_req = cls(
modeling_cmd_req = cls(
cmd=cmd,
cmd_id=cmd_id,
file_id=file_id,
)
drawing_cmd_req.additional_properties = d
return drawing_cmd_req
modeling_cmd_req.additional_properties = d
return modeling_cmd_req
@property
def additional_keys(self) -> List[str]:

View File

@ -4,12 +4,12 @@ import attr
from ..types import UNSET, Unset
E = TypeVar("E", bound="DrawingCmdReqBatch")
F = TypeVar("F", bound="ModelingCmdReqBatch")
@attr.s(auto_attribs=True)
class DrawingCmdReqBatch:
"""A batch set of graphics commands submitted to the KittyCAD engine via the Drawing API.""" # noqa: E501
class ModelingCmdReqBatch:
"""A batch set of graphics commands submitted to the KittyCAD engine via the Modeling API.""" # noqa: E501
cmds: Union[Unset, Any] = UNSET
file_id: Union[Unset, str] = UNSET
@ -31,18 +31,18 @@ class DrawingCmdReqBatch:
return field_dict
@classmethod
def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
d = src_dict.copy()
cmds = d.pop("cmds", UNSET)
file_id = d.pop("file_id", UNSET)
drawing_cmd_req_batch = cls(
modeling_cmd_req_batch = cls(
cmds=cmds,
file_id=file_id,
)
drawing_cmd_req_batch.additional_properties = d
return drawing_cmd_req_batch
modeling_cmd_req_batch.additional_properties = d
return modeling_cmd_req_batch
@property
def additional_keys(self) -> List[str]:

View File

@ -4,12 +4,12 @@ import attr
from ..types import UNSET, Unset
Y = TypeVar("Y", bound="DrawingError")
H = TypeVar("H", bound="ModelingError")
@attr.s(auto_attribs=True)
class DrawingError:
"""Why a command submitted to the Drawing API failed.""" # noqa: E501
class ModelingError:
"""Why a command submitted to the Modeling API failed.""" # noqa: E501
error_code: Union[Unset, str] = UNSET
external_message: Union[Unset, str] = UNSET
@ -39,7 +39,7 @@ class DrawingError:
return field_dict
@classmethod
def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
d = src_dict.copy()
error_code = d.pop("error_code", UNSET)
@ -49,15 +49,15 @@ class DrawingError:
status_code = d.pop("status_code", UNSET)
drawing_error = cls(
modeling_error = cls(
error_code=error_code,
external_message=external_message,
internal_message=internal_message,
status_code=status_code,
)
drawing_error.additional_properties = d
return drawing_error
modeling_error.additional_properties = d
return modeling_error
@property
def additional_keys(self) -> List[str]:

View File

@ -2,22 +2,22 @@ from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.drawing_cmd_id import DrawingCmdId
from ..models.modeling_cmd_id import ModelingCmdId
from ..types import UNSET, Unset
from .drawing_error import DrawingError
from .modeling_error import ModelingError
Success = Any
Error = DrawingError
Error = ModelingError
H = TypeVar("H", bound="Cancelled")
N = TypeVar("N", bound="Cancelled")
@attr.s(auto_attribs=True)
class Cancelled:
what_failed: Union[Unset, DrawingCmdId] = UNSET
what_failed: Union[Unset, ModelingCmdId] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
@ -34,14 +34,14 @@ class Cancelled:
return field_dict
@classmethod
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
d = src_dict.copy()
_what_failed = d.pop("what_failed", UNSET)
what_failed: Union[Unset, DrawingCmdId]
what_failed: Union[Unset, ModelingCmdId]
if isinstance(_what_failed, Unset):
what_failed = UNSET
else:
what_failed = DrawingCmdId(_what_failed)
what_failed = ModelingCmdId(_what_failed)
cancelled = cls(
what_failed=what_failed,
@ -67,4 +67,4 @@ class Cancelled:
return key in self.additional_properties
DrawingOutcome = Union[Success, Error, Cancelled]
ModelingOutcome = Union[Success, Error, Cancelled]

View File

@ -4,12 +4,12 @@ import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="DrawingOutcomes")
H = TypeVar("H", bound="ModelingOutcomes")
@attr.s(auto_attribs=True)
class DrawingOutcomes:
"""The result from a batch of drawing commands.""" # noqa: E501
class ModelingOutcomes:
"""The result from a batch of modeling commands.""" # noqa: E501
outcomes: Union[Unset, Any] = UNSET
@ -27,16 +27,16 @@ class DrawingOutcomes:
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
d = src_dict.copy()
outcomes = d.pop("outcomes", UNSET)
drawing_outcomes = cls(
modeling_outcomes = cls(
outcomes=outcomes,
)
drawing_outcomes.additional_properties = d
return drawing_outcomes
modeling_outcomes.additional_properties = d
return modeling_outcomes
@property
def additional_keys(self) -> List[str]:

View File

@ -5,7 +5,7 @@ import attr
from ..models.country_code import CountryCode
from ..types import UNSET, Unset
H = TypeVar("H", bound="NewAddress")
B = TypeVar("B", bound="NewAddress")
@attr.s(auto_attribs=True)
@ -53,7 +53,7 @@ class NewAddress:
return field_dict
@classmethod
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
def from_dict(cls: Type[B], src_dict: Dict[str, Any]) -> B:
d = src_dict.copy()
city = d.pop("city", UNSET)

View File

@ -4,31 +4,31 @@ import attr
from ..types import UNSET, Unset
B = TypeVar("B", bound="Onboarding")
P = TypeVar("P", bound="Onboarding")
@attr.s(auto_attribs=True)
class Onboarding:
"""Onboarding details""" # noqa: E501
first_call_from_their_machine_date: Union[Unset, str] = UNSET
first_call_from__their_machine_date: Union[Unset, str] = UNSET
first_litterbox_execute_date: Union[Unset, str] = UNSET
first_token_date: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
first_call_from_their_machine_date = self.first_call_from_their_machine_date
first_call_from__their_machine_date = self.first_call_from__their_machine_date
first_litterbox_execute_date = self.first_litterbox_execute_date
first_token_date = self.first_token_date
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if first_call_from_their_machine_date is not UNSET:
if first_call_from__their_machine_date is not UNSET:
field_dict[
"first_call_from_their_machine_date"
] = first_call_from_their_machine_date
] = first_call_from__their_machine_date
if first_litterbox_execute_date is not UNSET:
field_dict["first_litterbox_execute_date"] = first_litterbox_execute_date
if first_token_date is not UNSET:
@ -37,9 +37,9 @@ class Onboarding:
return field_dict
@classmethod
def from_dict(cls: Type[B], src_dict: Dict[str, Any]) -> B:
def from_dict(cls: Type[P], src_dict: Dict[str, Any]) -> P:
d = src_dict.copy()
first_call_from_their_machine_date = d.pop(
first_call_from__their_machine_date = d.pop(
"first_call_from_their_machine_date", UNSET
)
@ -48,7 +48,7 @@ class Onboarding:
first_token_date = d.pop("first_token_date", UNSET)
onboarding = cls(
first_call_from_their_machine_date=first_call_from_their_machine_date,
first_call_from__their_machine_date=first_call_from__their_machine_date,
first_litterbox_execute_date=first_litterbox_execute_date,
first_token_date=first_token_date,
)

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
P = TypeVar("P", bound="OutputFile")
J = TypeVar("J", bound="OutputFile")
@attr.s(auto_attribs=True)
@ -31,7 +31,7 @@ class OutputFile:
return field_dict
@classmethod
def from_dict(cls: Type[P], src_dict: Dict[str, Any]) -> P:
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
d = src_dict.copy()
contents = d.pop("contents", UNSET)

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
J = TypeVar("J", bound="PaymentIntent")
T = TypeVar("T", bound="PaymentIntent")
@attr.s(auto_attribs=True)
@ -27,7 +27,7 @@ class PaymentIntent:
return field_dict
@classmethod
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
client_secret = d.pop("client_secret", UNSET)

View File

@ -9,7 +9,7 @@ from ..models.card_details import CardDetails
from ..models.payment_method_type import PaymentMethodType
from ..types import UNSET, Unset
T = TypeVar("T", bound="PaymentMethod")
V = TypeVar("V", bound="PaymentMethod")
@attr.s(auto_attribs=True)
@ -57,7 +57,7 @@ class PaymentMethod:
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
d = src_dict.copy()
_billing_info = d.pop("billing_info", UNSET)
billing_info: Union[Unset, BillingInfo]

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
V = TypeVar("V", bound="PaymentMethodCardChecks")
C = TypeVar("C", bound="PaymentMethodCardChecks")
@attr.s(auto_attribs=True)
@ -35,7 +35,7 @@ class PaymentMethodCardChecks:
return field_dict
@classmethod
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
def from_dict(cls: Type[C], src_dict: Dict[str, Any]) -> C:
d = src_dict.copy()
address_line1_check = d.pop("address_line1_check", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.physics_constant_name import PhysicsConstantName
from ..models.uuid import Uuid
from ..types import UNSET, Unset
C = TypeVar("C", bound="PhysicsConstant")
R = TypeVar("R", bound="PhysicsConstant")
@attr.s(auto_attribs=True)
@ -77,7 +78,7 @@ class PhysicsConstant:
return field_dict
@classmethod
def from_dict(cls: Type[C], src_dict: Dict[str, Any]) -> C:
def from_dict(cls: Type[R], src_dict: Dict[str, Any]) -> R:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -102,7 +103,12 @@ class PhysicsConstant:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
_started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime]

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
R = TypeVar("R", bound="PluginsInfo")
C = TypeVar("C", bound="PluginsInfo")
@attr.s(auto_attribs=True)
@ -49,7 +49,7 @@ class PluginsInfo:
return field_dict
@classmethod
def from_dict(cls: Type[R], src_dict: Dict[str, Any]) -> R:
def from_dict(cls: Type[C], src_dict: Dict[str, Any]) -> C:
d = src_dict.copy()
authorization = cast(List[str], d.pop("authorization", UNSET))

View File

@ -0,0 +1,62 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
E = TypeVar("E", bound="Point2d")
@attr.s(auto_attribs=True)
class Point2d:
"""A point in 2D space""" # noqa: E501
x: Union[Unset, float] = UNSET
y: Union[Unset, float] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
x = self.x
y = self.y
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if x is not UNSET:
field_dict["x"] = x
if y is not UNSET:
field_dict["y"] = y
return field_dict
@classmethod
def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
d = src_dict.copy()
x = d.pop("x", UNSET)
y = d.pop("y", UNSET)
point2d = cls(
x=x,
y=y,
)
point2d.additional_properties = d
return point2d
@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,69 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
M = TypeVar("M", bound="Point3d")
@attr.s(auto_attribs=True)
class Point3d:
"""A point in 3D space""" # noqa: E501
x: Union[Unset, float] = UNSET
y: Union[Unset, float] = UNSET
z: Union[Unset, float] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
x = self.x
y = self.y
z = self.z
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if x is not UNSET:
field_dict["x"] = x
if y is not UNSET:
field_dict["y"] = y
if z is not UNSET:
field_dict["z"] = z
return field_dict
@classmethod
def from_dict(cls: Type[M], src_dict: Dict[str, Any]) -> M:
d = src_dict.copy()
x = d.pop("x", UNSET)
y = d.pop("y", UNSET)
z = d.pop("z", UNSET)
point3d = cls(
x=x,
y=y,
z=z,
)
point3d.additional_properties = d
return point3d
@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

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
C = TypeVar("C", bound="PointEMetadata")
S = TypeVar("S", bound="PointEMetadata")
@attr.s(auto_attribs=True)
@ -29,7 +29,7 @@ class PointEMetadata:
return field_dict
@classmethod
def from_dict(cls: Type[C], src_dict: Dict[str, Any]) -> C:
def from_dict(cls: Type[S], src_dict: Dict[str, Any]) -> S:
d = src_dict.copy()
ok = d.pop("ok", UNSET)

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
E = TypeVar("E", bound="Pong")
L = TypeVar("L", bound="Pong")
@attr.s(auto_attribs=True)
@ -27,7 +27,7 @@ class Pong:
return field_dict
@classmethod
def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
d = src_dict.copy()
message = d.pop("message", UNSET)

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
M = TypeVar("M", bound="RegistryServiceConfig")
T = TypeVar("T", bound="RegistryServiceConfig")
@attr.s(auto_attribs=True)
@ -59,7 +59,7 @@ class RegistryServiceConfig:
return field_dict
@classmethod
def from_dict(cls: Type[M], src_dict: Dict[str, Any]) -> M:
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
allow_nondistributable_artifacts_cid_rs = cast(
List[str], d.pop("allow_nondistributable_artifacts_cid_rs", UNSET)

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
S = TypeVar("S", bound="Runtime")
E = TypeVar("E", bound="Runtime")
@attr.s(auto_attribs=True)
@ -33,7 +33,7 @@ class Runtime:
return field_dict
@classmethod
def from_dict(cls: Type[S], src_dict: Dict[str, Any]) -> S:
def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
d = src_dict.copy()
path = d.pop("path", UNSET)

View File

@ -4,9 +4,10 @@ from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from ..models.uuid import Uuid
from ..types import UNSET, Unset
L = TypeVar("L", bound="Session")
D = TypeVar("D", bound="Session")
@attr.s(auto_attribs=True)
@ -57,7 +58,7 @@ class Session:
return field_dict
@classmethod
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
def from_dict(cls: Type[D], src_dict: Dict[str, Any]) -> D:
d = src_dict.copy()
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
@ -75,7 +76,12 @@ class Session:
id = d.pop("id", UNSET)
session_token = d.pop("session_token", UNSET)
_session_token = d.pop("session_token", UNSET)
session_token: Union[Unset, Uuid]
if isinstance(_session_token, Unset):
session_token = UNSET
else:
session_token = Uuid(_session_token)
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="SystemInfoDefaultAddressPools")
Y = TypeVar("Y", bound="SystemInfoDefaultAddressPools")
@attr.s(auto_attribs=True)
@ -29,7 +29,7 @@ class SystemInfoDefaultAddressPools:
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
d = src_dict.copy()
base = d.pop("base", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_acceleration_format import UnitAccelerationFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
E = TypeVar("E", bound="UnitAccelerationConversion")
Y = TypeVar("Y", bound="UnitAccelerationConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitAccelerationConversion:
return field_dict
@classmethod
def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitAccelerationConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,6 +6,7 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_angle_format import UnitAngleFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
D = TypeVar("D", bound="UnitAngleConversion")
@ -104,7 +105,12 @@ class UnitAngleConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_angular_velocity_format import UnitAngularVelocityFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
Y = TypeVar("Y", bound="UnitAngularVelocityConversion")
F = TypeVar("F", bound="UnitAngularVelocityConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitAngularVelocityConversion:
return field_dict
@classmethod
def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitAngularVelocityConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_area_format import UnitAreaFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
Y = TypeVar("Y", bound="UnitAreaConversion")
Z = TypeVar("Z", bound="UnitAreaConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitAreaConversion:
return field_dict
@classmethod
def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
def from_dict(cls: Type[Z], src_dict: Dict[str, Any]) -> Z:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitAreaConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_charge_format import UnitChargeFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
D = TypeVar("D", bound="UnitChargeConversion")
G = TypeVar("G", bound="UnitChargeConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitChargeConversion:
return field_dict
@classmethod
def from_dict(cls: Type[D], src_dict: Dict[str, Any]) -> D:
def from_dict(cls: Type[G], src_dict: Dict[str, Any]) -> G:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitChargeConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_concentration_format import UnitConcentrationFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
F = TypeVar("F", bound="UnitConcentrationConversion")
L = TypeVar("L", bound="UnitConcentrationConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitConcentrationConversion:
return field_dict
@classmethod
def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitConcentrationConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_data_format import UnitDataFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
Z = TypeVar("Z", bound="UnitDataConversion")
N = TypeVar("N", bound="UnitDataConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitDataConversion:
return field_dict
@classmethod
def from_dict(cls: Type[Z], src_dict: Dict[str, Any]) -> Z:
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitDataConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_data_transfer_rate_format import UnitDataTransferRateFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
G = TypeVar("G", bound="UnitDataTransferRateConversion")
N = TypeVar("N", bound="UnitDataTransferRateConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitDataTransferRateConversion:
return field_dict
@classmethod
def from_dict(cls: Type[G], src_dict: Dict[str, Any]) -> G:
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitDataTransferRateConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_density_format import UnitDensityFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
L = TypeVar("L", bound="UnitDensityConversion")
H = TypeVar("H", bound="UnitDensityConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitDensityConversion:
return field_dict
@classmethod
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitDensityConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_energy_format import UnitEnergyFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
N = TypeVar("N", bound="UnitEnergyConversion")
V = TypeVar("V", bound="UnitEnergyConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitEnergyConversion:
return field_dict
@classmethod
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitEnergyConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_force_format import UnitForceFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
N = TypeVar("N", bound="UnitForceConversion")
E = TypeVar("E", bound="UnitForceConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitForceConversion:
return field_dict
@classmethod
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitForceConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_illuminance_format import UnitIlluminanceFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
H = TypeVar("H", bound="UnitIlluminanceConversion")
T = TypeVar("T", bound="UnitIlluminanceConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitIlluminanceConversion:
return field_dict
@classmethod
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
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]
@ -104,7 +105,12 @@ class UnitIlluminanceConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_length_format import UnitLengthFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
V = TypeVar("V", bound="UnitLengthConversion")
Q = TypeVar("Q", bound="UnitLengthConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitLengthConversion:
return field_dict
@classmethod
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
def from_dict(cls: Type[Q], src_dict: Dict[str, Any]) -> Q:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitLengthConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_magnetic_field_strength_format import UnitMagneticFieldStrengthFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
E = TypeVar("E", bound="UnitMagneticFieldStrengthConversion")
F = TypeVar("F", bound="UnitMagneticFieldStrengthConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitMagneticFieldStrengthConversion:
return field_dict
@classmethod
def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitMagneticFieldStrengthConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_magnetic_flux_format import UnitMagneticFluxFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
T = TypeVar("T", bound="UnitMagneticFluxConversion")
D = TypeVar("D", bound="UnitMagneticFluxConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitMagneticFluxConversion:
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
def from_dict(cls: Type[D], src_dict: Dict[str, Any]) -> D:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitMagneticFluxConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_mass_format import UnitMassFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
Q = TypeVar("Q", bound="UnitMassConversion")
J = TypeVar("J", bound="UnitMassConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitMassConversion:
return field_dict
@classmethod
def from_dict(cls: Type[Q], src_dict: Dict[str, Any]) -> Q:
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitMassConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,6 +6,7 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_metric_power import UnitMetricPower
from ..models.uuid import Uuid
from ..types import UNSET, Unset
F = TypeVar("F", bound="UnitMetricPowerConversion")
@ -104,7 +105,12 @@ class UnitMetricPowerConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_metric_power import UnitMetricPower
from ..models.uuid import Uuid
from ..types import UNSET, Unset
D = TypeVar("D", bound="UnitMetricPowerCubedConversion")
V = TypeVar("V", bound="UnitMetricPowerCubedConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitMetricPowerCubedConversion:
return field_dict
@classmethod
def from_dict(cls: Type[D], src_dict: Dict[str, Any]) -> D:
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitMetricPowerCubedConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_metric_power import UnitMetricPower
from ..models.uuid import Uuid
from ..types import UNSET, Unset
J = TypeVar("J", bound="UnitMetricPowerSquaredConversion")
U = TypeVar("U", bound="UnitMetricPowerSquaredConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitMetricPowerSquaredConversion:
return field_dict
@classmethod
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
def from_dict(cls: Type[U], src_dict: Dict[str, Any]) -> U:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitMetricPowerSquaredConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,6 +6,7 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_power_format import UnitPowerFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
F = TypeVar("F", bound="UnitPowerConversion")
@ -104,7 +105,12 @@ class UnitPowerConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_pressure_format import UnitPressureFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
V = TypeVar("V", bound="UnitPressureConversion")
Y = TypeVar("Y", bound="UnitPressureConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitPressureConversion:
return field_dict
@classmethod
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitPressureConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_radiation_format import UnitRadiationFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
U = TypeVar("U", bound="UnitRadiationConversion")
F = TypeVar("F", bound="UnitRadiationConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitRadiationConversion:
return field_dict
@classmethod
def from_dict(cls: Type[U], src_dict: Dict[str, Any]) -> U:
def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitRadiationConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_radioactivity_format import UnitRadioactivityFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
F = TypeVar("F", bound="UnitRadioactivityConversion")
P = TypeVar("P", bound="UnitRadioactivityConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitRadioactivityConversion:
return field_dict
@classmethod
def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
def from_dict(cls: Type[P], src_dict: Dict[str, Any]) -> P:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitRadioactivityConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,6 +6,7 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_solid_angle_format import UnitSolidAngleFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
Y = TypeVar("Y", bound="UnitSolidAngleConversion")
@ -104,7 +105,12 @@ class UnitSolidAngleConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_temperature_format import UnitTemperatureFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
F = TypeVar("F", bound="UnitTemperatureConversion")
L = TypeVar("L", bound="UnitTemperatureConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitTemperatureConversion:
return field_dict
@classmethod
def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitTemperatureConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_time_format import UnitTimeFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
P = TypeVar("P", bound="UnitTimeConversion")
K = TypeVar("K", bound="UnitTimeConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitTimeConversion:
return field_dict
@classmethod
def from_dict(cls: Type[P], src_dict: Dict[str, Any]) -> P:
def from_dict(cls: Type[K], src_dict: Dict[str, Any]) -> K:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitTimeConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_velocity_format import UnitVelocityFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
Y = TypeVar("Y", bound="UnitVelocityConversion")
N = TypeVar("N", bound="UnitVelocityConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitVelocityConversion:
return field_dict
@classmethod
def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitVelocityConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_voltage_format import UnitVoltageFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
L = TypeVar("L", bound="UnitVoltageConversion")
H = TypeVar("H", bound="UnitVoltageConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitVoltageConversion:
return field_dict
@classmethod
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitVoltageConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -6,9 +6,10 @@ from dateutil.parser import isoparse
from ..models.api_call_status import ApiCallStatus
from ..models.unit_volume_format import UnitVolumeFormat
from ..models.uuid import Uuid
from ..types import UNSET, Unset
K = TypeVar("K", bound="UnitVolumeConversion")
A = TypeVar("A", bound="UnitVolumeConversion")
@attr.s(auto_attribs=True)
@ -86,7 +87,7 @@ class UnitVolumeConversion:
return field_dict
@classmethod
def from_dict(cls: Type[K], src_dict: Dict[str, Any]) -> K:
def from_dict(cls: Type[A], src_dict: Dict[str, Any]) -> A:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
@ -104,7 +105,12 @@ class UnitVolumeConversion:
error = d.pop("error", UNSET)
id = d.pop("id", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
input = d.pop("input", UNSET)

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset
N = TypeVar("N", bound="UpdateUser")
R = TypeVar("R", bound="UpdateUser")
@attr.s(auto_attribs=True)
@ -47,7 +47,7 @@ class UpdateUser:
return field_dict
@classmethod
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
def from_dict(cls: Type[R], src_dict: Dict[str, Any]) -> R:
d = src_dict.copy()
company = d.pop("company", UNSET)

Some files were not shown because too many files have changed in this diff Show More