diff --git a/generate/generate.py b/generate/generate.py index acee3be1a..599349211 100755 --- a/generate/generate.py +++ b/generate/generate.py @@ -379,9 +379,6 @@ def generatePath(path: str, name: str, method: str, endpoint: dict, data: dict) else: success_type = endpoint_refs[0] - if fn_name == "get_file_conversion" or fn_name == "create_file_conversion": - fn_name += "_with_base64_helper" - example_imports = ( """ from kittycad.client import ClientFromEnv @@ -394,15 +391,6 @@ from kittycad.types import Response """ ) - if fn_name.endswith("_with_base64_helper"): - example_imports += ( - """from kittycad.api.""" - + tag_name - + """ import """ - + fn_name.replace("_with_base64_helper", "") - + "\n" - ) - # Iterate over the parameters. params_str = "" if "parameters" in endpoint: @@ -475,16 +463,7 @@ from kittycad.types import Response example_imports + "from typing import Union, Any, Optional, List, Tuple\n" ) - if fn_name.endswith("_with_base64_helper"): - example_variable = ( - "result: " - + response_type.replace( - "FileConversion", "Tuple[FileConversion, bytes]" - ) - + " = " - ) - else: - example_variable = "result: " + response_type + " = " + example_variable = "result: " + response_type + " = " example_imports = example_imports + "from kittycad.types import Response\n" example_imports = example_imports + "from kittycad.models import Error\n" @@ -516,10 +495,6 @@ from kittycad.types import Response and success_type != "" ): example_success_type = success_type - if fn_name.endswith("_with_base64_helper"): - example_success_type = example_success_type.replace( - "FileConversion", "Tuple[FileConversion, bytes]" - ) short_sync_example = short_sync_example + ( """ @@ -541,7 +516,7 @@ from kittycad.types import Response # OR if you need more info (e.g. status_code) """ + example_variable_response - + fn_name.replace("_with_base64_helper", "") + + fn_name + """.sync_detailed(client=client,\n""" + params_str + """) @@ -567,7 +542,7 @@ async def test_""" """ + example_variable_response + "await " - + fn_name.replace("_with_base64_helper", "") + + fn_name + """.asyncio_detailed(client=client,\n""" + params_str + """)""" @@ -963,6 +938,13 @@ def generateTypes(cwd: str, parser: dict): generateType(path, key, schema, data) f.write("from ." + camel_to_snake(key) + " import " + key + "\n") + # This is a hot fix for the empty type. + # We likely need a better way to handle this. + f.write("from .empty import Empty\n") + + # Add the Base64Data type. + f.write("from .base64data import Base64Data\n") + # Close the file. f.close() @@ -994,6 +976,8 @@ def generateType(path: str, name: str, schema: dict, data: dict): return elif "oneOf" in schema: generateOneOfType(file_path, name, schema, data) + elif "anyOf" in schema: + generateAnyOfType(file_path, name, schema, data) else: logging.error("schema: ", [schema]) logging.error("unsupported type: ", name) @@ -1099,6 +1083,123 @@ def generateEnumTypeCode( return value +def generateAnyOfType(path: str, name: str, schema: dict, data: dict): + logging.info("generating type: ", name, " at: ", path) + + if isEnumWithDocsOneOf(schema): + additional_docs = [] + enum = [] + # We want to treat this as an enum with additional docs. + for any_of in schema["anyOf"]: + enum.append(any_of["enum"][0]) + if "description" in any_of: + additional_docs.append(any_of["description"]) + else: + additional_docs.append("") + # Write the enum. + schema["enum"] = enum + schema["type"] = "string" + generateEnumType(path, name, schema, "string", additional_docs) + # return early. + return + + # Open our file. + f = open(path, "w") + + # Import the refs if there are any. + all_options = [] + for any_of in schema["anyOf"]: + if "allOf" in any_of: + for all_of in any_of["allOf"]: + if "$ref" in all_of: + ref = all_of["$ref"] + ref_name = ref[ref.rfind("/") + 1 :] + f.write( + "from ." + + camel_to_snake(ref_name) + + " import " + + ref_name + + "\n" + ) + all_options.append(ref_name) + if "$ref" in any_of: + ref = any_of["$ref"] + ref_name = ref[ref.rfind("/") + 1 :] + f.write("from ." + camel_to_snake(ref_name) + " import " + ref_name + "\n") + all_options.append(ref_name) + + if isNestedObjectOneOf(schema): + # We want to write each of the nested objects. + for any_of in schema["anyOf"]: + # Get the nested object. + if "properties" in any_of: + for prop_name in any_of["properties"]: + nested_object = any_of["properties"][prop_name] + if nested_object == {}: + f.write("from typing import Any\n") + f.write(prop_name + " = Any\n") + f.write("\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") + all_options.append(prop_name) + else: + object_code = generateObjectTypeCode( + prop_name, nested_object, "object", data, None + ) + f.write(object_code) + f.write("\n") + all_options.append(prop_name) + elif "type" in any_of and any_of["type"] == "string": + enum_code = generateEnumTypeCode( + any_of["enum"][0], any_of, "string", [] + ) + f.write(enum_code) + f.write("\n") + all_options.append(any_of["enum"][0]) + + # Check if each any_of has the same enum of one. + tag = getTagAnyOf(schema) + + if tag is not None: + # Generate each of the options from the tag. + for any_of in schema["anyOf"]: + # Get the value of the tag. + object_name = any_of["properties"][tag]["enum"][0] + object_code = generateObjectTypeCode( + object_name, any_of, "object", data, tag + ) + f.write(object_code) + f.write("\n") + all_options.append(object_name) + + # Write the sum type. + f.write("from typing import Union\n") + f.write(name + " = Union[") + + for num, option in enumerate(all_options, start=0): + if num == 0: + f.write(option) + else: + f.write(", " + option + "") + f.write("]\n") + + # Close the file. + f.close() + + def generateOneOfType(path: str, name: str, schema: dict, data: dict): logging.info("generating type: ", name, " at: ", path) @@ -1219,8 +1320,11 @@ def generateObjectTypeCode( f = io.StringIO() has_date_time = hasDateTime(schema) + has_base_64 = hasBase64(schema) if has_date_time: f.write("import datetime\n") + if has_base_64: + f.write("from ..models.base64data import Base64Data\n") f.write( "from typing import Any, Dict, List, Type, TypeVar, Union, cast, deprecated\n" ) @@ -1407,6 +1511,22 @@ def renderTypeToDict(f, property_name: str, property_schema: dict, data: dict): ) # return early return + elif property_schema["format"] == "byte": + f.write("\t\t" + property_name + ": Union[Unset, str] = UNSET\n") + f.write( + "\t\tif not isinstance(self." + + clean_parameter_name(property_name) + + ", Unset):\n" + ) + f.write( + "\t\t\t" + + clean_parameter_name(property_name) + + " = self." + + clean_parameter_name(property_name) + + ".get_encoded()\n" + ) + # return early + return f.write( "\t\t" @@ -1439,6 +1559,79 @@ def renderTypeToDict(f, property_name: str, property_schema: dict, data: dict): + clean_parameter_name(property_name) + "\n" ) + elif "additionalProperties" in property_schema and property_type == "object": + if "$ref" in property_schema["additionalProperties"]: + ref = property_schema["additionalProperties"]["$ref"].replace( + "#/components/schemas/", "" + ) + f.write( + "\t\t" + property_name + ": Union[Unset, Dict[str, Any]] = UNSET\n" + ) + f.write( + "\t\tif not isinstance(self." + + clean_parameter_name(property_name) + + ", Unset):\n" + ) + f.write("\t\t\tnew_dict: Dict[str, Any] = {}\n") + f.write( + "\t\t\tfor key, value in self." + + clean_parameter_name(property_name) + + ".items():\n" + ) + f.write("\t\t\t\tnew_dict[key] = value.to_dict()\n") + f.write( + "\t\t\t" + clean_parameter_name(property_name) + " = new_dict\n" + ) + elif ( + "type" in property_schema["additionalProperties"] + and property_schema["additionalProperties"]["type"] == "integer" + ): + f.write( + "\t\t" + + clean_parameter_name(property_name) + + " = self." + + clean_parameter_name(property_name) + + "\n" + ) + f.write("\n") + elif ( + "format" in property_schema["additionalProperties"] + and property_schema["additionalProperties"]["format"] == "byte" + ): + f.write( + "\t\t" + property_name + ": Union[Unset, Dict[str, str]] = UNSET\n" + ) + f.write( + "\t\tif not isinstance(self." + + clean_parameter_name(property_name) + + ", Unset):\n" + ) + f.write("\t\t\tnew_dict: Dict[str, str] = {}\n") + f.write( + "\t\t\tfor key, value in self." + + clean_parameter_name(property_name) + + ".items():\n" + ) + f.write("\t\t\t\tnew_dict[key] = value.get_encoded()\n") + f.write( + "\t\t\t" + clean_parameter_name(property_name) + " = new_dict\n" + ) + elif ( + "type" in property_schema["additionalProperties"] + and property_schema["additionalProperties"]["type"] == "string" + ): + f.write( + "\t\t" + + clean_parameter_name(property_name) + + " = self." + + clean_parameter_name(property_name) + + "\n" + ) + f.write("\n") + else: + # Throw an error. + print("property: ", property_schema) + raise Exception("Unknown property type") elif property_type == "array": if "items" in property_schema: if "$ref" in property_schema["items"]: @@ -1573,9 +1766,59 @@ def renderTypeInit(f, property_name: str, property_schema: dict, data: dict): ) # Return early. return + elif property_schema["format"] == "byte": + f.write( + "\t" + property_name + ": Union[Unset, Base64Data] = UNSET\n" + ) + # Return early. + return f.write("\t" + property_name + ": Union[Unset, str] = UNSET\n") + elif "additionalProperties" in property_schema and property_type == "object": + if "$ref" in property_schema["additionalProperties"]: + ref = property_schema["additionalProperties"]["$ref"].replace( + "#/components/schemas/", "" + ) + # Make sure we import the model. + f.write( + "\tfrom ..models." + camel_to_snake(ref) + " import " + ref + "\n" + ) + f.write( + "\t" + + property_name + + ": Union[Unset, Dict[str, " + + ref + + "]] = UNSET\n" + ) + elif ( + "type" in property_schema["additionalProperties"] + and property_schema["additionalProperties"]["type"] == "integer" + ): + f.write( + "\t" + property_name + ": Union[Unset, Dict[str, int]] = UNSET\n" + ) + elif ( + "format" in property_schema["additionalProperties"] + and property_schema["additionalProperties"]["format"] == "byte" + ): + f.write( + "\t" + + property_name + + ": Union[Unset, Dict[str, Base64Data]] = UNSET\n" + ) + elif ( + "type" in property_schema["additionalProperties"] + and property_schema["additionalProperties"]["type"] == "string" + ): + f.write( + "\t" + property_name + ": Union[Unset, Dict[str, str]] = UNSET\n" + ) + else: + # Throw an error. + print("property: ", property_schema) + raise Exception("Unknown property type") elif property_type == "object": + # TODO: we need to get the name of the object f.write("\t" + property_name + ": Union[Unset, Any] = UNSET\n") elif property_type == "integer": f.write("\t" + property_name + ": Union[Unset, int] = UNSET\n") @@ -1694,6 +1937,38 @@ def renderTypeFromDict(f, property_name: str, property_schema: dict, data: dict) f.write("\n") # Return early. return + elif property_schema["format"] == "byte": + f.write( + "\t\t_" + + clean_parameter_name(property_name) + + ' = d.pop("' + + property_name + + '", UNSET)\n' + ) + f.write( + "\t\t" + + clean_parameter_name(property_name) + + ": Union[Unset, Base64Data]\n" + ) + f.write( + "\t\tif isinstance(_" + + clean_parameter_name(property_name) + + ", Unset):\n" + ) + f.write( + "\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n" + ) + f.write("\t\telse:\n") + f.write( + "\t\t\t" + + clean_parameter_name(property_name) + + " = Base64Data(bytes(_" + + clean_parameter_name(property_name) + + ", 'utf-8'))\n" + ) + f.write("\n") + # Return early. + return f.write( "\t\t" @@ -1730,6 +2005,90 @@ def renderTypeFromDict(f, property_name: str, property_schema: dict, data: dict) + '", UNSET)\n' ) f.write("\n") + elif "additionalProperties" in property_schema and property_type == "object": + if "$ref" in property_schema["additionalProperties"]: + ref = property_schema["additionalProperties"]["$ref"].replace( + "#/components/schemas/", "" + ) + f.write( + "\t\t_" + + clean_parameter_name(property_name) + + ' = d.pop("' + + property_name + + '", UNSET)\n' + ) + f.write( + "\t\tif isinstance(_" + + clean_parameter_name(property_name) + + ", Unset):\n" + ) + f.write("\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n") + f.write("\t\telse:\n") + f.write( + "\t\t\tnew_map: Dict[str, " + + ref + + "] = {}\n\t\t\tfor k, v in _" + + clean_parameter_name(property_name) + + ".items():\n\t\t\t\tnew_map[k] = " + + ref + + ".from_dict(v) # type: ignore\n\t\t\t" + + clean_parameter_name(property_name) + + " = new_map # type: ignore\n" + ) + f.write("\n") + elif ( + "type" in property_schema["additionalProperties"] + and property_schema["additionalProperties"]["type"] == "integer" + ): + f.write( + "\t\t" + + clean_parameter_name(property_name) + + ' = d.pop("' + + property_name + + '", UNSET)\n' + ) + f.write("\n") + elif ( + "format" in property_schema["additionalProperties"] + and property_schema["additionalProperties"]["format"] == "byte" + ): + f.write( + "\t\t_" + + clean_parameter_name(property_name) + + ' = d.pop("' + + property_name + + '", UNSET)\n' + ) + f.write( + "\t\tif isinstance(_" + + clean_parameter_name(property_name) + + ", Unset):\n" + ) + f.write("\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n") + f.write( + "\t\telse:\n\t\t\tnew_map: Dict[str, Base64Data] = {}\n\t\t\tfor k, v in _" + + clean_parameter_name(property_name) + + ".items():\n\t\t\t\tnew_map[k] = Base64Data(bytes(v, 'utf-8'))\n\t\t\t" + + clean_parameter_name(property_name) + + " = new_map # type: ignore\n" + ) + f.write("\n") + elif ( + "type" in property_schema["additionalProperties"] + and property_schema["additionalProperties"]["type"] == "string" + ): + f.write( + "\t\t" + + clean_parameter_name(property_name) + + ' = d.pop("' + + property_name + + '", UNSET)\n' + ) + f.write("\n") + else: + # Throw an error. + print("property: ", property_schema) + raise Exception("Unknown property type") elif property_type == "array": if "items" in property_schema: if "$ref" in property_schema["items"]: @@ -1861,6 +2220,25 @@ def hasDateTime(schema: dict) -> bool: return False +def hasBase64(schema: dict) -> bool: + # Generate the type. + if "type" in schema: + type_name = schema["type"] + if type_name == "object": + # Iternate over the properties. + if "properties" in schema: + for property_name in schema["properties"]: + property_schema = schema["properties"][property_name] + has_base64 = hasBase64(property_schema) + if has_base64: + return True + elif type_name == "string" and "format" in schema: + if schema["format"] == "byte": + return True + + return False + + def getRefs(schema: dict) -> List[str]: refs = [] if "$ref" in schema: @@ -2074,7 +2452,7 @@ def camel_to_screaming_snake(name: str): # Change `file_conversion` to `FileConversion` def snake_to_title(name: str): - return name.title().replace("_", "") + return name.title().replace("_", "").replace("3D", "3d") def get_function_parameters( @@ -2145,6 +2523,34 @@ def isNestedObjectOneOf(schema: dict) -> bool: return is_nested_object +def getTagAnyOf(schema: dict) -> Optional[str]: + tag = None + for any_of in schema["anyOf"]: + has_tag = False + # Check if each are an object w 1 property in it. + if "type" in any_of and any_of["type"] == "object" and "properties" in any_of: + for prop_name in any_of["properties"]: + prop = any_of["properties"][prop_name] + if ( + "type" in prop + and prop["type"] == "string" + and "enum" in prop + and len(prop["enum"]) == 1 + ): + if tag is not None and tag != prop_name: + has_tag = False + break + else: + has_tag = True + tag = prop_name + + if has_tag is False: + tag = None + break + + return tag + + def getTagOneOf(schema: dict) -> Optional[str]: tag = None for one_of in schema["oneOf"]: diff --git a/generate/run.sh b/generate/run.sh index f4b7e3452..1132a385b 100755 --- a/generate/run.sh +++ b/generate/run.sh @@ -5,10 +5,14 @@ set -o pipefail # Fix for ci. git config --global --add safe.directory /home/user/src +git add kittycad/models/base64data.py +git add kittycad/models/empty.py + # Cleanup old stuff. rm -rf kittycad/models rm -rf kittycad/api -git checkout kittycad/api/file/*_with_base64_helper.py &>/dev/null +git checkout kittycad/models/base64data.py +git checkout kittycad/models/empty.py # Generate new. poetry run python generate/generate.py diff --git a/kittycad.py.patch.json b/kittycad.py.patch.json index 99eae2653..71c32f3e9 100644 --- a/kittycad.py.patch.json +++ b/kittycad.py.patch.json @@ -1 +1 @@ -[{"op": "add", "path": "/info/x-python", "value": {"client": "# Create a client with your token.\nfrom kittycad import Client\n\nclient = Client(token=\"$TOKEN\")\n\n# - OR -\n\n# Create a new client with your token parsed from the environment variable:\n# `KITTYCAD_API_TOKEN`.\nfrom kittycad import ClientFromEnv\n\nclient = ClientFromEnv()\n\n# NOTE: The python library additionally implements asyncio, however all the code samples we\n# show below use the sync functions for ease of use and understanding.\n# Check out the library docs at:\n# https://python.api.docs.kittycad.io/_autosummary/kittycad.api.html#module-kittycad.api\n# for more details.", "install": "pip install kittycad"}}, {"op": "add", "path": "/components/schemas/RtcIceProtocol/enum", "value": ["unspecified", "udp", "tcp"]}, {"op": "add", "path": "/components/schemas/RtcIceProtocol/type", "value": "string"}, {"op": "add", "path": "/components/schemas/PaymentMethodType/enum", "value": ["card"]}, {"op": "add", "path": "/components/schemas/PaymentMethodType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitArea/enum", "value": ["cm2", "dm2", "ft2", "in2", "km2", "m2", "mm2", "yd2"]}, {"op": "add", "path": "/components/schemas/UnitArea/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitMass/enum", "value": ["g", "kg", "lb"]}, {"op": "add", "path": "/components/schemas/UnitMass/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AnnotationType/enum", "value": ["t2d", "t3d"]}, {"op": "add", "path": "/components/schemas/AnnotationType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/InvoiceStatus/enum", "value": ["deleted", "draft", "open", "paid", "uncollectible", "void"]}, {"op": "add", "path": "/components/schemas/InvoiceStatus/type", "value": "string"}, {"op": "add", "path": "/components/schemas/Currency/enum", "value": ["aed", "afn", "all", "amd", "ang", "aoa", "ars", "aud", "awg", "azn", "bam", "bbd", "bdt", "bgn", "bif", "bmd", "bnd", "bob", "brl", "bsd", "bwp", "bzd", "cad", "cdf", "chf", "clp", "cny", "cop", "crc", "cve", "czk", "djf", "dkk", "dop", "dzd", "eek", "egp", "etb", "eur", "fjd", "fkp", "gbp", "gel", "gip", "gmd", "gnf", "gtq", "gyd", "hkd", "hnl", "hrk", "htg", "huf", "idr", "ils", "inr", "isk", "jmd", "jpy", "kes", "kgs", "khr", "kmf", "krw", "kyd", "kzt", "lak", "lbp", "lkr", "lrd", "lsl", "ltl", "lvl", "mad", "mdl", "mga", "mkd", "mnt", "mop", "mro", "mur", "mvr", "mwk", "mxn", "myr", "mzn", "nad", "ngn", "nio", "nok", "npr", "nzd", "pab", "pen", "pgk", "php", "pkr", "pln", "pyg", "qar", "ron", "rsd", "rub", "rwf", "sar", "sbd", "scr", "sek", "sgd", "shp", "sll", "sos", "srd", "std", "svc", "szl", "thb", "tjs", "top", "try", "ttd", "twd", "tzs", "uah", "ugx", "usd", "uyu", "uzs", "vef", "vnd", "vuv", "wst", "xaf", "xcd", "xof", "xpf", "yer", "zar", "zmw"]}, {"op": "add", "path": "/components/schemas/Currency/type", "value": "string"}, {"op": "add", "path": "/components/schemas/CountryCode/enum", "value": ["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]}, {"op": "add", "path": "/components/schemas/CountryCode/type", "value": "string"}, {"op": "add", "path": "/components/schemas/CreatedAtSortMode/enum", "value": ["created_at_ascending", "created_at_descending"]}, {"op": "add", "path": "/components/schemas/CreatedAtSortMode/type", "value": "string"}, {"op": "add", "path": "/components/schemas/CodeLanguage/enum", "value": ["go", "python", "node"]}, {"op": "add", "path": "/components/schemas/CodeLanguage/type", "value": "string"}, {"op": "add", "path": "/components/schemas/Environment/enum", "value": ["DEVELOPMENT", "PREVIEW", "PRODUCTION"]}, {"op": "add", "path": "/components/schemas/Environment/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AiPluginApiType/enum", "value": ["openapi"]}, {"op": "add", "path": "/components/schemas/AiPluginApiType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitTorque/enum", "value": ["newton_metres", "pound_foot"]}, {"op": "add", "path": "/components/schemas/UnitTorque/type", "value": "string"}, {"op": "add", "path": "/components/schemas/FileImportFormat/enum", "value": ["gltf", "obj", "ply", "step", "stl"]}, {"op": "add", "path": "/components/schemas/FileImportFormat/type", "value": "string"}, {"op": "add", "path": "/components/schemas/OAuth2GrantType/enum", "value": ["urn:ietf:params:oauth:grant-type:device_code"]}, {"op": "add", "path": "/components/schemas/OAuth2GrantType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitDensity/enum", "value": ["lb:ft3", "kg:m3"]}, {"op": "add", "path": "/components/schemas/UnitDensity/type", "value": "string"}, {"op": "add", "path": "/components/schemas/FileExportFormat/enum", "value": ["gltf", "obj", "ply", "step", "stl"]}, {"op": "add", "path": "/components/schemas/FileExportFormat/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AiPluginHttpAuthType/enum", "value": ["basic", "bearer"]}, {"op": "add", "path": "/components/schemas/AiPluginHttpAuthType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitLength/enum", "value": ["cm", "ft", "in", "m", "mm", "yd"]}, {"op": "add", "path": "/components/schemas/UnitLength/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AccountProvider/enum", "value": ["google", "github"]}, {"op": "add", "path": "/components/schemas/AccountProvider/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitFrequency/enum", "value": ["gigahertz", "hertz", "kilohertz", "megahertz", "microhertz", "millihertz", "nanohertz", "terahertz"]}, {"op": "add", "path": "/components/schemas/UnitFrequency/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AiPluginAuthType/enum", "value": ["none", "user_http", "service_http", "oauth"]}, {"op": "add", "path": "/components/schemas/AiPluginAuthType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/RtcSdpType/enum", "value": ["unspecified", "offer", "pranswer", "answer", "rollback"]}, {"op": "add", "path": "/components/schemas/RtcSdpType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/ErrorCode/enum", "value": ["bad_request", "internal_engine"]}, {"op": "add", "path": "/components/schemas/ErrorCode/type", "value": "string"}, {"op": "add", "path": "/components/schemas/ApiCallQueryGroupBy/enum", "value": ["email", "method", "endpoint", "user_id", "origin", "ip_address"]}, {"op": "add", "path": "/components/schemas/ApiCallQueryGroupBy/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitPower/enum", "value": ["btu_per_minute", "horsepower", "kilowatts", "metric_horsepower", "microwatts", "milliwatts", "watts"]}, {"op": "add", "path": "/components/schemas/UnitPower/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitVolume/enum", "value": ["cm3", "ft3", "in3", "m3", "yd3", "usfloz", "usgal", "l", "ml"]}, {"op": "add", "path": "/components/schemas/UnitVolume/type", "value": "string"}, {"op": "add", "path": "/components/schemas/SceneSelectionType/enum", "value": ["replace", "add", "remove"]}, {"op": "add", "path": "/components/schemas/SceneSelectionType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitTemperature/enum", "value": ["celsius", "fahrenheit", "kelvin", "rankine"]}, {"op": "add", "path": "/components/schemas/UnitTemperature/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitForce/enum", "value": ["dynes", "kiloponds", "micronewtons", "millinewtons", "newtons", "poundals", "pounds"]}, {"op": "add", "path": "/components/schemas/UnitForce/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitAngle/enum", "value": ["degrees", "radians"]}, {"op": "add", "path": "/components/schemas/UnitAngle/type", "value": "string"}, {"op": "add", "path": "/components/schemas/Direction/enum", "value": ["positive", "negative"]}, {"op": "add", "path": "/components/schemas/Direction/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitPressure/enum", "value": ["atmospheres", "bars", "hectopascals", "kilopascals", "millibars", "pascals", "psi"]}, {"op": "add", "path": "/components/schemas/UnitPressure/type", "value": "string"}, {"op": "add", "path": "/components/schemas/Axis/enum", "value": ["y", "z"]}, {"op": "add", "path": "/components/schemas/Axis/type", "value": "string"}, {"op": "add", "path": "/components/schemas/Method/enum", "value": ["OPTIONS", "GET", "POST", "PUT", "DELETE", "HEAD", "TRACE", "CONNECT", "PATCH", "EXTENSION"]}, {"op": "add", "path": "/components/schemas/Method/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitCurrent/enum", "value": ["amperes", "microamperes", "milliamperes", "nanoamperes"]}, {"op": "add", "path": "/components/schemas/UnitCurrent/type", "value": "string"}, {"op": "add", "path": "/components/schemas/RtcIceCandidateType/enum", "value": ["unspecified", "host", "srflx", "prflx", "relay"]}, {"op": "add", "path": "/components/schemas/RtcIceCandidateType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitEnergy/enum", "value": ["btu", "electronvolts", "joules", "kilocalories", "kilowatt_hours", "watt_hours"]}, {"op": "add", "path": "/components/schemas/UnitEnergy/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AsyncApiCallType/enum", "value": ["file_conversion", "file_volume", "file_center_of_mass", "file_mass", "file_density", "file_surface_area"]}, {"op": "add", "path": "/components/schemas/AsyncApiCallType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/Storage/enum", "value": ["binary", "standard", "embedded"]}, {"op": "add", "path": "/components/schemas/Storage/type", "value": "string"}, {"op": "add", "path": "/components/schemas/CameraDragInteractionType/enum", "value": ["pan", "rotate", "zoom"]}, {"op": "add", "path": "/components/schemas/CameraDragInteractionType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/ApiCallStatus/enum", "value": ["queued", "uploaded", "in_progress", "completed", "failed"]}, {"op": "add", "path": "/components/schemas/ApiCallStatus/type", "value": "string"}, {"op": "add", "path": "/paths/~1user~1api-tokens/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import create_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_create_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = create_api_token_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.create_api_token_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1api-tokens/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import list_api_tokens_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiTokenResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_tokens_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiTokenResultsPage, Error]\n ] = list_api_tokens_for_user.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiTokenResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.list_api_tokens_for_user.html"}}, {"op": "add", "path": "/paths/~1modeling~1cmd/post/x-python", "value": {"example": "from kittycad.api.modeling import cmd\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models.modeling_cmd import move_path_pen\nfrom kittycad.models.modeling_cmd_id import ModelingCmdId\nfrom kittycad.models.modeling_cmd_req import ModelingCmdReq\nfrom kittycad.models.point3d import Point3d\nfrom kittycad.types import Response\n\n\ndef example_cmd():\n # Create our client.\n client = ClientFromEnv()\n\n cmd.sync(\n client=client,\n body=ModelingCmdReq(\n cmd=move_path_pen(\n path=ModelingCmdId(\"\"),\n to=Point3d(\n x=3.14,\n y=3.14,\n z=3.14,\n ),\n ),\n cmd_id=ModelingCmdId(\"\"),\n ),\n )\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.cmd.html"}}, {"op": "add", "path": "/paths/~1user~1session~1{token}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_session_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Session\nfrom kittycad.types import Response\n\n\ndef example_get_session_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Session, Error]] = get_session_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Session = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_session_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1api-calls~1{id}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1tax/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import validate_customer_tax_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_validate_customer_tax_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = validate_customer_tax_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.validate_customer_tax_information_for_user.html"}}, {"op": "add", "path": "/paths/~1api-calls/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls.html"}}, {"op": "add", "path": "/paths/~1.well-known~1ai-plugin.json/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_ai_plugin_manifest\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPluginManifest, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_plugin_manifest():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AiPluginManifest, Error]\n ] = get_ai_plugin_manifest.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPluginManifest = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_ai_plugin_manifest.html"}}, {"op": "add", "path": "/paths/~1user~1extended/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_self_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_self_extended.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self_extended.html"}}, {"op": "add", "path": "/paths/~1apps~1github~1consent/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_consent\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AppClientInfo, Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_consent():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AppClientInfo, Error]] = apps_github_consent.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AppClientInfo = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_consent.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1pressure~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_pressure_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPressureConversion\nfrom kittycad.models.unit_pressure import UnitPressure\nfrom kittycad.types import Response\n\n\ndef example_get_pressure_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPressureConversion, Error]\n ] = get_pressure_unit_conversion.sync(\n client=client,\n input_unit=UnitPressure.ATMOSPHERES,\n output_unit=UnitPressure.ATMOSPHERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPressureConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_pressure_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1file~1execute~1{lang}/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.executor import create_file_execution\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CodeOutput, Error\nfrom kittycad.models.code_language import CodeLanguage\nfrom kittycad.types import Response\n\n\ndef example_create_file_execution():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[CodeOutput, Error]] = create_file_execution.sync(\n client=client,\n lang=CodeLanguage.GO,\n output=None, # Optional[str]\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CodeOutput = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_file_execution.html"}}, {"op": "add", "path": "/paths/~1file~1mass/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileMass, Error]] = create_file_mass.sync(\n client=client,\n material_density=3.14,\n material_density_unit=UnitDensity.LB_FT3,\n output_unit=UnitMass.G,\n src_format=FileImportFormat.GLTF,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileMass = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_mass.html"}}, {"op": "add", "path": "/paths/~1users-extended/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ExtendedUserResultsPage, Error]\n ] = list_users_extended.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUserResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users_extended.html"}}, {"op": "add", "path": "/paths/~1user~1front-hash/get/x-python", "value": {"example": "from kittycad.api.users import get_user_front_hash_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_user_front_hash_self():\n # Create our client.\n client = ClientFromEnv()\n\n get_user_front_hash_self.sync(\n client=client,\n )\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_front_hash_self.html"}}, {"op": "add", "path": "/paths/~1file~1conversion~1{src_format}~1{output_format}/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import (\n create_file_conversion,\n create_file_conversion_with_base64_helper,\n)\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileConversion\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.types import Response\n\n\ndef example_create_file_conversion_with_base64_helper():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Tuple[FileConversion, bytes], Error]\n ] = create_file_conversion_with_base64_helper.sync(\n client=client,\n output_format=FileExportFormat.GLTF,\n src_format=FileImportFormat.GLTF,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Tuple[FileConversion, bytes] = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_conversion_with_base64_helper.html"}}, {"op": "add", "path": "/paths/~1ai~1text-to-3d~1{output_format}/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_3d\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Mesh\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_3d():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Mesh, Error]] = create_text_to_3d.sync(\n client=client,\n output_format=FileExportFormat.GLTF,\n prompt=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Mesh = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_3d.html"}}, {"op": "add", "path": "/paths/~1users/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[UserResultsPage, Error]] = list_users.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UserResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users.html"}}, {"op": "add", "path": "/paths/~1users-extended~1{id}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_extended.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_extended.html"}}, {"op": "add", "path": "/paths/~1user/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self.html"}}, {"op": "add", "path": "/paths/~1user/delete/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import delete_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.delete_user_self.html"}}, {"op": "add", "path": "/paths/~1user/put/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import update_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.models.update_user import UpdateUser\nfrom kittycad.types import Response\n\n\ndef example_update_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = update_user_self.sync(\n client=client,\n body=UpdateUser(\n company=\"\",\n discord=\"\",\n first_name=\"\",\n github=\"\",\n last_name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.update_user_self.html"}}, {"op": "add", "path": "/paths/~1ping/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import ping\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Pong\nfrom kittycad.types import Response\n\n\ndef example_ping():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Pong, Error]] = ping.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Pong = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.ping.html"}}, {"op": "add", "path": "/paths/~1user~1api-tokens~1{token}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import get_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = get_api_token_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.get_api_token_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1api-tokens~1{token}/delete/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import delete_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_api_token_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.delete_api_token_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1intent/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_intent_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentIntent\nfrom kittycad.types import Response\n\n\ndef example_create_payment_intent_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PaymentIntent, Error]\n ] = create_payment_intent_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PaymentIntent = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_intent_for_user.html"}}, {"op": "add", "path": "/paths/~1ws~1executor~1term/get/x-python", "value": {"example": "from kittycad.api.executor import create_executor_term\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_create_executor_term():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n websocket = create_executor_term.sync(\n client=client,\n )\n\n # Send a message.\n websocket.send(\"{}\")\n\n # Get the messages.\n for message in websocket:\n print(message)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_executor_term.html"}}, {"op": "add", "path": "/paths/~1users~1{id}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1methods/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_payment_methods_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentMethod\nfrom kittycad.types import Response\n\n\ndef example_list_payment_methods_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[PaymentMethod], Error]\n ] = list_payment_methods_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[PaymentMethod] = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_payment_methods_for_user.html"}}, {"op": "add", "path": "/paths/~1file~1volume/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_volume\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileVolume\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_create_file_volume():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileVolume, Error]] = create_file_volume.sync(\n client=client,\n output_unit=UnitVolume.CM3,\n src_format=FileImportFormat.GLTF,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileVolume = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_volume.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1mass~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_mass_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitMassConversion\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_get_mass_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitMassConversion, Error]\n ] = get_mass_unit_conversion.sync(\n client=client,\n input_unit=UnitMass.G,\n output_unit=UnitMass.G,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitMassConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_mass_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1ai~1image-to-3d~1{input_format}~1{output_format}/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_image_to_3d\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Mesh\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.image_type import ImageType\nfrom kittycad.types import Response\n\n\ndef example_create_image_to_3d():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Mesh, Error]] = create_image_to_3d.sync(\n client=client,\n input_format=ImageType.PNG,\n output_format=FileExportFormat.GLTF,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Mesh = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_image_to_3d.html"}}, {"op": "add", "path": "/paths/~1users~1{id}~1api-calls/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls_for_user.sync(\n client=client,\n id=\"\",\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls_for_user.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1length~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_length_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitLengthConversion\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_get_length_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitLengthConversion, Error]\n ] = get_length_unit_conversion.sync(\n client=client,\n input_unit=UnitLength.CM,\n output_unit=UnitLength.CM,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitLengthConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_length_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1file~1surface-area/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_surface_area\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileSurfaceArea\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_create_file_surface_area():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileSurfaceArea, Error]\n ] = create_file_surface_area.sync(\n client=client,\n output_unit=UnitArea.CM2,\n src_format=FileImportFormat.GLTF,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileSurfaceArea = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_surface_area.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1area~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_area_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAreaConversion\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_get_area_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAreaConversion, Error]\n ] = get_area_unit_conversion.sync(\n client=client,\n input_unit=UnitArea.CM2,\n output_unit=UnitArea.CM2,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAreaConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_area_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1methods~1{id}/delete/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_method_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_method_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_method_for_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_method_for_user.html"}}, {"op": "add", "path": "/paths/~1auth~1email/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, VerificationToken\nfrom kittycad.models.email_authentication_form import EmailAuthenticationForm\nfrom kittycad.types import Response\n\n\ndef example_auth_email():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[VerificationToken, Error]] = auth_email.sync(\n client=client,\n body=EmailAuthenticationForm(\n email=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: VerificationToken = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1current~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_current_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitCurrentConversion\nfrom kittycad.models.unit_current import UnitCurrent\nfrom kittycad.types import Response\n\n\ndef example_get_current_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitCurrentConversion, Error]\n ] = get_current_unit_conversion.sync(\n client=client,\n input_unit=UnitCurrent.AMPERES,\n output_unit=UnitCurrent.AMPERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitCurrentConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_current_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1modeling~1cmd-batch/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.modeling import cmd_batch\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ModelingOutcomes\nfrom kittycad.models.modeling_cmd import move_path_pen\nfrom kittycad.models.modeling_cmd_id import ModelingCmdId\nfrom kittycad.models.modeling_cmd_req import ModelingCmdReq\nfrom kittycad.models.modeling_cmd_req_batch import ModelingCmdReqBatch\nfrom kittycad.models.point3d import Point3d\nfrom kittycad.types import Response\n\n\ndef example_cmd_batch():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ModelingOutcomes, Error]] = cmd_batch.sync(\n client=client,\n body=ModelingCmdReqBatch(\n cmds={\n \"\": ModelingCmdReq(\n cmd=move_path_pen(\n path=ModelingCmdId(\"\"),\n to=Point3d(\n x=3.14,\n y=3.14,\n z=3.14,\n ),\n ),\n cmd_id=ModelingCmdId(\"\"),\n )\n },\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ModelingOutcomes = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.cmd_batch.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1angle~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_angle_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAngleConversion\nfrom kittycad.models.unit_angle import UnitAngle\nfrom kittycad.types import Response\n\n\ndef example_get_angle_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAngleConversion, Error]\n ] = get_angle_unit_conversion.sync(\n client=client,\n input_unit=UnitAngle.DEGREES,\n output_unit=UnitAngle.DEGREES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAngleConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_angle_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1logout/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import logout\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_logout():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = logout.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.logout.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1force~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_force_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitForceConversion\nfrom kittycad.models.unit_force import UnitForce\nfrom kittycad.types import Response\n\n\ndef example_get_force_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitForceConversion, Error]\n ] = get_force_unit_conversion.sync(\n client=client,\n input_unit=UnitForce.DYNES,\n output_unit=UnitForce.DYNES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitForceConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_force_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1user~1onboarding/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_onboarding_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Onboarding\nfrom kittycad.types import Response\n\n\ndef example_get_user_onboarding_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Onboarding, Error]] = get_user_onboarding_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Onboarding = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_onboarding_self.html"}}, {"op": "add", "path": "/paths/~1_meta~1info/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_metadata\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Metadata\nfrom kittycad.types import Response\n\n\ndef example_get_metadata():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Metadata, Error]] = get_metadata.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Metadata = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_metadata.html"}}, {"op": "add", "path": "/paths/~1user~1api-calls/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import user_list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_user_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = user_list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.user_list_api_calls.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1torque~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_torque_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTorqueConversion\nfrom kittycad.models.unit_torque import UnitTorque\nfrom kittycad.types import Response\n\n\ndef example_get_torque_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTorqueConversion, Error]\n ] = get_torque_unit_conversion.sync(\n client=client,\n input_unit=UnitTorque.NEWTON_METRES,\n output_unit=UnitTorque.NEWTON_METRES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTorqueConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_torque_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1async~1operations~1{id}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_async_operation\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import (\n Error,\n FileCenterOfMass,\n FileConversion,\n FileDensity,\n FileMass,\n FileSurfaceArea,\n FileVolume,\n)\nfrom kittycad.types import Response\n\n\ndef example_get_async_operation():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n Error,\n ]\n ] = get_async_operation.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n ] = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_async_operation.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1energy~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_energy_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitEnergyConversion\nfrom kittycad.models.unit_energy import UnitEnergy\nfrom kittycad.types import Response\n\n\ndef example_get_energy_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitEnergyConversion, Error]\n ] = get_energy_unit_conversion.sync(\n client=client,\n input_unit=UnitEnergy.BTU,\n output_unit=UnitEnergy.BTU,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitEnergyConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_energy_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1apps~1github~1callback/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_callback.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_callback.html"}}, {"op": "add", "path": "/paths/~1file~1density/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_density\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileDensity\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_density():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileDensity, Error]] = create_file_density.sync(\n client=client,\n material_mass=3.14,\n material_mass_unit=UnitMass.G,\n output_unit=UnitDensity.LB_FT3,\n src_format=FileImportFormat.GLTF,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileDensity = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_density.html"}}, {"op": "add", "path": "/paths/~1file~1center-of-mass/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_center_of_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileCenterOfMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_create_file_center_of_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileCenterOfMass, Error]\n ] = create_file_center_of_mass.sync(\n client=client,\n output_unit=UnitLength.CM,\n src_format=FileImportFormat.GLTF,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileCenterOfMass = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_center_of_mass.html"}}, {"op": "add", "path": "/paths/~1openai~1openapi.json/get/x-python", "value": {"example": "from kittycad.api.meta import get_openai_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_openai_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_openai_schema.sync(\n client=client,\n )\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_openai_schema.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1frequency~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_frequency_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitFrequencyConversion\nfrom kittycad.models.unit_frequency import UnitFrequency\nfrom kittycad.types import Response\n\n\ndef example_get_frequency_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitFrequencyConversion, Error]\n ] = get_frequency_unit_conversion.sync(\n client=client,\n input_unit=UnitFrequency.GIGAHERTZ,\n output_unit=UnitFrequency.GIGAHERTZ,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitFrequencyConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_frequency_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1user~1payment/put/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_update_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = update_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_information_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1payment/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_create_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = create_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_information_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1payment/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = get_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_information_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1payment/delete/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_information_for_user.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1volume~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_volume_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitVolumeConversion\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_get_volume_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitVolumeConversion, Error]\n ] = get_volume_unit_conversion.sync(\n client=client,\n input_unit=UnitVolume.CM3,\n output_unit=UnitVolume.CM3,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitVolumeConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_volume_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1api-call-metrics/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_metrics\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallQueryGroup, Error\nfrom kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_metrics():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[ApiCallQueryGroup], Error]\n ] = get_api_call_metrics.sync(\n client=client,\n group_by=ApiCallQueryGroupBy.EMAIL,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[ApiCallQueryGroup] = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_metrics.html"}}, {"op": "add", "path": "/paths/~1async~1operations/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_async_operations\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AsyncApiCallResultsPage, Error\nfrom kittycad.models.api_call_status import ApiCallStatus\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_async_operations():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AsyncApiCallResultsPage, Error]\n ] = list_async_operations.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n status=ApiCallStatus.QUEUED,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AsyncApiCallResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_async_operations.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1invoices/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_invoices_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Invoice\nfrom kittycad.types import Response\n\n\ndef example_list_invoices_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[List[Invoice], Error]] = list_invoices_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[Invoice] = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_invoices_for_user.html"}}, {"op": "add", "path": "/paths/~1auth~1email~1callback/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_auth_email_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = auth_email_callback.sync(\n client=client,\n email=\"\",\n token=\"\",\n callback_url=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email_callback.html"}}, {"op": "add", "path": "/paths/~1ws~1modeling~1commands/get/x-python", "value": {"example": "from kittycad.api.modeling import modeling_commands_ws\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_modeling_commands_ws():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n websocket = modeling_commands_ws.sync(\n client=client,\n fps=10,\n unlocked_framerate=False,\n video_res_height=10,\n video_res_width=10,\n )\n\n # Send a message.\n websocket.send(\"{}\")\n\n # Get the messages.\n for message in websocket:\n print(message)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.modeling_commands_ws.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1power~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_power_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPowerConversion\nfrom kittycad.models.unit_power import UnitPower\nfrom kittycad.types import Response\n\n\ndef example_get_power_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPowerConversion, Error]\n ] = get_power_unit_conversion.sync(\n client=client,\n input_unit=UnitPower.BTU_PER_MINUTE,\n output_unit=UnitPower.BTU_PER_MINUTE,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPowerConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_power_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1api-calls~1{id}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call.html"}}, {"op": "add", "path": "/paths/~1apps~1github~1webhook/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_webhook\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_webhook():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_webhook.sync(\n client=client,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_webhook.html"}}, {"op": "add", "path": "/paths/~1/get/x-python", "value": {"example": "from kittycad.api.meta import get_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_schema.sync(\n client=client,\n )\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_schema.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1temperature~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_temperature_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTemperatureConversion\nfrom kittycad.models.unit_temperature import UnitTemperature\nfrom kittycad.types import Response\n\n\ndef example_get_temperature_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTemperatureConversion, Error]\n ] = get_temperature_unit_conversion.sync(\n client=client,\n input_unit=UnitTemperature.CELSIUS,\n output_unit=UnitTemperature.CELSIUS,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTemperatureConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_temperature_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1balance/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_user.html"}}] \ No newline at end of file +[{"op": "add", "path": "/components/schemas/UnitVolume/enum", "value": ["cm3", "ft3", "in3", "m3", "yd3", "usfloz", "usgal", "l", "ml"]}, {"op": "add", "path": "/components/schemas/UnitVolume/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AiPluginHttpAuthType/enum", "value": ["basic", "bearer"]}, {"op": "add", "path": "/components/schemas/AiPluginHttpAuthType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AsyncApiCallType/enum", "value": ["file_conversion", "file_volume", "file_center_of_mass", "file_mass", "file_density", "file_surface_area"]}, {"op": "add", "path": "/components/schemas/AsyncApiCallType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/OAuth2GrantType/enum", "value": ["urn:ietf:params:oauth:grant-type:device_code"]}, {"op": "add", "path": "/components/schemas/OAuth2GrantType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/ImageFormat/enum", "value": ["png", "jpeg"]}, {"op": "add", "path": "/components/schemas/ImageFormat/type", "value": "string"}, {"op": "add", "path": "/components/schemas/Direction/enum", "value": ["positive", "negative"]}, {"op": "add", "path": "/components/schemas/Direction/type", "value": "string"}, {"op": "add", "path": "/components/schemas/Axis/enum", "value": ["y", "z"]}, {"op": "add", "path": "/components/schemas/Axis/type", "value": "string"}, {"op": "add", "path": "/components/schemas/FbxStorage/enum", "value": ["ascii", "binary"]}, {"op": "add", "path": "/components/schemas/FbxStorage/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitTemperature/enum", "value": ["celsius", "fahrenheit", "kelvin", "rankine"]}, {"op": "add", "path": "/components/schemas/UnitTemperature/type", "value": "string"}, {"op": "add", "path": "/components/schemas/Environment/enum", "value": ["DEVELOPMENT", "PREVIEW", "PRODUCTION"]}, {"op": "add", "path": "/components/schemas/Environment/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AiPluginAuthType/enum", "value": ["none", "user_http", "service_http", "oauth"]}, {"op": "add", "path": "/components/schemas/AiPluginAuthType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/ApiCallStatus/enum", "value": ["queued", "uploaded", "in_progress", "completed", "failed"]}, {"op": "add", "path": "/components/schemas/ApiCallStatus/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AccountProvider/enum", "value": ["google", "github"]}, {"op": "add", "path": "/components/schemas/AccountProvider/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitMass/enum", "value": ["g", "kg", "lb"]}, {"op": "add", "path": "/components/schemas/UnitMass/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitPressure/enum", "value": ["atmospheres", "bars", "hectopascals", "kilopascals", "millibars", "pascals", "psi"]}, {"op": "add", "path": "/components/schemas/UnitPressure/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitFrequency/enum", "value": ["gigahertz", "hertz", "kilohertz", "megahertz", "microhertz", "millihertz", "nanohertz", "terahertz"]}, {"op": "add", "path": "/components/schemas/UnitFrequency/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitEnergy/enum", "value": ["btu", "electronvolts", "joules", "kilocalories", "kilowatt_hours", "watt_hours"]}, {"op": "add", "path": "/components/schemas/UnitEnergy/type", "value": "string"}, {"op": "add", "path": "/components/schemas/CreatedAtSortMode/enum", "value": ["created_at_ascending", "created_at_descending"]}, {"op": "add", "path": "/components/schemas/CreatedAtSortMode/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitCurrent/enum", "value": ["amperes", "microamperes", "milliamperes", "nanoamperes"]}, {"op": "add", "path": "/components/schemas/UnitCurrent/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitForce/enum", "value": ["dynes", "kiloponds", "micronewtons", "millinewtons", "newtons", "poundals", "pounds"]}, {"op": "add", "path": "/components/schemas/UnitForce/type", "value": "string"}, {"op": "add", "path": "/components/schemas/ApiCallQueryGroupBy/enum", "value": ["email", "method", "endpoint", "user_id", "origin", "ip_address"]}, {"op": "add", "path": "/components/schemas/ApiCallQueryGroupBy/type", "value": "string"}, {"op": "add", "path": "/components/schemas/CodeLanguage/enum", "value": ["go", "python", "node"]}, {"op": "add", "path": "/components/schemas/CodeLanguage/type", "value": "string"}, {"op": "add", "path": "/components/schemas/FileImportFormat/enum", "value": ["fbx", "gltf", "obj", "ply", "step", "stl"]}, {"op": "add", "path": "/components/schemas/FileImportFormat/type", "value": "string"}, {"op": "add", "path": "/components/schemas/InvoiceStatus/enum", "value": ["deleted", "draft", "open", "paid", "uncollectible", "void"]}, {"op": "add", "path": "/components/schemas/InvoiceStatus/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitTorque/enum", "value": ["newton_metres", "pound_foot"]}, {"op": "add", "path": "/components/schemas/UnitTorque/type", "value": "string"}, {"op": "add", "path": "/components/schemas/GltfStorage/enum", "value": ["binary", "standard", "embedded"]}, {"op": "add", "path": "/components/schemas/GltfStorage/type", "value": "string"}, {"op": "add", "path": "/components/schemas/SceneSelectionType/enum", "value": ["replace", "add", "remove"]}, {"op": "add", "path": "/components/schemas/SceneSelectionType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/CountryCode/enum", "value": ["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]}, {"op": "add", "path": "/components/schemas/CountryCode/type", "value": "string"}, {"op": "add", "path": "/components/schemas/CameraDragInteractionType/enum", "value": ["pan", "rotate", "zoom"]}, {"op": "add", "path": "/components/schemas/CameraDragInteractionType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AnnotationType/enum", "value": ["t2d", "t3d"]}, {"op": "add", "path": "/components/schemas/AnnotationType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/Currency/enum", "value": ["aed", "afn", "all", "amd", "ang", "aoa", "ars", "aud", "awg", "azn", "bam", "bbd", "bdt", "bgn", "bif", "bmd", "bnd", "bob", "brl", "bsd", "bwp", "bzd", "cad", "cdf", "chf", "clp", "cny", "cop", "crc", "cve", "czk", "djf", "dkk", "dop", "dzd", "eek", "egp", "etb", "eur", "fjd", "fkp", "gbp", "gel", "gip", "gmd", "gnf", "gtq", "gyd", "hkd", "hnl", "hrk", "htg", "huf", "idr", "ils", "inr", "isk", "jmd", "jpy", "kes", "kgs", "khr", "kmf", "krw", "kyd", "kzt", "lak", "lbp", "lkr", "lrd", "lsl", "ltl", "lvl", "mad", "mdl", "mga", "mkd", "mnt", "mop", "mro", "mur", "mvr", "mwk", "mxn", "myr", "mzn", "nad", "ngn", "nio", "nok", "npr", "nzd", "pab", "pen", "pgk", "php", "pkr", "pln", "pyg", "qar", "ron", "rsd", "rub", "rwf", "sar", "sbd", "scr", "sek", "sgd", "shp", "sll", "sos", "srd", "std", "svc", "szl", "thb", "tjs", "top", "try", "ttd", "twd", "tzs", "uah", "ugx", "usd", "uyu", "uzs", "vef", "vnd", "vuv", "wst", "xaf", "xcd", "xof", "xpf", "yer", "zar", "zmw"]}, {"op": "add", "path": "/components/schemas/Currency/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitArea/enum", "value": ["cm2", "dm2", "ft2", "in2", "km2", "m2", "mm2", "yd2"]}, {"op": "add", "path": "/components/schemas/UnitArea/type", "value": "string"}, {"op": "add", "path": "/components/schemas/GltfPresentation/enum", "value": ["compact", "pretty"]}, {"op": "add", "path": "/components/schemas/GltfPresentation/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitAngle/enum", "value": ["degrees", "radians"]}, {"op": "add", "path": "/components/schemas/UnitAngle/type", "value": "string"}, {"op": "add", "path": "/components/schemas/PaymentMethodType/enum", "value": ["card"]}, {"op": "add", "path": "/components/schemas/PaymentMethodType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/ErrorCode/enum", "value": ["internal_engine", "internal_api", "bad_request", "invalid_json", "connection_problem", "message_type_not_accepted", "message_type_not_accepted_for_web_r_t_c"]}, {"op": "add", "path": "/components/schemas/ErrorCode/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitLength/enum", "value": ["cm", "ft", "in", "m", "mm", "yd"]}, {"op": "add", "path": "/components/schemas/UnitLength/type", "value": "string"}, {"op": "add", "path": "/components/schemas/RtcSdpType/enum", "value": ["unspecified", "offer", "pranswer", "answer", "rollback"]}, {"op": "add", "path": "/components/schemas/RtcSdpType/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitDensity/enum", "value": ["lb:ft3", "kg:m3"]}, {"op": "add", "path": "/components/schemas/UnitDensity/type", "value": "string"}, {"op": "add", "path": "/components/schemas/Method/enum", "value": ["OPTIONS", "GET", "POST", "PUT", "DELETE", "HEAD", "TRACE", "CONNECT", "PATCH", "EXTENSION"]}, {"op": "add", "path": "/components/schemas/Method/type", "value": "string"}, {"op": "add", "path": "/components/schemas/PlyStorage/enum", "value": ["ascii", "binary_little_endian", "binary_big_endian"]}, {"op": "add", "path": "/components/schemas/PlyStorage/type", "value": "string"}, {"op": "add", "path": "/components/schemas/FileExportFormat/enum", "value": ["fbx", "glb", "gltf", "obj", "ply", "step", "stl"]}, {"op": "add", "path": "/components/schemas/FileExportFormat/type", "value": "string"}, {"op": "add", "path": "/components/schemas/UnitPower/enum", "value": ["btu_per_minute", "horsepower", "kilowatts", "metric_horsepower", "microwatts", "milliwatts", "watts"]}, {"op": "add", "path": "/components/schemas/UnitPower/type", "value": "string"}, {"op": "add", "path": "/components/schemas/StlStorage/enum", "value": ["ascii", "binary"]}, {"op": "add", "path": "/components/schemas/StlStorage/type", "value": "string"}, {"op": "add", "path": "/components/schemas/AiPluginApiType/enum", "value": ["openapi"]}, {"op": "add", "path": "/components/schemas/AiPluginApiType/type", "value": "string"}, {"op": "add", "path": "/info/x-python", "value": {"client": "# Create a client with your token.\nfrom kittycad import Client\n\nclient = Client(token=\"$TOKEN\")\n\n# - OR -\n\n# Create a new client with your token parsed from the environment variable:\n# `KITTYCAD_API_TOKEN`.\nfrom kittycad import ClientFromEnv\n\nclient = ClientFromEnv()\n\n# NOTE: The python library additionally implements asyncio, however all the code samples we\n# show below use the sync functions for ease of use and understanding.\n# Check out the library docs at:\n# https://python.api.docs.kittycad.io/_autosummary/kittycad.api.html#module-kittycad.api\n# for more details.", "install": "pip install kittycad"}}, {"op": "add", "path": "/paths/~1file~1conversion~1{src_format}~1{output_format}/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileConversion\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.types import Response\n\n\ndef example_create_file_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileConversion, Error]] = create_file_conversion.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_conversion.html"}}, {"op": "add", "path": "/paths/~1user~1payment/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_create_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = create_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_information_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1payment/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = get_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_information_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1payment/delete/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_information_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1payment/put/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_update_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = update_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_information_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1extended/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_self_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_self_extended.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self_extended.html"}}, {"op": "add", "path": "/paths/~1file~1surface-area/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_surface_area\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileSurfaceArea\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_create_file_surface_area():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileSurfaceArea, Error]\n ] = create_file_surface_area.sync(\n client=client,\n output_unit=UnitArea.CM2,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileSurfaceArea = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_surface_area.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1volume~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_volume_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitVolumeConversion\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_get_volume_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitVolumeConversion, Error]\n ] = get_volume_unit_conversion.sync(\n client=client,\n input_unit=UnitVolume.CM3,\n output_unit=UnitVolume.CM3,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitVolumeConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_volume_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1api-calls~1{id}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call.html"}}, {"op": "add", "path": "/paths/~1ai~1image-to-3d~1{input_format}~1{output_format}/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_image_to_3d\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Mesh\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.image_type import ImageType\nfrom kittycad.types import Response\n\n\ndef example_create_image_to_3d():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Mesh, Error]] = create_image_to_3d.sync(\n client=client,\n input_format=ImageType.PNG,\n output_format=FileExportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Mesh = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_image_to_3d.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1methods/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_payment_methods_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentMethod\nfrom kittycad.types import Response\n\n\ndef example_list_payment_methods_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[PaymentMethod], Error]\n ] = list_payment_methods_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[PaymentMethod] = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_payment_methods_for_user.html"}}, {"op": "add", "path": "/paths/~1ws~1modeling~1commands/get/x-python", "value": {"example": "from kittycad.api.modeling import modeling_commands_ws\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_modeling_commands_ws():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n websocket = modeling_commands_ws.sync(\n client=client,\n fps=10,\n unlocked_framerate=False,\n video_res_height=10,\n video_res_width=10,\n webrtc=False,\n )\n\n # Send a message.\n websocket.send(\"{}\")\n\n # Get the messages.\n for message in websocket:\n print(message)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.modeling_commands_ws.html"}}, {"op": "add", "path": "/paths/~1user~1onboarding/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_onboarding_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Onboarding\nfrom kittycad.types import Response\n\n\ndef example_get_user_onboarding_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Onboarding, Error]] = get_user_onboarding_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Onboarding = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_onboarding_self.html"}}, {"op": "add", "path": "/paths/~1user~1session~1{token}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_session_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Session\nfrom kittycad.types import Response\n\n\ndef example_get_session_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Session, Error]] = get_session_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Session = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_session_for_user.html"}}, {"op": "add", "path": "/paths/~1users-extended/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ExtendedUserResultsPage, Error]\n ] = list_users_extended.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUserResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users_extended.html"}}, {"op": "add", "path": "/paths/~1apps~1github~1callback/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_callback.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_callback.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1angle~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_angle_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAngleConversion\nfrom kittycad.models.unit_angle import UnitAngle\nfrom kittycad.types import Response\n\n\ndef example_get_angle_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAngleConversion, Error]\n ] = get_angle_unit_conversion.sync(\n client=client,\n input_unit=UnitAngle.DEGREES,\n output_unit=UnitAngle.DEGREES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAngleConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_angle_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1area~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_area_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAreaConversion\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_get_area_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAreaConversion, Error]\n ] = get_area_unit_conversion.sync(\n client=client,\n input_unit=UnitArea.CM2,\n output_unit=UnitArea.CM2,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAreaConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_area_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1/get/x-python", "value": {"example": "from kittycad.api.meta import get_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_schema.sync(\n client=client,\n )\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_schema.html"}}, {"op": "add", "path": "/paths/~1ai~1text-to-3d~1{output_format}/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_3d\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Mesh\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_3d():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Mesh, Error]] = create_text_to_3d.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n prompt=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Mesh = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_3d.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1current~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_current_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitCurrentConversion\nfrom kittycad.models.unit_current import UnitCurrent\nfrom kittycad.types import Response\n\n\ndef example_get_current_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitCurrentConversion, Error]\n ] = get_current_unit_conversion.sync(\n client=client,\n input_unit=UnitCurrent.AMPERES,\n output_unit=UnitCurrent.AMPERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitCurrentConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_current_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1temperature~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_temperature_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTemperatureConversion\nfrom kittycad.models.unit_temperature import UnitTemperature\nfrom kittycad.types import Response\n\n\ndef example_get_temperature_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTemperatureConversion, Error]\n ] = get_temperature_unit_conversion.sync(\n client=client,\n input_unit=UnitTemperature.CELSIUS,\n output_unit=UnitTemperature.CELSIUS,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTemperatureConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_temperature_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1async~1operations/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_async_operations\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AsyncApiCallResultsPage, Error\nfrom kittycad.models.api_call_status import ApiCallStatus\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_async_operations():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AsyncApiCallResultsPage, Error]\n ] = list_async_operations.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n status=ApiCallStatus.QUEUED,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AsyncApiCallResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_async_operations.html"}}, {"op": "add", "path": "/paths/~1api-calls/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls.html"}}, {"op": "add", "path": "/paths/~1modeling~1cmd/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.modeling import cmd\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import (\n CurveGetControlPoints,\n CurveGetType,\n Empty,\n EntityGetAllChildUuids,\n EntityGetChildUuid,\n EntityGetNumChildren,\n EntityGetParentId,\n Error,\n Export,\n GetEntityType,\n HighlightSetEntity,\n MouseClick,\n PathGetInfo,\n SelectGet,\n SelectWithPoint,\n Solid3dGetAllEdgeFaces,\n Solid3dGetAllOppositeEdges,\n Solid3dGetNextAdjacentEdge,\n Solid3dGetOppositeEdge,\n Solid3dGetPrevAdjacentEdge,\n TakeSnapshot,\n)\nfrom kittycad.models.modeling_cmd import move_path_pen\nfrom kittycad.models.modeling_cmd_id import ModelingCmdId\nfrom kittycad.models.modeling_cmd_req import ModelingCmdReq\nfrom kittycad.models.point3d import Point3d\nfrom kittycad.types import Response\n\n\ndef example_cmd():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[\n Empty,\n Export,\n SelectWithPoint,\n HighlightSetEntity,\n EntityGetChildUuid,\n EntityGetNumChildren,\n EntityGetParentId,\n EntityGetAllChildUuids,\n SelectGet,\n GetEntityType,\n Solid3dGetAllEdgeFaces,\n Solid3dGetAllOppositeEdges,\n Solid3dGetOppositeEdge,\n Solid3dGetPrevAdjacentEdge,\n Solid3dGetNextAdjacentEdge,\n MouseClick,\n CurveGetType,\n CurveGetControlPoints,\n TakeSnapshot,\n PathGetInfo,\n Error,\n ]\n ] = cmd.sync(\n client=client,\n body=ModelingCmdReq(\n cmd=move_path_pen(\n path=ModelingCmdId(\"\"),\n to=Point3d(\n x=3.14,\n y=3.14,\n z=3.14,\n ),\n ),\n cmd_id=ModelingCmdId(\"\"),\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Union[\n Empty,\n Export,\n SelectWithPoint,\n HighlightSetEntity,\n EntityGetChildUuid,\n EntityGetNumChildren,\n EntityGetParentId,\n EntityGetAllChildUuids,\n SelectGet,\n GetEntityType,\n Solid3dGetAllEdgeFaces,\n Solid3dGetAllOppositeEdges,\n Solid3dGetOppositeEdge,\n Solid3dGetPrevAdjacentEdge,\n Solid3dGetNextAdjacentEdge,\n MouseClick,\n CurveGetType,\n CurveGetControlPoints,\n TakeSnapshot,\n PathGetInfo,\n ] = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.cmd.html"}}, {"op": "add", "path": "/paths/~1users-extended~1{id}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_extended.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_extended.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1mass~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_mass_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitMassConversion\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_get_mass_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitMassConversion, Error]\n ] = get_mass_unit_conversion.sync(\n client=client,\n input_unit=UnitMass.G,\n output_unit=UnitMass.G,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitMassConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_mass_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1length~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_length_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitLengthConversion\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_get_length_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitLengthConversion, Error]\n ] = get_length_unit_conversion.sync(\n client=client,\n input_unit=UnitLength.CM,\n output_unit=UnitLength.CM,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitLengthConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_length_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1file~1center-of-mass/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_center_of_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileCenterOfMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_create_file_center_of_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileCenterOfMass, Error]\n ] = create_file_center_of_mass.sync(\n client=client,\n output_unit=UnitLength.CM,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileCenterOfMass = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_center_of_mass.html"}}, {"op": "add", "path": "/paths/~1api-call-metrics/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_metrics\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallQueryGroup, Error\nfrom kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_metrics():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[ApiCallQueryGroup], Error]\n ] = get_api_call_metrics.sync(\n client=client,\n group_by=ApiCallQueryGroupBy.EMAIL,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[ApiCallQueryGroup] = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_metrics.html"}}, {"op": "add", "path": "/paths/~1user~1api-calls/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import user_list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_user_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = user_list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.user_list_api_calls.html"}}, {"op": "add", "path": "/paths/~1modeling~1cmd-batch/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.modeling import cmd_batch\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ModelingOutcomes\nfrom kittycad.models.modeling_cmd import move_path_pen\nfrom kittycad.models.modeling_cmd_id import ModelingCmdId\nfrom kittycad.models.modeling_cmd_req import ModelingCmdReq\nfrom kittycad.models.modeling_cmd_req_batch import ModelingCmdReqBatch\nfrom kittycad.models.point3d import Point3d\nfrom kittycad.types import Response\n\n\ndef example_cmd_batch():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ModelingOutcomes, Error]] = cmd_batch.sync(\n client=client,\n body=ModelingCmdReqBatch(\n cmds={\n \"\": ModelingCmdReq(\n cmd=move_path_pen(\n path=ModelingCmdId(\"\"),\n to=Point3d(\n x=3.14,\n y=3.14,\n z=3.14,\n ),\n ),\n cmd_id=ModelingCmdId(\"\"),\n )\n },\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ModelingOutcomes = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.cmd_batch.html"}}, {"op": "add", "path": "/paths/~1user~1api-tokens~1{token}/delete/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import delete_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_api_token_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.delete_api_token_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1api-tokens~1{token}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import get_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = get_api_token_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.get_api_token_for_user.html"}}, {"op": "add", "path": "/paths/~1apps~1github~1consent/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_consent\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AppClientInfo, Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_consent():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AppClientInfo, Error]] = apps_github_consent.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AppClientInfo = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_consent.html"}}, {"op": "add", "path": "/paths/~1file~1mass/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileMass, Error]] = create_file_mass.sync(\n client=client,\n material_density=3.14,\n material_density_unit=UnitDensity.LB_FT3,\n output_unit=UnitMass.G,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileMass = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_mass.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1energy~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_energy_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitEnergyConversion\nfrom kittycad.models.unit_energy import UnitEnergy\nfrom kittycad.types import Response\n\n\ndef example_get_energy_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitEnergyConversion, Error]\n ] = get_energy_unit_conversion.sync(\n client=client,\n input_unit=UnitEnergy.BTU,\n output_unit=UnitEnergy.BTU,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitEnergyConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_energy_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1user~1front-hash/get/x-python", "value": {"example": "from kittycad.api.users import get_user_front_hash_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_user_front_hash_self():\n # Create our client.\n client = ClientFromEnv()\n\n get_user_front_hash_self.sync(\n client=client,\n )\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_front_hash_self.html"}}, {"op": "add", "path": "/paths/~1logout/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import logout\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_logout():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = logout.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.logout.html"}}, {"op": "add", "path": "/paths/~1apps~1github~1webhook/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_webhook\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_webhook():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_webhook.sync(\n client=client,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_webhook.html"}}, {"op": "add", "path": "/paths/~1auth~1email~1callback/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_auth_email_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = auth_email_callback.sync(\n client=client,\n email=\"\",\n token=\"\",\n callback_url=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email_callback.html"}}, {"op": "add", "path": "/paths/~1users~1{id}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user.html"}}, {"op": "add", "path": "/paths/~1auth~1email/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, VerificationToken\nfrom kittycad.models.email_authentication_form import EmailAuthenticationForm\nfrom kittycad.types import Response\n\n\ndef example_auth_email():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[VerificationToken, Error]] = auth_email.sync(\n client=client,\n body=EmailAuthenticationForm(\n email=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: VerificationToken = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1pressure~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_pressure_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPressureConversion\nfrom kittycad.models.unit_pressure import UnitPressure\nfrom kittycad.types import Response\n\n\ndef example_get_pressure_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPressureConversion, Error]\n ] = get_pressure_unit_conversion.sync(\n client=client,\n input_unit=UnitPressure.ATMOSPHERES,\n output_unit=UnitPressure.ATMOSPHERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPressureConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_pressure_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1user~1api-calls~1{id}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1intent/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_intent_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentIntent\nfrom kittycad.types import Response\n\n\ndef example_create_payment_intent_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PaymentIntent, Error]\n ] = create_payment_intent_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PaymentIntent = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_intent_for_user.html"}}, {"op": "add", "path": "/paths/~1async~1operations~1{id}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_async_operation\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import (\n Error,\n FileCenterOfMass,\n FileConversion,\n FileDensity,\n FileMass,\n FileSurfaceArea,\n FileVolume,\n)\nfrom kittycad.types import Response\n\n\ndef example_get_async_operation():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n Error,\n ]\n ] = get_async_operation.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n ] = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_async_operation.html"}}, {"op": "add", "path": "/paths/~1file~1volume/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_volume\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileVolume\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_create_file_volume():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileVolume, Error]] = create_file_volume.sync(\n client=client,\n output_unit=UnitVolume.CM3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileVolume = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_volume.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1methods~1{id}/delete/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_method_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_method_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_method_for_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_method_for_user.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1force~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_force_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitForceConversion\nfrom kittycad.models.unit_force import UnitForce\nfrom kittycad.types import Response\n\n\ndef example_get_force_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitForceConversion, Error]\n ] = get_force_unit_conversion.sync(\n client=client,\n input_unit=UnitForce.DYNES,\n output_unit=UnitForce.DYNES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitForceConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_force_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1ws~1executor~1term/get/x-python", "value": {"example": "from kittycad.api.executor import create_executor_term\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_create_executor_term():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n websocket = create_executor_term.sync(\n client=client,\n )\n\n # Send a message.\n websocket.send(\"{}\")\n\n # Get the messages.\n for message in websocket:\n print(message)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_executor_term.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1power~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_power_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPowerConversion\nfrom kittycad.models.unit_power import UnitPower\nfrom kittycad.types import Response\n\n\ndef example_get_power_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPowerConversion, Error]\n ] = get_power_unit_conversion.sync(\n client=client,\n input_unit=UnitPower.BTU_PER_MINUTE,\n output_unit=UnitPower.BTU_PER_MINUTE,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPowerConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_power_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1users~1{id}~1api-calls/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls_for_user.sync(\n client=client,\n id=\"\",\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls_for_user.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1torque~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_torque_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTorqueConversion\nfrom kittycad.models.unit_torque import UnitTorque\nfrom kittycad.types import Response\n\n\ndef example_get_torque_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTorqueConversion, Error]\n ] = get_torque_unit_conversion.sync(\n client=client,\n input_unit=UnitTorque.NEWTON_METRES,\n output_unit=UnitTorque.NEWTON_METRES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTorqueConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_torque_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1openai~1openapi.json/get/x-python", "value": {"example": "from kittycad.api.meta import get_openai_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_openai_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_openai_schema.sync(\n client=client,\n )\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_openai_schema.html"}}, {"op": "add", "path": "/paths/~1unit~1conversion~1frequency~1{input_unit}~1{output_unit}/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_frequency_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitFrequencyConversion\nfrom kittycad.models.unit_frequency import UnitFrequency\nfrom kittycad.types import Response\n\n\ndef example_get_frequency_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitFrequencyConversion, Error]\n ] = get_frequency_unit_conversion.sync(\n client=client,\n input_unit=UnitFrequency.GIGAHERTZ,\n output_unit=UnitFrequency.GIGAHERTZ,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitFrequencyConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_frequency_unit_conversion.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1invoices/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_invoices_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Invoice\nfrom kittycad.types import Response\n\n\ndef example_list_invoices_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[List[Invoice], Error]] = list_invoices_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[Invoice] = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_invoices_for_user.html"}}, {"op": "add", "path": "/paths/~1.well-known~1ai-plugin.json/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_ai_plugin_manifest\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPluginManifest, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_plugin_manifest():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AiPluginManifest, Error]\n ] = get_ai_plugin_manifest.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPluginManifest = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_ai_plugin_manifest.html"}}, {"op": "add", "path": "/paths/~1file~1execute~1{lang}/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.executor import create_file_execution\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CodeOutput, Error\nfrom kittycad.models.code_language import CodeLanguage\nfrom kittycad.types import Response\n\n\ndef example_create_file_execution():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[CodeOutput, Error]] = create_file_execution.sync(\n client=client,\n lang=CodeLanguage.GO,\n output=None, # Optional[str]\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CodeOutput = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_file_execution.html"}}, {"op": "add", "path": "/paths/~1user/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self.html"}}, {"op": "add", "path": "/paths/~1user/delete/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import delete_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.delete_user_self.html"}}, {"op": "add", "path": "/paths/~1user/put/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import update_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.models.update_user import UpdateUser\nfrom kittycad.types import Response\n\n\ndef example_update_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = update_user_self.sync(\n client=client,\n body=UpdateUser(\n company=\"\",\n discord=\"\",\n first_name=\"\",\n github=\"\",\n last_name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.update_user_self.html"}}, {"op": "add", "path": "/paths/~1_meta~1info/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_metadata\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Metadata\nfrom kittycad.types import Response\n\n\ndef example_get_metadata():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Metadata, Error]] = get_metadata.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Metadata = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_metadata.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1balance/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_user.html"}}, {"op": "add", "path": "/paths/~1users/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[UserResultsPage, Error]] = list_users.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UserResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users.html"}}, {"op": "add", "path": "/paths/~1ping/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import ping\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Pong\nfrom kittycad.types import Response\n\n\ndef example_ping():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Pong, Error]] = ping.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Pong = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.ping.html"}}, {"op": "add", "path": "/paths/~1user~1api-tokens/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import create_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_create_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = create_api_token_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.create_api_token_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1api-tokens/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import list_api_tokens_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiTokenResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_tokens_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiTokenResultsPage, Error]\n ] = list_api_tokens_for_user.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiTokenResultsPage = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.list_api_tokens_for_user.html"}}, {"op": "add", "path": "/paths/~1user~1payment~1tax/get/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import validate_customer_tax_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_validate_customer_tax_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = validate_customer_tax_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.validate_customer_tax_information_for_user.html"}}, {"op": "add", "path": "/paths/~1file~1density/post/x-python", "value": {"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_density\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileDensity\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_density():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileDensity, Error]] = create_file_density.sync(\n client=client,\n material_mass=3.14,\n material_mass_unit=UnitMass.G,\n output_unit=UnitDensity.LB_FT3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileDensity = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_density.html"}}] \ No newline at end of file diff --git a/kittycad/api/file/create_file_conversion_with_base64_helper.py b/kittycad/api/file/create_file_conversion_with_base64_helper.py deleted file mode 100644 index 2f92416bf..000000000 --- a/kittycad/api/file/create_file_conversion_with_base64_helper.py +++ /dev/null @@ -1,58 +0,0 @@ -import base64 -from typing import Any, Optional, Tuple, Union - -from ...api.file.create_file_conversion import asyncio as fc_asyncio, sync as fc_sync -from ...client import Client -from ...models import Error, FileConversion, FileExportFormat, FileImportFormat - - -def sync( - src_format: FileImportFormat, - output_format: FileExportFormat, - body: bytes, - *, - client: Client, -) -> Optional[Union[Any, Tuple[FileConversion, bytes], Error]]: - """Convert a CAD file from one format to another. If the file being converted is larger than a certain size it will be performed asynchronously. This function automatically base64 encodes the request body and base64 decodes the request output.""" - - encoded = base64.b64encode(body) - - fc = fc_sync( - src_format=src_format, - output_format=output_format, - body=encoded, - client=client, - ) - - if isinstance(fc, FileConversion) and fc.output != "": - if isinstance(fc.output, str): - b = base64.urlsafe_b64decode(fc.output.strip("=") + "===") - return (fc, b) - - return fc - - -async def asyncio( - src_format: FileImportFormat, - output_format: FileExportFormat, - body: bytes, - *, - client: Client, -) -> Optional[Union[Any, Tuple[FileConversion, bytes], Error]]: - """Convert a CAD file from one format to another. If the file being converted is larger than a certain size it will be performed asynchronously. This function automatically base64 encodes the request body and base64 decodes the request output.""" - - encoded = base64.b64encode(body) - - fc = await fc_asyncio( - src_format=src_format, - output_format=output_format, - body=encoded, - client=client, - ) - - if isinstance(fc, FileConversion) and fc.output != "": - if isinstance(fc.output, str): - b = base64.urlsafe_b64decode(fc.output.strip("=") + "===") - return (fc, b) - - return fc diff --git a/kittycad/api/file/get_file_conversion_with_base64_helper.py b/kittycad/api/file/get_file_conversion_with_base64_helper.py deleted file mode 100644 index c28f79b00..000000000 --- a/kittycad/api/file/get_file_conversion_with_base64_helper.py +++ /dev/null @@ -1,47 +0,0 @@ -import base64 -from typing import Any, Optional, Tuple, Union - -from ...api.api_calls.get_async_operation import asyncio as fc_asyncio, sync as fc_sync -from ...client import Client -from ...models import Error -from ...models.file_conversion import FileConversion - - -def sync( - id: str, - *, - client: Client, -) -> Optional[Union[Any, Tuple[FileConversion, bytes], Error]]: - """Get the status of a file conversion. This function automatically base64 decodes the output response if there is one.""" - - fc = fc_sync( - id=id, - client=client, - ) - - if isinstance(fc, FileConversion) and fc.output != "": - if isinstance(fc.output, str): - b = base64.urlsafe_b64decode(fc.output.strip("=") + "===") - return (fc, b) - - return fc - - -async def asyncio( - id: str, - *, - client: Client, -) -> Optional[Union[Any, Tuple[FileConversion, bytes], Error]]: - """Get the status of a file conversion. This function automatically base64 decodes the output response if there is one.""" - - fc = await fc_asyncio( - id=id, - client=client, - ) - - if isinstance(fc, FileConversion) and fc.output != "": - if isinstance(fc.output, str): - b = base64.urlsafe_b64decode(fc.output.strip("=") + "===") - return (fc, b) - - return fc diff --git a/kittycad/api/modeling/cmd.py b/kittycad/api/modeling/cmd.py index ae6dfe7eb..0fbc367ed 100644 --- a/kittycad/api/modeling/cmd.py +++ b/kittycad/api/modeling/cmd.py @@ -3,8 +3,28 @@ from typing import Any, Dict, Optional, Union import httpx from ...client import Client +from ...models.curve_get_control_points import CurveGetControlPoints +from ...models.curve_get_type import CurveGetType +from ...models.empty import Empty +from ...models.entity_get_all_child_uuids import EntityGetAllChildUuids +from ...models.entity_get_child_uuid import EntityGetChildUuid +from ...models.entity_get_num_children import EntityGetNumChildren +from ...models.entity_get_parent_id import EntityGetParentId from ...models.error import Error +from ...models.export import Export +from ...models.get_entity_type import GetEntityType +from ...models.highlight_set_entity import HighlightSetEntity from ...models.modeling_cmd_req import ModelingCmdReq +from ...models.mouse_click import MouseClick +from ...models.path_get_info import PathGetInfo +from ...models.select_get import SelectGet +from ...models.select_with_point import SelectWithPoint +from ...models.solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces +from ...models.solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges +from ...models.solid3d_get_next_adjacent_edge import Solid3dGetNextAdjacentEdge +from ...models.solid3d_get_opposite_edge import Solid3dGetOppositeEdge +from ...models.solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge +from ...models.take_snapshot import TakeSnapshot from ...types import Response @@ -29,10 +49,221 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]]: +def _parse_response( + *, response: httpx.Response +) -> Optional[ + Union[ + Empty, + Export, + SelectWithPoint, + HighlightSetEntity, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, + EntityGetAllChildUuids, + SelectGet, + GetEntityType, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + Solid3dGetNextAdjacentEdge, + MouseClick, + CurveGetType, + CurveGetControlPoints, + TakeSnapshot, + PathGetInfo, + Error, + ] +]: if response.status_code == 200: - response_200 = response.json() - return response_200 + data = response.json() + try: + if not isinstance(data, dict): + raise TypeError() + option_empty = Empty.from_dict(data) + return option_empty + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_export = Export.from_dict(data) + return option_export + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_select_with_point = SelectWithPoint.from_dict(data) + return option_select_with_point + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_highlight_set_entity = HighlightSetEntity.from_dict(data) + return option_highlight_set_entity + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_entity_get_child_uuid = EntityGetChildUuid.from_dict(data) + return option_entity_get_child_uuid + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_entity_get_num_children = EntityGetNumChildren.from_dict(data) + return option_entity_get_num_children + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_entity_get_parent_id = EntityGetParentId.from_dict(data) + return option_entity_get_parent_id + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_entity_get_all_child_uuids = EntityGetAllChildUuids.from_dict(data) + return option_entity_get_all_child_uuids + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_select_get = SelectGet.from_dict(data) + return option_select_get + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_get_entity_type = GetEntityType.from_dict(data) + return option_get_entity_type + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_solid3d_get_all_edge_faces = Solid3dGetAllEdgeFaces.from_dict(data) + return option_solid3d_get_all_edge_faces + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_solid3d_get_all_opposite_edges = ( + Solid3dGetAllOppositeEdges.from_dict(data) + ) + return option_solid3d_get_all_opposite_edges + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_solid3d_get_opposite_edge = Solid3dGetOppositeEdge.from_dict(data) + return option_solid3d_get_opposite_edge + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_solid3d_get_prev_adjacent_edge = ( + Solid3dGetPrevAdjacentEdge.from_dict(data) + ) + return option_solid3d_get_prev_adjacent_edge + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_solid3d_get_next_adjacent_edge = ( + Solid3dGetNextAdjacentEdge.from_dict(data) + ) + return option_solid3d_get_next_adjacent_edge + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_mouse_click = MouseClick.from_dict(data) + return option_mouse_click + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_curve_get_type = CurveGetType.from_dict(data) + return option_curve_get_type + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_curve_get_control_points = CurveGetControlPoints.from_dict(data) + return option_curve_get_control_points + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_take_snapshot = TakeSnapshot.from_dict(data) + return option_take_snapshot + except ValueError: + pass + except TypeError: + pass + try: + if not isinstance(data, dict): + raise TypeError() + option_path_get_info = PathGetInfo.from_dict(data) + return option_path_get_info + except ValueError: + raise + except TypeError: + raise if response.status_code == 400: response_4XX = Error.from_dict(response.json()) return response_4XX @@ -44,7 +275,33 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]] def _build_response( *, response: httpx.Response -) -> Response[Optional[Union[dict, Error]]]: +) -> Response[ + Optional[ + Union[ + Empty, + Export, + SelectWithPoint, + HighlightSetEntity, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, + EntityGetAllChildUuids, + SelectGet, + GetEntityType, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + Solid3dGetNextAdjacentEdge, + MouseClick, + CurveGetType, + CurveGetControlPoints, + TakeSnapshot, + PathGetInfo, + Error, + ] + ] +]: return Response( status_code=response.status_code, content=response.content, @@ -57,7 +314,33 @@ def sync_detailed( body: ModelingCmdReq, *, client: Client, -) -> Response[Optional[Union[dict, Error]]]: +) -> Response[ + Optional[ + Union[ + Empty, + Export, + SelectWithPoint, + HighlightSetEntity, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, + EntityGetAllChildUuids, + SelectGet, + GetEntityType, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + Solid3dGetNextAdjacentEdge, + MouseClick, + CurveGetType, + CurveGetControlPoints, + TakeSnapshot, + PathGetInfo, + Error, + ] + ] +]: kwargs = _get_kwargs( body=body, client=client, @@ -75,7 +358,31 @@ def sync( body: ModelingCmdReq, *, client: Client, -) -> Optional[Union[dict, Error]]: +) -> Optional[ + Union[ + Empty, + Export, + SelectWithPoint, + HighlightSetEntity, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, + EntityGetAllChildUuids, + SelectGet, + GetEntityType, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + Solid3dGetNextAdjacentEdge, + MouseClick, + CurveGetType, + CurveGetControlPoints, + TakeSnapshot, + PathGetInfo, + Error, + ] +]: """Response depends on which command was submitted, so unfortunately the OpenAPI schema can't generate the right response type.""" # noqa: E501 return sync_detailed( @@ -88,7 +395,33 @@ async def asyncio_detailed( body: ModelingCmdReq, *, client: Client, -) -> Response[Optional[Union[dict, Error]]]: +) -> Response[ + Optional[ + Union[ + Empty, + Export, + SelectWithPoint, + HighlightSetEntity, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, + EntityGetAllChildUuids, + SelectGet, + GetEntityType, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + Solid3dGetNextAdjacentEdge, + MouseClick, + CurveGetType, + CurveGetControlPoints, + TakeSnapshot, + PathGetInfo, + Error, + ] + ] +]: kwargs = _get_kwargs( body=body, client=client, @@ -104,7 +437,31 @@ async def asyncio( body: ModelingCmdReq, *, client: Client, -) -> Optional[Union[dict, Error]]: +) -> Optional[ + Union[ + Empty, + Export, + SelectWithPoint, + HighlightSetEntity, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, + EntityGetAllChildUuids, + SelectGet, + GetEntityType, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + Solid3dGetNextAdjacentEdge, + MouseClick, + CurveGetType, + CurveGetControlPoints, + TakeSnapshot, + PathGetInfo, + Error, + ] +]: """Response depends on which command was submitted, so unfortunately the OpenAPI schema can't generate the right response type.""" # noqa: E501 return ( diff --git a/kittycad/api/modeling/modeling_commands_ws.py b/kittycad/api/modeling/modeling_commands_ws.py index 2e7d6ded5..33fbd43e5 100644 --- a/kittycad/api/modeling/modeling_commands_ws.py +++ b/kittycad/api/modeling/modeling_commands_ws.py @@ -12,6 +12,7 @@ def _get_kwargs( unlocked_framerate: bool, video_res_height: int, video_res_width: int, + webrtc: bool, *, client: Client, ) -> Dict[str, Any]: @@ -41,6 +42,12 @@ def _get_kwargs( else: url = url + "?video_res_width=" + str(video_res_width) + if webrtc is not None: + if "?" in url: + url = url + "&webrtc=" + str(webrtc) + else: + url = url + "?webrtc=" + str(webrtc) + headers: Dict[str, Any] = client.get_headers() cookies: Dict[str, Any] = client.get_cookies() @@ -57,6 +64,7 @@ def sync( unlocked_framerate: bool, video_res_height: int, video_res_width: int, + webrtc: bool, *, client: Client, ) -> ClientConnection: @@ -67,6 +75,7 @@ def sync( unlocked_framerate=unlocked_framerate, video_res_height=video_res_height, video_res_width=video_res_width, + webrtc=webrtc, client=client, ) @@ -85,6 +94,7 @@ async def asyncio( unlocked_framerate: bool, video_res_height: int, video_res_width: int, + webrtc: bool, *, client: Client, ) -> WebSocketClientProtocol: @@ -95,6 +105,7 @@ async def asyncio( unlocked_framerate=unlocked_framerate, video_res_height=video_res_height, video_res_width=video_res_width, + webrtc=webrtc, client=client, ) diff --git a/kittycad/client_test.py b/kittycad/client_test.py index 393aaf71e..ac94f5fbf 100644 --- a/kittycad/client_test.py +++ b/kittycad/client_test.py @@ -1,20 +1,17 @@ import os -from typing import Tuple, Union +from typing import Dict, Optional, Union import pytest from .api.api_tokens import list_api_tokens_for_user -from .api.file import ( - create_file_conversion_with_base64_helper, - create_file_mass, - create_file_volume, -) +from .api.file import create_file_conversion, create_file_mass, create_file_volume from .api.meta import ping from .api.users import get_user_self, list_users_extended from .client import ClientFromEnv from .models import ( ApiCallStatus, ApiTokenResultsPage, + Base64Data, CreatedAtSortMode, Error, ExtendedUserResultsPage, @@ -29,6 +26,7 @@ from .models import ( UnitVolume, User, ) +from .types import Unset def test_get_session(): @@ -106,19 +104,16 @@ def test_file_convert_stl(): file.close() # Get the fc. - result: Union[ - Tuple[FileConversion, bytes], Error, None - ] = create_file_conversion_with_base64_helper.sync( + result: Optional[Union[FileConversion, Error]] = create_file_conversion.sync( client=client, body=content, src_format=FileImportFormat.STL, output_format=FileExportFormat.OBJ, ) - r: Tuple[FileConversion, bytes] = result # type: ignore + assert isinstance(result, FileConversion) - b: bytes = r[1] - fc: FileConversion = r[0] + fc: FileConversion = result print(f"FileConversion: {fc}") @@ -127,8 +122,12 @@ def test_file_convert_stl(): print(f"FileConversion: {fc}") + assert not isinstance(fc.outputs, Unset) + + outputs: Dict[str, Base64Data] = fc.outputs # Make sure the bytes are not empty. - assert len(b) > 0 + for key, value in outputs.items(): + assert len(value.get_decoded()) > 0 @pytest.mark.asyncio @@ -142,19 +141,18 @@ async def test_file_convert_stl_async(): file.close() # Get the fc. - result: Union[ - Tuple[FileConversion, bytes], Error, None - ] = await create_file_conversion_with_base64_helper.asyncio( + result: Optional[ + Union[FileConversion, Error] + ] = await create_file_conversion.asyncio( client=client, body=content, src_format=FileImportFormat.STL, output_format=FileExportFormat.OBJ, ) - r: Tuple[FileConversion, bytes] = result # type: ignore + assert isinstance(result, FileConversion) - b: bytes = r[1] - fc: FileConversion = r[0] + fc: FileConversion = result print(f"FileConversion: {fc}") @@ -163,8 +161,12 @@ async def test_file_convert_stl_async(): print(f"FileConversion: {fc}") + assert not isinstance(fc.outputs, Unset) + + outputs: Dict[str, Base64Data] = fc.outputs # Make sure the bytes are not empty. - assert len(b) > 0 + for key, value in outputs.items(): + assert len(value.get_decoded()) > 0 @pytest.mark.asyncio @@ -178,19 +180,18 @@ async def test_file_convert_obj_async(): file.close() # Get the fc. - result: Union[ - Tuple[FileConversion, bytes], Error, None - ] = await create_file_conversion_with_base64_helper.asyncio( + result: Optional[ + Union[FileConversion, Error] + ] = await create_file_conversion.asyncio( client=client, body=content, src_format=FileImportFormat.OBJ, output_format=FileExportFormat.STL, ) - r: Tuple[FileConversion, bytes] = result # type: ignore + assert isinstance(result, FileConversion) - b: bytes = r[1] - fc: FileConversion = r[0] + fc: FileConversion = result print(f"FileConversion: {fc}") @@ -199,8 +200,12 @@ async def test_file_convert_obj_async(): print(f"FileConversion: {fc}") + assert not isinstance(fc.outputs, Unset) + + outputs: Dict[str, Base64Data] = fc.outputs # Make sure the bytes are not empty. - assert len(b) > 0 + for key, value in outputs.items(): + assert len(value.get_decoded()) > 0 def test_file_mass(): diff --git a/kittycad/examples_test.py b/kittycad/examples_test.py index f673209f9..234e5d725 100644 --- a/kittycad/examples_test.py +++ b/kittycad/examples_test.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Tuple, Union +from typing import List, Optional, Union import pytest @@ -28,7 +28,6 @@ from kittycad.api.executor import create_executor_term, create_file_execution from kittycad.api.file import ( create_file_center_of_mass, create_file_conversion, - create_file_conversion_with_base64_helper, create_file_density, create_file_mass, create_file_surface_area, @@ -94,9 +93,17 @@ from kittycad.models import ( AppClientInfo, AsyncApiCallResultsPage, CodeOutput, + CurveGetControlPoints, + CurveGetType, Customer, CustomerBalance, + Empty, + EntityGetAllChildUuids, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, Error, + Export, ExtendedUser, ExtendedUserResultsPage, FileCenterOfMass, @@ -105,15 +112,27 @@ from kittycad.models import ( FileMass, FileSurfaceArea, FileVolume, + GetEntityType, + HighlightSetEntity, Invoice, Mesh, Metadata, ModelingOutcomes, + MouseClick, Onboarding, + PathGetInfo, PaymentIntent, PaymentMethod, Pong, + SelectGet, + SelectWithPoint, Session, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetNextAdjacentEdge, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + TakeSnapshot, UnitAngleConversion, UnitAreaConversion, UnitCurrentConversion, @@ -289,7 +308,7 @@ def test_create_image_to_3d(): result: Optional[Union[Mesh, Error]] = create_image_to_3d.sync( client=client, input_format=ImageType.PNG, - output_format=FileExportFormat.GLTF, + output_format=FileExportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -304,7 +323,7 @@ def test_create_image_to_3d(): response: Response[Optional[Union[Mesh, Error]]] = create_image_to_3d.sync_detailed( client=client, input_format=ImageType.PNG, - output_format=FileExportFormat.GLTF, + output_format=FileExportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -319,7 +338,7 @@ async def test_create_image_to_3d_async(): result: Optional[Union[Mesh, Error]] = await create_image_to_3d.asyncio( client=client, input_format=ImageType.PNG, - output_format=FileExportFormat.GLTF, + output_format=FileExportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -329,7 +348,7 @@ async def test_create_image_to_3d_async(): ] = await create_image_to_3d.asyncio_detailed( client=client, input_format=ImageType.PNG, - output_format=FileExportFormat.GLTF, + output_format=FileExportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -341,7 +360,7 @@ def test_create_text_to_3d(): result: Optional[Union[Mesh, Error]] = create_text_to_3d.sync( client=client, - output_format=FileExportFormat.GLTF, + output_format=FileExportFormat.FBX, prompt="", ) @@ -355,7 +374,7 @@ def test_create_text_to_3d(): # OR if you need more info (e.g. status_code) response: Response[Optional[Union[Mesh, Error]]] = create_text_to_3d.sync_detailed( client=client, - output_format=FileExportFormat.GLTF, + output_format=FileExportFormat.FBX, prompt="", ) @@ -369,7 +388,7 @@ async def test_create_text_to_3d_async(): result: Optional[Union[Mesh, Error]] = await create_text_to_3d.asyncio( client=client, - output_format=FileExportFormat.GLTF, + output_format=FileExportFormat.FBX, prompt="", ) @@ -378,7 +397,7 @@ async def test_create_text_to_3d_async(): Optional[Union[Mesh, Error]] ] = await create_text_to_3d.asyncio_detailed( client=client, - output_format=FileExportFormat.GLTF, + output_format=FileExportFormat.FBX, prompt="", ) @@ -932,7 +951,7 @@ def test_create_file_center_of_mass(): result: Optional[Union[FileCenterOfMass, Error]] = create_file_center_of_mass.sync( client=client, output_unit=UnitLength.CM, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -949,7 +968,7 @@ def test_create_file_center_of_mass(): ] = create_file_center_of_mass.sync_detailed( client=client, output_unit=UnitLength.CM, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -966,7 +985,7 @@ async def test_create_file_center_of_mass_async(): ] = await create_file_center_of_mass.asyncio( client=client, output_unit=UnitLength.CM, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -976,22 +995,20 @@ async def test_create_file_center_of_mass_async(): ] = await create_file_center_of_mass.asyncio_detailed( client=client, output_unit=UnitLength.CM, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @pytest.mark.skip -def test_create_file_conversion_with_base64_helper(): +def test_create_file_conversion(): # Create our client. client = ClientFromEnv() - result: Optional[ - Union[Tuple[FileConversion, bytes], Error] - ] = create_file_conversion_with_base64_helper.sync( + result: Optional[Union[FileConversion, Error]] = create_file_conversion.sync( client=client, - output_format=FileExportFormat.GLTF, - src_format=FileImportFormat.GLTF, + output_format=FileExportFormat.FBX, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -999,7 +1016,7 @@ def test_create_file_conversion_with_base64_helper(): print(result) raise Exception("Error in response") - body: Tuple[FileConversion, bytes] = result + body: FileConversion = result print(body) # OR if you need more info (e.g. status_code) @@ -1007,8 +1024,8 @@ def test_create_file_conversion_with_base64_helper(): Optional[Union[FileConversion, Error]] ] = create_file_conversion.sync_detailed( client=client, - output_format=FileExportFormat.GLTF, - src_format=FileImportFormat.GLTF, + output_format=FileExportFormat.FBX, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1016,16 +1033,16 @@ def test_create_file_conversion_with_base64_helper(): # OR run async @pytest.mark.asyncio @pytest.mark.skip -async def test_create_file_conversion_with_base64_helper_async(): +async def test_create_file_conversion_async(): # Create our client. client = ClientFromEnv() result: Optional[ - Union[Tuple[FileConversion, bytes], Error] - ] = await create_file_conversion_with_base64_helper.asyncio( + Union[FileConversion, Error] + ] = await create_file_conversion.asyncio( client=client, - output_format=FileExportFormat.GLTF, - src_format=FileImportFormat.GLTF, + output_format=FileExportFormat.FBX, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1034,8 +1051,8 @@ async def test_create_file_conversion_with_base64_helper_async(): Optional[Union[FileConversion, Error]] ] = await create_file_conversion.asyncio_detailed( client=client, - output_format=FileExportFormat.GLTF, - src_format=FileImportFormat.GLTF, + output_format=FileExportFormat.FBX, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1050,7 +1067,7 @@ def test_create_file_density(): material_mass=3.14, material_mass_unit=UnitMass.G, output_unit=UnitDensity.LB_FT3, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1069,7 +1086,7 @@ def test_create_file_density(): material_mass=3.14, material_mass_unit=UnitMass.G, output_unit=UnitDensity.LB_FT3, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1086,7 +1103,7 @@ async def test_create_file_density_async(): material_mass=3.14, material_mass_unit=UnitMass.G, output_unit=UnitDensity.LB_FT3, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1098,7 +1115,7 @@ async def test_create_file_density_async(): material_mass=3.14, material_mass_unit=UnitMass.G, output_unit=UnitDensity.LB_FT3, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1168,7 +1185,7 @@ def test_create_file_mass(): material_density=3.14, material_density_unit=UnitDensity.LB_FT3, output_unit=UnitMass.G, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1187,7 +1204,7 @@ def test_create_file_mass(): material_density=3.14, material_density_unit=UnitDensity.LB_FT3, output_unit=UnitMass.G, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1204,7 +1221,7 @@ async def test_create_file_mass_async(): material_density=3.14, material_density_unit=UnitDensity.LB_FT3, output_unit=UnitMass.G, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1216,7 +1233,7 @@ async def test_create_file_mass_async(): material_density=3.14, material_density_unit=UnitDensity.LB_FT3, output_unit=UnitMass.G, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1229,7 +1246,7 @@ def test_create_file_surface_area(): result: Optional[Union[FileSurfaceArea, Error]] = create_file_surface_area.sync( client=client, output_unit=UnitArea.CM2, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1246,7 +1263,7 @@ def test_create_file_surface_area(): ] = create_file_surface_area.sync_detailed( client=client, output_unit=UnitArea.CM2, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1263,7 +1280,7 @@ async def test_create_file_surface_area_async(): ] = await create_file_surface_area.asyncio( client=client, output_unit=UnitArea.CM2, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1273,7 +1290,7 @@ async def test_create_file_surface_area_async(): ] = await create_file_surface_area.asyncio_detailed( client=client, output_unit=UnitArea.CM2, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1286,7 +1303,7 @@ def test_create_file_volume(): result: Optional[Union[FileVolume, Error]] = create_file_volume.sync( client=client, output_unit=UnitVolume.CM3, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1303,7 +1320,7 @@ def test_create_file_volume(): ] = create_file_volume.sync_detailed( client=client, output_unit=UnitVolume.CM3, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1318,7 +1335,7 @@ async def test_create_file_volume_async(): result: Optional[Union[FileVolume, Error]] = await create_file_volume.asyncio( client=client, output_unit=UnitVolume.CM3, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1328,7 +1345,7 @@ async def test_create_file_volume_async(): ] = await create_file_volume.asyncio_detailed( client=client, output_unit=UnitVolume.CM3, - src_format=FileImportFormat.GLTF, + src_format=FileImportFormat.FBX, body=bytes("some bytes", "utf-8"), ) @@ -1377,7 +1394,31 @@ def test_cmd(): # Create our client. client = ClientFromEnv() - cmd.sync( + result: Optional[ + Union[ + Empty, + Export, + SelectWithPoint, + HighlightSetEntity, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, + EntityGetAllChildUuids, + SelectGet, + GetEntityType, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + Solid3dGetNextAdjacentEdge, + MouseClick, + CurveGetType, + CurveGetControlPoints, + TakeSnapshot, + PathGetInfo, + Error, + ] + ] = cmd.sync( client=client, body=ModelingCmdReq( cmd=move_path_pen( @@ -1392,8 +1433,62 @@ def test_cmd(): ), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Union[ + Empty, + Export, + SelectWithPoint, + HighlightSetEntity, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, + EntityGetAllChildUuids, + SelectGet, + GetEntityType, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + Solid3dGetNextAdjacentEdge, + MouseClick, + CurveGetType, + CurveGetControlPoints, + TakeSnapshot, + PathGetInfo, + ] = result + print(body) + # OR if you need more info (e.g. status_code) - cmd.sync_detailed( + response: Response[ + Optional[ + Union[ + Empty, + Export, + SelectWithPoint, + HighlightSetEntity, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, + EntityGetAllChildUuids, + SelectGet, + GetEntityType, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + Solid3dGetNextAdjacentEdge, + MouseClick, + CurveGetType, + CurveGetControlPoints, + TakeSnapshot, + PathGetInfo, + Error, + ] + ] + ] = cmd.sync_detailed( client=client, body=ModelingCmdReq( cmd=move_path_pen( @@ -1416,7 +1511,31 @@ async def test_cmd_async(): # Create our client. client = ClientFromEnv() - await cmd.asyncio( + result: Optional[ + Union[ + Empty, + Export, + SelectWithPoint, + HighlightSetEntity, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, + EntityGetAllChildUuids, + SelectGet, + GetEntityType, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + Solid3dGetNextAdjacentEdge, + MouseClick, + CurveGetType, + CurveGetControlPoints, + TakeSnapshot, + PathGetInfo, + Error, + ] + ] = await cmd.asyncio( client=client, body=ModelingCmdReq( cmd=move_path_pen( @@ -1432,7 +1551,33 @@ async def test_cmd_async(): ) # OR run async with more info - await cmd.asyncio_detailed( + response: Response[ + Optional[ + Union[ + Empty, + Export, + SelectWithPoint, + HighlightSetEntity, + EntityGetChildUuid, + EntityGetNumChildren, + EntityGetParentId, + EntityGetAllChildUuids, + SelectGet, + GetEntityType, + Solid3dGetAllEdgeFaces, + Solid3dGetAllOppositeEdges, + Solid3dGetOppositeEdge, + Solid3dGetPrevAdjacentEdge, + Solid3dGetNextAdjacentEdge, + MouseClick, + CurveGetType, + CurveGetControlPoints, + TakeSnapshot, + PathGetInfo, + Error, + ] + ] + ] = await cmd.asyncio_detailed( client=client, body=ModelingCmdReq( cmd=move_path_pen( @@ -3798,6 +3943,7 @@ def test_modeling_commands_ws(): unlocked_framerate=False, video_res_height=10, video_res_width=10, + webrtc=False, ) # Send a message. @@ -3822,6 +3968,7 @@ async def test_modeling_commands_ws_async(): unlocked_framerate=False, video_res_height=10, video_res_width=10, + webrtc=False, ) # Send a message. diff --git a/kittycad/models/__init__.py b/kittycad/models/__init__.py index ac80682a2..4aaeabe70 100644 --- a/kittycad/models/__init__.py +++ b/kittycad/models/__init__.py @@ -19,6 +19,7 @@ from .api_call_query_group_by import ApiCallQueryGroupBy from .api_call_status import ApiCallStatus from .api_call_with_price import ApiCallWithPrice from .api_call_with_price_results_page import ApiCallWithPriceResultsPage +from .api_error import ApiError from .api_token import ApiToken from .api_token_results_page import ApiTokenResultsPage from .app_client_info import AppClientInfo @@ -28,6 +29,7 @@ from .async_api_call_results_page import AsyncApiCallResultsPage from .async_api_call_type import AsyncApiCallType from .axis import Axis from .axis_direction_pair import AxisDirectionPair +from .base64data import Base64Data from .billing_info import BillingInfo from .cache_metadata import CacheMetadata from .camera_drag_interaction_type import CameraDragInteractionType @@ -42,6 +44,9 @@ from .country_code import CountryCode from .coupon import Coupon from .created_at_sort_mode import CreatedAtSortMode from .currency import Currency +from .curve_get_control_points import CurveGetControlPoints +from .curve_get_type import CurveGetType +from .curve_type import CurveType from .customer import Customer from .customer_balance import CustomerBalance from .device_access_token_request_form import DeviceAccessTokenRequestForm @@ -51,17 +56,23 @@ from .direction import Direction from .discount import Discount from .docker_system_info import DockerSystemInfo from .email_authentication_form import EmailAuthenticationForm -from .engine_error import EngineError +from .empty import Empty from .engine_metadata import EngineMetadata +from .entity_get_all_child_uuids import EntityGetAllChildUuids +from .entity_get_child_uuid import EntityGetChildUuid +from .entity_get_num_children import EntityGetNumChildren +from .entity_get_parent_id import EntityGetParentId from .entity_type import EntityType from .environment import Environment from .error import Error from .error_code import ErrorCode -from .error_response import ErrorResponse from .executor_metadata import ExecutorMetadata +from .export import Export from .export_file import ExportFile from .extended_user import ExtendedUser from .extended_user_results_page import ExtendedUserResultsPage +from .failure_web_socket_response import FailureWebSocketResponse +from .fbx_storage import FbxStorage from .file_center_of_mass import FileCenterOfMass from .file_conversion import FileConversion from .file_density import FileDensity @@ -72,7 +83,12 @@ from .file_surface_area import FileSurfaceArea from .file_system_metadata import FileSystemMetadata from .file_volume import FileVolume from .gateway import Gateway +from .get_entity_type import GetEntityType +from .gltf_presentation import GltfPresentation +from .gltf_storage import GltfStorage +from .highlight_set_entity import HighlightSetEntity from .ice_server import IceServer +from .image_format import ImageFormat from .image_type import ImageType from .index_info import IndexInfo from .input_format import InputFormat @@ -95,41 +111,53 @@ from .modeling_cmd_req_batch import ModelingCmdReqBatch from .modeling_error import ModelingError from .modeling_outcome import ModelingOutcome from .modeling_outcomes import ModelingOutcomes +from .mouse_click import MouseClick from .new_address import NewAddress from .o_auth2_client_info import OAuth2ClientInfo from .o_auth2_grant_type import OAuth2GrantType from .ok_modeling_cmd_response import OkModelingCmdResponse +from .ok_web_socket_response_data import OkWebSocketResponseData from .onboarding import Onboarding from .output_file import OutputFile from .output_format import OutputFormat +from .path_command import PathCommand +from .path_get_info import PathGetInfo from .path_segment import PathSegment +from .path_segment_info import PathSegmentInfo from .payment_intent import PaymentIntent from .payment_method import PaymentMethod from .payment_method_card_checks import PaymentMethodCardChecks from .payment_method_type import PaymentMethodType from .plugins_info import PluginsInfo +from .ply_storage import PlyStorage from .point2d import Point2d from .point3d import Point3d from .point_e_metadata import PointEMetadata from .pong import Pong from .raw_file import RawFile from .registry_service_config import RegistryServiceConfig -from .rtc_ice_candidate import RtcIceCandidate from .rtc_ice_candidate_init import RtcIceCandidateInit -from .rtc_ice_candidate_type import RtcIceCandidateType -from .rtc_ice_protocol import RtcIceProtocol from .rtc_sdp_type import RtcSdpType from .rtc_session_description import RtcSessionDescription from .runtime import Runtime from .scene_selection_type import SceneSelectionType +from .scene_tool_type import SceneToolType +from .select_get import SelectGet +from .select_with_point import SelectWithPoint from .session import Session -from .snake_case_result import SnakeCaseResult -from .storage import Storage +from .solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces +from .solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges +from .solid3d_get_next_adjacent_edge import Solid3dGetNextAdjacentEdge +from .solid3d_get_opposite_edge import Solid3dGetOppositeEdge +from .solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge +from .stl_storage import StlStorage +from .success_web_socket_response import SuccessWebSocketResponse from .system import System from .system_info_cgroup_driver_enum import SystemInfoCgroupDriverEnum from .system_info_cgroup_version_enum import SystemInfoCgroupVersionEnum from .system_info_default_address_pools import SystemInfoDefaultAddressPools from .system_info_isolation_enum import SystemInfoIsolationEnum +from .take_snapshot import TakeSnapshot from .unit_angle import UnitAngle from .unit_angle_conversion import UnitAngleConversion from .unit_area import UnitArea @@ -162,5 +190,5 @@ from .user import User from .user_results_page import UserResultsPage from .uuid import Uuid from .verification_token import VerificationToken -from .web_socket_messages import WebSocketMessages -from .web_socket_responses import WebSocketResponses +from .web_socket_request import WebSocketRequest +from .web_socket_response import WebSocketResponse diff --git a/kittycad/models/engine_error.py b/kittycad/models/api_error.py similarity index 88% rename from kittycad/models/engine_error.py rename to kittycad/models/api_error.py index a575d569f..d54561280 100644 --- a/kittycad/models/engine_error.py +++ b/kittycad/models/api_error.py @@ -5,11 +5,11 @@ import attr from ..models.error_code import ErrorCode from ..types import UNSET, Unset -CE = TypeVar("CE", bound="EngineError") +HX = TypeVar("HX", bound="ApiError") @attr.s(auto_attribs=True) -class EngineError: +class ApiError: """An error.""" # noqa: E501 error_code: Union[Unset, ErrorCode] = UNSET @@ -33,7 +33,7 @@ class EngineError: return field_dict @classmethod - def from_dict(cls: Type[CE], src_dict: Dict[str, Any]) -> CE: + def from_dict(cls: Type[HX], src_dict: Dict[str, Any]) -> HX: d = src_dict.copy() _error_code = d.pop("error_code", UNSET) error_code: Union[Unset, ErrorCode] @@ -44,13 +44,13 @@ class EngineError: message = d.pop("message", UNSET) - engine_error = cls( + api_error = cls( error_code=error_code, message=message, ) - engine_error.additional_properties = d - return engine_error + api_error.additional_properties = d + return api_error @property def additional_keys(self) -> List[str]: diff --git a/kittycad/models/api_token.py b/kittycad/models/api_token.py index b2baf9283..ee019e5e2 100644 --- a/kittycad/models/api_token.py +++ b/kittycad/models/api_token.py @@ -7,7 +7,7 @@ from dateutil.parser import isoparse from ..models.uuid import Uuid from ..types import UNSET, Unset -HX = TypeVar("HX", bound="ApiToken") +LB = TypeVar("LB", bound="ApiToken") @attr.s(auto_attribs=True) @@ -56,7 +56,7 @@ class ApiToken: return field_dict @classmethod - def from_dict(cls: Type[HX], src_dict: Dict[str, Any]) -> HX: + def from_dict(cls: Type[LB], src_dict: Dict[str, Any]) -> LB: d = src_dict.copy() _created_at = d.pop("created_at", UNSET) created_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/api_token_results_page.py b/kittycad/models/api_token_results_page.py index 5a7758fa3..3e9c36fc4 100644 --- a/kittycad/models/api_token_results_page.py +++ b/kittycad/models/api_token_results_page.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -LB = TypeVar("LB", bound="ApiTokenResultsPage") +NE = TypeVar("NE", bound="ApiTokenResultsPage") @attr.s(auto_attribs=True) @@ -37,7 +37,7 @@ class ApiTokenResultsPage: return field_dict @classmethod - def from_dict(cls: Type[LB], src_dict: Dict[str, Any]) -> LB: + def from_dict(cls: Type[NE], src_dict: Dict[str, Any]) -> NE: d = src_dict.copy() from ..models.api_token import ApiToken diff --git a/kittycad/models/app_client_info.py b/kittycad/models/app_client_info.py index 56956296a..52fb5576a 100644 --- a/kittycad/models/app_client_info.py +++ b/kittycad/models/app_client_info.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -NE = TypeVar("NE", bound="AppClientInfo") +TL = TypeVar("TL", bound="AppClientInfo") @attr.s(auto_attribs=True) @@ -27,7 +27,7 @@ class AppClientInfo: return field_dict @classmethod - def from_dict(cls: Type[NE], src_dict: Dict[str, Any]) -> NE: + def from_dict(cls: Type[TL], src_dict: Dict[str, Any]) -> TL: d = src_dict.copy() url = d.pop("url", UNSET) diff --git a/kittycad/models/async_api_call.py b/kittycad/models/async_api_call.py index 0c0f46916..8425cc6ba 100644 --- a/kittycad/models/async_api_call.py +++ b/kittycad/models/async_api_call.py @@ -9,7 +9,7 @@ from ..models.async_api_call_type import AsyncApiCallType from ..models.uuid import Uuid from ..types import UNSET, Unset -TL = TypeVar("TL", bound="AsyncApiCall") +MN = TypeVar("MN", bound="AsyncApiCall") @attr.s(auto_attribs=True) @@ -86,7 +86,7 @@ class AsyncApiCall: return field_dict @classmethod - def from_dict(cls: Type[TL], src_dict: Dict[str, Any]) -> TL: + def from_dict(cls: Type[MN], src_dict: Dict[str, Any]) -> MN: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/async_api_call_output.py b/kittycad/models/async_api_call_output.py index b4130fb7f..3f1ecfe11 100644 --- a/kittycad/models/async_api_call_output.py +++ b/kittycad/models/async_api_call_output.py @@ -5,6 +5,7 @@ import attr from dateutil.parser import isoparse from ..models.api_call_status import ApiCallStatus +from ..models.base64data import Base64Data from ..models.file_export_format import FileExportFormat from ..models.file_import_format import FileImportFormat from ..models.input_format import InputFormat @@ -18,7 +19,7 @@ from ..models.unit_volume import UnitVolume from ..models.uuid import Uuid from ..types import UNSET, Unset -MN = TypeVar("MN", bound="file_conversion") +JV = TypeVar("JV", bound="file_conversion") @attr.s(auto_attribs=True) @@ -29,10 +30,10 @@ class file_conversion: created_at: Union[Unset, datetime.datetime] = UNSET error: Union[Unset, str] = UNSET id: Union[Unset, str] = UNSET - output: Union[Unset, str] = UNSET + output: Union[Unset, Base64Data] = UNSET output_format: Union[Unset, FileExportFormat] = UNSET output_format_options: Union[Unset, OutputFormat] = UNSET - outputs: Union[Unset, Any] = UNSET + outputs: Union[Unset, Dict[str, Base64Data]] = UNSET src_format: Union[Unset, FileImportFormat] = UNSET src_format_options: Union[Unset, InputFormat] = UNSET started_at: Union[Unset, datetime.datetime] = UNSET @@ -52,12 +53,19 @@ class file_conversion: created_at = self.created_at.isoformat() error = self.error id = self.id - output = self.output + output: Union[Unset, str] = UNSET + if not isinstance(self.output, Unset): + output = self.output.get_encoded() if not isinstance(self.output_format, Unset): output_format = self.output_format if not isinstance(self.output_format_options, Unset): output_format_options = self.output_format_options - outputs = self.outputs + outputs: Union[Unset, Dict[str, str]] = UNSET + if not isinstance(self.outputs, Unset): + new_dict: Dict[str, str] = {} + for key, value in self.outputs.items(): + new_dict[key] = value.get_encoded() + outputs = new_dict if not isinstance(self.src_format, Unset): src_format = self.src_format if not isinstance(self.src_format_options, Unset): @@ -109,7 +117,7 @@ class file_conversion: return field_dict @classmethod - def from_dict(cls: Type[MN], src_dict: Dict[str, Any]) -> MN: + def from_dict(cls: Type[JV], src_dict: Dict[str, Any]) -> JV: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] @@ -134,7 +142,12 @@ class file_conversion: else: id = _id # type: ignore[arg-type] - output = d.pop("output", UNSET) + _output = d.pop("output", UNSET) + output: Union[Unset, Base64Data] + if isinstance(_output, Unset): + output = UNSET + else: + output = Base64Data(bytes(_output, "utf-8")) _output_format = d.pop("output_format", UNSET) output_format: Union[Unset, FileExportFormat] @@ -150,7 +163,15 @@ class file_conversion: else: output_format_options = _output_format_options # type: ignore[arg-type] - outputs = d.pop("outputs", UNSET) + _outputs = d.pop("outputs", UNSET) + if isinstance(_outputs, Unset): + outputs = UNSET + else: + new_map: Dict[str, Base64Data] = {} + for k, v in _outputs.items(): + new_map[k] = Base64Data(bytes(v, "utf-8")) + outputs = new_map # type: ignore + _src_format = d.pop("src_format", UNSET) src_format: Union[Unset, FileImportFormat] if isinstance(_src_format, Unset): @@ -228,7 +249,7 @@ class file_conversion: return key in self.additional_properties -JV = TypeVar("JV", bound="file_center_of_mass") +IO = TypeVar("IO", bound="file_center_of_mass") @attr.s(auto_attribs=True) @@ -306,7 +327,7 @@ class file_center_of_mass: return field_dict @classmethod - def from_dict(cls: Type[JV], src_dict: Dict[str, Any]) -> JV: + def from_dict(cls: Type[IO], src_dict: Dict[str, Any]) -> IO: d = src_dict.copy() _center_of_mass = d.pop("center_of_mass", UNSET) center_of_mass: Union[Unset, Point3d] @@ -412,7 +433,7 @@ class file_center_of_mass: return key in self.additional_properties -IO = TypeVar("IO", bound="file_mass") +FV = TypeVar("FV", bound="file_mass") @attr.s(auto_attribs=True) @@ -498,7 +519,7 @@ class file_mass: return field_dict @classmethod - def from_dict(cls: Type[IO], src_dict: Dict[str, Any]) -> IO: + def from_dict(cls: Type[FV], src_dict: Dict[str, Any]) -> FV: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] @@ -610,7 +631,7 @@ class file_mass: return key in self.additional_properties -FV = TypeVar("FV", bound="file_volume") +LE = TypeVar("LE", bound="file_volume") @attr.s(auto_attribs=True) @@ -687,7 +708,7 @@ class file_volume: return field_dict @classmethod - def from_dict(cls: Type[FV], src_dict: Dict[str, Any]) -> FV: + def from_dict(cls: Type[LE], src_dict: Dict[str, Any]) -> LE: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] @@ -788,7 +809,7 @@ class file_volume: return key in self.additional_properties -LE = TypeVar("LE", bound="file_density") +OY = TypeVar("OY", bound="file_density") @attr.s(auto_attribs=True) @@ -874,7 +895,7 @@ class file_density: return field_dict @classmethod - def from_dict(cls: Type[LE], src_dict: Dict[str, Any]) -> LE: + def from_dict(cls: Type[OY], src_dict: Dict[str, Any]) -> OY: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] @@ -986,7 +1007,7 @@ class file_density: return key in self.additional_properties -OY = TypeVar("OY", bound="file_surface_area") +HO = TypeVar("HO", bound="file_surface_area") @attr.s(auto_attribs=True) @@ -1063,7 +1084,7 @@ class file_surface_area: return field_dict @classmethod - def from_dict(cls: Type[OY], src_dict: Dict[str, Any]) -> OY: + def from_dict(cls: Type[HO], src_dict: Dict[str, Any]) -> HO: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/async_api_call_results_page.py b/kittycad/models/async_api_call_results_page.py index 3371285ab..c09dc86b8 100644 --- a/kittycad/models/async_api_call_results_page.py +++ b/kittycad/models/async_api_call_results_page.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -HO = TypeVar("HO", bound="AsyncApiCallResultsPage") +TM = TypeVar("TM", bound="AsyncApiCallResultsPage") @attr.s(auto_attribs=True) @@ -37,7 +37,7 @@ class AsyncApiCallResultsPage: return field_dict @classmethod - def from_dict(cls: Type[HO], src_dict: Dict[str, Any]) -> HO: + def from_dict(cls: Type[TM], src_dict: Dict[str, Any]) -> TM: d = src_dict.copy() from ..models.async_api_call import AsyncApiCall diff --git a/kittycad/models/axis_direction_pair.py b/kittycad/models/axis_direction_pair.py index e74a571cc..ea53a700b 100644 --- a/kittycad/models/axis_direction_pair.py +++ b/kittycad/models/axis_direction_pair.py @@ -6,7 +6,7 @@ from ..models.axis import Axis from ..models.direction import Direction from ..types import UNSET, Unset -TM = TypeVar("TM", bound="AxisDirectionPair") +BS = TypeVar("BS", bound="AxisDirectionPair") @attr.s(auto_attribs=True) @@ -35,7 +35,7 @@ class AxisDirectionPair: return field_dict @classmethod - def from_dict(cls: Type[TM], src_dict: Dict[str, Any]) -> TM: + def from_dict(cls: Type[BS], src_dict: Dict[str, Any]) -> BS: d = src_dict.copy() _axis = d.pop("axis", UNSET) axis: Union[Unset, Axis] diff --git a/kittycad/models/base64data.py b/kittycad/models/base64data.py new file mode 100644 index 000000000..f8cc0633b --- /dev/null +++ b/kittycad/models/base64data.py @@ -0,0 +1,35 @@ +import base64 +import binascii + + +class Base64Data: + def __init__(self, data: bytes): + """ + Initializes the object. + + If the provided data is already in base64 encoded format, it will store it. + If the data is a regular byte string, it will encode and then store it. + """ + if self.is_base64(data): + self._data = str(data, "utf-8") + else: + encoded = base64.b64encode(data) + self._data = str(encoded, "utf-8") + + @staticmethod + def is_base64(data: bytes) -> bool: + """Checks if given data is base64 encoded.""" + try: + str_data = str(data, "utf-8") + _ = base64.urlsafe_b64decode(str_data.strip("=") + "===") + return True + except binascii.Error: + return False + + def get_encoded(self) -> str: + """Returns the stored base64 encoded data.""" + return self._data + + def get_decoded(self) -> bytes: + """Returns the decoded byte string.""" + return base64.urlsafe_b64decode(self._data.strip("=") + "===") diff --git a/kittycad/models/billing_info.py b/kittycad/models/billing_info.py index 3be4253ae..1c94bbe16 100644 --- a/kittycad/models/billing_info.py +++ b/kittycad/models/billing_info.py @@ -5,7 +5,7 @@ import attr from ..models.new_address import NewAddress from ..types import UNSET, Unset -BS = TypeVar("BS", bound="BillingInfo") +AH = TypeVar("AH", bound="BillingInfo") @attr.s(auto_attribs=True) @@ -37,7 +37,7 @@ class BillingInfo: return field_dict @classmethod - def from_dict(cls: Type[BS], src_dict: Dict[str, Any]) -> BS: + def from_dict(cls: Type[AH], src_dict: Dict[str, Any]) -> AH: d = src_dict.copy() _address = d.pop("address", UNSET) address: Union[Unset, NewAddress] diff --git a/kittycad/models/cache_metadata.py b/kittycad/models/cache_metadata.py index 00068314a..e2a11db9d 100644 --- a/kittycad/models/cache_metadata.py +++ b/kittycad/models/cache_metadata.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -AH = TypeVar("AH", bound="CacheMetadata") +EG = TypeVar("EG", bound="CacheMetadata") @attr.s(auto_attribs=True) @@ -29,7 +29,7 @@ class CacheMetadata: return field_dict @classmethod - def from_dict(cls: Type[AH], src_dict: Dict[str, Any]) -> AH: + def from_dict(cls: Type[EG], src_dict: Dict[str, Any]) -> EG: d = src_dict.copy() ok = d.pop("ok", UNSET) diff --git a/kittycad/models/card_details.py b/kittycad/models/card_details.py index 482ec46d2..d131ebdcb 100644 --- a/kittycad/models/card_details.py +++ b/kittycad/models/card_details.py @@ -5,7 +5,7 @@ import attr from ..models.payment_method_card_checks import PaymentMethodCardChecks from ..types import UNSET, Unset -EG = TypeVar("EG", bound="CardDetails") +JR = TypeVar("JR", bound="CardDetails") @attr.s(auto_attribs=True) @@ -57,7 +57,7 @@ class CardDetails: return field_dict @classmethod - def from_dict(cls: Type[EG], src_dict: Dict[str, Any]) -> EG: + def from_dict(cls: Type[JR], src_dict: Dict[str, Any]) -> JR: d = src_dict.copy() brand = d.pop("brand", UNSET) diff --git a/kittycad/models/cluster.py b/kittycad/models/cluster.py index 053c8ccaf..12585442b 100644 --- a/kittycad/models/cluster.py +++ b/kittycad/models/cluster.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -JR = TypeVar("JR", bound="Cluster") +LY = TypeVar("LY", bound="Cluster") @attr.s(auto_attribs=True) @@ -49,7 +49,7 @@ class Cluster: return field_dict @classmethod - def from_dict(cls: Type[JR], src_dict: Dict[str, Any]) -> JR: + def from_dict(cls: Type[LY], src_dict: Dict[str, Any]) -> LY: d = src_dict.copy() addr = d.pop("addr", UNSET) diff --git a/kittycad/models/code_output.py b/kittycad/models/code_output.py index 0e0397e6f..2f1fa8eb6 100644 --- a/kittycad/models/code_output.py +++ b/kittycad/models/code_output.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -LY = TypeVar("LY", bound="CodeOutput") +HK = TypeVar("HK", bound="CodeOutput") @attr.s(auto_attribs=True) @@ -41,7 +41,7 @@ class CodeOutput: return field_dict @classmethod - def from_dict(cls: Type[LY], src_dict: Dict[str, Any]) -> LY: + def from_dict(cls: Type[HK], src_dict: Dict[str, Any]) -> HK: d = src_dict.copy() from ..models.output_file import OutputFile diff --git a/kittycad/models/color.py b/kittycad/models/color.py index 37e16b790..39930a1ec 100644 --- a/kittycad/models/color.py +++ b/kittycad/models/color.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -HK = TypeVar("HK", bound="Color") +VR = TypeVar("VR", bound="Color") @attr.s(auto_attribs=True) @@ -39,7 +39,7 @@ class Color: return field_dict @classmethod - def from_dict(cls: Type[HK], src_dict: Dict[str, Any]) -> HK: + def from_dict(cls: Type[VR], src_dict: Dict[str, Any]) -> VR: d = src_dict.copy() a = d.pop("a", UNSET) diff --git a/kittycad/models/commit.py b/kittycad/models/commit.py index 6c8092db8..05461befc 100644 --- a/kittycad/models/commit.py +++ b/kittycad/models/commit.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -VR = TypeVar("VR", bound="Commit") +ON = TypeVar("ON", bound="Commit") @attr.s(auto_attribs=True) @@ -31,7 +31,7 @@ class Commit: return field_dict @classmethod - def from_dict(cls: Type[VR], src_dict: Dict[str, Any]) -> VR: + def from_dict(cls: Type[ON], src_dict: Dict[str, Any]) -> ON: d = src_dict.copy() expected = d.pop("expected", UNSET) diff --git a/kittycad/models/connection.py b/kittycad/models/connection.py index b5c3a61b6..9a73d2276 100644 --- a/kittycad/models/connection.py +++ b/kittycad/models/connection.py @@ -10,7 +10,7 @@ from ..models.jetstream import Jetstream from ..models.leaf_node import LeafNode from ..types import UNSET, Unset -ON = TypeVar("ON", bound="Connection") +PC = TypeVar("PC", bound="Connection") @attr.s(auto_attribs=True) @@ -33,7 +33,7 @@ class Connection: http_base_path: Union[Unset, str] = UNSET http_host: Union[Unset, str] = UNSET http_port: Union[Unset, int] = UNSET - http_req_stats: Union[Unset, Any] = UNSET + http_req_stats: Union[Unset, Dict[str, int]] = UNSET https_port: Union[Unset, int] = UNSET in_bytes: Union[Unset, int] = UNSET in_msgs: Union[Unset, int] = UNSET @@ -88,6 +88,7 @@ class Connection: http_host = self.http_host http_port = self.http_port http_req_stats = self.http_req_stats + https_port = self.https_port in_bytes = self.in_bytes in_msgs = self.in_msgs @@ -225,7 +226,7 @@ class Connection: return field_dict @classmethod - def from_dict(cls: Type[ON], src_dict: Dict[str, Any]) -> ON: + def from_dict(cls: Type[PC], src_dict: Dict[str, Any]) -> PC: d = src_dict.copy() auth_timeout = d.pop("auth_timeout", UNSET) @@ -271,6 +272,7 @@ class Connection: http_port = d.pop("http_port", UNSET) http_req_stats = d.pop("http_req_stats", UNSET) + https_port = d.pop("https_port", UNSET) in_bytes = d.pop("in_bytes", UNSET) diff --git a/kittycad/models/coupon.py b/kittycad/models/coupon.py index 6a8f41344..2486d3c55 100644 --- a/kittycad/models/coupon.py +++ b/kittycad/models/coupon.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -PC = TypeVar("PC", bound="Coupon") +US = TypeVar("US", bound="Coupon") @attr.s(auto_attribs=True) @@ -39,7 +39,7 @@ class Coupon: return field_dict @classmethod - def from_dict(cls: Type[PC], src_dict: Dict[str, Any]) -> PC: + def from_dict(cls: Type[US], src_dict: Dict[str, Any]) -> US: d = src_dict.copy() amount_off = d.pop("amount_off", UNSET) diff --git a/kittycad/models/curve_get_control_points.py b/kittycad/models/curve_get_control_points.py new file mode 100644 index 000000000..67837fe86 --- /dev/null +++ b/kittycad/models/curve_get_control_points.py @@ -0,0 +1,63 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +import attr + +from ..types import UNSET, Unset + +KQ = TypeVar("KQ", bound="CurveGetControlPoints") + + +@attr.s(auto_attribs=True) +class CurveGetControlPoints: + """The response from the `CurveGetControlPoints` command.""" # noqa: E501 + + from ..models.point3d import Point3d + + control_points: Union[Unset, List[Point3d]] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + from ..models.point3d import Point3d + + control_points: Union[Unset, List[Point3d]] = UNSET + if not isinstance(self.control_points, Unset): + control_points = self.control_points + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if control_points is not UNSET: + field_dict["control_points"] = control_points + + return field_dict + + @classmethod + def from_dict(cls: Type[KQ], src_dict: Dict[str, Any]) -> KQ: + d = src_dict.copy() + from ..models.point3d import Point3d + + control_points = cast(List[Point3d], d.pop("control_points", UNSET)) + + curve_get_control_points = cls( + control_points=control_points, + ) + + curve_get_control_points.additional_properties = d + return curve_get_control_points + + @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 diff --git a/kittycad/models/curve_get_type.py b/kittycad/models/curve_get_type.py new file mode 100644 index 000000000..9a6bbe247 --- /dev/null +++ b/kittycad/models/curve_get_type.py @@ -0,0 +1,62 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..models.curve_type import CurveType +from ..types import UNSET, Unset + +FH = TypeVar("FH", bound="CurveGetType") + + +@attr.s(auto_attribs=True) +class CurveGetType: + """The response from the `CurveGetType` command.""" # noqa: E501 + + curve_type: Union[Unset, CurveType] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.curve_type, Unset): + curve_type = self.curve_type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if curve_type is not UNSET: + field_dict["curve_type"] = curve_type + + return field_dict + + @classmethod + def from_dict(cls: Type[FH], src_dict: Dict[str, Any]) -> FH: + d = src_dict.copy() + _curve_type = d.pop("curve_type", UNSET) + curve_type: Union[Unset, CurveType] + if isinstance(_curve_type, Unset): + curve_type = UNSET + else: + curve_type = _curve_type # type: ignore[arg-type] + + curve_get_type = cls( + curve_type=curve_type, + ) + + curve_get_type.additional_properties = d + return curve_get_type + + @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 diff --git a/kittycad/models/curve_type.py b/kittycad/models/curve_type.py new file mode 100644 index 000000000..719096ea1 --- /dev/null +++ b/kittycad/models/curve_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class CurveType(str, Enum): + """The type of Curve (embedded within path)""" # noqa: E501 + + LINE = "line" + NURBS = "nurbs" + + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/customer.py b/kittycad/models/customer.py index 812e24e33..fadad277c 100644 --- a/kittycad/models/customer.py +++ b/kittycad/models/customer.py @@ -8,7 +8,7 @@ from ..models.currency import Currency from ..models.new_address import NewAddress from ..types import UNSET, Unset -US = TypeVar("US", bound="Customer") +NH = TypeVar("NH", bound="Customer") @attr.s(auto_attribs=True) @@ -22,7 +22,7 @@ class Customer: delinquent: Union[Unset, bool] = False email: Union[Unset, str] = UNSET id: Union[Unset, str] = UNSET - metadata: Union[Unset, Any] = UNSET + metadata: Union[Unset, Dict[str, str]] = UNSET name: Union[Unset, str] = UNSET phone: Union[Unset, str] = UNSET @@ -41,6 +41,7 @@ class Customer: email = self.email id = self.id metadata = self.metadata + name = self.name phone = self.phone @@ -71,7 +72,7 @@ class Customer: return field_dict @classmethod - def from_dict(cls: Type[US], src_dict: Dict[str, Any]) -> US: + def from_dict(cls: Type[NH], src_dict: Dict[str, Any]) -> NH: d = src_dict.copy() _address = d.pop("address", UNSET) address: Union[Unset, NewAddress] @@ -103,6 +104,7 @@ class Customer: id = d.pop("id", UNSET) metadata = d.pop("metadata", UNSET) + name = d.pop("name", UNSET) phone = d.pop("phone", UNSET) diff --git a/kittycad/models/customer_balance.py b/kittycad/models/customer_balance.py index 674bb8bdc..99e88b301 100644 --- a/kittycad/models/customer_balance.py +++ b/kittycad/models/customer_balance.py @@ -7,7 +7,7 @@ from dateutil.parser import isoparse from ..models.uuid import Uuid from ..types import UNSET, Unset -KQ = TypeVar("KQ", bound="CustomerBalance") +BB = TypeVar("BB", bound="CustomerBalance") @attr.s(auto_attribs=True) @@ -64,7 +64,7 @@ class CustomerBalance: return field_dict @classmethod - def from_dict(cls: Type[KQ], src_dict: Dict[str, Any]) -> KQ: + def from_dict(cls: Type[BB], src_dict: Dict[str, Any]) -> BB: d = src_dict.copy() _created_at = d.pop("created_at", UNSET) created_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/device_access_token_request_form.py b/kittycad/models/device_access_token_request_form.py index 6830546c4..6ccd39bd6 100644 --- a/kittycad/models/device_access_token_request_form.py +++ b/kittycad/models/device_access_token_request_form.py @@ -5,7 +5,7 @@ import attr from ..models.o_auth2_grant_type import OAuth2GrantType from ..types import UNSET, Unset -FH = TypeVar("FH", bound="DeviceAccessTokenRequestForm") +PJ = TypeVar("PJ", bound="DeviceAccessTokenRequestForm") @attr.s(auto_attribs=True) @@ -37,7 +37,7 @@ class DeviceAccessTokenRequestForm: return field_dict @classmethod - def from_dict(cls: Type[FH], src_dict: Dict[str, Any]) -> FH: + def from_dict(cls: Type[PJ], src_dict: Dict[str, Any]) -> PJ: d = src_dict.copy() client_id = d.pop("client_id", UNSET) diff --git a/kittycad/models/device_auth_request_form.py b/kittycad/models/device_auth_request_form.py index ec4c5d957..f1b73a185 100644 --- a/kittycad/models/device_auth_request_form.py +++ b/kittycad/models/device_auth_request_form.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -NH = TypeVar("NH", bound="DeviceAuthRequestForm") +TV = TypeVar("TV", bound="DeviceAuthRequestForm") @attr.s(auto_attribs=True) @@ -27,7 +27,7 @@ class DeviceAuthRequestForm: return field_dict @classmethod - def from_dict(cls: Type[NH], src_dict: Dict[str, Any]) -> NH: + def from_dict(cls: Type[TV], src_dict: Dict[str, Any]) -> TV: d = src_dict.copy() client_id = d.pop("client_id", UNSET) diff --git a/kittycad/models/device_auth_verify_params.py b/kittycad/models/device_auth_verify_params.py index fe532fdd1..221b6c9e7 100644 --- a/kittycad/models/device_auth_verify_params.py +++ b/kittycad/models/device_auth_verify_params.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -BB = TypeVar("BB", bound="DeviceAuthVerifyParams") +CR = TypeVar("CR", bound="DeviceAuthVerifyParams") @attr.s(auto_attribs=True) @@ -27,7 +27,7 @@ class DeviceAuthVerifyParams: return field_dict @classmethod - def from_dict(cls: Type[BB], src_dict: Dict[str, Any]) -> BB: + def from_dict(cls: Type[CR], src_dict: Dict[str, Any]) -> CR: d = src_dict.copy() user_code = d.pop("user_code", UNSET) diff --git a/kittycad/models/discount.py b/kittycad/models/discount.py index afb055d5a..fb40eb74d 100644 --- a/kittycad/models/discount.py +++ b/kittycad/models/discount.py @@ -5,7 +5,7 @@ import attr from ..models.coupon import Coupon from ..types import UNSET, Unset -PJ = TypeVar("PJ", bound="Discount") +CE = TypeVar("CE", bound="Discount") @attr.s(auto_attribs=True) @@ -29,7 +29,7 @@ class Discount: return field_dict @classmethod - def from_dict(cls: Type[PJ], src_dict: Dict[str, Any]) -> PJ: + def from_dict(cls: Type[CE], src_dict: Dict[str, Any]) -> CE: d = src_dict.copy() _coupon = d.pop("coupon", UNSET) coupon: Union[Unset, Coupon] diff --git a/kittycad/models/docker_system_info.py b/kittycad/models/docker_system_info.py index d4aba9131..4e9bc9dee 100644 --- a/kittycad/models/docker_system_info.py +++ b/kittycad/models/docker_system_info.py @@ -5,12 +5,13 @@ import attr from ..models.commit import Commit from ..models.plugins_info import PluginsInfo from ..models.registry_service_config import RegistryServiceConfig +from ..models.runtime import Runtime from ..models.system_info_cgroup_driver_enum import SystemInfoCgroupDriverEnum from ..models.system_info_cgroup_version_enum import SystemInfoCgroupVersionEnum from ..models.system_info_isolation_enum import SystemInfoIsolationEnum from ..types import UNSET, Unset -TV = TypeVar("TV", bound="DockerSystemInfo") +MS = TypeVar("MS", bound="DockerSystemInfo") @attr.s(auto_attribs=True) @@ -73,7 +74,9 @@ class DockerSystemInfo: product_license: Union[Unset, str] = UNSET registry_config: Union[Unset, RegistryServiceConfig] = UNSET runc_commit: Union[Unset, Commit] = UNSET - runtimes: Union[Unset, Any] = UNSET + from ..models.runtime import Runtime + + runtimes: Union[Unset, Dict[str, Runtime]] = UNSET security_options: Union[Unset, List[str]] = UNSET server_version: Union[Unset, str] = UNSET swap_limit: Union[Unset, bool] = False @@ -155,7 +158,12 @@ class DockerSystemInfo: registry_config = self.registry_config if not isinstance(self.runc_commit, Unset): runc_commit = self.runc_commit - runtimes = self.runtimes + runtimes: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.runtimes, Unset): + new_dict: Dict[str, Any] = {} + for key, value in self.runtimes.items(): + new_dict[key] = value.to_dict() + runtimes = new_dict security_options: Union[Unset, List[str]] = UNSET if not isinstance(self.security_options, Unset): security_options = self.security_options @@ -293,7 +301,7 @@ class DockerSystemInfo: return field_dict @classmethod - def from_dict(cls: Type[TV], src_dict: Dict[str, Any]) -> TV: + def from_dict(cls: Type[MS], src_dict: Dict[str, Any]) -> MS: d = src_dict.copy() architecture = d.pop("architecture", UNSET) @@ -449,7 +457,15 @@ class DockerSystemInfo: else: runc_commit = _runc_commit # type: ignore[arg-type] - runtimes = d.pop("runtimes", UNSET) + _runtimes = d.pop("runtimes", UNSET) + if isinstance(_runtimes, Unset): + runtimes = UNSET + else: + new_map: Dict[str, Runtime] = {} + for k, v in _runtimes.items(): + new_map[k] = Runtime.from_dict(v) # type: ignore + runtimes = new_map # type: ignore + security_options = cast(List[str], d.pop("security_options", UNSET)) server_version = d.pop("server_version", UNSET) diff --git a/kittycad/models/email_authentication_form.py b/kittycad/models/email_authentication_form.py index c405a2638..922fd01f3 100644 --- a/kittycad/models/email_authentication_form.py +++ b/kittycad/models/email_authentication_form.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -CR = TypeVar("CR", bound="EmailAuthenticationForm") +LT = TypeVar("LT", bound="EmailAuthenticationForm") @attr.s(auto_attribs=True) @@ -31,7 +31,7 @@ class EmailAuthenticationForm: return field_dict @classmethod - def from_dict(cls: Type[CR], src_dict: Dict[str, Any]) -> CR: + def from_dict(cls: Type[LT], src_dict: Dict[str, Any]) -> LT: d = src_dict.copy() callback_url = d.pop("callback_url", UNSET) diff --git a/kittycad/models/empty.py b/kittycad/models/empty.py new file mode 100644 index 000000000..0e4b57308 --- /dev/null +++ b/kittycad/models/empty.py @@ -0,0 +1,15 @@ +from typing import Any, Dict, Type, TypeVar + +import attr + +VI = TypeVar("VI", bound="Empty") + + +@attr.s(auto_attribs=True) +class Empty: + def __str__(self) -> str: + return "" + + @classmethod + def from_dict(cls: Type[VI], src_dict: Dict[str, Any]) -> Any: + return {} diff --git a/kittycad/models/engine_metadata.py b/kittycad/models/engine_metadata.py index 47b384689..46ad07feb 100644 --- a/kittycad/models/engine_metadata.py +++ b/kittycad/models/engine_metadata.py @@ -8,7 +8,7 @@ from ..models.environment import Environment from ..models.file_system_metadata import FileSystemMetadata from ..types import UNSET, Unset -MS = TypeVar("MS", bound="EngineMetadata") +ED = TypeVar("ED", bound="EngineMetadata") @attr.s(auto_attribs=True) @@ -57,7 +57,7 @@ class EngineMetadata: return field_dict @classmethod - def from_dict(cls: Type[MS], src_dict: Dict[str, Any]) -> MS: + def from_dict(cls: Type[ED], src_dict: Dict[str, Any]) -> ED: d = src_dict.copy() async_jobs_running = d.pop("async_jobs_running", UNSET) diff --git a/kittycad/models/entity_get_all_child_uuids.py b/kittycad/models/entity_get_all_child_uuids.py new file mode 100644 index 000000000..ffe957508 --- /dev/null +++ b/kittycad/models/entity_get_all_child_uuids.py @@ -0,0 +1,57 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +import attr + +from ..types import UNSET, Unset + +YY = TypeVar("YY", bound="EntityGetAllChildUuids") + + +@attr.s(auto_attribs=True) +class EntityGetAllChildUuids: + """The response from the `EntityGetAllChildUuids` command.""" # noqa: E501 + + entity_ids: Union[Unset, List[str]] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + entity_ids: Union[Unset, List[str]] = UNSET + if not isinstance(self.entity_ids, Unset): + entity_ids = self.entity_ids + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if entity_ids is not UNSET: + field_dict["entity_ids"] = entity_ids + + return field_dict + + @classmethod + def from_dict(cls: Type[YY], src_dict: Dict[str, Any]) -> YY: + d = src_dict.copy() + entity_ids = cast(List[str], d.pop("entity_ids", UNSET)) + + entity_get_all_child_uuids = cls( + entity_ids=entity_ids, + ) + + entity_get_all_child_uuids.additional_properties = d + return entity_get_all_child_uuids + + @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 diff --git a/kittycad/models/entity_get_child_uuid.py b/kittycad/models/entity_get_child_uuid.py new file mode 100644 index 000000000..ddff9d033 --- /dev/null +++ b/kittycad/models/entity_get_child_uuid.py @@ -0,0 +1,55 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +DO = TypeVar("DO", bound="EntityGetChildUuid") + + +@attr.s(auto_attribs=True) +class EntityGetChildUuid: + """The response from the `EntityGetChildUuid` command.""" # noqa: E501 + + entity_id: Union[Unset, str] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + entity_id = self.entity_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if entity_id is not UNSET: + field_dict["entity_id"] = entity_id + + return field_dict + + @classmethod + def from_dict(cls: Type[DO], src_dict: Dict[str, Any]) -> DO: + d = src_dict.copy() + entity_id = d.pop("entity_id", UNSET) + + entity_get_child_uuid = cls( + entity_id=entity_id, + ) + + entity_get_child_uuid.additional_properties = d + return entity_get_child_uuid + + @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 diff --git a/kittycad/models/entity_get_num_children.py b/kittycad/models/entity_get_num_children.py new file mode 100644 index 000000000..300740017 --- /dev/null +++ b/kittycad/models/entity_get_num_children.py @@ -0,0 +1,55 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +FZ = TypeVar("FZ", bound="EntityGetNumChildren") + + +@attr.s(auto_attribs=True) +class EntityGetNumChildren: + """The response from the `EntityGetNumChildren` command.""" # noqa: E501 + + num: Union[Unset, int] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + num = self.num + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if num is not UNSET: + field_dict["num"] = num + + return field_dict + + @classmethod + def from_dict(cls: Type[FZ], src_dict: Dict[str, Any]) -> FZ: + d = src_dict.copy() + num = d.pop("num", UNSET) + + entity_get_num_children = cls( + num=num, + ) + + entity_get_num_children.additional_properties = d + return entity_get_num_children + + @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 diff --git a/kittycad/models/entity_get_parent_id.py b/kittycad/models/entity_get_parent_id.py new file mode 100644 index 000000000..308a55d86 --- /dev/null +++ b/kittycad/models/entity_get_parent_id.py @@ -0,0 +1,55 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +GL = TypeVar("GL", bound="EntityGetParentId") + + +@attr.s(auto_attribs=True) +class EntityGetParentId: + """The response from the `EntityGetParentId` command.""" # noqa: E501 + + entity_id: Union[Unset, str] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + entity_id = self.entity_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if entity_id is not UNSET: + field_dict["entity_id"] = entity_id + + return field_dict + + @classmethod + def from_dict(cls: Type[GL], src_dict: Dict[str, Any]) -> GL: + d = src_dict.copy() + entity_id = d.pop("entity_id", UNSET) + + entity_get_parent_id = cls( + entity_id=entity_id, + ) + + entity_get_parent_id.additional_properties = d + return entity_get_parent_id + + @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 diff --git a/kittycad/models/entity_type.py b/kittycad/models/entity_type.py index 29fe398d9..05fe5c865 100644 --- a/kittycad/models/entity_type.py +++ b/kittycad/models/entity_type.py @@ -12,6 +12,7 @@ class EntityType(str, Enum): SOLID3D = "solid3d" EDGE = "edge" FACE = "face" + PLANE = "plane" def __str__(self) -> str: return str(self.value) diff --git a/kittycad/models/error.py b/kittycad/models/error.py index b5c8be571..3184703db 100644 --- a/kittycad/models/error.py +++ b/kittycad/models/error.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -LT = TypeVar("LT", bound="Error") +NN = TypeVar("NN", bound="Error") @attr.s(auto_attribs=True) @@ -35,7 +35,7 @@ class Error: return field_dict @classmethod - def from_dict(cls: Type[LT], src_dict: Dict[str, Any]) -> LT: + def from_dict(cls: Type[NN], src_dict: Dict[str, Any]) -> NN: d = src_dict.copy() error_code = d.pop("error_code", UNSET) diff --git a/kittycad/models/error_code.py b/kittycad/models/error_code.py index df2057b40..f35903ea5 100644 --- a/kittycad/models/error_code.py +++ b/kittycad/models/error_code.py @@ -2,12 +2,22 @@ from enum import Enum class ErrorCode(str, Enum): - """The type of errorcode.""" # noqa: E501 + """The type of error sent by the KittyCAD API.""" # noqa: E501 - """# User requested something impossible or invalid """ # noqa: E501 - BAD_REQUEST = "bad_request" - """# Engine failed to complete request, consider retrying """ # noqa: E501 + """# Graphics engine failed to complete request, consider retrying """ # noqa: E501 INTERNAL_ENGINE = "internal_engine" + """# API failed to complete request, consider retrying """ # noqa: E501 + INTERNAL_API = "internal_api" + """# User requested something geometrically or graphically impossible. Don't retry this request, as it's inherently impossible. Instead, read the error message and change your request. """ # noqa: E501 + BAD_REQUEST = "bad_request" + """# Client sent invalid JSON. """ # noqa: E501 + INVALID_JSON = "invalid_json" + """# Problem sending data between client and KittyCAD API. """ # noqa: E501 + CONNECTION_PROBLEM = "connection_problem" + """# Client sent a Websocket message type which the KittyCAD API does not handle. """ # noqa: E501 + MESSAGE_TYPE_NOT_ACCEPTED = "message_type_not_accepted" + """# Client sent a Websocket message intended for WebRTC but it was configured as a WebRTC connection. """ # noqa: E501 + MESSAGE_TYPE_NOT_ACCEPTED_FOR_WEB_R_T_C = "message_type_not_accepted_for_web_r_t_c" def __str__(self) -> str: return str(self.value) diff --git a/kittycad/models/executor_metadata.py b/kittycad/models/executor_metadata.py index 76f832ddc..778450ec8 100644 --- a/kittycad/models/executor_metadata.py +++ b/kittycad/models/executor_metadata.py @@ -6,7 +6,7 @@ from ..models.docker_system_info import DockerSystemInfo from ..models.environment import Environment from ..types import UNSET, Unset -YY = TypeVar("YY", bound="ExecutorMetadata") +OH = TypeVar("OH", bound="ExecutorMetadata") @attr.s(auto_attribs=True) @@ -41,7 +41,7 @@ class ExecutorMetadata: return field_dict @classmethod - def from_dict(cls: Type[YY], src_dict: Dict[str, Any]) -> YY: + def from_dict(cls: Type[OH], src_dict: Dict[str, Any]) -> OH: d = src_dict.copy() _docker_info = d.pop("docker_info", UNSET) docker_info: Union[Unset, DockerSystemInfo] diff --git a/kittycad/models/error_response.py b/kittycad/models/export.py similarity index 55% rename from kittycad/models/error_response.py rename to kittycad/models/export.py index 0a47be6b6..d874fbd61 100644 --- a/kittycad/models/error_response.py +++ b/kittycad/models/export.py @@ -4,47 +4,47 @@ import attr from ..types import UNSET, Unset -ED = TypeVar("ED", bound="ErrorResponse") +VI = TypeVar("VI", bound="Export") @attr.s(auto_attribs=True) -class ErrorResponse: - """The error response.""" # noqa: E501 +class Export: + """The response from the `Export` endpoint.""" # noqa: E501 - from ..models.engine_error import EngineError + from ..models.export_file import ExportFile - errors: Union[Unset, List[EngineError]] = UNSET + files: Union[Unset, List[ExportFile]] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - from ..models.engine_error import EngineError + from ..models.export_file import ExportFile - errors: Union[Unset, List[EngineError]] = UNSET - if not isinstance(self.errors, Unset): - errors = self.errors + files: Union[Unset, List[ExportFile]] = UNSET + if not isinstance(self.files, Unset): + files = self.files field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if errors is not UNSET: - field_dict["errors"] = errors + if files is not UNSET: + field_dict["files"] = files return field_dict @classmethod - def from_dict(cls: Type[ED], src_dict: Dict[str, Any]) -> ED: + def from_dict(cls: Type[VI], src_dict: Dict[str, Any]) -> VI: d = src_dict.copy() - from ..models.engine_error import EngineError + from ..models.export_file import ExportFile - errors = cast(List[EngineError], d.pop("errors", UNSET)) + files = cast(List[ExportFile], d.pop("files", UNSET)) - error_response = cls( - errors=errors, + export = cls( + files=files, ) - error_response.additional_properties = d - return error_response + export.additional_properties = d + return export @property def additional_keys(self) -> List[str]: diff --git a/kittycad/models/export_file.py b/kittycad/models/export_file.py index 94b858718..9e3756159 100644 --- a/kittycad/models/export_file.py +++ b/kittycad/models/export_file.py @@ -2,22 +2,25 @@ from typing import Any, Dict, List, Type, TypeVar, Union import attr +from ..models.base64data import Base64Data from ..types import UNSET, Unset -DO = TypeVar("DO", bound="ExportFile") +ET = TypeVar("ET", bound="ExportFile") @attr.s(auto_attribs=True) class ExportFile: """A file to be exported to the client.""" # noqa: E501 - contents: Union[Unset, str] = UNSET + contents: Union[Unset, Base64Data] = UNSET name: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - contents = self.contents + contents: Union[Unset, str] = UNSET + if not isinstance(self.contents, Unset): + contents = self.contents.get_encoded() name = self.name field_dict: Dict[str, Any] = {} @@ -31,9 +34,14 @@ class ExportFile: return field_dict @classmethod - def from_dict(cls: Type[DO], src_dict: Dict[str, Any]) -> DO: + def from_dict(cls: Type[ET], src_dict: Dict[str, Any]) -> ET: d = src_dict.copy() - contents = d.pop("contents", UNSET) + _contents = d.pop("contents", UNSET) + contents: Union[Unset, Base64Data] + if isinstance(_contents, Unset): + contents = UNSET + else: + contents = Base64Data(bytes(_contents, "utf-8")) name = d.pop("name", UNSET) diff --git a/kittycad/models/extended_user.py b/kittycad/models/extended_user.py index 0d355cbe0..b046f7558 100644 --- a/kittycad/models/extended_user.py +++ b/kittycad/models/extended_user.py @@ -6,7 +6,7 @@ from dateutil.parser import isoparse from ..types import UNSET, Unset -FZ = TypeVar("FZ", bound="ExtendedUser") +QF = TypeVar("QF", bound="ExtendedUser") @attr.s(auto_attribs=True) @@ -98,7 +98,7 @@ class ExtendedUser: return field_dict @classmethod - def from_dict(cls: Type[FZ], src_dict: Dict[str, Any]) -> FZ: + def from_dict(cls: Type[QF], src_dict: Dict[str, Any]) -> QF: d = src_dict.copy() company = d.pop("company", UNSET) diff --git a/kittycad/models/extended_user_results_page.py b/kittycad/models/extended_user_results_page.py index 70c4c9412..8e9632b77 100644 --- a/kittycad/models/extended_user_results_page.py +++ b/kittycad/models/extended_user_results_page.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -GL = TypeVar("GL", bound="ExtendedUserResultsPage") +DI = TypeVar("DI", bound="ExtendedUserResultsPage") @attr.s(auto_attribs=True) @@ -37,7 +37,7 @@ class ExtendedUserResultsPage: return field_dict @classmethod - def from_dict(cls: Type[GL], src_dict: Dict[str, Any]) -> GL: + def from_dict(cls: Type[DI], src_dict: Dict[str, Any]) -> DI: d = src_dict.copy() from ..models.extended_user import ExtendedUser diff --git a/kittycad/models/failure_web_socket_response.py b/kittycad/models/failure_web_socket_response.py new file mode 100644 index 000000000..f7aa3bea8 --- /dev/null +++ b/kittycad/models/failure_web_socket_response.py @@ -0,0 +1,77 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +import attr + +from ..types import UNSET, Unset + +OJ = TypeVar("OJ", bound="FailureWebSocketResponse") + + +@attr.s(auto_attribs=True) +class FailureWebSocketResponse: + """Unsuccessful Websocket response.""" # noqa: E501 + + from ..models.api_error import ApiError + + errors: Union[Unset, List[ApiError]] = UNSET + request_id: Union[Unset, str] = UNSET + success: Union[Unset, bool] = False + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + from ..models.api_error import ApiError + + errors: Union[Unset, List[ApiError]] = UNSET + if not isinstance(self.errors, Unset): + errors = self.errors + request_id = self.request_id + success = self.success + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if errors is not UNSET: + field_dict["errors"] = errors + if request_id is not UNSET: + field_dict["request_id"] = request_id + if success is not UNSET: + field_dict["success"] = success + + return field_dict + + @classmethod + def from_dict(cls: Type[OJ], src_dict: Dict[str, Any]) -> OJ: + d = src_dict.copy() + from ..models.api_error import ApiError + + errors = cast(List[ApiError], d.pop("errors", UNSET)) + + request_id = d.pop("request_id", UNSET) + + success = d.pop("success", UNSET) + + failure_web_socket_response = cls( + errors=errors, + request_id=request_id, + success=success, + ) + + failure_web_socket_response.additional_properties = d + return failure_web_socket_response + + @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 diff --git a/kittycad/models/fbx_storage.py b/kittycad/models/fbx_storage.py new file mode 100644 index 000000000..b3dc44cc4 --- /dev/null +++ b/kittycad/models/fbx_storage.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class FbxStorage(str, Enum): + """Describes the storage format of an FBX file.""" # noqa: E501 + + """# ASCII FBX encoding. """ # noqa: E501 + ASCII = "ascii" + """# Binary FBX encoding. """ # noqa: E501 + BINARY = "binary" + + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/file_center_of_mass.py b/kittycad/models/file_center_of_mass.py index 7dfadb670..86cefdc42 100644 --- a/kittycad/models/file_center_of_mass.py +++ b/kittycad/models/file_center_of_mass.py @@ -11,7 +11,7 @@ from ..models.unit_length import UnitLength from ..models.uuid import Uuid from ..types import UNSET, Unset -NN = TypeVar("NN", bound="FileCenterOfMass") +UF = TypeVar("UF", bound="FileCenterOfMass") @attr.s(auto_attribs=True) @@ -86,7 +86,7 @@ class FileCenterOfMass: return field_dict @classmethod - def from_dict(cls: Type[NN], src_dict: Dict[str, Any]) -> NN: + def from_dict(cls: Type[UF], src_dict: Dict[str, Any]) -> UF: d = src_dict.copy() _center_of_mass = d.pop("center_of_mass", UNSET) center_of_mass: Union[Unset, Point3d] diff --git a/kittycad/models/file_conversion.py b/kittycad/models/file_conversion.py index e3a13bcdb..2abf83bb5 100644 --- a/kittycad/models/file_conversion.py +++ b/kittycad/models/file_conversion.py @@ -5,6 +5,7 @@ import attr from dateutil.parser import isoparse from ..models.api_call_status import ApiCallStatus +from ..models.base64data import Base64Data from ..models.file_export_format import FileExportFormat from ..models.file_import_format import FileImportFormat from ..models.input_format import InputFormat @@ -12,7 +13,7 @@ from ..models.output_format import OutputFormat from ..models.uuid import Uuid from ..types import UNSET, Unset -OH = TypeVar("OH", bound="FileConversion") +YF = TypeVar("YF", bound="FileConversion") @attr.s(auto_attribs=True) @@ -23,10 +24,10 @@ class FileConversion: created_at: Union[Unset, datetime.datetime] = UNSET error: Union[Unset, str] = UNSET id: Union[Unset, str] = UNSET - output: Union[Unset, str] = UNSET + output: Union[Unset, Base64Data] = UNSET output_format: Union[Unset, FileExportFormat] = UNSET output_format_options: Union[Unset, OutputFormat] = UNSET - outputs: Union[Unset, Any] = UNSET + outputs: Union[Unset, Dict[str, Base64Data]] = UNSET src_format: Union[Unset, FileImportFormat] = UNSET src_format_options: Union[Unset, InputFormat] = UNSET started_at: Union[Unset, datetime.datetime] = UNSET @@ -45,12 +46,19 @@ class FileConversion: created_at = self.created_at.isoformat() error = self.error id = self.id - output = self.output + output: Union[Unset, str] = UNSET + if not isinstance(self.output, Unset): + output = self.output.get_encoded() if not isinstance(self.output_format, Unset): output_format = self.output_format if not isinstance(self.output_format_options, Unset): output_format_options = self.output_format_options - outputs = self.outputs + outputs: Union[Unset, Dict[str, str]] = UNSET + if not isinstance(self.outputs, Unset): + new_dict: Dict[str, str] = {} + for key, value in self.outputs.items(): + new_dict[key] = value.get_encoded() + outputs = new_dict if not isinstance(self.src_format, Unset): src_format = self.src_format if not isinstance(self.src_format_options, Unset): @@ -100,7 +108,7 @@ class FileConversion: return field_dict @classmethod - def from_dict(cls: Type[OH], src_dict: Dict[str, Any]) -> OH: + def from_dict(cls: Type[YF], src_dict: Dict[str, Any]) -> YF: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] @@ -125,7 +133,12 @@ class FileConversion: else: id = _id # type: ignore[arg-type] - output = d.pop("output", UNSET) + _output = d.pop("output", UNSET) + output: Union[Unset, Base64Data] + if isinstance(_output, Unset): + output = UNSET + else: + output = Base64Data(bytes(_output, "utf-8")) _output_format = d.pop("output_format", UNSET) output_format: Union[Unset, FileExportFormat] @@ -141,7 +154,15 @@ class FileConversion: else: output_format_options = _output_format_options # type: ignore[arg-type] - outputs = d.pop("outputs", UNSET) + _outputs = d.pop("outputs", UNSET) + if isinstance(_outputs, Unset): + outputs = UNSET + else: + new_map: Dict[str, Base64Data] = {} + for k, v in _outputs.items(): + new_map[k] = Base64Data(bytes(v, "utf-8")) + outputs = new_map # type: ignore + _src_format = d.pop("src_format", UNSET) src_format: Union[Unset, FileImportFormat] if isinstance(_src_format, Unset): diff --git a/kittycad/models/file_density.py b/kittycad/models/file_density.py index 3a8f029db..ae7f3fe0a 100644 --- a/kittycad/models/file_density.py +++ b/kittycad/models/file_density.py @@ -11,7 +11,7 @@ from ..models.unit_mass import UnitMass from ..models.uuid import Uuid from ..types import UNSET, Unset -VI = TypeVar("VI", bound="FileDensity") +PY = TypeVar("PY", bound="FileDensity") @attr.s(auto_attribs=True) @@ -94,7 +94,7 @@ class FileDensity: return field_dict @classmethod - def from_dict(cls: Type[VI], src_dict: Dict[str, Any]) -> VI: + def from_dict(cls: Type[PY], src_dict: Dict[str, Any]) -> PY: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/file_export_format.py b/kittycad/models/file_export_format.py index 37d7658b1..d1eee8886 100644 --- a/kittycad/models/file_export_format.py +++ b/kittycad/models/file_export_format.py @@ -4,7 +4,21 @@ from enum import Enum class FileExportFormat(str, Enum): """The valid types of output file formats.""" # noqa: E501 - """# glTF 2.0. We refer to this as glTF since that is how our customers refer to it, although by default it will be in binary format and thus technically (glb). """ # noqa: E501 + """# Autodesk Filmbox (FBX) format. """ # noqa: E501 + FBX = "fbx" + """# Binary glTF 2.0. + +This is a single binary with .glb extension. + +This is better if you want a compressed format as opposed to the human readable glTF that lacks compression. """ # noqa: E501 + GLB = "glb" + """# glTF 2.0. Embedded glTF 2.0 (pretty printed). + +Single JSON file with .gltf extension binary data encoded as base64 data URIs. + +The JSON contents are pretty printed. + +It is human readable, single file, and you can view the diff easily in a git commit. """ # noqa: E501 GLTF = "gltf" """# The OBJ file format. It may or may not have an an attached material (mtl // mtllib) within the file, but we interact with it as if it does not. """ # noqa: E501 OBJ = "obj" diff --git a/kittycad/models/file_import_format.py b/kittycad/models/file_import_format.py index 1a484317e..61867d9ed 100644 --- a/kittycad/models/file_import_format.py +++ b/kittycad/models/file_import_format.py @@ -4,6 +4,8 @@ from enum import Enum class FileImportFormat(str, Enum): """The valid types of source file formats.""" # noqa: E501 + """# Autodesk Filmbox (FBX) format. """ # noqa: E501 + FBX = "fbx" """# glTF 2.0. """ # noqa: E501 GLTF = "gltf" """# The OBJ file format. It may or may not have an an attached material (mtl // mtllib) within the file, but we interact with it as if it does not. """ # noqa: E501 diff --git a/kittycad/models/file_mass.py b/kittycad/models/file_mass.py index fcf6ca3e2..ad5b9c061 100644 --- a/kittycad/models/file_mass.py +++ b/kittycad/models/file_mass.py @@ -11,7 +11,7 @@ from ..models.unit_mass import UnitMass from ..models.uuid import Uuid from ..types import UNSET, Unset -ET = TypeVar("ET", bound="FileMass") +LK = TypeVar("LK", bound="FileMass") @attr.s(auto_attribs=True) @@ -94,7 +94,7 @@ class FileMass: return field_dict @classmethod - def from_dict(cls: Type[ET], src_dict: Dict[str, Any]) -> ET: + def from_dict(cls: Type[LK], src_dict: Dict[str, Any]) -> LK: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/file_surface_area.py b/kittycad/models/file_surface_area.py index aa32beaa4..284d73b4b 100644 --- a/kittycad/models/file_surface_area.py +++ b/kittycad/models/file_surface_area.py @@ -10,7 +10,7 @@ from ..models.unit_area import UnitArea from ..models.uuid import Uuid from ..types import UNSET, Unset -QF = TypeVar("QF", bound="FileSurfaceArea") +AR = TypeVar("AR", bound="FileSurfaceArea") @attr.s(auto_attribs=True) @@ -84,7 +84,7 @@ class FileSurfaceArea: return field_dict @classmethod - def from_dict(cls: Type[QF], src_dict: Dict[str, Any]) -> QF: + def from_dict(cls: Type[AR], src_dict: Dict[str, Any]) -> AR: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/file_system_metadata.py b/kittycad/models/file_system_metadata.py index 6b58acb77..a67b0ecdf 100644 --- a/kittycad/models/file_system_metadata.py +++ b/kittycad/models/file_system_metadata.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -DI = TypeVar("DI", bound="FileSystemMetadata") +WB = TypeVar("WB", bound="FileSystemMetadata") @attr.s(auto_attribs=True) @@ -29,7 +29,7 @@ class FileSystemMetadata: return field_dict @classmethod - def from_dict(cls: Type[DI], src_dict: Dict[str, Any]) -> DI: + def from_dict(cls: Type[WB], src_dict: Dict[str, Any]) -> WB: d = src_dict.copy() ok = d.pop("ok", UNSET) diff --git a/kittycad/models/file_volume.py b/kittycad/models/file_volume.py index 10b737bf1..dca014bd9 100644 --- a/kittycad/models/file_volume.py +++ b/kittycad/models/file_volume.py @@ -10,7 +10,7 @@ from ..models.unit_volume import UnitVolume from ..models.uuid import Uuid from ..types import UNSET, Unset -OJ = TypeVar("OJ", bound="FileVolume") +KK = TypeVar("KK", bound="FileVolume") @attr.s(auto_attribs=True) @@ -84,7 +84,7 @@ class FileVolume: return field_dict @classmethod - def from_dict(cls: Type[OJ], src_dict: Dict[str, Any]) -> OJ: + def from_dict(cls: Type[KK], src_dict: Dict[str, Any]) -> KK: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/gateway.py b/kittycad/models/gateway.py index 247c63847..53df24f99 100644 --- a/kittycad/models/gateway.py +++ b/kittycad/models/gateway.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -UF = TypeVar("UF", bound="Gateway") +HC = TypeVar("HC", bound="Gateway") @attr.s(auto_attribs=True) @@ -43,7 +43,7 @@ class Gateway: return field_dict @classmethod - def from_dict(cls: Type[UF], src_dict: Dict[str, Any]) -> UF: + def from_dict(cls: Type[HC], src_dict: Dict[str, Any]) -> HC: d = src_dict.copy() auth_timeout = d.pop("auth_timeout", UNSET) diff --git a/kittycad/models/get_entity_type.py b/kittycad/models/get_entity_type.py new file mode 100644 index 000000000..0c3355ae2 --- /dev/null +++ b/kittycad/models/get_entity_type.py @@ -0,0 +1,62 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..models.entity_type import EntityType +from ..types import UNSET, Unset + +FM = TypeVar("FM", bound="GetEntityType") + + +@attr.s(auto_attribs=True) +class GetEntityType: + """The response from the `GetEntityType` command.""" # noqa: E501 + + entity_type: Union[Unset, EntityType] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.entity_type, Unset): + entity_type = self.entity_type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if entity_type is not UNSET: + field_dict["entity_type"] = entity_type + + return field_dict + + @classmethod + def from_dict(cls: Type[FM], src_dict: Dict[str, Any]) -> FM: + d = src_dict.copy() + _entity_type = d.pop("entity_type", UNSET) + entity_type: Union[Unset, EntityType] + if isinstance(_entity_type, Unset): + entity_type = UNSET + else: + entity_type = _entity_type # type: ignore[arg-type] + + get_entity_type = cls( + entity_type=entity_type, + ) + + get_entity_type.additional_properties = d + return get_entity_type + + @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 diff --git a/kittycad/models/gltf_presentation.py b/kittycad/models/gltf_presentation.py new file mode 100644 index 000000000..95c38a630 --- /dev/null +++ b/kittycad/models/gltf_presentation.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class GltfPresentation(str, Enum): + """Describes the presentation style of the glTF JSON.""" # noqa: E501 + + """# Condense the JSON into the smallest possible size. """ # noqa: E501 + COMPACT = "compact" + """# Expand the JSON into a more human readable format. + +This is the default setting. """ # noqa: E501 + PRETTY = "pretty" + + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/storage.py b/kittycad/models/gltf_storage.py similarity index 83% rename from kittycad/models/storage.py rename to kittycad/models/gltf_storage.py index 0e02752aa..525b7320b 100644 --- a/kittycad/models/storage.py +++ b/kittycad/models/gltf_storage.py @@ -1,14 +1,12 @@ from enum import Enum -class Storage(str, Enum): +class GltfStorage(str, Enum): """Describes the storage format of a glTF 2.0 scene.""" # noqa: E501 """# Binary glTF 2.0. -This is a single binary with .glb extension. - -This is the default setting. """ # noqa: E501 +This is a single binary with .glb extension. """ # noqa: E501 BINARY = "binary" """# Standard glTF 2.0. @@ -16,7 +14,9 @@ This is a JSON file with .gltf extension paired with a separate binary blob file STANDARD = "standard" """# Embedded glTF 2.0. -Single JSON file with .gltf extension binary data encoded as base64 data URIs. """ # noqa: E501 +Single JSON file with .gltf extension binary data encoded as base64 data URIs. + +This is the default setting. """ # noqa: E501 EMBEDDED = "embedded" def __str__(self) -> str: diff --git a/kittycad/models/highlight_set_entity.py b/kittycad/models/highlight_set_entity.py new file mode 100644 index 000000000..ad81baa8f --- /dev/null +++ b/kittycad/models/highlight_set_entity.py @@ -0,0 +1,62 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +PV = TypeVar("PV", bound="HighlightSetEntity") + + +@attr.s(auto_attribs=True) +class HighlightSetEntity: + """The response from the `HighlightSetEntity` command.""" # noqa: E501 + + entity_id: Union[Unset, str] = UNSET + sequence: Union[Unset, int] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + entity_id = self.entity_id + sequence = self.sequence + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if entity_id is not UNSET: + field_dict["entity_id"] = entity_id + if sequence is not UNSET: + field_dict["sequence"] = sequence + + return field_dict + + @classmethod + def from_dict(cls: Type[PV], src_dict: Dict[str, Any]) -> PV: + d = src_dict.copy() + entity_id = d.pop("entity_id", UNSET) + + sequence = d.pop("sequence", UNSET) + + highlight_set_entity = cls( + entity_id=entity_id, + sequence=sequence, + ) + + highlight_set_entity.additional_properties = d + return highlight_set_entity + + @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 diff --git a/kittycad/models/ice_server.py b/kittycad/models/ice_server.py index 83ce22bb3..c8a24bdb4 100644 --- a/kittycad/models/ice_server.py +++ b/kittycad/models/ice_server.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -YF = TypeVar("YF", bound="IceServer") +QI = TypeVar("QI", bound="IceServer") @attr.s(auto_attribs=True) @@ -37,7 +37,7 @@ class IceServer: return field_dict @classmethod - def from_dict(cls: Type[YF], src_dict: Dict[str, Any]) -> YF: + def from_dict(cls: Type[QI], src_dict: Dict[str, Any]) -> QI: d = src_dict.copy() credential = d.pop("credential", UNSET) diff --git a/kittycad/models/image_format.py b/kittycad/models/image_format.py new file mode 100644 index 000000000..01671688a --- /dev/null +++ b/kittycad/models/image_format.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class ImageFormat(str, Enum): + """Enum containing the variety of image formats snapshots may be exported to.""" # noqa: E501 + + """# .png format """ # noqa: E501 + PNG = "png" + """# .jpeg format """ # noqa: E501 + JPEG = "jpeg" + + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/index_info.py b/kittycad/models/index_info.py index 227f7190e..d03b953b7 100644 --- a/kittycad/models/index_info.py +++ b/kittycad/models/index_info.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -PY = TypeVar("PY", bound="IndexInfo") +TP = TypeVar("TP", bound="IndexInfo") @attr.s(auto_attribs=True) @@ -41,7 +41,7 @@ class IndexInfo: return field_dict @classmethod - def from_dict(cls: Type[PY], src_dict: Dict[str, Any]) -> PY: + def from_dict(cls: Type[TP], src_dict: Dict[str, Any]) -> TP: d = src_dict.copy() mirrors = cast(List[str], d.pop("mirrors", UNSET)) diff --git a/kittycad/models/input_format.py b/kittycad/models/input_format.py index eb040aa1c..b998f4e42 100644 --- a/kittycad/models/input_format.py +++ b/kittycad/models/input_format.py @@ -6,7 +6,57 @@ from ..models.system import System from ..models.unit_length import UnitLength from ..types import UNSET, Unset -LK = TypeVar("LK", bound="gltf") +CF = TypeVar("CF", bound="fbx") + + +@attr.s(auto_attribs=True) +class fbx: + """Autodesk Filmbox (FBX) format.""" # noqa: E501 + + type: str = "fbx" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[CF], src_dict: Dict[str, Any]) -> CF: + d = src_dict.copy() + type = d.pop("type", UNSET) + + fbx = cls( + type=type, + ) + + fbx.additional_properties = d + return fbx + + @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 + + +OM = TypeVar("OM", bound="gltf") @attr.s(auto_attribs=True) @@ -28,7 +78,7 @@ class gltf: return field_dict @classmethod - def from_dict(cls: Type[LK], src_dict: Dict[str, Any]) -> LK: + def from_dict(cls: Type[OM], src_dict: Dict[str, Any]) -> OM: d = src_dict.copy() type = d.pop("type", UNSET) @@ -56,7 +106,7 @@ class gltf: return key in self.additional_properties -AR = TypeVar("AR", bound="step") +EN = TypeVar("EN", bound="step") @attr.s(auto_attribs=True) @@ -78,7 +128,7 @@ class step: return field_dict @classmethod - def from_dict(cls: Type[AR], src_dict: Dict[str, Any]) -> AR: + def from_dict(cls: Type[EN], src_dict: Dict[str, Any]) -> EN: d = src_dict.copy() type = d.pop("type", UNSET) @@ -106,7 +156,7 @@ class step: return key in self.additional_properties -WB = TypeVar("WB", bound="obj") +RS = TypeVar("RS", bound="obj") @attr.s(auto_attribs=True) @@ -138,7 +188,7 @@ class obj: return field_dict @classmethod - def from_dict(cls: Type[WB], src_dict: Dict[str, Any]) -> WB: + def from_dict(cls: Type[RS], src_dict: Dict[str, Any]) -> RS: d = src_dict.copy() _coords = d.pop("coords", UNSET) coords: Union[Unset, System] @@ -182,7 +232,7 @@ class obj: return key in self.additional_properties -KK = TypeVar("KK", bound="ply") +LR = TypeVar("LR", bound="ply") @attr.s(auto_attribs=True) @@ -214,7 +264,7 @@ class ply: return field_dict @classmethod - def from_dict(cls: Type[KK], src_dict: Dict[str, Any]) -> KK: + def from_dict(cls: Type[LR], src_dict: Dict[str, Any]) -> LR: d = src_dict.copy() _coords = d.pop("coords", UNSET) coords: Union[Unset, System] @@ -258,7 +308,7 @@ class ply: return key in self.additional_properties -HC = TypeVar("HC", bound="stl") +MP = TypeVar("MP", bound="stl") @attr.s(auto_attribs=True) @@ -290,7 +340,7 @@ class stl: return field_dict @classmethod - def from_dict(cls: Type[HC], src_dict: Dict[str, Any]) -> HC: + def from_dict(cls: Type[MP], src_dict: Dict[str, Any]) -> MP: d = src_dict.copy() _coords = d.pop("coords", UNSET) coords: Union[Unset, System] @@ -334,4 +384,4 @@ class stl: return key in self.additional_properties -InputFormat = Union[gltf, step, obj, ply, stl] +InputFormat = Union[fbx, gltf, step, obj, ply, stl] diff --git a/kittycad/models/invoice.py b/kittycad/models/invoice.py index 3be79aefa..692808583 100644 --- a/kittycad/models/invoice.py +++ b/kittycad/models/invoice.py @@ -8,7 +8,7 @@ from ..models.currency import Currency from ..models.invoice_status import InvoiceStatus from ..types import UNSET, Unset -FM = TypeVar("FM", bound="Invoice") +WF = TypeVar("WF", bound="Invoice") @attr.s(auto_attribs=True) @@ -33,7 +33,7 @@ class Invoice: from ..models.invoice_line_item import InvoiceLineItem lines: Union[Unset, List[InvoiceLineItem]] = UNSET - metadata: Union[Unset, Any] = UNSET + metadata: Union[Unset, Dict[str, str]] = UNSET number: Union[Unset, str] = UNSET paid: Union[Unset, bool] = False pdf: Union[Unset, str] = UNSET @@ -74,6 +74,7 @@ class Invoice: if not isinstance(self.lines, Unset): lines = self.lines metadata = self.metadata + number = self.number paid = self.paid pdf = self.pdf @@ -143,7 +144,7 @@ class Invoice: return field_dict @classmethod - def from_dict(cls: Type[FM], src_dict: Dict[str, Any]) -> FM: + def from_dict(cls: Type[WF], src_dict: Dict[str, Any]) -> WF: d = src_dict.copy() amount_due = d.pop("amount_due", UNSET) @@ -188,6 +189,7 @@ class Invoice: lines = cast(List[InvoiceLineItem], d.pop("lines", UNSET)) metadata = d.pop("metadata", UNSET) + number = d.pop("number", UNSET) paid = d.pop("paid", UNSET) diff --git a/kittycad/models/invoice_line_item.py b/kittycad/models/invoice_line_item.py index d6d6ff3d7..bff78faef 100644 --- a/kittycad/models/invoice_line_item.py +++ b/kittycad/models/invoice_line_item.py @@ -5,7 +5,7 @@ import attr from ..models.currency import Currency from ..types import UNSET, Unset -PV = TypeVar("PV", bound="InvoiceLineItem") +RO = TypeVar("RO", bound="InvoiceLineItem") @attr.s(auto_attribs=True) @@ -17,7 +17,7 @@ class InvoiceLineItem: description: Union[Unset, str] = UNSET id: Union[Unset, str] = UNSET invoice_item: Union[Unset, str] = UNSET - metadata: Union[Unset, Any] = UNSET + metadata: Union[Unset, Dict[str, str]] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) @@ -49,7 +49,7 @@ class InvoiceLineItem: return field_dict @classmethod - def from_dict(cls: Type[PV], src_dict: Dict[str, Any]) -> PV: + def from_dict(cls: Type[RO], src_dict: Dict[str, Any]) -> RO: d = src_dict.copy() amount = d.pop("amount", UNSET) diff --git a/kittycad/models/jetstream.py b/kittycad/models/jetstream.py index 5e8898a93..486ba560c 100644 --- a/kittycad/models/jetstream.py +++ b/kittycad/models/jetstream.py @@ -7,7 +7,7 @@ from ..models.jetstream_stats import JetstreamStats from ..models.meta_cluster_info import MetaClusterInfo from ..types import UNSET, Unset -QI = TypeVar("QI", bound="Jetstream") +DN = TypeVar("DN", bound="Jetstream") @attr.s(auto_attribs=True) @@ -41,7 +41,7 @@ class Jetstream: return field_dict @classmethod - def from_dict(cls: Type[QI], src_dict: Dict[str, Any]) -> QI: + def from_dict(cls: Type[DN], src_dict: Dict[str, Any]) -> DN: d = src_dict.copy() _config = d.pop("config", UNSET) config: Union[Unset, JetstreamConfig] diff --git a/kittycad/models/jetstream_api_stats.py b/kittycad/models/jetstream_api_stats.py index 9bfca10c6..a4ac53014 100644 --- a/kittycad/models/jetstream_api_stats.py +++ b/kittycad/models/jetstream_api_stats.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -TP = TypeVar("TP", bound="JetstreamApiStats") +BA = TypeVar("BA", bound="JetstreamApiStats") @attr.s(auto_attribs=True) @@ -35,7 +35,7 @@ class JetstreamApiStats: return field_dict @classmethod - def from_dict(cls: Type[TP], src_dict: Dict[str, Any]) -> TP: + def from_dict(cls: Type[BA], src_dict: Dict[str, Any]) -> BA: d = src_dict.copy() errors = d.pop("errors", UNSET) diff --git a/kittycad/models/jetstream_config.py b/kittycad/models/jetstream_config.py index 42017a1ce..a0437f356 100644 --- a/kittycad/models/jetstream_config.py +++ b/kittycad/models/jetstream_config.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -CF = TypeVar("CF", bound="JetstreamConfig") +OR = TypeVar("OR", bound="JetstreamConfig") @attr.s(auto_attribs=True) @@ -39,7 +39,7 @@ class JetstreamConfig: return field_dict @classmethod - def from_dict(cls: Type[CF], src_dict: Dict[str, Any]) -> CF: + def from_dict(cls: Type[OR], src_dict: Dict[str, Any]) -> OR: d = src_dict.copy() domain = d.pop("domain", UNSET) diff --git a/kittycad/models/jetstream_stats.py b/kittycad/models/jetstream_stats.py index 5964bab61..82408dd1e 100644 --- a/kittycad/models/jetstream_stats.py +++ b/kittycad/models/jetstream_stats.py @@ -5,7 +5,7 @@ import attr from ..models.jetstream_api_stats import JetstreamApiStats from ..types import UNSET, Unset -OM = TypeVar("OM", bound="JetstreamStats") +CB = TypeVar("CB", bound="JetstreamStats") @attr.s(auto_attribs=True) @@ -53,7 +53,7 @@ class JetstreamStats: return field_dict @classmethod - def from_dict(cls: Type[OM], src_dict: Dict[str, Any]) -> OM: + def from_dict(cls: Type[CB], src_dict: Dict[str, Any]) -> CB: d = src_dict.copy() accounts = d.pop("accounts", UNSET) diff --git a/kittycad/models/leaf_node.py b/kittycad/models/leaf_node.py index c37ed318f..844e1d309 100644 --- a/kittycad/models/leaf_node.py +++ b/kittycad/models/leaf_node.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -EN = TypeVar("EN", bound="LeafNode") +LC = TypeVar("LC", bound="LeafNode") @attr.s(auto_attribs=True) @@ -39,7 +39,7 @@ class LeafNode: return field_dict @classmethod - def from_dict(cls: Type[EN], src_dict: Dict[str, Any]) -> EN: + def from_dict(cls: Type[LC], src_dict: Dict[str, Any]) -> LC: d = src_dict.copy() auth_timeout = d.pop("auth_timeout", UNSET) diff --git a/kittycad/models/mesh.py b/kittycad/models/mesh.py index 4b4e338d9..c5369c106 100644 --- a/kittycad/models/mesh.py +++ b/kittycad/models/mesh.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -RS = TypeVar("RS", bound="Mesh") +TO = TypeVar("TO", bound="Mesh") @attr.s(auto_attribs=True) @@ -25,7 +25,7 @@ class Mesh: return field_dict @classmethod - def from_dict(cls: Type[RS], src_dict: Dict[str, Any]) -> RS: + def from_dict(cls: Type[TO], src_dict: Dict[str, Any]) -> TO: d = src_dict.copy() mesh = d.pop("mesh", UNSET) diff --git a/kittycad/models/meta_cluster_info.py b/kittycad/models/meta_cluster_info.py index b8fb798f1..50609db74 100644 --- a/kittycad/models/meta_cluster_info.py +++ b/kittycad/models/meta_cluster_info.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -LR = TypeVar("LR", bound="MetaClusterInfo") +ZP = TypeVar("ZP", bound="MetaClusterInfo") @attr.s(auto_attribs=True) @@ -35,7 +35,7 @@ class MetaClusterInfo: return field_dict @classmethod - def from_dict(cls: Type[LR], src_dict: Dict[str, Any]) -> LR: + def from_dict(cls: Type[ZP], src_dict: Dict[str, Any]) -> ZP: d = src_dict.copy() cluster_size = d.pop("cluster_size", UNSET) diff --git a/kittycad/models/metadata.py b/kittycad/models/metadata.py index 5b891abf5..59c1cdeba 100644 --- a/kittycad/models/metadata.py +++ b/kittycad/models/metadata.py @@ -11,7 +11,7 @@ from ..models.file_system_metadata import FileSystemMetadata from ..models.point_e_metadata import PointEMetadata from ..types import UNSET, Unset -MP = TypeVar("MP", bound="Metadata") +EO = TypeVar("EO", bound="Metadata") @attr.s(auto_attribs=True) @@ -71,7 +71,7 @@ class Metadata: return field_dict @classmethod - def from_dict(cls: Type[MP], src_dict: Dict[str, Any]) -> MP: + def from_dict(cls: Type[EO], src_dict: Dict[str, Any]) -> EO: d = src_dict.copy() _cache = d.pop("cache", UNSET) cache: Union[Unset, CacheMetadata] diff --git a/kittycad/models/modeling_cmd.py b/kittycad/models/modeling_cmd.py index cc9721c92..82c95db5a 100644 --- a/kittycad/models/modeling_cmd.py +++ b/kittycad/models/modeling_cmd.py @@ -5,15 +5,18 @@ import attr from ..models.annotation_options import AnnotationOptions from ..models.annotation_type import AnnotationType from ..models.camera_drag_interaction_type import CameraDragInteractionType +from ..models.color import Color +from ..models.image_format import ImageFormat from ..models.modeling_cmd_id import ModelingCmdId from ..models.output_format import OutputFormat from ..models.path_segment import PathSegment from ..models.point2d import Point2d from ..models.point3d import Point3d from ..models.scene_selection_type import SceneSelectionType +from ..models.scene_tool_type import SceneToolType from ..types import UNSET, Unset -WF = TypeVar("WF", bound="start_path") +NY = TypeVar("NY", bound="start_path") @attr.s(auto_attribs=True) @@ -35,7 +38,7 @@ class start_path: return field_dict @classmethod - def from_dict(cls: Type[WF], src_dict: Dict[str, Any]) -> WF: + def from_dict(cls: Type[NY], src_dict: Dict[str, Any]) -> NY: d = src_dict.copy() type = d.pop("type", UNSET) @@ -63,7 +66,7 @@ class start_path: return key in self.additional_properties -RO = TypeVar("RO", bound="move_path_pen") +QO = TypeVar("QO", bound="move_path_pen") @attr.s(auto_attribs=True) @@ -95,7 +98,7 @@ class move_path_pen: return field_dict @classmethod - def from_dict(cls: Type[RO], src_dict: Dict[str, Any]) -> RO: + def from_dict(cls: Type[QO], src_dict: Dict[str, Any]) -> QO: d = src_dict.copy() _path = d.pop("path", UNSET) path: Union[Unset, ModelingCmdId] @@ -139,7 +142,7 @@ class move_path_pen: return key in self.additional_properties -DN = TypeVar("DN", bound="extend_path") +KX = TypeVar("KX", bound="extend_path") @attr.s(auto_attribs=True) @@ -171,7 +174,7 @@ class extend_path: return field_dict @classmethod - def from_dict(cls: Type[DN], src_dict: Dict[str, Any]) -> DN: + def from_dict(cls: Type[KX], src_dict: Dict[str, Any]) -> KX: d = src_dict.copy() _path = d.pop("path", UNSET) path: Union[Unset, ModelingCmdId] @@ -215,7 +218,7 @@ class extend_path: return key in self.additional_properties -BA = TypeVar("BA", bound="extrude") +IZ = TypeVar("IZ", bound="extrude") @attr.s(auto_attribs=True) @@ -250,7 +253,7 @@ class extrude: return field_dict @classmethod - def from_dict(cls: Type[BA], src_dict: Dict[str, Any]) -> BA: + def from_dict(cls: Type[IZ], src_dict: Dict[str, Any]) -> IZ: d = src_dict.copy() cap = d.pop("cap", UNSET) @@ -292,7 +295,7 @@ class extrude: return key in self.additional_properties -OR = TypeVar("OR", bound="close_path") +WO = TypeVar("WO", bound="close_path") @attr.s(auto_attribs=True) @@ -318,7 +321,7 @@ class close_path: return field_dict @classmethod - def from_dict(cls: Type[OR], src_dict: Dict[str, Any]) -> OR: + def from_dict(cls: Type[WO], src_dict: Dict[str, Any]) -> WO: d = src_dict.copy() path_id = d.pop("path_id", UNSET) @@ -349,7 +352,7 @@ class close_path: return key in self.additional_properties -CB = TypeVar("CB", bound="camera_drag_start") +NK = TypeVar("NK", bound="camera_drag_start") @attr.s(auto_attribs=True) @@ -381,7 +384,7 @@ class camera_drag_start: return field_dict @classmethod - def from_dict(cls: Type[CB], src_dict: Dict[str, Any]) -> CB: + def from_dict(cls: Type[NK], src_dict: Dict[str, Any]) -> NK: d = src_dict.copy() _interaction = d.pop("interaction", UNSET) interaction: Union[Unset, CameraDragInteractionType] @@ -425,7 +428,7 @@ class camera_drag_start: return key in self.additional_properties -LC = TypeVar("LC", bound="camera_drag_move") +UQ = TypeVar("UQ", bound="camera_drag_move") @attr.s(auto_attribs=True) @@ -461,7 +464,7 @@ class camera_drag_move: return field_dict @classmethod - def from_dict(cls: Type[LC], src_dict: Dict[str, Any]) -> LC: + def from_dict(cls: Type[UQ], src_dict: Dict[str, Any]) -> UQ: d = src_dict.copy() _interaction = d.pop("interaction", UNSET) interaction: Union[Unset, CameraDragInteractionType] @@ -508,7 +511,7 @@ class camera_drag_move: return key in self.additional_properties -TO = TypeVar("TO", bound="camera_drag_end") +QE = TypeVar("QE", bound="camera_drag_end") @attr.s(auto_attribs=True) @@ -540,7 +543,7 @@ class camera_drag_end: return field_dict @classmethod - def from_dict(cls: Type[TO], src_dict: Dict[str, Any]) -> TO: + def from_dict(cls: Type[QE], src_dict: Dict[str, Any]) -> QE: d = src_dict.copy() _interaction = d.pop("interaction", UNSET) interaction: Union[Unset, CameraDragInteractionType] @@ -584,7 +587,7 @@ class camera_drag_end: return key in self.additional_properties -ZP = TypeVar("ZP", bound="default_camera_look_at") +XH = TypeVar("XH", bound="default_camera_look_at") @attr.s(auto_attribs=True) @@ -621,7 +624,7 @@ class default_camera_look_at: return field_dict @classmethod - def from_dict(cls: Type[ZP], src_dict: Dict[str, Any]) -> ZP: + def from_dict(cls: Type[XH], src_dict: Dict[str, Any]) -> XH: d = src_dict.copy() _center = d.pop("center", UNSET) center: Union[Unset, Point3d] @@ -673,7 +676,64 @@ class default_camera_look_at: return key in self.additional_properties -EO = TypeVar("EO", bound="default_camera_enable_sketch_mode") +KT = TypeVar("KT", bound="default_camera_zoom") + + +@attr.s(auto_attribs=True) +class default_camera_zoom: + """Adjust zoom of the default camera.""" # noqa: E501 + + magnitude: Union[Unset, float] = UNSET + type: str = "default_camera_zoom" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + magnitude = self.magnitude + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if magnitude is not UNSET: + field_dict["magnitude"] = magnitude + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[KT], src_dict: Dict[str, Any]) -> KT: + d = src_dict.copy() + magnitude = d.pop("magnitude", UNSET) + + type = d.pop("type", UNSET) + + default_camera_zoom = cls( + magnitude=magnitude, + type=type, + ) + + default_camera_zoom.additional_properties = d + return default_camera_zoom + + @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 + + +BV = TypeVar("BV", bound="default_camera_enable_sketch_mode") @attr.s(auto_attribs=True) @@ -722,7 +782,7 @@ class default_camera_enable_sketch_mode: return field_dict @classmethod - def from_dict(cls: Type[EO], src_dict: Dict[str, Any]) -> EO: + def from_dict(cls: Type[BV], src_dict: Dict[str, Any]) -> BV: d = src_dict.copy() animated = d.pop("animated", UNSET) @@ -783,7 +843,7 @@ class default_camera_enable_sketch_mode: return key in self.additional_properties -NY = TypeVar("NY", bound="default_camera_disable_sketch_mode") +GU = TypeVar("GU", bound="default_camera_disable_sketch_mode") @attr.s(auto_attribs=True) @@ -805,7 +865,7 @@ class default_camera_disable_sketch_mode: return field_dict @classmethod - def from_dict(cls: Type[NY], src_dict: Dict[str, Any]) -> NY: + def from_dict(cls: Type[GU], src_dict: Dict[str, Any]) -> GU: d = src_dict.copy() type = d.pop("type", UNSET) @@ -833,7 +893,7 @@ class default_camera_disable_sketch_mode: return key in self.additional_properties -QO = TypeVar("QO", bound="export") +SS = TypeVar("SS", bound="export") @attr.s(auto_attribs=True) @@ -866,7 +926,7 @@ class export: return field_dict @classmethod - def from_dict(cls: Type[QO], src_dict: Dict[str, Any]) -> QO: + def from_dict(cls: Type[SS], src_dict: Dict[str, Any]) -> SS: d = src_dict.copy() entity_ids = cast(List[str], d.pop("entity_ids", UNSET)) @@ -905,7 +965,7 @@ class export: return key in self.additional_properties -KX = TypeVar("KX", bound="entity_get_parent_id") +UP = TypeVar("UP", bound="entity_get_parent_id") @attr.s(auto_attribs=True) @@ -931,7 +991,7 @@ class entity_get_parent_id: return field_dict @classmethod - def from_dict(cls: Type[KX], src_dict: Dict[str, Any]) -> KX: + def from_dict(cls: Type[UP], src_dict: Dict[str, Any]) -> UP: d = src_dict.copy() entity_id = d.pop("entity_id", UNSET) @@ -962,7 +1022,7 @@ class entity_get_parent_id: return key in self.additional_properties -IZ = TypeVar("IZ", bound="entity_get_num_children") +AZ = TypeVar("AZ", bound="entity_get_num_children") @attr.s(auto_attribs=True) @@ -988,7 +1048,7 @@ class entity_get_num_children: return field_dict @classmethod - def from_dict(cls: Type[IZ], src_dict: Dict[str, Any]) -> IZ: + def from_dict(cls: Type[AZ], src_dict: Dict[str, Any]) -> AZ: d = src_dict.copy() entity_id = d.pop("entity_id", UNSET) @@ -1019,7 +1079,7 @@ class entity_get_num_children: return key in self.additional_properties -WO = TypeVar("WO", bound="entity_get_child_uuid") +DJ = TypeVar("DJ", bound="entity_get_child_uuid") @attr.s(auto_attribs=True) @@ -1049,7 +1109,7 @@ class entity_get_child_uuid: return field_dict @classmethod - def from_dict(cls: Type[WO], src_dict: Dict[str, Any]) -> WO: + def from_dict(cls: Type[DJ], src_dict: Dict[str, Any]) -> DJ: d = src_dict.copy() child_index = d.pop("child_index", UNSET) @@ -1083,7 +1143,7 @@ class entity_get_child_uuid: return key in self.additional_properties -NK = TypeVar("NK", bound="entity_get_all_child_uuids") +WJ = TypeVar("WJ", bound="entity_get_all_child_uuids") @attr.s(auto_attribs=True) @@ -1109,7 +1169,7 @@ class entity_get_all_child_uuids: return field_dict @classmethod - def from_dict(cls: Type[NK], src_dict: Dict[str, Any]) -> NK: + def from_dict(cls: Type[WJ], src_dict: Dict[str, Any]) -> WJ: d = src_dict.copy() entity_id = d.pop("entity_id", UNSET) @@ -1140,7 +1200,7 @@ class entity_get_all_child_uuids: return key in self.additional_properties -UQ = TypeVar("UQ", bound="edit_mode_enter") +TR = TypeVar("TR", bound="edit_mode_enter") @attr.s(auto_attribs=True) @@ -1166,7 +1226,7 @@ class edit_mode_enter: return field_dict @classmethod - def from_dict(cls: Type[UQ], src_dict: Dict[str, Any]) -> UQ: + def from_dict(cls: Type[TR], src_dict: Dict[str, Any]) -> TR: d = src_dict.copy() target = d.pop("target", UNSET) @@ -1197,7 +1257,7 @@ class edit_mode_enter: return key in self.additional_properties -QE = TypeVar("QE", bound="edit_mode_exit") +YD = TypeVar("YD", bound="edit_mode_exit") @attr.s(auto_attribs=True) @@ -1219,7 +1279,7 @@ class edit_mode_exit: return field_dict @classmethod - def from_dict(cls: Type[QE], src_dict: Dict[str, Any]) -> QE: + def from_dict(cls: Type[YD], src_dict: Dict[str, Any]) -> YD: d = src_dict.copy() type = d.pop("type", UNSET) @@ -1247,7 +1307,7 @@ class edit_mode_exit: return key in self.additional_properties -XH = TypeVar("XH", bound="select_with_point") +JF = TypeVar("JF", bound="select_with_point") @attr.s(auto_attribs=True) @@ -1279,7 +1339,7 @@ class select_with_point: return field_dict @classmethod - def from_dict(cls: Type[XH], src_dict: Dict[str, Any]) -> XH: + def from_dict(cls: Type[JF], src_dict: Dict[str, Any]) -> JF: d = src_dict.copy() _selected_at_window = d.pop("selected_at_window", UNSET) selected_at_window: Union[Unset, Point2d] @@ -1323,7 +1383,7 @@ class select_with_point: return key in self.additional_properties -KT = TypeVar("KT", bound="select_clear") +VP = TypeVar("VP", bound="select_clear") @attr.s(auto_attribs=True) @@ -1345,7 +1405,7 @@ class select_clear: return field_dict @classmethod - def from_dict(cls: Type[KT], src_dict: Dict[str, Any]) -> KT: + def from_dict(cls: Type[VP], src_dict: Dict[str, Any]) -> VP: d = src_dict.copy() type = d.pop("type", UNSET) @@ -1373,7 +1433,7 @@ class select_clear: return key in self.additional_properties -BV = TypeVar("BV", bound="select_add") +EL = TypeVar("EL", bound="select_add") @attr.s(auto_attribs=True) @@ -1401,7 +1461,7 @@ class select_add: return field_dict @classmethod - def from_dict(cls: Type[BV], src_dict: Dict[str, Any]) -> BV: + def from_dict(cls: Type[EL], src_dict: Dict[str, Any]) -> EL: d = src_dict.copy() entities = cast(List[str], d.pop("entities", UNSET)) @@ -1432,7 +1492,7 @@ class select_add: return key in self.additional_properties -GU = TypeVar("GU", bound="select_remove") +ZG = TypeVar("ZG", bound="select_remove") @attr.s(auto_attribs=True) @@ -1460,7 +1520,7 @@ class select_remove: return field_dict @classmethod - def from_dict(cls: Type[GU], src_dict: Dict[str, Any]) -> GU: + def from_dict(cls: Type[ZG], src_dict: Dict[str, Any]) -> ZG: d = src_dict.copy() entities = cast(List[str], d.pop("entities", UNSET)) @@ -1491,7 +1551,7 @@ class select_remove: return key in self.additional_properties -SS = TypeVar("SS", bound="select_replace") +LF = TypeVar("LF", bound="select_replace") @attr.s(auto_attribs=True) @@ -1519,7 +1579,7 @@ class select_replace: return field_dict @classmethod - def from_dict(cls: Type[SS], src_dict: Dict[str, Any]) -> SS: + def from_dict(cls: Type[LF], src_dict: Dict[str, Any]) -> LF: d = src_dict.copy() entities = cast(List[str], d.pop("entities", UNSET)) @@ -1550,7 +1610,7 @@ class select_replace: return key in self.additional_properties -UP = TypeVar("UP", bound="select_get") +CS = TypeVar("CS", bound="select_get") @attr.s(auto_attribs=True) @@ -1572,7 +1632,7 @@ class select_get: return field_dict @classmethod - def from_dict(cls: Type[UP], src_dict: Dict[str, Any]) -> UP: + def from_dict(cls: Type[CS], src_dict: Dict[str, Any]) -> CS: d = src_dict.copy() type = d.pop("type", UNSET) @@ -1600,7 +1660,7 @@ class select_get: return key in self.additional_properties -AZ = TypeVar("AZ", bound="highlight_set_entity") +GN = TypeVar("GN", bound="highlight_set_entity") @attr.s(auto_attribs=True) @@ -1631,7 +1691,7 @@ class highlight_set_entity: return field_dict @classmethod - def from_dict(cls: Type[AZ], src_dict: Dict[str, Any]) -> AZ: + def from_dict(cls: Type[GN], src_dict: Dict[str, Any]) -> GN: d = src_dict.copy() _selected_at_window = d.pop("selected_at_window", UNSET) selected_at_window: Union[Unset, Point2d] @@ -1670,7 +1730,7 @@ class highlight_set_entity: return key in self.additional_properties -DJ = TypeVar("DJ", bound="highlight_set_entities") +GD = TypeVar("GD", bound="highlight_set_entities") @attr.s(auto_attribs=True) @@ -1698,7 +1758,7 @@ class highlight_set_entities: return field_dict @classmethod - def from_dict(cls: Type[DJ], src_dict: Dict[str, Any]) -> DJ: + def from_dict(cls: Type[GD], src_dict: Dict[str, Any]) -> GD: d = src_dict.copy() entities = cast(List[str], d.pop("entities", UNSET)) @@ -1729,7 +1789,7 @@ class highlight_set_entities: return key in self.additional_properties -WJ = TypeVar("WJ", bound="new_annotation") +VJ = TypeVar("VJ", bound="new_annotation") @attr.s(auto_attribs=True) @@ -1765,7 +1825,7 @@ class new_annotation: return field_dict @classmethod - def from_dict(cls: Type[WJ], src_dict: Dict[str, Any]) -> WJ: + def from_dict(cls: Type[VJ], src_dict: Dict[str, Any]) -> VJ: d = src_dict.copy() _annotation_type = d.pop("annotation_type", UNSET) annotation_type: Union[Unset, AnnotationType] @@ -1812,7 +1872,7 @@ class new_annotation: return key in self.additional_properties -TR = TypeVar("TR", bound="update_annotation") +OX = TypeVar("OX", bound="update_annotation") @attr.s(auto_attribs=True) @@ -1843,7 +1903,7 @@ class update_annotation: return field_dict @classmethod - def from_dict(cls: Type[TR], src_dict: Dict[str, Any]) -> TR: + def from_dict(cls: Type[OX], src_dict: Dict[str, Any]) -> OX: d = src_dict.copy() annotation_id = d.pop("annotation_id", UNSET) @@ -1882,7 +1942,7 @@ class update_annotation: return key in self.additional_properties -YD = TypeVar("YD", bound="object_visible") +YW = TypeVar("YW", bound="object_visible") @attr.s(auto_attribs=True) @@ -1912,7 +1972,7 @@ class object_visible: return field_dict @classmethod - def from_dict(cls: Type[YD], src_dict: Dict[str, Any]) -> YD: + def from_dict(cls: Type[YW], src_dict: Dict[str, Any]) -> YW: d = src_dict.copy() hidden = d.pop("hidden", UNSET) @@ -1946,7 +2006,7 @@ class object_visible: return key in self.additional_properties -JF = TypeVar("JF", bound="get_entity_type") +QX = TypeVar("QX", bound="get_entity_type") @attr.s(auto_attribs=True) @@ -1972,7 +2032,7 @@ class get_entity_type: return field_dict @classmethod - def from_dict(cls: Type[JF], src_dict: Dict[str, Any]) -> JF: + def from_dict(cls: Type[QX], src_dict: Dict[str, Any]) -> QX: d = src_dict.copy() entity_id = d.pop("entity_id", UNSET) @@ -2003,7 +2063,7 @@ class get_entity_type: return key in self.additional_properties -VP = TypeVar("VP", bound="solid3d_get_all_edge_faces") +NO = TypeVar("NO", bound="solid3d_get_all_edge_faces") @attr.s(auto_attribs=True) @@ -2033,7 +2093,7 @@ class solid3d_get_all_edge_faces: return field_dict @classmethod - def from_dict(cls: Type[VP], src_dict: Dict[str, Any]) -> VP: + def from_dict(cls: Type[NO], src_dict: Dict[str, Any]) -> NO: d = src_dict.copy() edge_id = d.pop("edge_id", UNSET) @@ -2067,7 +2127,7 @@ class solid3d_get_all_edge_faces: return key in self.additional_properties -EL = TypeVar("EL", bound="solid3d_get_all_opposite_edges") +VX = TypeVar("VX", bound="solid3d_get_all_opposite_edges") @attr.s(auto_attribs=True) @@ -2102,7 +2162,7 @@ class solid3d_get_all_opposite_edges: return field_dict @classmethod - def from_dict(cls: Type[EL], src_dict: Dict[str, Any]) -> EL: + def from_dict(cls: Type[VX], src_dict: Dict[str, Any]) -> VX: d = src_dict.copy() _along_vector = d.pop("along_vector", UNSET) along_vector: Union[Unset, Point3d] @@ -2144,7 +2204,7 @@ class solid3d_get_all_opposite_edges: return key in self.additional_properties -ZG = TypeVar("ZG", bound="solid3d_get_opposite_edge") +RG = TypeVar("RG", bound="solid3d_get_opposite_edge") @attr.s(auto_attribs=True) @@ -2178,7 +2238,7 @@ class solid3d_get_opposite_edge: return field_dict @classmethod - def from_dict(cls: Type[ZG], src_dict: Dict[str, Any]) -> ZG: + def from_dict(cls: Type[RG], src_dict: Dict[str, Any]) -> RG: d = src_dict.copy() edge_id = d.pop("edge_id", UNSET) @@ -2215,7 +2275,7 @@ class solid3d_get_opposite_edge: return key in self.additional_properties -LF = TypeVar("LF", bound="solid3d_get_next_adjacent_edge") +IT = TypeVar("IT", bound="solid3d_get_next_adjacent_edge") @attr.s(auto_attribs=True) @@ -2249,7 +2309,7 @@ class solid3d_get_next_adjacent_edge: return field_dict @classmethod - def from_dict(cls: Type[LF], src_dict: Dict[str, Any]) -> LF: + def from_dict(cls: Type[IT], src_dict: Dict[str, Any]) -> IT: d = src_dict.copy() edge_id = d.pop("edge_id", UNSET) @@ -2286,7 +2346,7 @@ class solid3d_get_next_adjacent_edge: return key in self.additional_properties -CS = TypeVar("CS", bound="solid3d_get_prev_adjacent_edge") +LD = TypeVar("LD", bound="solid3d_get_prev_adjacent_edge") @attr.s(auto_attribs=True) @@ -2320,7 +2380,7 @@ class solid3d_get_prev_adjacent_edge: return field_dict @classmethod - def from_dict(cls: Type[CS], src_dict: Dict[str, Any]) -> CS: + def from_dict(cls: Type[LD], src_dict: Dict[str, Any]) -> LD: d = src_dict.copy() edge_id = d.pop("edge_id", UNSET) @@ -2357,6 +2417,1175 @@ class solid3d_get_prev_adjacent_edge: return key in self.additional_properties +UA = TypeVar("UA", bound="send_object") + + +@attr.s(auto_attribs=True) +class send_object: + """Sends object to front or back.""" # noqa: E501 + + front: Union[Unset, bool] = False + object_id: Union[Unset, str] = UNSET + type: str = "send_object" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + front = self.front + object_id = self.object_id + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if front is not UNSET: + field_dict["front"] = front + if object_id is not UNSET: + field_dict["object_id"] = object_id + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[UA], src_dict: Dict[str, Any]) -> UA: + d = src_dict.copy() + front = d.pop("front", UNSET) + + object_id = d.pop("object_id", UNSET) + + type = d.pop("type", UNSET) + + send_object = cls( + front=front, + object_id=object_id, + type=type, + ) + + send_object.additional_properties = d + return send_object + + @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 + + +TN = TypeVar("TN", bound="entity_set_opacity") + + +@attr.s(auto_attribs=True) +class entity_set_opacity: + """Set opacity of the entity.""" # noqa: E501 + + entity_id: Union[Unset, str] = UNSET + opacity: Union[Unset, float] = UNSET + type: str = "entity_set_opacity" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + entity_id = self.entity_id + opacity = self.opacity + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if entity_id is not UNSET: + field_dict["entity_id"] = entity_id + if opacity is not UNSET: + field_dict["opacity"] = opacity + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[TN], src_dict: Dict[str, Any]) -> TN: + d = src_dict.copy() + entity_id = d.pop("entity_id", UNSET) + + opacity = d.pop("opacity", UNSET) + + type = d.pop("type", UNSET) + + entity_set_opacity = cls( + entity_id=entity_id, + opacity=opacity, + type=type, + ) + + entity_set_opacity.additional_properties = d + return entity_set_opacity + + @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 + + +MZ = TypeVar("MZ", bound="entity_fade") + + +@attr.s(auto_attribs=True) +class entity_fade: + """Fade the entity in or out.""" # noqa: E501 + + duration_seconds: Union[Unset, float] = UNSET + entity_id: Union[Unset, str] = UNSET + fade_in: Union[Unset, bool] = False + type: str = "entity_fade" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + duration_seconds = self.duration_seconds + entity_id = self.entity_id + fade_in = self.fade_in + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if duration_seconds is not UNSET: + field_dict["duration_seconds"] = duration_seconds + if entity_id is not UNSET: + field_dict["entity_id"] = entity_id + if fade_in is not UNSET: + field_dict["fade_in"] = fade_in + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[MZ], src_dict: Dict[str, Any]) -> MZ: + d = src_dict.copy() + duration_seconds = d.pop("duration_seconds", UNSET) + + entity_id = d.pop("entity_id", UNSET) + + fade_in = d.pop("fade_in", UNSET) + + type = d.pop("type", UNSET) + + entity_fade = cls( + duration_seconds=duration_seconds, + entity_id=entity_id, + fade_in=fade_in, + type=type, + ) + + entity_fade.additional_properties = d + return entity_fade + + @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 + + +UG = TypeVar("UG", bound="make_plane") + + +@attr.s(auto_attribs=True) +class make_plane: + """Make a plane.""" # noqa: E501 + + clobber: Union[Unset, bool] = False + origin: Union[Unset, Point3d] = UNSET + size: Union[Unset, float] = UNSET + type: str = "make_plane" + x_axis: Union[Unset, Point3d] = UNSET + y_axis: Union[Unset, Point3d] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + clobber = self.clobber + if not isinstance(self.origin, Unset): + origin = self.origin + size = self.size + type = self.type + if not isinstance(self.x_axis, Unset): + x_axis = self.x_axis + if not isinstance(self.y_axis, Unset): + y_axis = self.y_axis + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if clobber is not UNSET: + field_dict["clobber"] = clobber + if origin is not UNSET: + field_dict["origin"] = origin + if size is not UNSET: + field_dict["size"] = size + field_dict["type"] = type + if x_axis is not UNSET: + field_dict["x_axis"] = x_axis + if y_axis is not UNSET: + field_dict["y_axis"] = y_axis + + return field_dict + + @classmethod + def from_dict(cls: Type[UG], src_dict: Dict[str, Any]) -> UG: + d = src_dict.copy() + clobber = d.pop("clobber", UNSET) + + _origin = d.pop("origin", UNSET) + origin: Union[Unset, Point3d] + if isinstance(_origin, Unset): + origin = UNSET + else: + origin = _origin # type: ignore[arg-type] + + size = d.pop("size", UNSET) + + type = d.pop("type", UNSET) + + _x_axis = d.pop("x_axis", UNSET) + x_axis: Union[Unset, Point3d] + if isinstance(_x_axis, Unset): + x_axis = UNSET + else: + x_axis = _x_axis # type: ignore[arg-type] + + _y_axis = d.pop("y_axis", UNSET) + y_axis: Union[Unset, Point3d] + if isinstance(_y_axis, Unset): + y_axis = UNSET + else: + y_axis = _y_axis # type: ignore[arg-type] + + make_plane = cls( + clobber=clobber, + origin=origin, + size=size, + type=type, + x_axis=x_axis, + y_axis=y_axis, + ) + + make_plane.additional_properties = d + return make_plane + + @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 + + +CY = TypeVar("CY", bound="plane_set_color") + + +@attr.s(auto_attribs=True) +class plane_set_color: + """Set the plane's color.""" # noqa: E501 + + color: Union[Unset, Color] = UNSET + plane_id: Union[Unset, str] = UNSET + type: str = "plane_set_color" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.color, Unset): + color = self.color + plane_id = self.plane_id + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if color is not UNSET: + field_dict["color"] = color + if plane_id is not UNSET: + field_dict["plane_id"] = plane_id + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[CY], src_dict: Dict[str, Any]) -> CY: + d = src_dict.copy() + _color = d.pop("color", UNSET) + color: Union[Unset, Color] + if isinstance(_color, Unset): + color = UNSET + else: + color = _color # type: ignore[arg-type] + + plane_id = d.pop("plane_id", UNSET) + + type = d.pop("type", UNSET) + + plane_set_color = cls( + color=color, + plane_id=plane_id, + type=type, + ) + + plane_set_color.additional_properties = d + return plane_set_color + + @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 + + +NZ = TypeVar("NZ", bound="set_tool") + + +@attr.s(auto_attribs=True) +class set_tool: + """Set the active tool.""" # noqa: E501 + + tool: Union[Unset, SceneToolType] = UNSET + type: str = "set_tool" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.tool, Unset): + tool = self.tool + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if tool is not UNSET: + field_dict["tool"] = tool + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[NZ], src_dict: Dict[str, Any]) -> NZ: + d = src_dict.copy() + _tool = d.pop("tool", UNSET) + tool: Union[Unset, SceneToolType] + if isinstance(_tool, Unset): + tool = UNSET + else: + tool = _tool # type: ignore[arg-type] + + type = d.pop("type", UNSET) + + set_tool = cls( + tool=tool, + type=type, + ) + + set_tool.additional_properties = d + return set_tool + + @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 + + +LI = TypeVar("LI", bound="mouse_move") + + +@attr.s(auto_attribs=True) +class mouse_move: + """Send a mouse move event.""" # noqa: E501 + + type: str = "mouse_move" + window: Union[Unset, Point2d] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + type = self.type + if not isinstance(self.window, Unset): + window = self.window + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + field_dict["type"] = type + if window is not UNSET: + field_dict["window"] = window + + return field_dict + + @classmethod + def from_dict(cls: Type[LI], src_dict: Dict[str, Any]) -> LI: + d = src_dict.copy() + type = d.pop("type", UNSET) + + _window = d.pop("window", UNSET) + window: Union[Unset, Point2d] + if isinstance(_window, Unset): + window = UNSET + else: + window = _window # type: ignore[arg-type] + + mouse_move = cls( + type=type, + window=window, + ) + + mouse_move.additional_properties = d + return mouse_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 + + +LO = TypeVar("LO", bound="mouse_click") + + +@attr.s(auto_attribs=True) +class mouse_click: + """Send a mouse click event. Updates modified/selected entities.""" # noqa: E501 + + type: str = "mouse_click" + window: Union[Unset, Point2d] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + type = self.type + if not isinstance(self.window, Unset): + window = self.window + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + field_dict["type"] = type + if window is not UNSET: + field_dict["window"] = window + + return field_dict + + @classmethod + def from_dict(cls: Type[LO], src_dict: Dict[str, Any]) -> LO: + d = src_dict.copy() + type = d.pop("type", UNSET) + + _window = d.pop("window", UNSET) + window: Union[Unset, Point2d] + if isinstance(_window, Unset): + window = UNSET + else: + window = _window # type: ignore[arg-type] + + mouse_click = cls( + type=type, + window=window, + ) + + mouse_click.additional_properties = d + return mouse_click + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties + + +XJ = TypeVar("XJ", bound="sketch_mode_enable") + + +@attr.s(auto_attribs=True) +class sketch_mode_enable: + """Enable sketch mode on the given plane.""" # noqa: E501 + + animated: Union[Unset, bool] = False + ortho: Union[Unset, bool] = False + plane_id: Union[Unset, str] = UNSET + type: str = "sketch_mode_enable" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + animated = self.animated + ortho = self.ortho + plane_id = self.plane_id + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if animated is not UNSET: + field_dict["animated"] = animated + if ortho is not UNSET: + field_dict["ortho"] = ortho + if plane_id is not UNSET: + field_dict["plane_id"] = plane_id + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[XJ], src_dict: Dict[str, Any]) -> XJ: + d = src_dict.copy() + animated = d.pop("animated", UNSET) + + ortho = d.pop("ortho", UNSET) + + plane_id = d.pop("plane_id", UNSET) + + type = d.pop("type", UNSET) + + sketch_mode_enable = cls( + animated=animated, + ortho=ortho, + plane_id=plane_id, + type=type, + ) + + sketch_mode_enable.additional_properties = d + return sketch_mode_enable + + @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 + + +OW = TypeVar("OW", bound="sketch_mode_disable") + + +@attr.s(auto_attribs=True) +class sketch_mode_disable: + """Disable sketch mode.""" # noqa: E501 + + type: str = "sketch_mode_disable" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[OW], src_dict: Dict[str, Any]) -> OW: + d = src_dict.copy() + type = d.pop("type", UNSET) + + sketch_mode_disable = cls( + type=type, + ) + + sketch_mode_disable.additional_properties = d + return sketch_mode_disable + + @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 + + +JQ = TypeVar("JQ", bound="curve_get_type") + + +@attr.s(auto_attribs=True) +class curve_get_type: + """Get type of a given curve.""" # noqa: E501 + + curve_id: Union[Unset, str] = UNSET + type: str = "curve_get_type" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + curve_id = self.curve_id + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if curve_id is not UNSET: + field_dict["curve_id"] = curve_id + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[JQ], src_dict: Dict[str, Any]) -> JQ: + d = src_dict.copy() + curve_id = d.pop("curve_id", UNSET) + + type = d.pop("type", UNSET) + + curve_get_type = cls( + curve_id=curve_id, + type=type, + ) + + curve_get_type.additional_properties = d + return curve_get_type + + @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 + + +PQ = TypeVar("PQ", bound="curve_get_control_points") + + +@attr.s(auto_attribs=True) +class curve_get_control_points: + """Get control points of a given curve.""" # noqa: E501 + + curve_id: Union[Unset, str] = UNSET + type: str = "curve_get_control_points" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + curve_id = self.curve_id + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if curve_id is not UNSET: + field_dict["curve_id"] = curve_id + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[PQ], src_dict: Dict[str, Any]) -> PQ: + d = src_dict.copy() + curve_id = d.pop("curve_id", UNSET) + + type = d.pop("type", UNSET) + + curve_get_control_points = cls( + curve_id=curve_id, + type=type, + ) + + curve_get_control_points.additional_properties = d + return curve_get_control_points + + @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 + + +IM = TypeVar("IM", bound="take_snapshot") + + +@attr.s(auto_attribs=True) +class take_snapshot: + """Take a snapshot.""" # noqa: E501 + + format: Union[Unset, ImageFormat] = UNSET + type: str = "take_snapshot" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.format, Unset): + format = self.format + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if format is not UNSET: + field_dict["format"] = format + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[IM], src_dict: Dict[str, Any]) -> IM: + d = src_dict.copy() + _format = d.pop("format", UNSET) + format: Union[Unset, ImageFormat] + if isinstance(_format, Unset): + format = UNSET + else: + format = _format # type: ignore[arg-type] + + type = d.pop("type", UNSET) + + take_snapshot = cls( + format=format, + type=type, + ) + + take_snapshot.additional_properties = d + return take_snapshot + + @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 + + +OU = TypeVar("OU", bound="make_axes_gizmo") + + +@attr.s(auto_attribs=True) +class make_axes_gizmo: + """Add a gizmo showing the axes.""" # noqa: E501 + + clobber: Union[Unset, bool] = False + gizmo_mode: Union[Unset, bool] = False + type: str = "make_axes_gizmo" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + clobber = self.clobber + gizmo_mode = self.gizmo_mode + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if clobber is not UNSET: + field_dict["clobber"] = clobber + if gizmo_mode is not UNSET: + field_dict["gizmo_mode"] = gizmo_mode + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[OU], src_dict: Dict[str, Any]) -> OU: + d = src_dict.copy() + clobber = d.pop("clobber", UNSET) + + gizmo_mode = d.pop("gizmo_mode", UNSET) + + type = d.pop("type", UNSET) + + make_axes_gizmo = cls( + clobber=clobber, + gizmo_mode=gizmo_mode, + type=type, + ) + + make_axes_gizmo.additional_properties = d + return make_axes_gizmo + + @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 + + +KL = TypeVar("KL", bound="path_get_info") + + +@attr.s(auto_attribs=True) +class path_get_info: + """Query the given path""" # noqa: E501 + + path_id: Union[Unset, str] = UNSET + type: str = "path_get_info" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + path_id = self.path_id + type = self.type + + 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 + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[KL], src_dict: Dict[str, Any]) -> KL: + d = src_dict.copy() + path_id = d.pop("path_id", UNSET) + + type = d.pop("type", UNSET) + + path_get_info = cls( + path_id=path_id, + type=type, + ) + + path_get_info.additional_properties = d + return path_get_info + + @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 + + +XI = TypeVar("XI", bound="handle_mouse_drag_start") + + +@attr.s(auto_attribs=True) +class handle_mouse_drag_start: + """Start dragging mouse.""" # noqa: E501 + + type: str = "handle_mouse_drag_start" + window: Union[Unset, Point2d] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + type = self.type + if not isinstance(self.window, Unset): + window = self.window + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + field_dict["type"] = type + if window is not UNSET: + field_dict["window"] = window + + return field_dict + + @classmethod + def from_dict(cls: Type[XI], src_dict: Dict[str, Any]) -> XI: + d = src_dict.copy() + type = d.pop("type", UNSET) + + _window = d.pop("window", UNSET) + window: Union[Unset, Point2d] + if isinstance(_window, Unset): + window = UNSET + else: + window = _window # type: ignore[arg-type] + + handle_mouse_drag_start = cls( + type=type, + window=window, + ) + + handle_mouse_drag_start.additional_properties = d + return handle_mouse_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 + + +PO = TypeVar("PO", bound="handle_mouse_drag_move") + + +@attr.s(auto_attribs=True) +class handle_mouse_drag_move: + """Continue dragging mouse.""" # noqa: E501 + + type: str = "handle_mouse_drag_move" + window: Union[Unset, Point2d] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + type = self.type + if not isinstance(self.window, Unset): + window = self.window + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + field_dict["type"] = type + if window is not UNSET: + field_dict["window"] = window + + return field_dict + + @classmethod + def from_dict(cls: Type[PO], src_dict: Dict[str, Any]) -> PO: + d = src_dict.copy() + type = d.pop("type", UNSET) + + _window = d.pop("window", UNSET) + window: Union[Unset, Point2d] + if isinstance(_window, Unset): + window = UNSET + else: + window = _window # type: ignore[arg-type] + + handle_mouse_drag_move = cls( + type=type, + window=window, + ) + + handle_mouse_drag_move.additional_properties = d + return handle_mouse_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 + + +PS = TypeVar("PS", bound="handle_mouse_drag_end") + + +@attr.s(auto_attribs=True) +class handle_mouse_drag_end: + """Stop dragging mouse.""" # noqa: E501 + + type: str = "handle_mouse_drag_end" + window: Union[Unset, Point2d] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + type = self.type + if not isinstance(self.window, Unset): + window = self.window + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + field_dict["type"] = type + if window is not UNSET: + field_dict["window"] = window + + return field_dict + + @classmethod + def from_dict(cls: Type[PS], src_dict: Dict[str, Any]) -> PS: + d = src_dict.copy() + type = d.pop("type", UNSET) + + _window = d.pop("window", UNSET) + window: Union[Unset, Point2d] + if isinstance(_window, Unset): + window = UNSET + else: + window = _window # type: ignore[arg-type] + + handle_mouse_drag_end = cls( + type=type, + window=window, + ) + + handle_mouse_drag_end.additional_properties = d + return handle_mouse_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[ start_path, move_path_pen, @@ -2367,6 +3596,7 @@ ModelingCmd = Union[ camera_drag_move, camera_drag_end, default_camera_look_at, + default_camera_zoom, default_camera_enable_sketch_mode, default_camera_disable_sketch_mode, export, @@ -2393,4 +3623,22 @@ ModelingCmd = Union[ solid3d_get_opposite_edge, solid3d_get_next_adjacent_edge, solid3d_get_prev_adjacent_edge, + send_object, + entity_set_opacity, + entity_fade, + make_plane, + plane_set_color, + set_tool, + mouse_move, + mouse_click, + sketch_mode_enable, + sketch_mode_disable, + curve_get_type, + curve_get_control_points, + take_snapshot, + make_axes_gizmo, + path_get_info, + handle_mouse_drag_start, + handle_mouse_drag_move, + handle_mouse_drag_end, ] diff --git a/kittycad/models/modeling_cmd_req.py b/kittycad/models/modeling_cmd_req.py index 670c8009a..533242d07 100644 --- a/kittycad/models/modeling_cmd_req.py +++ b/kittycad/models/modeling_cmd_req.py @@ -6,7 +6,7 @@ from ..models.modeling_cmd import ModelingCmd from ..models.modeling_cmd_id import ModelingCmdId from ..types import UNSET, Unset -GN = TypeVar("GN", bound="ModelingCmdReq") +WR = TypeVar("WR", bound="ModelingCmdReq") @attr.s(auto_attribs=True) @@ -35,7 +35,7 @@ class ModelingCmdReq: return field_dict @classmethod - def from_dict(cls: Type[GN], src_dict: Dict[str, Any]) -> GN: + def from_dict(cls: Type[WR], src_dict: Dict[str, Any]) -> WR: d = src_dict.copy() _cmd = d.pop("cmd", UNSET) cmd: Union[Unset, ModelingCmd] diff --git a/kittycad/models/modeling_cmd_req_batch.py b/kittycad/models/modeling_cmd_req_batch.py index 56bfd3e65..b76110334 100644 --- a/kittycad/models/modeling_cmd_req_batch.py +++ b/kittycad/models/modeling_cmd_req_batch.py @@ -2,21 +2,29 @@ from typing import Any, Dict, List, Type, TypeVar, Union import attr +from ..models.modeling_cmd_req import ModelingCmdReq from ..types import UNSET, Unset -GD = TypeVar("GD", bound="ModelingCmdReqBatch") +XL = TypeVar("XL", bound="ModelingCmdReqBatch") @attr.s(auto_attribs=True) class ModelingCmdReqBatch: """A batch set of graphics commands submitted to the KittyCAD engine via the Modeling API.""" # noqa: E501 - cmds: Union[Unset, Any] = UNSET + from ..models.modeling_cmd_req import ModelingCmdReq + + cmds: Union[Unset, Dict[str, ModelingCmdReq]] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - cmds = self.cmds + cmds: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.cmds, Unset): + new_dict: Dict[str, Any] = {} + for key, value in self.cmds.items(): + new_dict[key] = value.to_dict() + cmds = new_dict field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -27,9 +35,16 @@ class ModelingCmdReqBatch: return field_dict @classmethod - def from_dict(cls: Type[GD], src_dict: Dict[str, Any]) -> GD: + def from_dict(cls: Type[XL], src_dict: Dict[str, Any]) -> XL: d = src_dict.copy() - cmds = d.pop("cmds", UNSET) + _cmds = d.pop("cmds", UNSET) + if isinstance(_cmds, Unset): + cmds = UNSET + else: + new_map: Dict[str, ModelingCmdReq] = {} + for k, v in _cmds.items(): + new_map[k] = ModelingCmdReq.from_dict(v) # type: ignore + cmds = new_map # type: ignore modeling_cmd_req_batch = cls( cmds=cmds, diff --git a/kittycad/models/modeling_error.py b/kittycad/models/modeling_error.py index 3782e7746..d467eef05 100644 --- a/kittycad/models/modeling_error.py +++ b/kittycad/models/modeling_error.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -VJ = TypeVar("VJ", bound="ModelingError") +ZX = TypeVar("ZX", bound="ModelingError") @attr.s(auto_attribs=True) @@ -39,7 +39,7 @@ class ModelingError: return field_dict @classmethod - def from_dict(cls: Type[VJ], src_dict: Dict[str, Any]) -> VJ: + def from_dict(cls: Type[ZX], src_dict: Dict[str, Any]) -> ZX: d = src_dict.copy() error_code = d.pop("error_code", UNSET) diff --git a/kittycad/models/modeling_outcome.py b/kittycad/models/modeling_outcome.py index 643fd4028..a886fe6b3 100644 --- a/kittycad/models/modeling_outcome.py +++ b/kittycad/models/modeling_outcome.py @@ -13,7 +13,7 @@ success = OkModelingCmdResponse error = ModelingError -OX = TypeVar("OX", bound="cancelled") +FT = TypeVar("FT", bound="cancelled") @attr.s(auto_attribs=True) @@ -35,7 +35,7 @@ class cancelled: return field_dict @classmethod - def from_dict(cls: Type[OX], src_dict: Dict[str, Any]) -> OX: + def from_dict(cls: Type[FT], src_dict: Dict[str, Any]) -> FT: d = src_dict.copy() _what_failed = d.pop("what_failed", UNSET) what_failed: Union[Unset, ModelingCmdId] diff --git a/kittycad/models/modeling_outcomes.py b/kittycad/models/modeling_outcomes.py index d0d42b26a..c333fea82 100644 --- a/kittycad/models/modeling_outcomes.py +++ b/kittycad/models/modeling_outcomes.py @@ -2,21 +2,29 @@ from typing import Any, Dict, List, Type, TypeVar, Union import attr +from ..models.modeling_outcome import ModelingOutcome from ..types import UNSET, Unset -YW = TypeVar("YW", bound="ModelingOutcomes") +NX = TypeVar("NX", bound="ModelingOutcomes") @attr.s(auto_attribs=True) class ModelingOutcomes: """The result from a batch of modeling commands.""" # noqa: E501 - outcomes: Union[Unset, Any] = UNSET + from ..models.modeling_outcome import ModelingOutcome + + outcomes: Union[Unset, Dict[str, ModelingOutcome]] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - outcomes = self.outcomes + outcomes: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.outcomes, Unset): + new_dict: Dict[str, Any] = {} + for key, value in self.outcomes.items(): + new_dict[key] = value.to_dict() + outcomes = new_dict field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -27,9 +35,16 @@ class ModelingOutcomes: return field_dict @classmethod - def from_dict(cls: Type[YW], src_dict: Dict[str, Any]) -> YW: + def from_dict(cls: Type[NX], src_dict: Dict[str, Any]) -> NX: d = src_dict.copy() - outcomes = d.pop("outcomes", UNSET) + _outcomes = d.pop("outcomes", UNSET) + if isinstance(_outcomes, Unset): + outcomes = UNSET + else: + new_map: Dict[str, ModelingOutcome] = {} + for k, v in _outcomes.items(): + new_map[k] = ModelingOutcome.from_dict(v) # type: ignore + outcomes = new_map # type: ignore modeling_outcomes = cls( outcomes=outcomes, diff --git a/kittycad/models/mouse_click.py b/kittycad/models/mouse_click.py new file mode 100644 index 000000000..b5ef4cefe --- /dev/null +++ b/kittycad/models/mouse_click.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +import attr + +from ..types import UNSET, Unset + +SC = TypeVar("SC", bound="MouseClick") + + +@attr.s(auto_attribs=True) +class MouseClick: + """The response from the `MouseClick` command.""" # noqa: E501 + + entities_modified: Union[Unset, List[str]] = UNSET + entities_selected: Union[Unset, List[str]] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + entities_modified: Union[Unset, List[str]] = UNSET + if not isinstance(self.entities_modified, Unset): + entities_modified = self.entities_modified + entities_selected: Union[Unset, List[str]] = UNSET + if not isinstance(self.entities_selected, Unset): + entities_selected = self.entities_selected + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if entities_modified is not UNSET: + field_dict["entities_modified"] = entities_modified + if entities_selected is not UNSET: + field_dict["entities_selected"] = entities_selected + + return field_dict + + @classmethod + def from_dict(cls: Type[SC], src_dict: Dict[str, Any]) -> SC: + d = src_dict.copy() + entities_modified = cast(List[str], d.pop("entities_modified", UNSET)) + + entities_selected = cast(List[str], d.pop("entities_selected", UNSET)) + + mouse_click = cls( + entities_modified=entities_modified, + entities_selected=entities_selected, + ) + + mouse_click.additional_properties = d + return mouse_click + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/kittycad/models/new_address.py b/kittycad/models/new_address.py index 90a80d388..1a8b2894b 100644 --- a/kittycad/models/new_address.py +++ b/kittycad/models/new_address.py @@ -5,7 +5,7 @@ import attr from ..models.country_code import CountryCode from ..types import UNSET, Unset -QX = TypeVar("QX", bound="NewAddress") +TX = TypeVar("TX", bound="NewAddress") @attr.s(auto_attribs=True) @@ -53,7 +53,7 @@ class NewAddress: return field_dict @classmethod - def from_dict(cls: Type[QX], src_dict: Dict[str, Any]) -> QX: + def from_dict(cls: Type[TX], src_dict: Dict[str, Any]) -> TX: d = src_dict.copy() city = d.pop("city", UNSET) diff --git a/kittycad/models/o_auth2_client_info.py b/kittycad/models/o_auth2_client_info.py index 37099e881..a27ddd170 100644 --- a/kittycad/models/o_auth2_client_info.py +++ b/kittycad/models/o_auth2_client_info.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -NO = TypeVar("NO", bound="OAuth2ClientInfo") +JA = TypeVar("JA", bound="OAuth2ClientInfo") @attr.s(auto_attribs=True) @@ -35,7 +35,7 @@ class OAuth2ClientInfo: return field_dict @classmethod - def from_dict(cls: Type[NO], src_dict: Dict[str, Any]) -> NO: + def from_dict(cls: Type[JA], src_dict: Dict[str, Any]) -> JA: d = src_dict.copy() csrf_token = d.pop("csrf_token", UNSET) diff --git a/kittycad/models/ok_modeling_cmd_response.py b/kittycad/models/ok_modeling_cmd_response.py index 19ebbaa9b..581c5f2a5 100644 --- a/kittycad/models/ok_modeling_cmd_response.py +++ b/kittycad/models/ok_modeling_cmd_response.py @@ -1,11 +1,29 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, Dict, List, Type, TypeVar, Union import attr -from ..models.entity_type import EntityType +from ..models.curve_get_control_points import CurveGetControlPoints +from ..models.curve_get_type import CurveGetType +from ..models.entity_get_all_child_uuids import EntityGetAllChildUuids +from ..models.entity_get_child_uuid import EntityGetChildUuid +from ..models.entity_get_num_children import EntityGetNumChildren +from ..models.entity_get_parent_id import EntityGetParentId +from ..models.export import Export +from ..models.get_entity_type import GetEntityType +from ..models.highlight_set_entity import HighlightSetEntity +from ..models.mouse_click import MouseClick +from ..models.path_get_info import PathGetInfo +from ..models.select_get import SelectGet +from ..models.select_with_point import SelectWithPoint +from ..models.solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces +from ..models.solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges +from ..models.solid3d_get_next_adjacent_edge import Solid3dGetNextAdjacentEdge +from ..models.solid3d_get_opposite_edge import Solid3dGetOppositeEdge +from ..models.solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge +from ..models.take_snapshot import TakeSnapshot from ..types import UNSET, Unset -VX = TypeVar("VX", bound="empty") +SK = TypeVar("SK", bound="empty") @attr.s(auto_attribs=True) @@ -27,7 +45,7 @@ class empty: return field_dict @classmethod - def from_dict(cls: Type[VX], src_dict: Dict[str, Any]) -> VX: + def from_dict(cls: Type[SK], src_dict: Dict[str, Any]) -> SK: d = src_dict.copy() type = d.pop("type", UNSET) @@ -55,48 +73,46 @@ class empty: return key in self.additional_properties -RG = TypeVar("RG", bound="export") +UK = TypeVar("UK", bound="export") @attr.s(auto_attribs=True) class export: """The response from the `Export` command. When this is being performed over a websocket, this is sent as binary not JSON. The binary data can be deserialized as `bincode` into a `Vec`.""" # noqa: E501 - from ..models.export_file import ExportFile - - files: Union[Unset, List[ExportFile]] = UNSET + data: Union[Unset, Export] = UNSET type: str = "export" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - from ..models.export_file import ExportFile - - files: Union[Unset, List[ExportFile]] = UNSET - if not isinstance(self.files, Unset): - files = self.files + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if files is not UNSET: - field_dict["files"] = files + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[RG], src_dict: Dict[str, Any]) -> RG: + def from_dict(cls: Type[UK], src_dict: Dict[str, Any]) -> UK: d = src_dict.copy() - from ..models.export_file import ExportFile - - files = cast(List[ExportFile], d.pop("files", UNSET)) + _data = d.pop("data", UNSET) + data: Union[Unset, Export] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) export = cls( - files=files, + data=data, type=type, ) @@ -120,40 +136,46 @@ class export: return key in self.additional_properties -IT = TypeVar("IT", bound="select_with_point") +CX = TypeVar("CX", bound="select_with_point") @attr.s(auto_attribs=True) class select_with_point: """The response from the `SelectWithPoint` command.""" # noqa: E501 - entity_id: Union[Unset, str] = UNSET + data: Union[Unset, SelectWithPoint] = UNSET type: str = "select_with_point" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - entity_id = self.entity_id + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if entity_id is not UNSET: - field_dict["entity_id"] = entity_id + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[IT], src_dict: Dict[str, Any]) -> IT: + def from_dict(cls: Type[CX], src_dict: Dict[str, Any]) -> CX: d = src_dict.copy() - entity_id = d.pop("entity_id", UNSET) + _data = d.pop("data", UNSET) + data: Union[Unset, SelectWithPoint] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) select_with_point = cls( - entity_id=entity_id, + data=data, type=type, ) @@ -177,47 +199,46 @@ class select_with_point: return key in self.additional_properties -LD = TypeVar("LD", bound="highlight_set_entity") +MT = TypeVar("MT", bound="highlight_set_entity") @attr.s(auto_attribs=True) class highlight_set_entity: """The response from the `HighlightSetEntity` command.""" # noqa: E501 - entity_id: Union[Unset, str] = UNSET - sequence: Union[Unset, int] = UNSET + data: Union[Unset, HighlightSetEntity] = UNSET type: str = "highlight_set_entity" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - entity_id = self.entity_id - sequence = self.sequence + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if entity_id is not UNSET: - field_dict["entity_id"] = entity_id - if sequence is not UNSET: - field_dict["sequence"] = sequence + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[LD], src_dict: Dict[str, Any]) -> LD: + def from_dict(cls: Type[MT], src_dict: Dict[str, Any]) -> MT: d = src_dict.copy() - entity_id = d.pop("entity_id", UNSET) - - sequence = d.pop("sequence", UNSET) + _data = d.pop("data", UNSET) + data: Union[Unset, HighlightSetEntity] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) highlight_set_entity = cls( - entity_id=entity_id, - sequence=sequence, + data=data, type=type, ) @@ -241,40 +262,46 @@ class highlight_set_entity: return key in self.additional_properties -UA = TypeVar("UA", bound="entity_get_child_uuid") +LJ = TypeVar("LJ", bound="entity_get_child_uuid") @attr.s(auto_attribs=True) class entity_get_child_uuid: """The response from the `EntityGetChildUuid` command.""" # noqa: E501 - entity_id: Union[Unset, str] = UNSET + data: Union[Unset, EntityGetChildUuid] = UNSET type: str = "entity_get_child_uuid" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - entity_id = self.entity_id + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if entity_id is not UNSET: - field_dict["entity_id"] = entity_id + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[UA], src_dict: Dict[str, Any]) -> UA: + def from_dict(cls: Type[LJ], src_dict: Dict[str, Any]) -> LJ: d = src_dict.copy() - entity_id = d.pop("entity_id", UNSET) + _data = d.pop("data", UNSET) + data: Union[Unset, EntityGetChildUuid] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) entity_get_child_uuid = cls( - entity_id=entity_id, + data=data, type=type, ) @@ -298,40 +325,46 @@ class entity_get_child_uuid: return key in self.additional_properties -TN = TypeVar("TN", bound="entity_get_num_children") +TF = TypeVar("TF", bound="entity_get_num_children") @attr.s(auto_attribs=True) class entity_get_num_children: """The response from the `EntityGetNumChildren` command.""" # noqa: E501 - num: Union[Unset, int] = UNSET + data: Union[Unset, EntityGetNumChildren] = UNSET type: str = "entity_get_num_children" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - num = self.num + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if num is not UNSET: - field_dict["num"] = num + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[TN], src_dict: Dict[str, Any]) -> TN: + def from_dict(cls: Type[TF], src_dict: Dict[str, Any]) -> TF: d = src_dict.copy() - num = d.pop("num", UNSET) + _data = d.pop("data", UNSET) + data: Union[Unset, EntityGetNumChildren] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) entity_get_num_children = cls( - num=num, + data=data, type=type, ) @@ -355,40 +388,46 @@ class entity_get_num_children: return key in self.additional_properties -MZ = TypeVar("MZ", bound="entity_get_parent_id") +HF = TypeVar("HF", bound="entity_get_parent_id") @attr.s(auto_attribs=True) class entity_get_parent_id: """The response from the `EntityGetParentId` command.""" # noqa: E501 - entity_id: Union[Unset, str] = UNSET + data: Union[Unset, EntityGetParentId] = UNSET type: str = "entity_get_parent_id" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - entity_id = self.entity_id + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if entity_id is not UNSET: - field_dict["entity_id"] = entity_id + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[MZ], src_dict: Dict[str, Any]) -> MZ: + def from_dict(cls: Type[HF], src_dict: Dict[str, Any]) -> HF: d = src_dict.copy() - entity_id = d.pop("entity_id", UNSET) + _data = d.pop("data", UNSET) + data: Union[Unset, EntityGetParentId] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) entity_get_parent_id = cls( - entity_id=entity_id, + data=data, type=type, ) @@ -412,42 +451,46 @@ class entity_get_parent_id: return key in self.additional_properties -UG = TypeVar("UG", bound="entity_get_all_child_uuids") +JD = TypeVar("JD", bound="entity_get_all_child_uuids") @attr.s(auto_attribs=True) class entity_get_all_child_uuids: """The response from the `EntityGetAllChildUuids` command.""" # noqa: E501 - entity_ids: Union[Unset, List[str]] = UNSET + data: Union[Unset, EntityGetAllChildUuids] = UNSET type: str = "entity_get_all_child_uuids" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - entity_ids: Union[Unset, List[str]] = UNSET - if not isinstance(self.entity_ids, Unset): - entity_ids = self.entity_ids + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if entity_ids is not UNSET: - field_dict["entity_ids"] = entity_ids + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[UG], src_dict: Dict[str, Any]) -> UG: + def from_dict(cls: Type[JD], src_dict: Dict[str, Any]) -> JD: d = src_dict.copy() - entity_ids = cast(List[str], d.pop("entity_ids", UNSET)) + _data = d.pop("data", UNSET) + data: Union[Unset, EntityGetAllChildUuids] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) entity_get_all_child_uuids = cls( - entity_ids=entity_ids, + data=data, type=type, ) @@ -471,42 +514,46 @@ class entity_get_all_child_uuids: return key in self.additional_properties -CY = TypeVar("CY", bound="select_get") +RZ = TypeVar("RZ", bound="select_get") @attr.s(auto_attribs=True) class select_get: """The response from the `SelectGet` command.""" # noqa: E501 - entity_ids: Union[Unset, List[str]] = UNSET + data: Union[Unset, SelectGet] = UNSET type: str = "select_get" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - entity_ids: Union[Unset, List[str]] = UNSET - if not isinstance(self.entity_ids, Unset): - entity_ids = self.entity_ids + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if entity_ids is not UNSET: - field_dict["entity_ids"] = entity_ids + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[CY], src_dict: Dict[str, Any]) -> CY: + def from_dict(cls: Type[RZ], src_dict: Dict[str, Any]) -> RZ: d = src_dict.copy() - entity_ids = cast(List[str], d.pop("entity_ids", UNSET)) + _data = d.pop("data", UNSET) + data: Union[Unset, SelectGet] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) select_get = cls( - entity_ids=entity_ids, + data=data, type=type, ) @@ -530,46 +577,46 @@ class select_get: return key in self.additional_properties -NZ = TypeVar("NZ", bound="get_entity_type") +BH = TypeVar("BH", bound="get_entity_type") @attr.s(auto_attribs=True) class get_entity_type: """The response from the `GetEntityType` command.""" # noqa: E501 - entity_type: Union[Unset, EntityType] = UNSET + data: Union[Unset, GetEntityType] = UNSET type: str = "get_entity_type" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - if not isinstance(self.entity_type, Unset): - entity_type = self.entity_type + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if entity_type is not UNSET: - field_dict["entity_type"] = entity_type + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[NZ], src_dict: Dict[str, Any]) -> NZ: + def from_dict(cls: Type[BH], src_dict: Dict[str, Any]) -> BH: d = src_dict.copy() - _entity_type = d.pop("entity_type", UNSET) - entity_type: Union[Unset, EntityType] - if isinstance(_entity_type, Unset): - entity_type = UNSET + _data = d.pop("data", UNSET) + data: Union[Unset, GetEntityType] + if isinstance(_data, Unset): + data = UNSET else: - entity_type = _entity_type # type: ignore[arg-type] + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) get_entity_type = cls( - entity_type=entity_type, + data=data, type=type, ) @@ -593,42 +640,46 @@ class get_entity_type: return key in self.additional_properties -LI = TypeVar("LI", bound="solid3d_get_all_edge_faces") +SX = TypeVar("SX", bound="solid3d_get_all_edge_faces") @attr.s(auto_attribs=True) class solid3d_get_all_edge_faces: """The response from the `Solid3dGetAllEdgeFaces` command.""" # noqa: E501 - faces: Union[Unset, List[str]] = UNSET + data: Union[Unset, Solid3dGetAllEdgeFaces] = UNSET type: str = "solid3d_get_all_edge_faces" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - faces: Union[Unset, List[str]] = UNSET - if not isinstance(self.faces, Unset): - faces = self.faces + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if faces is not UNSET: - field_dict["faces"] = faces + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[LI], src_dict: Dict[str, Any]) -> LI: + def from_dict(cls: Type[SX], src_dict: Dict[str, Any]) -> SX: d = src_dict.copy() - faces = cast(List[str], d.pop("faces", UNSET)) + _data = d.pop("data", UNSET) + data: Union[Unset, Solid3dGetAllEdgeFaces] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) solid3d_get_all_edge_faces = cls( - faces=faces, + data=data, type=type, ) @@ -652,42 +703,46 @@ class solid3d_get_all_edge_faces: return key in self.additional_properties -LO = TypeVar("LO", bound="solid3d_get_all_opposite_edges") +CN = TypeVar("CN", bound="solid3d_get_all_opposite_edges") @attr.s(auto_attribs=True) class solid3d_get_all_opposite_edges: """The response from the `Solid3dGetAllOppositeEdges` command.""" # noqa: E501 - edges: Union[Unset, List[str]] = UNSET + data: Union[Unset, Solid3dGetAllOppositeEdges] = UNSET type: str = "solid3d_get_all_opposite_edges" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - edges: Union[Unset, List[str]] = UNSET - if not isinstance(self.edges, Unset): - edges = self.edges + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if edges is not UNSET: - field_dict["edges"] = edges + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[LO], src_dict: Dict[str, Any]) -> LO: + def from_dict(cls: Type[CN], src_dict: Dict[str, Any]) -> CN: d = src_dict.copy() - edges = cast(List[str], d.pop("edges", UNSET)) + _data = d.pop("data", UNSET) + data: Union[Unset, Solid3dGetAllOppositeEdges] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) solid3d_get_all_opposite_edges = cls( - edges=edges, + data=data, type=type, ) @@ -711,40 +766,46 @@ class solid3d_get_all_opposite_edges: return key in self.additional_properties -XJ = TypeVar("XJ", bound="solid3d_get_opposite_edge") +GS = TypeVar("GS", bound="solid3d_get_opposite_edge") @attr.s(auto_attribs=True) class solid3d_get_opposite_edge: """The response from the `Solid3dGetOppositeEdge` command.""" # noqa: E501 - edge: Union[Unset, str] = UNSET + data: Union[Unset, Solid3dGetOppositeEdge] = UNSET type: str = "solid3d_get_opposite_edge" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - edge = self.edge + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if edge is not UNSET: - field_dict["edge"] = edge + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[XJ], src_dict: Dict[str, Any]) -> XJ: + def from_dict(cls: Type[GS], src_dict: Dict[str, Any]) -> GS: d = src_dict.copy() - edge = d.pop("edge", UNSET) + _data = d.pop("data", UNSET) + data: Union[Unset, Solid3dGetOppositeEdge] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) solid3d_get_opposite_edge = cls( - edge=edge, + data=data, type=type, ) @@ -768,40 +829,46 @@ class solid3d_get_opposite_edge: return key in self.additional_properties -OW = TypeVar("OW", bound="solid3d_get_prev_adjacent_edge") +SO = TypeVar("SO", bound="solid3d_get_prev_adjacent_edge") @attr.s(auto_attribs=True) class solid3d_get_prev_adjacent_edge: """The response from the `Solid3dGetPrevAdjacentEdge` command.""" # noqa: E501 - edge: Union[Unset, str] = UNSET + data: Union[Unset, Solid3dGetPrevAdjacentEdge] = UNSET type: str = "solid3d_get_prev_adjacent_edge" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - edge = self.edge + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if edge is not UNSET: - field_dict["edge"] = edge + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[OW], src_dict: Dict[str, Any]) -> OW: + def from_dict(cls: Type[SO], src_dict: Dict[str, Any]) -> SO: d = src_dict.copy() - edge = d.pop("edge", UNSET) + _data = d.pop("data", UNSET) + data: Union[Unset, Solid3dGetPrevAdjacentEdge] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) solid3d_get_prev_adjacent_edge = cls( - edge=edge, + data=data, type=type, ) @@ -825,40 +892,46 @@ class solid3d_get_prev_adjacent_edge: return key in self.additional_properties -JQ = TypeVar("JQ", bound="solid3d_get_next_adjacent_edge") +ZS = TypeVar("ZS", bound="solid3d_get_next_adjacent_edge") @attr.s(auto_attribs=True) class solid3d_get_next_adjacent_edge: """The response from the `Solid3dGetNextAdjacentEdge` command.""" # noqa: E501 - edge: Union[Unset, str] = UNSET + data: Union[Unset, Solid3dGetNextAdjacentEdge] = UNSET type: str = "solid3d_get_next_adjacent_edge" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - edge = self.edge + if not isinstance(self.data, Unset): + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if edge is not UNSET: - field_dict["edge"] = edge + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[JQ], src_dict: Dict[str, Any]) -> JQ: + def from_dict(cls: Type[ZS], src_dict: Dict[str, Any]) -> ZS: d = src_dict.copy() - edge = d.pop("edge", UNSET) + _data = d.pop("data", UNSET) + data: Union[Unset, Solid3dGetNextAdjacentEdge] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] type = d.pop("type", UNSET) solid3d_get_next_adjacent_edge = cls( - edge=edge, + data=data, type=type, ) @@ -882,6 +955,321 @@ class solid3d_get_next_adjacent_edge: return key in self.additional_properties +AM = TypeVar("AM", bound="mouse_click") + + +@attr.s(auto_attribs=True) +class mouse_click: + """The response from the `MouseClick` command.""" # noqa: E501 + + data: Union[Unset, MouseClick] = UNSET + type: str = "mouse_click" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.data, Unset): + data = self.data + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[AM], src_dict: Dict[str, Any]) -> AM: + d = src_dict.copy() + _data = d.pop("data", UNSET) + data: Union[Unset, MouseClick] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] + + type = d.pop("type", UNSET) + + mouse_click = cls( + data=data, + type=type, + ) + + mouse_click.additional_properties = d + return mouse_click + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties + + +GK = TypeVar("GK", bound="curve_get_type") + + +@attr.s(auto_attribs=True) +class curve_get_type: + """The response from the `CurveGetType` command.""" # noqa: E501 + + data: Union[Unset, CurveGetType] = UNSET + type: str = "curve_get_type" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.data, Unset): + data = self.data + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[GK], src_dict: Dict[str, Any]) -> GK: + d = src_dict.copy() + _data = d.pop("data", UNSET) + data: Union[Unset, CurveGetType] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] + + type = d.pop("type", UNSET) + + curve_get_type = cls( + data=data, + type=type, + ) + + curve_get_type.additional_properties = d + return curve_get_type + + @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 + + +SG = TypeVar("SG", bound="curve_get_control_points") + + +@attr.s(auto_attribs=True) +class curve_get_control_points: + """The response from the `CurveGetControlPoints` command.""" # noqa: E501 + + data: Union[Unset, CurveGetControlPoints] = UNSET + type: str = "curve_get_control_points" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.data, Unset): + data = self.data + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[SG], src_dict: Dict[str, Any]) -> SG: + d = src_dict.copy() + _data = d.pop("data", UNSET) + data: Union[Unset, CurveGetControlPoints] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] + + type = d.pop("type", UNSET) + + curve_get_control_points = cls( + data=data, + type=type, + ) + + curve_get_control_points.additional_properties = d + return curve_get_control_points + + @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 + + +QZ = TypeVar("QZ", bound="take_snapshot") + + +@attr.s(auto_attribs=True) +class take_snapshot: + """The response from the `Take Snapshot` command.""" # noqa: E501 + + data: Union[Unset, TakeSnapshot] = UNSET + type: str = "take_snapshot" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.data, Unset): + data = self.data + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[QZ], src_dict: Dict[str, Any]) -> QZ: + d = src_dict.copy() + _data = d.pop("data", UNSET) + data: Union[Unset, TakeSnapshot] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] + + type = d.pop("type", UNSET) + + take_snapshot = cls( + data=data, + type=type, + ) + + take_snapshot.additional_properties = d + return take_snapshot + + @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 + + +SY = TypeVar("SY", bound="path_get_info") + + +@attr.s(auto_attribs=True) +class path_get_info: + """The response from the `Path Get Info` command.""" # noqa: E501 + + data: Union[Unset, PathGetInfo] = UNSET + type: str = "path_get_info" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.data, Unset): + data = self.data + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[SY], src_dict: Dict[str, Any]) -> SY: + d = src_dict.copy() + _data = d.pop("data", UNSET) + data: Union[Unset, PathGetInfo] + if isinstance(_data, Unset): + data = UNSET + else: + data = _data # type: ignore[arg-type] + + type = d.pop("type", UNSET) + + path_get_info = cls( + data=data, + type=type, + ) + + path_get_info.additional_properties = d + return path_get_info + + @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 + + OkModelingCmdResponse = Union[ empty, export, @@ -898,4 +1286,9 @@ OkModelingCmdResponse = Union[ solid3d_get_opposite_edge, solid3d_get_prev_adjacent_edge, solid3d_get_next_adjacent_edge, + mouse_click, + curve_get_type, + curve_get_control_points, + take_snapshot, + path_get_info, ] diff --git a/kittycad/models/web_socket_responses.py b/kittycad/models/ok_web_socket_response_data.py similarity index 59% rename from kittycad/models/web_socket_responses.py rename to kittycad/models/ok_web_socket_response_data.py index baa49d42b..83b47a00d 100644 --- a/kittycad/models/web_socket_responses.py +++ b/kittycad/models/ok_web_socket_response_data.py @@ -1,181 +1,42 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, Dict, List, Type, TypeVar, Union import attr -from ..models.modeling_cmd_id import ModelingCmdId -from ..models.rtc_ice_candidate import RtcIceCandidate -from ..models.rtc_session_description import RtcSessionDescription -from ..models.snake_case_result import SnakeCaseResult from ..types import UNSET, Unset -OS = TypeVar("OS", bound="trickle_ice") - - -@attr.s(auto_attribs=True) -class trickle_ice: - """The trickle ICE candidate response.""" # noqa: E501 - - candidate: Union[Unset, RtcIceCandidate] = UNSET - type: str = "trickle_ice" - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - if not isinstance(self.candidate, Unset): - candidate = self.candidate - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if candidate is not UNSET: - field_dict["candidate"] = candidate - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[OS], src_dict: Dict[str, Any]) -> OS: - d = src_dict.copy() - _candidate = d.pop("candidate", UNSET) - candidate: Union[Unset, RtcIceCandidate] - if isinstance(_candidate, Unset): - candidate = UNSET - else: - candidate = _candidate # type: ignore[arg-type] - - type = d.pop("type", UNSET) - - trickle_ice = cls( - candidate=candidate, - type=type, - ) - - trickle_ice.additional_properties = d - return trickle_ice - - @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 - - -WP = TypeVar("WP", bound="sdp_answer") - - -@attr.s(auto_attribs=True) -class sdp_answer: - """The SDP answer response.""" # noqa: E501 - - answer: Union[Unset, RtcSessionDescription] = UNSET - type: str = "sdp_answer" - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - if not isinstance(self.answer, Unset): - answer = self.answer - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if answer is not UNSET: - field_dict["answer"] = answer - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[WP], src_dict: Dict[str, Any]) -> WP: - d = src_dict.copy() - _answer = d.pop("answer", UNSET) - answer: Union[Unset, RtcSessionDescription] - if isinstance(_answer, Unset): - answer = UNSET - else: - answer = _answer # type: ignore[arg-type] - - type = d.pop("type", UNSET) - - sdp_answer = cls( - answer=answer, - type=type, - ) - - sdp_answer.additional_properties = d - return sdp_answer - - @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 - - -XO = TypeVar("XO", bound="ice_server_info") +YK = TypeVar("YK", bound="ice_server_info") @attr.s(auto_attribs=True) class ice_server_info: - """The ICE server info response.""" # noqa: E501 + """Information about the ICE servers.""" # noqa: E501 - from ..models.ice_server import IceServer - - ice_servers: Union[Unset, List[IceServer]] = UNSET + data: Union[Unset, Any] = UNSET type: str = "ice_server_info" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - from ..models.ice_server import IceServer - - ice_servers: Union[Unset, List[IceServer]] = UNSET - if not isinstance(self.ice_servers, Unset): - ice_servers = self.ice_servers + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if ice_servers is not UNSET: - field_dict["ice_servers"] = ice_servers + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[XO], src_dict: Dict[str, Any]) -> XO: + def from_dict(cls: Type[YK], src_dict: Dict[str, Any]) -> YK: d = src_dict.copy() - from ..models.ice_server import IceServer - - ice_servers = cast(List[IceServer], d.pop("ice_servers", UNSET)) - + data = d.pop("data", UNSET) type = d.pop("type", UNSET) ice_server_info = cls( - ice_servers=ice_servers, + data=data, type=type, ) @@ -199,59 +60,151 @@ class ice_server_info: return key in self.additional_properties -LN = TypeVar("LN", bound="modeling") +WS = TypeVar("WS", bound="trickle_ice") + + +@attr.s(auto_attribs=True) +class trickle_ice: + """The trickle ICE candidate response.""" # noqa: E501 + + data: Union[Unset, Any] = UNSET + type: str = "trickle_ice" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + data = self.data + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[WS], src_dict: Dict[str, Any]) -> WS: + d = src_dict.copy() + data = d.pop("data", UNSET) + type = d.pop("type", UNSET) + + trickle_ice = cls( + data=data, + type=type, + ) + + trickle_ice.additional_properties = d + return trickle_ice + + @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 + + +SL = TypeVar("SL", bound="sdp_answer") + + +@attr.s(auto_attribs=True) +class sdp_answer: + """The SDP answer response.""" # noqa: E501 + + data: Union[Unset, Any] = UNSET + type: str = "sdp_answer" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + data = self.data + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[SL], src_dict: Dict[str, Any]) -> SL: + d = src_dict.copy() + data = d.pop("data", UNSET) + type = d.pop("type", UNSET) + + sdp_answer = cls( + data=data, + type=type, + ) + + sdp_answer.additional_properties = d + return sdp_answer + + @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 + + +MK = TypeVar("MK", bound="modeling") @attr.s(auto_attribs=True) class modeling: """The modeling command response.""" # noqa: E501 - cmd_id: Union[Unset, ModelingCmdId] = UNSET - result: Union[Unset, SnakeCaseResult] = UNSET + data: Union[Unset, Any] = UNSET type: str = "modeling" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - if not isinstance(self.cmd_id, Unset): - cmd_id = self.cmd_id - if not isinstance(self.result, Unset): - result = self.result + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if cmd_id is not UNSET: - field_dict["cmd_id"] = cmd_id - if result is not UNSET: - field_dict["result"] = result + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[LN], src_dict: Dict[str, Any]) -> LN: + def from_dict(cls: Type[MK], src_dict: Dict[str, Any]) -> MK: d = src_dict.copy() - _cmd_id = d.pop("cmd_id", UNSET) - cmd_id: Union[Unset, ModelingCmdId] - if isinstance(_cmd_id, Unset): - cmd_id = UNSET - else: - cmd_id = _cmd_id # type: ignore[arg-type] - - _result = d.pop("result", UNSET) - result: Union[Unset, SnakeCaseResult] - if isinstance(_result, Unset): - result = UNSET - else: - result = _result # type: ignore[arg-type] - + data = d.pop("data", UNSET) type = d.pop("type", UNSET) modeling = cls( - cmd_id=cmd_id, - result=result, + data=data, type=type, ) @@ -275,48 +228,39 @@ class modeling: return key in self.additional_properties -KR = TypeVar("KR", bound="export") +TU = TypeVar("TU", bound="export") @attr.s(auto_attribs=True) class export: - """The export command response, this is sent as binary.""" # noqa: E501 + """The exported files.""" # noqa: E501 - from ..models.raw_file import RawFile - - files: Union[Unset, List[RawFile]] = UNSET + data: Union[Unset, Any] = UNSET type: str = "export" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - from ..models.raw_file import RawFile - - files: Union[Unset, List[RawFile]] = UNSET - if not isinstance(self.files, Unset): - files = self.files + data = self.data type = self.type field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if files is not UNSET: - field_dict["files"] = files + if data is not UNSET: + field_dict["data"] = data field_dict["type"] = type return field_dict @classmethod - def from_dict(cls: Type[KR], src_dict: Dict[str, Any]) -> KR: + def from_dict(cls: Type[TU], src_dict: Dict[str, Any]) -> TU: d = src_dict.copy() - from ..models.raw_file import RawFile - - files = cast(List[RawFile], d.pop("files", UNSET)) - + data = d.pop("data", UNSET) type = d.pop("type", UNSET) export = cls( - files=files, + data=data, type=type, ) @@ -340,4 +284,6 @@ class export: return key in self.additional_properties -WebSocketResponses = Union[trickle_ice, sdp_answer, ice_server_info, modeling, export] +OkWebSocketResponseData = Union[ + ice_server_info, trickle_ice, sdp_answer, modeling, export +] diff --git a/kittycad/models/onboarding.py b/kittycad/models/onboarding.py index 4c3c266da..eb94b3a0b 100644 --- a/kittycad/models/onboarding.py +++ b/kittycad/models/onboarding.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -PQ = TypeVar("PQ", bound="Onboarding") +FY = TypeVar("FY", bound="Onboarding") @attr.s(auto_attribs=True) @@ -37,7 +37,7 @@ class Onboarding: return field_dict @classmethod - def from_dict(cls: Type[PQ], src_dict: Dict[str, Any]) -> PQ: + def from_dict(cls: Type[FY], src_dict: Dict[str, Any]) -> FY: d = src_dict.copy() first_call_from__their_machine_date = d.pop( "first_call_from_their_machine_date", UNSET diff --git a/kittycad/models/output_file.py b/kittycad/models/output_file.py index a59a49dde..09d8c0e82 100644 --- a/kittycad/models/output_file.py +++ b/kittycad/models/output_file.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -IM = TypeVar("IM", bound="OutputFile") +FD = TypeVar("FD", bound="OutputFile") @attr.s(auto_attribs=True) @@ -31,7 +31,7 @@ class OutputFile: return field_dict @classmethod - def from_dict(cls: Type[IM], src_dict: Dict[str, Any]) -> IM: + def from_dict(cls: Type[FD], src_dict: Dict[str, Any]) -> FD: d = src_dict.copy() contents = d.pop("contents", UNSET) diff --git a/kittycad/models/output_format.py b/kittycad/models/output_format.py index 7145c1e7f..c6d4795be 100644 --- a/kittycad/models/output_format.py +++ b/kittycad/models/output_format.py @@ -2,19 +2,23 @@ from typing import Any, Dict, List, Type, TypeVar, Union import attr -from ..models.storage import Storage +from ..models.fbx_storage import FbxStorage +from ..models.gltf_presentation import GltfPresentation +from ..models.gltf_storage import GltfStorage +from ..models.ply_storage import PlyStorage +from ..models.stl_storage import StlStorage from ..models.system import System from ..types import UNSET, Unset -OU = TypeVar("OU", bound="gltf") +TZ = TypeVar("TZ", bound="fbx") @attr.s(auto_attribs=True) -class gltf: - """glTF 2.0. We refer to this as glTF since that is how our customers refer to it, although by default it will be in binary format and thus technically (glb). If you prefer ascii output, you can set that option for the export.""" # noqa: E501 +class fbx: + """Autodesk Filmbox (FBX) format.""" # noqa: E501 - storage: Union[Unset, Storage] = UNSET - type: str = "gltf" + storage: Union[Unset, FbxStorage] = UNSET + type: str = "fbx" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) @@ -33,10 +37,85 @@ class gltf: return field_dict @classmethod - def from_dict(cls: Type[OU], src_dict: Dict[str, Any]) -> OU: + def from_dict(cls: Type[TZ], src_dict: Dict[str, Any]) -> TZ: d = src_dict.copy() _storage = d.pop("storage", UNSET) - storage: Union[Unset, Storage] + storage: Union[Unset, FbxStorage] + if isinstance(_storage, Unset): + storage = UNSET + else: + storage = _storage # type: ignore[arg-type] + + type = d.pop("type", UNSET) + + fbx = cls( + storage=storage, + type=type, + ) + + fbx.additional_properties = d + return fbx + + @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 + + +AX = TypeVar("AX", bound="gltf") + + +@attr.s(auto_attribs=True) +class gltf: + """glTF 2.0. We refer to this as glTF since that is how our customers refer to it, although by default it will be in binary format and thus technically (glb). If you prefer ascii output, you can set that option for the export.""" # noqa: E501 + + presentation: Union[Unset, GltfPresentation] = UNSET + storage: Union[Unset, GltfStorage] = UNSET + type: str = "gltf" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.presentation, Unset): + presentation = self.presentation + if not isinstance(self.storage, Unset): + storage = self.storage + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if presentation is not UNSET: + field_dict["presentation"] = presentation + if storage is not UNSET: + field_dict["storage"] = storage + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[AX], src_dict: Dict[str, Any]) -> AX: + d = src_dict.copy() + _presentation = d.pop("presentation", UNSET) + presentation: Union[Unset, GltfPresentation] + if isinstance(_presentation, Unset): + presentation = UNSET + else: + presentation = _presentation # type: ignore[arg-type] + + _storage = d.pop("storage", UNSET) + storage: Union[Unset, GltfStorage] if isinstance(_storage, Unset): storage = UNSET else: @@ -45,6 +124,7 @@ class gltf: type = d.pop("type", UNSET) gltf = cls( + presentation=presentation, storage=storage, type=type, ) @@ -69,7 +149,7 @@ class gltf: return key in self.additional_properties -KL = TypeVar("KL", bound="obj") +RQ = TypeVar("RQ", bound="obj") @attr.s(auto_attribs=True) @@ -96,7 +176,7 @@ class obj: return field_dict @classmethod - def from_dict(cls: Type[KL], src_dict: Dict[str, Any]) -> KL: + def from_dict(cls: Type[RQ], src_dict: Dict[str, Any]) -> RQ: d = src_dict.copy() _coords = d.pop("coords", UNSET) coords: Union[Unset, System] @@ -132,7 +212,7 @@ class obj: return key in self.additional_properties -XI = TypeVar("XI", bound="ply") +ZL = TypeVar("ZL", bound="ply") @attr.s(auto_attribs=True) @@ -140,7 +220,7 @@ class ply: """The PLY Polygon File Format.""" # noqa: E501 coords: Union[Unset, System] = UNSET - storage: Union[Unset, Storage] = UNSET + storage: Union[Unset, PlyStorage] = UNSET type: str = "ply" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) @@ -164,7 +244,7 @@ class ply: return field_dict @classmethod - def from_dict(cls: Type[XI], src_dict: Dict[str, Any]) -> XI: + def from_dict(cls: Type[ZL], src_dict: Dict[str, Any]) -> ZL: d = src_dict.copy() _coords = d.pop("coords", UNSET) coords: Union[Unset, System] @@ -174,7 +254,7 @@ class ply: coords = _coords # type: ignore[arg-type] _storage = d.pop("storage", UNSET) - storage: Union[Unset, Storage] + storage: Union[Unset, PlyStorage] if isinstance(_storage, Unset): storage = UNSET else: @@ -208,7 +288,7 @@ class ply: return key in self.additional_properties -PO = TypeVar("PO", bound="step") +CM = TypeVar("CM", bound="step") @attr.s(auto_attribs=True) @@ -235,7 +315,7 @@ class step: return field_dict @classmethod - def from_dict(cls: Type[PO], src_dict: Dict[str, Any]) -> PO: + def from_dict(cls: Type[CM], src_dict: Dict[str, Any]) -> CM: d = src_dict.copy() _coords = d.pop("coords", UNSET) coords: Union[Unset, System] @@ -271,7 +351,7 @@ class step: return key in self.additional_properties -PS = TypeVar("PS", bound="stl") +OS = TypeVar("OS", bound="stl") @attr.s(auto_attribs=True) @@ -279,7 +359,7 @@ class stl: """*ST**ereo**L**ithography format.""" # noqa: E501 coords: Union[Unset, System] = UNSET - storage: Union[Unset, Storage] = UNSET + storage: Union[Unset, StlStorage] = UNSET type: str = "stl" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) @@ -303,7 +383,7 @@ class stl: return field_dict @classmethod - def from_dict(cls: Type[PS], src_dict: Dict[str, Any]) -> PS: + def from_dict(cls: Type[OS], src_dict: Dict[str, Any]) -> OS: d = src_dict.copy() _coords = d.pop("coords", UNSET) coords: Union[Unset, System] @@ -313,7 +393,7 @@ class stl: coords = _coords # type: ignore[arg-type] _storage = d.pop("storage", UNSET) - storage: Union[Unset, Storage] + storage: Union[Unset, StlStorage] if isinstance(_storage, Unset): storage = UNSET else: @@ -347,4 +427,4 @@ class stl: return key in self.additional_properties -OutputFormat = Union[gltf, obj, ply, step, stl] +OutputFormat = Union[fbx, gltf, obj, ply, step, stl] diff --git a/kittycad/models/path_command.py b/kittycad/models/path_command.py new file mode 100644 index 000000000..98d26cf10 --- /dev/null +++ b/kittycad/models/path_command.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class PathCommand(str, Enum): + """The path component command type (within a Path)""" # noqa: E501 + + MOVE_TO = "move_to" + LINE_TO = "line_to" + BEZ_CURVE_TO = "bez_curve_to" + NURBS_CURVE_TO = "nurbs_curve_to" + ADD_ARC = "add_arc" + + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/path_get_info.py b/kittycad/models/path_get_info.py new file mode 100644 index 000000000..6ab950f9e --- /dev/null +++ b/kittycad/models/path_get_info.py @@ -0,0 +1,63 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +import attr + +from ..types import UNSET, Unset + +WP = TypeVar("WP", bound="PathGetInfo") + + +@attr.s(auto_attribs=True) +class PathGetInfo: + """The response from the `PathGetInfo` command.""" # noqa: E501 + + from ..models.path_segment_info import PathSegmentInfo + + segments: Union[Unset, List[PathSegmentInfo]] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + from ..models.path_segment_info import PathSegmentInfo + + segments: Union[Unset, List[PathSegmentInfo]] = UNSET + if not isinstance(self.segments, Unset): + segments = self.segments + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if segments is not UNSET: + field_dict["segments"] = segments + + return field_dict + + @classmethod + def from_dict(cls: Type[WP], src_dict: Dict[str, Any]) -> WP: + d = src_dict.copy() + from ..models.path_segment_info import PathSegmentInfo + + segments = cast(List[PathSegmentInfo], d.pop("segments", UNSET)) + + path_get_info = cls( + segments=segments, + ) + + path_get_info.additional_properties = d + return path_get_info + + @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 diff --git a/kittycad/models/path_segment.py b/kittycad/models/path_segment.py index 7a194a8ef..fad6da572 100644 --- a/kittycad/models/path_segment.py +++ b/kittycad/models/path_segment.py @@ -6,7 +6,7 @@ from ..models.point2d import Point2d from ..models.point3d import Point3d from ..types import UNSET, Unset -WR = TypeVar("WR", bound="line") +XO = TypeVar("XO", bound="line") @attr.s(auto_attribs=True) @@ -33,7 +33,7 @@ class line: return field_dict @classmethod - def from_dict(cls: Type[WR], src_dict: Dict[str, Any]) -> WR: + def from_dict(cls: Type[XO], src_dict: Dict[str, Any]) -> XO: d = src_dict.copy() _end = d.pop("end", UNSET) end: Union[Unset, Point3d] @@ -69,7 +69,7 @@ class line: return key in self.additional_properties -XL = TypeVar("XL", bound="arc") +LN = TypeVar("LN", bound="arc") @attr.s(auto_attribs=True) @@ -108,7 +108,7 @@ class arc: return field_dict @classmethod - def from_dict(cls: Type[XL], src_dict: Dict[str, Any]) -> XL: + def from_dict(cls: Type[LN], src_dict: Dict[str, Any]) -> LN: d = src_dict.copy() angle_end = d.pop("angle_end", UNSET) @@ -153,7 +153,7 @@ class arc: return key in self.additional_properties -ZX = TypeVar("ZX", bound="bezier") +KR = TypeVar("KR", bound="bezier") @attr.s(auto_attribs=True) @@ -190,7 +190,7 @@ class bezier: return field_dict @classmethod - def from_dict(cls: Type[ZX], src_dict: Dict[str, Any]) -> ZX: + def from_dict(cls: Type[KR], src_dict: Dict[str, Any]) -> KR: d = src_dict.copy() _control1 = d.pop("control1", UNSET) control1: Union[Unset, Point3d] diff --git a/kittycad/models/path_segment_info.py b/kittycad/models/path_segment_info.py new file mode 100644 index 000000000..008a8377a --- /dev/null +++ b/kittycad/models/path_segment_info.py @@ -0,0 +1,76 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..models.modeling_cmd_id import ModelingCmdId +from ..models.path_command import PathCommand +from ..types import UNSET, Unset + +MG = TypeVar("MG", bound="PathSegmentInfo") + + +@attr.s(auto_attribs=True) +class PathSegmentInfo: + """Info about a path segment""" # noqa: E501 + + command: Union[Unset, PathCommand] = UNSET + command_id: Union[Unset, ModelingCmdId] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + if not isinstance(self.command, Unset): + command = self.command + if not isinstance(self.command_id, Unset): + command_id = self.command_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if command is not UNSET: + field_dict["command"] = command + if command_id is not UNSET: + field_dict["command_id"] = command_id + + return field_dict + + @classmethod + def from_dict(cls: Type[MG], src_dict: Dict[str, Any]) -> MG: + d = src_dict.copy() + _command = d.pop("command", UNSET) + command: Union[Unset, PathCommand] + if isinstance(_command, Unset): + command = UNSET + else: + command = _command # type: ignore[arg-type] + + _command_id = d.pop("command_id", UNSET) + command_id: Union[Unset, ModelingCmdId] + if isinstance(_command_id, Unset): + command_id = UNSET + else: + command_id = _command_id # type: ignore[arg-type] + + path_segment_info = cls( + command=command, + command_id=command_id, + ) + + path_segment_info.additional_properties = d + return path_segment_info + + @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 diff --git a/kittycad/models/payment_intent.py b/kittycad/models/payment_intent.py index 59e771e46..e6e073287 100644 --- a/kittycad/models/payment_intent.py +++ b/kittycad/models/payment_intent.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -FT = TypeVar("FT", bound="PaymentIntent") +UE = TypeVar("UE", bound="PaymentIntent") @attr.s(auto_attribs=True) @@ -27,7 +27,7 @@ class PaymentIntent: return field_dict @classmethod - def from_dict(cls: Type[FT], src_dict: Dict[str, Any]) -> FT: + def from_dict(cls: Type[UE], src_dict: Dict[str, Any]) -> UE: d = src_dict.copy() client_secret = d.pop("client_secret", UNSET) diff --git a/kittycad/models/payment_method.py b/kittycad/models/payment_method.py index 6f40d2e5e..d0acd9851 100644 --- a/kittycad/models/payment_method.py +++ b/kittycad/models/payment_method.py @@ -9,7 +9,7 @@ from ..models.card_details import CardDetails from ..models.payment_method_type import PaymentMethodType from ..types import UNSET, Unset -NX = TypeVar("NX", bound="PaymentMethod") +BF = TypeVar("BF", bound="PaymentMethod") @attr.s(auto_attribs=True) @@ -20,7 +20,7 @@ class PaymentMethod: card: Union[Unset, CardDetails] = UNSET created_at: Union[Unset, datetime.datetime] = UNSET id: Union[Unset, str] = UNSET - metadata: Union[Unset, Any] = UNSET + metadata: Union[Unset, Dict[str, str]] = UNSET type: Union[Unset, PaymentMethodType] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) @@ -35,6 +35,7 @@ class PaymentMethod: created_at = self.created_at.isoformat() id = self.id metadata = self.metadata + if not isinstance(self.type, Unset): type = self.type @@ -57,7 +58,7 @@ class PaymentMethod: return field_dict @classmethod - def from_dict(cls: Type[NX], src_dict: Dict[str, Any]) -> NX: + def from_dict(cls: Type[BF], src_dict: Dict[str, Any]) -> BF: d = src_dict.copy() _billing_info = d.pop("billing_info", UNSET) billing_info: Union[Unset, BillingInfo] @@ -83,6 +84,7 @@ class PaymentMethod: id = d.pop("id", UNSET) metadata = d.pop("metadata", UNSET) + _type = d.pop("type", UNSET) type: Union[Unset, PaymentMethodType] if isinstance(_type, Unset): diff --git a/kittycad/models/payment_method_card_checks.py b/kittycad/models/payment_method_card_checks.py index b46b77cd0..d98bceb0b 100644 --- a/kittycad/models/payment_method_card_checks.py +++ b/kittycad/models/payment_method_card_checks.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -SC = TypeVar("SC", bound="PaymentMethodCardChecks") +UU = TypeVar("UU", bound="PaymentMethodCardChecks") @attr.s(auto_attribs=True) @@ -35,7 +35,7 @@ class PaymentMethodCardChecks: return field_dict @classmethod - def from_dict(cls: Type[SC], src_dict: Dict[str, Any]) -> SC: + def from_dict(cls: Type[UU], src_dict: Dict[str, Any]) -> UU: d = src_dict.copy() address_line1_check = d.pop("address_line1_check", UNSET) diff --git a/kittycad/models/plugins_info.py b/kittycad/models/plugins_info.py index ff508f023..bbe7370b3 100644 --- a/kittycad/models/plugins_info.py +++ b/kittycad/models/plugins_info.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -TX = TypeVar("TX", bound="PluginsInfo") +MB = TypeVar("MB", bound="PluginsInfo") @attr.s(auto_attribs=True) @@ -50,7 +50,7 @@ class PluginsInfo: return field_dict @classmethod - def from_dict(cls: Type[TX], src_dict: Dict[str, Any]) -> TX: + def from_dict(cls: Type[MB], src_dict: Dict[str, Any]) -> MB: d = src_dict.copy() authorization = cast(List[str], d.pop("authorization", UNSET)) diff --git a/kittycad/models/ply_storage.py b/kittycad/models/ply_storage.py new file mode 100644 index 000000000..7c48b864d --- /dev/null +++ b/kittycad/models/ply_storage.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class PlyStorage(str, Enum): + """The storage for the output PLY file.""" # noqa: E501 + + """# Write numbers in their ascii representation (e.g. -13, 6.28, etc.). Properties are separated by spaces and elements are separated by line breaks. """ # noqa: E501 + ASCII = "ascii" + """# Encode payload as binary using little endian. """ # noqa: E501 + BINARY_LITTLE_ENDIAN = "binary_little_endian" + """# Encode payload as binary using big endian. """ # noqa: E501 + BINARY_BIG_ENDIAN = "binary_big_endian" + + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/point2d.py b/kittycad/models/point2d.py index 4f72efe69..86e69cb97 100644 --- a/kittycad/models/point2d.py +++ b/kittycad/models/point2d.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -JA = TypeVar("JA", bound="Point2d") +TB = TypeVar("TB", bound="Point2d") @attr.s(auto_attribs=True) @@ -31,7 +31,7 @@ class Point2d: return field_dict @classmethod - def from_dict(cls: Type[JA], src_dict: Dict[str, Any]) -> JA: + def from_dict(cls: Type[TB], src_dict: Dict[str, Any]) -> TB: d = src_dict.copy() x = d.pop("x", UNSET) diff --git a/kittycad/models/point3d.py b/kittycad/models/point3d.py index a6a2bd093..b3755c940 100644 --- a/kittycad/models/point3d.py +++ b/kittycad/models/point3d.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -SK = TypeVar("SK", bound="Point3d") +FJ = TypeVar("FJ", bound="Point3d") @attr.s(auto_attribs=True) @@ -35,7 +35,7 @@ class Point3d: return field_dict @classmethod - def from_dict(cls: Type[SK], src_dict: Dict[str, Any]) -> SK: + def from_dict(cls: Type[FJ], src_dict: Dict[str, Any]) -> FJ: d = src_dict.copy() x = d.pop("x", UNSET) diff --git a/kittycad/models/point_e_metadata.py b/kittycad/models/point_e_metadata.py index 6319fc21f..26d994cf5 100644 --- a/kittycad/models/point_e_metadata.py +++ b/kittycad/models/point_e_metadata.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -UK = TypeVar("UK", bound="PointEMetadata") +HB = TypeVar("HB", bound="PointEMetadata") @attr.s(auto_attribs=True) @@ -29,7 +29,7 @@ class PointEMetadata: return field_dict @classmethod - def from_dict(cls: Type[UK], src_dict: Dict[str, Any]) -> UK: + def from_dict(cls: Type[HB], src_dict: Dict[str, Any]) -> HB: d = src_dict.copy() ok = d.pop("ok", UNSET) diff --git a/kittycad/models/pong.py b/kittycad/models/pong.py index 744fc8448..98fb5bf5f 100644 --- a/kittycad/models/pong.py +++ b/kittycad/models/pong.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -CX = TypeVar("CX", bound="Pong") +SF = TypeVar("SF", bound="Pong") @attr.s(auto_attribs=True) @@ -27,7 +27,7 @@ class Pong: return field_dict @classmethod - def from_dict(cls: Type[CX], src_dict: Dict[str, Any]) -> CX: + def from_dict(cls: Type[SF], src_dict: Dict[str, Any]) -> SF: d = src_dict.copy() message = d.pop("message", UNSET) diff --git a/kittycad/models/raw_file.py b/kittycad/models/raw_file.py index ce55f90c3..76460c172 100644 --- a/kittycad/models/raw_file.py +++ b/kittycad/models/raw_file.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -MT = TypeVar("MT", bound="RawFile") +DU = TypeVar("DU", bound="RawFile") @attr.s(auto_attribs=True) @@ -33,7 +33,7 @@ class RawFile: return field_dict @classmethod - def from_dict(cls: Type[MT], src_dict: Dict[str, Any]) -> MT: + def from_dict(cls: Type[DU], src_dict: Dict[str, Any]) -> DU: d = src_dict.copy() contents = cast(List[int], d.pop("contents", UNSET)) diff --git a/kittycad/models/registry_service_config.py b/kittycad/models/registry_service_config.py index 25a6d1199..088d337eb 100644 --- a/kittycad/models/registry_service_config.py +++ b/kittycad/models/registry_service_config.py @@ -2,9 +2,10 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast import attr +from ..models.index_info import IndexInfo from ..types import UNSET, Unset -LJ = TypeVar("LJ", bound="RegistryServiceConfig") +BM = TypeVar("BM", bound="RegistryServiceConfig") @attr.s(auto_attribs=True) @@ -13,7 +14,9 @@ class RegistryServiceConfig: allow_nondistributable_artifacts_cid_rs: Union[Unset, List[str]] = UNSET allow_nondistributable_artifacts_hostnames: Union[Unset, List[str]] = UNSET - index_configs: Union[Unset, Any] = UNSET + from ..models.index_info import IndexInfo + + index_configs: Union[Unset, Dict[str, IndexInfo]] = UNSET insecure_registry_cid_rs: Union[Unset, List[str]] = UNSET mirrors: Union[Unset, List[str]] = UNSET @@ -30,7 +33,12 @@ class RegistryServiceConfig: allow_nondistributable_artifacts_hostnames = ( self.allow_nondistributable_artifacts_hostnames ) - index_configs = self.index_configs + index_configs: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.index_configs, Unset): + new_dict: Dict[str, Any] = {} + for key, value in self.index_configs.items(): + new_dict[key] = value.to_dict() + index_configs = new_dict insecure_registry_cid_rs: Union[Unset, List[str]] = UNSET if not isinstance(self.insecure_registry_cid_rs, Unset): insecure_registry_cid_rs = self.insecure_registry_cid_rs @@ -59,7 +67,7 @@ class RegistryServiceConfig: return field_dict @classmethod - def from_dict(cls: Type[LJ], src_dict: Dict[str, Any]) -> LJ: + def from_dict(cls: Type[BM], src_dict: Dict[str, Any]) -> BM: d = src_dict.copy() allow_nondistributable_artifacts_cid_rs = cast( List[str], d.pop("allow_nondistributable_artifacts_cid_rs", UNSET) @@ -69,7 +77,15 @@ class RegistryServiceConfig: List[str], d.pop("allow_nondistributable_artifacts_hostnames", UNSET) ) - index_configs = d.pop("index_configs", UNSET) + _index_configs = d.pop("index_configs", UNSET) + if isinstance(_index_configs, Unset): + index_configs = UNSET + else: + new_map: Dict[str, IndexInfo] = {} + for k, v in _index_configs.items(): + new_map[k] = IndexInfo.from_dict(v) # type: ignore + index_configs = new_map # type: ignore + insecure_registry_cid_rs = cast( List[str], d.pop("insecure_registry_cid_rs", UNSET) ) diff --git a/kittycad/models/rtc_ice_candidate.py b/kittycad/models/rtc_ice_candidate.py deleted file mode 100644 index 246f2f26b..000000000 --- a/kittycad/models/rtc_ice_candidate.py +++ /dev/null @@ -1,139 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -import attr - -from ..models.rtc_ice_candidate_type import RtcIceCandidateType -from ..models.rtc_ice_protocol import RtcIceProtocol -from ..types import UNSET, Unset - -TF = TypeVar("TF", bound="RtcIceCandidate") - - -@attr.s(auto_attribs=True) -class RtcIceCandidate: - """ICECandidate represents a ice candidate""" # noqa: E501 - - address: Union[Unset, str] = UNSET - component: Union[Unset, int] = UNSET - foundation: Union[Unset, str] = UNSET - port: Union[Unset, int] = UNSET - priority: Union[Unset, int] = UNSET - protocol: Union[Unset, RtcIceProtocol] = UNSET - related_address: Union[Unset, str] = UNSET - related_port: Union[Unset, int] = UNSET - stats_id: Union[Unset, str] = UNSET - tcp_type: Union[Unset, str] = UNSET - typ: Union[Unset, RtcIceCandidateType] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - address = self.address - component = self.component - foundation = self.foundation - port = self.port - priority = self.priority - if not isinstance(self.protocol, Unset): - protocol = self.protocol - related_address = self.related_address - related_port = self.related_port - stats_id = self.stats_id - tcp_type = self.tcp_type - if not isinstance(self.typ, Unset): - typ = self.typ - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if address is not UNSET: - field_dict["address"] = address - if component is not UNSET: - field_dict["component"] = component - if foundation is not UNSET: - field_dict["foundation"] = foundation - if port is not UNSET: - field_dict["port"] = port - if priority is not UNSET: - field_dict["priority"] = priority - if protocol is not UNSET: - field_dict["protocol"] = protocol - if related_address is not UNSET: - field_dict["related_address"] = related_address - if related_port is not UNSET: - field_dict["related_port"] = related_port - if stats_id is not UNSET: - field_dict["stats_id"] = stats_id - if tcp_type is not UNSET: - field_dict["tcp_type"] = tcp_type - if typ is not UNSET: - field_dict["typ"] = typ - - return field_dict - - @classmethod - def from_dict(cls: Type[TF], src_dict: Dict[str, Any]) -> TF: - d = src_dict.copy() - address = d.pop("address", UNSET) - - component = d.pop("component", UNSET) - - foundation = d.pop("foundation", UNSET) - - port = d.pop("port", UNSET) - - priority = d.pop("priority", UNSET) - - _protocol = d.pop("protocol", UNSET) - protocol: Union[Unset, RtcIceProtocol] - if isinstance(_protocol, Unset): - protocol = UNSET - else: - protocol = _protocol # type: ignore[arg-type] - - related_address = d.pop("related_address", UNSET) - - related_port = d.pop("related_port", UNSET) - - stats_id = d.pop("stats_id", UNSET) - - tcp_type = d.pop("tcp_type", UNSET) - - _typ = d.pop("typ", UNSET) - typ: Union[Unset, RtcIceCandidateType] - if isinstance(_typ, Unset): - typ = UNSET - else: - typ = _typ # type: ignore[arg-type] - - rtc_ice_candidate = cls( - address=address, - component=component, - foundation=foundation, - port=port, - priority=priority, - protocol=protocol, - related_address=related_address, - related_port=related_port, - stats_id=stats_id, - tcp_type=tcp_type, - typ=typ, - ) - - rtc_ice_candidate.additional_properties = d - return rtc_ice_candidate - - @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 diff --git a/kittycad/models/rtc_ice_candidate_init.py b/kittycad/models/rtc_ice_candidate_init.py index a68cdbd65..500a96f72 100644 --- a/kittycad/models/rtc_ice_candidate_init.py +++ b/kittycad/models/rtc_ice_candidate_init.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -HF = TypeVar("HF", bound="RtcIceCandidateInit") +TY = TypeVar("TY", bound="RtcIceCandidateInit") @attr.s(auto_attribs=True) @@ -39,7 +39,7 @@ class RtcIceCandidateInit: return field_dict @classmethod - def from_dict(cls: Type[HF], src_dict: Dict[str, Any]) -> HF: + def from_dict(cls: Type[TY], src_dict: Dict[str, Any]) -> TY: d = src_dict.copy() candidate = d.pop("candidate", UNSET) diff --git a/kittycad/models/rtc_ice_candidate_type.py b/kittycad/models/rtc_ice_candidate_type.py deleted file mode 100644 index 1f157b888..000000000 --- a/kittycad/models/rtc_ice_candidate_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class RtcIceCandidateType(str, Enum): - """ICECandidateType represents the type of the ICE candidate used.""" # noqa: E501 - - """# Unspecified indicates that the candidate type is unspecified. """ # noqa: E501 - UNSPECIFIED = "unspecified" - """# ICECandidateTypeHost indicates that the candidate is of Host type as described in . A candidate obtained by binding to a specific port from an IP address on the host. This includes IP addresses on physical interfaces and logical ones, such as ones obtained through VPNs. """ # noqa: E501 - HOST = "host" - """# ICECandidateTypeSrflx indicates the the candidate is of Server Reflexive type as described . A candidate type whose IP address and port are a binding allocated by a NAT for an ICE agent after it sends a packet through the NAT to a server, such as a STUN server. """ # noqa: E501 - SRFLX = "srflx" - """# ICECandidateTypePrflx indicates that the candidate is of Peer Reflexive type. A candidate type whose IP address and port are a binding allocated by a NAT for an ICE agent after it sends a packet through the NAT to its peer. """ # noqa: E501 - PRFLX = "prflx" - """# ICECandidateTypeRelay indicates the the candidate is of Relay type as described in . A candidate type obtained from a relay server, such as a TURN server. """ # noqa: E501 - RELAY = "relay" - - def __str__(self) -> str: - return str(self.value) diff --git a/kittycad/models/rtc_ice_protocol.py b/kittycad/models/rtc_ice_protocol.py deleted file mode 100644 index 351946309..000000000 --- a/kittycad/models/rtc_ice_protocol.py +++ /dev/null @@ -1,15 +0,0 @@ -from enum import Enum - - -class RtcIceProtocol(str, Enum): - """ICEProtocol indicates the transport protocol type that is used in the ice.URL structure.""" # noqa: E501 - - """# Unspecified indicates that the protocol is unspecified. """ # noqa: E501 - UNSPECIFIED = "unspecified" - """# UDP indicates the URL uses a UDP transport. """ # noqa: E501 - UDP = "udp" - """# TCP indicates the URL uses a TCP transport. """ # noqa: E501 - TCP = "tcp" - - def __str__(self) -> str: - return str(self.value) diff --git a/kittycad/models/rtc_session_description.py b/kittycad/models/rtc_session_description.py index caa697563..c21a30c65 100644 --- a/kittycad/models/rtc_session_description.py +++ b/kittycad/models/rtc_session_description.py @@ -5,7 +5,7 @@ import attr from ..models.rtc_sdp_type import RtcSdpType from ..types import UNSET, Unset -JD = TypeVar("JD", bound="RtcSessionDescription") +NC = TypeVar("NC", bound="RtcSessionDescription") @attr.s(auto_attribs=True) @@ -33,7 +33,7 @@ class RtcSessionDescription: return field_dict @classmethod - def from_dict(cls: Type[JD], src_dict: Dict[str, Any]) -> JD: + def from_dict(cls: Type[NC], src_dict: Dict[str, Any]) -> NC: d = src_dict.copy() sdp = d.pop("sdp", UNSET) diff --git a/kittycad/models/runtime.py b/kittycad/models/runtime.py index ff2e5e040..f74c857b3 100644 --- a/kittycad/models/runtime.py +++ b/kittycad/models/runtime.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -RZ = TypeVar("RZ", bound="Runtime") +GP = TypeVar("GP", bound="Runtime") @attr.s(auto_attribs=True) @@ -33,7 +33,7 @@ class Runtime: return field_dict @classmethod - def from_dict(cls: Type[RZ], src_dict: Dict[str, Any]) -> RZ: + def from_dict(cls: Type[GP], src_dict: Dict[str, Any]) -> GP: d = src_dict.copy() path = d.pop("path", UNSET) diff --git a/kittycad/models/scene_tool_type.py b/kittycad/models/scene_tool_type.py new file mode 100644 index 000000000..70354f3a2 --- /dev/null +++ b/kittycad/models/scene_tool_type.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class SceneToolType(str, Enum): + """The type of scene's active tool""" # noqa: E501 + + CAMERA_REVOLVE = "camera_revolve" + SELECT = "select" + MOVE = "move" + SKETCH_LINE = "sketch_line" + SKETCH_CURVE = "sketch_curve" + SKETCH_CURVE_MOD = "sketch_curve_mod" + + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/select_get.py b/kittycad/models/select_get.py new file mode 100644 index 000000000..4c188359f --- /dev/null +++ b/kittycad/models/select_get.py @@ -0,0 +1,57 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +import attr + +from ..types import UNSET, Unset + +FF = TypeVar("FF", bound="SelectGet") + + +@attr.s(auto_attribs=True) +class SelectGet: + """The response from the `SelectGet` command.""" # noqa: E501 + + entity_ids: Union[Unset, List[str]] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + entity_ids: Union[Unset, List[str]] = UNSET + if not isinstance(self.entity_ids, Unset): + entity_ids = self.entity_ids + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if entity_ids is not UNSET: + field_dict["entity_ids"] = entity_ids + + return field_dict + + @classmethod + def from_dict(cls: Type[FF], src_dict: Dict[str, Any]) -> FF: + d = src_dict.copy() + entity_ids = cast(List[str], d.pop("entity_ids", UNSET)) + + select_get = cls( + entity_ids=entity_ids, + ) + + select_get.additional_properties = d + return select_get + + @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 diff --git a/kittycad/models/select_with_point.py b/kittycad/models/select_with_point.py new file mode 100644 index 000000000..fad6f3499 --- /dev/null +++ b/kittycad/models/select_with_point.py @@ -0,0 +1,55 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +YO = TypeVar("YO", bound="SelectWithPoint") + + +@attr.s(auto_attribs=True) +class SelectWithPoint: + """The response from the `SelectWithPoint` command.""" # noqa: E501 + + entity_id: Union[Unset, str] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + entity_id = self.entity_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if entity_id is not UNSET: + field_dict["entity_id"] = entity_id + + return field_dict + + @classmethod + def from_dict(cls: Type[YO], src_dict: Dict[str, Any]) -> YO: + d = src_dict.copy() + entity_id = d.pop("entity_id", UNSET) + + select_with_point = cls( + entity_id=entity_id, + ) + + select_with_point.additional_properties = d + return select_with_point + + @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 diff --git a/kittycad/models/session.py b/kittycad/models/session.py index 7769d9c89..1900f9301 100644 --- a/kittycad/models/session.py +++ b/kittycad/models/session.py @@ -7,7 +7,7 @@ from dateutil.parser import isoparse from ..models.uuid import Uuid from ..types import UNSET, Unset -BH = TypeVar("BH", bound="Session") +FS = TypeVar("FS", bound="Session") @attr.s(auto_attribs=True) @@ -58,7 +58,7 @@ class Session: return field_dict @classmethod - def from_dict(cls: Type[BH], src_dict: Dict[str, Any]) -> BH: + def from_dict(cls: Type[FS], src_dict: Dict[str, Any]) -> FS: d = src_dict.copy() _created_at = d.pop("created_at", UNSET) created_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/snake_case_result.py b/kittycad/models/snake_case_result.py deleted file mode 100644 index 9d34b23be..000000000 --- a/kittycad/models/snake_case_result.py +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Any - -SnakeCaseResult = Any diff --git a/kittycad/models/solid3d_get_all_edge_faces.py b/kittycad/models/solid3d_get_all_edge_faces.py new file mode 100644 index 000000000..0c85efcde --- /dev/null +++ b/kittycad/models/solid3d_get_all_edge_faces.py @@ -0,0 +1,57 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +import attr + +from ..types import UNSET, Unset + +WN = TypeVar("WN", bound="Solid3dGetAllEdgeFaces") + + +@attr.s(auto_attribs=True) +class Solid3dGetAllEdgeFaces: + """The response from the `Solid3dGetAllEdgeFaces` command.""" # noqa: E501 + + faces: Union[Unset, List[str]] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + faces: Union[Unset, List[str]] = UNSET + if not isinstance(self.faces, Unset): + faces = self.faces + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if faces is not UNSET: + field_dict["faces"] = faces + + return field_dict + + @classmethod + def from_dict(cls: Type[WN], src_dict: Dict[str, Any]) -> WN: + d = src_dict.copy() + faces = cast(List[str], d.pop("faces", UNSET)) + + solid3d_get_all_edge_faces = cls( + faces=faces, + ) + + solid3d_get_all_edge_faces.additional_properties = d + return solid3d_get_all_edge_faces + + @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 diff --git a/kittycad/models/solid3d_get_all_opposite_edges.py b/kittycad/models/solid3d_get_all_opposite_edges.py new file mode 100644 index 000000000..80d1eb9f2 --- /dev/null +++ b/kittycad/models/solid3d_get_all_opposite_edges.py @@ -0,0 +1,57 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +import attr + +from ..types import UNSET, Unset + +EQ = TypeVar("EQ", bound="Solid3dGetAllOppositeEdges") + + +@attr.s(auto_attribs=True) +class Solid3dGetAllOppositeEdges: + """The response from the `Solid3dGetAllOppositeEdges` command.""" # noqa: E501 + + edges: Union[Unset, List[str]] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + edges: Union[Unset, List[str]] = UNSET + if not isinstance(self.edges, Unset): + edges = self.edges + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if edges is not UNSET: + field_dict["edges"] = edges + + return field_dict + + @classmethod + def from_dict(cls: Type[EQ], src_dict: Dict[str, Any]) -> EQ: + d = src_dict.copy() + edges = cast(List[str], d.pop("edges", UNSET)) + + solid3d_get_all_opposite_edges = cls( + edges=edges, + ) + + solid3d_get_all_opposite_edges.additional_properties = d + return solid3d_get_all_opposite_edges + + @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 diff --git a/kittycad/models/solid3d_get_next_adjacent_edge.py b/kittycad/models/solid3d_get_next_adjacent_edge.py new file mode 100644 index 000000000..42ddd1e0e --- /dev/null +++ b/kittycad/models/solid3d_get_next_adjacent_edge.py @@ -0,0 +1,55 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +UW = TypeVar("UW", bound="Solid3dGetNextAdjacentEdge") + + +@attr.s(auto_attribs=True) +class Solid3dGetNextAdjacentEdge: + """The response from the `Solid3dGetNextAdjacentEdge` command.""" # noqa: E501 + + edge: Union[Unset, str] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + edge = self.edge + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if edge is not UNSET: + field_dict["edge"] = edge + + return field_dict + + @classmethod + def from_dict(cls: Type[UW], src_dict: Dict[str, Any]) -> UW: + d = src_dict.copy() + edge = d.pop("edge", UNSET) + + solid3d_get_next_adjacent_edge = cls( + edge=edge, + ) + + solid3d_get_next_adjacent_edge.additional_properties = d + return solid3d_get_next_adjacent_edge + + @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 diff --git a/kittycad/models/solid3d_get_opposite_edge.py b/kittycad/models/solid3d_get_opposite_edge.py new file mode 100644 index 000000000..cebc3988f --- /dev/null +++ b/kittycad/models/solid3d_get_opposite_edge.py @@ -0,0 +1,55 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +MD = TypeVar("MD", bound="Solid3dGetOppositeEdge") + + +@attr.s(auto_attribs=True) +class Solid3dGetOppositeEdge: + """The response from the `Solid3dGetOppositeEdge` command.""" # noqa: E501 + + edge: Union[Unset, str] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + edge = self.edge + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if edge is not UNSET: + field_dict["edge"] = edge + + return field_dict + + @classmethod + def from_dict(cls: Type[MD], src_dict: Dict[str, Any]) -> MD: + d = src_dict.copy() + edge = d.pop("edge", UNSET) + + solid3d_get_opposite_edge = cls( + edge=edge, + ) + + solid3d_get_opposite_edge.additional_properties = d + return solid3d_get_opposite_edge + + @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 diff --git a/kittycad/models/solid3d_get_prev_adjacent_edge.py b/kittycad/models/solid3d_get_prev_adjacent_edge.py new file mode 100644 index 000000000..741b26dcf --- /dev/null +++ b/kittycad/models/solid3d_get_prev_adjacent_edge.py @@ -0,0 +1,55 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +HD = TypeVar("HD", bound="Solid3dGetPrevAdjacentEdge") + + +@attr.s(auto_attribs=True) +class Solid3dGetPrevAdjacentEdge: + """The response from the `Solid3dGetPrevAdjacentEdge` command.""" # noqa: E501 + + edge: Union[Unset, str] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + edge = self.edge + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if edge is not UNSET: + field_dict["edge"] = edge + + return field_dict + + @classmethod + def from_dict(cls: Type[HD], src_dict: Dict[str, Any]) -> HD: + d = src_dict.copy() + edge = d.pop("edge", UNSET) + + solid3d_get_prev_adjacent_edge = cls( + edge=edge, + ) + + solid3d_get_prev_adjacent_edge.additional_properties = d + return solid3d_get_prev_adjacent_edge + + @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 diff --git a/kittycad/models/stl_storage.py b/kittycad/models/stl_storage.py new file mode 100644 index 000000000..1f9fc8f62 --- /dev/null +++ b/kittycad/models/stl_storage.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class StlStorage(str, Enum): + """Export storage.""" # noqa: E501 + + """# Plaintext encoding. """ # noqa: E501 + ASCII = "ascii" + """# Binary STL encoding. + +This is the default setting. """ # noqa: E501 + BINARY = "binary" + + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/success_web_socket_response.py b/kittycad/models/success_web_socket_response.py new file mode 100644 index 000000000..ebe82973b --- /dev/null +++ b/kittycad/models/success_web_socket_response.py @@ -0,0 +1,76 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..models.ok_web_socket_response_data import OkWebSocketResponseData +from ..types import UNSET, Unset + +UJ = TypeVar("UJ", bound="SuccessWebSocketResponse") + + +@attr.s(auto_attribs=True) +class SuccessWebSocketResponse: + """Successful Websocket response.""" # noqa: E501 + + request_id: Union[Unset, str] = UNSET + resp: Union[Unset, OkWebSocketResponseData] = UNSET + success: Union[Unset, bool] = False + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + request_id = self.request_id + if not isinstance(self.resp, Unset): + resp = self.resp + success = self.success + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if request_id is not UNSET: + field_dict["request_id"] = request_id + if resp is not UNSET: + field_dict["resp"] = resp + if success is not UNSET: + field_dict["success"] = success + + return field_dict + + @classmethod + def from_dict(cls: Type[UJ], src_dict: Dict[str, Any]) -> UJ: + d = src_dict.copy() + request_id = d.pop("request_id", UNSET) + + _resp = d.pop("resp", UNSET) + resp: Union[Unset, OkWebSocketResponseData] + if isinstance(_resp, Unset): + resp = UNSET + else: + resp = _resp # type: ignore[arg-type] + + success = d.pop("success", UNSET) + + success_web_socket_response = cls( + request_id=request_id, + resp=resp, + success=success, + ) + + success_web_socket_response.additional_properties = d + return success_web_socket_response + + @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 diff --git a/kittycad/models/system.py b/kittycad/models/system.py index d2ceff262..d8c268476 100644 --- a/kittycad/models/system.py +++ b/kittycad/models/system.py @@ -5,7 +5,7 @@ import attr from ..models.axis_direction_pair import AxisDirectionPair from ..types import UNSET, Unset -SX = TypeVar("SX", bound="System") +RU = TypeVar("RU", bound="System") @attr.s(auto_attribs=True) @@ -41,7 +41,7 @@ class System: return field_dict @classmethod - def from_dict(cls: Type[SX], src_dict: Dict[str, Any]) -> SX: + def from_dict(cls: Type[RU], src_dict: Dict[str, Any]) -> RU: d = src_dict.copy() _forward = d.pop("forward", UNSET) forward: Union[Unset, AxisDirectionPair] diff --git a/kittycad/models/system_info_default_address_pools.py b/kittycad/models/system_info_default_address_pools.py index 91b9aabaa..1f4e6d256 100644 --- a/kittycad/models/system_info_default_address_pools.py +++ b/kittycad/models/system_info_default_address_pools.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -CN = TypeVar("CN", bound="SystemInfoDefaultAddressPools") +DL = TypeVar("DL", bound="SystemInfoDefaultAddressPools") @attr.s(auto_attribs=True) @@ -29,7 +29,7 @@ class SystemInfoDefaultAddressPools: return field_dict @classmethod - def from_dict(cls: Type[CN], src_dict: Dict[str, Any]) -> CN: + def from_dict(cls: Type[DL], src_dict: Dict[str, Any]) -> DL: d = src_dict.copy() base = d.pop("base", UNSET) diff --git a/kittycad/models/take_snapshot.py b/kittycad/models/take_snapshot.py new file mode 100644 index 000000000..41e22e964 --- /dev/null +++ b/kittycad/models/take_snapshot.py @@ -0,0 +1,63 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..models.base64data import Base64Data +from ..types import UNSET, Unset + +QT = TypeVar("QT", bound="TakeSnapshot") + + +@attr.s(auto_attribs=True) +class TakeSnapshot: + """The response from the `TakeSnapshot` command.""" # noqa: E501 + + contents: Union[Unset, Base64Data] = UNSET + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + contents: Union[Unset, str] = UNSET + if not isinstance(self.contents, Unset): + contents = self.contents.get_encoded() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if contents is not UNSET: + field_dict["contents"] = contents + + return field_dict + + @classmethod + def from_dict(cls: Type[QT], src_dict: Dict[str, Any]) -> QT: + d = src_dict.copy() + _contents = d.pop("contents", UNSET) + contents: Union[Unset, Base64Data] + if isinstance(_contents, Unset): + contents = UNSET + else: + contents = Base64Data(bytes(_contents, "utf-8")) + + take_snapshot = cls( + contents=contents, + ) + + take_snapshot.additional_properties = d + return take_snapshot + + @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 diff --git a/kittycad/models/unit_angle_conversion.py b/kittycad/models/unit_angle_conversion.py index 60b50db0f..5139f71a2 100644 --- a/kittycad/models/unit_angle_conversion.py +++ b/kittycad/models/unit_angle_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_angle import UnitAngle from ..models.uuid import Uuid from ..types import UNSET, Unset -GS = TypeVar("GS", bound="UnitAngleConversion") +PT = TypeVar("PT", bound="UnitAngleConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitAngleConversion: return field_dict @classmethod - def from_dict(cls: Type[GS], src_dict: Dict[str, Any]) -> GS: + def from_dict(cls: Type[PT], src_dict: Dict[str, Any]) -> PT: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_area_conversion.py b/kittycad/models/unit_area_conversion.py index 64bec4adb..82ea17818 100644 --- a/kittycad/models/unit_area_conversion.py +++ b/kittycad/models/unit_area_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_area import UnitArea from ..models.uuid import Uuid from ..types import UNSET, Unset -SO = TypeVar("SO", bound="UnitAreaConversion") +HR = TypeVar("HR", bound="UnitAreaConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitAreaConversion: return field_dict @classmethod - def from_dict(cls: Type[SO], src_dict: Dict[str, Any]) -> SO: + def from_dict(cls: Type[HR], src_dict: Dict[str, Any]) -> HR: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_current_conversion.py b/kittycad/models/unit_current_conversion.py index 9bcbc4420..95b8d07a0 100644 --- a/kittycad/models/unit_current_conversion.py +++ b/kittycad/models/unit_current_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_current import UnitCurrent from ..models.uuid import Uuid from ..types import UNSET, Unset -ZS = TypeVar("ZS", bound="UnitCurrentConversion") +VF = TypeVar("VF", bound="UnitCurrentConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitCurrentConversion: return field_dict @classmethod - def from_dict(cls: Type[ZS], src_dict: Dict[str, Any]) -> ZS: + def from_dict(cls: Type[VF], src_dict: Dict[str, Any]) -> VF: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_energy_conversion.py b/kittycad/models/unit_energy_conversion.py index 0056f5bed..b0dd96e3e 100644 --- a/kittycad/models/unit_energy_conversion.py +++ b/kittycad/models/unit_energy_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_energy import UnitEnergy from ..models.uuid import Uuid from ..types import UNSET, Unset -AM = TypeVar("AM", bound="UnitEnergyConversion") +VM = TypeVar("VM", bound="UnitEnergyConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitEnergyConversion: return field_dict @classmethod - def from_dict(cls: Type[AM], src_dict: Dict[str, Any]) -> AM: + def from_dict(cls: Type[VM], src_dict: Dict[str, Any]) -> VM: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_force_conversion.py b/kittycad/models/unit_force_conversion.py index 182b1a825..3ed826a1a 100644 --- a/kittycad/models/unit_force_conversion.py +++ b/kittycad/models/unit_force_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_force import UnitForce from ..models.uuid import Uuid from ..types import UNSET, Unset -GK = TypeVar("GK", bound="UnitForceConversion") +WH = TypeVar("WH", bound="UnitForceConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitForceConversion: return field_dict @classmethod - def from_dict(cls: Type[GK], src_dict: Dict[str, Any]) -> GK: + def from_dict(cls: Type[WH], src_dict: Dict[str, Any]) -> WH: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_frequency_conversion.py b/kittycad/models/unit_frequency_conversion.py index 0acc85d00..e004a7900 100644 --- a/kittycad/models/unit_frequency_conversion.py +++ b/kittycad/models/unit_frequency_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_frequency import UnitFrequency from ..models.uuid import Uuid from ..types import UNSET, Unset -SG = TypeVar("SG", bound="UnitFrequencyConversion") +DQ = TypeVar("DQ", bound="UnitFrequencyConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitFrequencyConversion: return field_dict @classmethod - def from_dict(cls: Type[SG], src_dict: Dict[str, Any]) -> SG: + def from_dict(cls: Type[DQ], src_dict: Dict[str, Any]) -> DQ: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_length_conversion.py b/kittycad/models/unit_length_conversion.py index 96e809f23..2651e54d6 100644 --- a/kittycad/models/unit_length_conversion.py +++ b/kittycad/models/unit_length_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_length import UnitLength from ..models.uuid import Uuid from ..types import UNSET, Unset -QZ = TypeVar("QZ", bound="UnitLengthConversion") +UY = TypeVar("UY", bound="UnitLengthConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitLengthConversion: return field_dict @classmethod - def from_dict(cls: Type[QZ], src_dict: Dict[str, Any]) -> QZ: + def from_dict(cls: Type[UY], src_dict: Dict[str, Any]) -> UY: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_mass_conversion.py b/kittycad/models/unit_mass_conversion.py index da31e9bba..591ee9571 100644 --- a/kittycad/models/unit_mass_conversion.py +++ b/kittycad/models/unit_mass_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_mass import UnitMass from ..models.uuid import Uuid from ..types import UNSET, Unset -SY = TypeVar("SY", bound="UnitMassConversion") +PD = TypeVar("PD", bound="UnitMassConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitMassConversion: return field_dict @classmethod - def from_dict(cls: Type[SY], src_dict: Dict[str, Any]) -> SY: + def from_dict(cls: Type[PD], src_dict: Dict[str, Any]) -> PD: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_power_conversion.py b/kittycad/models/unit_power_conversion.py index 15bebe0f6..bd07ba152 100644 --- a/kittycad/models/unit_power_conversion.py +++ b/kittycad/models/unit_power_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_power import UnitPower from ..models.uuid import Uuid from ..types import UNSET, Unset -YK = TypeVar("YK", bound="UnitPowerConversion") +SM = TypeVar("SM", bound="UnitPowerConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitPowerConversion: return field_dict @classmethod - def from_dict(cls: Type[YK], src_dict: Dict[str, Any]) -> YK: + def from_dict(cls: Type[SM], src_dict: Dict[str, Any]) -> SM: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_pressure_conversion.py b/kittycad/models/unit_pressure_conversion.py index 41f02cc54..149ccb58f 100644 --- a/kittycad/models/unit_pressure_conversion.py +++ b/kittycad/models/unit_pressure_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_pressure import UnitPressure from ..models.uuid import Uuid from ..types import UNSET, Unset -WS = TypeVar("WS", bound="UnitPressureConversion") +JL = TypeVar("JL", bound="UnitPressureConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitPressureConversion: return field_dict @classmethod - def from_dict(cls: Type[WS], src_dict: Dict[str, Any]) -> WS: + def from_dict(cls: Type[JL], src_dict: Dict[str, Any]) -> JL: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_temperature_conversion.py b/kittycad/models/unit_temperature_conversion.py index 5c4e0d7c7..76fdec326 100644 --- a/kittycad/models/unit_temperature_conversion.py +++ b/kittycad/models/unit_temperature_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_temperature import UnitTemperature from ..models.uuid import Uuid from ..types import UNSET, Unset -SL = TypeVar("SL", bound="UnitTemperatureConversion") +CG = TypeVar("CG", bound="UnitTemperatureConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitTemperatureConversion: return field_dict @classmethod - def from_dict(cls: Type[SL], src_dict: Dict[str, Any]) -> SL: + def from_dict(cls: Type[CG], src_dict: Dict[str, Any]) -> CG: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_torque_conversion.py b/kittycad/models/unit_torque_conversion.py index 904065fc8..d1c7d1d69 100644 --- a/kittycad/models/unit_torque_conversion.py +++ b/kittycad/models/unit_torque_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_torque import UnitTorque from ..models.uuid import Uuid from ..types import UNSET, Unset -MK = TypeVar("MK", bound="UnitTorqueConversion") +QA = TypeVar("QA", bound="UnitTorqueConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitTorqueConversion: return field_dict @classmethod - def from_dict(cls: Type[MK], src_dict: Dict[str, Any]) -> MK: + def from_dict(cls: Type[QA], src_dict: Dict[str, Any]) -> QA: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/unit_volume_conversion.py b/kittycad/models/unit_volume_conversion.py index bb2bcb42e..4919ea272 100644 --- a/kittycad/models/unit_volume_conversion.py +++ b/kittycad/models/unit_volume_conversion.py @@ -9,7 +9,7 @@ from ..models.unit_volume import UnitVolume from ..models.uuid import Uuid from ..types import UNSET, Unset -TU = TypeVar("TU", bound="UnitVolumeConversion") +ZB = TypeVar("ZB", bound="UnitVolumeConversion") @attr.s(auto_attribs=True) @@ -87,7 +87,7 @@ class UnitVolumeConversion: return field_dict @classmethod - def from_dict(cls: Type[TU], src_dict: Dict[str, Any]) -> TU: + def from_dict(cls: Type[ZB], src_dict: Dict[str, Any]) -> ZB: d = src_dict.copy() _completed_at = d.pop("completed_at", UNSET) completed_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/update_user.py b/kittycad/models/update_user.py index a939c7ab0..6c58dc5bb 100644 --- a/kittycad/models/update_user.py +++ b/kittycad/models/update_user.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -FY = TypeVar("FY", bound="UpdateUser") +AU = TypeVar("AU", bound="UpdateUser") @attr.s(auto_attribs=True) @@ -47,7 +47,7 @@ class UpdateUser: return field_dict @classmethod - def from_dict(cls: Type[FY], src_dict: Dict[str, Any]) -> FY: + def from_dict(cls: Type[AU], src_dict: Dict[str, Any]) -> AU: d = src_dict.copy() company = d.pop("company", UNSET) diff --git a/kittycad/models/user.py b/kittycad/models/user.py index 2f819ba46..9ee4cb831 100644 --- a/kittycad/models/user.py +++ b/kittycad/models/user.py @@ -6,7 +6,7 @@ from dateutil.parser import isoparse from ..types import UNSET, Unset -FD = TypeVar("FD", bound="User") +FX = TypeVar("FX", bound="User") @attr.s(auto_attribs=True) @@ -83,7 +83,7 @@ class User: return field_dict @classmethod - def from_dict(cls: Type[FD], src_dict: Dict[str, Any]) -> FD: + def from_dict(cls: Type[FX], src_dict: Dict[str, Any]) -> FX: d = src_dict.copy() company = d.pop("company", UNSET) diff --git a/kittycad/models/user_results_page.py b/kittycad/models/user_results_page.py index 7794fcc3d..981c75cc1 100644 --- a/kittycad/models/user_results_page.py +++ b/kittycad/models/user_results_page.py @@ -4,7 +4,7 @@ import attr from ..types import UNSET, Unset -TZ = TypeVar("TZ", bound="UserResultsPage") +BL = TypeVar("BL", bound="UserResultsPage") @attr.s(auto_attribs=True) @@ -37,7 +37,7 @@ class UserResultsPage: return field_dict @classmethod - def from_dict(cls: Type[TZ], src_dict: Dict[str, Any]) -> TZ: + def from_dict(cls: Type[BL], src_dict: Dict[str, Any]) -> BL: d = src_dict.copy() from ..models.user import User diff --git a/kittycad/models/verification_token.py b/kittycad/models/verification_token.py index 2d5361c27..d1ef3ef35 100644 --- a/kittycad/models/verification_token.py +++ b/kittycad/models/verification_token.py @@ -6,7 +6,7 @@ from dateutil.parser import isoparse from ..types import UNSET, Unset -AX = TypeVar("AX", bound="VerificationToken") +KU = TypeVar("KU", bound="VerificationToken") @attr.s(auto_attribs=True) @@ -53,7 +53,7 @@ class VerificationToken: return field_dict @classmethod - def from_dict(cls: Type[AX], src_dict: Dict[str, Any]) -> AX: + def from_dict(cls: Type[KU], src_dict: Dict[str, Any]) -> KU: d = src_dict.copy() _created_at = d.pop("created_at", UNSET) created_at: Union[Unset, datetime.datetime] diff --git a/kittycad/models/web_socket_messages.py b/kittycad/models/web_socket_request.py similarity index 77% rename from kittycad/models/web_socket_messages.py rename to kittycad/models/web_socket_request.py index a253d75ab..1aa577dbf 100644 --- a/kittycad/models/web_socket_messages.py +++ b/kittycad/models/web_socket_request.py @@ -8,7 +8,7 @@ from ..models.rtc_ice_candidate_init import RtcIceCandidateInit from ..models.rtc_session_description import RtcSessionDescription from ..types import UNSET, Unset -RQ = TypeVar("RQ", bound="trickle_ice") +PZ = TypeVar("PZ", bound="trickle_ice") @attr.s(auto_attribs=True) @@ -35,7 +35,7 @@ class trickle_ice: return field_dict @classmethod - def from_dict(cls: Type[RQ], src_dict: Dict[str, Any]) -> RQ: + def from_dict(cls: Type[PZ], src_dict: Dict[str, Any]) -> PZ: d = src_dict.copy() _candidate = d.pop("candidate", UNSET) candidate: Union[Unset, RtcIceCandidateInit] @@ -71,7 +71,7 @@ class trickle_ice: return key in self.additional_properties -ZL = TypeVar("ZL", bound="sdp_offer") +FA = TypeVar("FA", bound="sdp_offer") @attr.s(auto_attribs=True) @@ -98,7 +98,7 @@ class sdp_offer: return field_dict @classmethod - def from_dict(cls: Type[ZL], src_dict: Dict[str, Any]) -> ZL: + def from_dict(cls: Type[FA], src_dict: Dict[str, Any]) -> FA: d = src_dict.copy() _offer = d.pop("offer", UNSET) offer: Union[Unset, RtcSessionDescription] @@ -134,7 +134,7 @@ class sdp_offer: return key in self.additional_properties -CM = TypeVar("CM", bound="modeling_cmd_req") +GE = TypeVar("GE", bound="modeling_cmd_req") @attr.s(auto_attribs=True) @@ -166,7 +166,7 @@ class modeling_cmd_req: return field_dict @classmethod - def from_dict(cls: Type[CM], src_dict: Dict[str, Any]) -> CM: + def from_dict(cls: Type[GE], src_dict: Dict[str, Any]) -> GE: d = src_dict.copy() _cmd = d.pop("cmd", UNSET) cmd: Union[Unset, ModelingCmd] @@ -210,4 +210,54 @@ class modeling_cmd_req: return key in self.additional_properties -WebSocketMessages = Union[trickle_ice, sdp_offer, modeling_cmd_req] +JG = TypeVar("JG", bound="ping") + + +@attr.s(auto_attribs=True) +class ping: + """The client-to-server Ping to ensure the WebSocket stays alive.""" # noqa: E501 + + type: str = "ping" + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + type = self.type + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + field_dict["type"] = type + + return field_dict + + @classmethod + def from_dict(cls: Type[JG], src_dict: Dict[str, Any]) -> JG: + d = src_dict.copy() + type = d.pop("type", UNSET) + + ping = cls( + type=type, + ) + + ping.additional_properties = d + return ping + + @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 + + +WebSocketRequest = Union[trickle_ice, sdp_offer, modeling_cmd_req, ping] diff --git a/kittycad/models/web_socket_response.py b/kittycad/models/web_socket_response.py new file mode 100644 index 000000000..7c1faa8f1 --- /dev/null +++ b/kittycad/models/web_socket_response.py @@ -0,0 +1,6 @@ +from typing import Union + +from .failure_web_socket_response import FailureWebSocketResponse +from .success_web_socket_response import SuccessWebSocketResponse + +WebSocketResponse = Union[SuccessWebSocketResponse, FailureWebSocketResponse] diff --git a/pyproject.toml b/pyproject.toml index df9fa5d09..dad9848b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "kittycad" -version = "0.5.0" +version = "0.5.1" description = "A client library for accessing KittyCAD" authors = [] diff --git a/spec.json b/spec.json index bba341aaf..5f437395c 100644 --- a/spec.json +++ b/spec.json @@ -635,6 +635,28 @@ ], "type": "object" }, + "ApiError": { + "description": "An error.", + "properties": { + "error_code": { + "allOf": [ + { + "$ref": "#/components/schemas/ErrorCode" + } + ], + "description": "The error code." + }, + "message": { + "description": "The error message.", + "type": "string" + } + }, + "required": [ + "error_code", + "message" + ], + "type": "object" + }, "ApiToken": { "description": "An API token.\n\nThese are used to authenticate users with Bearer authentication.", "properties": { @@ -4890,6 +4912,47 @@ } ] }, + "CurveGetControlPoints": { + "description": "The response from the `CurveGetControlPoints` command.", + "properties": { + "control_points": { + "description": "Control points in the curve.", + "items": { + "$ref": "#/components/schemas/Point3d" + }, + "type": "array" + } + }, + "required": [ + "control_points" + ], + "type": "object" + }, + "CurveGetType": { + "description": "The response from the `CurveGetType` command.", + "properties": { + "curve_type": { + "allOf": [ + { + "$ref": "#/components/schemas/CurveType" + } + ], + "description": "Curve type" + } + }, + "required": [ + "curve_type" + ], + "type": "object" + }, + "CurveType": { + "description": "The type of Curve (embedded within path)", + "enum": [ + "line", + "nurbs" + ], + "type": "string" + }, "Customer": { "description": "The resource representing a payment \"Customer\".", "properties": { @@ -5493,28 +5556,6 @@ ], "type": "object" }, - "EngineError": { - "description": "An error.", - "properties": { - "error_code": { - "allOf": [ - { - "$ref": "#/components/schemas/ErrorCode" - } - ], - "description": "The error code." - }, - "message": { - "description": "The error message.", - "type": "string" - } - }, - "required": [ - "error_code", - "message" - ], - "type": "object" - }, "EngineMetadata": { "description": "Metadata about our currently running server.\n\nThis is mostly used for internal purposes and debugging.", "properties": { @@ -5569,6 +5610,66 @@ ], "type": "object" }, + "EntityGetAllChildUuids": { + "description": "The response from the `EntityGetAllChildUuids` command.", + "properties": { + "entity_ids": { + "description": "The UUIDs of the child entities.", + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "entity_ids" + ], + "type": "object" + }, + "EntityGetChildUuid": { + "description": "The response from the `EntityGetChildUuid` command.", + "properties": { + "entity_id": { + "description": "The UUID of the child entity.", + "format": "uuid", + "type": "string" + } + }, + "required": [ + "entity_id" + ], + "type": "object" + }, + "EntityGetNumChildren": { + "description": "The response from the `EntityGetNumChildren` command.", + "properties": { + "num": { + "description": "The number of children the entity has.", + "format": "uint32", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "num" + ], + "type": "object" + }, + "EntityGetParentId": { + "description": "The response from the `EntityGetParentId` command.", + "properties": { + "entity_id": { + "description": "The UUID of the parent entity.", + "format": "uuid", + "type": "string" + } + }, + "required": [ + "entity_id" + ], + "type": "object" + }, "EntityType": { "description": "The type of entity", "enum": [ @@ -5579,7 +5680,8 @@ "solid2d", "solid3d", "edge", - "face" + "face", + "plane" ], "type": "string" }, @@ -5629,40 +5731,59 @@ "type": "object" }, "ErrorCode": { - "description": "The type of errorcode.", + "description": "The type of error sent by the KittyCAD API.", "oneOf": [ { - "description": "User requested something impossible or invalid", + "description": "Graphics engine failed to complete request, consider retrying", + "enum": [ + "internal_engine" + ], + "type": "string" + }, + { + "description": "API failed to complete request, consider retrying", + "enum": [ + "internal_api" + ], + "type": "string" + }, + { + "description": "User requested something geometrically or graphically impossible. Don't retry this request, as it's inherently impossible. Instead, read the error message and change your request.", "enum": [ "bad_request" ], "type": "string" }, { - "description": "Engine failed to complete request, consider retrying", + "description": "Client sent invalid JSON.", "enum": [ - "internal_engine" + "invalid_json" + ], + "type": "string" + }, + { + "description": "Problem sending data between client and KittyCAD API.", + "enum": [ + "connection_problem" + ], + "type": "string" + }, + { + "description": "Client sent a Websocket message type which the KittyCAD API does not handle.", + "enum": [ + "message_type_not_accepted" + ], + "type": "string" + }, + { + "description": "Client sent a Websocket message intended for WebRTC but it was configured as a WebRTC connection.", + "enum": [ + "message_type_not_accepted_for_web_r_t_c" ], "type": "string" } ] }, - "ErrorResponse": { - "description": "The error response.", - "properties": { - "errors": { - "description": "A list of errors.", - "items": { - "$ref": "#/components/schemas/EngineError" - }, - "type": "array" - } - }, - "required": [ - "errors" - ], - "type": "object" - }, "ExecutorMetadata": { "description": "Metadata about our currently running server.\n\nThis is mostly used for internal purposes and debugging.", "properties": { @@ -5694,6 +5815,22 @@ ], "type": "object" }, + "Export": { + "description": "The response from the `Export` endpoint.", + "properties": { + "files": { + "description": "The files that were exported.", + "items": { + "$ref": "#/components/schemas/ExportFile" + }, + "type": "array" + } + }, + "required": [ + "files" + ], + "type": "object" + }, "ExportFile": { "description": "A file to be exported to the client.", "properties": { @@ -5826,6 +5963,52 @@ ], "type": "object" }, + "FailureWebSocketResponse": { + "description": "Unsuccessful Websocket response.", + "properties": { + "errors": { + "description": "The errors that occurred.", + "items": { + "$ref": "#/components/schemas/ApiError" + }, + "type": "array" + }, + "request_id": { + "description": "Which request this is a response to. If the request was a modeling command, this is the modeling command ID. If no request ID was sent, this will be null.", + "format": "uuid", + "nullable": true, + "type": "string" + }, + "success": { + "description": "Always false", + "type": "boolean" + } + }, + "required": [ + "errors", + "success" + ], + "type": "object" + }, + "FbxStorage": { + "description": "Describes the storage format of an FBX file.", + "oneOf": [ + { + "description": "ASCII FBX encoding.", + "enum": [ + "ascii" + ], + "type": "string" + }, + { + "description": "Binary FBX encoding.", + "enum": [ + "binary" + ], + "type": "string" + } + ] + }, "FileCenterOfMass": { "description": "A file center of mass result.", "properties": { @@ -6138,7 +6321,21 @@ "description": "The valid types of output file formats.", "oneOf": [ { - "description": "glTF 2.0. We refer to this as glTF since that is how our customers refer to it, although by default it will be in binary format and thus technically (glb).", + "description": "Autodesk Filmbox (FBX) format. ", + "enum": [ + "fbx" + ], + "type": "string" + }, + { + "description": "Binary glTF 2.0.\n\nThis is a single binary with .glb extension.\n\nThis is better if you want a compressed format as opposed to the human readable glTF that lacks compression.", + "enum": [ + "glb" + ], + "type": "string" + }, + { + "description": "glTF 2.0. Embedded glTF 2.0 (pretty printed).\n\nSingle JSON file with .gltf extension binary data encoded as base64 data URIs.\n\nThe JSON contents are pretty printed.\n\nIt is human readable, single file, and you can view the diff easily in a git commit.", "enum": [ "gltf" ], @@ -6177,6 +6374,13 @@ "FileImportFormat": { "description": "The valid types of source file formats.", "oneOf": [ + { + "description": "Autodesk Filmbox (FBX) format. ", + "enum": [ + "fbx" + ], + "type": "string" + }, { "description": "glTF 2.0.", "enum": [ @@ -6537,6 +6741,87 @@ }, "type": "object" }, + "GetEntityType": { + "description": "The response from the `GetEntityType` command.", + "properties": { + "entity_type": { + "allOf": [ + { + "$ref": "#/components/schemas/EntityType" + } + ], + "description": "The type of the entity." + } + }, + "required": [ + "entity_type" + ], + "type": "object" + }, + "GltfPresentation": { + "description": "Describes the presentation style of the glTF JSON.", + "oneOf": [ + { + "description": "Condense the JSON into the smallest possible size.", + "enum": [ + "compact" + ], + "type": "string" + }, + { + "description": "Expand the JSON into a more human readable format.\n\nThis is the default setting.", + "enum": [ + "pretty" + ], + "type": "string" + } + ] + }, + "GltfStorage": { + "description": "Describes the storage format of a glTF 2.0 scene.", + "oneOf": [ + { + "description": "Binary glTF 2.0.\n\nThis is a single binary with .glb extension.", + "enum": [ + "binary" + ], + "type": "string" + }, + { + "description": "Standard glTF 2.0.\n\nThis is a JSON file with .gltf extension paired with a separate binary blob file with .bin extension.", + "enum": [ + "standard" + ], + "type": "string" + }, + { + "description": "Embedded glTF 2.0.\n\nSingle JSON file with .gltf extension binary data encoded as base64 data URIs.\n\nThis is the default setting.", + "enum": [ + "embedded" + ], + "type": "string" + } + ] + }, + "HighlightSetEntity": { + "description": "The response from the `HighlightSetEntity` command.", + "properties": { + "entity_id": { + "description": "The UUID of the entity that was highlighted.", + "format": "uuid", + "nullable": true, + "type": "string" + }, + "sequence": { + "description": "If the client sent a sequence ID with its request, the backend sends it back.", + "format": "uint32", + "minimum": 0, + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, "IceServer": { "description": "Representation of an ICE server used for STUN/TURN Used to initiate WebRTC connections based on ", "properties": { @@ -6563,6 +6848,25 @@ ], "type": "object" }, + "ImageFormat": { + "description": "Enum containing the variety of image formats snapshots may be exported to.", + "oneOf": [ + { + "description": ".png format", + "enum": [ + "png" + ], + "type": "string" + }, + { + "description": ".jpeg format", + "enum": [ + "jpeg" + ], + "type": "string" + } + ] + }, "ImageType": { "description": "An enumeration.", "enum": [ @@ -6602,6 +6906,21 @@ "InputFormat": { "description": "Input format specifier.", "oneOf": [ + { + "description": "Autodesk Filmbox (FBX) format.", + "properties": { + "type": { + "enum": [ + "fbx" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, { "description": "Binary glTF 2.0. We refer to this as glTF since that is how our customers refer to it, but this can also import binary glTF (glb).", "properties": { @@ -7642,6 +7961,27 @@ ], "type": "object" }, + { + "description": "Adjust zoom of the default camera.", + "properties": { + "magnitude": { + "description": "Move the camera forward along the vector it's looking at, by this magnitudedefaultCameraZoom. Basically, how much should the camera move forward by.", + "format": "float", + "type": "number" + }, + "type": { + "enum": [ + "default_camera_zoom" + ], + "type": "string" + } + }, + "required": [ + "magnitude", + "type" + ], + "type": "object" + }, { "description": "Enable sketch mode, where users can sketch 2D geometry. Users choose a plane to sketch on.", "properties": { @@ -8341,6 +8681,476 @@ "type" ], "type": "object" + }, + { + "description": "Sends object to front or back.", + "properties": { + "front": { + "description": "Bring to front = true, send to back = false.", + "type": "boolean" + }, + "object_id": { + "description": "Which object is being changed.", + "format": "uuid", + "type": "string" + }, + "type": { + "enum": [ + "send_object" + ], + "type": "string" + } + }, + "required": [ + "front", + "object_id", + "type" + ], + "type": "object" + }, + { + "description": "Set opacity of the entity.", + "properties": { + "entity_id": { + "description": "Which entity is being changed.", + "format": "uuid", + "type": "string" + }, + "opacity": { + "description": "How transparent should it be? 0 or lower is totally transparent. 1 or greater is totally opaque.", + "format": "float", + "type": "number" + }, + "type": { + "enum": [ + "entity_set_opacity" + ], + "type": "string" + } + }, + "required": [ + "entity_id", + "opacity", + "type" + ], + "type": "object" + }, + { + "description": "Fade the entity in or out.", + "properties": { + "duration_seconds": { + "default": 0.4000000059604645, + "description": "How many seconds the animation should take.", + "format": "float", + "type": "number" + }, + "entity_id": { + "description": "Which entity is being changed.", + "format": "uuid", + "type": "string" + }, + "fade_in": { + "description": "Fade in = true, fade out = false.", + "type": "boolean" + }, + "type": { + "enum": [ + "entity_fade" + ], + "type": "string" + } + }, + "required": [ + "entity_id", + "fade_in", + "type" + ], + "type": "object" + }, + { + "description": "Make a plane.", + "properties": { + "clobber": { + "description": "If true, any existing drawables within the obj will be replaced (the object will be reset)", + "type": "boolean" + }, + "origin": { + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ], + "description": "Origin of the plane" + }, + "size": { + "description": "What should the plane's span/extent? When rendered visually, this is both the width and height along X and Y axis respectively.", + "format": "float", + "type": "number" + }, + "type": { + "enum": [ + "make_plane" + ], + "type": "string" + }, + "x_axis": { + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ], + "description": "What should the plane's X axis be?" + }, + "y_axis": { + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ], + "description": "What should the plane's Y axis be?" + } + }, + "required": [ + "clobber", + "origin", + "size", + "type", + "x_axis", + "y_axis" + ], + "type": "object" + }, + { + "description": "Set the plane's color.", + "properties": { + "color": { + "allOf": [ + { + "$ref": "#/components/schemas/Color" + } + ], + "description": "What color it should be." + }, + "plane_id": { + "description": "Which plane is being changed.", + "format": "uuid", + "type": "string" + }, + "type": { + "enum": [ + "plane_set_color" + ], + "type": "string" + } + }, + "required": [ + "color", + "plane_id", + "type" + ], + "type": "object" + }, + { + "description": "Set the active tool.", + "properties": { + "tool": { + "allOf": [ + { + "$ref": "#/components/schemas/SceneToolType" + } + ], + "description": "What tool should be active." + }, + "type": { + "enum": [ + "set_tool" + ], + "type": "string" + } + }, + "required": [ + "tool", + "type" + ], + "type": "object" + }, + { + "description": "Send a mouse move event.", + "properties": { + "type": { + "enum": [ + "mouse_move" + ], + "type": "string" + }, + "window": { + "allOf": [ + { + "$ref": "#/components/schemas/Point2d" + } + ], + "description": "Where the mouse is" + } + }, + "required": [ + "type", + "window" + ], + "type": "object" + }, + { + "description": "Send a mouse click event. Updates modified/selected entities.", + "properties": { + "type": { + "enum": [ + "mouse_click" + ], + "type": "string" + }, + "window": { + "allOf": [ + { + "$ref": "#/components/schemas/Point2d" + } + ], + "description": "Where the mouse is" + } + }, + "required": [ + "type", + "window" + ], + "type": "object" + }, + { + "description": "Enable sketch mode on the given plane.", + "properties": { + "animated": { + "description": "Animate the transition to sketch mode.", + "type": "boolean" + }, + "ortho": { + "description": "Use an orthographic camera.", + "type": "boolean" + }, + "plane_id": { + "description": "Sketch on this plane.", + "format": "uuid", + "type": "string" + }, + "type": { + "enum": [ + "sketch_mode_enable" + ], + "type": "string" + } + }, + "required": [ + "animated", + "ortho", + "plane_id", + "type" + ], + "type": "object" + }, + { + "description": "Disable sketch mode.", + "properties": { + "type": { + "enum": [ + "sketch_mode_disable" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + { + "description": "Get type of a given curve.", + "properties": { + "curve_id": { + "description": "Which curve to query.", + "format": "uuid", + "type": "string" + }, + "type": { + "enum": [ + "curve_get_type" + ], + "type": "string" + } + }, + "required": [ + "curve_id", + "type" + ], + "type": "object" + }, + { + "description": "Get control points of a given curve.", + "properties": { + "curve_id": { + "description": "Which curve to query.", + "format": "uuid", + "type": "string" + }, + "type": { + "enum": [ + "curve_get_control_points" + ], + "type": "string" + } + }, + "required": [ + "curve_id", + "type" + ], + "type": "object" + }, + { + "description": "Take a snapshot.", + "properties": { + "format": { + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ], + "description": "What image format to return." + }, + "type": { + "enum": [ + "take_snapshot" + ], + "type": "string" + } + }, + "required": [ + "format", + "type" + ], + "type": "object" + }, + { + "description": "Add a gizmo showing the axes.", + "properties": { + "clobber": { + "description": "If true, any existing drawables within the obj will be replaced (the object will be reset)", + "type": "boolean" + }, + "gizmo_mode": { + "description": "If true, axes gizmo will be placed in the corner of the screen. If false, it will be placed at the origin of the scene.", + "type": "boolean" + }, + "type": { + "enum": [ + "make_axes_gizmo" + ], + "type": "string" + } + }, + "required": [ + "clobber", + "gizmo_mode", + "type" + ], + "type": "object" + }, + { + "description": "Query the given path", + "properties": { + "path_id": { + "description": "Which path to query", + "format": "uuid", + "type": "string" + }, + "type": { + "enum": [ + "path_get_info" + ], + "type": "string" + } + }, + "required": [ + "path_id", + "type" + ], + "type": "object" + }, + { + "description": "Start dragging mouse.", + "properties": { + "type": { + "enum": [ + "handle_mouse_drag_start" + ], + "type": "string" + }, + "window": { + "allOf": [ + { + "$ref": "#/components/schemas/Point2d" + } + ], + "description": "The mouse position." + } + }, + "required": [ + "type", + "window" + ], + "type": "object" + }, + { + "description": "Continue dragging mouse.", + "properties": { + "type": { + "enum": [ + "handle_mouse_drag_move" + ], + "type": "string" + }, + "window": { + "allOf": [ + { + "$ref": "#/components/schemas/Point2d" + } + ], + "description": "The mouse position." + } + }, + "required": [ + "type", + "window" + ], + "type": "object" + }, + { + "description": "Stop dragging mouse.", + "properties": { + "type": { + "enum": [ + "handle_mouse_drag_end" + ], + "type": "string" + }, + "window": { + "allOf": [ + { + "$ref": "#/components/schemas/Point2d" + } + ], + "description": "The mouse position." + } + }, + "required": [ + "type", + "window" + ], + "type": "object" } ] }, @@ -8382,7 +9192,6 @@ "additionalProperties": { "$ref": "#/components/schemas/ModelingCmdReq" }, - "description": "A set of commands to submit to the KittyCAD engine in a batch.", "type": "object" } }, @@ -8485,7 +9294,6 @@ "additionalProperties": { "$ref": "#/components/schemas/ModelingOutcome" }, - "description": "The results from each command in the batch.", "type": "object" } }, @@ -8494,6 +9302,32 @@ ], "type": "object" }, + "MouseClick": { + "description": "The response from the `MouseClick` command.", + "properties": { + "entities_modified": { + "description": "Entities that are modified.", + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + }, + "entities_selected": { + "description": "Entities that are selected.", + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "entities_modified", + "entities_selected" + ], + "type": "object" + }, "NewAddress": { "description": "The struct that is used to create a new record. This is automatically generated and has all the same fields as the main struct only it is missing the `id`.", "properties": { @@ -8587,12 +9421,8 @@ { "description": "The response from the `Export` command. When this is being performed over a websocket, this is sent as binary not JSON. The binary data can be deserialized as `bincode` into a `Vec`.", "properties": { - "files": { - "description": "The files that were exported.", - "items": { - "$ref": "#/components/schemas/ExportFile" - }, - "type": "array" + "data": { + "$ref": "#/components/schemas/Export" }, "type": { "enum": [ @@ -8602,7 +9432,7 @@ } }, "required": [ - "files", + "data", "type" ], "type": "object" @@ -8610,11 +9440,8 @@ { "description": "The response from the `SelectWithPoint` command.", "properties": { - "entity_id": { - "description": "The UUID of the entity that was selected.", - "format": "uuid", - "nullable": true, - "type": "string" + "data": { + "$ref": "#/components/schemas/SelectWithPoint" }, "type": { "enum": [ @@ -8624,6 +9451,7 @@ } }, "required": [ + "data", "type" ], "type": "object" @@ -8631,18 +9459,8 @@ { "description": "The response from the `HighlightSetEntity` command.", "properties": { - "entity_id": { - "description": "The UUID of the entity that was highlighted.", - "format": "uuid", - "nullable": true, - "type": "string" - }, - "sequence": { - "description": "If the client sent a sequence ID with its request, the backend sends it back.", - "format": "uint32", - "minimum": 0, - "nullable": true, - "type": "integer" + "data": { + "$ref": "#/components/schemas/HighlightSetEntity" }, "type": { "enum": [ @@ -8652,6 +9470,7 @@ } }, "required": [ + "data", "type" ], "type": "object" @@ -8659,10 +9478,8 @@ { "description": "The response from the `EntityGetChildUuid` command.", "properties": { - "entity_id": { - "description": "The UUID of the child entity.", - "format": "uuid", - "type": "string" + "data": { + "$ref": "#/components/schemas/EntityGetChildUuid" }, "type": { "enum": [ @@ -8672,7 +9489,7 @@ } }, "required": [ - "entity_id", + "data", "type" ], "type": "object" @@ -8680,11 +9497,8 @@ { "description": "The response from the `EntityGetNumChildren` command.", "properties": { - "num": { - "description": "The number of children the entity has.", - "format": "uint32", - "minimum": 0, - "type": "integer" + "data": { + "$ref": "#/components/schemas/EntityGetNumChildren" }, "type": { "enum": [ @@ -8694,7 +9508,7 @@ } }, "required": [ - "num", + "data", "type" ], "type": "object" @@ -8702,10 +9516,8 @@ { "description": "The response from the `EntityGetParentId` command.", "properties": { - "entity_id": { - "description": "The UUID of the parent entity.", - "format": "uuid", - "type": "string" + "data": { + "$ref": "#/components/schemas/EntityGetParentId" }, "type": { "enum": [ @@ -8715,7 +9527,7 @@ } }, "required": [ - "entity_id", + "data", "type" ], "type": "object" @@ -8723,13 +9535,8 @@ { "description": "The response from the `EntityGetAllChildUuids` command.", "properties": { - "entity_ids": { - "description": "The UUIDs of the child entities.", - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" + "data": { + "$ref": "#/components/schemas/EntityGetAllChildUuids" }, "type": { "enum": [ @@ -8739,7 +9546,7 @@ } }, "required": [ - "entity_ids", + "data", "type" ], "type": "object" @@ -8747,13 +9554,8 @@ { "description": "The response from the `SelectGet` command.", "properties": { - "entity_ids": { - "description": "The UUIDs of the selected entities.", - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" + "data": { + "$ref": "#/components/schemas/SelectGet" }, "type": { "enum": [ @@ -8763,7 +9565,7 @@ } }, "required": [ - "entity_ids", + "data", "type" ], "type": "object" @@ -8771,13 +9573,8 @@ { "description": "The response from the `GetEntityType` command.", "properties": { - "entity_type": { - "allOf": [ - { - "$ref": "#/components/schemas/EntityType" - } - ], - "description": "The type of the entity." + "data": { + "$ref": "#/components/schemas/GetEntityType" }, "type": { "enum": [ @@ -8787,7 +9584,7 @@ } }, "required": [ - "entity_type", + "data", "type" ], "type": "object" @@ -8795,13 +9592,8 @@ { "description": "The response from the `Solid3dGetAllEdgeFaces` command.", "properties": { - "faces": { - "description": "The UUIDs of the faces.", - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" + "data": { + "$ref": "#/components/schemas/Solid3dGetAllEdgeFaces" }, "type": { "enum": [ @@ -8811,7 +9603,7 @@ } }, "required": [ - "faces", + "data", "type" ], "type": "object" @@ -8819,13 +9611,8 @@ { "description": "The response from the `Solid3dGetAllOppositeEdges` command.", "properties": { - "edges": { - "description": "The UUIDs of the edges.", - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" + "data": { + "$ref": "#/components/schemas/Solid3dGetAllOppositeEdges" }, "type": { "enum": [ @@ -8835,7 +9622,7 @@ } }, "required": [ - "edges", + "data", "type" ], "type": "object" @@ -8843,10 +9630,8 @@ { "description": "The response from the `Solid3dGetOppositeEdge` command.", "properties": { - "edge": { - "description": "The UUID of the edge.", - "format": "uuid", - "type": "string" + "data": { + "$ref": "#/components/schemas/Solid3dGetOppositeEdge" }, "type": { "enum": [ @@ -8856,7 +9641,7 @@ } }, "required": [ - "edge", + "data", "type" ], "type": "object" @@ -8864,10 +9649,8 @@ { "description": "The response from the `Solid3dGetPrevAdjacentEdge` command.", "properties": { - "edge": { - "description": "The UUID of the edge.", - "format": "uuid", - "type": "string" + "data": { + "$ref": "#/components/schemas/Solid3dGetPrevAdjacentEdge" }, "type": { "enum": [ @@ -8877,7 +9660,7 @@ } }, "required": [ - "edge", + "data", "type" ], "type": "object" @@ -8885,10 +9668,8 @@ { "description": "The response from the `Solid3dGetNextAdjacentEdge` command.", "properties": { - "edge": { - "description": "The UUID of the edge.", - "format": "uuid", - "type": "string" + "data": { + "$ref": "#/components/schemas/Solid3dGetNextAdjacentEdge" }, "type": { "enum": [ @@ -8898,7 +9679,265 @@ } }, "required": [ - "edge", + "data", + "type" + ], + "type": "object" + }, + { + "description": "The response from the `MouseClick` command.", + "properties": { + "data": { + "$ref": "#/components/schemas/MouseClick" + }, + "type": { + "enum": [ + "mouse_click" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + }, + { + "description": "The response from the `CurveGetType` command.", + "properties": { + "data": { + "$ref": "#/components/schemas/CurveGetType" + }, + "type": { + "enum": [ + "curve_get_type" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + }, + { + "description": "The response from the `CurveGetControlPoints` command.", + "properties": { + "data": { + "$ref": "#/components/schemas/CurveGetControlPoints" + }, + "type": { + "enum": [ + "curve_get_control_points" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + }, + { + "description": "The response from the `Take Snapshot` command.", + "properties": { + "data": { + "$ref": "#/components/schemas/TakeSnapshot" + }, + "type": { + "enum": [ + "take_snapshot" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + }, + { + "description": "The response from the `Path Get Info` command.", + "properties": { + "data": { + "$ref": "#/components/schemas/PathGetInfo" + }, + "type": { + "enum": [ + "path_get_info" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + } + ] + }, + "OkWebSocketResponseData": { + "description": "The websocket messages this server sends.", + "oneOf": [ + { + "description": "Information about the ICE servers.", + "properties": { + "data": { + "properties": { + "ice_servers": { + "description": "Information about the ICE servers.", + "items": { + "$ref": "#/components/schemas/IceServer" + }, + "type": "array" + } + }, + "required": [ + "ice_servers" + ], + "type": "object" + }, + "type": { + "enum": [ + "ice_server_info" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + }, + { + "description": "The trickle ICE candidate response.", + "properties": { + "data": { + "properties": { + "candidate": { + "allOf": [ + { + "$ref": "#/components/schemas/RtcIceCandidateInit" + } + ], + "description": "Information about the ICE candidate." + } + }, + "required": [ + "candidate" + ], + "type": "object" + }, + "type": { + "enum": [ + "trickle_ice" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + }, + { + "description": "The SDP answer response.", + "properties": { + "data": { + "properties": { + "answer": { + "allOf": [ + { + "$ref": "#/components/schemas/RtcSessionDescription" + } + ], + "description": "The session description." + } + }, + "required": [ + "answer" + ], + "type": "object" + }, + "type": { + "enum": [ + "sdp_answer" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + }, + { + "description": "The modeling command response.", + "properties": { + "data": { + "properties": { + "modeling_response": { + "allOf": [ + { + "$ref": "#/components/schemas/OkModelingCmdResponse" + } + ], + "description": "The result of the command." + } + }, + "required": [ + "modeling_response" + ], + "type": "object" + }, + "type": { + "enum": [ + "modeling" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + }, + { + "description": "The exported files.", + "properties": { + "data": { + "properties": { + "files": { + "description": "The exported files", + "items": { + "$ref": "#/components/schemas/RawFile" + }, + "type": "array" + } + }, + "required": [ + "files" + ], + "type": "object" + }, + "type": { + "enum": [ + "export" + ], + "type": "string" + } + }, + "required": [ + "data", "type" ], "type": "object" @@ -8943,12 +9982,44 @@ "description": "Output format specifier.", "oneOf": [ { - "description": "glTF 2.0. We refer to this as glTF since that is how our customers refer to it, although by default it will be in binary format and thus technically (glb). If you prefer ascii output, you can set that option for the export.", + "description": "Autodesk Filmbox (FBX) format.", "properties": { "storage": { "allOf": [ { - "$ref": "#/components/schemas/Storage" + "$ref": "#/components/schemas/FbxStorage" + } + ], + "description": "Specifies which kind of FBX will be exported." + }, + "type": { + "enum": [ + "fbx" + ], + "type": "string" + } + }, + "required": [ + "storage", + "type" + ], + "type": "object" + }, + { + "description": "glTF 2.0. We refer to this as glTF since that is how our customers refer to it, although by default it will be in binary format and thus technically (glb). If you prefer ascii output, you can set that option for the export.", + "properties": { + "presentation": { + "allOf": [ + { + "$ref": "#/components/schemas/GltfPresentation" + } + ], + "description": "Specifies how the JSON will be presented." + }, + "storage": { + "allOf": [ + { + "$ref": "#/components/schemas/GltfStorage" } ], "description": "Specifies which kind of glTF 2.0 will be exported." @@ -8961,6 +10032,7 @@ } }, "required": [ + "presentation", "storage", "type" ], @@ -9004,7 +10076,7 @@ "storage": { "allOf": [ { - "$ref": "#/components/schemas/Storage" + "$ref": "#/components/schemas/PlyStorage" } ], "description": "The storage for the output PLY file." @@ -9061,7 +10133,7 @@ "storage": { "allOf": [ { - "$ref": "#/components/schemas/Storage" + "$ref": "#/components/schemas/StlStorage" } ], "description": "Export storage." @@ -9082,6 +10154,33 @@ } ] }, + "PathCommand": { + "description": "The path component command type (within a Path)", + "enum": [ + "move_to", + "line_to", + "bez_curve_to", + "nurbs_curve_to", + "add_arc" + ], + "type": "string" + }, + "PathGetInfo": { + "description": "The response from the `PathGetInfo` command.", + "properties": { + "segments": { + "description": "All segments in the path, in the order they were added.", + "items": { + "$ref": "#/components/schemas/PathSegmentInfo" + }, + "type": "array" + } + }, + "required": [ + "segments" + ], + "type": "object" + }, "PathSegment": { "description": "A segment of a path. Paths are composed of many segments.", "oneOf": [ @@ -9195,6 +10294,32 @@ } ] }, + "PathSegmentInfo": { + "description": "Info about a path segment", + "properties": { + "command": { + "allOf": [ + { + "$ref": "#/components/schemas/PathCommand" + } + ], + "description": "What is the path segment?" + }, + "command_id": { + "allOf": [ + { + "$ref": "#/components/schemas/ModelingCmdId" + } + ], + "description": "Which command created this path? This field is absent if the path command is not actually creating a path segment, e.g. moving the pen doesn't create a path segment.", + "nullable": true + } + }, + "required": [ + "command" + ], + "type": "object" + }, "PaymentIntent": { "description": "A payment intent response.", "properties": { @@ -9325,6 +10450,32 @@ }, "type": "object" }, + "PlyStorage": { + "description": "The storage for the output PLY file.", + "oneOf": [ + { + "description": "Write numbers in their ascii representation (e.g. -13, 6.28, etc.). Properties are separated by spaces and elements are separated by line breaks.", + "enum": [ + "ascii" + ], + "type": "string" + }, + { + "description": "Encode payload as binary using little endian.", + "enum": [ + "binary_little_endian" + ], + "type": "string" + }, + { + "description": "Encode payload as binary using big endian.", + "enum": [ + "binary_big_endian" + ], + "type": "string" + } + ] + }, "Point2d": { "description": "A point in 2D space", "properties": { @@ -9455,85 +10606,6 @@ }, "type": "object" }, - "RtcIceCandidate": { - "description": "ICECandidate represents a ice candidate", - "properties": { - "address": { - "description": "The address of the candidate.", - "type": "string" - }, - "component": { - "description": "The component of the candidate.", - "format": "uint16", - "minimum": 0, - "type": "integer" - }, - "foundation": { - "description": "The foundation for the address.", - "type": "string" - }, - "port": { - "description": "The port used for the candidate.", - "format": "uint16", - "minimum": 0, - "type": "integer" - }, - "priority": { - "description": "The priority of the candidate.", - "format": "uint32", - "minimum": 0, - "type": "integer" - }, - "protocol": { - "allOf": [ - { - "$ref": "#/components/schemas/RtcIceProtocol" - } - ], - "description": "The protocol used for the candidate." - }, - "related_address": { - "description": "The related address of the candidate.", - "type": "string" - }, - "related_port": { - "description": "The related port of the candidate.", - "format": "uint16", - "minimum": 0, - "type": "integer" - }, - "stats_id": { - "description": "The stats ID.", - "type": "string" - }, - "tcp_type": { - "description": "The TCP type of the candidate.", - "type": "string" - }, - "typ": { - "allOf": [ - { - "$ref": "#/components/schemas/RtcIceCandidateType" - } - ], - "description": "The type of the candidate." - } - }, - "required": [ - "address", - "component", - "foundation", - "port", - "priority", - "protocol", - "related_address", - "related_port", - "stats_id", - "tcp_type", - "typ" - ], - "type": "object" - }, "RtcIceCandidateInit": { "description": "ICECandidateInit is used to serialize ice candidates", "properties": { @@ -9564,72 +10636,6 @@ ], "type": "object" }, - "RtcIceCandidateType": { - "description": "ICECandidateType represents the type of the ICE candidate used.", - "oneOf": [ - { - "description": "Unspecified indicates that the candidate type is unspecified.", - "enum": [ - "unspecified" - ], - "type": "string" - }, - { - "description": "ICECandidateTypeHost indicates that the candidate is of Host type as described in . A candidate obtained by binding to a specific port from an IP address on the host. This includes IP addresses on physical interfaces and logical ones, such as ones obtained through VPNs.", - "enum": [ - "host" - ], - "type": "string" - }, - { - "description": "ICECandidateTypeSrflx indicates the the candidate is of Server Reflexive type as described . A candidate type whose IP address and port are a binding allocated by a NAT for an ICE agent after it sends a packet through the NAT to a server, such as a STUN server.", - "enum": [ - "srflx" - ], - "type": "string" - }, - { - "description": "ICECandidateTypePrflx indicates that the candidate is of Peer Reflexive type. A candidate type whose IP address and port are a binding allocated by a NAT for an ICE agent after it sends a packet through the NAT to its peer.", - "enum": [ - "prflx" - ], - "type": "string" - }, - { - "description": "ICECandidateTypeRelay indicates the the candidate is of Relay type as described in . A candidate type obtained from a relay server, such as a TURN server.", - "enum": [ - "relay" - ], - "type": "string" - } - ] - }, - "RtcIceProtocol": { - "description": "ICEProtocol indicates the transport protocol type that is used in the ice.URL structure.", - "oneOf": [ - { - "description": "Unspecified indicates that the protocol is unspecified.", - "enum": [ - "unspecified" - ], - "type": "string" - }, - { - "description": "UDP indicates the URL uses a UDP transport.", - "enum": [ - "udp" - ], - "type": "string" - }, - { - "description": "TCP indicates the URL uses a TCP transport.", - "enum": [ - "tcp" - ], - "type": "string" - } - ] - }, "RtcSdpType": { "description": "SDPType describes the type of an SessionDescription.", "oneOf": [ @@ -9736,6 +10742,47 @@ } ] }, + "SceneToolType": { + "description": "The type of scene's active tool", + "enum": [ + "camera_revolve", + "select", + "move", + "sketch_line", + "sketch_curve", + "sketch_curve_mod" + ], + "type": "string" + }, + "SelectGet": { + "description": "The response from the `SelectGet` command.", + "properties": { + "entity_ids": { + "description": "The UUIDs of the selected entities.", + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "entity_ids" + ], + "type": "object" + }, + "SelectWithPoint": { + "description": "The response from the `SelectWithPoint` command.", + "properties": { + "entity_id": { + "description": "The UUID of the entity that was selected.", + "format": "uuid", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, "Session": { "description": "An authentication session.\n\nFor our UIs, these are automatically created by Next.js.", "properties": { @@ -9782,63 +10829,129 @@ ], "type": "object" }, - "SnakeCaseResult": { - "description": "Serde serializes Result into JSON as \"Ok\" and \"Err\", but we want \"ok\" and \"err\". So, create a new enum that serializes as lowercase.", + "Solid3dGetAllEdgeFaces": { + "description": "The response from the `Solid3dGetAllEdgeFaces` command.", + "properties": { + "faces": { + "description": "The UUIDs of the faces.", + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "faces" + ], + "type": "object" + }, + "Solid3dGetAllOppositeEdges": { + "description": "The response from the `Solid3dGetAllOppositeEdges` command.", + "properties": { + "edges": { + "description": "The UUIDs of the edges.", + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "edges" + ], + "type": "object" + }, + "Solid3dGetNextAdjacentEdge": { + "description": "The response from the `Solid3dGetNextAdjacentEdge` command.", + "properties": { + "edge": { + "description": "The UUID of the edge.", + "format": "uuid", + "type": "string" + } + }, + "required": [ + "edge" + ], + "type": "object" + }, + "Solid3dGetOppositeEdge": { + "description": "The response from the `Solid3dGetOppositeEdge` command.", + "properties": { + "edge": { + "description": "The UUID of the edge.", + "format": "uuid", + "type": "string" + } + }, + "required": [ + "edge" + ], + "type": "object" + }, + "Solid3dGetPrevAdjacentEdge": { + "description": "The response from the `Solid3dGetPrevAdjacentEdge` command.", + "properties": { + "edge": { + "description": "The UUID of the edge.", + "format": "uuid", + "type": "string" + } + }, + "required": [ + "edge" + ], + "type": "object" + }, + "StlStorage": { + "description": "Export storage.", "oneOf": [ { - "additionalProperties": false, - "description": "The result is Ok.", - "properties": { - "ok": { - "$ref": "#/components/schemas/OkModelingCmdResponse" - } - }, - "required": [ - "ok" + "description": "Plaintext encoding.", + "enum": [ + "ascii" ], - "type": "object" + "type": "string" }, { - "additionalProperties": false, - "description": "The result is Err.", - "properties": { - "err": { - "$ref": "#/components/schemas/ErrorResponse" - } - }, - "required": [ - "err" - ], - "type": "object" - } - ] - }, - "Storage": { - "description": "Describes the storage format of a glTF 2.0 scene.", - "oneOf": [ - { - "description": "Binary glTF 2.0.\n\nThis is a single binary with .glb extension.\n\nThis is the default setting.", + "description": "Binary STL encoding.\n\nThis is the default setting.", "enum": [ "binary" ], "type": "string" - }, - { - "description": "Standard glTF 2.0.\n\nThis is a JSON file with .gltf extension paired with a separate binary blob file with .bin extension.", - "enum": [ - "standard" - ], - "type": "string" - }, - { - "description": "Embedded glTF 2.0.\n\nSingle JSON file with .gltf extension binary data encoded as base64 data URIs.", - "enum": [ - "embedded" - ], - "type": "string" } ] }, + "SuccessWebSocketResponse": { + "description": "Successful Websocket response.", + "properties": { + "request_id": { + "description": "Which request this is a response to. If the request was a modeling command, this is the modeling command ID. If no request ID was sent, this will be null.", + "format": "uuid", + "nullable": true, + "type": "string" + }, + "resp": { + "allOf": [ + { + "$ref": "#/components/schemas/OkWebSocketResponseData" + } + ], + "description": "The data sent with a successful response. This will be flattened into a 'type' and 'data' field." + }, + "success": { + "description": "Always true", + "type": "boolean" + } + }, + "required": [ + "resp", + "success" + ], + "type": "object" + }, "System": { "description": "Co-ordinate system definition.\n\nThe `up` axis must be orthogonal to the `forward` axis.\n\nSee [cglearn.eu] for background reading.\n\n[cglearn.eu](https://cglearn.eu/pub/computer-graphics/introduction-to-geometry#material-coordinate-systems-1)", "properties": { @@ -9907,6 +11020,21 @@ ], "type": "string" }, + "TakeSnapshot": { + "description": "The response from the `TakeSnapshot` command.", + "properties": { + "contents": { + "description": "Contents of the image.", + "format": "byte", + "title": "String", + "type": "string" + } + }, + "required": [ + "contents" + ], + "type": "object" + }, "UnitAngle": { "description": "The valid types of angle formats.", "oneOf": [ @@ -11883,7 +13011,7 @@ ], "type": "object" }, - "WebSocketMessages": { + "WebSocketRequest": { "description": "The websocket messages the server receives.", "oneOf": [ { @@ -11966,140 +13094,44 @@ "type" ], "type": "object" - } - ] - }, - "WebSocketResponses": { - "description": "The websocket messages this server sends.", - "oneOf": [ - { - "description": "The trickle ICE candidate response.", - "properties": { - "candidate": { - "allOf": [ - { - "$ref": "#/components/schemas/RtcIceCandidate" - } - ], - "description": "Information about the ICE candidate." - }, - "type": { - "enum": [ - "trickle_ice" - ], - "type": "string" - } - }, - "required": [ - "candidate", - "type" - ], - "type": "object" }, { - "description": "The SDP answer response.", + "description": "The client-to-server Ping to ensure the WebSocket stays alive.", "properties": { - "answer": { - "allOf": [ - { - "$ref": "#/components/schemas/RtcSessionDescription" - } - ], - "description": "The session description." - }, "type": { "enum": [ - "sdp_answer" + "ping" ], "type": "string" } }, "required": [ - "answer", - "type" - ], - "type": "object" - }, - { - "description": "The ICE server info response.", - "properties": { - "ice_servers": { - "description": "Information about the ICE servers.", - "items": { - "$ref": "#/components/schemas/IceServer" - }, - "type": "array" - }, - "type": { - "enum": [ - "ice_server_info" - ], - "type": "string" - } - }, - "required": [ - "ice_servers", - "type" - ], - "type": "object" - }, - { - "description": "The modeling command response.", - "properties": { - "cmd_id": { - "allOf": [ - { - "$ref": "#/components/schemas/ModelingCmdId" - } - ], - "description": "The ID of the command." - }, - "result": { - "allOf": [ - { - "$ref": "#/components/schemas/SnakeCaseResult" - } - ], - "description": "The result of the command." - }, - "type": { - "enum": [ - "modeling" - ], - "type": "string" - } - }, - "required": [ - "cmd_id", - "result", - "type" - ], - "type": "object" - }, - { - "description": "The export command response, this is sent as binary.", - "properties": { - "files": { - "description": "The exported files.", - "items": { - "$ref": "#/components/schemas/RawFile" - }, - "type": "array" - }, - "type": { - "enum": [ - "export" - ], - "type": "string" - } - }, - "required": [ - "files", "type" ], "type": "object" } ] + }, + "WebSocketResponse": { + "anyOf": [ + { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessWebSocketResponse" + } + ], + "description": "Response sent when a request succeeded." + }, + { + "allOf": [ + { + "$ref": "#/components/schemas/FailureWebSocketResponse" + } + ], + "description": "Response sent when a request did not succeed." + } + ], + "description": "Websocket responses can either be successful or unsuccessful. Slightly different schemas in either case." } } }, @@ -14600,7 +15632,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebSocketMessages" + "$ref": "#/components/schemas/WebSocketRequest" } } }, @@ -14611,7 +15643,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebSocketResponses" + "$ref": "#/components/schemas/WebSocketResponse" } } }, @@ -14851,7 +15883,9 @@ "200": { "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/OkModelingCmdResponse" + } } }, "description": "successful operation", @@ -19263,6 +20297,14 @@ "minimum": 0, "type": "integer" } + }, + { + "description": "If true, will start a webrtc connection.", + "in": "query", + "name": "webrtc", + "schema": { + "type": "boolean" + } } ], "responses": { @@ -19391,4 +20433,4 @@ "name": "users" } ] -} \ No newline at end of file +}