Update api spec (#98)

* YOYO NEW API SPEC!

* fixups

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

* updates

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-07-07 18:03:18 -07:00
committed by GitHub
parent c6af833ec5
commit d0a345acd0
87 changed files with 1522 additions and 506 deletions

View File

@ -292,14 +292,20 @@ def generateTypeAndExamplePython(
logging.error("schema: %s", json.dumps(schema, indent=4)) logging.error("schema: %s", json.dumps(schema, indent=4))
raise Exception("Unknown parameter type") raise Exception("Unknown parameter type")
elif "oneOf" in schema and len(schema["oneOf"]) > 0: elif "oneOf" in schema and len(schema["oneOf"]) > 0:
one_of = schema["oneOf"][0]
# Check if each of these only has a object w 1 property. # Check if each of these only has a object w 1 property.
if isNestedObjectOneOf(schema): if isNestedObjectOneOf(schema):
properties = schema["oneOf"][0]["properties"] if "properties" in one_of:
for prop in properties: properties = one_of["properties"]
for prop in properties:
return generateTypeAndExamplePython(
prop, properties[prop], data, camel_to_snake(name)
)
break
elif "type" in one_of and one_of["type"] == "string":
return generateTypeAndExamplePython( return generateTypeAndExamplePython(
prop, properties[prop], data, camel_to_snake(name) name, one_of, data, camel_to_snake(name)
) )
break
return generateTypeAndExamplePython(name, schema["oneOf"][0], data, None) return generateTypeAndExamplePython(name, schema["oneOf"][0], data, None)
elif "allOf" in schema and len(schema["allOf"]) == 1: elif "allOf" in schema and len(schema["allOf"]) == 1:
@ -1249,6 +1255,21 @@ def generateEnumType(
logging.info("generating type: ", name, " at: ", path) logging.info("generating type: ", name, " at: ", path)
f = open(path, "w") f = open(path, "w")
code = generateEnumTypeCode(name, schema, type_name, additional_docs)
f.write(code)
# Close the file.
f.close()
def generateEnumTypeCode(
name: str,
schema: dict,
type_name: str,
additional_docs: List[str],
) -> str:
f = io.StringIO()
f.write("from enum import Enum\n") f.write("from enum import Enum\n")
f.write("\n") f.write("\n")
f.write("class " + name + "(str, Enum):\n") f.write("class " + name + "(str, Enum):\n")
@ -1276,9 +1297,13 @@ def generateEnumType(
f.write("\tdef __str__(self) -> str:\n") f.write("\tdef __str__(self) -> str:\n")
f.write("\t\treturn str(self.value)\n") f.write("\t\treturn str(self.value)\n")
value = f.getvalue()
# Close the file. # Close the file.
f.close() f.close()
return value
def generateOneOfType(path: str, name: str, schema: dict, data: dict): def generateOneOfType(path: str, name: str, schema: dict, data: dict):
logging.info("generating type: ", name, " at: ", path) logging.info("generating type: ", name, " at: ", path)
@ -1316,35 +1341,43 @@ def generateOneOfType(path: str, name: str, schema: dict, data: dict):
# We want to write each of the nested objects. # We want to write each of the nested objects.
for one_of in schema["oneOf"]: for one_of in schema["oneOf"]:
# Get the nested object. # Get the nested object.
for prop_name in one_of["properties"]: if "properties" in one_of:
nested_object = one_of["properties"][prop_name] for prop_name in one_of["properties"]:
if nested_object == {}: nested_object = one_of["properties"][prop_name]
f.write("from typing import Any\n") if nested_object == {}:
f.write(prop_name + " = Any\n") f.write("from typing import Any\n")
f.write("\n") f.write(prop_name + " = Any\n")
all_options.append(prop_name)
elif "$ref" in nested_object:
ref = nested_object["$ref"]
ref_name = ref[ref.rfind("/") + 1 :]
f.write(
"from ."
+ camel_to_snake(ref_name)
+ " import "
+ ref_name
+ "\n"
)
f.write("\n")
if prop_name != ref_name:
f.write(prop_name + " = " + ref_name + "\n")
f.write("\n") f.write("\n")
all_options.append(prop_name) all_options.append(prop_name)
else: elif "$ref" in nested_object:
object_code = generateObjectTypeCode( ref = nested_object["$ref"]
prop_name, nested_object, "object", data ref_name = ref[ref.rfind("/") + 1 :]
) f.write(
f.write(object_code) "from ."
f.write("\n") + camel_to_snake(ref_name)
all_options.append(prop_name) + " import "
+ ref_name
+ "\n"
)
f.write("\n")
if prop_name != ref_name:
f.write(prop_name + " = " + ref_name + "\n")
f.write("\n")
all_options.append(prop_name)
else:
object_code = generateObjectTypeCode(
prop_name, nested_object, "object", data
)
f.write(object_code)
f.write("\n")
all_options.append(prop_name)
elif "type" in one_of and one_of["type"] == "string":
enum_code = generateEnumTypeCode(
one_of["enum"][0], one_of, "string", []
)
f.write(enum_code)
f.write("\n")
all_options.append(one_of["enum"][0])
# Check if each one_of has the same enum of one. # Check if each one_of has the same enum of one.
tag = None tag = None
@ -2290,6 +2323,10 @@ def isNestedObjectOneOf(schema: dict) -> bool:
else: else:
is_nested_object = False is_nested_object = False
break break
elif (
one_of["type"] == "string" and "enum" in one_of and len(one_of["enum"]) == 1
):
is_nested_object = True
else: else:
is_nested_object = False is_nested_object = False
break break

View File

@ -18,7 +18,7 @@ poetry run isort .
poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py
poetry run ruff check --fix . poetry run ruff check --fix .
# We ignore errors here but we should eventually fix them. # We ignore errors here but we should eventually fix them.
poetry run mypy . poetry run mypy . || true
# Run the tests. # Run the tests.

File diff suppressed because one or more lines are too long

View File

@ -142,12 +142,11 @@ from kittycad.models.email_authentication_form import EmailAuthenticationForm
from kittycad.models.file_export_format import FileExportFormat from kittycad.models.file_export_format import FileExportFormat
from kittycad.models.file_import_format import FileImportFormat from kittycad.models.file_import_format import FileImportFormat
from kittycad.models.image_type import ImageType from kittycad.models.image_type import ImageType
from kittycad.models.line3d import Line3d from kittycad.models.modeling_cmd import ModelingCmd
from kittycad.models.modeling_cmd_id import ModelingCmdId from kittycad.models.modeling_cmd_id import ModelingCmdId
from kittycad.models.modeling_cmd_req import ModelingCmdReq from kittycad.models.modeling_cmd_req import ModelingCmdReq
from kittycad.models.modeling_cmd_req_batch import ModelingCmdReqBatch from kittycad.models.modeling_cmd_req_batch import ModelingCmdReqBatch
from kittycad.models.physics_constant_name import PhysicsConstantName from kittycad.models.physics_constant_name import PhysicsConstantName
from kittycad.models.point3d import Point3d
from kittycad.models.unit_angle import UnitAngle from kittycad.models.unit_angle import UnitAngle
from kittycad.models.unit_area import UnitArea from kittycad.models.unit_area import UnitArea
from kittycad.models.unit_current import UnitCurrent from kittycad.models.unit_current import UnitCurrent
@ -1403,18 +1402,7 @@ def test_cmd():
cmd.sync( cmd.sync(
client=client, client=client,
body=ModelingCmdReq( body=ModelingCmdReq(
cmd=Line3d( cmd=ModelingCmd.START_PATH,
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>"), cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>", file_id="<string>",
), ),
@ -1424,18 +1412,7 @@ def test_cmd():
cmd.sync_detailed( cmd.sync_detailed(
client=client, client=client,
body=ModelingCmdReq( body=ModelingCmdReq(
cmd=Line3d( cmd=ModelingCmd.START_PATH,
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>"), cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>", file_id="<string>",
), ),
@ -1452,18 +1429,7 @@ async def test_cmd_async():
await cmd.asyncio( await cmd.asyncio(
client=client, client=client,
body=ModelingCmdReq( body=ModelingCmdReq(
cmd=Line3d( cmd=ModelingCmd.START_PATH,
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>"), cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>", file_id="<string>",
), ),
@ -1473,18 +1439,7 @@ async def test_cmd_async():
await cmd.asyncio_detailed( await cmd.asyncio_detailed(
client=client, client=client,
body=ModelingCmdReq( body=ModelingCmdReq(
cmd=Line3d( cmd=ModelingCmd.START_PATH,
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>"), cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>", file_id="<string>",
), ),
@ -1501,18 +1456,7 @@ def test_cmd_batch():
body=ModelingCmdReqBatch( body=ModelingCmdReqBatch(
cmds={ cmds={
"<string>": ModelingCmdReq( "<string>": ModelingCmdReq(
cmd=Line3d( cmd=ModelingCmd.START_PATH,
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>"), cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>", file_id="<string>",
) )
@ -1536,18 +1480,7 @@ def test_cmd_batch():
body=ModelingCmdReqBatch( body=ModelingCmdReqBatch(
cmds={ cmds={
"<string>": ModelingCmdReq( "<string>": ModelingCmdReq(
cmd=Line3d( cmd=ModelingCmd.START_PATH,
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>"), cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>", file_id="<string>",
) )
@ -1569,18 +1502,7 @@ async def test_cmd_batch_async():
body=ModelingCmdReqBatch( body=ModelingCmdReqBatch(
cmds={ cmds={
"<string>": ModelingCmdReq( "<string>": ModelingCmdReq(
cmd=Line3d( cmd=ModelingCmd.START_PATH,
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>"), cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>", file_id="<string>",
) )
@ -1597,18 +1519,7 @@ async def test_cmd_batch_async():
body=ModelingCmdReqBatch( body=ModelingCmdReqBatch(
cmds={ cmds={
"<string>": ModelingCmdReq( "<string>": ModelingCmdReq(
cmd=Line3d( cmd=ModelingCmd.START_PATH,
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>"), cmd_id=ModelingCmdId("<uuid>"),
file_id="<string>", file_id="<string>",
) )

View File

@ -21,6 +21,7 @@ from .async_api_call_results_page import AsyncApiCallResultsPage
from .async_api_call_type import AsyncApiCallType from .async_api_call_type import AsyncApiCallType
from .billing_info import BillingInfo from .billing_info import BillingInfo
from .cache_metadata import CacheMetadata from .cache_metadata import CacheMetadata
from .camera_drag_interaction_type import CameraDragInteractionType
from .card_details import CardDetails from .card_details import CardDetails
from .cluster import Cluster from .cluster import Cluster
from .code_language import CodeLanguage from .code_language import CodeLanguage
@ -28,6 +29,7 @@ from .code_output import CodeOutput
from .commit import Commit from .commit import Commit
from .connection import Connection from .connection import Connection
from .country_code import CountryCode from .country_code import CountryCode
from .coupon import Coupon
from .created_at_sort_mode import CreatedAtSortMode from .created_at_sort_mode import CreatedAtSortMode
from .currency import Currency from .currency import Currency
from .customer import Customer from .customer import Customer
@ -35,6 +37,7 @@ from .customer_balance import CustomerBalance
from .device_access_token_request_form import DeviceAccessTokenRequestForm from .device_access_token_request_form import DeviceAccessTokenRequestForm
from .device_auth_request_form import DeviceAuthRequestForm from .device_auth_request_form import DeviceAuthRequestForm
from .device_auth_verify_params import DeviceAuthVerifyParams from .device_auth_verify_params import DeviceAuthVerifyParams
from .discount import Discount
from .docker_system_info import DockerSystemInfo from .docker_system_info import DockerSystemInfo
from .email_authentication_form import EmailAuthenticationForm from .email_authentication_form import EmailAuthenticationForm
from .engine_metadata import EngineMetadata from .engine_metadata import EngineMetadata
@ -64,7 +67,6 @@ from .jetstream_api_stats import JetstreamApiStats
from .jetstream_config import JetstreamConfig from .jetstream_config import JetstreamConfig
from .jetstream_stats import JetstreamStats from .jetstream_stats import JetstreamStats
from .leaf_node import LeafNode from .leaf_node import LeafNode
from .line3d import Line3d
from .mesh import Mesh from .mesh import Mesh
from .meta_cluster_info import MetaClusterInfo from .meta_cluster_info import MetaClusterInfo
from .metadata import Metadata from .metadata import Metadata
@ -81,6 +83,7 @@ from .o_auth2_client_info import OAuth2ClientInfo
from .o_auth2_grant_type import OAuth2GrantType from .o_auth2_grant_type import OAuth2GrantType
from .onboarding import Onboarding from .onboarding import Onboarding
from .output_file import OutputFile from .output_file import OutputFile
from .path_segment import PathSegment
from .payment_intent import PaymentIntent from .payment_intent import PaymentIntent
from .payment_method import PaymentMethod from .payment_method import PaymentMethod
from .payment_method_card_checks import PaymentMethodCardChecks from .payment_method_card_checks import PaymentMethodCardChecks

View File

@ -46,7 +46,7 @@ class AiPluginApi:
if isinstance(_type, Unset): if isinstance(_type, Unset):
type = UNSET type = UNSET
else: else:
type = AiPluginApiType(_type) type = _type # type: ignore[arg-type]
url = d.pop("url", UNSET) url = d.pop("url", UNSET)

View File

@ -42,14 +42,14 @@ class AiPluginAuth:
if isinstance(_authorization_type, Unset): if isinstance(_authorization_type, Unset):
authorization_type = UNSET authorization_type = UNSET
else: else:
authorization_type = AiPluginHttpAuthType(_authorization_type) authorization_type = _authorization_type # type: ignore[arg-type]
_type = d.pop("type", UNSET) _type = d.pop("type", UNSET)
type: Union[Unset, AiPluginAuthType] type: Union[Unset, AiPluginAuthType]
if isinstance(_type, Unset): if isinstance(_type, Unset):
type = UNSET type = UNSET
else: else:
type = AiPluginAuthType(_type) type = _type # type: ignore[arg-type]
ai_plugin_auth = cls( ai_plugin_auth = cls(
authorization_type=authorization_type, authorization_type=authorization_type,

View File

@ -164,7 +164,7 @@ class ApiCallWithPrice:
if isinstance(_method, Unset): if isinstance(_method, Unset):
method = UNSET method = UNSET
else: else:
method = Method(_method) method = _method # type: ignore[arg-type]
minutes = d.pop("minutes", UNSET) minutes = d.pop("minutes", UNSET)

View File

@ -125,14 +125,14 @@ class AsyncApiCall:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_type = d.pop("type", UNSET) _type = d.pop("type", UNSET)
type: Union[Unset, AsyncApiCallType] type: Union[Unset, AsyncApiCallType]
if isinstance(_type, Unset): if isinstance(_type, Unset):
type = UNSET type = UNSET
else: else:
type = AsyncApiCallType(_type) type = _type # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -120,14 +120,14 @@ class FileConversion:
if isinstance(_output_format, Unset): if isinstance(_output_format, Unset):
output_format = UNSET output_format = UNSET
else: else:
output_format = FileExportFormat(_output_format) output_format = _output_format # type: ignore[arg-type]
_src_format = d.pop("src_format", UNSET) _src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, FileImportFormat] src_format: Union[Unset, FileImportFormat]
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -141,7 +141,7 @@ class FileConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
type = d.pop("type", UNSET) type = d.pop("type", UNSET)
@ -296,7 +296,7 @@ class FileCenterOfMass:
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -310,7 +310,7 @@ class FileCenterOfMass:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
type = d.pop("type", UNSET) type = d.pop("type", UNSET)
@ -468,7 +468,7 @@ class FileMass:
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -482,7 +482,7 @@ class FileMass:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
type = d.pop("type", UNSET) type = d.pop("type", UNSET)
@ -633,7 +633,7 @@ class FileVolume:
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -647,7 +647,7 @@ class FileVolume:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
type = d.pop("type", UNSET) type = d.pop("type", UNSET)
@ -807,7 +807,7 @@ class FileDensity:
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -821,7 +821,7 @@ class FileDensity:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
type = d.pop("type", UNSET) type = d.pop("type", UNSET)
@ -972,7 +972,7 @@ class FileSurfaceArea:
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -986,7 +986,7 @@ class FileSurfaceArea:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
surface_area = d.pop("surface_area", UNSET) surface_area = d.pop("surface_area", UNSET)

View File

@ -0,0 +1,15 @@
from enum import Enum
class CameraDragInteractionType(str, Enum):
"""The type of camera drag interaction.""" # noqa: E501
"""# Camera pan """ # noqa: E501
PAN = "pan"
"""# Camera rotate (revolve/orbit) """ # noqa: E501
ROTATE = "rotate"
"""# Camera zoom (increase or decrease distance to reference point center) """ # noqa: E501
ZOOM = "zoom"
def __str__(self) -> str:
return str(self.value)

View File

@ -4,8 +4,11 @@ from enum import Enum
class CodeLanguage(str, Enum): class CodeLanguage(str, Enum):
"""The language code is written in.""" # noqa: E501 """The language code is written in.""" # noqa: E501
"""# The `go` programming language. """ # noqa: E501
GO = "go" GO = "go"
"""# The `python` programming language. """ # noqa: E501
PYTHON = "python" PYTHON = "python"
"""# The `node` programming language. """ # noqa: E501
NODE = "node" NODE = "node"
def __str__(self) -> str: def __str__(self) -> str:

76
kittycad/models/coupon.py Normal file
View File

@ -0,0 +1,76 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
M = TypeVar("M", bound="Coupon")
@attr.s(auto_attribs=True)
class Coupon:
"""The resource representing a Coupon.""" # noqa: E501
amount_off: Union[Unset, float] = UNSET
deleted: Union[Unset, bool] = False
id: Union[Unset, str] = UNSET
percent_off: Union[Unset, float] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
amount_off = self.amount_off
deleted = self.deleted
id = self.id
percent_off = self.percent_off
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if amount_off is not UNSET:
field_dict["amount_off"] = amount_off
if deleted is not UNSET:
field_dict["deleted"] = deleted
if id is not UNSET:
field_dict["id"] = id
if percent_off is not UNSET:
field_dict["percent_off"] = percent_off
return field_dict
@classmethod
def from_dict(cls: Type[M], src_dict: Dict[str, Any]) -> M:
d = src_dict.copy()
amount_off = d.pop("amount_off", UNSET)
deleted = d.pop("deleted", UNSET)
id = d.pop("id", UNSET)
percent_off = d.pop("percent_off", UNSET)
coupon = cls(
amount_off=amount_off,
deleted=deleted,
id=id,
percent_off=percent_off,
)
coupon.additional_properties = d
return coupon
@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

@ -8,7 +8,7 @@ from ..models.currency import Currency
from ..models.new_address import NewAddress from ..models.new_address import NewAddress
from ..types import UNSET, Unset from ..types import UNSET, Unset
M = TypeVar("M", bound="Customer") N = TypeVar("N", bound="Customer")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -71,7 +71,7 @@ class Customer:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[M], src_dict: Dict[str, Any]) -> M: def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
d = src_dict.copy() d = src_dict.copy()
_address = d.pop("address", UNSET) _address = d.pop("address", UNSET)
address: Union[Unset, NewAddress] address: Union[Unset, NewAddress]
@ -94,7 +94,7 @@ class Customer:
if isinstance(_currency, Unset): if isinstance(_currency, Unset):
currency = UNSET currency = UNSET
else: else:
currency = Currency(_currency) currency = _currency # type: ignore[arg-type]
delinquent = d.pop("delinquent", UNSET) delinquent = d.pop("delinquent", UNSET)

View File

@ -7,7 +7,7 @@ from dateutil.parser import isoparse
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
N = TypeVar("N", bound="CustomerBalance") J = TypeVar("J", bound="CustomerBalance")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -64,7 +64,7 @@ class CustomerBalance:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N: def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
d = src_dict.copy() d = src_dict.copy()
_created_at = d.pop("created_at", UNSET) _created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime] created_at: Union[Unset, datetime.datetime]

View File

@ -5,7 +5,7 @@ import attr
from ..models.o_auth2_grant_type import OAuth2GrantType from ..models.o_auth2_grant_type import OAuth2GrantType
from ..types import UNSET, Unset from ..types import UNSET, Unset
J = TypeVar("J", bound="DeviceAccessTokenRequestForm") V = TypeVar("V", bound="DeviceAccessTokenRequestForm")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -37,7 +37,7 @@ class DeviceAccessTokenRequestForm:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J: def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
d = src_dict.copy() d = src_dict.copy()
client_id = d.pop("client_id", UNSET) client_id = d.pop("client_id", UNSET)
@ -48,7 +48,7 @@ class DeviceAccessTokenRequestForm:
if isinstance(_grant_type, Unset): if isinstance(_grant_type, Unset):
grant_type = UNSET grant_type = UNSET
else: else:
grant_type = OAuth2GrantType(_grant_type) grant_type = _grant_type # type: ignore[arg-type]
device_access_token_request_form = cls( device_access_token_request_form = cls(
client_id=client_id, client_id=client_id,

View File

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

View File

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

View File

@ -0,0 +1,62 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.coupon import Coupon
from ..types import UNSET, Unset
J = TypeVar("J", bound="Discount")
@attr.s(auto_attribs=True)
class Discount:
"""The resource representing a Discount.""" # noqa: E501
coupon: Union[Unset, Coupon] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
if not isinstance(self.coupon, Unset):
coupon = self.coupon
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if coupon is not UNSET:
field_dict["coupon"] = coupon
return field_dict
@classmethod
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
d = src_dict.copy()
_coupon = d.pop("coupon", UNSET)
coupon: Union[Unset, Coupon]
if isinstance(_coupon, Unset):
coupon = UNSET
else:
coupon = Coupon(_coupon)
discount = cls(
coupon=coupon,
)
discount.additional_properties = d
return discount
@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 from ..types import UNSET, Unset
J = TypeVar("J", bound="EmailAuthenticationForm") L = TypeVar("L", bound="EmailAuthenticationForm")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -31,7 +31,7 @@ class EmailAuthenticationForm:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J: def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
d = src_dict.copy() d = src_dict.copy()
callback_url = d.pop("callback_url", UNSET) 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 ..models.file_system_metadata import FileSystemMetadata
from ..types import UNSET, Unset from ..types import UNSET, Unset
V = TypeVar("V", bound="EngineMetadata") E = TypeVar("E", bound="EngineMetadata")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -57,7 +57,7 @@ class EngineMetadata:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V: def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
d = src_dict.copy() d = src_dict.copy()
async_jobs_running = d.pop("async_jobs_running", UNSET) async_jobs_running = d.pop("async_jobs_running", UNSET)
@ -73,7 +73,7 @@ class EngineMetadata:
if isinstance(_environment, Unset): if isinstance(_environment, Unset):
environment = UNSET environment = UNSET
else: else:
environment = Environment(_environment) environment = _environment # type: ignore[arg-type]
_fs = d.pop("fs", UNSET) _fs = d.pop("fs", UNSET)
fs: Union[Unset, FileSystemMetadata] fs: Union[Unset, FileSystemMetadata]

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset from ..types import UNSET, Unset
L = TypeVar("L", bound="Error") Y = TypeVar("Y", bound="Error")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -35,7 +35,7 @@ class Error:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L: def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
d = src_dict.copy() d = src_dict.copy()
error_code = d.pop("error_code", UNSET) 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 ..models.environment import Environment
from ..types import UNSET, Unset from ..types import UNSET, Unset
E = TypeVar("E", bound="ExecutorMetadata") H = TypeVar("H", bound="ExecutorMetadata")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -41,7 +41,7 @@ class ExecutorMetadata:
return field_dict return field_dict
@classmethod @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() d = src_dict.copy()
_docker_info = d.pop("docker_info", UNSET) _docker_info = d.pop("docker_info", UNSET)
docker_info: Union[Unset, DockerSystemInfo] docker_info: Union[Unset, DockerSystemInfo]
@ -55,7 +55,7 @@ class ExecutorMetadata:
if isinstance(_environment, Unset): if isinstance(_environment, Unset):
environment = UNSET environment = UNSET
else: else:
environment = Environment(_environment) environment = _environment # type: ignore[arg-type]
git_hash = d.pop("git_hash", UNSET) git_hash = d.pop("git_hash", UNSET)

View File

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

View File

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

View File

@ -5,19 +5,21 @@ import attr
from ..models.modeling_cmd_id import ModelingCmdId from ..models.modeling_cmd_id import ModelingCmdId
from ..types import UNSET, Unset from ..types import UNSET, Unset
T = TypeVar("T", bound="Extrude") B = TypeVar("B", bound="Extrude")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class Extrude: class Extrude:
"""Command for extruding a solid.""" # noqa: E501 """Command for extruding a solid.""" # noqa: E501
cap: Union[Unset, bool] = False
distance: Union[Unset, float] = UNSET distance: Union[Unset, float] = UNSET
target: Union[Unset, ModelingCmdId] = UNSET target: Union[Unset, ModelingCmdId] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
cap = self.cap
distance = self.distance distance = self.distance
if not isinstance(self.target, Unset): if not isinstance(self.target, Unset):
target = self.target target = self.target
@ -25,6 +27,8 @@ class Extrude:
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if cap is not UNSET:
field_dict["cap"] = cap
if distance is not UNSET: if distance is not UNSET:
field_dict["distance"] = distance field_dict["distance"] = distance
if target is not UNSET: if target is not UNSET:
@ -33,8 +37,10 @@ class Extrude:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def from_dict(cls: Type[B], src_dict: Dict[str, Any]) -> B:
d = src_dict.copy() d = src_dict.copy()
cap = d.pop("cap", UNSET)
distance = d.pop("distance", UNSET) distance = d.pop("distance", UNSET)
_target = d.pop("target", UNSET) _target = d.pop("target", UNSET)
@ -45,6 +51,7 @@ class Extrude:
target = ModelingCmdId(_target) target = ModelingCmdId(_target)
extrude = cls( extrude = cls(
cap=cap,
distance=distance, distance=distance,
target=target, target=target,
) )

View File

@ -9,7 +9,7 @@ from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
M = TypeVar("M", bound="FileCenterOfMass") S = TypeVar("S", bound="FileCenterOfMass")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -80,7 +80,7 @@ class FileCenterOfMass:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[M], src_dict: Dict[str, Any]) -> M: def from_dict(cls: Type[S], src_dict: Dict[str, Any]) -> S:
d = src_dict.copy() d = src_dict.copy()
center_of_mass = cast(List[float], d.pop("center_of_mass", UNSET)) center_of_mass = cast(List[float], d.pop("center_of_mass", UNSET))
@ -112,7 +112,7 @@ class FileCenterOfMass:
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -126,7 +126,7 @@ class FileCenterOfMass:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -10,7 +10,7 @@ from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
B = TypeVar("B", bound="FileConversion") A = TypeVar("A", bound="FileConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -84,7 +84,7 @@ class FileConversion:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[B], src_dict: Dict[str, Any]) -> B: def from_dict(cls: Type[A], src_dict: Dict[str, Any]) -> A:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -116,14 +116,14 @@ class FileConversion:
if isinstance(_output_format, Unset): if isinstance(_output_format, Unset):
output_format = UNSET output_format = UNSET
else: else:
output_format = FileExportFormat(_output_format) output_format = _output_format # type: ignore[arg-type]
_src_format = d.pop("src_format", UNSET) _src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, FileImportFormat] src_format: Union[Unset, FileImportFormat]
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -137,7 +137,7 @@ class FileConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
S = TypeVar("S", bound="FileDensity") H = TypeVar("H", bound="FileDensity")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -82,7 +82,7 @@ class FileDensity:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[S], src_dict: Dict[str, Any]) -> S: def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -116,7 +116,7 @@ class FileDensity:
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -130,7 +130,7 @@ class FileDensity:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
A = TypeVar("A", bound="FileMass") E = TypeVar("E", bound="FileMass")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -82,7 +82,7 @@ class FileMass:
return field_dict return field_dict
@classmethod @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() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -116,7 +116,7 @@ class FileMass:
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -130,7 +130,7 @@ class FileMass:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
H = TypeVar("H", bound="FileSurfaceArea") G = TypeVar("G", bound="FileSurfaceArea")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -78,7 +78,7 @@ class FileSurfaceArea:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H: def from_dict(cls: Type[G], src_dict: Dict[str, Any]) -> G:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -108,7 +108,7 @@ class FileSurfaceArea:
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -122,7 +122,7 @@ class FileSurfaceArea:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
surface_area = d.pop("surface_area", UNSET) surface_area = d.pop("surface_area", UNSET)

View File

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

View File

@ -9,7 +9,7 @@ from ..models.file_import_format import FileImportFormat
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
G = TypeVar("G", bound="FileVolume") R = TypeVar("R", bound="FileVolume")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -78,7 +78,7 @@ class FileVolume:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[G], src_dict: Dict[str, Any]) -> G: def from_dict(cls: Type[R], src_dict: Dict[str, Any]) -> R:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -108,7 +108,7 @@ class FileVolume:
if isinstance(_src_format, Unset): if isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = FileImportFormat(_src_format) src_format = _src_format # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -122,7 +122,7 @@ class FileVolume:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

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

View File

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

View File

@ -8,7 +8,7 @@ from ..models.currency import Currency
from ..models.invoice_status import InvoiceStatus from ..models.invoice_status import InvoiceStatus
from ..types import UNSET, Unset from ..types import UNSET, Unset
L = TypeVar("L", bound="Invoice") H = TypeVar("H", bound="Invoice")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -26,6 +26,9 @@ class Invoice:
customer_id: Union[Unset, str] = UNSET customer_id: Union[Unset, str] = UNSET
default_payment_method: Union[Unset, str] = UNSET default_payment_method: Union[Unset, str] = UNSET
description: Union[Unset, str] = UNSET description: Union[Unset, str] = UNSET
from ..models.discount import Discount
discounts: Union[Unset, List[Discount]] = UNSET
id: Union[Unset, str] = UNSET id: Union[Unset, str] = UNSET
from ..models.invoice_line_item import InvoiceLineItem from ..models.invoice_line_item import InvoiceLineItem
@ -59,6 +62,11 @@ class Invoice:
customer_id = self.customer_id customer_id = self.customer_id
default_payment_method = self.default_payment_method default_payment_method = self.default_payment_method
description = self.description description = self.description
from ..models.discount import Discount
discounts: Union[Unset, List[Discount]] = UNSET
if not isinstance(self.discounts, Unset):
discounts = self.discounts
id = self.id id = self.id
from ..models.invoice_line_item import InvoiceLineItem from ..models.invoice_line_item import InvoiceLineItem
@ -103,6 +111,8 @@ class Invoice:
field_dict["default_payment_method"] = default_payment_method field_dict["default_payment_method"] = default_payment_method
if description is not UNSET: if description is not UNSET:
field_dict["description"] = description field_dict["description"] = description
if discounts is not UNSET:
field_dict["discounts"] = discounts
if id is not UNSET: if id is not UNSET:
field_dict["id"] = id field_dict["id"] = id
if lines is not UNSET: if lines is not UNSET:
@ -133,7 +143,7 @@ class Invoice:
return field_dict return field_dict
@classmethod @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() d = src_dict.copy()
amount_due = d.pop("amount_due", UNSET) amount_due = d.pop("amount_due", UNSET)
@ -157,7 +167,7 @@ class Invoice:
if isinstance(_currency, Unset): if isinstance(_currency, Unset):
currency = UNSET currency = UNSET
else: else:
currency = Currency(_currency) currency = _currency # type: ignore[arg-type]
customer_email = d.pop("customer_email", UNSET) customer_email = d.pop("customer_email", UNSET)
@ -167,6 +177,10 @@ class Invoice:
description = d.pop("description", UNSET) description = d.pop("description", UNSET)
from ..models.discount import Discount
discounts = cast(List[Discount], d.pop("discounts", UNSET))
id = d.pop("id", UNSET) id = d.pop("id", UNSET)
from ..models.invoice_line_item import InvoiceLineItem from ..models.invoice_line_item import InvoiceLineItem
@ -189,7 +203,7 @@ class Invoice:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = InvoiceStatus(_status) status = _status # type: ignore[arg-type]
subtotal = d.pop("subtotal", UNSET) subtotal = d.pop("subtotal", UNSET)
@ -211,6 +225,7 @@ class Invoice:
customer_id=customer_id, customer_id=customer_id,
default_payment_method=default_payment_method, default_payment_method=default_payment_method,
description=description, description=description,
discounts=discounts,
id=id, id=id,
lines=lines, lines=lines,
metadata=metadata, metadata=metadata,

View File

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

View File

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

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset from ..types import UNSET, Unset
K = TypeVar("K", bound="JetstreamApiStats") R = TypeVar("R", bound="JetstreamApiStats")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -35,7 +35,7 @@ class JetstreamApiStats:
return field_dict return field_dict
@classmethod @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() d = src_dict.copy()
errors = d.pop("errors", UNSET) errors = d.pop("errors", UNSET)

View File

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

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset from ..types import UNSET, Unset
U = TypeVar("U", bound="MetaClusterInfo") S = TypeVar("S", bound="MetaClusterInfo")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -35,7 +35,7 @@ class MetaClusterInfo:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[U], src_dict: Dict[str, Any]) -> U: def from_dict(cls: Type[S], src_dict: Dict[str, Any]) -> S:
d = src_dict.copy() d = src_dict.copy()
cluster_size = d.pop("cluster_size", UNSET) 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 ..models.point_e_metadata import PointEMetadata
from ..types import UNSET, Unset from ..types import UNSET, Unset
S = TypeVar("S", bound="Metadata") K = TypeVar("K", bound="Metadata")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -71,7 +71,7 @@ class Metadata:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[S], src_dict: Dict[str, Any]) -> S: def from_dict(cls: Type[K], src_dict: Dict[str, Any]) -> K:
d = src_dict.copy() d = src_dict.copy()
_cache = d.pop("cache", UNSET) _cache = d.pop("cache", UNSET)
cache: Union[Unset, CacheMetadata] cache: Union[Unset, CacheMetadata]
@ -92,7 +92,7 @@ class Metadata:
if isinstance(_environment, Unset): if isinstance(_environment, Unset):
environment = UNSET environment = UNSET
else: else:
environment = Environment(_environment) environment = _environment # type: ignore[arg-type]
_executor = d.pop("executor", UNSET) _executor = d.pop("executor", UNSET)
executor: Union[Unset, ExecutorMetadata] executor: Union[Unset, ExecutorMetadata]

View File

@ -1,52 +1,76 @@
from enum import Enum
from typing import Any, Dict, List, Type, TypeVar, Union from typing import Any, Dict, List, Type, TypeVar, Union
import attr import attr
from ..models.camera_drag_interaction_type import CameraDragInteractionType
from ..models.modeling_cmd_id import ModelingCmdId
from ..models.path_segment import PathSegment
from ..models.point2d import Point2d from ..models.point2d import Point2d
from ..models.point3d import Point3d
from ..types import UNSET, Unset from ..types import UNSET, Unset
from .extrude import Extrude from .extrude import Extrude
from .line3d import Line3d
AddLine = Line3d
K = TypeVar("K", bound="SelectionClick") class StartPath(str, Enum):
"""Start a path.""" # noqa: E501
START_PATH = "StartPath"
def __str__(self) -> str:
return str(self.value)
Q = TypeVar("Q", bound="MovePathPen")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class SelectionClick: class MovePathPen:
at: Union[Unset, Point2d] = UNSET path: Union[Unset, ModelingCmdId] = UNSET
to: Union[Unset, Point3d] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
if not isinstance(self.at, Unset): if not isinstance(self.path, Unset):
at = self.at path = self.path
if not isinstance(self.to, Unset):
to = self.to
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if at is not UNSET: if path is not UNSET:
field_dict["at"] = at field_dict["path"] = path
if to is not UNSET:
field_dict["to"] = to
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[K], src_dict: Dict[str, Any]) -> K: def from_dict(cls: Type[Q], src_dict: Dict[str, Any]) -> Q:
d = src_dict.copy() d = src_dict.copy()
_at = d.pop("at", UNSET) _path = d.pop("path", UNSET)
at: Union[Unset, Point2d] path: Union[Unset, ModelingCmdId]
if isinstance(_at, Unset): if isinstance(_path, Unset):
at = UNSET path = UNSET
else: else:
at = Point2d(_at) path = ModelingCmdId(_path)
selection_click = cls( _to = d.pop("to", UNSET)
at=at, to: Union[Unset, Point3d]
if isinstance(_to, Unset):
to = UNSET
else:
to = Point3d(_to)
move_path_pen = cls(
path=path,
to=to,
) )
selection_click.additional_properties = d move_path_pen.additional_properties = d
return selection_click return move_path_pen
@property @property
def additional_keys(self) -> List[str]: def additional_keys(self) -> List[str]:
@ -65,4 +89,341 @@ class SelectionClick:
return key in self.additional_properties return key in self.additional_properties
ModelingCmd = Union[AddLine, Extrude, SelectionClick] F = TypeVar("F", bound="ExtendPath")
@attr.s(auto_attribs=True)
class ExtendPath:
path: Union[Unset, ModelingCmdId] = UNSET
segment: Union[Unset, PathSegment] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
if not isinstance(self.path, Unset):
path = self.path
if not isinstance(self.segment, Unset):
segment = self.segment
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if path is not UNSET:
field_dict["path"] = path
if segment is not UNSET:
field_dict["segment"] = segment
return field_dict
@classmethod
def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
d = src_dict.copy()
_path = d.pop("path", UNSET)
path: Union[Unset, ModelingCmdId]
if isinstance(_path, Unset):
path = UNSET
else:
path = ModelingCmdId(_path)
_segment = d.pop("segment", UNSET)
segment: Union[Unset, PathSegment]
if isinstance(_segment, Unset):
segment = UNSET
else:
segment = _segment # type: ignore[arg-type]
extend_path = cls(
path=path,
segment=segment,
)
extend_path.additional_properties = d
return extend_path
@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
H = TypeVar("H", bound="ClosePath")
@attr.s(auto_attribs=True)
class ClosePath:
path_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
path_id = self.path_id
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if path_id is not UNSET:
field_dict["path_id"] = path_id
return field_dict
@classmethod
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
d = src_dict.copy()
path_id = d.pop("path_id", UNSET)
close_path = cls(
path_id=path_id,
)
close_path.additional_properties = d
return close_path
@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
N = TypeVar("N", bound="CameraDragStart")
@attr.s(auto_attribs=True)
class CameraDragStart:
interaction: Union[Unset, CameraDragInteractionType] = UNSET
window: 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.interaction, Unset):
interaction = self.interaction
if not isinstance(self.window, Unset):
window = self.window
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if interaction is not UNSET:
field_dict["interaction"] = interaction
if window is not UNSET:
field_dict["window"] = window
return field_dict
@classmethod
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
d = src_dict.copy()
_interaction = d.pop("interaction", UNSET)
interaction: Union[Unset, CameraDragInteractionType]
if isinstance(_interaction, Unset):
interaction = UNSET
else:
interaction = _interaction # type: ignore[arg-type]
_window = d.pop("window", UNSET)
window: Union[Unset, Point2d]
if isinstance(_window, Unset):
window = UNSET
else:
window = Point2d(_window)
camera_drag_start = cls(
interaction=interaction,
window=window,
)
camera_drag_start.additional_properties = d
return camera_drag_start
@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
H = TypeVar("H", bound="CameraDragMove")
@attr.s(auto_attribs=True)
class CameraDragMove:
interaction: Union[Unset, CameraDragInteractionType] = UNSET
sequence: Union[Unset, int] = UNSET
window: 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.interaction, Unset):
interaction = self.interaction
sequence = self.sequence
if not isinstance(self.window, Unset):
window = self.window
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if interaction is not UNSET:
field_dict["interaction"] = interaction
if sequence is not UNSET:
field_dict["sequence"] = sequence
if window is not UNSET:
field_dict["window"] = window
return field_dict
@classmethod
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H:
d = src_dict.copy()
_interaction = d.pop("interaction", UNSET)
interaction: Union[Unset, CameraDragInteractionType]
if isinstance(_interaction, Unset):
interaction = UNSET
else:
interaction = _interaction # type: ignore[arg-type]
sequence = d.pop("sequence", UNSET)
_window = d.pop("window", UNSET)
window: Union[Unset, Point2d]
if isinstance(_window, Unset):
window = UNSET
else:
window = Point2d(_window)
camera_drag_move = cls(
interaction=interaction,
sequence=sequence,
window=window,
)
camera_drag_move.additional_properties = d
return camera_drag_move
@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
B = TypeVar("B", bound="CameraDragEnd")
@attr.s(auto_attribs=True)
class CameraDragEnd:
interaction: Union[Unset, CameraDragInteractionType] = UNSET
window: 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.interaction, Unset):
interaction = self.interaction
if not isinstance(self.window, Unset):
window = self.window
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if interaction is not UNSET:
field_dict["interaction"] = interaction
if window is not UNSET:
field_dict["window"] = window
return field_dict
@classmethod
def from_dict(cls: Type[B], src_dict: Dict[str, Any]) -> B:
d = src_dict.copy()
_interaction = d.pop("interaction", UNSET)
interaction: Union[Unset, CameraDragInteractionType]
if isinstance(_interaction, Unset):
interaction = UNSET
else:
interaction = _interaction # type: ignore[arg-type]
_window = d.pop("window", UNSET)
window: Union[Unset, Point2d]
if isinstance(_window, Unset):
window = UNSET
else:
window = Point2d(_window)
camera_drag_end = cls(
interaction=interaction,
window=window,
)
camera_drag_end.additional_properties = d
return camera_drag_end
@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[
StartPath,
MovePathPen,
ExtendPath,
Extrude,
ClosePath,
CameraDragStart,
CameraDragMove,
CameraDragEnd,
]

View File

@ -6,7 +6,7 @@ from ..models.modeling_cmd import ModelingCmd
from ..models.modeling_cmd_id import ModelingCmdId from ..models.modeling_cmd_id import ModelingCmdId
from ..types import UNSET, Unset from ..types import UNSET, Unset
Q = TypeVar("Q", bound="ModelingCmdReq") B = TypeVar("B", bound="ModelingCmdReq")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -39,7 +39,7 @@ class ModelingCmdReq:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[Q], src_dict: Dict[str, Any]) -> Q: def from_dict(cls: Type[B], src_dict: Dict[str, Any]) -> B:
d = src_dict.copy() d = src_dict.copy()
_cmd = d.pop("cmd", UNSET) _cmd = d.pop("cmd", UNSET)
cmd: Union[Unset, ModelingCmd] cmd: Union[Unset, ModelingCmd]

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset from ..types import UNSET, Unset
F = TypeVar("F", bound="ModelingCmdReqBatch") P = TypeVar("P", bound="ModelingCmdReqBatch")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -31,7 +31,7 @@ class ModelingCmdReqBatch:
return field_dict return field_dict
@classmethod @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() d = src_dict.copy()
cmds = d.pop("cmds", UNSET) cmds = d.pop("cmds", UNSET)
file_id = d.pop("file_id", UNSET) file_id = d.pop("file_id", UNSET)

View File

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

View File

@ -12,7 +12,7 @@ Success = Any
Error = ModelingError Error = ModelingError
N = TypeVar("N", bound="Cancelled") T = TypeVar("T", bound="Cancelled")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -34,7 +34,7 @@ class Cancelled:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
_what_failed = d.pop("what_failed", UNSET) _what_failed = d.pop("what_failed", UNSET)
what_failed: Union[Unset, ModelingCmdId] what_failed: Union[Unset, ModelingCmdId]

View File

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

View File

@ -5,7 +5,7 @@ import attr
from ..models.country_code import CountryCode from ..models.country_code import CountryCode
from ..types import UNSET, Unset from ..types import UNSET, Unset
B = TypeVar("B", bound="NewAddress") C = TypeVar("C", bound="NewAddress")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -53,7 +53,7 @@ class NewAddress:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[B], src_dict: Dict[str, Any]) -> B: def from_dict(cls: Type[C], src_dict: Dict[str, Any]) -> C:
d = src_dict.copy() d = src_dict.copy()
city = d.pop("city", UNSET) city = d.pop("city", UNSET)
@ -62,7 +62,7 @@ class NewAddress:
if isinstance(_country, Unset): if isinstance(_country, Unset):
country = UNSET country = UNSET
else: else:
country = CountryCode(_country) country = _country # type: ignore[arg-type]
state = d.pop("state", UNSET) state = d.pop("state", UNSET)

View File

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

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset from ..types import UNSET, Unset
P = TypeVar("P", bound="Onboarding") C = TypeVar("C", bound="Onboarding")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -37,7 +37,7 @@ class Onboarding:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[P], src_dict: Dict[str, Any]) -> P: def from_dict(cls: Type[C], src_dict: Dict[str, Any]) -> C:
d = src_dict.copy() 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 "first_call_from_their_machine_date", UNSET

View File

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

View File

@ -0,0 +1,221 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.point2d import Point2d
from ..models.point3d import Point3d
from ..types import UNSET, Unset
M = TypeVar("M", bound="Line")
@attr.s(auto_attribs=True)
class Line:
end: 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.end, Unset):
end = self.end
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if end is not UNSET:
field_dict["end"] = end
return field_dict
@classmethod
def from_dict(cls: Type[M], src_dict: Dict[str, Any]) -> M:
d = src_dict.copy()
_end = d.pop("end", UNSET)
end: Union[Unset, Point3d]
if isinstance(_end, Unset):
end = UNSET
else:
end = Point3d(_end)
line = cls(
end=end,
)
line.additional_properties = d
return line
@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
S = TypeVar("S", bound="Arc")
@attr.s(auto_attribs=True)
class Arc:
angle_end: Union[Unset, float] = UNSET
angle_start: Union[Unset, float] = UNSET
center: Union[Unset, Point2d] = UNSET
radius: Union[Unset, float] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
angle_end = self.angle_end
angle_start = self.angle_start
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 angle_end is not UNSET:
field_dict["angle_end"] = angle_end
if angle_start is not UNSET:
field_dict["angle_start"] = angle_start
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[S], src_dict: Dict[str, Any]) -> S:
d = src_dict.copy()
angle_end = d.pop("angle_end", UNSET)
angle_start = d.pop("angle_start", UNSET)
_center = d.pop("center", UNSET)
center: Union[Unset, Point2d]
if isinstance(_center, Unset):
center = UNSET
else:
center = Point2d(_center)
radius = d.pop("radius", UNSET)
arc = cls(
angle_end=angle_end,
angle_start=angle_start,
center=center,
radius=radius,
)
arc.additional_properties = d
return arc
@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
L = TypeVar("L", bound="Bezier")
@attr.s(auto_attribs=True)
class Bezier:
control1: Union[Unset, Point3d] = UNSET
control2: Union[Unset, Point3d] = UNSET
end: 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.control1, Unset):
control1 = self.control1
if not isinstance(self.control2, Unset):
control2 = self.control2
if not isinstance(self.end, Unset):
end = self.end
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if control1 is not UNSET:
field_dict["control1"] = control1
if control2 is not UNSET:
field_dict["control2"] = control2
if end is not UNSET:
field_dict["end"] = end
return field_dict
@classmethod
def from_dict(cls: Type[L], src_dict: Dict[str, Any]) -> L:
d = src_dict.copy()
_control1 = d.pop("control1", UNSET)
control1: Union[Unset, Point3d]
if isinstance(_control1, Unset):
control1 = UNSET
else:
control1 = Point3d(_control1)
_control2 = d.pop("control2", UNSET)
control2: Union[Unset, Point3d]
if isinstance(_control2, Unset):
control2 = UNSET
else:
control2 = Point3d(_control2)
_end = d.pop("end", UNSET)
end: Union[Unset, Point3d]
if isinstance(_end, Unset):
end = UNSET
else:
end = Point3d(_end)
bezier = cls(
control1=control1,
control2=control2,
end=end,
)
bezier.additional_properties = d
return bezier
@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
PathSegment = Union[Line, Arc, Bezier]

View File

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

View File

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

View File

@ -9,7 +9,7 @@ from ..models.physics_constant_name import PhysicsConstantName
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
R = TypeVar("R", bound="PhysicsConstant") Y = TypeVar("Y", bound="PhysicsConstant")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -78,7 +78,7 @@ class PhysicsConstant:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[R], src_dict: Dict[str, Any]) -> R: def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -92,7 +92,7 @@ class PhysicsConstant:
if isinstance(_constant, Unset): if isinstance(_constant, Unset):
constant = UNSET constant = UNSET
else: else:
constant = PhysicsConstantName(_constant) constant = _constant # type: ignore[arg-type]
_created_at = d.pop("created_at", UNSET) _created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime] created_at: Union[Unset, datetime.datetime]
@ -122,7 +122,7 @@ class PhysicsConstant:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@ from dateutil.parser import isoparse
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
D = TypeVar("D", bound="Session") N = TypeVar("N", bound="Session")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -58,7 +58,7 @@ class Session:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[D], src_dict: Dict[str, Any]) -> D: def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N:
d = src_dict.copy() d = src_dict.copy()
_created_at = d.pop("created_at", UNSET) _created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime] created_at: Union[Unset, datetime.datetime]

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset from ..types import UNSET, Unset
Y = TypeVar("Y", bound="SystemInfoDefaultAddressPools") H = TypeVar("H", bound="SystemInfoDefaultAddressPools")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -29,7 +29,7 @@ class SystemInfoDefaultAddressPools:
return field_dict return field_dict
@classmethod @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() d = src_dict.copy()
base = d.pop("base", UNSET) base = d.pop("base", UNSET)

View File

@ -9,7 +9,7 @@ from ..models.unit_angle import UnitAngle
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
Y = TypeVar("Y", bound="UnitAngleConversion") V = TypeVar("V", bound="UnitAngleConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitAngleConversion:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[Y], src_dict: Dict[str, Any]) -> Y: def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitAngleConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitAngle(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitAngleConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitAngle(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitAngleConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_area import UnitArea
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
D = TypeVar("D", bound="UnitAreaConversion") E = TypeVar("E", bound="UnitAreaConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitAreaConversion:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[D], src_dict: Dict[str, Any]) -> D: def from_dict(cls: Type[E], src_dict: Dict[str, Any]) -> E:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitAreaConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitArea(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitAreaConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitArea(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitAreaConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_current import UnitCurrent
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
F = TypeVar("F", bound="UnitCurrentConversion") T = TypeVar("T", bound="UnitCurrentConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitCurrentConversion:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitCurrentConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitCurrent(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitCurrentConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitCurrent(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitCurrentConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_energy import UnitEnergy
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
Z = TypeVar("Z", bound="UnitEnergyConversion") Q = TypeVar("Q", bound="UnitEnergyConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitEnergyConversion:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[Z], src_dict: Dict[str, Any]) -> Z: def from_dict(cls: Type[Q], src_dict: Dict[str, Any]) -> Q:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitEnergyConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitEnergy(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitEnergyConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitEnergy(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitEnergyConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_force import UnitForce
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
G = TypeVar("G", bound="UnitForceConversion") F = TypeVar("F", bound="UnitForceConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitForceConversion:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[G], src_dict: Dict[str, Any]) -> G: def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitForceConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitForce(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitForceConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitForce(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitForceConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_frequency import UnitFrequency
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
L = TypeVar("L", bound="UnitFrequencyConversion") D = TypeVar("D", bound="UnitFrequencyConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitFrequencyConversion:
return field_dict return field_dict
@classmethod @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() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitFrequencyConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitFrequency(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitFrequencyConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitFrequency(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitFrequencyConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_length import UnitLength
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
N = TypeVar("N", bound="UnitLengthConversion") J = TypeVar("J", bound="UnitLengthConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitLengthConversion:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N: def from_dict(cls: Type[J], src_dict: Dict[str, Any]) -> J:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitLengthConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitLength(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitLengthConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitLength(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitLengthConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_mass import UnitMass
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
N = TypeVar("N", bound="UnitMassConversion") F = TypeVar("F", bound="UnitMassConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitMassConversion:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[N], src_dict: Dict[str, Any]) -> N: def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitMassConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitMass(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitMassConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitMass(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitMassConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_power import UnitPower
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
H = TypeVar("H", bound="UnitPowerConversion") V = TypeVar("V", bound="UnitPowerConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitPowerConversion:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[H], src_dict: Dict[str, Any]) -> H: def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitPowerConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitPower(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitPowerConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitPower(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitPowerConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_pressure import UnitPressure
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
V = TypeVar("V", bound="UnitPressureConversion") U = TypeVar("U", bound="UnitPressureConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitPressureConversion:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[V], src_dict: Dict[str, Any]) -> V: def from_dict(cls: Type[U], src_dict: Dict[str, Any]) -> U:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitPressureConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitPressure(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitPressureConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitPressure(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitPressureConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_temperature import UnitTemperature
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
E = TypeVar("E", bound="UnitTemperatureConversion") F = TypeVar("F", bound="UnitTemperatureConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitTemperatureConversion:
return field_dict return field_dict
@classmethod @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() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitTemperatureConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitTemperature(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitTemperatureConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitTemperature(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitTemperatureConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_torque import UnitTorque
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
T = TypeVar("T", bound="UnitTorqueConversion") Y = TypeVar("Y", bound="UnitTorqueConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitTorqueConversion:
return field_dict return field_dict
@classmethod @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() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitTorqueConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitTorque(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitTorqueConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitTorque(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitTorqueConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -9,7 +9,7 @@ from ..models.unit_volume import UnitVolume
from ..models.uuid import Uuid from ..models.uuid import Uuid
from ..types import UNSET, Unset from ..types import UNSET, Unset
Q = TypeVar("Q", bound="UnitVolumeConversion") F = TypeVar("F", bound="UnitVolumeConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -87,7 +87,7 @@ class UnitVolumeConversion:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[Q], src_dict: Dict[str, Any]) -> Q: def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
@ -119,7 +119,7 @@ class UnitVolumeConversion:
if isinstance(_input_unit, Unset): if isinstance(_input_unit, Unset):
input_unit = UNSET input_unit = UNSET
else: else:
input_unit = UnitVolume(_input_unit) input_unit = _input_unit # type: ignore[arg-type]
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
@ -128,7 +128,7 @@ class UnitVolumeConversion:
if isinstance(_output_unit, Unset): if isinstance(_output_unit, Unset):
output_unit = UNSET output_unit = UNSET
else: else:
output_unit = UnitVolume(_output_unit) output_unit = _output_unit # type: ignore[arg-type]
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
@ -142,7 +142,7 @@ class UnitVolumeConversion:
if isinstance(_status, Unset): if isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = ApiCallStatus(_status) status = _status # type: ignore[arg-type]
_updated_at = d.pop("updated_at", UNSET) _updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime] updated_at: Union[Unset, datetime.datetime]

View File

@ -4,7 +4,7 @@ import attr
from ..types import UNSET, Unset from ..types import UNSET, Unset
F = TypeVar("F", bound="UpdateUser") P = TypeVar("P", bound="UpdateUser")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -47,7 +47,7 @@ class UpdateUser:
return field_dict return field_dict
@classmethod @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() d = src_dict.copy()
company = d.pop("company", UNSET) company = d.pop("company", UNSET)

View File

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

View File

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

View File

@ -6,7 +6,7 @@ from dateutil.parser import isoparse
from ..types import UNSET, Unset from ..types import UNSET, Unset
F = TypeVar("F", bound="VerificationToken") K = TypeVar("K", bound="VerificationToken")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
@ -53,7 +53,7 @@ class VerificationToken:
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[F], src_dict: Dict[str, Any]) -> F: def from_dict(cls: Type[K], src_dict: Dict[str, Any]) -> K:
d = src_dict.copy() d = src_dict.copy()
_created_at = d.pop("created_at", UNSET) _created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime] created_at: Union[Unset, datetime.datetime]

492
spec.json
View File

@ -1284,6 +1284,32 @@
], ],
"type": "object" "type": "object"
}, },
"CameraDragInteractionType": {
"description": "The type of camera drag interaction.",
"oneOf": [
{
"description": "Camera pan",
"enum": [
"pan"
],
"type": "string"
},
{
"description": "Camera rotate (revolve/orbit)",
"enum": [
"rotate"
],
"type": "string"
},
{
"description": "Camera zoom (increase or decrease distance to reference point center)",
"enum": [
"zoom"
],
"type": "string"
}
]
},
"CardDetails": { "CardDetails": {
"description": "The card details of a payment method.", "description": "The card details of a payment method.",
"properties": { "properties": {
@ -1374,12 +1400,29 @@
}, },
"CodeLanguage": { "CodeLanguage": {
"description": "The language code is written in.", "description": "The language code is written in.",
"enum": [ "oneOf": [
"go", {
"python", "description": "The `go` programming language.",
"node" "enum": [
], "go"
"type": "string" ],
"type": "string"
},
{
"description": "The `python` programming language.",
"enum": [
"python"
],
"type": "string"
},
{
"description": "The `node` programming language.",
"enum": [
"node"
],
"type": "string"
}
]
}, },
"CodeOutput": { "CodeOutput": {
"description": "Output of the code being executed.", "description": "Output of the code being executed.",
@ -3497,6 +3540,34 @@
} }
] ]
}, },
"Coupon": {
"description": "The resource representing a Coupon.",
"properties": {
"amount_off": {
"description": "Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer.",
"format": "money-usd",
"nullable": true,
"title": "Number",
"type": "number"
},
"deleted": {
"default": false,
"description": "Always true for a deleted object.",
"type": "boolean"
},
"id": {
"description": "Unique identifier for the object.",
"type": "string"
},
"percent_off": {
"description": "Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon.\n\nFor example, a coupon with percent_off of 50 will make a %s100 invoice %s50 instead.",
"format": "double",
"nullable": true,
"type": "number"
}
},
"type": "object"
},
"CreatedAtSortMode": { "CreatedAtSortMode": {
"description": "Supported set of sort modes for scanning by created_at only.\n\nCurrently, we only support scanning in ascending order.", "description": "Supported set of sort modes for scanning by created_at only.\n\nCurrently, we only support scanning in ascending order.",
"oneOf": [ "oneOf": [
@ -4685,6 +4756,23 @@
], ],
"type": "object" "type": "object"
}, },
"Discount": {
"description": "The resource representing a Discount.",
"properties": {
"coupon": {
"allOf": [
{
"$ref": "#/components/schemas/Coupon"
}
],
"description": "The coupon that applied to create this discount."
}
},
"required": [
"coupon"
],
"type": "object"
},
"DockerSystemInfo": { "DockerSystemInfo": {
"description": "Docker system info.", "description": "Docker system info.",
"properties": { "properties": {
@ -5306,6 +5394,10 @@
"Extrude": { "Extrude": {
"description": "Command for extruding a solid.", "description": "Command for extruding a solid.",
"properties": { "properties": {
"cap": {
"description": "Whether to cap the extrusion with a face, or not. If true, the resulting solid will be closed on all sides, like a dice. If false, it will be open on one side, like a drinking glass.",
"type": "boolean"
},
"distance": { "distance": {
"description": "How far off the plane to extrude", "description": "How far off the plane to extrude",
"format": "double", "format": "double",
@ -5317,10 +5409,11 @@
"$ref": "#/components/schemas/ModelingCmdId" "$ref": "#/components/schemas/ModelingCmdId"
} }
], ],
"description": "Which sketch to extrude" "description": "Which sketch to extrude. Must be a closed 2D solid."
} }
}, },
"required": [ "required": [
"cap",
"distance", "distance",
"target" "target"
], ],
@ -6091,6 +6184,13 @@
"description": "Description of the invoice.", "description": "Description of the invoice.",
"type": "string" "type": "string"
}, },
"discounts": {
"description": "The discounts applied to the invoice. This is an array of discount objects.",
"items": {
"$ref": "#/components/schemas/Discount"
},
"type": "array"
},
"id": { "id": {
"description": "Unique identifier for the object.", "description": "Unique identifier for the object.",
"type": "string" "type": "string"
@ -6454,32 +6554,6 @@
}, },
"type": "object" "type": "object"
}, },
"Line3d": {
"description": "Command for adding a line.",
"properties": {
"from": {
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
],
"description": "Start of the line"
},
"to": {
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
],
"description": "End of the line"
}
},
"required": [
"from",
"to"
],
"type": "object"
},
"Mesh": { "Mesh": {
"properties": { "properties": {
"mesh": { "mesh": {
@ -6667,22 +6741,86 @@
"ModelingCmd": { "ModelingCmd": {
"description": "Commands that the KittyCAD engine can execute.", "description": "Commands that the KittyCAD engine can execute.",
"oneOf": [ "oneOf": [
{
"description": "Start a path.",
"enum": [
"StartPath"
],
"type": "string"
},
{ {
"additionalProperties": false, "additionalProperties": false,
"description": "Add a line", "description": "Move the path's \"pen\".",
"properties": { "properties": {
"AddLine": { "MovePathPen": {
"$ref": "#/components/schemas/Line3d" "properties": {
"path": {
"allOf": [
{
"$ref": "#/components/schemas/ModelingCmdId"
}
],
"description": "The ID of the command which created the path."
},
"to": {
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
],
"description": "Where the path's pen should be."
}
},
"required": [
"path",
"to"
],
"type": "object"
} }
}, },
"required": [ "required": [
"AddLine" "MovePathPen"
], ],
"type": "object" "type": "object"
}, },
{ {
"additionalProperties": false, "additionalProperties": false,
"description": "Extrude a solid", "description": "Extend a path by adding a new segment which starts at the path's \"pen\". If no \"pen\" location has been set before (via `MovePen`), then the pen is at the origin.",
"properties": {
"ExtendPath": {
"properties": {
"path": {
"allOf": [
{
"$ref": "#/components/schemas/ModelingCmdId"
}
],
"description": "The ID of the command which created the path."
},
"segment": {
"allOf": [
{
"$ref": "#/components/schemas/PathSegment"
}
],
"description": "Segment to append to the path. This segment will implicitly begin at the current \"pen\" location."
}
},
"required": [
"path",
"segment"
],
"type": "object"
}
},
"required": [
"ExtendPath"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Extrude a 2D solid.",
"properties": { "properties": {
"Extrude": { "Extrude": {
"$ref": "#/components/schemas/Extrude" "$ref": "#/components/schemas/Extrude"
@ -6695,27 +6833,136 @@
}, },
{ {
"additionalProperties": false, "additionalProperties": false,
"description": "Mouse clicked on the engine window, trying to select some surface.", "description": "Closes a path, converting it to a 2D solid.",
"properties": { "properties": {
"SelectionClick": { "ClosePath": {
"properties": { "properties": {
"at": { "path_id": {
"allOf": [ "description": "Which path to close.",
{ "format": "uuid",
"$ref": "#/components/schemas/Point2d" "type": "string"
}
],
"description": "Where the mouse was clicked. TODO engine#1035: Choose a coordinate system for this."
} }
}, },
"required": [ "required": [
"at" "path_id"
], ],
"type": "object" "type": "object"
} }
}, },
"required": [ "required": [
"SelectionClick" "ClosePath"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Camera drag started.",
"properties": {
"CameraDragStart": {
"properties": {
"interaction": {
"allOf": [
{
"$ref": "#/components/schemas/CameraDragInteractionType"
}
],
"description": "The type of camera drag interaction."
},
"window": {
"allOf": [
{
"$ref": "#/components/schemas/Point2d"
}
],
"description": "The initial mouse position."
}
},
"required": [
"interaction",
"window"
],
"type": "object"
}
},
"required": [
"CameraDragStart"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Camera drag continued.",
"properties": {
"CameraDragMove": {
"properties": {
"interaction": {
"allOf": [
{
"$ref": "#/components/schemas/CameraDragInteractionType"
}
],
"description": "The type of camera drag interaction."
},
"sequence": {
"description": "Logical timestamp. The client should increment this with every event in the current mouse drag. That way, if the events are being sent over an unordered channel, the API can ignore the older events.",
"format": "uint32",
"minimum": 0,
"nullable": true,
"type": "integer"
},
"window": {
"allOf": [
{
"$ref": "#/components/schemas/Point2d"
}
],
"description": "The current mouse position."
}
},
"required": [
"interaction",
"window"
],
"type": "object"
}
},
"required": [
"CameraDragMove"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Camera drag ended.",
"properties": {
"CameraDragEnd": {
"properties": {
"interaction": {
"allOf": [
{
"$ref": "#/components/schemas/CameraDragInteractionType"
}
],
"description": "The type of camera drag interaction."
},
"window": {
"allOf": [
{
"$ref": "#/components/schemas/Point2d"
}
],
"description": "The final mouse position."
}
},
"required": [
"interaction",
"window"
],
"type": "object"
}
},
"required": [
"CameraDragEnd"
], ],
"type": "object" "type": "object"
} }
@ -6985,6 +7232,125 @@
}, },
"type": "object" "type": "object"
}, },
"PathSegment": {
"description": "A segment of a path. Paths are composed of many segments.",
"oneOf": [
{
"additionalProperties": false,
"description": "A straight line segment. Goes from the current path \"pen\" to the given endpoint.",
"properties": {
"Line": {
"properties": {
"end": {
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
],
"description": "End point of the line."
}
},
"required": [
"end"
],
"type": "object"
}
},
"required": [
"Line"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "A circular arc segment.",
"properties": {
"Arc": {
"properties": {
"angle_end": {
"description": "Start of the arc along circle's perimeter.",
"format": "float",
"type": "number"
},
"angle_start": {
"description": "Start of the arc along circle's perimeter.",
"format": "float",
"type": "number"
},
"center": {
"allOf": [
{
"$ref": "#/components/schemas/Point2d"
}
],
"description": "Center of the circle"
},
"radius": {
"description": "Radius of the circle",
"format": "float",
"type": "number"
}
},
"required": [
"angle_end",
"angle_start",
"center",
"radius"
],
"type": "object"
}
},
"required": [
"Arc"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "A cubic bezier curve segment. Start at the end of the current line, go through control point 1 and 2, then end at a given point.",
"properties": {
"Bezier": {
"properties": {
"control1": {
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
],
"description": "First control point."
},
"control2": {
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
],
"description": "Second control point."
},
"end": {
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
],
"description": "Final control point."
}
},
"required": [
"control1",
"control2",
"end"
],
"type": "object"
}
},
"required": [
"Bezier"
],
"type": "object"
}
]
},
"PaymentIntent": { "PaymentIntent": {
"description": "A payment intent response.", "description": "A payment intent response.",
"properties": { "properties": {
@ -10525,7 +10891,9 @@
"api-calls", "api-calls",
"hidden" "hidden"
], ],
"x-dropshot-pagination": true "x-dropshot-pagination": {
"required": []
}
} }
}, },
"/api-calls/{id}": { "/api-calls/{id}": {
@ -10947,7 +11315,9 @@
"api-calls", "api-calls",
"hidden" "hidden"
], ],
"x-dropshot-pagination": true "x-dropshot-pagination": {
"required": []
}
} }
}, },
"/async/operations/{id}": { "/async/operations/{id}": {
@ -14885,7 +15255,9 @@
"tags": [ "tags": [
"api-calls" "api-calls"
], ],
"x-dropshot-pagination": true "x-dropshot-pagination": {
"required": []
}
} }
}, },
"/user/api-calls/{id}": { "/user/api-calls/{id}": {
@ -15050,7 +15422,9 @@
"tags": [ "tags": [
"api-tokens" "api-tokens"
], ],
"x-dropshot-pagination": true "x-dropshot-pagination": {
"required": []
}
}, },
"options": { "options": {
"description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.",
@ -16528,7 +16902,9 @@
"users", "users",
"hidden" "hidden"
], ],
"x-dropshot-pagination": true "x-dropshot-pagination": {
"required": []
}
} }
}, },
"/users-extended": { "/users-extended": {
@ -16621,7 +16997,9 @@
"users", "users",
"hidden" "hidden"
], ],
"x-dropshot-pagination": true "x-dropshot-pagination": {
"required": []
}
} }
}, },
"/users-extended/{id}": { "/users-extended/{id}": {
@ -16871,7 +17249,9 @@
"api-calls", "api-calls",
"hidden" "hidden"
], ],
"x-dropshot-pagination": true "x-dropshot-pagination": {
"required": []
}
} }
}, },
"/ws/executor/term": { "/ws/executor/term": {