diff --git a/generate/float.py.jinja2 b/generate/float.py.jinja2 new file mode 100644 index 000000000..ad51896f6 --- /dev/null +++ b/generate/float.py.jinja2 @@ -0,0 +1,16 @@ +from typing import Any + +from pydantic import GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema + + +class {{name}}(float): + """{{description}}""" + def __float__(self) -> float: + return self + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function(cls, handler(float)) diff --git a/generate/functions-ws.py.jinja2 b/generate/functions-ws.py.jinja2 index 1411bae28..8933b65c4 100644 --- a/generate/functions-ws.py.jinja2 +++ b/generate/functions-ws.py.jinja2 @@ -93,7 +93,7 @@ def sync( client=client, ) - return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=None, compression=None, max_size=None) # type: ignore + return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"]) # type: ignore @@ -179,20 +179,20 @@ class WebSocket: """ for message in self.ws: - yield {{response_type}}.from_dict(json.loads(message)) + yield {{response_type}}(**json.loads(message)) def send(self, data:{% for arg in args %}{%if arg.name == "body" %}{{arg.type}}{% endif %}{% endfor %}): """Send data to the websocket.""" - self.ws.send(json.dumps(data.to_dict())) + self.ws.send(json.dumps(data.model_dump())) def send_binary(self, data:{% for arg in args %}{%if arg.name == "body" %}{{arg.type}}{% endif %}{% endfor %}): """Send data as bson to the websocket.""" - self.ws.send(bson.BSON.encode(data.to_dict())) + self.ws.send(bson.encode(data.model_dump())) def recv(self) -> {{response_type}}: """Receive data from the websocket.""" message = self.ws.recv() - return {{response_type}}.from_dict(json.loads(message)) + return {{response_type}}(**json.loads(message)) def close(self): """Close the websocket.""" diff --git a/generate/generate.py b/generate/generate.py index c777c49b2..94562638b 100755 --- a/generate/generate.py +++ b/generate/generate.py @@ -579,18 +579,18 @@ async def test_""" client = ClientFromEnv() # Connect to the websocket. - websocket = """ + with """ + fn_name + """.sync(client=client,""" + params_str - + """) + + """) as websocket: - # Send a message. - websocket.send("{}") + # Send a message. + websocket.send("{}") - # Get the messages. - for message in websocket: - print(message) + # Get the messages. + for message in websocket: + print(message) """ ) @@ -603,20 +603,20 @@ async def test_""" client = ClientFromEnv() # Connect to the websocket. - websocket = """ + with """ + fn_name + """.WebSocket(client=client,""" + params_str - + """) + + """) as websocket: - # Send a message. - websocket.send(""" + # Send a message. + websocket.send(""" + body_example + """) - # Get a message. - message = websocket.recv() - print(message) + # Get a message. + message = websocket.recv() + print(message) """ ) @@ -793,7 +793,7 @@ async def test_""" + option_name + " = " + snake_to_title(ref) - + ".from_dict(data)\n" + + "(**data)\n" ) parse_response.write( "\t\t\treturn " + option_name + "\n" @@ -816,7 +816,7 @@ async def test_""" + response_code + " = " + ref - + ".from_dict(response.json())\n" + + "(**response.json())\n" ) elif "type" in json: if json["type"] == "array": @@ -829,7 +829,7 @@ async def test_""" "\t\tresponse_" + response_code + " = [\n" ) parse_response.write( - "\t\t\t" + ref + ".from_dict(item)\n" + "\t\t\t" + ref + "(**item)\n" ) parse_response.write( "\t\t\tfor item in response.json()\n" @@ -871,7 +871,7 @@ async def test_""" + response_code + " = " + ref - + ".from_dict(response.json())\n" + + "(**response.json())\n" ) else: print(endpoint) @@ -881,7 +881,7 @@ async def test_""" parse_response.write("\t\treturn response_" + response_code + "\n") # End the method. - parse_response.write("\treturn Error.from_dict(response.json())\n") + parse_response.write("\treturn Error(**response.json())\n") else: parse_response.write("\treturn\n") @@ -994,9 +994,6 @@ def generateTypes(cwd: str, parser: dict): # 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() @@ -1040,10 +1037,29 @@ def generateStringType(path: str, name: str, schema: dict, type_name: str): logging.info("generating type: ", name, " at: ", path) f = open(path, "w") - f.write("class " + name + "(str):\n") - f.write("\n") - f.write("\tdef __str__(self) -> str:\n") - f.write("\t\treturn self\n") + TemplateType = TypedDict( + "TemplateType", + { + "description": str, + "name": str, + }, + ) + + description = "" + if "description" in schema: + description = schema["description"] + + template_info: TemplateType = { + "description": description, + "name": name, + } + + environment = jinja2.Environment(loader=jinja2.FileSystemLoader("generate/")) + template_file = "str.py.jinja2" + template = environment.get_template(template_file) + content = template.render(**template_info) + + f.write(content) # Close the file. f.close() @@ -1053,10 +1069,29 @@ def generateIntegerType(path: str, name: str, schema: dict, type_name: str): logging.info("generating type: ", name, " at: ", path) f = open(path, "w") - f.write("class " + name + "(int):\n") - f.write("\n") - f.write("\tdef __int__(self) -> int:\n") - f.write("\t\treturn self\n") + TemplateType = TypedDict( + "TemplateType", + { + "description": str, + "name": str, + }, + ) + + description = "" + if "description" in schema: + description = schema["description"] + + template_info: TemplateType = { + "description": description, + "name": name, + } + + environment = jinja2.Environment(loader=jinja2.FileSystemLoader("generate/")) + template_file = "int.py.jinja2" + template = environment.get_template(template_file) + content = template.render(**template_info) + + f.write(content) # Close the file. f.close() @@ -1066,10 +1101,29 @@ def generateFloatType(path: str, name: str, schema: dict, type_name: str): logging.info("generating type: ", name, " at: ", path) f = open(path, "w") - f.write("class " + name + "(float):\n") - f.write("\n") - f.write("\tdef __float__(self) -> float:\n") - f.write("\t\treturn self\n") + TemplateType = TypedDict( + "TemplateType", + { + "description": str, + "name": str, + }, + ) + + description = "" + if "description" in schema: + description = schema["description"] + + template_info: TemplateType = { + "description": description, + "name": name, + } + + environment = jinja2.Environment(loader=jinja2.FileSystemLoader("generate/")) + template_file = "float.py.jinja2" + template = environment.get_template(template_file) + content = template.render(**template_info) + + f.write(content) # Close the file. f.close() @@ -1209,7 +1263,7 @@ def generateAnyOfType(path: str, name: str, schema: dict, data: dict): all_options.append(prop_name) else: object_code = generateObjectTypeCode( - prop_name, nested_object, "object", data, None + prop_name, nested_object, "object", data, None, None ) f.write(object_code) f.write("\n") @@ -1231,7 +1285,7 @@ def generateAnyOfType(path: str, name: str, schema: dict, data: dict): # Get the value of the tag. object_name = any_of["properties"][tag]["enum"][0] object_code = generateObjectTypeCode( - object_name, any_of, "object", data, tag + object_name, any_of, "object", data, tag, None ) f.write(object_code) f.write("\n") @@ -1384,7 +1438,7 @@ def generateOneOfType(path: str, name: str, schema: dict, data: dict): all_options.append(prop_name) else: object_code = generateObjectTypeCode( - prop_name, nested_object, "object", data, None + prop_name, nested_object, "object", data, None, None ) f.write(object_code) f.write("\n") @@ -1399,27 +1453,51 @@ def generateOneOfType(path: str, name: str, schema: dict, data: dict): # Check if each one_of has the same enum of one. tag = getTagOneOf(schema) + content = getContentOneOf(schema, tag) - if tag is not None: + if tag is not None and content is not None: + # Generate each of the options from the tag. + for one_of in schema["oneOf"]: + # Get the value of the tag. + object_name = one_of["properties"][tag]["enum"][0] + # Generate the type for the object. + content_code = generateObjectTypeCode( + snake_to_title(object_name) + "Data", + one_of["properties"][content], + "object", + data, + None, + None, + ) + f.write(content_code) + f.write("\n") + object_code = generateObjectTypeCode( + object_name, one_of, "object", data, tag, content + ) + f.write(object_code) + f.write("\n") + all_options.append(object_name) + elif tag is not None: # Generate each of the options from the tag. for one_of in schema["oneOf"]: # Get the value of the tag. object_name = one_of["properties"][tag]["enum"][0] object_code = generateObjectTypeCode( - object_name, one_of, "object", data, tag + object_name, + one_of, + "object", + data, + tag, + None, ) f.write(object_code) f.write("\n") all_options.append(object_name) # Write the sum type. - if name == "SnakeCaseResult": - f.write("from typing import Any\n") - f.write(name + " = Any") - else: - description = getOneOfDescription(schema) - content = generateUnionType(all_options, name, description) - f.write(content) + description = getOneOfDescription(schema) + content = generateUnionType(all_options, name, description) + f.write(content) # Close the file. f.close() @@ -1433,203 +1511,88 @@ def getOneOfDescription(schema: dict) -> str: def generateObjectTypeCode( - name: str, schema: dict, type_name: str, data: dict, tag: Optional[str] + name: str, + schema: dict, + type_name: str, + data: dict, + tag: Optional[str], + content: Optional[str], ) -> str: - 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" + FieldType = TypedDict( + "FieldType", + { + "name": str, + "type": str, + "value": str, + }, + ) + TemplateType = TypedDict( + "TemplateType", + { + "fields": List[FieldType], + "description": str, + "name": str, + "imports": List[str], + }, ) - f.write("\n") - f.write("import attr\n") - if has_date_time: - f.write("from dateutil.parser import isoparse\n") - f.write("\n") + description = "" + if "description" in schema: + description = schema["description"] + + imports = [] refs = getRefs(schema) for ref in refs: - f.write("from ..models." + camel_to_snake(ref) + " import " + ref + "\n") + imports.append("from ..models." + camel_to_snake(ref) + " import " + ref + "\n") - f.write("from ..types import UNSET, Unset\n") - f.write("\n") + required = [] + if "required" in schema: + required = schema["required"] - type_letter = randletter() - f.write(type_letter + ' = TypeVar("' + type_letter + '", bound="' + name + '")\n') - f.write("\n") - f.write("@attr.s(auto_attribs=True)\n") - f.write("class " + name + ":\n") - # Write the description. - if "description" in schema: - f.write('\t""" ' + schema["description"] + ' """ # noqa: E501\n') - # Iterate over the properties. - for property_name in schema["properties"]: - property_schema = schema["properties"][property_name] - if property_name == tag: - f.write("\t" + property_name + ': str = "' + name + '"\n') - else: - renderTypeInit(f, property_name, property_schema, data) - - # Finish writing the class. - f.write("\n") - f.write( - "\tadditional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)\n" - ) - - # Now let's write the to_dict method. - f.write("\n") - f.write("\tdef to_dict(self) -> Dict[str, Any]:\n") - # Iternate over the properties. - for property_name in schema["properties"]: - property_schema = schema["properties"][property_name] - if property_name == tag: - renderTypeToDict(f, property_name, property_schema, data) - else: - renderTypeToDict(f, property_name, property_schema, data) - - # Finish writing the to_dict method. - f.write("\n") - f.write("\t\tfield_dict: Dict[str, Any] = {}\n") - f.write("\t\tfield_dict.update(self.additional_properties)\n") - f.write("\t\tfield_dict.update({})\n") - - # Iternate over the properties. - for property_name in schema["properties"]: - property_schema = schema["properties"][property_name] - if "allOf" in property_schema and len(property_schema["allOf"]) == 1: - property_schema = property_schema["allOf"][0] - if property_name == tag: - f.write( - "\t\tfield_dict['" - + property_name - + "'] = " - + clean_parameter_name(property_name) - + "\n" - ) - else: - # Write the property. - f.write( - "\t\tif " + clean_parameter_name(property_name) + " is not UNSET:\n" - ) - # We only want .to_dict on nested objects. - if "$ref" in property_schema: - ref = property_schema["$ref"].replace("#/components/schemas/", "") - actual_schema = data["components"]["schemas"][ref] - is_enum = isEnumWithDocsOneOf(actual_schema) - if ( - "properties" in actual_schema - or "oneOf" in actual_schema - or "anyOf" in actual_schema - or "allOf" in actual_schema - ) and not is_enum: - f.write( - "\t\t\t_" - + property_name - + ": " - + ref - + " = cast(" - + ref - + ", " - + clean_parameter_name(property_name) - + ")\n" - ) - f.write( - "\t\t\tfield_dict['" - + property_name - + "'] = _" - + property_name - + ".to_dict()\n" - ) - else: - f.write( - "\t\t\tfield_dict['" - + property_name - + "'] = " - + clean_parameter_name(property_name) - + "\n" - ) + fields = [] + if "properties" in schema: + for property_name in schema["properties"]: + property_schema = schema["properties"][property_name] + if property_name == tag: + field0: FieldType = { + "name": property_name, + "type": "str", + "value": '"' + name + '"', + } + fields.append(field0) + elif property_name == content: + field1: FieldType = { + "name": property_name, + "type": snake_to_title(name) + "Data", + "value": "", + } + fields.append(field1) else: - f.write( - "\t\t\tfield_dict['" - + property_name - + "'] = " - + clean_parameter_name(property_name) - + "\n" - ) + field_type = getTypeName(property_schema) + if property_name not in required: + field_type = "Optional[" + field_type + "] = None" + field2: FieldType = { + "name": property_name, + "type": field_type, + "value": "", + } + fields.append(field2) - f.write("\n") - f.write("\t\treturn field_dict\n") + template_info: TemplateType = { + "fields": fields, + "description": description, + "name": name, + "imports": imports, + } - # Now let's write the from_dict method. - f.write("\n") - f.write("\t@classmethod\n") - f.write( - "\tdef from_dict(cls: Type[" - + type_letter - + "], src_dict: Dict[str, Any]) -> " - + type_letter - + ":\n" - ) - f.write("\t\td = src_dict.copy()\n") + # Iterate over the properties. - # Iternate over the properties. - for property_name in schema["properties"]: - property_schema = schema["properties"][property_name] - renderTypeFromDict(f, property_name, property_schema, data) + environment = jinja2.Environment(loader=jinja2.FileSystemLoader("generate/")) + template_file = "object.py.jinja2" + template = environment.get_template(template_file) + content = template.render(**template_info) - # Finish writing the from_dict method. - f.write("\n") - f.write("\t\t" + camel_to_snake(name) + " = cls(\n") - # Iternate over the properties. - for property_name in schema["properties"]: - # Write the property. - f.write( - "\t\t\t" - + clean_parameter_name(property_name) - + "= " - + clean_parameter_name(property_name) - + ",\n" - ) - - # Close the class. - f.write("\t\t)\n") - f.write("\n") - f.write("\t\t" + camel_to_snake(name) + ".additional_properties = d\n") - f.write("\t\treturn " + camel_to_snake(name) + "\n") - - # write the rest of the class. - f.write("\n") - f.write("\t@property\n") - f.write("\tdef additional_keys(self) -> List[str]:\n") - f.write("\t\treturn list(self.additional_properties.keys())\n") - - f.write("\n") - f.write("\tdef __getitem__(self, key: str) -> Any:\n") - f.write("\t\treturn self.additional_properties[key]\n") - - f.write("\n") - f.write("\tdef __setitem__(self, key: str, value: Any) -> None:\n") - f.write("\t\tself.additional_properties[key] = value\n") - - f.write("\n") - f.write("\tdef __delitem__(self, key: str) -> None:\n") - f.write("\t\tdel self.additional_properties[key]\n") - - f.write("\n") - f.write("\tdef __contains__(self, key: str) -> bool:\n") - f.write("\t\treturn key in self.additional_properties\n") - - value = f.getvalue() - - # Close the file. - f.close() - - return value + return content def generateObjectType(path: str, name: str, schema: dict, type_name: str, data: dict): @@ -1637,790 +1600,13 @@ def generateObjectType(path: str, name: str, schema: dict, type_name: str, data: f = open(path, "w") - code = generateObjectTypeCode(name, schema, type_name, data, None) + code = generateObjectTypeCode(name, schema, type_name, data, None, None) f.write(code) # Close the file. f.close() -def renderTypeToDict(f, property_name: str, property_schema: dict, data: dict): - if "type" in property_schema: - property_type = property_schema["type"] - - # Write the property. - if property_type == "string": - if "format" in property_schema: - if ( - property_schema["format"] == "date-time" - or property_schema["format"] == "partial-date-time" - ): - 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) - + ".isoformat()\n" - ) - # 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" - + clean_parameter_name(property_name) - + " = self." - + clean_parameter_name(property_name) - + "\n" - ) - elif property_type == "integer": - f.write( - "\t\t" - + clean_parameter_name(property_name) - + " = self." - + clean_parameter_name(property_name) - + "\n" - ) - elif property_type == "number": - f.write( - "\t\t" - + clean_parameter_name(property_name) - + " = self." - + clean_parameter_name(property_name) - + "\n" - ) - elif property_type == "boolean": - f.write( - "\t\t" - + clean_parameter_name(property_name) - + " = self." - + 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"]: - property_type = property_schema["items"]["$ref"] - property_type = property_type.replace("#/components/schemas/", "") - f.write( - "\t\tfrom ..models." - + camel_to_snake(property_type) - + " import " - + property_type - + "\n" - ) - elif "type" in property_schema["items"]: - if property_schema["items"]["type"] == "string": - property_type = "str" - elif property_schema["items"]["type"] == "integer": - property_type = "int" - elif property_schema["items"]["type"] == "number": - property_type = "float" - elif property_schema["items"]["type"] == "array": - if "items" in property_schema["items"]: - if property_schema["items"]["items"]["type"] == "string": - property_type = "List[str]" - elif property_schema["items"]["items"]["type"] == "number": - property_type = "List[float]" - else: - logging.error("property: ", property_schema) - raise Exception("Unknown property type") - else: - logging.error("property: ", property_schema) - raise Exception("Unknown property type") - else: - print("property: ", property_schema) - raise Exception("Unknown property type") - else: - logging.error("array: ", [property_schema]) - logging.error("array: ", [property_schema["items"]]) - raise Exception("Unknown array type") - - f.write( - "\t\t" - + property_name - + ": Union[Unset, List[" - + property_type - + "]] = 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) - + "\n" - ) - else: - f.write( - "\t\t" - + clean_parameter_name(property_name) - + " = self." - + clean_parameter_name(property_name) - + "\n" - ) - elif "$ref" in property_schema: - ref = property_schema["$ref"].replace("#/components/schemas/", "") - f.write("\t\t" + property_name + ": Union[Unset, " + ref + "] = 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) - + "\n" - ) - elif "allOf" in property_schema: - thing = property_schema["allOf"][0] - if "$ref" in thing: - ref = thing["$ref"].replace("#/components/schemas/", "") - if ref == "Uuid": - return renderTypeToDict( - f, property_name, data["components"]["schemas"][ref], data - ) - f.write("\t\t" + property_name + ": Union[Unset, " + ref + "] = 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) - + "\n" - ) - else: - raise Exception("unknown allOf type: ", property_schema) - else: - f.write( - "\t\t" - + clean_parameter_name(property_name) - + " = self." - + clean_parameter_name(property_name) - + "\n" - ) - - -def renderTypeInit(f, property_name: str, property_schema: dict, data: dict): - property_name = clean_parameter_name(property_name) - # if "deprecated" in property_schema and property_schema["deprecated"]: - # TODO some properties are deprecated, but we still need to support them - # we should show some kind of warning here - if "type" in property_schema: - property_type = property_schema["type"] - - # Write the property. - if property_type == "string": - if "format" in property_schema: - if ( - property_schema["format"] == "date-time" - or property_schema["format"] == "partial-date-time" - ): - f.write( - "\t" - + property_name - + ": Union[Unset, datetime.datetime] = UNSET\n" - ) - # 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") - elif property_type == "number": - f.write("\t" + property_name + ": Union[Unset, float] = UNSET\n") - elif property_type == "boolean": - f.write("\t" + property_name + ": Union[Unset, bool] = False\n") - elif property_type == "array": - if "items" in property_schema: - if "$ref" in property_schema["items"]: - property_type = property_schema["items"]["$ref"] - property_type = property_type.replace("#/components/schemas/", "") - f.write( - "\tfrom ..models." - + camel_to_snake(property_type) - + " import " - + property_type - + "\n" - ) - elif "type" in property_schema["items"]: - if property_schema["items"]["type"] == "string": - property_type = "str" - elif property_schema["items"]["type"] == "number": - property_type = "float" - elif property_schema["items"]["type"] == "integer": - property_type = "int" - elif property_schema["items"]["type"] == "array": - if "items" in property_schema["items"]: - if property_schema["items"]["items"]["type"] == "string": - property_type = "List[str]" - elif property_schema["items"]["items"]["type"] == "number": - property_type = "List[float]" - else: - logging.error("property: ", property_schema) - raise Exception("Unknown property type") - else: - logging.error("property: ", property_schema) - raise Exception("Unknown property type") - else: - print("property: ", property_schema) - raise Exception("Unknown property type") - else: - logging.error("array: ", [property_schema]) - logging.error("array: ", [property_schema["items"]]) - raise Exception("Unknown array type") - - f.write( - "\t" - + property_name - + ": Union[Unset, List[" - + property_type - + "]] = UNSET\n" - ) - else: - raise Exception("Unknown array type") - else: - logging.error("property type: ", property_schema) - raise Exception("unknown type: ", property_type) - elif "$ref" in property_schema: - ref = property_schema["$ref"].replace("#/components/schemas/", "") - f.write("\t" + property_name + ": Union[Unset, " + ref + "] = UNSET\n") - elif "allOf" in property_schema: - thing = property_schema["allOf"][0] - if "$ref" in thing: - ref = thing["$ref"].replace("#/components/schemas/", "") - if ref == "Uuid": - return renderTypeInit( - f, property_name, data["components"]["schemas"][ref], data - ) - f.write("\t" + property_name + ": Union[Unset, " + ref + "] = UNSET\n") - else: - raise Exception("unknown allOf type: ", property_schema) - else: - f.write("\t" + property_name + ": Union[Unset, Any] = UNSET\n") - - -def renderTypeFromDict(f, property_name: str, property_schema: dict, data: dict): - if "type" in property_schema: - property_type = property_schema["type"] - - # Write the property. - if property_type == "string": - if "format" in property_schema: - if ( - property_schema["format"] == "date-time" - or property_schema["format"] == "partial-date-time" - ): - 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, datetime.datetime]\n" - ) - f.write( - "\t\tif isinstance(_" - + clean_parameter_name(property_name) - + ", Unset):\n" - ) - f.write( - "\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n" - ) - f.write("\t\telse:\n") - f.write( - "\t\t\t" - + clean_parameter_name(property_name) - + " = isoparse(_" - + clean_parameter_name(property_name) - + ")\n" - ) - 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" - + clean_parameter_name(property_name) - + ' = d.pop("' - + property_name - + '", UNSET)\n' - ) - f.write("\n") - elif property_type == "integer": - f.write( - "\t\t" - + clean_parameter_name(property_name) - + ' = d.pop("' - + property_name - + '", UNSET)\n' - ) - f.write("\n") - elif property_type == "number": - f.write( - "\t\t" - + clean_parameter_name(property_name) - + ' = d.pop("' - + property_name - + '", UNSET)\n' - ) - f.write("\n") - elif property_type == "boolean": - f.write( - "\t\t" - + clean_parameter_name(property_name) - + ' = d.pop("' - + property_name - + '", 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"]: - property_type = property_schema["items"]["$ref"] - property_type = property_type.replace("#/components/schemas/", "") - f.write( - "\t\tfrom ..models." - + camel_to_snake(property_type) - + " import " - + property_type - + "\n" - ) - elif "type" in property_schema["items"]: - if property_schema["items"]["type"] == "string": - property_type = "str" - elif property_schema["items"]["type"] == "number": - property_type = "float" - elif property_schema["items"]["type"] == "integer": - property_type = "int" - elif property_schema["items"]["type"] == "array": - if "items" in property_schema["items"]: - if property_schema["items"]["items"]["type"] == "string": - property_type = "List[str]" - elif property_schema["items"]["items"]["type"] == "number": - property_type = "List[float]" - else: - logging.error("property: ", property_schema) - raise Exception("Unknown property type") - else: - logging.error("property: ", property_schema) - raise Exception("Unknown property type") - else: - raise Exception( - " unknown array type: ", - property_schema["items"]["type"], - ) - else: - logging.error("array: ", [property_schema]) - logging.error("array: ", [property_schema["items"]]) - raise Exception("Unknown array type") - - f.write( - "\t\t" - + clean_parameter_name(property_name) - + " = cast(List[" - + property_type - + '], d.pop("' - + property_name - + '", UNSET))\n' - ) - f.write("\n") - else: - f.write( - "\t\t" - + clean_parameter_name(property_name) - + ' = d.pop("' - + property_name - + '", UNSET)\n' - ) - elif "$ref" in property_schema: - ref = property_schema["$ref"].replace("#/components/schemas/", "") - # Get the type for the reference. - actual_schema = data["components"]["schemas"][ref] - - f.write( - "\t\t_" - + clean_parameter_name(property_name) - + ' = d.pop("' - + property_name - + '", UNSET)\n' - ) - f.write( - "\t\t" - + clean_parameter_name(property_name) - + ": Union[Unset, " - + ref - + "]\n" - ) - f.write( - "\t\tif isinstance(_" + clean_parameter_name(property_name) + ", Unset):\n" - ) - f.write("\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n") - f.write("\t\tif _" + clean_parameter_name(property_name) + " is None:\n") - f.write("\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n") - f.write("\t\telse:\n") - - is_enum = isEnumWithDocsOneOf(actual_schema) - if ( - "properties" in actual_schema - or "oneOf" in actual_schema - or "anyOf" in actual_schema - or "allOf" in actual_schema - ) and not is_enum: - f.write( - "\t\t\t" - + clean_parameter_name(property_name) - + " = " - + ref - + ".from_dict(_" - + clean_parameter_name(property_name) - + ")\n" - ) - else: - f.write( - "\t\t\t" - + clean_parameter_name(property_name) - + " = _" - + clean_parameter_name(property_name) - + "\n" - ) - - f.write("\n") - elif "allOf" in property_schema: - if len(property_schema["allOf"]) != 1: - print(property_schema) - raise Exception("Unknown allOf") - thing = property_schema["allOf"][0] - renderTypeFromDict(f, property_name, thing, data) - else: - f.write( - "\t\t" - + clean_parameter_name(property_name) - + ' = d.pop("' - + property_name - + '", UNSET)\n' - ) - - -def hasDateTime(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_date_time = hasDateTime(property_schema) - if has_date_time: - return True - elif type_name == "string" and "format" in schema: - if ( - schema["format"] == "date-time" - or schema["format"] == "partial-date-time" - ): - return True - - return False - - -def hasBase64(schema: dict) -> bool: - # Generate the type. - if "type" in schema: - type_name = schema["type"] - if type_name == "object": - if "additionalProperties" in schema: - return hasBase64(schema["additionalProperties"]) - # 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: @@ -2454,6 +1640,12 @@ def getRefs(schema: dict) -> List[str]: else: logging.error("unsupported type: ", schema) raise Exception("unsupported type: ", schema) + elif type_name == "array": + if "items" in schema: + schema_refs = getRefs(schema["items"]) + for ref in schema_refs: + if ref not in refs: + refs.append(ref) return refs @@ -2764,6 +1956,34 @@ def getTagOneOf(schema: dict) -> Optional[str]: return tag +def getContentOneOf(schema: dict, tag: Optional[str]) -> Optional[str]: + if tag is None: + return None + content = None + for one_of in schema["oneOf"]: + has_content = False + # Check if each are an object w 1 property in it. + if one_of["type"] == "object" and "properties" in one_of: + if len(one_of["properties"]) != 2: + return None + + for prop_name in one_of["properties"]: + if prop_name == tag: + continue + if content is not None and content != prop_name: + has_content = False + break + else: + has_content = True + content = prop_name + + if has_content is False: + content = None + break + + return content + + def isEnumWithDocsOneOf(schema: dict) -> bool: if "oneOf" not in schema: return False @@ -2826,6 +2046,51 @@ def getDetailedFunctionResultType(endpoint: dict, endpoint_refs: List[str]) -> s return "Response[" + getFunctionResultType(endpoint, endpoint_refs) + "]" +def getTypeName(schema: dict) -> str: + if "type" in schema: + if schema["type"] == "string": + if "format" in schema: + if ( + schema["format"] == "date-time" + or schema["format"] == "partial-date-time" + ): + return "datetime.datetime" + elif schema["format"] == "byte": + return "Base64Bytes" + elif schema["format"] == "uuid": + return "UUID" + elif schema["format"] == "url": + return "AnyUrl" + elif schema["format"] == "phone": + return "PhoneNumber" + return "str" + elif schema["type"] == "number": + return "float" + elif schema["type"] == "boolean": + return "bool" + elif schema["type"] == "integer": + return "int" + elif schema["type"] == "array": + if "items" in schema: + item_type = getTypeName(schema["items"]) + if "format" in schema["items"] and schema["items"]["format"] == "uint8": + return "bytes" + else: + return "List[" + item_type + "]" + elif "additionalProperties" in schema and schema["type"] == "object": + item_type = getTypeName(schema["additionalProperties"]) + return "Dict[str, " + item_type + "]" + elif "$ref" in schema: + return schema["$ref"].replace("#/components/schemas/", "") + elif "allOf" in schema and len(schema["allOf"]) == 1: + return getTypeName(schema["allOf"][0]) + elif "description" in schema: + return "Any" + + logging.error("schema: ", [schema]) + raise Exception("Unknown schema type") + + letters: List[str] = [] diff --git a/generate/int.py.jinja2 b/generate/int.py.jinja2 new file mode 100644 index 000000000..11136ff1d --- /dev/null +++ b/generate/int.py.jinja2 @@ -0,0 +1,16 @@ +from typing import Any + +from pydantic import GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema + + +class {{name}}(int): + """{{description}}""" + def __int__(self) -> int: + return self + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function(cls, handler(int)) diff --git a/generate/object.py.jinja2 b/generate/object.py.jinja2 new file mode 100644 index 000000000..1336b5950 --- /dev/null +++ b/generate/object.py.jinja2 @@ -0,0 +1,20 @@ +import datetime +from typing import List, Optional, Dict, Union, Any +from uuid import UUID + +from pydantic import BaseModel, Base64Bytes, AnyUrl +from pydantic_extra_types.phone_numbers import PhoneNumber + +{% for import in imports %} +{{ import }} +{% endfor %} + +class {{ name }}(BaseModel): + """{{ description }}""" + {% for field in fields %} + {% if field.value %} + {{ field.name }}: {{ field.type }} = {{ field.value }} + {% else %} + {{ field.name }}: {{ field.type }} + {% endif %} + {% endfor %} diff --git a/generate/run.sh b/generate/run.sh index 26a813ae5..0b819dcdf 100755 --- a/generate/run.sh +++ b/generate/run.sh @@ -5,13 +5,11 @@ 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/models/base64data.py git checkout kittycad/models/empty.py # Generate new. @@ -21,7 +19,7 @@ poetry run python generate/generate.py poetry run isort . poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py poetry run ruff check --fix . -poetry run mypy . || true +poetry run mypy . # Run the tests. diff --git a/generate/str.py.jinja2 b/generate/str.py.jinja2 new file mode 100644 index 000000000..b64676e7d --- /dev/null +++ b/generate/str.py.jinja2 @@ -0,0 +1,16 @@ +from typing import Any + +from pydantic import GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema + + +class {{name}}(str): + """{{description}}""" + def __str__(self) -> str: + return self + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function(cls, handler(str)) diff --git a/generate/union-type.py.jinja2 b/generate/union-type.py.jinja2 index 21ab728a1..e64a984c9 100644 --- a/generate/union-type.py.jinja2 +++ b/generate/union-type.py.jinja2 @@ -3,6 +3,9 @@ from typing_extensions import Self import attr from ..types import UNSET, Unset +from pydantic import GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema + GY = TypeVar("GY", bound="{{name}}") @attr.s(auto_attribs=True) @@ -24,14 +27,14 @@ class {{name}}: ]): self.type = type - def to_dict(self) -> Dict[str, Any]: + def model_dump(self) -> Dict[str, Any]: {% for type in types %}{% if loop.first %} if isinstance(self.type, {{type.name}}): {{type.var0}} : {{type.name}} = self.type - return {{type.var0}}.to_dict() + return {{type.var0}}.model_dump() {% else %}elif isinstance(self.type, {{type.name}}): {{type.var0}} : {{type.name}} = self.type - return {{type.var0}}.to_dict() + return {{type.var0}}.model_dump() {% endif %}{% endfor %} raise Exception("Unknown type") @@ -39,12 +42,20 @@ class {{name}}: def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY: {% for type in types %}{% if loop.first %} if d.get("{{type.check}}") == {{type.value}}: - {{type.var1}} : {{type.name}} = {{type.name}}() - {{type.var1}}.from_dict(d) + {{type.var1}} : {{type.name}} = {{type.name}}(**d) return cls(type={{type.var1}}) {% else %}elif d.get("{{type.check}}") == {{type.value}}: - {{type.var1}} : {{type.name}} = {{type.name}}() - {{type.var1}}.from_dict(d) + {{type.var1}} : {{type.name}} = {{type.name}}(**d) return cls(type={{type.var1}}) {% endif %}{% endfor %} raise Exception("Unknown type") + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function(cls, handler(Union[ + {% for type in types %} + {{type.name}}, + {% endfor %} + ])) diff --git a/kittycad.py.patch.json b/kittycad.py.patch.json index 42d9bcd06..2a38819b7 100644 --- a/kittycad.py.patch.json +++ b/kittycad.py.patch.json @@ -1,242 +1,10 @@ [ { "op": "add", - "path": "/info/x-python", + "path": "/paths/~1user~1payment/post/x-python", "value": { - "client": "# Create a client with your token.\nfrom kittycad.client 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.client 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/~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/~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/~1ai-prompts~1{id}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_ai_prompt\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPrompt, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_prompt():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPrompt, Error]] = get_ai_prompt.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: AiPrompt = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_ai_prompt.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/~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~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/~1user~1text-to-cad~1{id}/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad_model_feedback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.models.ai_feedback import AiFeedback\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad_model_feedback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = create_text_to_cad_model_feedback.sync(\n client=client,\n id=\"\",\n feedback=AiFeedback.THUMBS_UP,\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.ai.create_text_to_cad_model_feedback.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1text-to-cad~1{id}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_text_to_cad_model_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.types import Response\n\n\ndef example_get_text_to_cad_model_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCad, Error]\n ] = get_text_to_cad_model_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: TextToCad = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_text_to_cad_model_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1ai-prompts/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_ai_prompts\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPromptResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_ai_prompts():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPromptResultsPage, Error]] = list_ai_prompts.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: AiPromptResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_ai_prompts.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/~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/~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/~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/~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/~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/~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/~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-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/~1ws~1modeling~1commands/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.modeling import modeling_commands_ws\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, WebSocketRequest, WebSocketResponse\nfrom kittycad.models.rtc_sdp_type import RtcSdpType\nfrom kittycad.models.rtc_session_description import RtcSessionDescription\nfrom kittycad.models.web_socket_request import sdp_offer\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.WebSocket(\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 WebSocketRequest(\n sdp_offer(\n offer=RtcSessionDescription(\n sdp=\"\",\n type=RtcSdpType.UNSPECIFIED,\n ),\n )\n )\n )\n\n # Get a message.\n message = websocket.recv()\n print(message)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.modeling_commands_ws.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/~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~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~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/~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/~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/~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/~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~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/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" + "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" } }, { @@ -249,330 +17,26 @@ }, { "op": "add", - "path": "/paths/~1user~1payment/post/x-python", + "path": "/paths/~1user~1payment/delete/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" + "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/~1users-extended/get/x-python", + "path": "/paths/~1user~1payment/put/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" + "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/~1apps~1github~1webhook/post/x-python", + "path": "/paths/~1user~1api-tokens~1{token}/get/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/~1ai~1text-to-cad~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_cad\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.text_to_cad_create_body import TextToCadCreateBody\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[TextToCad, Error]] = create_text_to_cad.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n body=TextToCadCreateBody(\n prompt=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_cad.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~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/~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~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/~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/~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/~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/~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/~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~1text-to-cad/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_text_to_cad_models_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCadResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_text_to_cad_models_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCadResultsPage, Error]\n ] = list_text_to_cad_models_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: TextToCadResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_text_to_cad_models_for_user.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/~1internal~1discord~1api-token~1{discord_id}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import internal_get_api_token_for_discord_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_internal_get_api_token_for_discord_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiToken, Error]\n ] = internal_get_api_token_for_discord_user.sync(\n client=client,\n discord_id=\"\",\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.meta.internal_get_api_token_for_discord_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/~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/~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/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/~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/~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~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/~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/~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/~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~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/~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/~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/~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~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/~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/~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" - } - }, - { - "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~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/~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 TextToCad,\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 TextToCad,\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 TextToCad,\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~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/~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/~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" + "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" } }, { @@ -585,10 +49,546 @@ }, { "op": "add", - "path": "/paths/~1user~1api-tokens~1{token}/get/x-python", + "path": "/paths/~1user~1session~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" + "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/~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/~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/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/~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 TextToCad,\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 TextToCad,\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 TextToCad,\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/~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/~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/~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/~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/~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/~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/~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~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/~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/~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~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/~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/~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/~1ws~1modeling~1commands/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.modeling import modeling_commands_ws\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, WebSocketRequest, WebSocketResponse\nfrom kittycad.models.rtc_sdp_type import RtcSdpType\nfrom kittycad.models.rtc_session_description import RtcSessionDescription\nfrom kittycad.models.web_socket_request import sdp_offer\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 with modeling_commands_ws.WebSocket(\n client=client,\n fps=10,\n unlocked_framerate=False,\n video_res_height=10,\n video_res_width=10,\n webrtc=False,\n ) as websocket:\n # Send a message.\n websocket.send(\n WebSocketRequest(\n sdp_offer(\n offer=RtcSessionDescription(\n sdp=\"\",\n type=RtcSdpType.UNSPECIFIED,\n ),\n )\n )\n )\n\n # Get a message.\n message = websocket.recv()\n print(message)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.modeling_commands_ws.html" + } + }, + { + "op": "add", + "path": "/paths/~1ai~1text-to-cad~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_cad\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.text_to_cad_create_body import TextToCadCreateBody\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[TextToCad, Error]] = create_text_to_cad.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n body=TextToCadCreateBody(\n prompt=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_cad.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/~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/~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/~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/~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~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/~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~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/~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/~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/~1ai-prompts/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_ai_prompts\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPromptResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_ai_prompts():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPromptResultsPage, Error]] = list_ai_prompts.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: AiPromptResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_ai_prompts.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/~1internal~1discord~1api-token~1{discord_id}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import internal_get_api_token_for_discord_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_internal_get_api_token_for_discord_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiToken, Error]\n ] = internal_get_api_token_for_discord_user.sync(\n client=client,\n discord_id=\"\",\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.meta.internal_get_api_token_for_discord_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1text-to-cad/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_text_to_cad_models_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCadResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_text_to_cad_models_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCadResultsPage, Error]\n ] = list_text_to_cad_models_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: TextToCadResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_text_to_cad_models_for_user.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 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/~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/~1user~1text-to-cad~1{id}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_text_to_cad_model_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.types import Response\n\n\ndef example_get_text_to_cad_model_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCad, Error]\n ] = get_text_to_cad_model_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: TextToCad = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_text_to_cad_model_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1text-to-cad~1{id}/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad_model_feedback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.models.ai_feedback import AiFeedback\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad_model_feedback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = create_text_to_cad_model_feedback.sync(\n client=client,\n id=\"\",\n feedback=AiFeedback.THUMBS_UP,\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.ai.create_text_to_cad_model_feedback.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~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~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/~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/~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~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/~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/~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/~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/~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/~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~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/~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 with create_executor_term.sync(\n client=client,\n ) as websocket:\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/~1ai-prompts~1{id}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_ai_prompt\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPrompt, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_prompt():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPrompt, Error]] = get_ai_prompt.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: AiPrompt = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_ai_prompt.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/~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/~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/~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/~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/~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/~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" + } + }, + { + "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/~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/~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~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/~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": "/info/x-python", + "value": { + "client": "# Create a client with your token.\nfrom kittycad.client 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.client 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" } } ] \ No newline at end of file diff --git a/kittycad/api/ai/create_text_to_cad.py b/kittycad/api/ai/create_text_to_cad.py index 8ba659da4..cafc28a52 100644 --- a/kittycad/api/ai/create_text_to_cad.py +++ b/kittycad/api/ai/create_text_to_cad.py @@ -35,15 +35,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[TextToCad, Error]]: if response.status_code == 201: - response_201 = TextToCad.from_dict(response.json()) + response_201 = TextToCad(**response.json()) return response_201 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/ai/create_text_to_cad_model_feedback.py b/kittycad/api/ai/create_text_to_cad_model_feedback.py index 062052fac..9da92218e 100644 --- a/kittycad/api/ai/create_text_to_cad_model_feedback.py +++ b/kittycad/api/ai/create_text_to_cad_model_feedback.py @@ -39,12 +39,12 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Error]: return None if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: diff --git a/kittycad/api/ai/get_ai_prompt.py b/kittycad/api/ai/get_ai_prompt.py index 5e2d6458d..b9403c46f 100644 --- a/kittycad/api/ai/get_ai_prompt.py +++ b/kittycad/api/ai/get_ai_prompt.py @@ -31,15 +31,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[AiPrompt, Error]]: if response.status_code == 200: - response_200 = AiPrompt.from_dict(response.json()) + response_200 = AiPrompt(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/ai/get_text_to_cad_model_for_user.py b/kittycad/api/ai/get_text_to_cad_model_for_user.py index 699931098..a26fab3eb 100644 --- a/kittycad/api/ai/get_text_to_cad_model_for_user.py +++ b/kittycad/api/ai/get_text_to_cad_model_for_user.py @@ -31,15 +31,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[TextToCad, Error]]: if response.status_code == 200: - response_200 = TextToCad.from_dict(response.json()) + response_200 = TextToCad(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/ai/list_ai_prompts.py b/kittycad/api/ai/list_ai_prompts.py index 90c8383c4..a69f7d04a 100644 --- a/kittycad/api/ai/list_ai_prompts.py +++ b/kittycad/api/ai/list_ai_prompts.py @@ -53,15 +53,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[AiPromptResultsPage, Error]]: if response.status_code == 200: - response_200 = AiPromptResultsPage.from_dict(response.json()) + response_200 = AiPromptResultsPage(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/ai/list_text_to_cad_models_for_user.py b/kittycad/api/ai/list_text_to_cad_models_for_user.py index 0d615a2e9..79e93716f 100644 --- a/kittycad/api/ai/list_text_to_cad_models_for_user.py +++ b/kittycad/api/ai/list_text_to_cad_models_for_user.py @@ -53,15 +53,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[TextToCadResultsPage, Error]]: if response.status_code == 200: - response_200 = TextToCadResultsPage.from_dict(response.json()) + response_200 = TextToCadResultsPage(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/api_calls/get_api_call.py b/kittycad/api/api_calls/get_api_call.py index b140be1d4..d7ed245e0 100644 --- a/kittycad/api/api_calls/get_api_call.py +++ b/kittycad/api/api_calls/get_api_call.py @@ -33,15 +33,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[ApiCallWithPrice, Error]]: if response.status_code == 200: - response_200 = ApiCallWithPrice.from_dict(response.json()) + response_200 = ApiCallWithPrice(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/api_calls/get_api_call_for_user.py b/kittycad/api/api_calls/get_api_call_for_user.py index b0ff01b9f..5d32de066 100644 --- a/kittycad/api/api_calls/get_api_call_for_user.py +++ b/kittycad/api/api_calls/get_api_call_for_user.py @@ -33,15 +33,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[ApiCallWithPrice, Error]]: if response.status_code == 200: - response_200 = ApiCallWithPrice.from_dict(response.json()) + response_200 = ApiCallWithPrice(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/api_calls/get_api_call_metrics.py b/kittycad/api/api_calls/get_api_call_metrics.py index 86f4892d0..a0d5e1688 100644 --- a/kittycad/api/api_calls/get_api_call_metrics.py +++ b/kittycad/api/api_calls/get_api_call_metrics.py @@ -39,15 +39,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[List[ApiCallQueryGroup], Error]]: if response.status_code == 200: - response_200 = [ApiCallQueryGroup.from_dict(item) for item in response.json()] + response_200 = [ApiCallQueryGroup(**item) for item in response.json()] return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/api_calls/get_async_operation.py b/kittycad/api/api_calls/get_async_operation.py index f44e60eb8..a57b09f68 100644 --- a/kittycad/api/api_calls/get_async_operation.py +++ b/kittycad/api/api_calls/get_async_operation.py @@ -54,7 +54,7 @@ def _parse_response( try: if not isinstance(data, dict): raise TypeError() - option_file_conversion = FileConversion.from_dict(data) + option_file_conversion = FileConversion(**data) return option_file_conversion except ValueError: pass @@ -63,7 +63,7 @@ def _parse_response( try: if not isinstance(data, dict): raise TypeError() - option_file_center_of_mass = FileCenterOfMass.from_dict(data) + option_file_center_of_mass = FileCenterOfMass(**data) return option_file_center_of_mass except ValueError: pass @@ -72,7 +72,7 @@ def _parse_response( try: if not isinstance(data, dict): raise TypeError() - option_file_mass = FileMass.from_dict(data) + option_file_mass = FileMass(**data) return option_file_mass except ValueError: pass @@ -81,7 +81,7 @@ def _parse_response( try: if not isinstance(data, dict): raise TypeError() - option_file_volume = FileVolume.from_dict(data) + option_file_volume = FileVolume(**data) return option_file_volume except ValueError: pass @@ -90,7 +90,7 @@ def _parse_response( try: if not isinstance(data, dict): raise TypeError() - option_file_density = FileDensity.from_dict(data) + option_file_density = FileDensity(**data) return option_file_density except ValueError: pass @@ -99,7 +99,7 @@ def _parse_response( try: if not isinstance(data, dict): raise TypeError() - option_file_surface_area = FileSurfaceArea.from_dict(data) + option_file_surface_area = FileSurfaceArea(**data) return option_file_surface_area except ValueError: pass @@ -108,19 +108,19 @@ def _parse_response( try: if not isinstance(data, dict): raise TypeError() - option_text_to_cad = TextToCad.from_dict(data) + option_text_to_cad = TextToCad(**data) return option_text_to_cad except ValueError: raise except TypeError: raise if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/api_calls/list_api_calls.py b/kittycad/api/api_calls/list_api_calls.py index 45071e281..49e89d063 100644 --- a/kittycad/api/api_calls/list_api_calls.py +++ b/kittycad/api/api_calls/list_api_calls.py @@ -53,15 +53,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: if response.status_code == 200: - response_200 = ApiCallWithPriceResultsPage.from_dict(response.json()) + response_200 = ApiCallWithPriceResultsPage(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/api_calls/list_api_calls_for_user.py b/kittycad/api/api_calls/list_api_calls_for_user.py index beb575684..6ca7108d3 100644 --- a/kittycad/api/api_calls/list_api_calls_for_user.py +++ b/kittycad/api/api_calls/list_api_calls_for_user.py @@ -55,15 +55,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: if response.status_code == 200: - response_200 = ApiCallWithPriceResultsPage.from_dict(response.json()) + response_200 = ApiCallWithPriceResultsPage(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/api_calls/list_async_operations.py b/kittycad/api/api_calls/list_async_operations.py index fd1a2664b..be3833226 100644 --- a/kittycad/api/api_calls/list_async_operations.py +++ b/kittycad/api/api_calls/list_async_operations.py @@ -61,15 +61,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[AsyncApiCallResultsPage, Error]]: if response.status_code == 200: - response_200 = AsyncApiCallResultsPage.from_dict(response.json()) + response_200 = AsyncApiCallResultsPage(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/api_calls/user_list_api_calls.py b/kittycad/api/api_calls/user_list_api_calls.py index a6a1cec93..48e19931f 100644 --- a/kittycad/api/api_calls/user_list_api_calls.py +++ b/kittycad/api/api_calls/user_list_api_calls.py @@ -53,15 +53,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: if response.status_code == 200: - response_200 = ApiCallWithPriceResultsPage.from_dict(response.json()) + response_200 = ApiCallWithPriceResultsPage(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/api_tokens/create_api_token_for_user.py b/kittycad/api/api_tokens/create_api_token_for_user.py index 6b7c3d972..e40a27fb6 100644 --- a/kittycad/api/api_tokens/create_api_token_for_user.py +++ b/kittycad/api/api_tokens/create_api_token_for_user.py @@ -29,15 +29,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiToken, Error]]: if response.status_code == 201: - response_201 = ApiToken.from_dict(response.json()) + response_201 = ApiToken(**response.json()) return response_201 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/api_tokens/delete_api_token_for_user.py b/kittycad/api/api_tokens/delete_api_token_for_user.py index c3dd8345f..6a6063749 100644 --- a/kittycad/api/api_tokens/delete_api_token_for_user.py +++ b/kittycad/api/api_tokens/delete_api_token_for_user.py @@ -31,12 +31,12 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Error]: return None if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: diff --git a/kittycad/api/api_tokens/get_api_token_for_user.py b/kittycad/api/api_tokens/get_api_token_for_user.py index b26130194..dfc19d6db 100644 --- a/kittycad/api/api_tokens/get_api_token_for_user.py +++ b/kittycad/api/api_tokens/get_api_token_for_user.py @@ -31,15 +31,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiToken, Error]]: if response.status_code == 200: - response_200 = ApiToken.from_dict(response.json()) + response_200 = ApiToken(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/api_tokens/list_api_tokens_for_user.py b/kittycad/api/api_tokens/list_api_tokens_for_user.py index 2f355fe2c..aced0cc4b 100644 --- a/kittycad/api/api_tokens/list_api_tokens_for_user.py +++ b/kittycad/api/api_tokens/list_api_tokens_for_user.py @@ -53,15 +53,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[ApiTokenResultsPage, Error]]: if response.status_code == 200: - response_200 = ApiTokenResultsPage.from_dict(response.json()) + response_200 = ApiTokenResultsPage(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/apps/apps_github_callback.py b/kittycad/api/apps/apps_github_callback.py index 90953b092..c281d40be 100644 --- a/kittycad/api/apps/apps_github_callback.py +++ b/kittycad/api/apps/apps_github_callback.py @@ -29,12 +29,12 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Error]: return None if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: diff --git a/kittycad/api/apps/apps_github_consent.py b/kittycad/api/apps/apps_github_consent.py index e2ccfa94f..977208709 100644 --- a/kittycad/api/apps/apps_github_consent.py +++ b/kittycad/api/apps/apps_github_consent.py @@ -31,15 +31,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[AppClientInfo, Error]]: if response.status_code == 200: - response_200 = AppClientInfo.from_dict(response.json()) + response_200 = AppClientInfo(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/apps/apps_github_webhook.py b/kittycad/api/apps/apps_github_webhook.py index 0713325b7..fcf3719ba 100644 --- a/kittycad/api/apps/apps_github_webhook.py +++ b/kittycad/api/apps/apps_github_webhook.py @@ -31,12 +31,12 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Error]: return None if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: diff --git a/kittycad/api/executor/create_executor_term.py b/kittycad/api/executor/create_executor_term.py index b91a38582..8c88bc797 100644 --- a/kittycad/api/executor/create_executor_term.py +++ b/kittycad/api/executor/create_executor_term.py @@ -33,7 +33,7 @@ def sync( client=client, ) - return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=None, compression=None, max_size=None) # type: ignore + return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"]) # type: ignore async def asyncio( diff --git a/kittycad/api/executor/create_file_execution.py b/kittycad/api/executor/create_file_execution.py index d7b017b8b..392cf754c 100644 --- a/kittycad/api/executor/create_file_execution.py +++ b/kittycad/api/executor/create_file_execution.py @@ -41,15 +41,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[CodeOutput, Error]]: if response.status_code == 200: - response_200 = CodeOutput.from_dict(response.json()) + response_200 = CodeOutput(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/file/create_file_center_of_mass.py b/kittycad/api/file/create_file_center_of_mass.py index 03118befa..a295611c3 100644 --- a/kittycad/api/file/create_file_center_of_mass.py +++ b/kittycad/api/file/create_file_center_of_mass.py @@ -49,15 +49,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[FileCenterOfMass, Error]]: if response.status_code == 201: - response_201 = FileCenterOfMass.from_dict(response.json()) + response_201 = FileCenterOfMass(**response.json()) return response_201 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/file/create_file_conversion.py b/kittycad/api/file/create_file_conversion.py index ceb49f472..d45686fdd 100644 --- a/kittycad/api/file/create_file_conversion.py +++ b/kittycad/api/file/create_file_conversion.py @@ -39,15 +39,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[FileConversion, Error]]: if response.status_code == 201: - response_201 = FileConversion.from_dict(response.json()) + response_201 = FileConversion(**response.json()) return response_201 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/file/create_file_density.py b/kittycad/api/file/create_file_density.py index 79e00a28a..46b6d84b9 100644 --- a/kittycad/api/file/create_file_density.py +++ b/kittycad/api/file/create_file_density.py @@ -62,15 +62,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[FileDensity, Error]]: if response.status_code == 201: - response_201 = FileDensity.from_dict(response.json()) + response_201 = FileDensity(**response.json()) return response_201 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/file/create_file_mass.py b/kittycad/api/file/create_file_mass.py index d251c676f..2bb7a2daa 100644 --- a/kittycad/api/file/create_file_mass.py +++ b/kittycad/api/file/create_file_mass.py @@ -62,15 +62,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[FileMass, Error]]: if response.status_code == 201: - response_201 = FileMass.from_dict(response.json()) + response_201 = FileMass(**response.json()) return response_201 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/file/create_file_surface_area.py b/kittycad/api/file/create_file_surface_area.py index 2399901b8..efe655c5a 100644 --- a/kittycad/api/file/create_file_surface_area.py +++ b/kittycad/api/file/create_file_surface_area.py @@ -49,15 +49,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[FileSurfaceArea, Error]]: if response.status_code == 201: - response_201 = FileSurfaceArea.from_dict(response.json()) + response_201 = FileSurfaceArea(**response.json()) return response_201 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/file/create_file_volume.py b/kittycad/api/file/create_file_volume.py index 040c2f234..41bece21a 100644 --- a/kittycad/api/file/create_file_volume.py +++ b/kittycad/api/file/create_file_volume.py @@ -47,15 +47,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[FileVolume, Error]]: if response.status_code == 201: - response_201 = FileVolume.from_dict(response.json()) + response_201 = FileVolume(**response.json()) return response_201 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/hidden/auth_email.py b/kittycad/api/hidden/auth_email.py index 4487132a8..d8f13dd78 100644 --- a/kittycad/api/hidden/auth_email.py +++ b/kittycad/api/hidden/auth_email.py @@ -34,15 +34,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[VerificationToken, Error]]: if response.status_code == 201: - response_201 = VerificationToken.from_dict(response.json()) + response_201 = VerificationToken(**response.json()) return response_201 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/hidden/auth_email_callback.py b/kittycad/api/hidden/auth_email_callback.py index 0a60803b6..53dafbc2e 100644 --- a/kittycad/api/hidden/auth_email_callback.py +++ b/kittycad/api/hidden/auth_email_callback.py @@ -50,12 +50,12 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Error]: return None if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: diff --git a/kittycad/api/hidden/logout.py b/kittycad/api/hidden/logout.py index b8e3bbae9..e73ebe334 100644 --- a/kittycad/api/hidden/logout.py +++ b/kittycad/api/hidden/logout.py @@ -29,12 +29,12 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Error]: return None if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: diff --git a/kittycad/api/meta/get_ai_plugin_manifest.py b/kittycad/api/meta/get_ai_plugin_manifest.py index a7f6cf90b..f1539b531 100644 --- a/kittycad/api/meta/get_ai_plugin_manifest.py +++ b/kittycad/api/meta/get_ai_plugin_manifest.py @@ -31,15 +31,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[AiPluginManifest, Error]]: if response.status_code == 200: - response_200 = AiPluginManifest.from_dict(response.json()) + response_200 = AiPluginManifest(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/meta/get_metadata.py b/kittycad/api/meta/get_metadata.py index 8add017f6..2c5039948 100644 --- a/kittycad/api/meta/get_metadata.py +++ b/kittycad/api/meta/get_metadata.py @@ -29,15 +29,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[Metadata, Error]]: if response.status_code == 200: - response_200 = Metadata.from_dict(response.json()) + response_200 = Metadata(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/meta/get_openai_schema.py b/kittycad/api/meta/get_openai_schema.py index 72a38e14c..9ce8fa7a7 100644 --- a/kittycad/api/meta/get_openai_schema.py +++ b/kittycad/api/meta/get_openai_schema.py @@ -31,12 +31,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]] response_200 = response.json() return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/meta/get_schema.py b/kittycad/api/meta/get_schema.py index 7b9788435..e57b41197 100644 --- a/kittycad/api/meta/get_schema.py +++ b/kittycad/api/meta/get_schema.py @@ -31,12 +31,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]] response_200 = response.json() return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/meta/internal_get_api_token_for_discord_user.py b/kittycad/api/meta/internal_get_api_token_for_discord_user.py index a7c8921f1..282d54e3a 100644 --- a/kittycad/api/meta/internal_get_api_token_for_discord_user.py +++ b/kittycad/api/meta/internal_get_api_token_for_discord_user.py @@ -31,15 +31,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiToken, Error]]: if response.status_code == 200: - response_200 = ApiToken.from_dict(response.json()) + response_200 = ApiToken(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/meta/ping.py b/kittycad/api/meta/ping.py index 81c5a4d62..e71b7dcea 100644 --- a/kittycad/api/meta/ping.py +++ b/kittycad/api/meta/ping.py @@ -29,15 +29,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[Pong, Error]]: if response.status_code == 200: - response_200 = Pong.from_dict(response.json()) + response_200 = Pong(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/modeling/modeling_commands_ws.py b/kittycad/api/modeling/modeling_commands_ws.py index fde288613..d35cbafb5 100644 --- a/kittycad/api/modeling/modeling_commands_ws.py +++ b/kittycad/api/modeling/modeling_commands_ws.py @@ -82,7 +82,7 @@ def sync( client=client, ) - return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=None, compression=None, max_size=None) # type: ignore + return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"]) # type: ignore async def asyncio( @@ -153,20 +153,20 @@ class WebSocket: """ for message in self.ws: - yield WebSocketResponse.from_dict(json.loads(message)) + yield WebSocketResponse(**json.loads(message)) def send(self, data: WebSocketRequest): """Send data to the websocket.""" - self.ws.send(json.dumps(data.to_dict())) + self.ws.send(json.dumps(data.model_dump())) def send_binary(self, data: WebSocketRequest): """Send data as bson to the websocket.""" - self.ws.send(bson.BSON.encode(data.to_dict())) + self.ws.send(bson.encode(data.model_dump())) def recv(self) -> WebSocketResponse: """Receive data from the websocket.""" message = self.ws.recv() - return WebSocketResponse.from_dict(json.loads(message)) + return WebSocketResponse(**json.loads(message)) def close(self): """Close the websocket.""" diff --git a/kittycad/api/payments/create_payment_information_for_user.py b/kittycad/api/payments/create_payment_information_for_user.py index a29c97371..6b7731ca1 100644 --- a/kittycad/api/payments/create_payment_information_for_user.py +++ b/kittycad/api/payments/create_payment_information_for_user.py @@ -32,15 +32,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]: if response.status_code == 201: - response_201 = Customer.from_dict(response.json()) + response_201 = Customer(**response.json()) return response_201 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/payments/create_payment_intent_for_user.py b/kittycad/api/payments/create_payment_intent_for_user.py index c212b22f1..faad36d96 100644 --- a/kittycad/api/payments/create_payment_intent_for_user.py +++ b/kittycad/api/payments/create_payment_intent_for_user.py @@ -31,15 +31,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[PaymentIntent, Error]]: if response.status_code == 201: - response_201 = PaymentIntent.from_dict(response.json()) + response_201 = PaymentIntent(**response.json()) return response_201 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/payments/delete_payment_information_for_user.py b/kittycad/api/payments/delete_payment_information_for_user.py index 159f523a2..3d937a881 100644 --- a/kittycad/api/payments/delete_payment_information_for_user.py +++ b/kittycad/api/payments/delete_payment_information_for_user.py @@ -29,12 +29,12 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Error]: return None if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: diff --git a/kittycad/api/payments/delete_payment_method_for_user.py b/kittycad/api/payments/delete_payment_method_for_user.py index 52f69e264..5d62fcc22 100644 --- a/kittycad/api/payments/delete_payment_method_for_user.py +++ b/kittycad/api/payments/delete_payment_method_for_user.py @@ -31,12 +31,12 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Error]: return None if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: diff --git a/kittycad/api/payments/get_payment_balance_for_user.py b/kittycad/api/payments/get_payment_balance_for_user.py index 4de88e376..d5dc578b8 100644 --- a/kittycad/api/payments/get_payment_balance_for_user.py +++ b/kittycad/api/payments/get_payment_balance_for_user.py @@ -31,15 +31,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[CustomerBalance, Error]]: if response.status_code == 200: - response_200 = CustomerBalance.from_dict(response.json()) + response_200 = CustomerBalance(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/payments/get_payment_information_for_user.py b/kittycad/api/payments/get_payment_information_for_user.py index 44f5692e5..f1ae9f2d7 100644 --- a/kittycad/api/payments/get_payment_information_for_user.py +++ b/kittycad/api/payments/get_payment_information_for_user.py @@ -29,15 +29,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]: if response.status_code == 200: - response_200 = Customer.from_dict(response.json()) + response_200 = Customer(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/payments/list_invoices_for_user.py b/kittycad/api/payments/list_invoices_for_user.py index 2af14491d..a219fdad1 100644 --- a/kittycad/api/payments/list_invoices_for_user.py +++ b/kittycad/api/payments/list_invoices_for_user.py @@ -31,15 +31,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[List[Invoice], Error]]: if response.status_code == 200: - response_200 = [Invoice.from_dict(item) for item in response.json()] + response_200 = [Invoice(**item) for item in response.json()] return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/payments/list_payment_methods_for_user.py b/kittycad/api/payments/list_payment_methods_for_user.py index f23fc4d9c..d361c239a 100644 --- a/kittycad/api/payments/list_payment_methods_for_user.py +++ b/kittycad/api/payments/list_payment_methods_for_user.py @@ -31,15 +31,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[List[PaymentMethod], Error]]: if response.status_code == 200: - response_200 = [PaymentMethod.from_dict(item) for item in response.json()] + response_200 = [PaymentMethod(**item) for item in response.json()] return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/payments/update_payment_information_for_user.py b/kittycad/api/payments/update_payment_information_for_user.py index e4ab3a8c7..6b295a0a9 100644 --- a/kittycad/api/payments/update_payment_information_for_user.py +++ b/kittycad/api/payments/update_payment_information_for_user.py @@ -32,15 +32,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]: if response.status_code == 200: - response_200 = Customer.from_dict(response.json()) + response_200 = Customer(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/payments/validate_customer_tax_information_for_user.py b/kittycad/api/payments/validate_customer_tax_information_for_user.py index fab999d0a..8dff503d3 100644 --- a/kittycad/api/payments/validate_customer_tax_information_for_user.py +++ b/kittycad/api/payments/validate_customer_tax_information_for_user.py @@ -29,12 +29,12 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Error]: return None if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: diff --git a/kittycad/api/unit/get_angle_unit_conversion.py b/kittycad/api/unit/get_angle_unit_conversion.py index 08703bb66..7a1f2c05c 100644 --- a/kittycad/api/unit/get_angle_unit_conversion.py +++ b/kittycad/api/unit/get_angle_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitAngleConversion, Error]]: if response.status_code == 200: - response_200 = UnitAngleConversion.from_dict(response.json()) + response_200 = UnitAngleConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_area_unit_conversion.py b/kittycad/api/unit/get_area_unit_conversion.py index 1ae8b2e43..53e9262c8 100644 --- a/kittycad/api/unit/get_area_unit_conversion.py +++ b/kittycad/api/unit/get_area_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitAreaConversion, Error]]: if response.status_code == 200: - response_200 = UnitAreaConversion.from_dict(response.json()) + response_200 = UnitAreaConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_current_unit_conversion.py b/kittycad/api/unit/get_current_unit_conversion.py index f5fde0e2d..261c5832f 100644 --- a/kittycad/api/unit/get_current_unit_conversion.py +++ b/kittycad/api/unit/get_current_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitCurrentConversion, Error]]: if response.status_code == 200: - response_200 = UnitCurrentConversion.from_dict(response.json()) + response_200 = UnitCurrentConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_energy_unit_conversion.py b/kittycad/api/unit/get_energy_unit_conversion.py index e64c61da2..d473d6e09 100644 --- a/kittycad/api/unit/get_energy_unit_conversion.py +++ b/kittycad/api/unit/get_energy_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitEnergyConversion, Error]]: if response.status_code == 200: - response_200 = UnitEnergyConversion.from_dict(response.json()) + response_200 = UnitEnergyConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_force_unit_conversion.py b/kittycad/api/unit/get_force_unit_conversion.py index 1aa100ab0..381067f5e 100644 --- a/kittycad/api/unit/get_force_unit_conversion.py +++ b/kittycad/api/unit/get_force_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitForceConversion, Error]]: if response.status_code == 200: - response_200 = UnitForceConversion.from_dict(response.json()) + response_200 = UnitForceConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_frequency_unit_conversion.py b/kittycad/api/unit/get_frequency_unit_conversion.py index 9ffc58c91..8e7060d98 100644 --- a/kittycad/api/unit/get_frequency_unit_conversion.py +++ b/kittycad/api/unit/get_frequency_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitFrequencyConversion, Error]]: if response.status_code == 200: - response_200 = UnitFrequencyConversion.from_dict(response.json()) + response_200 = UnitFrequencyConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_length_unit_conversion.py b/kittycad/api/unit/get_length_unit_conversion.py index 29ae76ce6..7e1db8dd2 100644 --- a/kittycad/api/unit/get_length_unit_conversion.py +++ b/kittycad/api/unit/get_length_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitLengthConversion, Error]]: if response.status_code == 200: - response_200 = UnitLengthConversion.from_dict(response.json()) + response_200 = UnitLengthConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_mass_unit_conversion.py b/kittycad/api/unit/get_mass_unit_conversion.py index 3f743ce73..22a82e9ed 100644 --- a/kittycad/api/unit/get_mass_unit_conversion.py +++ b/kittycad/api/unit/get_mass_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitMassConversion, Error]]: if response.status_code == 200: - response_200 = UnitMassConversion.from_dict(response.json()) + response_200 = UnitMassConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_power_unit_conversion.py b/kittycad/api/unit/get_power_unit_conversion.py index f9c75f44d..5d6cd0d9f 100644 --- a/kittycad/api/unit/get_power_unit_conversion.py +++ b/kittycad/api/unit/get_power_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitPowerConversion, Error]]: if response.status_code == 200: - response_200 = UnitPowerConversion.from_dict(response.json()) + response_200 = UnitPowerConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_pressure_unit_conversion.py b/kittycad/api/unit/get_pressure_unit_conversion.py index 1eb6f25ad..e58866408 100644 --- a/kittycad/api/unit/get_pressure_unit_conversion.py +++ b/kittycad/api/unit/get_pressure_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitPressureConversion, Error]]: if response.status_code == 200: - response_200 = UnitPressureConversion.from_dict(response.json()) + response_200 = UnitPressureConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_temperature_unit_conversion.py b/kittycad/api/unit/get_temperature_unit_conversion.py index 8b22b53c7..ba01e7524 100644 --- a/kittycad/api/unit/get_temperature_unit_conversion.py +++ b/kittycad/api/unit/get_temperature_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitTemperatureConversion, Error]]: if response.status_code == 200: - response_200 = UnitTemperatureConversion.from_dict(response.json()) + response_200 = UnitTemperatureConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_torque_unit_conversion.py b/kittycad/api/unit/get_torque_unit_conversion.py index f0406e79e..cecf1a99a 100644 --- a/kittycad/api/unit/get_torque_unit_conversion.py +++ b/kittycad/api/unit/get_torque_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitTorqueConversion, Error]]: if response.status_code == 200: - response_200 = UnitTorqueConversion.from_dict(response.json()) + response_200 = UnitTorqueConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/unit/get_volume_unit_conversion.py b/kittycad/api/unit/get_volume_unit_conversion.py index 8711169a5..92de54654 100644 --- a/kittycad/api/unit/get_volume_unit_conversion.py +++ b/kittycad/api/unit/get_volume_unit_conversion.py @@ -43,15 +43,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UnitVolumeConversion, Error]]: if response.status_code == 200: - response_200 = UnitVolumeConversion.from_dict(response.json()) + response_200 = UnitVolumeConversion(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/users/delete_user_self.py b/kittycad/api/users/delete_user_self.py index 836b59333..38d6060ba 100644 --- a/kittycad/api/users/delete_user_self.py +++ b/kittycad/api/users/delete_user_self.py @@ -29,12 +29,12 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Error]: return None if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: diff --git a/kittycad/api/users/get_session_for_user.py b/kittycad/api/users/get_session_for_user.py index 629a31ad7..a32e4714e 100644 --- a/kittycad/api/users/get_session_for_user.py +++ b/kittycad/api/users/get_session_for_user.py @@ -31,15 +31,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[Session, Error]]: if response.status_code == 200: - response_200 = Session.from_dict(response.json()) + response_200 = Session(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/users/get_user.py b/kittycad/api/users/get_user.py index 0497b7252..5e458b830 100644 --- a/kittycad/api/users/get_user.py +++ b/kittycad/api/users/get_user.py @@ -31,15 +31,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]: if response.status_code == 200: - response_200 = User.from_dict(response.json()) + response_200 = User(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/users/get_user_extended.py b/kittycad/api/users/get_user_extended.py index 44ce69869..46b47a6e8 100644 --- a/kittycad/api/users/get_user_extended.py +++ b/kittycad/api/users/get_user_extended.py @@ -33,15 +33,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[ExtendedUser, Error]]: if response.status_code == 200: - response_200 = ExtendedUser.from_dict(response.json()) + response_200 = ExtendedUser(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/users/get_user_front_hash_self.py b/kittycad/api/users/get_user_front_hash_self.py index e2eda71e4..0db82575a 100644 --- a/kittycad/api/users/get_user_front_hash_self.py +++ b/kittycad/api/users/get_user_front_hash_self.py @@ -31,12 +31,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[str, Error]]: response_200 = response.text return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/users/get_user_onboarding_self.py b/kittycad/api/users/get_user_onboarding_self.py index db56949b6..3ded946f2 100644 --- a/kittycad/api/users/get_user_onboarding_self.py +++ b/kittycad/api/users/get_user_onboarding_self.py @@ -29,15 +29,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[Onboarding, Error]]: if response.status_code == 200: - response_200 = Onboarding.from_dict(response.json()) + response_200 = Onboarding(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/users/get_user_self.py b/kittycad/api/users/get_user_self.py index b7c58c9cf..56a00612c 100644 --- a/kittycad/api/users/get_user_self.py +++ b/kittycad/api/users/get_user_self.py @@ -29,15 +29,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]: if response.status_code == 200: - response_200 = User.from_dict(response.json()) + response_200 = User(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/users/get_user_self_extended.py b/kittycad/api/users/get_user_self_extended.py index 5d663247b..7bbf7fecf 100644 --- a/kittycad/api/users/get_user_self_extended.py +++ b/kittycad/api/users/get_user_self_extended.py @@ -31,15 +31,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[ExtendedUser, Error]]: if response.status_code == 200: - response_200 = ExtendedUser.from_dict(response.json()) + response_200 = ExtendedUser(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/users/list_users.py b/kittycad/api/users/list_users.py index 4da2aab96..7d21e90f7 100644 --- a/kittycad/api/users/list_users.py +++ b/kittycad/api/users/list_users.py @@ -53,15 +53,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[UserResultsPage, Error]]: if response.status_code == 200: - response_200 = UserResultsPage.from_dict(response.json()) + response_200 = UserResultsPage(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/users/list_users_extended.py b/kittycad/api/users/list_users_extended.py index 05043587e..554489a30 100644 --- a/kittycad/api/users/list_users_extended.py +++ b/kittycad/api/users/list_users_extended.py @@ -53,15 +53,15 @@ def _parse_response( *, response: httpx.Response ) -> Optional[Union[ExtendedUserResultsPage, Error]]: if response.status_code == 200: - response_200 = ExtendedUserResultsPage.from_dict(response.json()) + response_200 = ExtendedUserResultsPage(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/api/users/update_user_self.py b/kittycad/api/users/update_user_self.py index 8bf2ef538..af39dcdda 100644 --- a/kittycad/api/users/update_user_self.py +++ b/kittycad/api/users/update_user_self.py @@ -32,15 +32,15 @@ def _get_kwargs( def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]: if response.status_code == 200: - response_200 = User.from_dict(response.json()) + response_200 = User(**response.json()) return response_200 if response.status_code == 400: - response_4XX = Error.from_dict(response.json()) + response_4XX = Error(**response.json()) return response_4XX if response.status_code == 500: - response_5XX = Error.from_dict(response.json()) + response_5XX = Error(**response.json()) return response_5XX - return Error.from_dict(response.json()) + return Error(**response.json()) def _build_response( diff --git a/kittycad/client_test.py b/kittycad/client_test.py index 46e3640b1..65576a7cd 100644 --- a/kittycad/client_test.py +++ b/kittycad/client_test.py @@ -1,7 +1,7 @@ import json import os import uuid -from typing import Dict, Optional, Union +from typing import Optional, Union, cast import pytest @@ -14,25 +14,41 @@ from .client import ClientFromEnv from .models import ( ApiCallStatus, ApiTokenResultsPage, - Base64Data, + Axis, + AxisDirectionPair, CreatedAtSortMode, + Direction, Error, ExtendedUserResultsPage, + FailureWebSocketResponse, FileConversion, FileExportFormat, FileImportFormat, FileMass, FileVolume, + ImageFormat, + ImportFile, + InputFormat, ModelingCmd, ModelingCmdId, Pong, + SuccessWebSocketResponse, + System, UnitDensity, + UnitLength, UnitMass, UnitVolume, User, WebSocketRequest, ) -from .models.modeling_cmd import start_path +from .models.input_format import obj +from .models.modeling_cmd import ( + default_camera_focus_on, + import_files, + start_path, + take_snapshot, +) +from .models.ok_web_socket_response_data import modeling from .models.web_socket_request import modeling_cmd_req from .types import Unset @@ -131,11 +147,11 @@ def test_file_convert_stl(): print(f"FileConversion: {fc}") assert not isinstance(fc.outputs, Unset) + assert fc.outputs is not None - outputs: Dict[str, Base64Data] = fc.outputs # Make sure the bytes are not empty. - for key, value in outputs.items(): - assert len(value.get_decoded()) > 0 + for key, value in fc.outputs.items(): + assert len(value) > 0 @pytest.mark.asyncio @@ -170,11 +186,11 @@ async def test_file_convert_stl_async(): print(f"FileConversion: {fc}") assert not isinstance(fc.outputs, Unset) + assert fc.outputs is not None - outputs: Dict[str, Base64Data] = fc.outputs # Make sure the bytes are not empty. - for key, value in outputs.items(): - assert len(value.get_decoded()) > 0 + for key, value in fc.outputs.items(): + assert len(value) > 0 @pytest.mark.asyncio @@ -209,11 +225,11 @@ async def test_file_convert_obj_async(): print(f"FileConversion: {fc}") assert not isinstance(fc.outputs, Unset) + assert fc.outputs is not None - outputs: Dict[str, Base64Data] = fc.outputs # Make sure the bytes are not empty. - for key, value in outputs.items(): - assert len(value.get_decoded()) > 0 + for key, value in fc.outputs.items(): + assert len(value) > 0 def test_file_mass(): @@ -244,7 +260,7 @@ def test_file_mass(): assert fm.id is not None assert fm.mass is not None - assert fm.to_dict() is not None + assert fm.model_dump_json() is not None assert fm.status == ApiCallStatus.COMPLETED @@ -275,7 +291,7 @@ def test_file_volume(): assert fv.id is not None assert fv.volume is not None - assert fv.to_dict() is not None + assert fv.model_dump_json() is not None assert fv.status == ApiCallStatus.COMPLETED @@ -311,11 +327,98 @@ def test_ws(): req = WebSocketRequest( modeling_cmd_req(cmd=ModelingCmd(start_path()), cmd_id=ModelingCmdId(id)) ) - json.dumps(req.to_dict()) websocket.send(req) # Get the messages. while True: message = websocket.recv() - print(json.dumps(message.to_dict())) + print(json.dumps(message.model_dump_json())) break + + +def test_ws_import(): + # Create our client. + client = ClientFromEnv() + + # Connect to the websocket. + with modeling_commands_ws.WebSocket( + client=client, + fps=30, + unlocked_framerate=False, + video_res_height=360, + video_res_width=480, + webrtc=False, + ) as websocket: + # read the content of the file + dir_path = os.path.dirname(os.path.realpath(__file__)) + file_name = "ORIGINALVOXEL-3.obj" + file = open(os.path.join(dir_path, "..", "assets", file_name), "rb") + content = file.read() + file.close() + cmd_id = uuid.uuid4() + ImportFile(data=content, path=file_name) + # form the request + req = WebSocketRequest( + modeling_cmd_req( + cmd=ModelingCmd( + import_files( + files=[ImportFile(data=content, path=file_name)], + format=InputFormat( + obj( + units=UnitLength.MM, + coords=System( + forward=AxisDirectionPair( + axis=Axis.Y, direction=Direction.NEGATIVE + ), + up=AxisDirectionPair( + axis=Axis.Z, direction=Direction.POSITIVE + ), + ), + ) + ), + ) + ), + cmd_id=ModelingCmdId(cmd_id), + ) + ) + # Import files request must be sent as binary, because the file contents might be binary. + websocket.send_binary(req) + + # Get the success message. + message = websocket.recv() + if isinstance(message, FailureWebSocketResponse): + raise Exception(message) + elif isinstance(message, SuccessWebSocketResponse): + response = cast(SuccessWebSocketResponse, message) + resp = cast(modeling, response.resp) + print(json.dumps(resp.model_dump_json())) + # Get the object id from the response. + # TODO: FIX + object_id = uuid.uuid4() + + # Now we want to focus on the object. + cmd_id = uuid.uuid4() + # form the request + req = WebSocketRequest( + modeling_cmd_req( + cmd=ModelingCmd(default_camera_focus_on(uuid=object_id)), + cmd_id=ModelingCmdId(cmd_id), + ) + ) + websocket.send(req) + + # Get the success message. + message = websocket.recv() + print(json.dumps(message.model_dump_json())) + + # Now we want to snapshot as a png. + cmd_id = uuid.uuid4() + # form the request + # form the request + req = WebSocketRequest( + modeling_cmd_req( + cmd=ModelingCmd(take_snapshot(format=ImageFormat.PNG)), + cmd_id=ModelingCmdId(cmd_id), + ) + ) + websocket.send(req) diff --git a/kittycad/examples_test.py b/kittycad/examples_test.py index 3d4030784..2ee5cd3f5 100644 --- a/kittycad/examples_test.py +++ b/kittycad/examples_test.py @@ -3854,16 +3854,15 @@ def test_create_executor_term(): client = ClientFromEnv() # Connect to the websocket. - websocket = create_executor_term.sync( + with create_executor_term.sync( client=client, - ) + ) as websocket: + # Send a message. + websocket.send("{}") - # Send a message. - websocket.send("{}") - - # Get the messages. - for message in websocket: - print(message) + # Get the messages. + for message in websocket: + print(message) # OR run async @@ -3892,30 +3891,29 @@ def test_modeling_commands_ws(): client = ClientFromEnv() # Connect to the websocket. - websocket = modeling_commands_ws.WebSocket( + with modeling_commands_ws.WebSocket( client=client, fps=10, unlocked_framerate=False, video_res_height=10, video_res_width=10, webrtc=False, - ) - - # Send a message. - websocket.send( - WebSocketRequest( - sdp_offer( - offer=RtcSessionDescription( - sdp="", - type=RtcSdpType.UNSPECIFIED, - ), + ) as websocket: + # Send a message. + websocket.send( + WebSocketRequest( + sdp_offer( + offer=RtcSessionDescription( + sdp="", + type=RtcSdpType.UNSPECIFIED, + ), + ) ) ) - ) - # Get a message. - message = websocket.recv() - print(message) + # Get a message. + message = websocket.recv() + print(message) # OR run async diff --git a/kittycad/models/__init__.py b/kittycad/models/__init__.py index ed6e722c2..afe8c83c8 100644 --- a/kittycad/models/__init__.py +++ b/kittycad/models/__init__.py @@ -34,7 +34,6 @@ 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 diff --git a/kittycad/models/ai_plugin_api.py b/kittycad/models/ai_plugin_api.py index 232190001..575eab605 100644 --- a/kittycad/models/ai_plugin_api.py +++ b/kittycad/models/ai_plugin_api.py @@ -1,79 +1,15 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr +from pydantic import BaseModel from ..models.ai_plugin_api_type import AiPluginApiType -from ..types import UNSET, Unset - -SB = TypeVar("SB", bound="AiPluginApi") -@attr.s(auto_attribs=True) -class AiPluginApi: - """AI plugin api information.""" # noqa: E501 +class AiPluginApi(BaseModel): + """AI plugin api information.""" - is_user_authenticated: Union[Unset, bool] = False - type: Union[Unset, AiPluginApiType] = UNSET - url: Union[Unset, str] = UNSET + is_user_authenticated: Optional[bool] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + type: Optional[AiPluginApiType] = None - def to_dict(self) -> Dict[str, Any]: - is_user_authenticated = self.is_user_authenticated - type: Union[Unset, AiPluginApiType] = UNSET - if not isinstance(self.type, Unset): - type = self.type - url = self.url - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if is_user_authenticated is not UNSET: - field_dict["is_user_authenticated"] = is_user_authenticated - if type is not UNSET: - field_dict["type"] = type - if url is not UNSET: - field_dict["url"] = url - - return field_dict - - @classmethod - def from_dict(cls: Type[SB], src_dict: Dict[str, Any]) -> SB: - d = src_dict.copy() - is_user_authenticated = d.pop("is_user_authenticated", UNSET) - - _type = d.pop("type", UNSET) - type: Union[Unset, AiPluginApiType] - if isinstance(_type, Unset): - type = UNSET - if _type is None: - type = UNSET - else: - type = _type - - url = d.pop("url", UNSET) - - ai_plugin_api = cls( - is_user_authenticated=is_user_authenticated, - type=type, - url=url, - ) - - ai_plugin_api.additional_properties = d - return ai_plugin_api - - @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 + url: str diff --git a/kittycad/models/ai_plugin_auth.py b/kittycad/models/ai_plugin_auth.py index 434e05496..968ae487b 100644 --- a/kittycad/models/ai_plugin_auth.py +++ b/kittycad/models/ai_plugin_auth.py @@ -1,82 +1,14 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr +from pydantic import BaseModel from ..models.ai_plugin_auth_type import AiPluginAuthType from ..models.ai_plugin_http_auth_type import AiPluginHttpAuthType -from ..types import UNSET, Unset - -NP = TypeVar("NP", bound="AiPluginAuth") -@attr.s(auto_attribs=True) -class AiPluginAuth: - """AI plugin auth information.""" # noqa: E501 +class AiPluginAuth(BaseModel): + """AI plugin auth information.""" - authorization_type: Union[Unset, AiPluginHttpAuthType] = UNSET - type: Union[Unset, AiPluginAuthType] = UNSET + authorization_type: Optional[AiPluginHttpAuthType] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - authorization_type: Union[Unset, AiPluginHttpAuthType] = UNSET - if not isinstance(self.authorization_type, Unset): - authorization_type = self.authorization_type - type: Union[Unset, AiPluginAuthType] = UNSET - if not isinstance(self.type, Unset): - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if authorization_type is not UNSET: - field_dict["authorization_type"] = authorization_type - if type is not UNSET: - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[NP], src_dict: Dict[str, Any]) -> NP: - d = src_dict.copy() - _authorization_type = d.pop("authorization_type", UNSET) - authorization_type: Union[Unset, AiPluginHttpAuthType] - if isinstance(_authorization_type, Unset): - authorization_type = UNSET - if _authorization_type is None: - authorization_type = UNSET - else: - authorization_type = _authorization_type - - _type = d.pop("type", UNSET) - type: Union[Unset, AiPluginAuthType] - if isinstance(_type, Unset): - type = UNSET - if _type is None: - type = UNSET - else: - type = _type - - ai_plugin_auth = cls( - authorization_type=authorization_type, - type=type, - ) - - ai_plugin_auth.additional_properties = d - return ai_plugin_auth - - @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 + type: Optional[AiPluginAuthType] = None diff --git a/kittycad/models/ai_plugin_manifest.py b/kittycad/models/ai_plugin_manifest.py index 279144574..3ba94947a 100644 --- a/kittycad/models/ai_plugin_manifest.py +++ b/kittycad/models/ai_plugin_manifest.py @@ -1,143 +1,33 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Optional -import attr +from pydantic import BaseModel from ..models.ai_plugin_api import AiPluginApi from ..models.ai_plugin_auth import AiPluginAuth -from ..types import UNSET, Unset - -SA = TypeVar("SA", bound="AiPluginManifest") -@attr.s(auto_attribs=True) -class AiPluginManifest: +class AiPluginManifest(BaseModel): """AI plugin manifest. This is used for OpenAI's ChatGPT plugins. You can read more about them [here](https://platform.openai.com/docs/plugins/getting-started/plugin-manifest). - """ # noqa: E501 + """ - api: Union[Unset, AiPluginApi] = UNSET - auth: Union[Unset, AiPluginAuth] = UNSET - contact_email: Union[Unset, str] = UNSET - description_for_human: Union[Unset, str] = UNSET - description_for_model: Union[Unset, str] = UNSET - legal_info_url: Union[Unset, str] = UNSET - logo_url: Union[Unset, str] = UNSET - name_for_human: Union[Unset, str] = UNSET - name_for_model: Union[Unset, str] = UNSET - schema_version: Union[Unset, str] = UNSET + api: AiPluginApi - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + auth: AiPluginAuth - def to_dict(self) -> Dict[str, Any]: - api: Union[Unset, AiPluginApi] = UNSET - if not isinstance(self.api, Unset): - api = self.api - auth: Union[Unset, AiPluginAuth] = UNSET - if not isinstance(self.auth, Unset): - auth = self.auth - contact_email = self.contact_email - description_for_human = self.description_for_human - description_for_model = self.description_for_model - legal_info_url = self.legal_info_url - logo_url = self.logo_url - name_for_human = self.name_for_human - name_for_model = self.name_for_model - schema_version = self.schema_version + contact_email: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if api is not UNSET: - _api: AiPluginApi = cast(AiPluginApi, api) - field_dict["api"] = _api.to_dict() - if auth is not UNSET: - _auth: AiPluginAuth = cast(AiPluginAuth, auth) - field_dict["auth"] = _auth.to_dict() - if contact_email is not UNSET: - field_dict["contact_email"] = contact_email - if description_for_human is not UNSET: - field_dict["description_for_human"] = description_for_human - if description_for_model is not UNSET: - field_dict["description_for_model"] = description_for_model - if legal_info_url is not UNSET: - field_dict["legal_info_url"] = legal_info_url - if logo_url is not UNSET: - field_dict["logo_url"] = logo_url - if name_for_human is not UNSET: - field_dict["name_for_human"] = name_for_human - if name_for_model is not UNSET: - field_dict["name_for_model"] = name_for_model - if schema_version is not UNSET: - field_dict["schema_version"] = schema_version + description_for_human: Optional[str] = None - return field_dict + description_for_model: Optional[str] = None - @classmethod - def from_dict(cls: Type[SA], src_dict: Dict[str, Any]) -> SA: - d = src_dict.copy() - _api = d.pop("api", UNSET) - api: Union[Unset, AiPluginApi] - if isinstance(_api, Unset): - api = UNSET - if _api is None: - api = UNSET - else: - api = AiPluginApi.from_dict(_api) + legal_info_url: str - _auth = d.pop("auth", UNSET) - auth: Union[Unset, AiPluginAuth] - if isinstance(_auth, Unset): - auth = UNSET - if _auth is None: - auth = UNSET - else: - auth = AiPluginAuth.from_dict(_auth) + logo_url: str - contact_email = d.pop("contact_email", UNSET) + name_for_human: Optional[str] = None - description_for_human = d.pop("description_for_human", UNSET) + name_for_model: Optional[str] = None - description_for_model = d.pop("description_for_model", UNSET) - - legal_info_url = d.pop("legal_info_url", UNSET) - - logo_url = d.pop("logo_url", UNSET) - - name_for_human = d.pop("name_for_human", UNSET) - - name_for_model = d.pop("name_for_model", UNSET) - - schema_version = d.pop("schema_version", UNSET) - - ai_plugin_manifest = cls( - api=api, - auth=auth, - contact_email=contact_email, - description_for_human=description_for_human, - description_for_model=description_for_model, - legal_info_url=legal_info_url, - logo_url=logo_url, - name_for_human=name_for_human, - name_for_model=name_for_model, - schema_version=schema_version, - ) - - ai_plugin_manifest.additional_properties = d - return ai_plugin_manifest - - @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 + schema_version: Optional[str] = None diff --git a/kittycad/models/ai_prompt.py b/kittycad/models/ai_prompt.py index 633c89ff8..2fbf977a3 100644 --- a/kittycad/models/ai_prompt.py +++ b/kittycad/models/ai_prompt.py @@ -1,223 +1,42 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.ai_feedback import AiFeedback from ..models.ai_prompt_type import AiPromptType from ..models.api_call_status import ApiCallStatus from ..models.uuid import Uuid from ..models.uuid_binary import UuidBinary -from ..types import UNSET, Unset - -GO = TypeVar("GO", bound="AiPrompt") -@attr.s(auto_attribs=True) -class AiPrompt: - """An AI prompt.""" # noqa: E501 +class AiPrompt(BaseModel): + """An AI prompt.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - feedback: Union[Unset, AiFeedback] = UNSET - id: Union[Unset, UuidBinary] = UNSET - metadata: Union[Unset, Any] = UNSET - model_version: Union[Unset, str] = UNSET - output_file: Union[Unset, str] = UNSET - prompt: Union[Unset, str] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - type: Union[Unset, AiPromptType] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - feedback: Union[Unset, AiFeedback] = UNSET - if not isinstance(self.feedback, Unset): - feedback = self.feedback - id: Union[Unset, UuidBinary] = UNSET - if not isinstance(self.id, Unset): - id = self.id - metadata = self.metadata - model_version = self.model_version - output_file = self.output_file - prompt = self.prompt - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - type: Union[Unset, AiPromptType] = UNSET - if not isinstance(self.type, Unset): - type = self.type - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if feedback is not UNSET: - field_dict["feedback"] = feedback - if id is not UNSET: - field_dict["id"] = id - if metadata is not UNSET: - field_dict["metadata"] = metadata - if model_version is not UNSET: - field_dict["model_version"] = model_version - if output_file is not UNSET: - field_dict["output_file"] = output_file - if prompt is not UNSET: - field_dict["prompt"] = prompt - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if type is not UNSET: - field_dict["type"] = type - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + feedback: Optional[AiFeedback] = None - return field_dict + id: UuidBinary - @classmethod - def from_dict(cls: Type[GO], src_dict: Dict[str, Any]) -> GO: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + metadata: Optional[Any] = None - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + model_version: str - error = d.pop("error", UNSET) + output_file: Optional[str] = None - _feedback = d.pop("feedback", UNSET) - feedback: Union[Unset, AiFeedback] - if isinstance(_feedback, Unset): - feedback = UNSET - if _feedback is None: - feedback = UNSET - else: - feedback = _feedback + prompt: str - _id = d.pop("id", UNSET) - id: Union[Unset, UuidBinary] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - metadata = d.pop("metadata", UNSET) - model_version = d.pop("model_version", UNSET) + status: ApiCallStatus - output_file = d.pop("output_file", UNSET) + type: AiPromptType - prompt = d.pop("prompt", UNSET) + updated_at: datetime.datetime - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _type = d.pop("type", UNSET) - type: Union[Unset, AiPromptType] - if isinstance(_type, Unset): - type = UNSET - if _type is None: - type = UNSET - else: - type = _type - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - ai_prompt = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - feedback=feedback, - id=id, - metadata=metadata, - model_version=model_version, - output_file=output_file, - prompt=prompt, - started_at=started_at, - status=status, - type=type, - updated_at=updated_at, - user_id=user_id, - ) - - ai_prompt.additional_properties = d - return ai_prompt - - @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 + user_id: Uuid diff --git a/kittycad/models/ai_prompt_results_page.py b/kittycad/models/ai_prompt_results_page.py index 2e1992c55..1e9e1281c 100644 --- a/kittycad/models/ai_prompt_results_page.py +++ b/kittycad/models/ai_prompt_results_page.py @@ -1,70 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List, Optional -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -PI = TypeVar("PI", bound="AiPromptResultsPage") +from ..models.ai_prompt import AiPrompt -@attr.s(auto_attribs=True) -class AiPromptResultsPage: - """A single page of results""" # noqa: E501 +class AiPromptResultsPage(BaseModel): + """A single page of results""" - from ..models.ai_prompt import AiPrompt + items: List[AiPrompt] - items: Union[Unset, List[AiPrompt]] = UNSET - next_page: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - from ..models.ai_prompt import AiPrompt - - items: Union[Unset, List[AiPrompt]] = UNSET - if not isinstance(self.items, Unset): - items = self.items - next_page = self.next_page - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if items is not UNSET: - field_dict["items"] = items - if next_page is not UNSET: - field_dict["next_page"] = next_page - - return field_dict - - @classmethod - def from_dict(cls: Type[PI], src_dict: Dict[str, Any]) -> PI: - d = src_dict.copy() - from ..models.ai_prompt import AiPrompt - - items = cast(List[AiPrompt], d.pop("items", UNSET)) - - next_page = d.pop("next_page", UNSET) - - ai_prompt_results_page = cls( - items=items, - next_page=next_page, - ) - - ai_prompt_results_page.additional_properties = d - return ai_prompt_results_page - - @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 + next_page: Optional[str] = None diff --git a/kittycad/models/angle.py b/kittycad/models/angle.py index 26f64020e..b3c10c463 100644 --- a/kittycad/models/angle.py +++ b/kittycad/models/angle.py @@ -1,72 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.unit_angle import UnitAngle -from ..types import UNSET, Unset - -UZ = TypeVar("UZ", bound="Angle") -@attr.s(auto_attribs=True) -class Angle: - """An angle, with a specific unit.""" # noqa: E501 +class Angle(BaseModel): + """An angle, with a specific unit.""" - unit: Union[Unset, UnitAngle] = UNSET - value: Union[Unset, float] = UNSET + unit: UnitAngle - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - unit: Union[Unset, UnitAngle] = UNSET - if not isinstance(self.unit, Unset): - unit = self.unit - value = self.value - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if unit is not UNSET: - field_dict["unit"] = unit - if value is not UNSET: - field_dict["value"] = value - - return field_dict - - @classmethod - def from_dict(cls: Type[UZ], src_dict: Dict[str, Any]) -> UZ: - d = src_dict.copy() - _unit = d.pop("unit", UNSET) - unit: Union[Unset, UnitAngle] - if isinstance(_unit, Unset): - unit = UNSET - if _unit is None: - unit = UNSET - else: - unit = _unit - - value = d.pop("value", UNSET) - - angle = cls( - unit=unit, - value=value, - ) - - angle.additional_properties = d - return angle - - @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 + value: float diff --git a/kittycad/models/annotation_line_end_options.py b/kittycad/models/annotation_line_end_options.py index 53c9d2576..0cb346da0 100644 --- a/kittycad/models/annotation_line_end_options.py +++ b/kittycad/models/annotation_line_end_options.py @@ -1,81 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.annotation_line_end import AnnotationLineEnd -from ..types import UNSET, Unset - -FB = TypeVar("FB", bound="AnnotationLineEndOptions") -@attr.s(auto_attribs=True) -class AnnotationLineEndOptions: - """Options for annotation text""" # noqa: E501 +class AnnotationLineEndOptions(BaseModel): + """Options for annotation text""" - end: Union[Unset, AnnotationLineEnd] = UNSET - start: Union[Unset, AnnotationLineEnd] = UNSET + end: AnnotationLineEnd - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - end: Union[Unset, AnnotationLineEnd] = UNSET - if not isinstance(self.end, Unset): - end = self.end - start: Union[Unset, AnnotationLineEnd] = UNSET - if not isinstance(self.start, Unset): - start = self.start - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if end is not UNSET: - field_dict["end"] = end - if start is not UNSET: - field_dict["start"] = start - - return field_dict - - @classmethod - def from_dict(cls: Type[FB], src_dict: Dict[str, Any]) -> FB: - d = src_dict.copy() - _end = d.pop("end", UNSET) - end: Union[Unset, AnnotationLineEnd] - if isinstance(_end, Unset): - end = UNSET - if _end is None: - end = UNSET - else: - end = _end - - _start = d.pop("start", UNSET) - start: Union[Unset, AnnotationLineEnd] - if isinstance(_start, Unset): - start = UNSET - if _start is None: - start = UNSET - else: - start = _start - - annotation_line_end_options = cls( - end=end, - start=start, - ) - - annotation_line_end_options.additional_properties = d - return annotation_line_end_options - - @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 + start: AnnotationLineEnd diff --git a/kittycad/models/annotation_options.py b/kittycad/models/annotation_options.py index 079808545..61f50b63b 100644 --- a/kittycad/models/annotation_options.py +++ b/kittycad/models/annotation_options.py @@ -1,129 +1,22 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Optional -import attr +from pydantic import BaseModel from ..models.annotation_line_end_options import AnnotationLineEndOptions from ..models.annotation_text_options import AnnotationTextOptions from ..models.color import Color from ..models.point3d import Point3d -from ..types import UNSET, Unset - -QP = TypeVar("QP", bound="AnnotationOptions") -@attr.s(auto_attribs=True) -class AnnotationOptions: - """Options for annotations""" # noqa: E501 +class AnnotationOptions(BaseModel): + """Options for annotations""" - color: Union[Unset, Color] = UNSET - line_ends: Union[Unset, AnnotationLineEndOptions] = UNSET - line_width: Union[Unset, float] = UNSET - position: Union[Unset, Point3d] = UNSET - text: Union[Unset, AnnotationTextOptions] = UNSET + color: Optional[Color] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + line_ends: Optional[AnnotationLineEndOptions] = None - def to_dict(self) -> Dict[str, Any]: - color: Union[Unset, Color] = UNSET - if not isinstance(self.color, Unset): - color = self.color - line_ends: Union[Unset, AnnotationLineEndOptions] = UNSET - if not isinstance(self.line_ends, Unset): - line_ends = self.line_ends - line_width = self.line_width - position: Union[Unset, Point3d] = UNSET - if not isinstance(self.position, Unset): - position = self.position - text: Union[Unset, AnnotationTextOptions] = UNSET - if not isinstance(self.text, Unset): - text = self.text + line_width: Optional[float] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if color is not UNSET: - _color: Color = cast(Color, color) - field_dict["color"] = _color.to_dict() - if line_ends is not UNSET: - _line_ends: AnnotationLineEndOptions = cast( - AnnotationLineEndOptions, line_ends - ) - field_dict["line_ends"] = _line_ends.to_dict() - if line_width is not UNSET: - field_dict["line_width"] = line_width - if position is not UNSET: - _position: Point3d = cast(Point3d, position) - field_dict["position"] = _position.to_dict() - if text is not UNSET: - _text: AnnotationTextOptions = cast(AnnotationTextOptions, text) - field_dict["text"] = _text.to_dict() + position: Optional[Point3d] = None - return field_dict - - @classmethod - def from_dict(cls: Type[QP], src_dict: Dict[str, Any]) -> QP: - d = src_dict.copy() - _color = d.pop("color", UNSET) - color: Union[Unset, Color] - if isinstance(_color, Unset): - color = UNSET - if _color is None: - color = UNSET - else: - color = Color.from_dict(_color) - - _line_ends = d.pop("line_ends", UNSET) - line_ends: Union[Unset, AnnotationLineEndOptions] - if isinstance(_line_ends, Unset): - line_ends = UNSET - if _line_ends is None: - line_ends = UNSET - else: - line_ends = AnnotationLineEndOptions.from_dict(_line_ends) - - line_width = d.pop("line_width", UNSET) - - _position = d.pop("position", UNSET) - position: Union[Unset, Point3d] - if isinstance(_position, Unset): - position = UNSET - if _position is None: - position = UNSET - else: - position = Point3d.from_dict(_position) - - _text = d.pop("text", UNSET) - text: Union[Unset, AnnotationTextOptions] - if isinstance(_text, Unset): - text = UNSET - if _text is None: - text = UNSET - else: - text = AnnotationTextOptions.from_dict(_text) - - annotation_options = cls( - color=color, - line_ends=line_ends, - line_width=line_width, - position=position, - text=text, - ) - - annotation_options.additional_properties = d - return annotation_options - - @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 + text: Optional[AnnotationTextOptions] = None diff --git a/kittycad/models/annotation_text_options.py b/kittycad/models/annotation_text_options.py index c20962b8b..b8a6a4e3b 100644 --- a/kittycad/models/annotation_text_options.py +++ b/kittycad/models/annotation_text_options.py @@ -1,96 +1,17 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.annotation_text_alignment_x import AnnotationTextAlignmentX from ..models.annotation_text_alignment_y import AnnotationTextAlignmentY -from ..types import UNSET, Unset - -KC = TypeVar("KC", bound="AnnotationTextOptions") -@attr.s(auto_attribs=True) -class AnnotationTextOptions: - """Options for annotation text""" # noqa: E501 +class AnnotationTextOptions(BaseModel): + """Options for annotation text""" - point_size: Union[Unset, int] = UNSET - text: Union[Unset, str] = UNSET - x: Union[Unset, AnnotationTextAlignmentX] = UNSET - y: Union[Unset, AnnotationTextAlignmentY] = UNSET + point_size: int - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + text: str - def to_dict(self) -> Dict[str, Any]: - point_size = self.point_size - text = self.text - x: Union[Unset, AnnotationTextAlignmentX] = UNSET - if not isinstance(self.x, Unset): - x = self.x - y: Union[Unset, AnnotationTextAlignmentY] = UNSET - if not isinstance(self.y, Unset): - y = self.y + x: AnnotationTextAlignmentX - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if point_size is not UNSET: - field_dict["point_size"] = point_size - if text is not UNSET: - field_dict["text"] = text - if x is not UNSET: - field_dict["x"] = x - if y is not UNSET: - field_dict["y"] = y - - return field_dict - - @classmethod - def from_dict(cls: Type[KC], src_dict: Dict[str, Any]) -> KC: - d = src_dict.copy() - point_size = d.pop("point_size", UNSET) - - text = d.pop("text", UNSET) - - _x = d.pop("x", UNSET) - x: Union[Unset, AnnotationTextAlignmentX] - if isinstance(_x, Unset): - x = UNSET - if _x is None: - x = UNSET - else: - x = _x - - _y = d.pop("y", UNSET) - y: Union[Unset, AnnotationTextAlignmentY] - if isinstance(_y, Unset): - y = UNSET - if _y is None: - y = UNSET - else: - y = _y - - annotation_text_options = cls( - point_size=point_size, - text=text, - x=x, - y=y, - ) - - annotation_text_options.additional_properties = d - return annotation_text_options - - @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 + y: AnnotationTextAlignmentY diff --git a/kittycad/models/api_call_query_group.py b/kittycad/models/api_call_query_group.py index ec3d1f879..15d3e3cf9 100644 --- a/kittycad/models/api_call_query_group.py +++ b/kittycad/models/api_call_query_group.py @@ -1,62 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -HX = TypeVar("HX", bound="ApiCallQueryGroup") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class ApiCallQueryGroup: - """A response for a query on the API call table that is grouped by something.""" # noqa: E501 +class ApiCallQueryGroup(BaseModel): + """A response for a query on the API call table that is grouped by something.""" - count: Union[Unset, int] = UNSET - query: Union[Unset, str] = UNSET + count: int - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - count = self.count - query = self.query - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if count is not UNSET: - field_dict["count"] = count - if query is not UNSET: - field_dict["query"] = query - - return field_dict - - @classmethod - def from_dict(cls: Type[HX], src_dict: Dict[str, Any]) -> HX: - d = src_dict.copy() - count = d.pop("count", UNSET) - - query = d.pop("query", UNSET) - - api_call_query_group = cls( - count=count, - query=query, - ) - - api_call_query_group.additional_properties = d - return api_call_query_group - - @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 + query: str diff --git a/kittycad/models/api_call_with_price.py b/kittycad/models/api_call_with_price.py index 9c86d1744..d2bd3b5ca 100644 --- a/kittycad/models/api_call_with_price.py +++ b/kittycad/models/api_call_with_price.py @@ -1,266 +1,57 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.method import Method from ..models.uuid import Uuid -from ..types import UNSET, Unset - -LB = TypeVar("LB", bound="ApiCallWithPrice") -@attr.s(auto_attribs=True) -class ApiCallWithPrice: +class ApiCallWithPrice(BaseModel): """An API call with the price. - This is a join of the `ApiCall` and `ApiCallPrice` tables.""" # noqa: E501 + This is a join of the `ApiCall` and `ApiCallPrice` tables.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - duration: Union[Unset, int] = UNSET - email: Union[Unset, str] = UNSET - endpoint: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - ip_address: Union[Unset, str] = UNSET - litterbox: Union[Unset, bool] = False - method: Union[Unset, Method] = UNSET - minutes: Union[Unset, int] = UNSET - origin: Union[Unset, str] = UNSET - price: Union[Unset, float] = UNSET - request_body: Union[Unset, str] = UNSET - request_query_params: Union[Unset, str] = UNSET - response_body: Union[Unset, str] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status_code: Union[Unset, int] = UNSET - stripe_invoice_item_id: Union[Unset, str] = UNSET - token: Union[Unset, str] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_agent: Union[Unset, str] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - duration = self.duration - email = self.email - endpoint = self.endpoint - id = self.id - ip_address = self.ip_address - litterbox = self.litterbox - method: Union[Unset, Method] = UNSET - if not isinstance(self.method, Unset): - method = self.method - minutes = self.minutes - origin = self.origin - price = self.price - request_body = self.request_body - request_query_params = self.request_query_params - response_body = self.response_body - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status_code = self.status_code - stripe_invoice_item_id = self.stripe_invoice_item_id - token = self.token - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_agent = self.user_agent - user_id = self.user_id + duration: Optional[int] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if duration is not UNSET: - field_dict["duration"] = duration - if email is not UNSET: - field_dict["email"] = email - if endpoint is not UNSET: - field_dict["endpoint"] = endpoint - if id is not UNSET: - field_dict["id"] = id - if ip_address is not UNSET: - field_dict["ip_address"] = ip_address - if litterbox is not UNSET: - field_dict["litterbox"] = litterbox - if method is not UNSET: - field_dict["method"] = method - if minutes is not UNSET: - field_dict["minutes"] = minutes - if origin is not UNSET: - field_dict["origin"] = origin - if price is not UNSET: - field_dict["price"] = price - if request_body is not UNSET: - field_dict["request_body"] = request_body - if request_query_params is not UNSET: - field_dict["request_query_params"] = request_query_params - if response_body is not UNSET: - field_dict["response_body"] = response_body - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status_code is not UNSET: - field_dict["status_code"] = status_code - if stripe_invoice_item_id is not UNSET: - field_dict["stripe_invoice_item_id"] = stripe_invoice_item_id - if token is not UNSET: - field_dict["token"] = token - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_agent is not UNSET: - field_dict["user_agent"] = user_agent - if user_id is not UNSET: - field_dict["user_id"] = user_id + email: Optional[str] = None - return field_dict + endpoint: Optional[str] = None - @classmethod - def from_dict(cls: Type[LB], src_dict: Dict[str, Any]) -> LB: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + id: Uuid - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + ip_address: Optional[str] = None - duration = d.pop("duration", UNSET) + litterbox: Optional[bool] = None - email = d.pop("email", UNSET) + method: Method - endpoint = d.pop("endpoint", UNSET) + minutes: Optional[int] = None - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + origin: Optional[str] = None - ip_address = d.pop("ip_address", UNSET) + price: Optional[float] = None - litterbox = d.pop("litterbox", UNSET) + request_body: Optional[str] = None - _method = d.pop("method", UNSET) - method: Union[Unset, Method] - if isinstance(_method, Unset): - method = UNSET - if _method is None: - method = UNSET - else: - method = _method + request_query_params: Optional[str] = None - minutes = d.pop("minutes", UNSET) + response_body: Optional[str] = None - origin = d.pop("origin", UNSET) + started_at: Optional[datetime.datetime] = None - price = d.pop("price", UNSET) + status_code: Optional[int] = None - request_body = d.pop("request_body", UNSET) + stripe_invoice_item_id: Optional[str] = None - request_query_params = d.pop("request_query_params", UNSET) + token: Uuid - response_body = d.pop("response_body", UNSET) + updated_at: datetime.datetime - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) + user_agent: str - status_code = d.pop("status_code", UNSET) - - stripe_invoice_item_id = d.pop("stripe_invoice_item_id", UNSET) - - _token = d.pop("token", UNSET) - token: Union[Unset, Uuid] - if isinstance(_token, Unset): - token = UNSET - if _token is None: - token = UNSET - else: - token = _token - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - user_agent = d.pop("user_agent", UNSET) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - api_call_with_price = cls( - completed_at=completed_at, - created_at=created_at, - duration=duration, - email=email, - endpoint=endpoint, - id=id, - ip_address=ip_address, - litterbox=litterbox, - method=method, - minutes=minutes, - origin=origin, - price=price, - request_body=request_body, - request_query_params=request_query_params, - response_body=response_body, - started_at=started_at, - status_code=status_code, - stripe_invoice_item_id=stripe_invoice_item_id, - token=token, - updated_at=updated_at, - user_agent=user_agent, - user_id=user_id, - ) - - api_call_with_price.additional_properties = d - return api_call_with_price - - @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 + user_id: Uuid diff --git a/kittycad/models/api_call_with_price_results_page.py b/kittycad/models/api_call_with_price_results_page.py index e77730d5d..459dc2700 100644 --- a/kittycad/models/api_call_with_price_results_page.py +++ b/kittycad/models/api_call_with_price_results_page.py @@ -1,70 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List, Optional -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -NE = TypeVar("NE", bound="ApiCallWithPriceResultsPage") +from ..models.api_call_with_price import ApiCallWithPrice -@attr.s(auto_attribs=True) -class ApiCallWithPriceResultsPage: - """A single page of results""" # noqa: E501 +class ApiCallWithPriceResultsPage(BaseModel): + """A single page of results""" - from ..models.api_call_with_price import ApiCallWithPrice + items: List[ApiCallWithPrice] - items: Union[Unset, List[ApiCallWithPrice]] = UNSET - next_page: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - from ..models.api_call_with_price import ApiCallWithPrice - - items: Union[Unset, List[ApiCallWithPrice]] = UNSET - if not isinstance(self.items, Unset): - items = self.items - next_page = self.next_page - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if items is not UNSET: - field_dict["items"] = items - if next_page is not UNSET: - field_dict["next_page"] = next_page - - return field_dict - - @classmethod - def from_dict(cls: Type[NE], src_dict: Dict[str, Any]) -> NE: - d = src_dict.copy() - from ..models.api_call_with_price import ApiCallWithPrice - - items = cast(List[ApiCallWithPrice], d.pop("items", UNSET)) - - next_page = d.pop("next_page", UNSET) - - api_call_with_price_results_page = cls( - items=items, - next_page=next_page, - ) - - api_call_with_price_results_page.additional_properties = d - return api_call_with_price_results_page - - @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 + next_page: Optional[str] = None diff --git a/kittycad/models/api_error.py b/kittycad/models/api_error.py index 520a754e0..61a9e1b03 100644 --- a/kittycad/models/api_error.py +++ b/kittycad/models/api_error.py @@ -1,72 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.error_code import ErrorCode -from ..types import UNSET, Unset - -TL = TypeVar("TL", bound="ApiError") -@attr.s(auto_attribs=True) -class ApiError: - """An error.""" # noqa: E501 +class ApiError(BaseModel): + """An error.""" - error_code: Union[Unset, ErrorCode] = UNSET - message: Union[Unset, str] = UNSET + error_code: ErrorCode - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - error_code: Union[Unset, ErrorCode] = UNSET - if not isinstance(self.error_code, Unset): - error_code = self.error_code - message = self.message - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if error_code is not UNSET: - field_dict["error_code"] = error_code - if message is not UNSET: - field_dict["message"] = message - - return field_dict - - @classmethod - def from_dict(cls: Type[TL], src_dict: Dict[str, Any]) -> TL: - d = src_dict.copy() - _error_code = d.pop("error_code", UNSET) - error_code: Union[Unset, ErrorCode] - if isinstance(_error_code, Unset): - error_code = UNSET - if _error_code is None: - error_code = UNSET - else: - error_code = _error_code - - message = d.pop("message", UNSET) - - api_error = cls( - error_code=error_code, - message=message, - ) - - api_error.additional_properties = d - return api_error - - @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 + message: str diff --git a/kittycad/models/api_token.py b/kittycad/models/api_token.py index d6f7ebc39..cc587732b 100644 --- a/kittycad/models/api_token.py +++ b/kittycad/models/api_token.py @@ -1,130 +1,23 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.uuid import Uuid -from ..types import UNSET, Unset - -MN = TypeVar("MN", bound="ApiToken") -@attr.s(auto_attribs=True) -class ApiToken: +class ApiToken(BaseModel): """An API token. - These are used to authenticate users with Bearer authentication.""" # noqa: E501 + These are used to authenticate users with Bearer authentication.""" - created_at: Union[Unset, datetime.datetime] = UNSET - id: Union[Unset, str] = UNSET - is_valid: Union[Unset, bool] = False - token: Union[Unset, str] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + created_at: datetime.datetime - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + id: Uuid - def to_dict(self) -> Dict[str, Any]: - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - id = self.id - is_valid = self.is_valid - token = self.token - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + is_valid: bool - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if created_at is not UNSET: - field_dict["created_at"] = created_at - if id is not UNSET: - field_dict["id"] = id - if is_valid is not UNSET: - field_dict["is_valid"] = is_valid - if token is not UNSET: - field_dict["token"] = token - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + token: Uuid - return field_dict + updated_at: datetime.datetime - @classmethod - def from_dict(cls: Type[MN], src_dict: Dict[str, Any]) -> MN: - d = src_dict.copy() - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) - - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id - - is_valid = d.pop("is_valid", UNSET) - - _token = d.pop("token", UNSET) - token: Union[Unset, Uuid] - if isinstance(_token, Unset): - token = UNSET - if _token is None: - token = UNSET - else: - token = _token - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - api_token = cls( - created_at=created_at, - id=id, - is_valid=is_valid, - token=token, - updated_at=updated_at, - user_id=user_id, - ) - - api_token.additional_properties = d - return api_token - - @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 + user_id: Uuid diff --git a/kittycad/models/api_token_results_page.py b/kittycad/models/api_token_results_page.py index eb4092320..1fbb2cacf 100644 --- a/kittycad/models/api_token_results_page.py +++ b/kittycad/models/api_token_results_page.py @@ -1,70 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List, Optional -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -JV = TypeVar("JV", bound="ApiTokenResultsPage") +from ..models.api_token import ApiToken -@attr.s(auto_attribs=True) -class ApiTokenResultsPage: - """A single page of results""" # noqa: E501 +class ApiTokenResultsPage(BaseModel): + """A single page of results""" - from ..models.api_token import ApiToken + items: List[ApiToken] - items: Union[Unset, List[ApiToken]] = UNSET - next_page: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - from ..models.api_token import ApiToken - - items: Union[Unset, List[ApiToken]] = UNSET - if not isinstance(self.items, Unset): - items = self.items - next_page = self.next_page - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if items is not UNSET: - field_dict["items"] = items - if next_page is not UNSET: - field_dict["next_page"] = next_page - - return field_dict - - @classmethod - def from_dict(cls: Type[JV], src_dict: Dict[str, Any]) -> JV: - d = src_dict.copy() - from ..models.api_token import ApiToken - - items = cast(List[ApiToken], d.pop("items", UNSET)) - - next_page = d.pop("next_page", UNSET) - - api_token_results_page = cls( - items=items, - next_page=next_page, - ) - - api_token_results_page.additional_properties = d - return api_token_results_page - - @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 + next_page: Optional[str] = None diff --git a/kittycad/models/app_client_info.py b/kittycad/models/app_client_info.py index 86fe373bc..685dfb20d 100644 --- a/kittycad/models/app_client_info.py +++ b/kittycad/models/app_client_info.py @@ -1,55 +1,9 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -IO = TypeVar("IO", bound="AppClientInfo") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class AppClientInfo: - """Information about a third party app client.""" # noqa: E501 +class AppClientInfo(BaseModel): + """Information about a third party app client.""" - url: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - url = self.url - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if url is not UNSET: - field_dict["url"] = url - - return field_dict - - @classmethod - def from_dict(cls: Type[IO], src_dict: Dict[str, Any]) -> IO: - d = src_dict.copy() - url = d.pop("url", UNSET) - - app_client_info = cls( - url=url, - ) - - app_client_info.additional_properties = d - return app_client_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 + url: Optional[str] = None diff --git a/kittycad/models/async_api_call.py b/kittycad/models/async_api_call.py index 4b3279e56..8ab4ae289 100644 --- a/kittycad/models/async_api_call.py +++ b/kittycad/models/async_api_call.py @@ -1,195 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.async_api_call_type import AsyncApiCallType from ..models.uuid import Uuid -from ..types import UNSET, Unset - -FV = TypeVar("FV", bound="AsyncApiCall") -@attr.s(auto_attribs=True) -class AsyncApiCall: - """An async API call.""" # noqa: E501 +class AsyncApiCall(BaseModel): + """An async API call.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, Any] = UNSET - output: Union[Unset, Any] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - type: Union[Unset, AsyncApiCallType] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET - worker: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - output = self.output - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - type: Union[Unset, AsyncApiCallType] = UNSET - if not isinstance(self.type, Unset): - type = self.type - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id - worker = self.worker + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if output is not UNSET: - field_dict["output"] = output - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if type is not UNSET: - field_dict["type"] = type - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id - if worker is not UNSET: - field_dict["worker"] = worker + id: Uuid - return field_dict + input: Optional[Any] = None - @classmethod - 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] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + output: Optional[Any] = None - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + started_at: Optional[datetime.datetime] = None - error = d.pop("error", UNSET) + status: ApiCallStatus - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + type: AsyncApiCallType - input = d.pop("input", UNSET) - output = d.pop("output", UNSET) - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) + updated_at: datetime.datetime - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status + user_id: Uuid - _type = d.pop("type", UNSET) - type: Union[Unset, AsyncApiCallType] - if isinstance(_type, Unset): - type = UNSET - if _type is None: - type = UNSET - else: - type = _type - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - worker = d.pop("worker", UNSET) - - async_api_call = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - output=output, - started_at=started_at, - status=status, - type=type, - updated_at=updated_at, - user_id=user_id, - worker=worker, - ) - - async_api_call.additional_properties = d - return async_api_call - - @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 + worker: Optional[str] = None diff --git a/kittycad/models/async_api_call_output.py b/kittycad/models/async_api_call_output.py index 0024eefcd..71c3e70fb 100644 --- a/kittycad/models/async_api_call_output.py +++ b/kittycad/models/async_api_call_output.py @@ -1,12 +1,12 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, Dict, Optional, Type, TypeVar, Union import attr -from dateutil.parser import isoparse +from pydantic import Base64Bytes, BaseModel, GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema from ..models.ai_feedback import AiFeedback 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,1508 +18,218 @@ from ..models.unit_length import UnitLength from ..models.unit_mass import UnitMass from ..models.unit_volume import UnitVolume from ..models.uuid import Uuid -from ..types import UNSET, Unset - -LE = TypeVar("LE", bound="file_conversion") -@attr.s(auto_attribs=True) -class file_conversion: - """A file conversion.""" # noqa: E501 +class file_conversion(BaseModel): + """A file conversion.""" + + completed_at: Optional[datetime.datetime] = None + + created_at: datetime.datetime + + error: Optional[str] = None + + id: Uuid + + output_format: FileExportFormat + + output_format_options: Optional[OutputFormat] = None + + outputs: Optional[Dict[str, Base64Bytes]] = None + + src_format: FileImportFormat + + src_format_options: Optional[InputFormat] = None + + started_at: Optional[datetime.datetime] = None + + status: ApiCallStatus - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - output_format: Union[Unset, FileExportFormat] = UNSET - output_format_options: Union[Unset, OutputFormat] = 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 - status: Union[Unset, ApiCallStatus] = UNSET type: str = "file_conversion" - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + updated_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - output_format: Union[Unset, FileExportFormat] = UNSET - if not isinstance(self.output_format, Unset): - output_format = self.output_format - output_format_options: Union[Unset, OutputFormat] = UNSET - if not isinstance(self.output_format_options, Unset): - output_format_options = self.output_format_options - 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 - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - src_format_options: Union[Unset, InputFormat] = UNSET - if not isinstance(self.src_format_options, Unset): - src_format_options = self.src_format_options - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - type = self.type - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if output_format is not UNSET: - field_dict["output_format"] = output_format - if output_format_options is not UNSET: - _output_format_options: OutputFormat = cast( - OutputFormat, output_format_options - ) - field_dict["output_format_options"] = _output_format_options.to_dict() - if outputs is not UNSET: - field_dict["outputs"] = outputs - if src_format is not UNSET: - field_dict["src_format"] = src_format - if src_format_options is not UNSET: - _src_format_options: InputFormat = cast(InputFormat, src_format_options) - field_dict["src_format_options"] = _src_format_options.to_dict() - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - field_dict["type"] = type - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: Type[LE], src_dict: Dict[str, Any]) -> LE: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) - - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) - - error = d.pop("error", UNSET) - - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id - - _output_format = d.pop("output_format", UNSET) - output_format: Union[Unset, FileExportFormat] - if isinstance(_output_format, Unset): - output_format = UNSET - if _output_format is None: - output_format = UNSET - else: - output_format = _output_format - - _output_format_options = d.pop("output_format_options", UNSET) - output_format_options: Union[Unset, OutputFormat] - if isinstance(_output_format_options, Unset): - output_format_options = UNSET - if _output_format_options is None: - output_format_options = UNSET - else: - output_format_options = OutputFormat.from_dict(_output_format_options) - - _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): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _src_format_options = d.pop("src_format_options", UNSET) - src_format_options: Union[Unset, InputFormat] - if isinstance(_src_format_options, Unset): - src_format_options = UNSET - if _src_format_options is None: - src_format_options = UNSET - else: - src_format_options = InputFormat.from_dict(_src_format_options) - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - type = d.pop("type", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - file_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - output_format=output_format, - output_format_options=output_format_options, - outputs=outputs, - src_format=src_format, - src_format_options=src_format_options, - started_at=started_at, - status=status, - type=type, - updated_at=updated_at, - user_id=user_id, - ) - - file_conversion.additional_properties = d - return file_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid -OY = TypeVar("OY", bound="file_center_of_mass") +class file_center_of_mass(BaseModel): + """File center of mass.""" + center_of_mass: Optional[Point3d] = None -@attr.s(auto_attribs=True) -class file_center_of_mass: - """File center of mass.""" # noqa: E501 + completed_at: Optional[datetime.datetime] = None + + created_at: datetime.datetime + + error: Optional[str] = None + + id: Uuid + + output_unit: UnitLength + + src_format: FileImportFormat + + started_at: Optional[datetime.datetime] = None + + status: ApiCallStatus - center_of_mass: Union[Unset, Point3d] = UNSET - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - output_unit: Union[Unset, UnitLength] = UNSET - src_format: Union[Unset, FileImportFormat] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET type: str = "file_center_of_mass" - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + updated_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - center_of_mass: Union[Unset, Point3d] = UNSET - if not isinstance(self.center_of_mass, Unset): - center_of_mass = self.center_of_mass - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - output_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - type = self.type - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if center_of_mass is not UNSET: - _center_of_mass: Point3d = cast(Point3d, center_of_mass) - field_dict["center_of_mass"] = _center_of_mass.to_dict() - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if src_format is not UNSET: - field_dict["src_format"] = src_format - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - field_dict["type"] = type - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: Type[OY], src_dict: Dict[str, Any]) -> OY: - d = src_dict.copy() - _center_of_mass = d.pop("center_of_mass", UNSET) - center_of_mass: Union[Unset, Point3d] - if isinstance(_center_of_mass, Unset): - center_of_mass = UNSET - if _center_of_mass is None: - center_of_mass = UNSET - else: - center_of_mass = Point3d.from_dict(_center_of_mass) - - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) - - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) - - error = d.pop("error", UNSET) - - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitLength] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileImportFormat] - if isinstance(_src_format, Unset): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - type = d.pop("type", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - file_center_of_mass = cls( - center_of_mass=center_of_mass, - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - output_unit=output_unit, - src_format=src_format, - started_at=started_at, - status=status, - type=type, - updated_at=updated_at, - user_id=user_id, - ) - - file_center_of_mass.additional_properties = d - return file_center_of_mass - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid -HO = TypeVar("HO", bound="file_mass") +class file_mass(BaseModel): + """A file mass.""" + completed_at: Optional[datetime.datetime] = None -@attr.s(auto_attribs=True) -class file_mass: - """A file mass.""" # noqa: E501 + created_at: datetime.datetime + + error: Optional[str] = None + + id: Uuid + + mass: Optional[float] = None + + material_density: Optional[float] = None + + material_density_unit: UnitDensity + + output_unit: UnitMass + + src_format: FileImportFormat + + started_at: Optional[datetime.datetime] = None + + status: ApiCallStatus - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - mass: Union[Unset, float] = UNSET - material_density: Union[Unset, float] = UNSET - material_density_unit: Union[Unset, UnitDensity] = UNSET - output_unit: Union[Unset, UnitMass] = UNSET - src_format: Union[Unset, FileImportFormat] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET type: str = "file_mass" - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + updated_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - mass = self.mass - material_density = self.material_density - material_density_unit: Union[Unset, UnitDensity] = UNSET - if not isinstance(self.material_density_unit, Unset): - material_density_unit = self.material_density_unit - output_unit: Union[Unset, UnitMass] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - type = self.type - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if mass is not UNSET: - field_dict["mass"] = mass - if material_density is not UNSET: - field_dict["material_density"] = material_density - if material_density_unit is not UNSET: - field_dict["material_density_unit"] = material_density_unit - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if src_format is not UNSET: - field_dict["src_format"] = src_format - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - field_dict["type"] = type - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: Type[HO], src_dict: Dict[str, Any]) -> HO: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) - - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) - - error = d.pop("error", UNSET) - - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id - - mass = d.pop("mass", UNSET) - - material_density = d.pop("material_density", UNSET) - - _material_density_unit = d.pop("material_density_unit", UNSET) - material_density_unit: Union[Unset, UnitDensity] - if isinstance(_material_density_unit, Unset): - material_density_unit = UNSET - if _material_density_unit is None: - material_density_unit = UNSET - else: - material_density_unit = _material_density_unit - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitMass] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileImportFormat] - if isinstance(_src_format, Unset): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - type = d.pop("type", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - file_mass = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - mass=mass, - material_density=material_density, - material_density_unit=material_density_unit, - output_unit=output_unit, - src_format=src_format, - started_at=started_at, - status=status, - type=type, - updated_at=updated_at, - user_id=user_id, - ) - - file_mass.additional_properties = d - return file_mass - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid -TM = TypeVar("TM", bound="file_volume") +class file_volume(BaseModel): + """A file volume.""" + completed_at: Optional[datetime.datetime] = None -@attr.s(auto_attribs=True) -class file_volume: - """A file volume.""" # noqa: E501 + created_at: datetime.datetime + + error: Optional[str] = None + + id: Uuid + + output_unit: UnitVolume + + src_format: FileImportFormat + + started_at: Optional[datetime.datetime] = None + + status: ApiCallStatus - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - output_unit: Union[Unset, UnitVolume] = UNSET - src_format: Union[Unset, FileImportFormat] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET type: str = "file_volume" - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET - volume: Union[Unset, float] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + updated_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - output_unit: Union[Unset, UnitVolume] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - type = self.type - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id - volume = self.volume + user_id: Uuid - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if src_format is not UNSET: - field_dict["src_format"] = src_format - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - field_dict["type"] = type - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id - if volume is not UNSET: - field_dict["volume"] = volume - - return field_dict - - @classmethod - def from_dict(cls: Type[TM], src_dict: Dict[str, Any]) -> TM: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) - - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) - - error = d.pop("error", UNSET) - - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitVolume] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileImportFormat] - if isinstance(_src_format, Unset): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - type = d.pop("type", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - volume = d.pop("volume", UNSET) - - file_volume = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - output_unit=output_unit, - src_format=src_format, - started_at=started_at, - status=status, - type=type, - updated_at=updated_at, - user_id=user_id, - volume=volume, - ) - - file_volume.additional_properties = d - return file_volume - - @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 + volume: Optional[float] = None -BS = TypeVar("BS", bound="file_density") +class file_density(BaseModel): + """A file density.""" + completed_at: Optional[datetime.datetime] = None -@attr.s(auto_attribs=True) -class file_density: - """A file density.""" # noqa: E501 + created_at: datetime.datetime + + density: Optional[float] = None + + error: Optional[str] = None + + id: Uuid + + material_mass: Optional[float] = None + + material_mass_unit: UnitMass + + output_unit: UnitDensity + + src_format: FileImportFormat + + started_at: Optional[datetime.datetime] = None + + status: ApiCallStatus - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - density: Union[Unset, float] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - material_mass: Union[Unset, float] = UNSET - material_mass_unit: Union[Unset, UnitMass] = UNSET - output_unit: Union[Unset, UnitDensity] = UNSET - src_format: Union[Unset, FileImportFormat] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET type: str = "file_density" - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + updated_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - density = self.density - error = self.error - id = self.id - material_mass = self.material_mass - material_mass_unit: Union[Unset, UnitMass] = UNSET - if not isinstance(self.material_mass_unit, Unset): - material_mass_unit = self.material_mass_unit - output_unit: Union[Unset, UnitDensity] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - type = self.type - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if density is not UNSET: - field_dict["density"] = density - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if material_mass is not UNSET: - field_dict["material_mass"] = material_mass - if material_mass_unit is not UNSET: - field_dict["material_mass_unit"] = material_mass_unit - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if src_format is not UNSET: - field_dict["src_format"] = src_format - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - field_dict["type"] = type - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: Type[BS], src_dict: Dict[str, Any]) -> BS: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) - - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) - - density = d.pop("density", UNSET) - - error = d.pop("error", UNSET) - - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id - - material_mass = d.pop("material_mass", UNSET) - - _material_mass_unit = d.pop("material_mass_unit", UNSET) - material_mass_unit: Union[Unset, UnitMass] - if isinstance(_material_mass_unit, Unset): - material_mass_unit = UNSET - if _material_mass_unit is None: - material_mass_unit = UNSET - else: - material_mass_unit = _material_mass_unit - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitDensity] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileImportFormat] - if isinstance(_src_format, Unset): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - type = d.pop("type", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - file_density = cls( - completed_at=completed_at, - created_at=created_at, - density=density, - error=error, - id=id, - material_mass=material_mass, - material_mass_unit=material_mass_unit, - output_unit=output_unit, - src_format=src_format, - started_at=started_at, - status=status, - type=type, - updated_at=updated_at, - user_id=user_id, - ) - - file_density.additional_properties = d - return file_density - - @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 + user_id: Uuid -AH = TypeVar("AH", bound="file_surface_area") +class file_surface_area(BaseModel): + """A file surface area.""" + completed_at: Optional[datetime.datetime] = None -@attr.s(auto_attribs=True) -class file_surface_area: - """A file surface area.""" # noqa: E501 + created_at: datetime.datetime + + error: Optional[str] = None + + id: Uuid + + output_unit: UnitArea + + src_format: FileImportFormat + + started_at: Optional[datetime.datetime] = None + + status: ApiCallStatus + + surface_area: Optional[float] = None - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - output_unit: Union[Unset, UnitArea] = UNSET - src_format: Union[Unset, FileImportFormat] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - surface_area: Union[Unset, float] = UNSET type: str = "file_surface_area" - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + updated_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - output_unit: Union[Unset, UnitArea] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - surface_area = self.surface_area - type = self.type - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if src_format is not UNSET: - field_dict["src_format"] = src_format - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if surface_area is not UNSET: - field_dict["surface_area"] = surface_area - field_dict["type"] = type - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: Type[AH], src_dict: Dict[str, Any]) -> AH: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) - - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) - - error = d.pop("error", UNSET) - - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitArea] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileImportFormat] - if isinstance(_src_format, Unset): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - surface_area = d.pop("surface_area", UNSET) - - type = d.pop("type", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - file_surface_area = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - output_unit=output_unit, - src_format=src_format, - started_at=started_at, - status=status, - surface_area=surface_area, - type=type, - updated_at=updated_at, - user_id=user_id, - ) - - file_surface_area.additional_properties = d - return file_surface_area - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid -EG = TypeVar("EG", bound="text_to_cad") +class text_to_cad(BaseModel): + """Text to CAD.""" + completed_at: Optional[datetime.datetime] = None -@attr.s(auto_attribs=True) -class text_to_cad: - """Text to CAD.""" # noqa: E501 + created_at: datetime.datetime + + error: Optional[str] = None + + feedback: Optional[AiFeedback] = None + + id: Uuid + + model_version: str + + output_format: FileExportFormat + + outputs: Optional[Dict[str, Base64Bytes]] = None + + prompt: str + + started_at: Optional[datetime.datetime] = None + + status: ApiCallStatus - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - feedback: Union[Unset, AiFeedback] = UNSET - id: Union[Unset, str] = UNSET - model_version: Union[Unset, str] = UNSET - output_format: Union[Unset, FileExportFormat] = UNSET - outputs: Union[Unset, Dict[str, Base64Data]] = UNSET - prompt: Union[Unset, str] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET type: str = "text_to_cad" - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + updated_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - feedback: Union[Unset, AiFeedback] = UNSET - if not isinstance(self.feedback, Unset): - feedback = self.feedback - id = self.id - model_version = self.model_version - output_format: Union[Unset, FileExportFormat] = UNSET - if not isinstance(self.output_format, Unset): - output_format = self.output_format - 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 - prompt = self.prompt - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - type = self.type - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if feedback is not UNSET: - field_dict["feedback"] = feedback - if id is not UNSET: - field_dict["id"] = id - if model_version is not UNSET: - field_dict["model_version"] = model_version - if output_format is not UNSET: - field_dict["output_format"] = output_format - if outputs is not UNSET: - field_dict["outputs"] = outputs - if prompt is not UNSET: - field_dict["prompt"] = prompt - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - field_dict["type"] = type - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: Type[EG], src_dict: Dict[str, Any]) -> EG: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) - - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) - - error = d.pop("error", UNSET) - - _feedback = d.pop("feedback", UNSET) - feedback: Union[Unset, AiFeedback] - if isinstance(_feedback, Unset): - feedback = UNSET - if _feedback is None: - feedback = UNSET - else: - feedback = _feedback - - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id - - model_version = d.pop("model_version", UNSET) - - _output_format = d.pop("output_format", UNSET) - output_format: Union[Unset, FileExportFormat] - if isinstance(_output_format, Unset): - output_format = UNSET - if _output_format is None: - output_format = UNSET - else: - output_format = _output_format - - _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 - - prompt = d.pop("prompt", UNSET) - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - type = d.pop("type", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - text_to_cad = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - feedback=feedback, - id=id, - model_version=model_version, - output_format=output_format, - outputs=outputs, - prompt=prompt, - started_at=started_at, - status=status, - type=type, - updated_at=updated_at, - user_id=user_id, - ) - - text_to_cad.additional_properties = d - return text_to_cad - - @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 + user_id: Uuid GY = TypeVar("GY", bound="AsyncApiCallOutput") @@ -1554,60 +264,72 @@ class AsyncApiCallOutput: ): self.type = type - def to_dict(self) -> Dict[str, Any]: + def model_dump(self) -> Dict[str, Any]: if isinstance(self.type, file_conversion): - JR: file_conversion = self.type - return JR.to_dict() + SB: file_conversion = self.type + return SB.model_dump() elif isinstance(self.type, file_center_of_mass): - HK: file_center_of_mass = self.type - return HK.to_dict() + SA: file_center_of_mass = self.type + return SA.model_dump() elif isinstance(self.type, file_mass): - ON: file_mass = self.type - return ON.to_dict() + PI: file_mass = self.type + return PI.model_dump() elif isinstance(self.type, file_volume): - US: file_volume = self.type - return US.to_dict() + FB: file_volume = self.type + return FB.model_dump() elif isinstance(self.type, file_density): - FH: file_density = self.type - return FH.to_dict() + KC: file_density = self.type + return KC.model_dump() elif isinstance(self.type, file_surface_area): - BB: file_surface_area = self.type - return BB.to_dict() + LB: file_surface_area = self.type + return LB.model_dump() elif isinstance(self.type, text_to_cad): - TV: text_to_cad = self.type - return TV.to_dict() + TL: text_to_cad = self.type + return TL.model_dump() raise Exception("Unknown type") @classmethod def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY: if d.get("type") == "file_conversion": - LY: file_conversion = file_conversion() - LY.from_dict(d) - return cls(type=LY) + NP: file_conversion = file_conversion(**d) + return cls(type=NP) elif d.get("type") == "file_center_of_mass": - VR: file_center_of_mass = file_center_of_mass() - VR.from_dict(d) - return cls(type=VR) + GO: file_center_of_mass = file_center_of_mass(**d) + return cls(type=GO) elif d.get("type") == "file_mass": - PC: file_mass = file_mass() - PC.from_dict(d) - return cls(type=PC) + UZ: file_mass = file_mass(**d) + return cls(type=UZ) elif d.get("type") == "file_volume": - KQ: file_volume = file_volume() - KQ.from_dict(d) - return cls(type=KQ) + QP: file_volume = file_volume(**d) + return cls(type=QP) elif d.get("type") == "file_density": - NH: file_density = file_density() - NH.from_dict(d) - return cls(type=NH) + HX: file_density = file_density(**d) + return cls(type=HX) elif d.get("type") == "file_surface_area": - PJ: file_surface_area = file_surface_area() - PJ.from_dict(d) - return cls(type=PJ) + NE: file_surface_area = file_surface_area(**d) + return cls(type=NE) elif d.get("type") == "text_to_cad": - CR: text_to_cad = text_to_cad() - CR.from_dict(d) - return cls(type=CR) + MN: text_to_cad = text_to_cad(**d) + return cls(type=MN) raise Exception("Unknown type") + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function( + cls, + handler( + Union[ + file_conversion, + file_center_of_mass, + file_mass, + file_volume, + file_density, + file_surface_area, + text_to_cad, + ] + ), + ) diff --git a/kittycad/models/async_api_call_results_page.py b/kittycad/models/async_api_call_results_page.py index c6325b09b..69e21ec63 100644 --- a/kittycad/models/async_api_call_results_page.py +++ b/kittycad/models/async_api_call_results_page.py @@ -1,70 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List, Optional -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -CE = TypeVar("CE", bound="AsyncApiCallResultsPage") +from ..models.async_api_call import AsyncApiCall -@attr.s(auto_attribs=True) -class AsyncApiCallResultsPage: - """A single page of results""" # noqa: E501 +class AsyncApiCallResultsPage(BaseModel): + """A single page of results""" - from ..models.async_api_call import AsyncApiCall + items: List[AsyncApiCall] - items: Union[Unset, List[AsyncApiCall]] = UNSET - next_page: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - from ..models.async_api_call import AsyncApiCall - - items: Union[Unset, List[AsyncApiCall]] = UNSET - if not isinstance(self.items, Unset): - items = self.items - next_page = self.next_page - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if items is not UNSET: - field_dict["items"] = items - if next_page is not UNSET: - field_dict["next_page"] = next_page - - return field_dict - - @classmethod - def from_dict(cls: Type[CE], src_dict: Dict[str, Any]) -> CE: - d = src_dict.copy() - from ..models.async_api_call import AsyncApiCall - - items = cast(List[AsyncApiCall], d.pop("items", UNSET)) - - next_page = d.pop("next_page", UNSET) - - async_api_call_results_page = cls( - items=items, - next_page=next_page, - ) - - async_api_call_results_page.additional_properties = d - return async_api_call_results_page - - @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 + next_page: Optional[str] = None diff --git a/kittycad/models/axis_direction_pair.py b/kittycad/models/axis_direction_pair.py index 6a0c6a21a..6bc3abbd7 100644 --- a/kittycad/models/axis_direction_pair.py +++ b/kittycad/models/axis_direction_pair.py @@ -1,82 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.axis import Axis from ..models.direction import Direction -from ..types import UNSET, Unset - -MS = TypeVar("MS", bound="AxisDirectionPair") -@attr.s(auto_attribs=True) -class AxisDirectionPair: - """An [`Axis`] paired with a [`Direction`].""" # noqa: E501 +class AxisDirectionPair(BaseModel): + """An [`Axis`] paired with a [`Direction`].""" - axis: Union[Unset, Axis] = UNSET - direction: Union[Unset, Direction] = UNSET + axis: Axis - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - axis: Union[Unset, Axis] = UNSET - if not isinstance(self.axis, Unset): - axis = self.axis - direction: Union[Unset, Direction] = UNSET - if not isinstance(self.direction, Unset): - direction = self.direction - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if axis is not UNSET: - field_dict["axis"] = axis - if direction is not UNSET: - field_dict["direction"] = direction - - return field_dict - - @classmethod - def from_dict(cls: Type[MS], src_dict: Dict[str, Any]) -> MS: - d = src_dict.copy() - _axis = d.pop("axis", UNSET) - axis: Union[Unset, Axis] - if isinstance(_axis, Unset): - axis = UNSET - if _axis is None: - axis = UNSET - else: - axis = _axis - - _direction = d.pop("direction", UNSET) - direction: Union[Unset, Direction] - if isinstance(_direction, Unset): - direction = UNSET - if _direction is None: - direction = UNSET - else: - direction = _direction - - axis_direction_pair = cls( - axis=axis, - direction=direction, - ) - - axis_direction_pair.additional_properties = d - return axis_direction_pair - - @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 + direction: Direction diff --git a/kittycad/models/base64data.py b/kittycad/models/base64data.py deleted file mode 100644 index f8cc0633b..000000000 --- a/kittycad/models/base64data.py +++ /dev/null @@ -1,35 +0,0 @@ -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 7017d43e6..63a5e62e8 100644 --- a/kittycad/models/billing_info.py +++ b/kittycad/models/billing_info.py @@ -1,80 +1,16 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Optional -import attr +from pydantic import BaseModel +from pydantic_extra_types.phone_number import PhoneNumber from ..models.new_address import NewAddress -from ..types import UNSET, Unset - -LT = TypeVar("LT", bound="BillingInfo") -@attr.s(auto_attribs=True) -class BillingInfo: - """The billing information for payments.""" # noqa: E501 +class BillingInfo(BaseModel): + """The billing information for payments.""" - address: Union[Unset, NewAddress] = UNSET - name: Union[Unset, str] = UNSET - phone: Union[Unset, str] = UNSET + address: Optional[NewAddress] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + name: Optional[str] = None - def to_dict(self) -> Dict[str, Any]: - address: Union[Unset, NewAddress] = UNSET - if not isinstance(self.address, Unset): - address = self.address - name = self.name - phone = self.phone - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if address is not UNSET: - _address: NewAddress = cast(NewAddress, address) - field_dict["address"] = _address.to_dict() - if name is not UNSET: - field_dict["name"] = name - if phone is not UNSET: - field_dict["phone"] = phone - - return field_dict - - @classmethod - def from_dict(cls: Type[LT], src_dict: Dict[str, Any]) -> LT: - d = src_dict.copy() - _address = d.pop("address", UNSET) - address: Union[Unset, NewAddress] - if isinstance(_address, Unset): - address = UNSET - if _address is None: - address = UNSET - else: - address = NewAddress.from_dict(_address) - - name = d.pop("name", UNSET) - - phone = d.pop("phone", UNSET) - - billing_info = cls( - address=address, - name=name, - phone=phone, - ) - - billing_info.additional_properties = d - return billing_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 + phone: Optional[PhoneNumber] = None diff --git a/kittycad/models/cache_metadata.py b/kittycad/models/cache_metadata.py index dfbc01902..1a9ad9df5 100644 --- a/kittycad/models/cache_metadata.py +++ b/kittycad/models/cache_metadata.py @@ -1,57 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -ED = TypeVar("ED", bound="CacheMetadata") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class CacheMetadata: +class CacheMetadata(BaseModel): """Metadata about our cache. - This is mostly used for internal purposes and debugging.""" # noqa: E501 + This is mostly used for internal purposes and debugging.""" - ok: Union[Unset, bool] = False - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - ok = self.ok - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if ok is not UNSET: - field_dict["ok"] = ok - - return field_dict - - @classmethod - def from_dict(cls: Type[ED], src_dict: Dict[str, Any]) -> ED: - d = src_dict.copy() - ok = d.pop("ok", UNSET) - - cache_metadata = cls( - ok=ok, - ) - - cache_metadata.additional_properties = d - return cache_metadata - - @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 + ok: bool diff --git a/kittycad/models/card_details.py b/kittycad/models/card_details.py index d968979c0..83f8c1eef 100644 --- a/kittycad/models/card_details.py +++ b/kittycad/models/card_details.py @@ -1,115 +1,25 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Optional -import attr +from pydantic import BaseModel from ..models.payment_method_card_checks import PaymentMethodCardChecks -from ..types import UNSET, Unset - -YY = TypeVar("YY", bound="CardDetails") -@attr.s(auto_attribs=True) -class CardDetails: - """The card details of a payment method.""" # noqa: E501 +class CardDetails(BaseModel): + """The card details of a payment method.""" - brand: Union[Unset, str] = UNSET - checks: Union[Unset, PaymentMethodCardChecks] = UNSET - country: Union[Unset, str] = UNSET - exp_month: Union[Unset, int] = UNSET - exp_year: Union[Unset, int] = UNSET - fingerprint: Union[Unset, str] = UNSET - funding: Union[Unset, str] = UNSET - last4: Union[Unset, str] = UNSET + brand: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + checks: Optional[PaymentMethodCardChecks] = None - def to_dict(self) -> Dict[str, Any]: - brand = self.brand - checks: Union[Unset, PaymentMethodCardChecks] = UNSET - if not isinstance(self.checks, Unset): - checks = self.checks - country = self.country - exp_month = self.exp_month - exp_year = self.exp_year - fingerprint = self.fingerprint - funding = self.funding - last4 = self.last4 + country: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if brand is not UNSET: - field_dict["brand"] = brand - if checks is not UNSET: - _checks: PaymentMethodCardChecks = cast(PaymentMethodCardChecks, checks) - field_dict["checks"] = _checks.to_dict() - if country is not UNSET: - field_dict["country"] = country - if exp_month is not UNSET: - field_dict["exp_month"] = exp_month - if exp_year is not UNSET: - field_dict["exp_year"] = exp_year - if fingerprint is not UNSET: - field_dict["fingerprint"] = fingerprint - if funding is not UNSET: - field_dict["funding"] = funding - if last4 is not UNSET: - field_dict["last4"] = last4 + exp_month: Optional[int] = None - return field_dict + exp_year: Optional[int] = None - @classmethod - def from_dict(cls: Type[YY], src_dict: Dict[str, Any]) -> YY: - d = src_dict.copy() - brand = d.pop("brand", UNSET) + fingerprint: Optional[str] = None - _checks = d.pop("checks", UNSET) - checks: Union[Unset, PaymentMethodCardChecks] - if isinstance(_checks, Unset): - checks = UNSET - if _checks is None: - checks = UNSET - else: - checks = PaymentMethodCardChecks.from_dict(_checks) + funding: Optional[str] = None - country = d.pop("country", UNSET) - - exp_month = d.pop("exp_month", UNSET) - - exp_year = d.pop("exp_year", UNSET) - - fingerprint = d.pop("fingerprint", UNSET) - - funding = d.pop("funding", UNSET) - - last4 = d.pop("last4", UNSET) - - card_details = cls( - brand=brand, - checks=checks, - country=country, - exp_month=exp_month, - exp_year=exp_year, - fingerprint=fingerprint, - funding=funding, - last4=last4, - ) - - card_details.additional_properties = d - return card_details - - @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 + last4: Optional[str] = None diff --git a/kittycad/models/center_of_mass.py b/kittycad/models/center_of_mass.py index 2d512507b..c0e777194 100644 --- a/kittycad/models/center_of_mass.py +++ b/kittycad/models/center_of_mass.py @@ -1,83 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast -import attr +from pydantic import BaseModel from ..models.point3d import Point3d from ..models.unit_length import UnitLength -from ..types import UNSET, Unset - -DO = TypeVar("DO", bound="CenterOfMass") -@attr.s(auto_attribs=True) -class CenterOfMass: - """The center of mass response.""" # noqa: E501 +class CenterOfMass(BaseModel): + """The center of mass response.""" - center_of_mass: Union[Unset, Point3d] = UNSET - output_unit: Union[Unset, UnitLength] = UNSET + center_of_mass: Point3d - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - center_of_mass: Union[Unset, Point3d] = UNSET - if not isinstance(self.center_of_mass, Unset): - center_of_mass = self.center_of_mass - output_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if center_of_mass is not UNSET: - _center_of_mass: Point3d = cast(Point3d, center_of_mass) - field_dict["center_of_mass"] = _center_of_mass.to_dict() - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - - return field_dict - - @classmethod - def from_dict(cls: Type[DO], src_dict: Dict[str, Any]) -> DO: - d = src_dict.copy() - _center_of_mass = d.pop("center_of_mass", UNSET) - center_of_mass: Union[Unset, Point3d] - if isinstance(_center_of_mass, Unset): - center_of_mass = UNSET - if _center_of_mass is None: - center_of_mass = UNSET - else: - center_of_mass = Point3d.from_dict(_center_of_mass) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitLength] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - center_of_mass = cls( - center_of_mass=center_of_mass, - output_unit=output_unit, - ) - - center_of_mass.additional_properties = d - return center_of_mass - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + output_unit: UnitLength diff --git a/kittycad/models/client_metrics.py b/kittycad/models/client_metrics.py index 00139bcbc..3ce9b3a77 100644 --- a/kittycad/models/client_metrics.py +++ b/kittycad/models/client_metrics.py @@ -1,106 +1,22 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -FZ = TypeVar("FZ", bound="ClientMetrics") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class ClientMetrics: - """ClientMetrics contains information regarding the state of the peer.""" # noqa: E501 +class ClientMetrics(BaseModel): + """ClientMetrics contains information regarding the state of the peer.""" - rtc_frames_decoded: Union[Unset, int] = UNSET - rtc_frames_dropped: Union[Unset, int] = UNSET - rtc_frames_per_second: Union[Unset, int] = UNSET - rtc_frames_received: Union[Unset, int] = UNSET - rtc_freeze_count: Union[Unset, int] = UNSET - rtc_jitter_sec: Union[Unset, float] = UNSET - rtc_keyframes_decoded: Union[Unset, int] = UNSET - rtc_total_freezes_duration_sec: Union[Unset, float] = UNSET + rtc_frames_decoded: int - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + rtc_frames_dropped: int - def to_dict(self) -> Dict[str, Any]: - rtc_frames_decoded = self.rtc_frames_decoded - rtc_frames_dropped = self.rtc_frames_dropped - rtc_frames_per_second = self.rtc_frames_per_second - rtc_frames_received = self.rtc_frames_received - rtc_freeze_count = self.rtc_freeze_count - rtc_jitter_sec = self.rtc_jitter_sec - rtc_keyframes_decoded = self.rtc_keyframes_decoded - rtc_total_freezes_duration_sec = self.rtc_total_freezes_duration_sec + rtc_frames_per_second: int - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if rtc_frames_decoded is not UNSET: - field_dict["rtc_frames_decoded"] = rtc_frames_decoded - if rtc_frames_dropped is not UNSET: - field_dict["rtc_frames_dropped"] = rtc_frames_dropped - if rtc_frames_per_second is not UNSET: - field_dict["rtc_frames_per_second"] = rtc_frames_per_second - if rtc_frames_received is not UNSET: - field_dict["rtc_frames_received"] = rtc_frames_received - if rtc_freeze_count is not UNSET: - field_dict["rtc_freeze_count"] = rtc_freeze_count - if rtc_jitter_sec is not UNSET: - field_dict["rtc_jitter_sec"] = rtc_jitter_sec - if rtc_keyframes_decoded is not UNSET: - field_dict["rtc_keyframes_decoded"] = rtc_keyframes_decoded - if rtc_total_freezes_duration_sec is not UNSET: - field_dict[ - "rtc_total_freezes_duration_sec" - ] = rtc_total_freezes_duration_sec + rtc_frames_received: int - return field_dict + rtc_freeze_count: int - @classmethod - def from_dict(cls: Type[FZ], src_dict: Dict[str, Any]) -> FZ: - d = src_dict.copy() - rtc_frames_decoded = d.pop("rtc_frames_decoded", UNSET) + rtc_jitter_sec: float - rtc_frames_dropped = d.pop("rtc_frames_dropped", UNSET) + rtc_keyframes_decoded: int - rtc_frames_per_second = d.pop("rtc_frames_per_second", UNSET) - - rtc_frames_received = d.pop("rtc_frames_received", UNSET) - - rtc_freeze_count = d.pop("rtc_freeze_count", UNSET) - - rtc_jitter_sec = d.pop("rtc_jitter_sec", UNSET) - - rtc_keyframes_decoded = d.pop("rtc_keyframes_decoded", UNSET) - - rtc_total_freezes_duration_sec = d.pop("rtc_total_freezes_duration_sec", UNSET) - - client_metrics = cls( - rtc_frames_decoded=rtc_frames_decoded, - rtc_frames_dropped=rtc_frames_dropped, - rtc_frames_per_second=rtc_frames_per_second, - rtc_frames_received=rtc_frames_received, - rtc_freeze_count=rtc_freeze_count, - rtc_jitter_sec=rtc_jitter_sec, - rtc_keyframes_decoded=rtc_keyframes_decoded, - rtc_total_freezes_duration_sec=rtc_total_freezes_duration_sec, - ) - - client_metrics.additional_properties = d - return client_metrics - - @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 + rtc_total_freezes_duration_sec: float diff --git a/kittycad/models/cluster.py b/kittycad/models/cluster.py index 4e363f485..dc2167b7d 100644 --- a/kittycad/models/cluster.py +++ b/kittycad/models/cluster.py @@ -1,92 +1,19 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List, Optional -import attr - -from ..types import UNSET, Unset - -GL = TypeVar("GL", bound="Cluster") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Cluster: - """Cluster information.""" # noqa: E501 +class Cluster(BaseModel): + """Cluster information.""" - addr: Union[Unset, str] = UNSET - auth_timeout: Union[Unset, int] = UNSET - cluster_port: Union[Unset, int] = UNSET - name: Union[Unset, str] = UNSET - tls_timeout: Union[Unset, int] = UNSET - urls: Union[Unset, List[str]] = UNSET + addr: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + auth_timeout: Optional[int] = None - def to_dict(self) -> Dict[str, Any]: - addr = self.addr - auth_timeout = self.auth_timeout - cluster_port = self.cluster_port - name = self.name - tls_timeout = self.tls_timeout - urls: Union[Unset, List[str]] = UNSET - if not isinstance(self.urls, Unset): - urls = self.urls + cluster_port: Optional[int] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if addr is not UNSET: - field_dict["addr"] = addr - if auth_timeout is not UNSET: - field_dict["auth_timeout"] = auth_timeout - if cluster_port is not UNSET: - field_dict["cluster_port"] = cluster_port - if name is not UNSET: - field_dict["name"] = name - if tls_timeout is not UNSET: - field_dict["tls_timeout"] = tls_timeout - if urls is not UNSET: - field_dict["urls"] = urls + name: Optional[str] = None - return field_dict + tls_timeout: Optional[int] = None - @classmethod - def from_dict(cls: Type[GL], src_dict: Dict[str, Any]) -> GL: - d = src_dict.copy() - addr = d.pop("addr", UNSET) - - auth_timeout = d.pop("auth_timeout", UNSET) - - cluster_port = d.pop("cluster_port", UNSET) - - name = d.pop("name", UNSET) - - tls_timeout = d.pop("tls_timeout", UNSET) - - urls = cast(List[str], d.pop("urls", UNSET)) - - cluster = cls( - addr=addr, - auth_timeout=auth_timeout, - cluster_port=cluster_port, - name=name, - tls_timeout=tls_timeout, - urls=urls, - ) - - cluster.additional_properties = d - return cluster - - @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 + urls: Optional[List[str]] = None diff --git a/kittycad/models/code_output.py b/kittycad/models/code_output.py index 1c37f90b5..7250eb533 100644 --- a/kittycad/models/code_output.py +++ b/kittycad/models/code_output.py @@ -1,77 +1,15 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List, Optional -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -NN = TypeVar("NN", bound="CodeOutput") +from ..models.output_file import OutputFile -@attr.s(auto_attribs=True) -class CodeOutput: - """Output of the code being executed.""" # noqa: E501 +class CodeOutput(BaseModel): + """Output of the code being executed.""" - from ..models.output_file import OutputFile + output_files: Optional[List[OutputFile]] = None - output_files: Union[Unset, List[OutputFile]] = UNSET - stderr: Union[Unset, str] = UNSET - stdout: Union[Unset, str] = UNSET + stderr: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - from ..models.output_file import OutputFile - - output_files: Union[Unset, List[OutputFile]] = UNSET - if not isinstance(self.output_files, Unset): - output_files = self.output_files - stderr = self.stderr - stdout = self.stdout - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if output_files is not UNSET: - field_dict["output_files"] = output_files - if stderr is not UNSET: - field_dict["stderr"] = stderr - if stdout is not UNSET: - field_dict["stdout"] = stdout - - return field_dict - - @classmethod - def from_dict(cls: Type[NN], src_dict: Dict[str, Any]) -> NN: - d = src_dict.copy() - from ..models.output_file import OutputFile - - output_files = cast(List[OutputFile], d.pop("output_files", UNSET)) - - stderr = d.pop("stderr", UNSET) - - stdout = d.pop("stdout", UNSET) - - code_output = cls( - output_files=output_files, - stderr=stderr, - stdout=stdout, - ) - - code_output.additional_properties = d - return code_output - - @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 + stdout: Optional[str] = None diff --git a/kittycad/models/color.py b/kittycad/models/color.py index 8fa442b4c..17426888d 100644 --- a/kittycad/models/color.py +++ b/kittycad/models/color.py @@ -1,76 +1,14 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -OH = TypeVar("OH", bound="Color") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Color: - """An RGBA color""" # noqa: E501 +class Color(BaseModel): + """An RGBA color""" - a: Union[Unset, float] = UNSET - b: Union[Unset, float] = UNSET - g: Union[Unset, float] = UNSET - r: Union[Unset, float] = UNSET + a: float - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + b: float - def to_dict(self) -> Dict[str, Any]: - a = self.a - b = self.b - g = self.g - r = self.r + g: float - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if a is not UNSET: - field_dict["a"] = a - if b is not UNSET: - field_dict["b"] = b - if g is not UNSET: - field_dict["g"] = g - if r is not UNSET: - field_dict["r"] = r - - return field_dict - - @classmethod - def from_dict(cls: Type[OH], src_dict: Dict[str, Any]) -> OH: - d = src_dict.copy() - a = d.pop("a", UNSET) - - b = d.pop("b", UNSET) - - g = d.pop("g", UNSET) - - r = d.pop("r", UNSET) - - color = cls( - a=a, - b=b, - g=g, - r=r, - ) - - color.additional_properties = d - return 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 + r: float diff --git a/kittycad/models/connection.py b/kittycad/models/connection.py index f4a314e17..851e91692 100644 --- a/kittycad/models/connection.py +++ b/kittycad/models/connection.py @@ -1,440 +1,107 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Dict, Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.cluster import Cluster from ..models.gateway import Gateway from ..models.jetstream import Jetstream from ..models.leaf_node import LeafNode -from ..types import UNSET, Unset - -VI = TypeVar("VI", bound="Connection") -@attr.s(auto_attribs=True) -class Connection: +class Connection(BaseModel): """Metadata about a pub-sub connection. - This is mostly used for internal purposes and debugging.""" # noqa: E501 + This is mostly used for internal purposes and debugging.""" - auth_timeout: Union[Unset, int] = UNSET - cluster: Union[Unset, Cluster] = UNSET - config_load_time: Union[Unset, datetime.datetime] = UNSET - connections: Union[Unset, int] = UNSET - cores: Union[Unset, int] = UNSET - cpu: Union[Unset, float] = UNSET - gateway: Union[Unset, Gateway] = UNSET - git_commit: Union[Unset, str] = UNSET - go: Union[Unset, str] = UNSET - gomaxprocs: Union[Unset, int] = UNSET - host: Union[Unset, str] = UNSET - http_base_path: Union[Unset, str] = UNSET - http_host: Union[Unset, str] = UNSET - http_port: Union[Unset, int] = 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 - jetstream: Union[Unset, Jetstream] = UNSET - leaf: Union[Unset, LeafNode] = UNSET - leafnodes: Union[Unset, int] = UNSET - max_connections: Union[Unset, int] = UNSET - max_control_line: Union[Unset, int] = UNSET - max_payload: Union[Unset, int] = UNSET - max_pending: Union[Unset, int] = UNSET - mem: Union[Unset, int] = UNSET - now: Union[Unset, datetime.datetime] = UNSET - out_bytes: Union[Unset, int] = UNSET - out_msgs: Union[Unset, int] = UNSET - ping_interval: Union[Unset, int] = UNSET - ping_max: Union[Unset, int] = UNSET - port: Union[Unset, int] = UNSET - proto: Union[Unset, int] = UNSET - remotes: Union[Unset, int] = UNSET - routes: Union[Unset, int] = UNSET - server_id: Union[Unset, str] = UNSET - server_name: Union[Unset, str] = UNSET - slow_consumers: Union[Unset, int] = UNSET - start: Union[Unset, datetime.datetime] = UNSET - subscriptions: Union[Unset, int] = UNSET - system_account: Union[Unset, str] = UNSET - tls_timeout: Union[Unset, int] = UNSET - total_connections: Union[Unset, int] = UNSET - uptime: Union[Unset, str] = UNSET - version: Union[Unset, str] = UNSET - write_deadline: Union[Unset, int] = UNSET + auth_timeout: Optional[int] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + cluster: Optional[Cluster] = None - def to_dict(self) -> Dict[str, Any]: - auth_timeout = self.auth_timeout - cluster: Union[Unset, Cluster] = UNSET - if not isinstance(self.cluster, Unset): - cluster = self.cluster - config_load_time: Union[Unset, str] = UNSET - if not isinstance(self.config_load_time, Unset): - config_load_time = self.config_load_time.isoformat() - connections = self.connections - cores = self.cores - cpu = self.cpu - gateway: Union[Unset, Gateway] = UNSET - if not isinstance(self.gateway, Unset): - gateway = self.gateway - git_commit = self.git_commit - go = self.go - gomaxprocs = self.gomaxprocs - host = self.host - http_base_path = self.http_base_path - http_host = self.http_host - http_port = self.http_port - http_req_stats = self.http_req_stats + config_load_time: datetime.datetime - https_port = self.https_port - in_bytes = self.in_bytes - in_msgs = self.in_msgs - jetstream: Union[Unset, Jetstream] = UNSET - if not isinstance(self.jetstream, Unset): - jetstream = self.jetstream - leaf: Union[Unset, LeafNode] = UNSET - if not isinstance(self.leaf, Unset): - leaf = self.leaf - leafnodes = self.leafnodes - max_connections = self.max_connections - max_control_line = self.max_control_line - max_payload = self.max_payload - max_pending = self.max_pending - mem = self.mem - now: Union[Unset, str] = UNSET - if not isinstance(self.now, Unset): - now = self.now.isoformat() - out_bytes = self.out_bytes - out_msgs = self.out_msgs - ping_interval = self.ping_interval - ping_max = self.ping_max - port = self.port - proto = self.proto - remotes = self.remotes - routes = self.routes - server_id = self.server_id - server_name = self.server_name - slow_consumers = self.slow_consumers - start: Union[Unset, str] = UNSET - if not isinstance(self.start, Unset): - start = self.start.isoformat() - subscriptions = self.subscriptions - system_account = self.system_account - tls_timeout = self.tls_timeout - total_connections = self.total_connections - uptime = self.uptime - version = self.version - write_deadline = self.write_deadline + connections: Optional[int] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if auth_timeout is not UNSET: - field_dict["auth_timeout"] = auth_timeout - if cluster is not UNSET: - _cluster: Cluster = cast(Cluster, cluster) - field_dict["cluster"] = _cluster.to_dict() - if config_load_time is not UNSET: - field_dict["config_load_time"] = config_load_time - if connections is not UNSET: - field_dict["connections"] = connections - if cores is not UNSET: - field_dict["cores"] = cores - if cpu is not UNSET: - field_dict["cpu"] = cpu - if gateway is not UNSET: - _gateway: Gateway = cast(Gateway, gateway) - field_dict["gateway"] = _gateway.to_dict() - if git_commit is not UNSET: - field_dict["git_commit"] = git_commit - if go is not UNSET: - field_dict["go"] = go - if gomaxprocs is not UNSET: - field_dict["gomaxprocs"] = gomaxprocs - if host is not UNSET: - field_dict["host"] = host - if http_base_path is not UNSET: - field_dict["http_base_path"] = http_base_path - if http_host is not UNSET: - field_dict["http_host"] = http_host - if http_port is not UNSET: - field_dict["http_port"] = http_port - if http_req_stats is not UNSET: - field_dict["http_req_stats"] = http_req_stats - if https_port is not UNSET: - field_dict["https_port"] = https_port - if in_bytes is not UNSET: - field_dict["in_bytes"] = in_bytes - if in_msgs is not UNSET: - field_dict["in_msgs"] = in_msgs - if jetstream is not UNSET: - _jetstream: Jetstream = cast(Jetstream, jetstream) - field_dict["jetstream"] = _jetstream.to_dict() - if leaf is not UNSET: - _leaf: LeafNode = cast(LeafNode, leaf) - field_dict["leaf"] = _leaf.to_dict() - if leafnodes is not UNSET: - field_dict["leafnodes"] = leafnodes - if max_connections is not UNSET: - field_dict["max_connections"] = max_connections - if max_control_line is not UNSET: - field_dict["max_control_line"] = max_control_line - if max_payload is not UNSET: - field_dict["max_payload"] = max_payload - if max_pending is not UNSET: - field_dict["max_pending"] = max_pending - if mem is not UNSET: - field_dict["mem"] = mem - if now is not UNSET: - field_dict["now"] = now - if out_bytes is not UNSET: - field_dict["out_bytes"] = out_bytes - if out_msgs is not UNSET: - field_dict["out_msgs"] = out_msgs - if ping_interval is not UNSET: - field_dict["ping_interval"] = ping_interval - if ping_max is not UNSET: - field_dict["ping_max"] = ping_max - if port is not UNSET: - field_dict["port"] = port - if proto is not UNSET: - field_dict["proto"] = proto - if remotes is not UNSET: - field_dict["remotes"] = remotes - if routes is not UNSET: - field_dict["routes"] = routes - if server_id is not UNSET: - field_dict["server_id"] = server_id - if server_name is not UNSET: - field_dict["server_name"] = server_name - if slow_consumers is not UNSET: - field_dict["slow_consumers"] = slow_consumers - if start is not UNSET: - field_dict["start"] = start - if subscriptions is not UNSET: - field_dict["subscriptions"] = subscriptions - if system_account is not UNSET: - field_dict["system_account"] = system_account - if tls_timeout is not UNSET: - field_dict["tls_timeout"] = tls_timeout - if total_connections is not UNSET: - field_dict["total_connections"] = total_connections - if uptime is not UNSET: - field_dict["uptime"] = uptime - if version is not UNSET: - field_dict["version"] = version - if write_deadline is not UNSET: - field_dict["write_deadline"] = write_deadline + cores: Optional[int] = None - return field_dict + cpu: Optional[float] = None - @classmethod - def from_dict(cls: Type[VI], src_dict: Dict[str, Any]) -> VI: - d = src_dict.copy() - auth_timeout = d.pop("auth_timeout", UNSET) + gateway: Optional[Gateway] = None - _cluster = d.pop("cluster", UNSET) - cluster: Union[Unset, Cluster] - if isinstance(_cluster, Unset): - cluster = UNSET - if _cluster is None: - cluster = UNSET - else: - cluster = Cluster.from_dict(_cluster) + git_commit: Optional[str] = None - _config_load_time = d.pop("config_load_time", UNSET) - config_load_time: Union[Unset, datetime.datetime] - if isinstance(_config_load_time, Unset): - config_load_time = UNSET - else: - config_load_time = isoparse(_config_load_time) + go: Optional[str] = None - connections = d.pop("connections", UNSET) + gomaxprocs: Optional[int] = None - cores = d.pop("cores", UNSET) + host: str - cpu = d.pop("cpu", UNSET) + http_base_path: Optional[str] = None - _gateway = d.pop("gateway", UNSET) - gateway: Union[Unset, Gateway] - if isinstance(_gateway, Unset): - gateway = UNSET - if _gateway is None: - gateway = UNSET - else: - gateway = Gateway.from_dict(_gateway) + http_host: Optional[str] = None - git_commit = d.pop("git_commit", UNSET) + http_port: Optional[int] = None - go = d.pop("go", UNSET) + http_req_stats: Dict[str, int] - gomaxprocs = d.pop("gomaxprocs", UNSET) + https_port: Optional[int] = None - host = d.pop("host", UNSET) + in_bytes: Optional[int] = None - http_base_path = d.pop("http_base_path", UNSET) + in_msgs: Optional[int] = None - http_host = d.pop("http_host", UNSET) + jetstream: Optional[Jetstream] = None - http_port = d.pop("http_port", UNSET) + leaf: Optional[LeafNode] = None - http_req_stats = d.pop("http_req_stats", UNSET) + leafnodes: Optional[int] = None - https_port = d.pop("https_port", UNSET) + max_connections: Optional[int] = None - in_bytes = d.pop("in_bytes", UNSET) + max_control_line: Optional[int] = None - in_msgs = d.pop("in_msgs", UNSET) + max_payload: Optional[int] = None - _jetstream = d.pop("jetstream", UNSET) - jetstream: Union[Unset, Jetstream] - if isinstance(_jetstream, Unset): - jetstream = UNSET - if _jetstream is None: - jetstream = UNSET - else: - jetstream = Jetstream.from_dict(_jetstream) + max_pending: Optional[int] = None - _leaf = d.pop("leaf", UNSET) - leaf: Union[Unset, LeafNode] - if isinstance(_leaf, Unset): - leaf = UNSET - if _leaf is None: - leaf = UNSET - else: - leaf = LeafNode.from_dict(_leaf) + mem: Optional[int] = None - leafnodes = d.pop("leafnodes", UNSET) + now: datetime.datetime - max_connections = d.pop("max_connections", UNSET) + out_bytes: Optional[int] = None - max_control_line = d.pop("max_control_line", UNSET) + out_msgs: Optional[int] = None - max_payload = d.pop("max_payload", UNSET) + ping_interval: Optional[int] = None - max_pending = d.pop("max_pending", UNSET) + ping_max: Optional[int] = None - mem = d.pop("mem", UNSET) + port: Optional[int] = None - _now = d.pop("now", UNSET) - now: Union[Unset, datetime.datetime] - if isinstance(_now, Unset): - now = UNSET - else: - now = isoparse(_now) + proto: Optional[int] = None - out_bytes = d.pop("out_bytes", UNSET) + remotes: Optional[int] = None - out_msgs = d.pop("out_msgs", UNSET) + routes: Optional[int] = None - ping_interval = d.pop("ping_interval", UNSET) + server_id: Optional[str] = None - ping_max = d.pop("ping_max", UNSET) + server_name: Optional[str] = None - port = d.pop("port", UNSET) + slow_consumers: Optional[int] = None - proto = d.pop("proto", UNSET) + start: datetime.datetime - remotes = d.pop("remotes", UNSET) + subscriptions: Optional[int] = None - routes = d.pop("routes", UNSET) + system_account: Optional[str] = None - server_id = d.pop("server_id", UNSET) + tls_timeout: Optional[int] = None - server_name = d.pop("server_name", UNSET) + total_connections: Optional[int] = None - slow_consumers = d.pop("slow_consumers", UNSET) + uptime: Optional[str] = None - _start = d.pop("start", UNSET) - start: Union[Unset, datetime.datetime] - if isinstance(_start, Unset): - start = UNSET - else: - start = isoparse(_start) + version: Optional[str] = None - subscriptions = d.pop("subscriptions", UNSET) - - system_account = d.pop("system_account", UNSET) - - tls_timeout = d.pop("tls_timeout", UNSET) - - total_connections = d.pop("total_connections", UNSET) - - uptime = d.pop("uptime", UNSET) - - version = d.pop("version", UNSET) - - write_deadline = d.pop("write_deadline", UNSET) - - connection = cls( - auth_timeout=auth_timeout, - cluster=cluster, - config_load_time=config_load_time, - connections=connections, - cores=cores, - cpu=cpu, - gateway=gateway, - git_commit=git_commit, - go=go, - gomaxprocs=gomaxprocs, - host=host, - http_base_path=http_base_path, - http_host=http_host, - http_port=http_port, - http_req_stats=http_req_stats, - https_port=https_port, - in_bytes=in_bytes, - in_msgs=in_msgs, - jetstream=jetstream, - leaf=leaf, - leafnodes=leafnodes, - max_connections=max_connections, - max_control_line=max_control_line, - max_payload=max_payload, - max_pending=max_pending, - mem=mem, - now=now, - out_bytes=out_bytes, - out_msgs=out_msgs, - ping_interval=ping_interval, - ping_max=ping_max, - port=port, - proto=proto, - remotes=remotes, - routes=routes, - server_id=server_id, - server_name=server_name, - slow_consumers=slow_consumers, - start=start, - subscriptions=subscriptions, - system_account=system_account, - tls_timeout=tls_timeout, - total_connections=total_connections, - uptime=uptime, - version=version, - write_deadline=write_deadline, - ) - - connection.additional_properties = d - return connection - - @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 + write_deadline: Optional[int] = None diff --git a/kittycad/models/country_code.py b/kittycad/models/country_code.py index f7df3965d..be68caf10 100644 --- a/kittycad/models/country_code.py +++ b/kittycad/models/country_code.py @@ -1,3 +1,17 @@ +from typing import Any + +from pydantic import GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema + + class CountryCode(str): + """An ISO-3166 alpha-2 country code. Always uppercase.""" + def __str__(self) -> str: return self + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function(cls, handler(str)) diff --git a/kittycad/models/coupon.py b/kittycad/models/coupon.py index a3d2f5ccf..b660b1e5a 100644 --- a/kittycad/models/coupon.py +++ b/kittycad/models/coupon.py @@ -1,76 +1,15 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -ET = TypeVar("ET", bound="Coupon") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Coupon: - """The resource representing a Coupon.""" # noqa: E501 +class Coupon(BaseModel): + """The resource representing a Coupon.""" - amount_off: Union[Unset, float] = UNSET - deleted: Union[Unset, bool] = False - id: Union[Unset, str] = UNSET - percent_off: Union[Unset, float] = UNSET + amount_off: Optional[float] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + deleted: Optional[bool] = None - def to_dict(self) -> Dict[str, Any]: - amount_off = self.amount_off - deleted = self.deleted - id = self.id - percent_off = self.percent_off + id: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if amount_off is not UNSET: - field_dict["amount_off"] = amount_off - if deleted is not UNSET: - field_dict["deleted"] = deleted - if id is not UNSET: - field_dict["id"] = id - if percent_off is not UNSET: - field_dict["percent_off"] = percent_off - - return field_dict - - @classmethod - def from_dict(cls: Type[ET], src_dict: Dict[str, Any]) -> ET: - d = src_dict.copy() - amount_off = d.pop("amount_off", UNSET) - - deleted = d.pop("deleted", UNSET) - - id = d.pop("id", UNSET) - - percent_off = d.pop("percent_off", UNSET) - - coupon = cls( - amount_off=amount_off, - deleted=deleted, - id=id, - percent_off=percent_off, - ) - - coupon.additional_properties = d - return coupon - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + percent_off: Optional[float] = None diff --git a/kittycad/models/currency.py b/kittycad/models/currency.py index 1e0e1a589..3335b9a91 100644 --- a/kittycad/models/currency.py +++ b/kittycad/models/currency.py @@ -1,3 +1,20 @@ +from typing import Any + +from pydantic import GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema + + class Currency(str): + """Currency is the list of supported currencies. Always lowercase. + + This comes from the Stripe API docs: For more details see . + """ + def __str__(self) -> str: return self + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function(cls, handler(str)) diff --git a/kittycad/models/curve_get_control_points.py b/kittycad/models/curve_get_control_points.py index 60ab3e6a7..b35cc1944 100644 --- a/kittycad/models/curve_get_control_points.py +++ b/kittycad/models/curve_get_control_points.py @@ -1,63 +1,11 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -QF = TypeVar("QF", bound="CurveGetControlPoints") +from ..models.point3d import Point3d -@attr.s(auto_attribs=True) -class CurveGetControlPoints: - """The response from the `CurveGetControlPoints` command.""" # noqa: E501 +class CurveGetControlPoints(BaseModel): + """The response from the `CurveGetControlPoints` command.""" - 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[QF], src_dict: Dict[str, Any]) -> QF: - 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 + control_points: List[Point3d] diff --git a/kittycad/models/curve_get_end_points.py b/kittycad/models/curve_get_end_points.py index 81404723d..f2bbc6815 100644 --- a/kittycad/models/curve_get_end_points.py +++ b/kittycad/models/curve_get_end_points.py @@ -1,83 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast -import attr +from pydantic import BaseModel from ..models.point3d import Point3d -from ..types import UNSET, Unset - -DI = TypeVar("DI", bound="CurveGetEndPoints") -@attr.s(auto_attribs=True) -class CurveGetEndPoints: - """Endpoints of a curve""" # noqa: E501 +class CurveGetEndPoints(BaseModel): + """Endpoints of a curve""" - end: Union[Unset, Point3d] = UNSET - start: Union[Unset, Point3d] = UNSET + end: Point3d - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - end: Union[Unset, Point3d] = UNSET - if not isinstance(self.end, Unset): - end = self.end - start: Union[Unset, Point3d] = UNSET - if not isinstance(self.start, Unset): - start = self.start - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if end is not UNSET: - _end: Point3d = cast(Point3d, end) - field_dict["end"] = _end.to_dict() - if start is not UNSET: - _start: Point3d = cast(Point3d, start) - field_dict["start"] = _start.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[DI], src_dict: Dict[str, Any]) -> DI: - d = src_dict.copy() - _end = d.pop("end", UNSET) - end: Union[Unset, Point3d] - if isinstance(_end, Unset): - end = UNSET - if _end is None: - end = UNSET - else: - end = Point3d.from_dict(_end) - - _start = d.pop("start", UNSET) - start: Union[Unset, Point3d] - if isinstance(_start, Unset): - start = UNSET - if _start is None: - start = UNSET - else: - start = Point3d.from_dict(_start) - - curve_get_end_points = cls( - end=end, - start=start, - ) - - curve_get_end_points.additional_properties = d - return curve_get_end_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 + start: Point3d diff --git a/kittycad/models/curve_get_type.py b/kittycad/models/curve_get_type.py index 7a9f447ab..9ba6f116b 100644 --- a/kittycad/models/curve_get_type.py +++ b/kittycad/models/curve_get_type.py @@ -1,65 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.curve_type import CurveType -from ..types import UNSET, Unset - -OJ = TypeVar("OJ", bound="CurveGetType") -@attr.s(auto_attribs=True) -class CurveGetType: - """The response from the `CurveGetType` command.""" # noqa: E501 +class CurveGetType(BaseModel): + """The response from the `CurveGetType` command.""" - curve_type: Union[Unset, CurveType] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - curve_type: Union[Unset, CurveType] = UNSET - 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[OJ], src_dict: Dict[str, Any]) -> OJ: - d = src_dict.copy() - _curve_type = d.pop("curve_type", UNSET) - curve_type: Union[Unset, CurveType] - if isinstance(_curve_type, Unset): - curve_type = UNSET - if _curve_type is None: - curve_type = UNSET - else: - curve_type = _curve_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 + curve_type: CurveType diff --git a/kittycad/models/customer.py b/kittycad/models/customer.py index 4f19bd193..43bd67419 100644 --- a/kittycad/models/customer.py +++ b/kittycad/models/customer.py @@ -1,149 +1,32 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Dict, Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel +from pydantic_extra_types.phone_number import PhoneNumber from ..models.currency import Currency from ..models.new_address import NewAddress -from ..types import UNSET, Unset - -UF = TypeVar("UF", bound="Customer") -@attr.s(auto_attribs=True) -class Customer: - """The resource representing a payment "Customer".""" # noqa: E501 +class Customer(BaseModel): + """The resource representing a payment "Customer".""" - address: Union[Unset, NewAddress] = UNSET - balance: Union[Unset, float] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - currency: Union[Unset, Currency] = UNSET - delinquent: Union[Unset, bool] = False - email: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - metadata: Union[Unset, Dict[str, str]] = UNSET - name: Union[Unset, str] = UNSET - phone: Union[Unset, str] = UNSET + address: Optional[NewAddress] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + balance: Optional[float] = None - def to_dict(self) -> Dict[str, Any]: - address: Union[Unset, NewAddress] = UNSET - if not isinstance(self.address, Unset): - address = self.address - balance = self.balance - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - currency: Union[Unset, Currency] = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency - delinquent = self.delinquent - email = self.email - id = self.id - metadata = self.metadata + created_at: datetime.datetime - name = self.name - phone = self.phone + currency: Optional[Currency] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if address is not UNSET: - _address: NewAddress = cast(NewAddress, address) - field_dict["address"] = _address.to_dict() - if balance is not UNSET: - field_dict["balance"] = balance - if created_at is not UNSET: - field_dict["created_at"] = created_at - if currency is not UNSET: - field_dict["currency"] = currency - if delinquent is not UNSET: - field_dict["delinquent"] = delinquent - if email is not UNSET: - field_dict["email"] = email - if id is not UNSET: - field_dict["id"] = id - if metadata is not UNSET: - field_dict["metadata"] = metadata - if name is not UNSET: - field_dict["name"] = name - if phone is not UNSET: - field_dict["phone"] = phone + delinquent: Optional[bool] = None - return field_dict + email: Optional[str] = None - @classmethod - def from_dict(cls: Type[UF], src_dict: Dict[str, Any]) -> UF: - d = src_dict.copy() - _address = d.pop("address", UNSET) - address: Union[Unset, NewAddress] - if isinstance(_address, Unset): - address = UNSET - if _address is None: - address = UNSET - else: - address = NewAddress.from_dict(_address) + id: Optional[str] = None - balance = d.pop("balance", UNSET) + metadata: Optional[Dict[str, str]] = None - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + name: Optional[str] = None - _currency = d.pop("currency", UNSET) - currency: Union[Unset, Currency] - if isinstance(_currency, Unset): - currency = UNSET - if _currency is None: - currency = UNSET - else: - currency = _currency - - delinquent = d.pop("delinquent", UNSET) - - email = d.pop("email", UNSET) - - id = d.pop("id", UNSET) - - metadata = d.pop("metadata", UNSET) - - name = d.pop("name", UNSET) - - phone = d.pop("phone", UNSET) - - customer = cls( - address=address, - balance=balance, - created_at=created_at, - currency=currency, - delinquent=delinquent, - email=email, - id=id, - metadata=metadata, - name=name, - phone=phone, - ) - - customer.additional_properties = d - return customer - - @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 + phone: Optional[PhoneNumber] = None diff --git a/kittycad/models/customer_balance.py b/kittycad/models/customer_balance.py index 5a5c7b233..4fcb0ae02 100644 --- a/kittycad/models/customer_balance.py +++ b/kittycad/models/customer_balance.py @@ -1,137 +1,27 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.uuid import Uuid -from ..types import UNSET, Unset - -YF = TypeVar("YF", bound="CustomerBalance") -@attr.s(auto_attribs=True) -class CustomerBalance: +class CustomerBalance(BaseModel): """A balance for a user. - This holds information about the financial balance for the user.""" # noqa: E501 + This holds information about the financial balance for the user.""" - created_at: Union[Unset, datetime.datetime] = UNSET - id: Union[Unset, str] = UNSET - monthly_credits_remaining: Union[Unset, float] = UNSET - pre_pay_cash_remaining: Union[Unset, float] = UNSET - pre_pay_credits_remaining: Union[Unset, float] = UNSET - total_due: Union[Unset, float] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + created_at: datetime.datetime - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + id: Uuid - def to_dict(self) -> Dict[str, Any]: - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - id = self.id - monthly_credits_remaining = self.monthly_credits_remaining - pre_pay_cash_remaining = self.pre_pay_cash_remaining - pre_pay_credits_remaining = self.pre_pay_credits_remaining - total_due = self.total_due - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + monthly_credits_remaining: float - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if created_at is not UNSET: - field_dict["created_at"] = created_at - if id is not UNSET: - field_dict["id"] = id - if monthly_credits_remaining is not UNSET: - field_dict["monthly_credits_remaining"] = monthly_credits_remaining - if pre_pay_cash_remaining is not UNSET: - field_dict["pre_pay_cash_remaining"] = pre_pay_cash_remaining - if pre_pay_credits_remaining is not UNSET: - field_dict["pre_pay_credits_remaining"] = pre_pay_credits_remaining - if total_due is not UNSET: - field_dict["total_due"] = total_due - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + pre_pay_cash_remaining: float - return field_dict + pre_pay_credits_remaining: float - @classmethod - def from_dict(cls: Type[YF], src_dict: Dict[str, Any]) -> YF: - d = src_dict.copy() - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + total_due: float - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + updated_at: datetime.datetime - monthly_credits_remaining = d.pop("monthly_credits_remaining", UNSET) - - pre_pay_cash_remaining = d.pop("pre_pay_cash_remaining", UNSET) - - pre_pay_credits_remaining = d.pop("pre_pay_credits_remaining", UNSET) - - total_due = d.pop("total_due", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - customer_balance = cls( - created_at=created_at, - id=id, - monthly_credits_remaining=monthly_credits_remaining, - pre_pay_cash_remaining=pre_pay_cash_remaining, - pre_pay_credits_remaining=pre_pay_credits_remaining, - total_due=total_due, - updated_at=updated_at, - user_id=user_id, - ) - - customer_balance.additional_properties = d - return customer_balance - - @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 + user_id: Uuid diff --git a/kittycad/models/density.py b/kittycad/models/density.py index 8f4d1d17f..30ba52d80 100644 --- a/kittycad/models/density.py +++ b/kittycad/models/density.py @@ -1,72 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.unit_density import UnitDensity -from ..types import UNSET, Unset - -PY = TypeVar("PY", bound="Density") -@attr.s(auto_attribs=True) -class Density: - """The density response.""" # noqa: E501 +class Density(BaseModel): + """The density response.""" - density: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitDensity] = UNSET + density: float - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - density = self.density - output_unit: Union[Unset, UnitDensity] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if density is not UNSET: - field_dict["density"] = density - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - - return field_dict - - @classmethod - def from_dict(cls: Type[PY], src_dict: Dict[str, Any]) -> PY: - d = src_dict.copy() - density = d.pop("density", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitDensity] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - density = cls( - density=density, - output_unit=output_unit, - ) - - density.additional_properties = d - return density - - @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 + output_unit: UnitDensity diff --git a/kittycad/models/device_access_token_request_form.py b/kittycad/models/device_access_token_request_form.py index 3c554962f..01ba7691b 100644 --- a/kittycad/models/device_access_token_request_form.py +++ b/kittycad/models/device_access_token_request_form.py @@ -1,79 +1,15 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from uuid import UUID -import attr +from pydantic import BaseModel from ..models.o_auth2_grant_type import OAuth2GrantType -from ..types import UNSET, Unset - -LK = TypeVar("LK", bound="DeviceAccessTokenRequestForm") -@attr.s(auto_attribs=True) -class DeviceAccessTokenRequestForm: - """The form for a device access token request.""" # noqa: E501 +class DeviceAccessTokenRequestForm(BaseModel): + """The form for a device access token request.""" - client_id: Union[Unset, str] = UNSET - device_code: Union[Unset, str] = UNSET - grant_type: Union[Unset, OAuth2GrantType] = UNSET + client_id: UUID - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + device_code: UUID - def to_dict(self) -> Dict[str, Any]: - client_id = self.client_id - device_code = self.device_code - grant_type: Union[Unset, OAuth2GrantType] = UNSET - if not isinstance(self.grant_type, Unset): - grant_type = self.grant_type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if client_id is not UNSET: - field_dict["client_id"] = client_id - if device_code is not UNSET: - field_dict["device_code"] = device_code - if grant_type is not UNSET: - field_dict["grant_type"] = grant_type - - return field_dict - - @classmethod - def from_dict(cls: Type[LK], src_dict: Dict[str, Any]) -> LK: - d = src_dict.copy() - client_id = d.pop("client_id", UNSET) - - device_code = d.pop("device_code", UNSET) - - _grant_type = d.pop("grant_type", UNSET) - grant_type: Union[Unset, OAuth2GrantType] - if isinstance(_grant_type, Unset): - grant_type = UNSET - if _grant_type is None: - grant_type = UNSET - else: - grant_type = _grant_type - - device_access_token_request_form = cls( - client_id=client_id, - device_code=device_code, - grant_type=grant_type, - ) - - device_access_token_request_form.additional_properties = d - return device_access_token_request_form - - @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 + grant_type: OAuth2GrantType diff --git a/kittycad/models/device_auth_request_form.py b/kittycad/models/device_auth_request_form.py index 1e05ec4f7..a768e46b0 100644 --- a/kittycad/models/device_auth_request_form.py +++ b/kittycad/models/device_auth_request_form.py @@ -1,55 +1,9 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -AR = TypeVar("AR", bound="DeviceAuthRequestForm") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class DeviceAuthRequestForm: - """The request parameters for the OAuth 2.0 Device Authorization Grant flow.""" # noqa: E501 +class DeviceAuthRequestForm(BaseModel): + """The request parameters for the OAuth 2.0 Device Authorization Grant flow.""" - client_id: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - client_id = self.client_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if client_id is not UNSET: - field_dict["client_id"] = client_id - - return field_dict - - @classmethod - def from_dict(cls: Type[AR], src_dict: Dict[str, Any]) -> AR: - d = src_dict.copy() - client_id = d.pop("client_id", UNSET) - - device_auth_request_form = cls( - client_id=client_id, - ) - - device_auth_request_form.additional_properties = d - return device_auth_request_form - - @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 + client_id: UUID diff --git a/kittycad/models/device_auth_verify_params.py b/kittycad/models/device_auth_verify_params.py index 663cf9b50..738bfef1f 100644 --- a/kittycad/models/device_auth_verify_params.py +++ b/kittycad/models/device_auth_verify_params.py @@ -1,55 +1,8 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -WB = TypeVar("WB", bound="DeviceAuthVerifyParams") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class DeviceAuthVerifyParams: - """The request parameters to verify the `user_code` for the OAuth 2.0 Device Authorization Grant.""" # noqa: E501 +class DeviceAuthVerifyParams(BaseModel): + """The request parameters to verify the `user_code` for the OAuth 2.0 Device Authorization Grant.""" - user_code: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - user_code = self.user_code - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if user_code is not UNSET: - field_dict["user_code"] = user_code - - return field_dict - - @classmethod - def from_dict(cls: Type[WB], src_dict: Dict[str, Any]) -> WB: - d = src_dict.copy() - user_code = d.pop("user_code", UNSET) - - device_auth_verify_params = cls( - user_code=user_code, - ) - - device_auth_verify_params.additional_properties = d - return device_auth_verify_params - - @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 + user_code: str diff --git a/kittycad/models/discount.py b/kittycad/models/discount.py index 3a5566f51..12991e1dd 100644 --- a/kittycad/models/discount.py +++ b/kittycad/models/discount.py @@ -1,66 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast -import attr +from pydantic import BaseModel from ..models.coupon import Coupon -from ..types import UNSET, Unset - -KK = TypeVar("KK", bound="Discount") -@attr.s(auto_attribs=True) -class Discount: - """The resource representing a Discount.""" # noqa: E501 +class Discount(BaseModel): + """The resource representing a Discount.""" - coupon: Union[Unset, Coupon] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - coupon: Union[Unset, Coupon] = UNSET - if not isinstance(self.coupon, Unset): - coupon = self.coupon - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if coupon is not UNSET: - _coupon: Coupon = cast(Coupon, coupon) - field_dict["coupon"] = _coupon.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[KK], src_dict: Dict[str, Any]) -> KK: - d = src_dict.copy() - _coupon = d.pop("coupon", UNSET) - coupon: Union[Unset, Coupon] - if isinstance(_coupon, Unset): - coupon = UNSET - if _coupon is None: - coupon = UNSET - else: - coupon = Coupon.from_dict(_coupon) - - discount = cls( - coupon=coupon, - ) - - discount.additional_properties = d - return discount - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + coupon: Coupon diff --git a/kittycad/models/email_authentication_form.py b/kittycad/models/email_authentication_form.py index 9e2996b7b..d52004b0f 100644 --- a/kittycad/models/email_authentication_form.py +++ b/kittycad/models/email_authentication_form.py @@ -1,62 +1,11 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -HC = TypeVar("HC", bound="EmailAuthenticationForm") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class EmailAuthenticationForm: - """The body of the form for email authentication.""" # noqa: E501 +class EmailAuthenticationForm(BaseModel): + """The body of the form for email authentication.""" - callback_url: Union[Unset, str] = UNSET - email: Union[Unset, str] = UNSET + callback_url: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - callback_url = self.callback_url - email = self.email - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if callback_url is not UNSET: - field_dict["callback_url"] = callback_url - if email is not UNSET: - field_dict["email"] = email - - return field_dict - - @classmethod - def from_dict(cls: Type[HC], src_dict: Dict[str, Any]) -> HC: - d = src_dict.copy() - callback_url = d.pop("callback_url", UNSET) - - email = d.pop("email", UNSET) - - email_authentication_form = cls( - callback_url=callback_url, - email=email, - ) - - email_authentication_form.additional_properties = d - return email_authentication_form - - @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 + email: str diff --git a/kittycad/models/entity_get_all_child_uuids.py b/kittycad/models/entity_get_all_child_uuids.py index bd27bcd51..037d58afd 100644 --- a/kittycad/models/entity_get_all_child_uuids.py +++ b/kittycad/models/entity_get_all_child_uuids.py @@ -1,57 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -FM = TypeVar("FM", bound="EntityGetAllChildUuids") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class EntityGetAllChildUuids: - """The response from the `EntityGetAllChildUuids` command.""" # noqa: E501 +class EntityGetAllChildUuids(BaseModel): + """The response from the `EntityGetAllChildUuids` command.""" - 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[FM], src_dict: Dict[str, Any]) -> FM: - 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 + entity_ids: List[UUID] diff --git a/kittycad/models/entity_get_child_uuid.py b/kittycad/models/entity_get_child_uuid.py index c4622c1b9..82c92f975 100644 --- a/kittycad/models/entity_get_child_uuid.py +++ b/kittycad/models/entity_get_child_uuid.py @@ -1,55 +1,9 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -PV = TypeVar("PV", bound="EntityGetChildUuid") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class EntityGetChildUuid: - """The response from the `EntityGetChildUuid` command.""" # noqa: E501 +class EntityGetChildUuid(BaseModel): + """The response from the `EntityGetChildUuid` command.""" - 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[PV], src_dict: Dict[str, Any]) -> PV: - 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 + entity_id: UUID diff --git a/kittycad/models/entity_get_num_children.py b/kittycad/models/entity_get_num_children.py index 37869037c..2d7a9e3b9 100644 --- a/kittycad/models/entity_get_num_children.py +++ b/kittycad/models/entity_get_num_children.py @@ -1,55 +1,8 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -QI = TypeVar("QI", bound="EntityGetNumChildren") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class EntityGetNumChildren: - """The response from the `EntityGetNumChildren` command.""" # noqa: E501 +class EntityGetNumChildren(BaseModel): + """The response from the `EntityGetNumChildren` command.""" - 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[QI], src_dict: Dict[str, Any]) -> QI: - 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 + num: int diff --git a/kittycad/models/entity_get_parent_id.py b/kittycad/models/entity_get_parent_id.py index 69b92fc0a..2d02be126 100644 --- a/kittycad/models/entity_get_parent_id.py +++ b/kittycad/models/entity_get_parent_id.py @@ -1,55 +1,9 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -TP = TypeVar("TP", bound="EntityGetParentId") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class EntityGetParentId: - """The response from the `EntityGetParentId` command.""" # noqa: E501 +class EntityGetParentId(BaseModel): + """The response from the `EntityGetParentId` command.""" - 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[TP], src_dict: Dict[str, Any]) -> TP: - 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 + entity_id: UUID diff --git a/kittycad/models/error.py b/kittycad/models/error.py index b68ce99bf..ee365a29c 100644 --- a/kittycad/models/error.py +++ b/kittycad/models/error.py @@ -1,69 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -CF = TypeVar("CF", bound="Error") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Error: - """Error information from a response.""" # noqa: E501 +class Error(BaseModel): + """Error information from a response.""" - error_code: Union[Unset, str] = UNSET - message: Union[Unset, str] = UNSET - request_id: Union[Unset, str] = UNSET + error_code: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + message: str - def to_dict(self) -> Dict[str, Any]: - error_code = self.error_code - message = self.message - request_id = self.request_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if error_code is not UNSET: - field_dict["error_code"] = error_code - if message is not UNSET: - field_dict["message"] = message - if request_id is not UNSET: - field_dict["request_id"] = request_id - - return field_dict - - @classmethod - def from_dict(cls: Type[CF], src_dict: Dict[str, Any]) -> CF: - d = src_dict.copy() - error_code = d.pop("error_code", UNSET) - - message = d.pop("message", UNSET) - - request_id = d.pop("request_id", UNSET) - - error = cls( - error_code=error_code, - message=message, - request_id=request_id, - ) - - error.additional_properties = d - return error - - @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 + request_id: str diff --git a/kittycad/models/export.py b/kittycad/models/export.py index 5796206d3..fc8f2da3a 100644 --- a/kittycad/models/export.py +++ b/kittycad/models/export.py @@ -1,63 +1,11 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -OM = TypeVar("OM", bound="Export") +from ..models.export_file import ExportFile -@attr.s(auto_attribs=True) -class Export: - """The response from the `Export` endpoint.""" # noqa: E501 +class Export(BaseModel): + """The response from the `Export` endpoint.""" - from ..models.export_file import ExportFile - - 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.export_file import ExportFile - - 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 files is not UNSET: - field_dict["files"] = files - - return field_dict - - @classmethod - def from_dict(cls: Type[OM], src_dict: Dict[str, Any]) -> OM: - d = src_dict.copy() - from ..models.export_file import ExportFile - - files = cast(List[ExportFile], d.pop("files", UNSET)) - - export = cls( - files=files, - ) - - export.additional_properties = d - return export - - @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 + files: List[ExportFile] diff --git a/kittycad/models/export_file.py b/kittycad/models/export_file.py index 35e058fd6..c38f594f9 100644 --- a/kittycad/models/export_file.py +++ b/kittycad/models/export_file.py @@ -1,70 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..models.base64data import Base64Data -from ..types import UNSET, Unset - -EN = TypeVar("EN", bound="ExportFile") +from pydantic import Base64Bytes, BaseModel -@attr.s(auto_attribs=True) -class ExportFile: - """A file to be exported to the client.""" # noqa: E501 +class ExportFile(BaseModel): + """A file to be exported to the client.""" - contents: Union[Unset, Base64Data] = UNSET - name: Union[Unset, str] = UNSET + contents: Base64Bytes - 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() - name = self.name - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if contents is not UNSET: - field_dict["contents"] = contents - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: Type[EN], src_dict: Dict[str, Any]) -> EN: - 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")) - - name = d.pop("name", UNSET) - - export_file = cls( - contents=contents, - name=name, - ) - - export_file.additional_properties = d - return export_file - - @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 + name: str diff --git a/kittycad/models/extended_user.py b/kittycad/models/extended_user.py index f0b6edf1e..9c9e6080e 100644 --- a/kittycad/models/extended_user.py +++ b/kittycad/models/extended_user.py @@ -1,194 +1,46 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel +from pydantic_extra_types.phone_number import PhoneNumber from ..models.uuid import Uuid -from ..types import UNSET, Unset - -RS = TypeVar("RS", bound="ExtendedUser") -@attr.s(auto_attribs=True) -class ExtendedUser: +class ExtendedUser(BaseModel): """Extended user information. This is mostly used for internal purposes. It returns a mapping of the user's information, including that of our third party services we use for users: MailChimp, Stripe, and Front - """ # noqa: E501 + """ - company: Union[Unset, str] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - discord: Union[Unset, str] = UNSET - email: Union[Unset, str] = UNSET - email_verified: Union[Unset, datetime.datetime] = UNSET - first_name: Union[Unset, str] = UNSET - front_id: Union[Unset, str] = UNSET - github: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - image: Union[Unset, str] = UNSET - last_name: Union[Unset, str] = UNSET - mailchimp_id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET - phone: Union[Unset, str] = UNSET - stripe_id: Union[Unset, str] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET + company: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - company = self.company - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - discord = self.discord - email = self.email - email_verified: Union[Unset, str] = UNSET - if not isinstance(self.email_verified, Unset): - email_verified = self.email_verified.isoformat() - first_name = self.first_name - front_id = self.front_id - github = self.github - id = self.id - image = self.image - last_name = self.last_name - mailchimp_id = self.mailchimp_id - name = self.name - phone = self.phone - stripe_id = self.stripe_id - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() + discord: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if company is not UNSET: - field_dict["company"] = company - if created_at is not UNSET: - field_dict["created_at"] = created_at - if discord is not UNSET: - field_dict["discord"] = discord - if email is not UNSET: - field_dict["email"] = email - if email_verified is not UNSET: - field_dict["email_verified"] = email_verified - if first_name is not UNSET: - field_dict["first_name"] = first_name - if front_id is not UNSET: - field_dict["front_id"] = front_id - if github is not UNSET: - field_dict["github"] = github - if id is not UNSET: - field_dict["id"] = id - if image is not UNSET: - field_dict["image"] = image - if last_name is not UNSET: - field_dict["last_name"] = last_name - if mailchimp_id is not UNSET: - field_dict["mailchimp_id"] = mailchimp_id - if name is not UNSET: - field_dict["name"] = name - if phone is not UNSET: - field_dict["phone"] = phone - if stripe_id is not UNSET: - field_dict["stripe_id"] = stripe_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at + email: Optional[str] = None - return field_dict + email_verified: Optional[datetime.datetime] = None - @classmethod - def from_dict(cls: Type[RS], src_dict: Dict[str, Any]) -> RS: - d = src_dict.copy() - company = d.pop("company", UNSET) + first_name: Optional[str] = None - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + front_id: Optional[str] = None - discord = d.pop("discord", UNSET) + github: Optional[str] = None - email = d.pop("email", UNSET) + id: Uuid - _email_verified = d.pop("email_verified", UNSET) - email_verified: Union[Unset, datetime.datetime] - if isinstance(_email_verified, Unset): - email_verified = UNSET - else: - email_verified = isoparse(_email_verified) + image: str - first_name = d.pop("first_name", UNSET) + last_name: Optional[str] = None - front_id = d.pop("front_id", UNSET) + mailchimp_id: Optional[str] = None - github = d.pop("github", UNSET) + name: Optional[str] = None - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + phone: Optional[PhoneNumber] = None - image = d.pop("image", UNSET) + stripe_id: Optional[str] = None - last_name = d.pop("last_name", UNSET) - - mailchimp_id = d.pop("mailchimp_id", UNSET) - - name = d.pop("name", UNSET) - - phone = d.pop("phone", UNSET) - - stripe_id = d.pop("stripe_id", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - extended_user = cls( - company=company, - created_at=created_at, - discord=discord, - email=email, - email_verified=email_verified, - first_name=first_name, - front_id=front_id, - github=github, - id=id, - image=image, - last_name=last_name, - mailchimp_id=mailchimp_id, - name=name, - phone=phone, - stripe_id=stripe_id, - updated_at=updated_at, - ) - - extended_user.additional_properties = d - return extended_user - - @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 + updated_at: datetime.datetime diff --git a/kittycad/models/extended_user_results_page.py b/kittycad/models/extended_user_results_page.py index 762941865..62d388f21 100644 --- a/kittycad/models/extended_user_results_page.py +++ b/kittycad/models/extended_user_results_page.py @@ -1,70 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List, Optional -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -LR = TypeVar("LR", bound="ExtendedUserResultsPage") +from ..models.extended_user import ExtendedUser -@attr.s(auto_attribs=True) -class ExtendedUserResultsPage: - """A single page of results""" # noqa: E501 +class ExtendedUserResultsPage(BaseModel): + """A single page of results""" - from ..models.extended_user import ExtendedUser + items: List[ExtendedUser] - items: Union[Unset, List[ExtendedUser]] = UNSET - next_page: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - from ..models.extended_user import ExtendedUser - - items: Union[Unset, List[ExtendedUser]] = UNSET - if not isinstance(self.items, Unset): - items = self.items - next_page = self.next_page - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if items is not UNSET: - field_dict["items"] = items - if next_page is not UNSET: - field_dict["next_page"] = next_page - - return field_dict - - @classmethod - def from_dict(cls: Type[LR], src_dict: Dict[str, Any]) -> LR: - d = src_dict.copy() - from ..models.extended_user import ExtendedUser - - items = cast(List[ExtendedUser], d.pop("items", UNSET)) - - next_page = d.pop("next_page", UNSET) - - extended_user_results_page = cls( - items=items, - next_page=next_page, - ) - - extended_user_results_page.additional_properties = d - return extended_user_results_page - - @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 + next_page: Optional[str] = None diff --git a/kittycad/models/failure_web_socket_response.py b/kittycad/models/failure_web_socket_response.py index 88c6fea28..a2ed081d5 100644 --- a/kittycad/models/failure_web_socket_response.py +++ b/kittycad/models/failure_web_socket_response.py @@ -1,77 +1,16 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List, Optional +from uuid import UUID -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -MP = TypeVar("MP", bound="FailureWebSocketResponse") +from ..models.api_error import ApiError -@attr.s(auto_attribs=True) -class FailureWebSocketResponse: - """Unsuccessful Websocket response.""" # noqa: E501 +class FailureWebSocketResponse(BaseModel): + """Unsuccessful Websocket response.""" - from ..models.api_error import ApiError + errors: List[ApiError] - errors: Union[Unset, List[ApiError]] = UNSET - request_id: Union[Unset, str] = UNSET - success: Union[Unset, bool] = False + request_id: Optional[UUID] = None - 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[MP], src_dict: Dict[str, Any]) -> MP: - 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 + success: bool diff --git a/kittycad/models/file_center_of_mass.py b/kittycad/models/file_center_of_mass.py index b588895e3..8dc35e0c3 100644 --- a/kittycad/models/file_center_of_mass.py +++ b/kittycad/models/file_center_of_mass.py @@ -1,211 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.file_import_format import FileImportFormat from ..models.point3d import Point3d from ..models.unit_length import UnitLength from ..models.uuid import Uuid -from ..types import UNSET, Unset - -WF = TypeVar("WF", bound="FileCenterOfMass") -@attr.s(auto_attribs=True) -class FileCenterOfMass: - """A file center of mass result.""" # noqa: E501 +class FileCenterOfMass(BaseModel): + """A file center of mass result.""" - center_of_mass: Union[Unset, Point3d] = UNSET - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - output_unit: Union[Unset, UnitLength] = UNSET - src_format: Union[Unset, FileImportFormat] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + center_of_mass: Optional[Point3d] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + completed_at: Optional[datetime.datetime] = None - def to_dict(self) -> Dict[str, Any]: - center_of_mass: Union[Unset, Point3d] = UNSET - if not isinstance(self.center_of_mass, Unset): - center_of_mass = self.center_of_mass - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - output_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + created_at: datetime.datetime - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if center_of_mass is not UNSET: - _center_of_mass: Point3d = cast(Point3d, center_of_mass) - field_dict["center_of_mass"] = _center_of_mass.to_dict() - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if src_format is not UNSET: - field_dict["src_format"] = src_format - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + error: Optional[str] = None - return field_dict + id: Uuid - @classmethod - def from_dict(cls: Type[WF], src_dict: Dict[str, Any]) -> WF: - d = src_dict.copy() - _center_of_mass = d.pop("center_of_mass", UNSET) - center_of_mass: Union[Unset, Point3d] - if isinstance(_center_of_mass, Unset): - center_of_mass = UNSET - if _center_of_mass is None: - center_of_mass = UNSET - else: - center_of_mass = Point3d.from_dict(_center_of_mass) + output_unit: UnitLength - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + src_format: FileImportFormat - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + started_at: Optional[datetime.datetime] = None - error = d.pop("error", UNSET) + status: ApiCallStatus - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + updated_at: datetime.datetime - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitLength] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileImportFormat] - if isinstance(_src_format, Unset): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - file_center_of_mass = cls( - center_of_mass=center_of_mass, - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - output_unit=output_unit, - src_format=src_format, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - file_center_of_mass.additional_properties = d - return file_center_of_mass - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/file_conversion.py b/kittycad/models/file_conversion.py index d28037d9a..74e86b119 100644 --- a/kittycad/models/file_conversion.py +++ b/kittycad/models/file_conversion.py @@ -1,251 +1,41 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Dict, Optional -import attr -from dateutil.parser import isoparse +from pydantic import Base64Bytes, BaseModel 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 from ..models.output_format import OutputFormat from ..models.uuid import Uuid -from ..types import UNSET, Unset - -RO = TypeVar("RO", bound="FileConversion") -@attr.s(auto_attribs=True) -class FileConversion: - """A file conversion.""" # noqa: E501 +class FileConversion(BaseModel): + """A file conversion.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - output_format: Union[Unset, FileExportFormat] = UNSET - output_format_options: Union[Unset, OutputFormat] = 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 - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - output_format: Union[Unset, FileExportFormat] = UNSET - if not isinstance(self.output_format, Unset): - output_format = self.output_format - output_format_options: Union[Unset, OutputFormat] = UNSET - if not isinstance(self.output_format_options, Unset): - output_format_options = self.output_format_options - 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 - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - src_format_options: Union[Unset, InputFormat] = UNSET - if not isinstance(self.src_format_options, Unset): - src_format_options = self.src_format_options - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if output_format is not UNSET: - field_dict["output_format"] = output_format - if output_format_options is not UNSET: - _output_format_options: OutputFormat = cast( - OutputFormat, output_format_options - ) - field_dict["output_format_options"] = _output_format_options.to_dict() - if outputs is not UNSET: - field_dict["outputs"] = outputs - if src_format is not UNSET: - field_dict["src_format"] = src_format - if src_format_options is not UNSET: - _src_format_options: InputFormat = cast(InputFormat, src_format_options) - field_dict["src_format_options"] = _src_format_options.to_dict() - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + output_format: FileExportFormat - @classmethod - def from_dict(cls: Type[RO], src_dict: Dict[str, Any]) -> RO: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + output_format_options: Optional[OutputFormat] = None - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + outputs: Optional[Dict[str, Base64Bytes]] = None - error = d.pop("error", UNSET) + src_format: FileImportFormat - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + src_format_options: Optional[InputFormat] = None - _output_format = d.pop("output_format", UNSET) - output_format: Union[Unset, FileExportFormat] - if isinstance(_output_format, Unset): - output_format = UNSET - if _output_format is None: - output_format = UNSET - else: - output_format = _output_format + started_at: Optional[datetime.datetime] = None - _output_format_options = d.pop("output_format_options", UNSET) - output_format_options: Union[Unset, OutputFormat] - if isinstance(_output_format_options, Unset): - output_format_options = UNSET - if _output_format_options is None: - output_format_options = UNSET - else: - output_format_options = OutputFormat.from_dict(_output_format_options) + status: ApiCallStatus - _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 + updated_at: datetime.datetime - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileImportFormat] - if isinstance(_src_format, Unset): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _src_format_options = d.pop("src_format_options", UNSET) - src_format_options: Union[Unset, InputFormat] - if isinstance(_src_format_options, Unset): - src_format_options = UNSET - if _src_format_options is None: - src_format_options = UNSET - else: - src_format_options = InputFormat.from_dict(_src_format_options) - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - file_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - output_format=output_format, - output_format_options=output_format_options, - outputs=outputs, - src_format=src_format, - src_format_options=src_format_options, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - file_conversion.additional_properties = d - return file_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/file_density.py b/kittycad/models/file_density.py index f6ab43328..ba093b5d2 100644 --- a/kittycad/models/file_density.py +++ b/kittycad/models/file_density.py @@ -1,224 +1,40 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.file_import_format import FileImportFormat from ..models.unit_density import UnitDensity from ..models.unit_mass import UnitMass from ..models.uuid import Uuid -from ..types import UNSET, Unset - -DN = TypeVar("DN", bound="FileDensity") -@attr.s(auto_attribs=True) -class FileDensity: - """A file density result.""" # noqa: E501 +class FileDensity(BaseModel): + """A file density result.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - density: Union[Unset, float] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - material_mass: Union[Unset, float] = UNSET - material_mass_unit: Union[Unset, UnitMass] = UNSET - output_unit: Union[Unset, UnitDensity] = UNSET - src_format: Union[Unset, FileImportFormat] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - density = self.density - error = self.error - id = self.id - material_mass = self.material_mass - material_mass_unit: Union[Unset, UnitMass] = UNSET - if not isinstance(self.material_mass_unit, Unset): - material_mass_unit = self.material_mass_unit - output_unit: Union[Unset, UnitDensity] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + density: Optional[float] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if density is not UNSET: - field_dict["density"] = density - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if material_mass is not UNSET: - field_dict["material_mass"] = material_mass - if material_mass_unit is not UNSET: - field_dict["material_mass_unit"] = material_mass_unit - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if src_format is not UNSET: - field_dict["src_format"] = src_format - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + error: Optional[str] = None - return field_dict + id: Uuid - @classmethod - def from_dict(cls: Type[DN], src_dict: Dict[str, Any]) -> DN: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + material_mass: Optional[float] = None - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + material_mass_unit: UnitMass - density = d.pop("density", UNSET) + output_unit: UnitDensity - error = d.pop("error", UNSET) + src_format: FileImportFormat - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - material_mass = d.pop("material_mass", UNSET) + status: ApiCallStatus - _material_mass_unit = d.pop("material_mass_unit", UNSET) - material_mass_unit: Union[Unset, UnitMass] - if isinstance(_material_mass_unit, Unset): - material_mass_unit = UNSET - if _material_mass_unit is None: - material_mass_unit = UNSET - else: - material_mass_unit = _material_mass_unit + updated_at: datetime.datetime - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitDensity] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileImportFormat] - if isinstance(_src_format, Unset): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - file_density = cls( - completed_at=completed_at, - created_at=created_at, - density=density, - error=error, - id=id, - material_mass=material_mass, - material_mass_unit=material_mass_unit, - output_unit=output_unit, - src_format=src_format, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - file_density.additional_properties = d - return file_density - - @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 + user_id: Uuid diff --git a/kittycad/models/file_mass.py b/kittycad/models/file_mass.py index 45bb856ce..81a655eaf 100644 --- a/kittycad/models/file_mass.py +++ b/kittycad/models/file_mass.py @@ -1,224 +1,40 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.file_import_format import FileImportFormat from ..models.unit_density import UnitDensity from ..models.unit_mass import UnitMass from ..models.uuid import Uuid -from ..types import UNSET, Unset - -BA = TypeVar("BA", bound="FileMass") -@attr.s(auto_attribs=True) -class FileMass: - """A file mass result.""" # noqa: E501 +class FileMass(BaseModel): + """A file mass result.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - mass: Union[Unset, float] = UNSET - material_density: Union[Unset, float] = UNSET - material_density_unit: Union[Unset, UnitDensity] = UNSET - output_unit: Union[Unset, UnitMass] = UNSET - src_format: Union[Unset, FileImportFormat] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - mass = self.mass - material_density = self.material_density - material_density_unit: Union[Unset, UnitDensity] = UNSET - if not isinstance(self.material_density_unit, Unset): - material_density_unit = self.material_density_unit - output_unit: Union[Unset, UnitMass] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if mass is not UNSET: - field_dict["mass"] = mass - if material_density is not UNSET: - field_dict["material_density"] = material_density - if material_density_unit is not UNSET: - field_dict["material_density_unit"] = material_density_unit - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if src_format is not UNSET: - field_dict["src_format"] = src_format - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + mass: Optional[float] = None - @classmethod - def from_dict(cls: Type[BA], src_dict: Dict[str, Any]) -> BA: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + material_density: Optional[float] = None - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + material_density_unit: UnitDensity - error = d.pop("error", UNSET) + output_unit: UnitMass - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + src_format: FileImportFormat - mass = d.pop("mass", UNSET) + started_at: Optional[datetime.datetime] = None - material_density = d.pop("material_density", UNSET) + status: ApiCallStatus - _material_density_unit = d.pop("material_density_unit", UNSET) - material_density_unit: Union[Unset, UnitDensity] - if isinstance(_material_density_unit, Unset): - material_density_unit = UNSET - if _material_density_unit is None: - material_density_unit = UNSET - else: - material_density_unit = _material_density_unit + updated_at: datetime.datetime - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitMass] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileImportFormat] - if isinstance(_src_format, Unset): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - file_mass = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - mass=mass, - material_density=material_density, - material_density_unit=material_density_unit, - output_unit=output_unit, - src_format=src_format, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - file_mass.additional_properties = d - return file_mass - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/file_surface_area.py b/kittycad/models/file_surface_area.py index de8783916..bce15c009 100644 --- a/kittycad/models/file_surface_area.py +++ b/kittycad/models/file_surface_area.py @@ -1,200 +1,35 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.file_import_format import FileImportFormat from ..models.unit_area import UnitArea from ..models.uuid import Uuid -from ..types import UNSET, Unset - -OR = TypeVar("OR", bound="FileSurfaceArea") -@attr.s(auto_attribs=True) -class FileSurfaceArea: - """A file surface area result.""" # noqa: E501 +class FileSurfaceArea(BaseModel): + """A file surface area result.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - output_unit: Union[Unset, UnitArea] = UNSET - src_format: Union[Unset, FileImportFormat] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - surface_area: Union[Unset, float] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - output_unit: Union[Unset, UnitArea] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - surface_area = self.surface_area - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if src_format is not UNSET: - field_dict["src_format"] = src_format - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if surface_area is not UNSET: - field_dict["surface_area"] = surface_area - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + output_unit: UnitArea - @classmethod - def from_dict(cls: Type[OR], src_dict: Dict[str, Any]) -> OR: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + src_format: FileImportFormat - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + started_at: Optional[datetime.datetime] = None - error = d.pop("error", UNSET) + status: ApiCallStatus - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + surface_area: Optional[float] = None - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitArea] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit + updated_at: datetime.datetime - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileImportFormat] - if isinstance(_src_format, Unset): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - surface_area = d.pop("surface_area", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - file_surface_area = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - output_unit=output_unit, - src_format=src_format, - started_at=started_at, - status=status, - surface_area=surface_area, - updated_at=updated_at, - user_id=user_id, - ) - - file_surface_area.additional_properties = d - return file_surface_area - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/file_system_metadata.py b/kittycad/models/file_system_metadata.py index 673a0f7d8..7771cb443 100644 --- a/kittycad/models/file_system_metadata.py +++ b/kittycad/models/file_system_metadata.py @@ -1,57 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -CB = TypeVar("CB", bound="FileSystemMetadata") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class FileSystemMetadata: +class FileSystemMetadata(BaseModel): """Metadata about our file system. - This is mostly used for internal purposes and debugging.""" # noqa: E501 + This is mostly used for internal purposes and debugging.""" - ok: Union[Unset, bool] = False - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - ok = self.ok - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if ok is not UNSET: - field_dict["ok"] = ok - - return field_dict - - @classmethod - def from_dict(cls: Type[CB], src_dict: Dict[str, Any]) -> CB: - d = src_dict.copy() - ok = d.pop("ok", UNSET) - - file_system_metadata = cls( - ok=ok, - ) - - file_system_metadata.additional_properties = d - return file_system_metadata - - @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 + ok: bool diff --git a/kittycad/models/file_volume.py b/kittycad/models/file_volume.py index bc86af3cf..68d5d065b 100644 --- a/kittycad/models/file_volume.py +++ b/kittycad/models/file_volume.py @@ -1,200 +1,35 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.file_import_format import FileImportFormat from ..models.unit_volume import UnitVolume from ..models.uuid import Uuid -from ..types import UNSET, Unset - -LC = TypeVar("LC", bound="FileVolume") -@attr.s(auto_attribs=True) -class FileVolume: - """A file volume result.""" # noqa: E501 +class FileVolume(BaseModel): + """A file volume result.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - output_unit: Union[Unset, UnitVolume] = UNSET - src_format: Union[Unset, FileImportFormat] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET - volume: Union[Unset, float] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - output_unit: Union[Unset, UnitVolume] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - src_format: Union[Unset, FileImportFormat] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id - volume = self.volume + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if src_format is not UNSET: - field_dict["src_format"] = src_format - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id - if volume is not UNSET: - field_dict["volume"] = volume + id: Uuid - return field_dict + output_unit: UnitVolume - @classmethod - def from_dict(cls: Type[LC], src_dict: Dict[str, Any]) -> LC: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + src_format: FileImportFormat - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + started_at: Optional[datetime.datetime] = None - error = d.pop("error", UNSET) + status: ApiCallStatus - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + updated_at: datetime.datetime - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitVolume] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit + user_id: Uuid - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileImportFormat] - if isinstance(_src_format, Unset): - src_format = UNSET - if _src_format is None: - src_format = UNSET - else: - src_format = _src_format - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - volume = d.pop("volume", UNSET) - - file_volume = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - output_unit=output_unit, - src_format=src_format, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - volume=volume, - ) - - file_volume.additional_properties = d - return file_volume - - @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 + volume: Optional[float] = None diff --git a/kittycad/models/gateway.py b/kittycad/models/gateway.py index 3d17fad34..b15860f7d 100644 --- a/kittycad/models/gateway.py +++ b/kittycad/models/gateway.py @@ -1,83 +1,17 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -TO = TypeVar("TO", bound="Gateway") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Gateway: - """Gateway information.""" # noqa: E501 +class Gateway(BaseModel): + """Gateway information.""" - auth_timeout: Union[Unset, int] = UNSET - host: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET - port: Union[Unset, int] = UNSET - tls_timeout: Union[Unset, int] = UNSET + auth_timeout: Optional[int] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + host: Optional[str] = None - def to_dict(self) -> Dict[str, Any]: - auth_timeout = self.auth_timeout - host = self.host - name = self.name - port = self.port - tls_timeout = self.tls_timeout + name: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if auth_timeout is not UNSET: - field_dict["auth_timeout"] = auth_timeout - if host is not UNSET: - field_dict["host"] = host - if name is not UNSET: - field_dict["name"] = name - if port is not UNSET: - field_dict["port"] = port - if tls_timeout is not UNSET: - field_dict["tls_timeout"] = tls_timeout + port: Optional[int] = None - return field_dict - - @classmethod - def from_dict(cls: Type[TO], src_dict: Dict[str, Any]) -> TO: - d = src_dict.copy() - auth_timeout = d.pop("auth_timeout", UNSET) - - host = d.pop("host", UNSET) - - name = d.pop("name", UNSET) - - port = d.pop("port", UNSET) - - tls_timeout = d.pop("tls_timeout", UNSET) - - gateway = cls( - auth_timeout=auth_timeout, - host=host, - name=name, - port=port, - tls_timeout=tls_timeout, - ) - - gateway.additional_properties = d - return gateway - - @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 + tls_timeout: Optional[int] = None diff --git a/kittycad/models/get_entity_type.py b/kittycad/models/get_entity_type.py index df84c9dff..20ecd9ad0 100644 --- a/kittycad/models/get_entity_type.py +++ b/kittycad/models/get_entity_type.py @@ -1,65 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.entity_type import EntityType -from ..types import UNSET, Unset - -ZP = TypeVar("ZP", bound="GetEntityType") -@attr.s(auto_attribs=True) -class GetEntityType: - """The response from the `GetEntityType` command.""" # noqa: E501 +class GetEntityType(BaseModel): + """The response from the `GetEntityType` command.""" - entity_type: Union[Unset, EntityType] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - entity_type: Union[Unset, EntityType] = UNSET - 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[ZP], src_dict: Dict[str, Any]) -> ZP: - d = src_dict.copy() - _entity_type = d.pop("entity_type", UNSET) - entity_type: Union[Unset, EntityType] - if isinstance(_entity_type, Unset): - entity_type = UNSET - if _entity_type is None: - entity_type = UNSET - else: - entity_type = _entity_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 + entity_type: EntityType diff --git a/kittycad/models/get_sketch_mode_plane.py b/kittycad/models/get_sketch_mode_plane.py index ea9c8ca23..88967d343 100644 --- a/kittycad/models/get_sketch_mode_plane.py +++ b/kittycad/models/get_sketch_mode_plane.py @@ -1,100 +1,14 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast -import attr +from pydantic import BaseModel from ..models.point3d import Point3d -from ..types import UNSET, Unset - -EO = TypeVar("EO", bound="GetSketchModePlane") -@attr.s(auto_attribs=True) -class GetSketchModePlane: - """The plane for sketch mode.""" # noqa: E501 +class GetSketchModePlane(BaseModel): + """The plane for sketch mode.""" - x_axis: Union[Unset, Point3d] = UNSET - y_axis: Union[Unset, Point3d] = UNSET - z_axis: Union[Unset, Point3d] = UNSET + x_axis: Point3d - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + y_axis: Point3d - def to_dict(self) -> Dict[str, Any]: - x_axis: Union[Unset, Point3d] = UNSET - if not isinstance(self.x_axis, Unset): - x_axis = self.x_axis - y_axis: Union[Unset, Point3d] = UNSET - if not isinstance(self.y_axis, Unset): - y_axis = self.y_axis - z_axis: Union[Unset, Point3d] = UNSET - if not isinstance(self.z_axis, Unset): - z_axis = self.z_axis - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if x_axis is not UNSET: - _x_axis: Point3d = cast(Point3d, x_axis) - field_dict["x_axis"] = _x_axis.to_dict() - if y_axis is not UNSET: - _y_axis: Point3d = cast(Point3d, y_axis) - field_dict["y_axis"] = _y_axis.to_dict() - if z_axis is not UNSET: - _z_axis: Point3d = cast(Point3d, z_axis) - field_dict["z_axis"] = _z_axis.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[EO], src_dict: Dict[str, Any]) -> EO: - d = src_dict.copy() - _x_axis = d.pop("x_axis", UNSET) - x_axis: Union[Unset, Point3d] - if isinstance(_x_axis, Unset): - x_axis = UNSET - if _x_axis is None: - x_axis = UNSET - else: - x_axis = Point3d.from_dict(_x_axis) - - _y_axis = d.pop("y_axis", UNSET) - y_axis: Union[Unset, Point3d] - if isinstance(_y_axis, Unset): - y_axis = UNSET - if _y_axis is None: - y_axis = UNSET - else: - y_axis = Point3d.from_dict(_y_axis) - - _z_axis = d.pop("z_axis", UNSET) - z_axis: Union[Unset, Point3d] - if isinstance(_z_axis, Unset): - z_axis = UNSET - if _z_axis is None: - z_axis = UNSET - else: - z_axis = Point3d.from_dict(_z_axis) - - get_sketch_mode_plane = cls( - x_axis=x_axis, - y_axis=y_axis, - z_axis=z_axis, - ) - - get_sketch_mode_plane.additional_properties = d - return get_sketch_mode_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 + z_axis: Point3d diff --git a/kittycad/models/highlight_set_entity.py b/kittycad/models/highlight_set_entity.py index 8f4209112..9e2e4f6cb 100644 --- a/kittycad/models/highlight_set_entity.py +++ b/kittycad/models/highlight_set_entity.py @@ -1,62 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -NY = TypeVar("NY", bound="HighlightSetEntity") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class HighlightSetEntity: - """The response from the `HighlightSetEntity` command.""" # noqa: E501 +class HighlightSetEntity(BaseModel): + """The response from the `HighlightSetEntity` command.""" - entity_id: Union[Unset, str] = UNSET - sequence: Union[Unset, int] = UNSET + entity_id: Optional[UUID] = None - 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[NY], src_dict: Dict[str, Any]) -> NY: - 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 + sequence: Optional[int] = None diff --git a/kittycad/models/ice_server.py b/kittycad/models/ice_server.py index 009b51bd0..c3788a837 100644 --- a/kittycad/models/ice_server.py +++ b/kittycad/models/ice_server.py @@ -1,71 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List, Optional -import attr - -from ..types import UNSET, Unset - -QO = TypeVar("QO", bound="IceServer") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class IceServer: - """Representation of an ICE server used for STUN/TURN Used to initiate WebRTC connections based on """ # noqa: E501 +class IceServer(BaseModel): + """Representation of an ICE server used for STUN/TURN Used to initiate WebRTC connections based on """ - credential: Union[Unset, str] = UNSET - urls: Union[Unset, List[str]] = UNSET - username: Union[Unset, str] = UNSET + credential: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + urls: List[str] - def to_dict(self) -> Dict[str, Any]: - credential = self.credential - urls: Union[Unset, List[str]] = UNSET - if not isinstance(self.urls, Unset): - urls = self.urls - username = self.username - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if credential is not UNSET: - field_dict["credential"] = credential - if urls is not UNSET: - field_dict["urls"] = urls - if username is not UNSET: - field_dict["username"] = username - - return field_dict - - @classmethod - def from_dict(cls: Type[QO], src_dict: Dict[str, Any]) -> QO: - d = src_dict.copy() - credential = d.pop("credential", UNSET) - - urls = cast(List[str], d.pop("urls", UNSET)) - - username = d.pop("username", UNSET) - - ice_server = cls( - credential=credential, - urls=urls, - username=username, - ) - - ice_server.additional_properties = d - return ice_server - - @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 + username: Optional[str] = None diff --git a/kittycad/models/import_file.py b/kittycad/models/import_file.py index 723a2de05..65174f76c 100644 --- a/kittycad/models/import_file.py +++ b/kittycad/models/import_file.py @@ -1,64 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast -import attr - -from ..types import UNSET, Unset - -KX = TypeVar("KX", bound="ImportFile") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class ImportFile: - """File to import into the current model""" # noqa: E501 +class ImportFile(BaseModel): + """File to import into the current model""" - data: Union[Unset, List[int]] = UNSET - path: Union[Unset, str] = UNSET + data: bytes - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, List[int]] = UNSET - if not isinstance(self.data, Unset): - data = self.data - path = self.path - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - field_dict["data"] = data - if path is not UNSET: - field_dict["path"] = path - - return field_dict - - @classmethod - def from_dict(cls: Type[KX], src_dict: Dict[str, Any]) -> KX: - d = src_dict.copy() - data = cast(List[int], d.pop("data", UNSET)) - - path = d.pop("path", UNSET) - - import_file = cls( - data=data, - path=path, - ) - - import_file.additional_properties = d - return import_file - - @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 + path: str diff --git a/kittycad/models/import_files.py b/kittycad/models/import_files.py index 4bf1578c9..f6c77c5ee 100644 --- a/kittycad/models/import_files.py +++ b/kittycad/models/import_files.py @@ -1,55 +1,9 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -IZ = TypeVar("IZ", bound="ImportFiles") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class ImportFiles: - """Data from importing the files""" # noqa: E501 +class ImportFiles(BaseModel): + """Data from importing the files""" - object_id: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - object_id = self.object_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if object_id is not UNSET: - field_dict["object_id"] = object_id - - return field_dict - - @classmethod - def from_dict(cls: Type[IZ], src_dict: Dict[str, Any]) -> IZ: - d = src_dict.copy() - object_id = d.pop("object_id", UNSET) - - import_files = cls( - object_id=object_id, - ) - - import_files.additional_properties = d - return import_files - - @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 + object_id: UUID diff --git a/kittycad/models/input_format.py b/kittycad/models/input_format.py index e7bfe0370..b104df4ec 100644 --- a/kittycad/models/input_format.py +++ b/kittycad/models/input_format.py @@ -1,458 +1,65 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, Dict, Type, TypeVar, Union import attr +from pydantic import BaseModel, GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema from ..models.system import System from ..models.unit_length import UnitLength -from ..types import UNSET, Unset - -WO = TypeVar("WO", bound="fbx") -@attr.s(auto_attribs=True) -class fbx: - """Autodesk Filmbox (FBX) format.""" # noqa: E501 +class fbx(BaseModel): + """Autodesk Filmbox (FBX) format.""" 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[WO], src_dict: Dict[str, Any]) -> WO: - 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 - - -NK = TypeVar("NK", bound="gltf") - - -@attr.s(auto_attribs=True) -class gltf: - """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).""" # noqa: E501 +class gltf(BaseModel): + """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).""" type: str = "gltf" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - type = self.type +class obj(BaseModel): + """Wavefront OBJ format.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type + coords: System - return field_dict - - @classmethod - def from_dict(cls: Type[NK], src_dict: Dict[str, Any]) -> NK: - d = src_dict.copy() - type = d.pop("type", UNSET) - - gltf = cls( - type=type, - ) - - gltf.additional_properties = d - return gltf - - @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 - - -UQ = TypeVar("UQ", bound="obj") - - -@attr.s(auto_attribs=True) -class obj: - """Wavefront OBJ format.""" # noqa: E501 - - coords: Union[Unset, System] = UNSET type: str = "obj" - units: Union[Unset, UnitLength] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - coords: Union[Unset, System] = UNSET - if not isinstance(self.coords, Unset): - coords = self.coords - type = self.type - units: Union[Unset, UnitLength] = UNSET - if not isinstance(self.units, Unset): - units = self.units - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if coords is not UNSET: - _coords: System = cast(System, coords) - field_dict["coords"] = _coords.to_dict() - field_dict["type"] = type - if units is not UNSET: - field_dict["units"] = units - - return field_dict - - @classmethod - def from_dict(cls: Type[UQ], src_dict: Dict[str, Any]) -> UQ: - d = src_dict.copy() - _coords = d.pop("coords", UNSET) - coords: Union[Unset, System] - if isinstance(_coords, Unset): - coords = UNSET - if _coords is None: - coords = UNSET - else: - coords = System.from_dict(_coords) - - type = d.pop("type", UNSET) - - _units = d.pop("units", UNSET) - units: Union[Unset, UnitLength] - if isinstance(_units, Unset): - units = UNSET - if _units is None: - units = UNSET - else: - units = _units - - obj = cls( - coords=coords, - type=type, - units=units, - ) - - obj.additional_properties = d - return obj - - @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 + units: UnitLength -QE = TypeVar("QE", bound="ply") +class ply(BaseModel): + """The PLY Polygon File Format.""" + coords: System -@attr.s(auto_attribs=True) -class ply: - """The PLY Polygon File Format.""" # noqa: E501 - - coords: Union[Unset, System] = UNSET type: str = "ply" - units: Union[Unset, UnitLength] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - coords: Union[Unset, System] = UNSET - if not isinstance(self.coords, Unset): - coords = self.coords - type = self.type - units: Union[Unset, UnitLength] = UNSET - if not isinstance(self.units, Unset): - units = self.units - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if coords is not UNSET: - _coords: System = cast(System, coords) - field_dict["coords"] = _coords.to_dict() - field_dict["type"] = type - if units is not UNSET: - field_dict["units"] = units - - return field_dict - - @classmethod - def from_dict(cls: Type[QE], src_dict: Dict[str, Any]) -> QE: - d = src_dict.copy() - _coords = d.pop("coords", UNSET) - coords: Union[Unset, System] - if isinstance(_coords, Unset): - coords = UNSET - if _coords is None: - coords = UNSET - else: - coords = System.from_dict(_coords) - - type = d.pop("type", UNSET) - - _units = d.pop("units", UNSET) - units: Union[Unset, UnitLength] - if isinstance(_units, Unset): - units = UNSET - if _units is None: - units = UNSET - else: - units = _units - - ply = cls( - coords=coords, - type=type, - units=units, - ) - - ply.additional_properties = d - return ply - - @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 + units: UnitLength -XH = TypeVar("XH", bound="sldprt") - - -@attr.s(auto_attribs=True) -class sldprt: - """SolidWorks part (SLDPRT) format.""" # noqa: E501 +class sldprt(BaseModel): + """SolidWorks part (SLDPRT) format.""" type: str = "sldprt" - 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[XH], src_dict: Dict[str, Any]) -> XH: - d = src_dict.copy() - type = d.pop("type", UNSET) - - sldprt = cls( - type=type, - ) - - sldprt.additional_properties = d - return sldprt - - @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 - - -KT = TypeVar("KT", bound="step") - - -@attr.s(auto_attribs=True) -class step: - """ISO 10303-21 (STEP) format.""" # noqa: E501 +class step(BaseModel): + """ISO 10303-21 (STEP) format.""" type: str = "step" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - type = self.type +class stl(BaseModel): + """*ST**ereo**L**ithography format.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type + coords: System - return field_dict - - @classmethod - def from_dict(cls: Type[KT], src_dict: Dict[str, Any]) -> KT: - d = src_dict.copy() - type = d.pop("type", UNSET) - - step = cls( - type=type, - ) - - step.additional_properties = d - return step - - @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="stl") - - -@attr.s(auto_attribs=True) -class stl: - """*ST**ereo**L**ithography format.""" # noqa: E501 - - coords: Union[Unset, System] = UNSET type: str = "stl" - units: Union[Unset, UnitLength] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - coords: Union[Unset, System] = UNSET - if not isinstance(self.coords, Unset): - coords = self.coords - type = self.type - units: Union[Unset, UnitLength] = UNSET - if not isinstance(self.units, Unset): - units = self.units - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if coords is not UNSET: - _coords: System = cast(System, coords) - field_dict["coords"] = _coords.to_dict() - field_dict["type"] = type - if units is not UNSET: - field_dict["units"] = units - - return field_dict - - @classmethod - def from_dict(cls: Type[BV], src_dict: Dict[str, Any]) -> BV: - d = src_dict.copy() - _coords = d.pop("coords", UNSET) - coords: Union[Unset, System] - if isinstance(_coords, Unset): - coords = UNSET - if _coords is None: - coords = UNSET - else: - coords = System.from_dict(_coords) - - type = d.pop("type", UNSET) - - _units = d.pop("units", UNSET) - units: Union[Unset, UnitLength] - if isinstance(_units, Unset): - units = UNSET - if _units is None: - units = UNSET - else: - units = _units - - stl = cls( - coords=coords, - type=type, - units=units, - ) - - stl.additional_properties = d - return stl - - @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 + units: UnitLength GY = TypeVar("GY", bound="InputFormat") @@ -487,60 +94,72 @@ class InputFormat: ): self.type = type - def to_dict(self) -> Dict[str, Any]: + def model_dump(self) -> Dict[str, Any]: if isinstance(self.type, fbx): - GU: fbx = self.type - return GU.to_dict() + JV: fbx = self.type + return JV.model_dump() elif isinstance(self.type, gltf): - UP: gltf = self.type - return UP.to_dict() + FV: gltf = self.type + return FV.model_dump() elif isinstance(self.type, obj): - DJ: obj = self.type - return DJ.to_dict() + OY: obj = self.type + return OY.model_dump() elif isinstance(self.type, ply): - TR: ply = self.type - return TR.to_dict() + TM: ply = self.type + return TM.model_dump() elif isinstance(self.type, sldprt): - JF: sldprt = self.type - return JF.to_dict() + AH: sldprt = self.type + return AH.model_dump() elif isinstance(self.type, step): - EL: step = self.type - return EL.to_dict() + JR: step = self.type + return JR.model_dump() elif isinstance(self.type, stl): - LF: stl = self.type - return LF.to_dict() + HK: stl = self.type + return HK.model_dump() raise Exception("Unknown type") @classmethod def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY: if d.get("type") == "fbx": - SS: fbx = fbx() - SS.from_dict(d) - return cls(type=SS) + IO: fbx = fbx(**d) + return cls(type=IO) elif d.get("type") == "gltf": - AZ: gltf = gltf() - AZ.from_dict(d) - return cls(type=AZ) + LE: gltf = gltf(**d) + return cls(type=LE) elif d.get("type") == "obj": - WJ: obj = obj() - WJ.from_dict(d) - return cls(type=WJ) + HO: obj = obj(**d) + return cls(type=HO) elif d.get("type") == "ply": - YD: ply = ply() - YD.from_dict(d) - return cls(type=YD) + BS: ply = ply(**d) + return cls(type=BS) elif d.get("type") == "sldprt": - VP: sldprt = sldprt() - VP.from_dict(d) - return cls(type=VP) + EG: sldprt = sldprt(**d) + return cls(type=EG) elif d.get("type") == "step": - ZG: step = step() - ZG.from_dict(d) - return cls(type=ZG) + LY: step = step(**d) + return cls(type=LY) elif d.get("type") == "stl": - CS: stl = stl() - CS.from_dict(d) - return cls(type=CS) + VR: stl = stl(**d) + return cls(type=VR) raise Exception("Unknown type") + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function( + cls, + handler( + Union[ + fbx, + gltf, + obj, + ply, + sldprt, + step, + stl, + ] + ), + ) diff --git a/kittycad/models/invoice.py b/kittycad/models/invoice.py index 85f514198..570a02953 100644 --- a/kittycad/models/invoice.py +++ b/kittycad/models/invoice.py @@ -1,269 +1,63 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Dict, List, Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.currency import Currency +from ..models.discount import Discount +from ..models.invoice_line_item import InvoiceLineItem from ..models.invoice_status import InvoiceStatus -from ..types import UNSET, Unset - -GN = TypeVar("GN", bound="Invoice") -@attr.s(auto_attribs=True) -class Invoice: - """An invoice.""" # noqa: E501 +class Invoice(BaseModel): + """An invoice.""" - amount_due: Union[Unset, float] = UNSET - amount_paid: Union[Unset, float] = UNSET - amount_remaining: Union[Unset, float] = UNSET - attempt_count: Union[Unset, int] = UNSET - attempted: Union[Unset, bool] = False - created_at: Union[Unset, datetime.datetime] = UNSET - currency: Union[Unset, Currency] = UNSET - customer_email: Union[Unset, str] = UNSET - customer_id: Union[Unset, str] = UNSET - default_payment_method: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - from ..models.discount import Discount + amount_due: Optional[float] = None - discounts: Union[Unset, List[Discount]] = UNSET - id: Union[Unset, str] = UNSET - from ..models.invoice_line_item import InvoiceLineItem + amount_paid: Optional[float] = None - lines: Union[Unset, List[InvoiceLineItem]] = UNSET - metadata: Union[Unset, Dict[str, str]] = UNSET - number: Union[Unset, str] = UNSET - paid: Union[Unset, bool] = False - pdf: Union[Unset, str] = UNSET - receipt_number: Union[Unset, str] = UNSET - statement_descriptor: Union[Unset, str] = UNSET - status: Union[Unset, InvoiceStatus] = UNSET - subtotal: Union[Unset, float] = UNSET - tax: Union[Unset, float] = UNSET - total: Union[Unset, float] = UNSET - url: Union[Unset, str] = UNSET + amount_remaining: Optional[float] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + attempt_count: Optional[int] = None - def to_dict(self) -> Dict[str, Any]: - amount_due = self.amount_due - amount_paid = self.amount_paid - amount_remaining = self.amount_remaining - attempt_count = self.attempt_count - attempted = self.attempted - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - currency: Union[Unset, Currency] = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency - customer_email = self.customer_email - customer_id = self.customer_id - default_payment_method = self.default_payment_method - description = self.description - from ..models.discount import Discount + attempted: Optional[bool] = None - discounts: Union[Unset, List[Discount]] = UNSET - if not isinstance(self.discounts, Unset): - discounts = self.discounts - id = self.id - from ..models.invoice_line_item import InvoiceLineItem + created_at: datetime.datetime - lines: Union[Unset, List[InvoiceLineItem]] = UNSET - if not isinstance(self.lines, Unset): - lines = self.lines - metadata = self.metadata + currency: Optional[Currency] = None - number = self.number - paid = self.paid - pdf = self.pdf - receipt_number = self.receipt_number - statement_descriptor = self.statement_descriptor - status: Union[Unset, InvoiceStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - subtotal = self.subtotal - tax = self.tax - total = self.total - url = self.url + customer_email: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if amount_due is not UNSET: - field_dict["amount_due"] = amount_due - if amount_paid is not UNSET: - field_dict["amount_paid"] = amount_paid - if amount_remaining is not UNSET: - field_dict["amount_remaining"] = amount_remaining - if attempt_count is not UNSET: - field_dict["attempt_count"] = attempt_count - if attempted is not UNSET: - field_dict["attempted"] = attempted - if created_at is not UNSET: - field_dict["created_at"] = created_at - if currency is not UNSET: - field_dict["currency"] = currency - if customer_email is not UNSET: - field_dict["customer_email"] = customer_email - if customer_id is not UNSET: - field_dict["customer_id"] = customer_id - if default_payment_method is not UNSET: - field_dict["default_payment_method"] = default_payment_method - if description is not UNSET: - field_dict["description"] = description - if discounts is not UNSET: - field_dict["discounts"] = discounts - if id is not UNSET: - field_dict["id"] = id - if lines is not UNSET: - field_dict["lines"] = lines - if metadata is not UNSET: - field_dict["metadata"] = metadata - if number is not UNSET: - field_dict["number"] = number - if paid is not UNSET: - field_dict["paid"] = paid - if pdf is not UNSET: - field_dict["pdf"] = pdf - if receipt_number is not UNSET: - field_dict["receipt_number"] = receipt_number - if statement_descriptor is not UNSET: - field_dict["statement_descriptor"] = statement_descriptor - if status is not UNSET: - field_dict["status"] = status - if subtotal is not UNSET: - field_dict["subtotal"] = subtotal - if tax is not UNSET: - field_dict["tax"] = tax - if total is not UNSET: - field_dict["total"] = total - if url is not UNSET: - field_dict["url"] = url + customer_id: Optional[str] = None - return field_dict + default_payment_method: Optional[str] = None - @classmethod - def from_dict(cls: Type[GN], src_dict: Dict[str, Any]) -> GN: - d = src_dict.copy() - amount_due = d.pop("amount_due", UNSET) + description: Optional[str] = None - amount_paid = d.pop("amount_paid", UNSET) + discounts: Optional[List[Discount]] = None - amount_remaining = d.pop("amount_remaining", UNSET) + id: Optional[str] = None - attempt_count = d.pop("attempt_count", UNSET) + lines: Optional[List[InvoiceLineItem]] = None - attempted = d.pop("attempted", UNSET) + metadata: Optional[Dict[str, str]] = None - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + number: Optional[str] = None - _currency = d.pop("currency", UNSET) - currency: Union[Unset, Currency] - if isinstance(_currency, Unset): - currency = UNSET - if _currency is None: - currency = UNSET - else: - currency = _currency + paid: Optional[bool] = None - customer_email = d.pop("customer_email", UNSET) + pdf: Optional[str] = None - customer_id = d.pop("customer_id", UNSET) + receipt_number: Optional[str] = None - default_payment_method = d.pop("default_payment_method", UNSET) + statement_descriptor: Optional[str] = None - description = d.pop("description", UNSET) + status: Optional[InvoiceStatus] = None - from ..models.discount import Discount + subtotal: Optional[float] = None - discounts = cast(List[Discount], d.pop("discounts", UNSET)) + tax: Optional[float] = None - id = d.pop("id", UNSET) + total: Optional[float] = None - from ..models.invoice_line_item import InvoiceLineItem - - lines = cast(List[InvoiceLineItem], d.pop("lines", UNSET)) - - metadata = d.pop("metadata", UNSET) - - number = d.pop("number", UNSET) - - paid = d.pop("paid", UNSET) - - pdf = d.pop("pdf", UNSET) - - receipt_number = d.pop("receipt_number", UNSET) - - statement_descriptor = d.pop("statement_descriptor", UNSET) - - _status = d.pop("status", UNSET) - status: Union[Unset, InvoiceStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - subtotal = d.pop("subtotal", UNSET) - - tax = d.pop("tax", UNSET) - - total = d.pop("total", UNSET) - - url = d.pop("url", UNSET) - - invoice = cls( - amount_due=amount_due, - amount_paid=amount_paid, - amount_remaining=amount_remaining, - attempt_count=attempt_count, - attempted=attempted, - created_at=created_at, - currency=currency, - customer_email=customer_email, - customer_id=customer_id, - default_payment_method=default_payment_method, - description=description, - discounts=discounts, - id=id, - lines=lines, - metadata=metadata, - number=number, - paid=paid, - pdf=pdf, - receipt_number=receipt_number, - statement_descriptor=statement_descriptor, - status=status, - subtotal=subtotal, - tax=tax, - total=total, - url=url, - ) - - invoice.additional_properties = d - return invoice - - @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 + url: Optional[str] = None diff --git a/kittycad/models/invoice_line_item.py b/kittycad/models/invoice_line_item.py index 466b4ae5b..04c670694 100644 --- a/kittycad/models/invoice_line_item.py +++ b/kittycad/models/invoice_line_item.py @@ -1,100 +1,21 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Dict, Optional -import attr +from pydantic import BaseModel from ..models.currency import Currency -from ..types import UNSET, Unset - -GD = TypeVar("GD", bound="InvoiceLineItem") -@attr.s(auto_attribs=True) -class InvoiceLineItem: - """An invoice line item.""" # noqa: E501 +class InvoiceLineItem(BaseModel): + """An invoice line item.""" - amount: Union[Unset, float] = UNSET - currency: Union[Unset, Currency] = UNSET - description: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - invoice_item: Union[Unset, str] = UNSET - metadata: Union[Unset, Dict[str, str]] = UNSET + amount: Optional[float] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + currency: Optional[Currency] = None - def to_dict(self) -> Dict[str, Any]: - amount = self.amount - currency: Union[Unset, Currency] = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency - description = self.description - id = self.id - invoice_item = self.invoice_item - metadata = self.metadata + description: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if amount is not UNSET: - field_dict["amount"] = amount - if currency is not UNSET: - field_dict["currency"] = currency - if description is not UNSET: - field_dict["description"] = description - if id is not UNSET: - field_dict["id"] = id - if invoice_item is not UNSET: - field_dict["invoice_item"] = invoice_item - if metadata is not UNSET: - field_dict["metadata"] = metadata + id: Optional[str] = None - return field_dict + invoice_item: Optional[str] = None - @classmethod - def from_dict(cls: Type[GD], src_dict: Dict[str, Any]) -> GD: - d = src_dict.copy() - amount = d.pop("amount", UNSET) - - _currency = d.pop("currency", UNSET) - currency: Union[Unset, Currency] - if isinstance(_currency, Unset): - currency = UNSET - if _currency is None: - currency = UNSET - else: - currency = _currency - - description = d.pop("description", UNSET) - - id = d.pop("id", UNSET) - - invoice_item = d.pop("invoice_item", UNSET) - - metadata = d.pop("metadata", UNSET) - - invoice_line_item = cls( - amount=amount, - currency=currency, - description=description, - id=id, - invoice_item=invoice_item, - metadata=metadata, - ) - - invoice_line_item.additional_properties = d - return invoice_line_item - - @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 + metadata: Optional[Dict[str, str]] = None diff --git a/kittycad/models/jetstream.py b/kittycad/models/jetstream.py index 64ade3034..90c44a49e 100644 --- a/kittycad/models/jetstream.py +++ b/kittycad/models/jetstream.py @@ -1,102 +1,17 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Optional -import attr +from pydantic import BaseModel from ..models.jetstream_config import JetstreamConfig from ..models.jetstream_stats import JetstreamStats from ..models.meta_cluster_info import MetaClusterInfo -from ..types import UNSET, Unset - -VJ = TypeVar("VJ", bound="Jetstream") -@attr.s(auto_attribs=True) -class Jetstream: - """Jetstream information.""" # noqa: E501 +class Jetstream(BaseModel): + """Jetstream information.""" - config: Union[Unset, JetstreamConfig] = UNSET - meta: Union[Unset, MetaClusterInfo] = UNSET - stats: Union[Unset, JetstreamStats] = UNSET + config: Optional[JetstreamConfig] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + meta: Optional[MetaClusterInfo] = None - def to_dict(self) -> Dict[str, Any]: - config: Union[Unset, JetstreamConfig] = UNSET - if not isinstance(self.config, Unset): - config = self.config - meta: Union[Unset, MetaClusterInfo] = UNSET - if not isinstance(self.meta, Unset): - meta = self.meta - stats: Union[Unset, JetstreamStats] = UNSET - if not isinstance(self.stats, Unset): - stats = self.stats - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if config is not UNSET: - _config: JetstreamConfig = cast(JetstreamConfig, config) - field_dict["config"] = _config.to_dict() - if meta is not UNSET: - _meta: MetaClusterInfo = cast(MetaClusterInfo, meta) - field_dict["meta"] = _meta.to_dict() - if stats is not UNSET: - _stats: JetstreamStats = cast(JetstreamStats, stats) - field_dict["stats"] = _stats.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[VJ], src_dict: Dict[str, Any]) -> VJ: - d = src_dict.copy() - _config = d.pop("config", UNSET) - config: Union[Unset, JetstreamConfig] - if isinstance(_config, Unset): - config = UNSET - if _config is None: - config = UNSET - else: - config = JetstreamConfig.from_dict(_config) - - _meta = d.pop("meta", UNSET) - meta: Union[Unset, MetaClusterInfo] - if isinstance(_meta, Unset): - meta = UNSET - if _meta is None: - meta = UNSET - else: - meta = MetaClusterInfo.from_dict(_meta) - - _stats = d.pop("stats", UNSET) - stats: Union[Unset, JetstreamStats] - if isinstance(_stats, Unset): - stats = UNSET - if _stats is None: - stats = UNSET - else: - stats = JetstreamStats.from_dict(_stats) - - jetstream = cls( - config=config, - meta=meta, - stats=stats, - ) - - jetstream.additional_properties = d - return jetstream - - @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 + stats: Optional[JetstreamStats] = None diff --git a/kittycad/models/jetstream_api_stats.py b/kittycad/models/jetstream_api_stats.py index dc93e4200..e155a27a7 100644 --- a/kittycad/models/jetstream_api_stats.py +++ b/kittycad/models/jetstream_api_stats.py @@ -1,69 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -OX = TypeVar("OX", bound="JetstreamApiStats") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class JetstreamApiStats: - """Jetstream API statistics.""" # noqa: E501 +class JetstreamApiStats(BaseModel): + """Jetstream API statistics.""" - errors: Union[Unset, int] = UNSET - inflight: Union[Unset, int] = UNSET - total: Union[Unset, int] = UNSET + errors: Optional[int] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + inflight: Optional[int] = None - def to_dict(self) -> Dict[str, Any]: - errors = self.errors - inflight = self.inflight - total = self.total - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if errors is not UNSET: - field_dict["errors"] = errors - if inflight is not UNSET: - field_dict["inflight"] = inflight - if total is not UNSET: - field_dict["total"] = total - - return field_dict - - @classmethod - def from_dict(cls: Type[OX], src_dict: Dict[str, Any]) -> OX: - d = src_dict.copy() - errors = d.pop("errors", UNSET) - - inflight = d.pop("inflight", UNSET) - - total = d.pop("total", UNSET) - - jetstream_api_stats = cls( - errors=errors, - inflight=inflight, - total=total, - ) - - jetstream_api_stats.additional_properties = d - return jetstream_api_stats - - @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 + total: Optional[int] = None diff --git a/kittycad/models/jetstream_config.py b/kittycad/models/jetstream_config.py index 37c67366c..dd2e310f6 100644 --- a/kittycad/models/jetstream_config.py +++ b/kittycad/models/jetstream_config.py @@ -1,76 +1,15 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -YW = TypeVar("YW", bound="JetstreamConfig") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class JetstreamConfig: - """Jetstream configuration.""" # noqa: E501 +class JetstreamConfig(BaseModel): + """Jetstream configuration.""" - domain: Union[Unset, str] = UNSET - max_memory: Union[Unset, int] = UNSET - max_storage: Union[Unset, int] = UNSET - store_dir: Union[Unset, str] = UNSET + domain: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + max_memory: Optional[int] = None - def to_dict(self) -> Dict[str, Any]: - domain = self.domain - max_memory = self.max_memory - max_storage = self.max_storage - store_dir = self.store_dir + max_storage: Optional[int] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if domain is not UNSET: - field_dict["domain"] = domain - if max_memory is not UNSET: - field_dict["max_memory"] = max_memory - if max_storage is not UNSET: - field_dict["max_storage"] = max_storage - if store_dir is not UNSET: - field_dict["store_dir"] = store_dir - - return field_dict - - @classmethod - def from_dict(cls: Type[YW], src_dict: Dict[str, Any]) -> YW: - d = src_dict.copy() - domain = d.pop("domain", UNSET) - - max_memory = d.pop("max_memory", UNSET) - - max_storage = d.pop("max_storage", UNSET) - - store_dir = d.pop("store_dir", UNSET) - - jetstream_config = cls( - domain=domain, - max_memory=max_memory, - max_storage=max_storage, - store_dir=store_dir, - ) - - jetstream_config.additional_properties = d - return jetstream_config - - @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 + store_dir: Optional[str] = None diff --git a/kittycad/models/jetstream_stats.py b/kittycad/models/jetstream_stats.py index 0c6b36f43..f30faab61 100644 --- a/kittycad/models/jetstream_stats.py +++ b/kittycad/models/jetstream_stats.py @@ -1,108 +1,23 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Optional -import attr +from pydantic import BaseModel from ..models.jetstream_api_stats import JetstreamApiStats -from ..types import UNSET, Unset - -QX = TypeVar("QX", bound="JetstreamStats") -@attr.s(auto_attribs=True) -class JetstreamStats: - """Jetstream statistics.""" # noqa: E501 +class JetstreamStats(BaseModel): + """Jetstream statistics.""" - accounts: Union[Unset, int] = UNSET - api: Union[Unset, JetstreamApiStats] = UNSET - ha_assets: Union[Unset, int] = UNSET - memory: Union[Unset, int] = UNSET - reserved_memory: Union[Unset, int] = UNSET - reserved_store: Union[Unset, int] = UNSET - store: Union[Unset, int] = UNSET + accounts: Optional[int] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + api: Optional[JetstreamApiStats] = None - def to_dict(self) -> Dict[str, Any]: - accounts = self.accounts - api: Union[Unset, JetstreamApiStats] = UNSET - if not isinstance(self.api, Unset): - api = self.api - ha_assets = self.ha_assets - memory = self.memory - reserved_memory = self.reserved_memory - reserved_store = self.reserved_store - store = self.store + ha_assets: Optional[int] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if accounts is not UNSET: - field_dict["accounts"] = accounts - if api is not UNSET: - _api: JetstreamApiStats = cast(JetstreamApiStats, api) - field_dict["api"] = _api.to_dict() - if ha_assets is not UNSET: - field_dict["ha_assets"] = ha_assets - if memory is not UNSET: - field_dict["memory"] = memory - if reserved_memory is not UNSET: - field_dict["reserved_memory"] = reserved_memory - if reserved_store is not UNSET: - field_dict["reserved_store"] = reserved_store - if store is not UNSET: - field_dict["store"] = store + memory: Optional[int] = None - return field_dict + reserved_memory: Optional[int] = None - @classmethod - def from_dict(cls: Type[QX], src_dict: Dict[str, Any]) -> QX: - d = src_dict.copy() - accounts = d.pop("accounts", UNSET) + reserved_store: Optional[int] = None - _api = d.pop("api", UNSET) - api: Union[Unset, JetstreamApiStats] - if isinstance(_api, Unset): - api = UNSET - if _api is None: - api = UNSET - else: - api = JetstreamApiStats.from_dict(_api) - - ha_assets = d.pop("ha_assets", UNSET) - - memory = d.pop("memory", UNSET) - - reserved_memory = d.pop("reserved_memory", UNSET) - - reserved_store = d.pop("reserved_store", UNSET) - - store = d.pop("store", UNSET) - - jetstream_stats = cls( - accounts=accounts, - api=api, - ha_assets=ha_assets, - memory=memory, - reserved_memory=reserved_memory, - reserved_store=reserved_store, - store=store, - ) - - jetstream_stats.additional_properties = d - return jetstream_stats - - @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 + store: Optional[int] = None diff --git a/kittycad/models/leaf_node.py b/kittycad/models/leaf_node.py index 7f1140b35..2315d2e6e 100644 --- a/kittycad/models/leaf_node.py +++ b/kittycad/models/leaf_node.py @@ -1,76 +1,15 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -NO = TypeVar("NO", bound="LeafNode") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class LeafNode: - """Leaf node information.""" # noqa: E501 +class LeafNode(BaseModel): + """Leaf node information.""" - auth_timeout: Union[Unset, int] = UNSET - host: Union[Unset, str] = UNSET - port: Union[Unset, int] = UNSET - tls_timeout: Union[Unset, int] = UNSET + auth_timeout: Optional[int] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + host: Optional[str] = None - def to_dict(self) -> Dict[str, Any]: - auth_timeout = self.auth_timeout - host = self.host - port = self.port - tls_timeout = self.tls_timeout + port: Optional[int] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if auth_timeout is not UNSET: - field_dict["auth_timeout"] = auth_timeout - if host is not UNSET: - field_dict["host"] = host - if port is not UNSET: - field_dict["port"] = port - if tls_timeout is not UNSET: - field_dict["tls_timeout"] = tls_timeout - - return field_dict - - @classmethod - def from_dict(cls: Type[NO], src_dict: Dict[str, Any]) -> NO: - d = src_dict.copy() - auth_timeout = d.pop("auth_timeout", UNSET) - - host = d.pop("host", UNSET) - - port = d.pop("port", UNSET) - - tls_timeout = d.pop("tls_timeout", UNSET) - - leaf_node = cls( - auth_timeout=auth_timeout, - host=host, - port=port, - tls_timeout=tls_timeout, - ) - - leaf_node.additional_properties = d - return leaf_node - - @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 + tls_timeout: Optional[int] = None diff --git a/kittycad/models/mass.py b/kittycad/models/mass.py index 32e5d2381..7ae2615d1 100644 --- a/kittycad/models/mass.py +++ b/kittycad/models/mass.py @@ -1,72 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.unit_mass import UnitMass -from ..types import UNSET, Unset - -VX = TypeVar("VX", bound="Mass") -@attr.s(auto_attribs=True) -class Mass: - """The mass response.""" # noqa: E501 +class Mass(BaseModel): + """The mass response.""" - mass: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitMass] = UNSET + mass: float - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - mass = self.mass - output_unit: Union[Unset, UnitMass] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if mass is not UNSET: - field_dict["mass"] = mass - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - - return field_dict - - @classmethod - def from_dict(cls: Type[VX], src_dict: Dict[str, Any]) -> VX: - d = src_dict.copy() - mass = d.pop("mass", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitMass] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - mass = cls( - mass=mass, - output_unit=output_unit, - ) - - mass.additional_properties = d - return mass - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + output_unit: UnitMass diff --git a/kittycad/models/meta_cluster_info.py b/kittycad/models/meta_cluster_info.py index c6ee667ea..97e08a8fa 100644 --- a/kittycad/models/meta_cluster_info.py +++ b/kittycad/models/meta_cluster_info.py @@ -1,69 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -RG = TypeVar("RG", bound="MetaClusterInfo") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class MetaClusterInfo: - """Jetstream statistics.""" # noqa: E501 +class MetaClusterInfo(BaseModel): + """Jetstream statistics.""" - cluster_size: Union[Unset, int] = UNSET - leader: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + cluster_size: Optional[int] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + leader: Optional[str] = None - def to_dict(self) -> Dict[str, Any]: - cluster_size = self.cluster_size - leader = self.leader - name = self.name - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if cluster_size is not UNSET: - field_dict["cluster_size"] = cluster_size - if leader is not UNSET: - field_dict["leader"] = leader - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: Type[RG], src_dict: Dict[str, Any]) -> RG: - d = src_dict.copy() - cluster_size = d.pop("cluster_size", UNSET) - - leader = d.pop("leader", UNSET) - - name = d.pop("name", UNSET) - - meta_cluster_info = cls( - cluster_size=cluster_size, - leader=leader, - name=name, - ) - - meta_cluster_info.additional_properties = d - return meta_cluster_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 + name: Optional[str] = None diff --git a/kittycad/models/metadata.py b/kittycad/models/metadata.py index 72356e3cd..ef1248220 100644 --- a/kittycad/models/metadata.py +++ b/kittycad/models/metadata.py @@ -1,128 +1,23 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast -import attr +from pydantic import BaseModel from ..models.cache_metadata import CacheMetadata from ..models.connection import Connection from ..models.environment import Environment from ..models.file_system_metadata import FileSystemMetadata -from ..types import UNSET, Unset - -IT = TypeVar("IT", bound="Metadata") -@attr.s(auto_attribs=True) -class Metadata: +class Metadata(BaseModel): """Metadata about our currently running server. - This is mostly used for internal purposes and debugging.""" # noqa: E501 + This is mostly used for internal purposes and debugging.""" - cache: Union[Unset, CacheMetadata] = UNSET - environment: Union[Unset, Environment] = UNSET - fs: Union[Unset, FileSystemMetadata] = UNSET - git_hash: Union[Unset, str] = UNSET - pubsub: Union[Unset, Connection] = UNSET + cache: CacheMetadata - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + environment: Environment - def to_dict(self) -> Dict[str, Any]: - cache: Union[Unset, CacheMetadata] = UNSET - if not isinstance(self.cache, Unset): - cache = self.cache - environment: Union[Unset, Environment] = UNSET - if not isinstance(self.environment, Unset): - environment = self.environment - fs: Union[Unset, FileSystemMetadata] = UNSET - if not isinstance(self.fs, Unset): - fs = self.fs - git_hash = self.git_hash - pubsub: Union[Unset, Connection] = UNSET - if not isinstance(self.pubsub, Unset): - pubsub = self.pubsub + fs: FileSystemMetadata - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if cache is not UNSET: - _cache: CacheMetadata = cast(CacheMetadata, cache) - field_dict["cache"] = _cache.to_dict() - if environment is not UNSET: - field_dict["environment"] = environment - if fs is not UNSET: - _fs: FileSystemMetadata = cast(FileSystemMetadata, fs) - field_dict["fs"] = _fs.to_dict() - if git_hash is not UNSET: - field_dict["git_hash"] = git_hash - if pubsub is not UNSET: - _pubsub: Connection = cast(Connection, pubsub) - field_dict["pubsub"] = _pubsub.to_dict() + git_hash: str - return field_dict - - @classmethod - def from_dict(cls: Type[IT], src_dict: Dict[str, Any]) -> IT: - d = src_dict.copy() - _cache = d.pop("cache", UNSET) - cache: Union[Unset, CacheMetadata] - if isinstance(_cache, Unset): - cache = UNSET - if _cache is None: - cache = UNSET - else: - cache = CacheMetadata.from_dict(_cache) - - _environment = d.pop("environment", UNSET) - environment: Union[Unset, Environment] - if isinstance(_environment, Unset): - environment = UNSET - if _environment is None: - environment = UNSET - else: - environment = _environment - - _fs = d.pop("fs", UNSET) - fs: Union[Unset, FileSystemMetadata] - if isinstance(_fs, Unset): - fs = UNSET - if _fs is None: - fs = UNSET - else: - fs = FileSystemMetadata.from_dict(_fs) - - git_hash = d.pop("git_hash", UNSET) - - _pubsub = d.pop("pubsub", UNSET) - pubsub: Union[Unset, Connection] - if isinstance(_pubsub, Unset): - pubsub = UNSET - if _pubsub is None: - pubsub = UNSET - else: - pubsub = Connection.from_dict(_pubsub) - - metadata = cls( - cache=cache, - environment=environment, - fs=fs, - git_hash=git_hash, - pubsub=pubsub, - ) - - metadata.additional_properties = d - return metadata - - @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 + pubsub: Connection diff --git a/kittycad/models/modeling_cmd.py b/kittycad/models/modeling_cmd.py index 0cfdc29c8..ca530cc84 100644 --- a/kittycad/models/modeling_cmd.py +++ b/kittycad/models/modeling_cmd.py @@ -1,12 +1,16 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, Dict, List, Optional, Type, TypeVar, Union +from uuid import UUID import attr +from pydantic import BaseModel, GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema 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.import_file import ImportFile from ..models.input_format import InputFormat from ..models.modeling_cmd_id import ModelingCmdId from ..models.output_format import OutputFormat @@ -22,5053 +26,703 @@ from ..models.unit_density import UnitDensity from ..models.unit_length import UnitLength from ..models.unit_mass import UnitMass from ..models.unit_volume import UnitVolume -from ..types import UNSET, Unset - -LD = TypeVar("LD", bound="start_path") -@attr.s(auto_attribs=True) -class start_path: - """Start a path.""" # noqa: E501 +class start_path(BaseModel): + """Start a path.""" type: str = "start_path" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - type = self.type +class move_path_pen(BaseModel): + """Move the path's "pen".""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type + path: ModelingCmdId - return field_dict + to: Point3d - @classmethod - def from_dict(cls: Type[LD], src_dict: Dict[str, Any]) -> LD: - d = src_dict.copy() - type = d.pop("type", UNSET) - - start_path = cls( - type=type, - ) - - start_path.additional_properties = d - return start_path - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -UA = TypeVar("UA", bound="move_path_pen") - - -@attr.s(auto_attribs=True) -class move_path_pen: - """Move the path's "pen".""" # noqa: E501 - - path: Union[Unset, ModelingCmdId] = UNSET - to: Union[Unset, Point3d] = UNSET type: str = "move_path_pen" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - path: Union[Unset, ModelingCmdId] = UNSET - if not isinstance(self.path, Unset): - path = self.path - to: Union[Unset, Point3d] = UNSET - if not isinstance(self.to, Unset): - to = self.to - type = self.type +class extend_path(BaseModel): + """Extend a path by adding a new segment which starts at the path's "pen". If no "pen" location has been set before (via `MovePen`), then the pen is at the origin.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if path is not UNSET: - field_dict["path"] = path - if to is not UNSET: - _to: Point3d = cast(Point3d, to) - field_dict["to"] = _to.to_dict() - field_dict["type"] = type + path: ModelingCmdId - return field_dict + segment: PathSegment - @classmethod - def from_dict(cls: Type[UA], src_dict: Dict[str, Any]) -> UA: - d = src_dict.copy() - _path = d.pop("path", UNSET) - path: Union[Unset, ModelingCmdId] - if isinstance(_path, Unset): - path = UNSET - if _path is None: - path = UNSET - else: - path = _path - - _to = d.pop("to", UNSET) - to: Union[Unset, Point3d] - if isinstance(_to, Unset): - to = UNSET - if _to is None: - to = UNSET - else: - to = Point3d.from_dict(_to) - - type = d.pop("type", UNSET) - - move_path_pen = cls( - path=path, - to=to, - type=type, - ) - - move_path_pen.additional_properties = d - return move_path_pen - - @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="extend_path") - - -@attr.s(auto_attribs=True) -class extend_path: - """Extend a path by adding a new segment which starts at the path's "pen". If no "pen" location has been set before (via `MovePen`), then the pen is at the origin.""" # noqa: E501 - - path: Union[Unset, ModelingCmdId] = UNSET - segment: Union[Unset, PathSegment] = UNSET type: str = "extend_path" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - path: Union[Unset, ModelingCmdId] = UNSET - if not isinstance(self.path, Unset): - path = self.path - segment: Union[Unset, PathSegment] = UNSET - if not isinstance(self.segment, Unset): - segment = self.segment - type = self.type +class extrude(BaseModel): + """Extrude a 2D solid.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if path is not UNSET: - field_dict["path"] = path - if segment is not UNSET: - _segment: PathSegment = cast(PathSegment, segment) - field_dict["segment"] = _segment.to_dict() - field_dict["type"] = type + cap: bool - return field_dict + distance: float - @classmethod - def from_dict(cls: Type[TN], src_dict: Dict[str, Any]) -> TN: - d = src_dict.copy() - _path = d.pop("path", UNSET) - path: Union[Unset, ModelingCmdId] - if isinstance(_path, Unset): - path = UNSET - if _path is None: - path = UNSET - else: - path = _path + target: ModelingCmdId - _segment = d.pop("segment", UNSET) - segment: Union[Unset, PathSegment] - if isinstance(_segment, Unset): - segment = UNSET - if _segment is None: - segment = UNSET - else: - segment = PathSegment.from_dict(_segment) - - type = d.pop("type", UNSET) - - extend_path = cls( - path=path, - segment=segment, - type=type, - ) - - extend_path.additional_properties = d - return extend_path - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -MZ = TypeVar("MZ", bound="extrude") - - -@attr.s(auto_attribs=True) -class extrude: - """Extrude a 2D solid.""" # noqa: E501 - - cap: Union[Unset, bool] = False - distance: Union[Unset, float] = UNSET - target: Union[Unset, ModelingCmdId] = UNSET type: str = "extrude" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - cap = self.cap - distance = self.distance - target: Union[Unset, ModelingCmdId] = UNSET - if not isinstance(self.target, Unset): - target = self.target - type = self.type +class close_path(BaseModel): + """Closes a path, converting it to a 2D solid.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if cap is not UNSET: - field_dict["cap"] = cap - if distance is not UNSET: - field_dict["distance"] = distance - if target is not UNSET: - field_dict["target"] = target - field_dict["type"] = type + path_id: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[MZ], src_dict: Dict[str, Any]) -> MZ: - d = src_dict.copy() - cap = d.pop("cap", UNSET) - - distance = d.pop("distance", UNSET) - - _target = d.pop("target", UNSET) - target: Union[Unset, ModelingCmdId] - if isinstance(_target, Unset): - target = UNSET - if _target is None: - target = UNSET - else: - target = _target - - type = d.pop("type", UNSET) - - extrude = cls( - cap=cap, - distance=distance, - target=target, - type=type, - ) - - extrude.additional_properties = d - return extrude - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -UG = TypeVar("UG", bound="close_path") - - -@attr.s(auto_attribs=True) -class close_path: - """Closes a path, converting it to a 2D solid.""" # noqa: E501 - - path_id: Union[Unset, str] = UNSET type: str = "close_path" - 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 +class camera_drag_start(BaseModel): + """Camera drag started.""" - 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 + interaction: CameraDragInteractionType - return field_dict - - @classmethod - def from_dict(cls: Type[UG], src_dict: Dict[str, Any]) -> UG: - d = src_dict.copy() - path_id = d.pop("path_id", UNSET) - - type = d.pop("type", UNSET) - - close_path = cls( - path_id=path_id, - type=type, - ) - - close_path.additional_properties = d - return close_path - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -CY = TypeVar("CY", bound="camera_drag_start") - - -@attr.s(auto_attribs=True) -class camera_drag_start: - """Camera drag started.""" # noqa: E501 - - interaction: Union[Unset, CameraDragInteractionType] = UNSET type: str = "camera_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]: - interaction: Union[Unset, CameraDragInteractionType] = UNSET - if not isinstance(self.interaction, Unset): - interaction = self.interaction - type = self.type - window: Union[Unset, Point2d] = UNSET - if not isinstance(self.window, Unset): - window = self.window - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if interaction is not UNSET: - field_dict["interaction"] = interaction - field_dict["type"] = type - if window is not UNSET: - _window: Point2d = cast(Point2d, window) - field_dict["window"] = _window.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[CY], src_dict: Dict[str, Any]) -> CY: - d = src_dict.copy() - _interaction = d.pop("interaction", UNSET) - interaction: Union[Unset, CameraDragInteractionType] - if isinstance(_interaction, Unset): - interaction = UNSET - if _interaction is None: - interaction = UNSET - else: - interaction = _interaction - - type = d.pop("type", UNSET) - - _window = d.pop("window", UNSET) - window: Union[Unset, Point2d] - if isinstance(_window, Unset): - window = UNSET - if _window is None: - window = UNSET - else: - window = Point2d.from_dict(_window) - - camera_drag_start = cls( - interaction=interaction, - type=type, - window=window, - ) - - camera_drag_start.additional_properties = d - return camera_drag_start - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + window: Point2d -NZ = TypeVar("NZ", bound="camera_drag_move") +class camera_drag_move(BaseModel): + """Camera drag continued.""" + interaction: CameraDragInteractionType -@attr.s(auto_attribs=True) -class camera_drag_move: - """Camera drag continued.""" # noqa: E501 + sequence: Optional[int] = None - interaction: Union[Unset, CameraDragInteractionType] = UNSET - sequence: Union[Unset, int] = UNSET type: str = "camera_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]: - interaction: Union[Unset, CameraDragInteractionType] = UNSET - if not isinstance(self.interaction, Unset): - interaction = self.interaction - sequence = self.sequence - type = self.type - window: Union[Unset, Point2d] = UNSET - if not isinstance(self.window, Unset): - window = self.window - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if interaction is not UNSET: - field_dict["interaction"] = interaction - if sequence is not UNSET: - field_dict["sequence"] = sequence - field_dict["type"] = type - if window is not UNSET: - _window: Point2d = cast(Point2d, window) - field_dict["window"] = _window.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[NZ], src_dict: Dict[str, Any]) -> NZ: - d = src_dict.copy() - _interaction = d.pop("interaction", UNSET) - interaction: Union[Unset, CameraDragInteractionType] - if isinstance(_interaction, Unset): - interaction = UNSET - if _interaction is None: - interaction = UNSET - else: - interaction = _interaction - - sequence = d.pop("sequence", UNSET) - - type = d.pop("type", UNSET) - - _window = d.pop("window", UNSET) - window: Union[Unset, Point2d] - if isinstance(_window, Unset): - window = UNSET - if _window is None: - window = UNSET - else: - window = Point2d.from_dict(_window) - - camera_drag_move = cls( - interaction=interaction, - sequence=sequence, - type=type, - window=window, - ) - - camera_drag_move.additional_properties = d - return camera_drag_move - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + window: Point2d -LI = TypeVar("LI", bound="camera_drag_end") +class camera_drag_end(BaseModel): + """Camera drag ended.""" + interaction: CameraDragInteractionType -@attr.s(auto_attribs=True) -class camera_drag_end: - """Camera drag ended.""" # noqa: E501 - - interaction: Union[Unset, CameraDragInteractionType] = UNSET type: str = "camera_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]: - interaction: Union[Unset, CameraDragInteractionType] = UNSET - if not isinstance(self.interaction, Unset): - interaction = self.interaction - type = self.type - window: Union[Unset, Point2d] = UNSET - if not isinstance(self.window, Unset): - window = self.window - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if interaction is not UNSET: - field_dict["interaction"] = interaction - field_dict["type"] = type - if window is not UNSET: - _window: Point2d = cast(Point2d, window) - field_dict["window"] = _window.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[LI], src_dict: Dict[str, Any]) -> LI: - d = src_dict.copy() - _interaction = d.pop("interaction", UNSET) - interaction: Union[Unset, CameraDragInteractionType] - if isinstance(_interaction, Unset): - interaction = UNSET - if _interaction is None: - interaction = UNSET - else: - interaction = _interaction - - type = d.pop("type", UNSET) - - _window = d.pop("window", UNSET) - window: Union[Unset, Point2d] - if isinstance(_window, Unset): - window = UNSET - if _window is None: - window = UNSET - else: - window = Point2d.from_dict(_window) - - camera_drag_end = cls( - interaction=interaction, - type=type, - window=window, - ) - - camera_drag_end.additional_properties = d - return camera_drag_end - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + window: Point2d -LO = TypeVar("LO", bound="default_camera_look_at") +class default_camera_look_at(BaseModel): + """Change what the default camera is looking at.""" + center: Point3d -@attr.s(auto_attribs=True) -class default_camera_look_at: - """Change what the default camera is looking at.""" # noqa: E501 - - center: Union[Unset, Point3d] = UNSET type: str = "default_camera_look_at" - up: Union[Unset, Point3d] = UNSET - vantage: Union[Unset, Point3d] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + up: Point3d - def to_dict(self) -> Dict[str, Any]: - center: Union[Unset, Point3d] = UNSET - if not isinstance(self.center, Unset): - center = self.center - type = self.type - up: Union[Unset, Point3d] = UNSET - if not isinstance(self.up, Unset): - up = self.up - vantage: Union[Unset, Point3d] = UNSET - if not isinstance(self.vantage, Unset): - vantage = self.vantage - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if center is not UNSET: - _center: Point3d = cast(Point3d, center) - field_dict["center"] = _center.to_dict() - field_dict["type"] = type - if up is not UNSET: - _up: Point3d = cast(Point3d, up) - field_dict["up"] = _up.to_dict() - if vantage is not UNSET: - _vantage: Point3d = cast(Point3d, vantage) - field_dict["vantage"] = _vantage.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[LO], src_dict: Dict[str, Any]) -> LO: - d = src_dict.copy() - _center = d.pop("center", UNSET) - center: Union[Unset, Point3d] - if isinstance(_center, Unset): - center = UNSET - if _center is None: - center = UNSET - else: - center = Point3d.from_dict(_center) - - type = d.pop("type", UNSET) - - _up = d.pop("up", UNSET) - up: Union[Unset, Point3d] - if isinstance(_up, Unset): - up = UNSET - if _up is None: - up = UNSET - else: - up = Point3d.from_dict(_up) - - _vantage = d.pop("vantage", UNSET) - vantage: Union[Unset, Point3d] - if isinstance(_vantage, Unset): - vantage = UNSET - if _vantage is None: - vantage = UNSET - else: - vantage = Point3d.from_dict(_vantage) - - default_camera_look_at = cls( - center=center, - type=type, - up=up, - vantage=vantage, - ) - - default_camera_look_at.additional_properties = d - return default_camera_look_at - - @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 + vantage: Point3d -XJ = TypeVar("XJ", bound="default_camera_zoom") +class default_camera_zoom(BaseModel): + """Adjust zoom of the default camera.""" + magnitude: float -@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 +class default_camera_enable_sketch_mode(BaseModel): + """Enable sketch mode, where users can sketch 2D geometry. Users choose a plane to sketch on.""" - 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 + animated: bool - return field_dict + distance_to_plane: float - @classmethod - def from_dict(cls: Type[XJ], src_dict: Dict[str, Any]) -> XJ: - d = src_dict.copy() - magnitude = d.pop("magnitude", UNSET) + origin: Point3d - type = d.pop("type", UNSET) + ortho: bool - 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 - - -OW = TypeVar("OW", bound="default_camera_enable_sketch_mode") - - -@attr.s(auto_attribs=True) -class default_camera_enable_sketch_mode: - """Enable sketch mode, where users can sketch 2D geometry. Users choose a plane to sketch on.""" # noqa: E501 - - animated: Union[Unset, bool] = False - distance_to_plane: Union[Unset, float] = UNSET - origin: Union[Unset, Point3d] = UNSET - ortho: Union[Unset, bool] = False type: str = "default_camera_enable_sketch_mode" - x_axis: Union[Unset, Point3d] = UNSET - y_axis: Union[Unset, Point3d] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + x_axis: Point3d - def to_dict(self) -> Dict[str, Any]: - animated = self.animated - distance_to_plane = self.distance_to_plane - origin: Union[Unset, Point3d] = UNSET - if not isinstance(self.origin, Unset): - origin = self.origin - ortho = self.ortho - type = self.type - x_axis: Union[Unset, Point3d] = UNSET - if not isinstance(self.x_axis, Unset): - x_axis = self.x_axis - y_axis: Union[Unset, Point3d] = UNSET - 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 animated is not UNSET: - field_dict["animated"] = animated - if distance_to_plane is not UNSET: - field_dict["distance_to_plane"] = distance_to_plane - if origin is not UNSET: - _origin: Point3d = cast(Point3d, origin) - field_dict["origin"] = _origin.to_dict() - if ortho is not UNSET: - field_dict["ortho"] = ortho - field_dict["type"] = type - if x_axis is not UNSET: - _x_axis: Point3d = cast(Point3d, x_axis) - field_dict["x_axis"] = _x_axis.to_dict() - if y_axis is not UNSET: - _y_axis: Point3d = cast(Point3d, y_axis) - field_dict["y_axis"] = _y_axis.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[OW], src_dict: Dict[str, Any]) -> OW: - d = src_dict.copy() - animated = d.pop("animated", UNSET) - - distance_to_plane = d.pop("distance_to_plane", UNSET) - - _origin = d.pop("origin", UNSET) - origin: Union[Unset, Point3d] - if isinstance(_origin, Unset): - origin = UNSET - if _origin is None: - origin = UNSET - else: - origin = Point3d.from_dict(_origin) - - ortho = d.pop("ortho", 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 - if _x_axis is None: - x_axis = UNSET - else: - x_axis = Point3d.from_dict(_x_axis) - - _y_axis = d.pop("y_axis", UNSET) - y_axis: Union[Unset, Point3d] - if isinstance(_y_axis, Unset): - y_axis = UNSET - if _y_axis is None: - y_axis = UNSET - else: - y_axis = Point3d.from_dict(_y_axis) - - default_camera_enable_sketch_mode = cls( - animated=animated, - distance_to_plane=distance_to_plane, - origin=origin, - ortho=ortho, - type=type, - x_axis=x_axis, - y_axis=y_axis, - ) - - default_camera_enable_sketch_mode.additional_properties = d - return default_camera_enable_sketch_mode - - @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 + y_axis: Point3d -JQ = TypeVar("JQ", bound="default_camera_disable_sketch_mode") - - -@attr.s(auto_attribs=True) -class default_camera_disable_sketch_mode: - """Disable sketch mode, from the default camera.""" # noqa: E501 +class default_camera_disable_sketch_mode(BaseModel): + """Disable sketch mode, from the default camera.""" type: str = "default_camera_disable_sketch_mode" - 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[JQ], src_dict: Dict[str, Any]) -> JQ: - d = src_dict.copy() - type = d.pop("type", UNSET) - - default_camera_disable_sketch_mode = cls( - type=type, - ) - - default_camera_disable_sketch_mode.additional_properties = d - return default_camera_disable_sketch_mode - - @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="default_camera_focus_on") - - -@attr.s(auto_attribs=True) -class default_camera_focus_on: - """Focus default camera on object.""" # noqa: E501 +class default_camera_focus_on(BaseModel): + """Focus default camera on object.""" type: str = "default_camera_focus_on" - uuid: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - type = self.type - uuid = self.uuid - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type - if uuid is not UNSET: - field_dict["uuid"] = uuid - - return field_dict - - @classmethod - def from_dict(cls: Type[PQ], src_dict: Dict[str, Any]) -> PQ: - d = src_dict.copy() - type = d.pop("type", UNSET) - - uuid = d.pop("uuid", UNSET) - - default_camera_focus_on = cls( - type=type, - uuid=uuid, - ) - - default_camera_focus_on.additional_properties = d - return default_camera_focus_on - - @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 + uuid: UUID -IM = TypeVar("IM", bound="export") +class export(BaseModel): + """Export the scene to a file.""" + entity_ids: List[UUID] -@attr.s(auto_attribs=True) -class export: - """Export the scene to a file.""" # noqa: E501 + format: OutputFormat + + source_unit: UnitLength - entity_ids: Union[Unset, List[str]] = UNSET - format: Union[Unset, OutputFormat] = UNSET - source_unit: Union[Unset, UnitLength] = UNSET type: str = "export" - 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 - format: Union[Unset, OutputFormat] = UNSET - if not isinstance(self.format, Unset): - format = self.format - source_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.source_unit, Unset): - source_unit = self.source_unit - type = self.type +class entity_get_parent_id(BaseModel): + """What is this entity's parent?""" - 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 format is not UNSET: - _format: OutputFormat = cast(OutputFormat, format) - field_dict["format"] = _format.to_dict() - if source_unit is not UNSET: - field_dict["source_unit"] = source_unit - field_dict["type"] = type + entity_id: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[IM], src_dict: Dict[str, Any]) -> IM: - d = src_dict.copy() - entity_ids = cast(List[str], d.pop("entity_ids", UNSET)) - - _format = d.pop("format", UNSET) - format: Union[Unset, OutputFormat] - if isinstance(_format, Unset): - format = UNSET - if _format is None: - format = UNSET - else: - format = OutputFormat.from_dict(_format) - - _source_unit = d.pop("source_unit", UNSET) - source_unit: Union[Unset, UnitLength] - if isinstance(_source_unit, Unset): - source_unit = UNSET - if _source_unit is None: - source_unit = UNSET - else: - source_unit = _source_unit - - type = d.pop("type", UNSET) - - export = cls( - entity_ids=entity_ids, - format=format, - source_unit=source_unit, - type=type, - ) - - export.additional_properties = d - return export - - @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="entity_get_parent_id") - - -@attr.s(auto_attribs=True) -class entity_get_parent_id: - """What is this entity's parent?""" # noqa: E501 - - entity_id: Union[Unset, str] = 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 - type = self.type +class entity_get_num_children(BaseModel): + """How many children does the entity have?""" - 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 - field_dict["type"] = type + entity_id: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[OU], src_dict: Dict[str, Any]) -> OU: - d = src_dict.copy() - entity_id = d.pop("entity_id", UNSET) - - type = d.pop("type", UNSET) - - entity_get_parent_id = cls( - entity_id=entity_id, - type=type, - ) - - 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 - - -KL = TypeVar("KL", bound="entity_get_num_children") - - -@attr.s(auto_attribs=True) -class entity_get_num_children: - """How many children does the entity have?""" # noqa: E501 - - entity_id: Union[Unset, str] = 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]: - entity_id = self.entity_id - type = self.type +class entity_get_child_uuid(BaseModel): + """What is the UUID of this entity's n-th child?""" - 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 - field_dict["type"] = type + child_index: int - return field_dict + entity_id: UUID - @classmethod - def from_dict(cls: Type[KL], src_dict: Dict[str, Any]) -> KL: - d = src_dict.copy() - entity_id = d.pop("entity_id", UNSET) - - type = d.pop("type", UNSET) - - entity_get_num_children = cls( - entity_id=entity_id, - type=type, - ) - - 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 - - -XI = TypeVar("XI", bound="entity_get_child_uuid") - - -@attr.s(auto_attribs=True) -class entity_get_child_uuid: - """What is the UUID of this entity's n-th child?""" # noqa: E501 - - child_index: Union[Unset, int] = UNSET - entity_id: Union[Unset, str] = 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]: - child_index = self.child_index - entity_id = self.entity_id - type = self.type +class entity_get_all_child_uuids(BaseModel): + """What are all UUIDs of this entity's children?""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if child_index is not UNSET: - field_dict["child_index"] = child_index - if entity_id is not UNSET: - field_dict["entity_id"] = entity_id - field_dict["type"] = type + entity_id: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[XI], src_dict: Dict[str, Any]) -> XI: - d = src_dict.copy() - child_index = d.pop("child_index", UNSET) - - entity_id = d.pop("entity_id", UNSET) - - type = d.pop("type", UNSET) - - entity_get_child_uuid = cls( - child_index=child_index, - entity_id=entity_id, - type=type, - ) - - 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 - - -PO = TypeVar("PO", bound="entity_get_all_child_uuids") - - -@attr.s(auto_attribs=True) -class entity_get_all_child_uuids: - """What are all UUIDs of this entity's children?""" # noqa: E501 - - entity_id: Union[Unset, str] = 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_id = self.entity_id - type = self.type +class edit_mode_enter(BaseModel): + """Enter edit mode""" - 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 - field_dict["type"] = type + target: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[PO], src_dict: Dict[str, Any]) -> PO: - d = src_dict.copy() - entity_id = d.pop("entity_id", UNSET) - - type = d.pop("type", UNSET) - - entity_get_all_child_uuids = cls( - entity_id=entity_id, - type=type, - ) - - 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 - - -PS = TypeVar("PS", bound="edit_mode_enter") - - -@attr.s(auto_attribs=True) -class edit_mode_enter: - """Enter edit mode""" # noqa: E501 - - target: Union[Unset, str] = UNSET type: str = "edit_mode_enter" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - target = self.target - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if target is not UNSET: - field_dict["target"] = target - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[PS], src_dict: Dict[str, Any]) -> PS: - d = src_dict.copy() - target = d.pop("target", UNSET) - - type = d.pop("type", UNSET) - - edit_mode_enter = cls( - target=target, - type=type, - ) - - edit_mode_enter.additional_properties = d - return edit_mode_enter - - @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 - - -WR = TypeVar("WR", bound="edit_mode_exit") - - -@attr.s(auto_attribs=True) -class edit_mode_exit: - """Exit edit mode""" # noqa: E501 +class edit_mode_exit(BaseModel): + """Exit edit mode""" type: str = "edit_mode_exit" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - type = self.type +class select_with_point(BaseModel): + """Modifies the selection by simulating a "mouse click" at the given x,y window coordinate Returns ID of whatever was selected.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type + selected_at_window: Point2d - return field_dict + selection_type: SceneSelectionType - @classmethod - def from_dict(cls: Type[WR], src_dict: Dict[str, Any]) -> WR: - d = src_dict.copy() - type = d.pop("type", UNSET) - - edit_mode_exit = cls( - type=type, - ) - - edit_mode_exit.additional_properties = d - return edit_mode_exit - - @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 - - -XL = TypeVar("XL", bound="select_with_point") - - -@attr.s(auto_attribs=True) -class select_with_point: - """Modifies the selection by simulating a "mouse click" at the given x,y window coordinate Returns ID of whatever was selected.""" # noqa: E501 - - selected_at_window: Union[Unset, Point2d] = UNSET - selection_type: Union[Unset, SceneSelectionType] = UNSET type: str = "select_with_point" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - selected_at_window: Union[Unset, Point2d] = UNSET - if not isinstance(self.selected_at_window, Unset): - selected_at_window = self.selected_at_window - selection_type: Union[Unset, SceneSelectionType] = UNSET - if not isinstance(self.selection_type, Unset): - selection_type = self.selection_type - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if selected_at_window is not UNSET: - _selected_at_window: Point2d = cast(Point2d, selected_at_window) - field_dict["selected_at_window"] = _selected_at_window.to_dict() - if selection_type is not UNSET: - field_dict["selection_type"] = selection_type - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[XL], src_dict: Dict[str, Any]) -> XL: - d = src_dict.copy() - _selected_at_window = d.pop("selected_at_window", UNSET) - selected_at_window: Union[Unset, Point2d] - if isinstance(_selected_at_window, Unset): - selected_at_window = UNSET - if _selected_at_window is None: - selected_at_window = UNSET - else: - selected_at_window = Point2d.from_dict(_selected_at_window) - - _selection_type = d.pop("selection_type", UNSET) - selection_type: Union[Unset, SceneSelectionType] - if isinstance(_selection_type, Unset): - selection_type = UNSET - if _selection_type is None: - selection_type = UNSET - else: - selection_type = _selection_type - - type = d.pop("type", UNSET) - - select_with_point = cls( - selected_at_window=selected_at_window, - selection_type=selection_type, - type=type, - ) - - 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 - - -ZX = TypeVar("ZX", bound="select_clear") - - -@attr.s(auto_attribs=True) -class select_clear: - """Clear the selection""" # noqa: E501 +class select_clear(BaseModel): + """Clear the selection""" type: str = "select_clear" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - type = self.type +class select_add(BaseModel): + """Adds one or more entities (by UUID) to the selection.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type + entities: List[UUID] - return field_dict - - @classmethod - def from_dict(cls: Type[ZX], src_dict: Dict[str, Any]) -> ZX: - d = src_dict.copy() - type = d.pop("type", UNSET) - - select_clear = cls( - type=type, - ) - - select_clear.additional_properties = d - return select_clear - - @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 - - -FT = TypeVar("FT", bound="select_add") - - -@attr.s(auto_attribs=True) -class select_add: - """Adds one or more entities (by UUID) to the selection.""" # noqa: E501 - - entities: Union[Unset, List[str]] = UNSET type: str = "select_add" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - entities: Union[Unset, List[str]] = UNSET - if not isinstance(self.entities, Unset): - entities = self.entities - type = self.type +class select_remove(BaseModel): + """Removes one or more entities (by UUID) from the selection.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if entities is not UNSET: - field_dict["entities"] = entities - field_dict["type"] = type + entities: List[UUID] - return field_dict - - @classmethod - def from_dict(cls: Type[FT], src_dict: Dict[str, Any]) -> FT: - d = src_dict.copy() - entities = cast(List[str], d.pop("entities", UNSET)) - - type = d.pop("type", UNSET) - - select_add = cls( - entities=entities, - type=type, - ) - - select_add.additional_properties = d - return select_add - - @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 - - -NX = TypeVar("NX", bound="select_remove") - - -@attr.s(auto_attribs=True) -class select_remove: - """Removes one or more entities (by UUID) from the selection.""" # noqa: E501 - - entities: Union[Unset, List[str]] = UNSET type: str = "select_remove" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - entities: Union[Unset, List[str]] = UNSET - if not isinstance(self.entities, Unset): - entities = self.entities - type = self.type +class select_replace(BaseModel): + """Replaces the current selection with these new entities (by UUID). Equivalent to doing SelectClear then SelectAdd.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if entities is not UNSET: - field_dict["entities"] = entities - field_dict["type"] = type + entities: List[UUID] - return field_dict - - @classmethod - def from_dict(cls: Type[NX], src_dict: Dict[str, Any]) -> NX: - d = src_dict.copy() - entities = cast(List[str], d.pop("entities", UNSET)) - - type = d.pop("type", UNSET) - - select_remove = cls( - entities=entities, - type=type, - ) - - select_remove.additional_properties = d - return select_remove - - @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 - - -SC = TypeVar("SC", bound="select_replace") - - -@attr.s(auto_attribs=True) -class select_replace: - """Replaces the current selection with these new entities (by UUID). Equivalent to doing SelectClear then SelectAdd.""" # noqa: E501 - - entities: Union[Unset, List[str]] = UNSET type: str = "select_replace" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - entities: Union[Unset, List[str]] = UNSET - if not isinstance(self.entities, Unset): - entities = self.entities - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if entities is not UNSET: - field_dict["entities"] = entities - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[SC], src_dict: Dict[str, Any]) -> SC: - d = src_dict.copy() - entities = cast(List[str], d.pop("entities", UNSET)) - - type = d.pop("type", UNSET) - - select_replace = cls( - entities=entities, - type=type, - ) - - select_replace.additional_properties = d - return select_replace - - @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 - - -TX = TypeVar("TX", bound="select_get") - - -@attr.s(auto_attribs=True) -class select_get: - """Find all IDs of selected entities""" # noqa: E501 +class select_get(BaseModel): + """Find all IDs of selected entities""" type: str = "select_get" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - type = self.type +class highlight_set_entity(BaseModel): + """Changes the current highlighted entity to whichever one is at the given window coordinate. If there's no entity at this location, clears the highlight.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type + selected_at_window: Point2d - return field_dict + sequence: Optional[int] = None - @classmethod - def from_dict(cls: Type[TX], src_dict: Dict[str, Any]) -> TX: - d = src_dict.copy() - type = d.pop("type", UNSET) - - select_get = cls( - type=type, - ) - - 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 - - -JA = TypeVar("JA", bound="highlight_set_entity") - - -@attr.s(auto_attribs=True) -class highlight_set_entity: - """Changes the current highlighted entity to whichever one is at the given window coordinate. If there's no entity at this location, clears the highlight.""" # noqa: E501 - - selected_at_window: Union[Unset, Point2d] = UNSET - sequence: Union[Unset, int] = UNSET type: str = "highlight_set_entity" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - selected_at_window: Union[Unset, Point2d] = UNSET - if not isinstance(self.selected_at_window, Unset): - selected_at_window = self.selected_at_window - sequence = self.sequence - type = self.type +class highlight_set_entities(BaseModel): + """Changes the current highlighted entity to these entities.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if selected_at_window is not UNSET: - _selected_at_window: Point2d = cast(Point2d, selected_at_window) - field_dict["selected_at_window"] = _selected_at_window.to_dict() - if sequence is not UNSET: - field_dict["sequence"] = sequence - field_dict["type"] = type + entities: List[UUID] - return field_dict - - @classmethod - def from_dict(cls: Type[JA], src_dict: Dict[str, Any]) -> JA: - d = src_dict.copy() - _selected_at_window = d.pop("selected_at_window", UNSET) - selected_at_window: Union[Unset, Point2d] - if isinstance(_selected_at_window, Unset): - selected_at_window = UNSET - if _selected_at_window is None: - selected_at_window = UNSET - else: - selected_at_window = Point2d.from_dict(_selected_at_window) - - sequence = d.pop("sequence", UNSET) - - type = d.pop("type", UNSET) - - highlight_set_entity = cls( - selected_at_window=selected_at_window, - sequence=sequence, - type=type, - ) - - 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 - - -SK = TypeVar("SK", bound="highlight_set_entities") - - -@attr.s(auto_attribs=True) -class highlight_set_entities: - """Changes the current highlighted entity to these entities.""" # noqa: E501 - - entities: Union[Unset, List[str]] = UNSET type: str = "highlight_set_entities" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - entities: Union[Unset, List[str]] = UNSET - if not isinstance(self.entities, Unset): - entities = self.entities - type = self.type +class new_annotation(BaseModel): + """Create a new annotation""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if entities is not UNSET: - field_dict["entities"] = entities - field_dict["type"] = type + annotation_type: AnnotationType - return field_dict + clobber: bool - @classmethod - def from_dict(cls: Type[SK], src_dict: Dict[str, Any]) -> SK: - d = src_dict.copy() - entities = cast(List[str], d.pop("entities", UNSET)) + options: AnnotationOptions - type = d.pop("type", UNSET) - - highlight_set_entities = cls( - entities=entities, - type=type, - ) - - highlight_set_entities.additional_properties = d - return highlight_set_entities - - @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 - - -UK = TypeVar("UK", bound="new_annotation") - - -@attr.s(auto_attribs=True) -class new_annotation: - """Create a new annotation""" # noqa: E501 - - annotation_type: Union[Unset, AnnotationType] = UNSET - clobber: Union[Unset, bool] = False - options: Union[Unset, AnnotationOptions] = UNSET type: str = "new_annotation" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - annotation_type: Union[Unset, AnnotationType] = UNSET - if not isinstance(self.annotation_type, Unset): - annotation_type = self.annotation_type - clobber = self.clobber - options: Union[Unset, AnnotationOptions] = UNSET - if not isinstance(self.options, Unset): - options = self.options - type = self.type +class update_annotation(BaseModel): + """Update an annotation""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if annotation_type is not UNSET: - field_dict["annotation_type"] = annotation_type - if clobber is not UNSET: - field_dict["clobber"] = clobber - if options is not UNSET: - _options: AnnotationOptions = cast(AnnotationOptions, options) - field_dict["options"] = _options.to_dict() - field_dict["type"] = type + annotation_id: UUID - return field_dict + options: AnnotationOptions - @classmethod - def from_dict(cls: Type[UK], src_dict: Dict[str, Any]) -> UK: - d = src_dict.copy() - _annotation_type = d.pop("annotation_type", UNSET) - annotation_type: Union[Unset, AnnotationType] - if isinstance(_annotation_type, Unset): - annotation_type = UNSET - if _annotation_type is None: - annotation_type = UNSET - else: - annotation_type = _annotation_type - - clobber = d.pop("clobber", UNSET) - - _options = d.pop("options", UNSET) - options: Union[Unset, AnnotationOptions] - if isinstance(_options, Unset): - options = UNSET - if _options is None: - options = UNSET - else: - options = AnnotationOptions.from_dict(_options) - - type = d.pop("type", UNSET) - - new_annotation = cls( - annotation_type=annotation_type, - clobber=clobber, - options=options, - type=type, - ) - - new_annotation.additional_properties = d - return new_annotation - - @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 - - -CX = TypeVar("CX", bound="update_annotation") - - -@attr.s(auto_attribs=True) -class update_annotation: - """Update an annotation""" # noqa: E501 - - annotation_id: Union[Unset, str] = UNSET - options: Union[Unset, AnnotationOptions] = UNSET type: str = "update_annotation" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - annotation_id = self.annotation_id - options: Union[Unset, AnnotationOptions] = UNSET - if not isinstance(self.options, Unset): - options = self.options - type = self.type +class object_visible(BaseModel): + """Hide or show an object""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if annotation_id is not UNSET: - field_dict["annotation_id"] = annotation_id - if options is not UNSET: - _options: AnnotationOptions = cast(AnnotationOptions, options) - field_dict["options"] = _options.to_dict() - field_dict["type"] = type + hidden: bool - return field_dict + object_id: UUID - @classmethod - def from_dict(cls: Type[CX], src_dict: Dict[str, Any]) -> CX: - d = src_dict.copy() - annotation_id = d.pop("annotation_id", UNSET) - - _options = d.pop("options", UNSET) - options: Union[Unset, AnnotationOptions] - if isinstance(_options, Unset): - options = UNSET - if _options is None: - options = UNSET - else: - options = AnnotationOptions.from_dict(_options) - - type = d.pop("type", UNSET) - - update_annotation = cls( - annotation_id=annotation_id, - options=options, - type=type, - ) - - update_annotation.additional_properties = d - return update_annotation - - @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 - - -MT = TypeVar("MT", bound="object_visible") - - -@attr.s(auto_attribs=True) -class object_visible: - """Hide or show an object""" # noqa: E501 - - hidden: Union[Unset, bool] = False - object_id: Union[Unset, str] = UNSET type: str = "object_visible" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - hidden = self.hidden - object_id = self.object_id - type = self.type +class object_bring_to_front(BaseModel): + """Bring an object to the front of the scene""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if hidden is not UNSET: - field_dict["hidden"] = hidden - if object_id is not UNSET: - field_dict["object_id"] = object_id - field_dict["type"] = type + object_id: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[MT], src_dict: Dict[str, Any]) -> MT: - d = src_dict.copy() - hidden = d.pop("hidden", UNSET) - - object_id = d.pop("object_id", UNSET) - - type = d.pop("type", UNSET) - - object_visible = cls( - hidden=hidden, - object_id=object_id, - type=type, - ) - - object_visible.additional_properties = d - return object_visible - - @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 - - -LJ = TypeVar("LJ", bound="object_bring_to_front") - - -@attr.s(auto_attribs=True) -class object_bring_to_front: - """Bring an object to the front of the scene""" # noqa: E501 - - object_id: Union[Unset, str] = UNSET type: str = "object_bring_to_front" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - object_id = self.object_id - type = self.type +class get_entity_type(BaseModel): + """What type of entity is this?""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if object_id is not UNSET: - field_dict["object_id"] = object_id - field_dict["type"] = type + entity_id: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[LJ], src_dict: Dict[str, Any]) -> LJ: - d = src_dict.copy() - object_id = d.pop("object_id", UNSET) - - type = d.pop("type", UNSET) - - object_bring_to_front = cls( - object_id=object_id, - type=type, - ) - - object_bring_to_front.additional_properties = d - return object_bring_to_front - - @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 - - -TF = TypeVar("TF", bound="get_entity_type") - - -@attr.s(auto_attribs=True) -class get_entity_type: - """What type of entity is this?""" # noqa: E501 - - entity_id: Union[Unset, str] = UNSET type: str = "get_entity_type" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - entity_id = self.entity_id - type = self.type +class solid2d_add_hole(BaseModel): + """Add a hole to a Solid2d object before extruding it.""" - 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 - field_dict["type"] = type + hole_id: UUID - return field_dict + object_id: UUID - @classmethod - def from_dict(cls: Type[TF], src_dict: Dict[str, Any]) -> TF: - d = src_dict.copy() - entity_id = d.pop("entity_id", UNSET) - - type = d.pop("type", UNSET) - - get_entity_type = cls( - entity_id=entity_id, - type=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 - - -HF = TypeVar("HF", bound="solid2d_add_hole") - - -@attr.s(auto_attribs=True) -class solid2d_add_hole: - """Add a hole to a Solid2d object before extruding it.""" # noqa: E501 - - hole_id: Union[Unset, str] = UNSET - object_id: Union[Unset, str] = UNSET type: str = "solid2d_add_hole" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - hole_id = self.hole_id - object_id = self.object_id - type = self.type +class solid3d_get_all_edge_faces(BaseModel): + """Gets all faces which use the given edge.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if hole_id is not UNSET: - field_dict["hole_id"] = hole_id - if object_id is not UNSET: - field_dict["object_id"] = object_id - field_dict["type"] = type + edge_id: UUID - return field_dict + object_id: UUID - @classmethod - def from_dict(cls: Type[HF], src_dict: Dict[str, Any]) -> HF: - d = src_dict.copy() - hole_id = d.pop("hole_id", UNSET) - - object_id = d.pop("object_id", UNSET) - - type = d.pop("type", UNSET) - - solid2d_add_hole = cls( - hole_id=hole_id, - object_id=object_id, - type=type, - ) - - solid2d_add_hole.additional_properties = d - return solid2d_add_hole - - @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 - - -JD = TypeVar("JD", bound="solid3d_get_all_edge_faces") - - -@attr.s(auto_attribs=True) -class solid3d_get_all_edge_faces: - """Gets all faces which use the given edge.""" # noqa: E501 - - edge_id: Union[Unset, str] = UNSET - object_id: Union[Unset, str] = 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]: - edge_id = self.edge_id - object_id = self.object_id - type = self.type +class solid3d_get_all_opposite_edges(BaseModel): + """Gets all edges which are opposite the given edge, across all possible faces.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if edge_id is not UNSET: - field_dict["edge_id"] = edge_id - if object_id is not UNSET: - field_dict["object_id"] = object_id - field_dict["type"] = type + along_vector: Optional[Point3d] = None - return field_dict + edge_id: UUID - @classmethod - def from_dict(cls: Type[JD], src_dict: Dict[str, Any]) -> JD: - d = src_dict.copy() - edge_id = d.pop("edge_id", UNSET) + object_id: UUID - object_id = d.pop("object_id", UNSET) - - type = d.pop("type", UNSET) - - solid3d_get_all_edge_faces = cls( - edge_id=edge_id, - object_id=object_id, - type=type, - ) - - 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 - - -RZ = TypeVar("RZ", bound="solid3d_get_all_opposite_edges") - - -@attr.s(auto_attribs=True) -class solid3d_get_all_opposite_edges: - """Gets all edges which are opposite the given edge, across all possible faces.""" # noqa: E501 - - along_vector: Union[Unset, Point3d] = UNSET - edge_id: Union[Unset, str] = UNSET - object_id: Union[Unset, str] = 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]: - along_vector: Union[Unset, Point3d] = UNSET - if not isinstance(self.along_vector, Unset): - along_vector = self.along_vector - edge_id = self.edge_id - object_id = self.object_id - type = self.type +class solid3d_get_opposite_edge(BaseModel): + """Gets the edge opposite the given edge, along the given face.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if along_vector is not UNSET: - _along_vector: Point3d = cast(Point3d, along_vector) - field_dict["along_vector"] = _along_vector.to_dict() - if edge_id is not UNSET: - field_dict["edge_id"] = edge_id - if object_id is not UNSET: - field_dict["object_id"] = object_id - field_dict["type"] = type + edge_id: UUID - return field_dict + face_id: UUID - @classmethod - def from_dict(cls: Type[RZ], src_dict: Dict[str, Any]) -> RZ: - d = src_dict.copy() - _along_vector = d.pop("along_vector", UNSET) - along_vector: Union[Unset, Point3d] - if isinstance(_along_vector, Unset): - along_vector = UNSET - if _along_vector is None: - along_vector = UNSET - else: - along_vector = Point3d.from_dict(_along_vector) + object_id: UUID - edge_id = d.pop("edge_id", UNSET) - - object_id = d.pop("object_id", UNSET) - - type = d.pop("type", UNSET) - - solid3d_get_all_opposite_edges = cls( - along_vector=along_vector, - edge_id=edge_id, - object_id=object_id, - type=type, - ) - - 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 - - -BH = TypeVar("BH", bound="solid3d_get_opposite_edge") - - -@attr.s(auto_attribs=True) -class solid3d_get_opposite_edge: - """Gets the edge opposite the given edge, along the given face.""" # noqa: E501 - - edge_id: Union[Unset, str] = UNSET - face_id: Union[Unset, str] = UNSET - object_id: Union[Unset, str] = 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_id = self.edge_id - face_id = self.face_id - object_id = self.object_id - type = self.type +class solid3d_get_next_adjacent_edge(BaseModel): + """Gets the next adjacent edge for the given edge, along the given face.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if edge_id is not UNSET: - field_dict["edge_id"] = edge_id - if face_id is not UNSET: - field_dict["face_id"] = face_id - if object_id is not UNSET: - field_dict["object_id"] = object_id - field_dict["type"] = type + edge_id: UUID - return field_dict + face_id: UUID - @classmethod - def from_dict(cls: Type[BH], src_dict: Dict[str, Any]) -> BH: - d = src_dict.copy() - edge_id = d.pop("edge_id", UNSET) + object_id: UUID - face_id = d.pop("face_id", UNSET) - - object_id = d.pop("object_id", UNSET) - - type = d.pop("type", UNSET) - - solid3d_get_opposite_edge = cls( - edge_id=edge_id, - face_id=face_id, - object_id=object_id, - type=type, - ) - - 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 - - -SX = TypeVar("SX", bound="solid3d_get_next_adjacent_edge") - - -@attr.s(auto_attribs=True) -class solid3d_get_next_adjacent_edge: - """Gets the next adjacent edge for the given edge, along the given face.""" # noqa: E501 - - edge_id: Union[Unset, str] = UNSET - face_id: Union[Unset, str] = UNSET - object_id: Union[Unset, str] = 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_id = self.edge_id - face_id = self.face_id - object_id = self.object_id - type = self.type +class solid3d_get_prev_adjacent_edge(BaseModel): + """Gets the previous adjacent edge for the given edge, along the given face.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if edge_id is not UNSET: - field_dict["edge_id"] = edge_id - if face_id is not UNSET: - field_dict["face_id"] = face_id - if object_id is not UNSET: - field_dict["object_id"] = object_id - field_dict["type"] = type + edge_id: UUID - return field_dict + face_id: UUID - @classmethod - def from_dict(cls: Type[SX], src_dict: Dict[str, Any]) -> SX: - d = src_dict.copy() - edge_id = d.pop("edge_id", UNSET) + object_id: UUID - face_id = d.pop("face_id", UNSET) - - object_id = d.pop("object_id", UNSET) - - type = d.pop("type", UNSET) - - solid3d_get_next_adjacent_edge = cls( - edge_id=edge_id, - face_id=face_id, - object_id=object_id, - type=type, - ) - - 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 - - -CN = TypeVar("CN", bound="solid3d_get_prev_adjacent_edge") - - -@attr.s(auto_attribs=True) -class solid3d_get_prev_adjacent_edge: - """Gets the previous adjacent edge for the given edge, along the given face.""" # noqa: E501 - - edge_id: Union[Unset, str] = UNSET - face_id: Union[Unset, str] = UNSET - object_id: Union[Unset, str] = 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_id = self.edge_id - face_id = self.face_id - object_id = self.object_id - type = self.type +class send_object(BaseModel): + """Sends object to front or back.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if edge_id is not UNSET: - field_dict["edge_id"] = edge_id - if face_id is not UNSET: - field_dict["face_id"] = face_id - if object_id is not UNSET: - field_dict["object_id"] = object_id - field_dict["type"] = type + front: bool - return field_dict + object_id: UUID - @classmethod - def from_dict(cls: Type[CN], src_dict: Dict[str, Any]) -> CN: - d = src_dict.copy() - edge_id = d.pop("edge_id", UNSET) - - face_id = d.pop("face_id", UNSET) - - object_id = d.pop("object_id", UNSET) - - type = d.pop("type", UNSET) - - solid3d_get_prev_adjacent_edge = cls( - edge_id=edge_id, - face_id=face_id, - object_id=object_id, - type=type, - ) - - 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 - - -GS = TypeVar("GS", 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 +class entity_set_opacity(BaseModel): + """Set opacity of the entity.""" - 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 + entity_id: UUID - return field_dict + opacity: float - @classmethod - def from_dict(cls: Type[GS], src_dict: Dict[str, Any]) -> GS: - 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 - - -SO = TypeVar("SO", 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 +class entity_fade(BaseModel): + """Fade the entity in or out.""" - 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 + duration_seconds: Optional[float] = None - return field_dict + entity_id: UUID - @classmethod - def from_dict(cls: Type[SO], src_dict: Dict[str, Any]) -> SO: - d = src_dict.copy() - entity_id = d.pop("entity_id", UNSET) + fade_in: bool - 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 - - -ZS = TypeVar("ZS", 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 +class make_plane(BaseModel): + """Make a plane.""" - 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 + clobber: bool - return field_dict + hide: Optional[bool] = None - @classmethod - def from_dict(cls: Type[ZS], src_dict: Dict[str, Any]) -> ZS: - d = src_dict.copy() - duration_seconds = d.pop("duration_seconds", UNSET) + origin: Point3d - entity_id = d.pop("entity_id", UNSET) + size: float - 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 - - -AM = TypeVar("AM", bound="make_plane") - - -@attr.s(auto_attribs=True) -class make_plane: - """Make a plane.""" # noqa: E501 - - clobber: Union[Unset, bool] = False - hide: 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) + x_axis: Point3d - def to_dict(self) -> Dict[str, Any]: - clobber = self.clobber - hide = self.hide - origin: Union[Unset, Point3d] = UNSET - if not isinstance(self.origin, Unset): - origin = self.origin - size = self.size - type = self.type - x_axis: Union[Unset, Point3d] = UNSET - if not isinstance(self.x_axis, Unset): - x_axis = self.x_axis - y_axis: Union[Unset, Point3d] = UNSET - 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 hide is not UNSET: - field_dict["hide"] = hide - if origin is not UNSET: - _origin: Point3d = cast(Point3d, origin) - field_dict["origin"] = _origin.to_dict() - if size is not UNSET: - field_dict["size"] = size - field_dict["type"] = type - if x_axis is not UNSET: - _x_axis: Point3d = cast(Point3d, x_axis) - field_dict["x_axis"] = _x_axis.to_dict() - if y_axis is not UNSET: - _y_axis: Point3d = cast(Point3d, y_axis) - field_dict["y_axis"] = _y_axis.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[AM], src_dict: Dict[str, Any]) -> AM: - d = src_dict.copy() - clobber = d.pop("clobber", UNSET) - - hide = d.pop("hide", UNSET) - - _origin = d.pop("origin", UNSET) - origin: Union[Unset, Point3d] - if isinstance(_origin, Unset): - origin = UNSET - if _origin is None: - origin = UNSET - else: - origin = Point3d.from_dict(_origin) - - 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 - if _x_axis is None: - x_axis = UNSET - else: - x_axis = Point3d.from_dict(_x_axis) - - _y_axis = d.pop("y_axis", UNSET) - y_axis: Union[Unset, Point3d] - if isinstance(_y_axis, Unset): - y_axis = UNSET - if _y_axis is None: - y_axis = UNSET - else: - y_axis = Point3d.from_dict(_y_axis) - - make_plane = cls( - clobber=clobber, - hide=hide, - 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 + y_axis: Point3d -GK = TypeVar("GK", bound="plane_set_color") +class plane_set_color(BaseModel): + """Set the plane's color.""" + color: Color -@attr.s(auto_attribs=True) -class plane_set_color: - """Set the plane's color.""" # noqa: E501 + plane_id: UUID - 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]: - color: Union[Unset, Color] = UNSET - if not isinstance(self.color, Unset): - color = self.color - plane_id = self.plane_id - type = self.type +class set_tool(BaseModel): + """Set the active tool.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if color is not UNSET: - _color: Color = cast(Color, color) - field_dict["color"] = _color.to_dict() - if plane_id is not UNSET: - field_dict["plane_id"] = plane_id - field_dict["type"] = type + tool: SceneToolType - return field_dict - - @classmethod - def from_dict(cls: Type[GK], src_dict: Dict[str, Any]) -> GK: - d = src_dict.copy() - _color = d.pop("color", UNSET) - color: Union[Unset, Color] - if isinstance(_color, Unset): - color = UNSET - if _color is None: - color = UNSET - else: - color = Color.from_dict(_color) - - 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 - - -SG = TypeVar("SG", 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]: - tool: Union[Unset, SceneToolType] = UNSET - if not isinstance(self.tool, Unset): - tool = self.tool - type = self.type +class mouse_move(BaseModel): + """Send a mouse move event.""" - 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 + sequence: Optional[int] = None - return field_dict - - @classmethod - def from_dict(cls: Type[SG], src_dict: Dict[str, Any]) -> SG: - d = src_dict.copy() - _tool = d.pop("tool", UNSET) - tool: Union[Unset, SceneToolType] - if isinstance(_tool, Unset): - tool = UNSET - if _tool is None: - tool = UNSET - else: - tool = _tool - - 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 - - -QZ = TypeVar("QZ", bound="mouse_move") - - -@attr.s(auto_attribs=True) -class mouse_move: - """Send a mouse move event.""" # noqa: E501 - - sequence: Union[Unset, int] = UNSET 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]: - sequence = self.sequence - type = self.type - window: Union[Unset, Point2d] = UNSET - if not isinstance(self.window, Unset): - window = self.window - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if sequence is not UNSET: - field_dict["sequence"] = sequence - field_dict["type"] = type - if window is not UNSET: - _window: Point2d = cast(Point2d, window) - field_dict["window"] = _window.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[QZ], src_dict: Dict[str, Any]) -> QZ: - d = src_dict.copy() - sequence = d.pop("sequence", UNSET) - - type = d.pop("type", UNSET) - - _window = d.pop("window", UNSET) - window: Union[Unset, Point2d] - if isinstance(_window, Unset): - window = UNSET - if _window is None: - window = UNSET - else: - window = Point2d.from_dict(_window) - - mouse_move = cls( - sequence=sequence, - 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 + window: Point2d -SY = TypeVar("SY", bound="mouse_click") - - -@attr.s(auto_attribs=True) -class mouse_click: - """Send a mouse click event. Updates modified/selected entities.""" # noqa: E501 +class mouse_click(BaseModel): + """Send a mouse click event. Updates modified/selected entities.""" 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 - window: Union[Unset, Point2d] = UNSET - 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: - _window: Point2d = cast(Point2d, window) - field_dict["window"] = _window.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[SY], src_dict: Dict[str, Any]) -> SY: - d = src_dict.copy() - type = d.pop("type", UNSET) - - _window = d.pop("window", UNSET) - window: Union[Unset, Point2d] - if isinstance(_window, Unset): - window = UNSET - if _window is None: - window = UNSET - else: - window = Point2d.from_dict(_window) - - 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 + window: Point2d -YK = TypeVar("YK", bound="sketch_mode_enable") +class sketch_mode_enable(BaseModel): + """Enable sketch mode on the given plane.""" + animated: bool -@attr.s(auto_attribs=True) -class sketch_mode_enable: - """Enable sketch mode on the given plane.""" # noqa: E501 + disable_camera_with_plane: Optional[Point3d] = None + + ortho: bool + + plane_id: UUID - animated: Union[Unset, bool] = False - disable_camera_with_plane: Union[Unset, Point3d] = UNSET - 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 - disable_camera_with_plane: Union[Unset, Point3d] = UNSET - if not isinstance(self.disable_camera_with_plane, Unset): - disable_camera_with_plane = self.disable_camera_with_plane - 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 disable_camera_with_plane is not UNSET: - _disable_camera_with_plane: Point3d = cast( - Point3d, disable_camera_with_plane - ) - field_dict[ - "disable_camera_with_plane" - ] = _disable_camera_with_plane.to_dict() - 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[YK], src_dict: Dict[str, Any]) -> YK: - d = src_dict.copy() - animated = d.pop("animated", UNSET) - - _disable_camera_with_plane = d.pop("disable_camera_with_plane", UNSET) - disable_camera_with_plane: Union[Unset, Point3d] - if isinstance(_disable_camera_with_plane, Unset): - disable_camera_with_plane = UNSET - if _disable_camera_with_plane is None: - disable_camera_with_plane = UNSET - else: - disable_camera_with_plane = Point3d.from_dict(_disable_camera_with_plane) - - ortho = d.pop("ortho", UNSET) - - plane_id = d.pop("plane_id", UNSET) - - type = d.pop("type", UNSET) - - sketch_mode_enable = cls( - animated=animated, - disable_camera_with_plane=disable_camera_with_plane, - 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 - - -WS = TypeVar("WS", bound="sketch_mode_disable") - - -@attr.s(auto_attribs=True) -class sketch_mode_disable: - """Disable sketch mode.""" # noqa: E501 +class sketch_mode_disable(BaseModel): + """Disable sketch mode.""" 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 +class curve_get_type(BaseModel): + """Get type of a given curve.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type + curve_id: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[WS], src_dict: Dict[str, Any]) -> WS: - 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 - - -SL = TypeVar("SL", 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 +class curve_get_control_points(BaseModel): + """Get control points of a given curve.""" - 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 + curve_id: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[SL], src_dict: Dict[str, Any]) -> SL: - 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 - - -MK = TypeVar("MK", 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 +class take_snapshot(BaseModel): + """Take a snapshot.""" - 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 + format: ImageFormat - return field_dict - - @classmethod - def from_dict(cls: Type[MK], src_dict: Dict[str, Any]) -> MK: - 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 - - -TU = TypeVar("TU", 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]: - format: Union[Unset, ImageFormat] = UNSET - if not isinstance(self.format, Unset): - format = self.format - type = self.type +class make_axes_gizmo(BaseModel): + """Add a gizmo showing the axes.""" - 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 + clobber: bool - return field_dict + gizmo_mode: bool - @classmethod - def from_dict(cls: Type[TU], src_dict: Dict[str, Any]) -> TU: - d = src_dict.copy() - _format = d.pop("format", UNSET) - format: Union[Unset, ImageFormat] - if isinstance(_format, Unset): - format = UNSET - if _format is None: - format = UNSET - else: - format = _format - - 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 - - -FY = TypeVar("FY", 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 +class path_get_info(BaseModel): + """Query the given path""" - 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 + path_id: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[FY], src_dict: Dict[str, Any]) -> FY: - 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 - - -FD = TypeVar("FD", 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 +class path_get_curve_uuids_for_vertices(BaseModel): + """Get curves for vertices within a path""" - 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 + path_id: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[FD], src_dict: Dict[str, Any]) -> FD: - 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 - - -TZ = TypeVar("TZ", bound="path_get_curve_uuids_for_vertices") - - -@attr.s(auto_attribs=True) -class path_get_curve_uuids_for_vertices: - """Get curves for vertices within a path""" # noqa: E501 - - path_id: Union[Unset, str] = UNSET type: str = "path_get_curve_uuids_for_vertices" - vertex_ids: Union[Unset, List[str]] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - path_id = self.path_id - type = self.type - vertex_ids: Union[Unset, List[str]] = UNSET - if not isinstance(self.vertex_ids, Unset): - vertex_ids = self.vertex_ids - - 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 - if vertex_ids is not UNSET: - field_dict["vertex_ids"] = vertex_ids - - return field_dict - - @classmethod - def from_dict(cls: Type[TZ], src_dict: Dict[str, Any]) -> TZ: - d = src_dict.copy() - path_id = d.pop("path_id", UNSET) - - type = d.pop("type", UNSET) - - vertex_ids = cast(List[str], d.pop("vertex_ids", UNSET)) - - path_get_curve_uuids_for_vertices = cls( - path_id=path_id, - type=type, - vertex_ids=vertex_ids, - ) - - path_get_curve_uuids_for_vertices.additional_properties = d - return path_get_curve_uuids_for_vertices - - @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 + vertex_ids: List[UUID] -AX = TypeVar("AX", bound="path_get_vertex_uuids") +class path_get_vertex_uuids(BaseModel): + """Get vertices within a path""" + path_id: UUID -@attr.s(auto_attribs=True) -class path_get_vertex_uuids: - """Get vertices within a path""" # noqa: E501 - - path_id: Union[Unset, str] = UNSET type: str = "path_get_vertex_uuids" - 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[AX], src_dict: Dict[str, Any]) -> AX: - d = src_dict.copy() - path_id = d.pop("path_id", UNSET) - - type = d.pop("type", UNSET) - - path_get_vertex_uuids = cls( - path_id=path_id, - type=type, - ) - - path_get_vertex_uuids.additional_properties = d - return path_get_vertex_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 - - -RQ = TypeVar("RQ", bound="handle_mouse_drag_start") - - -@attr.s(auto_attribs=True) -class handle_mouse_drag_start: - """Start dragging mouse.""" # noqa: E501 +class handle_mouse_drag_start(BaseModel): + """Start dragging mouse.""" 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 - window: Union[Unset, Point2d] = UNSET - 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: - _window: Point2d = cast(Point2d, window) - field_dict["window"] = _window.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[RQ], src_dict: Dict[str, Any]) -> RQ: - d = src_dict.copy() - type = d.pop("type", UNSET) - - _window = d.pop("window", UNSET) - window: Union[Unset, Point2d] - if isinstance(_window, Unset): - window = UNSET - if _window is None: - window = UNSET - else: - window = Point2d.from_dict(_window) - - 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 + window: Point2d -ZL = TypeVar("ZL", bound="handle_mouse_drag_move") +class handle_mouse_drag_move(BaseModel): + """Continue dragging mouse.""" + sequence: Optional[int] = None -@attr.s(auto_attribs=True) -class handle_mouse_drag_move: - """Continue dragging mouse.""" # noqa: E501 - - sequence: Union[Unset, int] = UNSET 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]: - sequence = self.sequence - type = self.type - window: Union[Unset, Point2d] = UNSET - if not isinstance(self.window, Unset): - window = self.window - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if sequence is not UNSET: - field_dict["sequence"] = sequence - field_dict["type"] = type - if window is not UNSET: - _window: Point2d = cast(Point2d, window) - field_dict["window"] = _window.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[ZL], src_dict: Dict[str, Any]) -> ZL: - d = src_dict.copy() - sequence = d.pop("sequence", UNSET) - - type = d.pop("type", UNSET) - - _window = d.pop("window", UNSET) - window: Union[Unset, Point2d] - if isinstance(_window, Unset): - window = UNSET - if _window is None: - window = UNSET - else: - window = Point2d.from_dict(_window) - - handle_mouse_drag_move = cls( - sequence=sequence, - 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 + window: Point2d -CM = TypeVar("CM", bound="handle_mouse_drag_end") - - -@attr.s(auto_attribs=True) -class handle_mouse_drag_end: - """Stop dragging mouse.""" # noqa: E501 +class handle_mouse_drag_end(BaseModel): + """Stop dragging mouse.""" 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 - window: Union[Unset, Point2d] = UNSET - 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: - _window: Point2d = cast(Point2d, window) - field_dict["window"] = _window.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[CM], src_dict: Dict[str, Any]) -> CM: - d = src_dict.copy() - type = d.pop("type", UNSET) - - _window = d.pop("window", UNSET) - window: Union[Unset, Point2d] - if isinstance(_window, Unset): - window = UNSET - if _window is None: - window = UNSET - else: - window = Point2d.from_dict(_window) - - 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 + window: Point2d -OS = TypeVar("OS", bound="remove_scene_objects") +class remove_scene_objects(BaseModel): + """Remove scene objects.""" + object_ids: List[UUID] -@attr.s(auto_attribs=True) -class remove_scene_objects: - """Remove scene objects.""" # noqa: E501 - - object_ids: Union[Unset, List[str]] = UNSET type: str = "remove_scene_objects" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - object_ids: Union[Unset, List[str]] = UNSET - if not isinstance(self.object_ids, Unset): - object_ids = self.object_ids - type = self.type +class plane_intersect_and_project(BaseModel): + """Utility method. Performs both a ray cast and projection to plane-local coordinates. Returns the plane coordinates for the given window coordinates.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if object_ids is not UNSET: - field_dict["object_ids"] = object_ids - field_dict["type"] = type + plane_id: UUID - return field_dict - - @classmethod - def from_dict(cls: Type[OS], src_dict: Dict[str, Any]) -> OS: - d = src_dict.copy() - object_ids = cast(List[str], d.pop("object_ids", UNSET)) - - type = d.pop("type", UNSET) - - remove_scene_objects = cls( - object_ids=object_ids, - type=type, - ) - - remove_scene_objects.additional_properties = d - return remove_scene_objects - - @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="plane_intersect_and_project") - - -@attr.s(auto_attribs=True) -class plane_intersect_and_project: - """Utility method. Performs both a ray cast and projection to plane-local coordinates. Returns the plane coordinates for the given window coordinates.""" # noqa: E501 - - plane_id: Union[Unset, str] = UNSET type: str = "plane_intersect_and_project" - window: Union[Unset, Point2d] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - plane_id = self.plane_id - type = self.type - window: Union[Unset, Point2d] = UNSET - if not isinstance(self.window, Unset): - window = self.window - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if plane_id is not UNSET: - field_dict["plane_id"] = plane_id - field_dict["type"] = type - if window is not UNSET: - _window: Point2d = cast(Point2d, window) - field_dict["window"] = _window.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[WP], src_dict: Dict[str, Any]) -> WP: - d = src_dict.copy() - plane_id = d.pop("plane_id", UNSET) - - type = d.pop("type", UNSET) - - _window = d.pop("window", UNSET) - window: Union[Unset, Point2d] - if isinstance(_window, Unset): - window = UNSET - if _window is None: - window = UNSET - else: - window = Point2d.from_dict(_window) - - plane_intersect_and_project = cls( - plane_id=plane_id, - type=type, - window=window, - ) - - plane_intersect_and_project.additional_properties = d - return plane_intersect_and_project - - @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 + window: Point2d -XO = TypeVar("XO", bound="curve_get_end_points") +class curve_get_end_points(BaseModel): + """Find the start and end of a curve.""" + curve_id: UUID -@attr.s(auto_attribs=True) -class curve_get_end_points: - """Find the start and end of a curve.""" # noqa: E501 - - curve_id: Union[Unset, str] = UNSET type: str = "curve_get_end_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 +class reconfigure_stream(BaseModel): + """Reconfigure the stream.""" - 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 + fps: int - return field_dict + height: int - @classmethod - def from_dict(cls: Type[XO], src_dict: Dict[str, Any]) -> XO: - d = src_dict.copy() - curve_id = d.pop("curve_id", UNSET) - - type = d.pop("type", UNSET) - - curve_get_end_points = cls( - curve_id=curve_id, - type=type, - ) - - curve_get_end_points.additional_properties = d - return curve_get_end_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 - - -LN = TypeVar("LN", bound="reconfigure_stream") - - -@attr.s(auto_attribs=True) -class reconfigure_stream: - """Reconfigure the stream.""" # noqa: E501 - - fps: Union[Unset, int] = UNSET - height: Union[Unset, int] = UNSET type: str = "reconfigure_stream" - width: Union[Unset, int] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - fps = self.fps - height = self.height - type = self.type - width = self.width - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if fps is not UNSET: - field_dict["fps"] = fps - if height is not UNSET: - field_dict["height"] = height - field_dict["type"] = type - if width is not UNSET: - field_dict["width"] = width - - return field_dict - - @classmethod - def from_dict(cls: Type[LN], src_dict: Dict[str, Any]) -> LN: - d = src_dict.copy() - fps = d.pop("fps", UNSET) - - height = d.pop("height", UNSET) - - type = d.pop("type", UNSET) - - width = d.pop("width", UNSET) - - reconfigure_stream = cls( - fps=fps, - height=height, - type=type, - width=width, - ) - - reconfigure_stream.additional_properties = d - return reconfigure_stream - - @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 + width: int -KR = TypeVar("KR", bound="import_files") +class import_files(BaseModel): + """Import files to the current model.""" + files: List[ImportFile] -@attr.s(auto_attribs=True) -class import_files: - """Import files to the current model.""" # noqa: E501 + format: InputFormat - from ..models.import_file import ImportFile - - files: Union[Unset, List[ImportFile]] = UNSET - format: Union[Unset, InputFormat] = UNSET type: str = "import_files" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - from ..models.import_file import ImportFile +class mass(BaseModel): + """Get the mass of entities in the scene or the default scene.""" - files: Union[Unset, List[ImportFile]] = UNSET - if not isinstance(self.files, Unset): - files = self.files - format: Union[Unset, InputFormat] = UNSET - if not isinstance(self.format, Unset): - format = self.format - type = self.type + entity_ids: List[UUID] - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if files is not UNSET: - field_dict["files"] = files - if format is not UNSET: - _format: InputFormat = cast(InputFormat, format) - field_dict["format"] = _format.to_dict() - field_dict["type"] = type + material_density: float - return field_dict + material_density_unit: UnitDensity - @classmethod - def from_dict(cls: Type[KR], src_dict: Dict[str, Any]) -> KR: - d = src_dict.copy() - from ..models.import_file import ImportFile + output_unit: UnitMass - files = cast(List[ImportFile], d.pop("files", UNSET)) + source_unit: UnitLength - _format = d.pop("format", UNSET) - format: Union[Unset, InputFormat] - if isinstance(_format, Unset): - format = UNSET - if _format is None: - format = UNSET - else: - format = InputFormat.from_dict(_format) - - type = d.pop("type", UNSET) - - import_files = cls( - files=files, - format=format, - type=type, - ) - - import_files.additional_properties = d - return import_files - - @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 - - -MG = TypeVar("MG", bound="mass") - - -@attr.s(auto_attribs=True) -class mass: - """Get the mass of entities in the scene or the default scene.""" # noqa: E501 - - entity_ids: Union[Unset, List[str]] = UNSET - material_density: Union[Unset, float] = UNSET - material_density_unit: Union[Unset, UnitDensity] = UNSET - output_unit: Union[Unset, UnitMass] = UNSET - source_unit: Union[Unset, UnitLength] = UNSET type: str = "mass" - 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 - material_density = self.material_density - material_density_unit: Union[Unset, UnitDensity] = UNSET - if not isinstance(self.material_density_unit, Unset): - material_density_unit = self.material_density_unit - output_unit: Union[Unset, UnitMass] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - source_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.source_unit, Unset): - source_unit = self.source_unit - type = self.type +class density(BaseModel): + """Get the density of entities in the scene or the default scene.""" - 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 material_density is not UNSET: - field_dict["material_density"] = material_density - if material_density_unit is not UNSET: - field_dict["material_density_unit"] = material_density_unit - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if source_unit is not UNSET: - field_dict["source_unit"] = source_unit - field_dict["type"] = type + entity_ids: List[UUID] - return field_dict + material_mass: float - @classmethod - def from_dict(cls: Type[MG], src_dict: Dict[str, Any]) -> MG: - d = src_dict.copy() - entity_ids = cast(List[str], d.pop("entity_ids", UNSET)) + material_mass_unit: UnitMass - material_density = d.pop("material_density", UNSET) + output_unit: UnitDensity - _material_density_unit = d.pop("material_density_unit", UNSET) - material_density_unit: Union[Unset, UnitDensity] - if isinstance(_material_density_unit, Unset): - material_density_unit = UNSET - if _material_density_unit is None: - material_density_unit = UNSET - else: - material_density_unit = _material_density_unit + source_unit: UnitLength - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitMass] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _source_unit = d.pop("source_unit", UNSET) - source_unit: Union[Unset, UnitLength] - if isinstance(_source_unit, Unset): - source_unit = UNSET - if _source_unit is None: - source_unit = UNSET - else: - source_unit = _source_unit - - type = d.pop("type", UNSET) - - mass = cls( - entity_ids=entity_ids, - material_density=material_density, - material_density_unit=material_density_unit, - output_unit=output_unit, - source_unit=source_unit, - type=type, - ) - - mass.additional_properties = d - return mass - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -UE = TypeVar("UE", bound="density") - - -@attr.s(auto_attribs=True) -class density: - """Get the density of entities in the scene or the default scene.""" # noqa: E501 - - entity_ids: Union[Unset, List[str]] = UNSET - material_mass: Union[Unset, float] = UNSET - material_mass_unit: Union[Unset, UnitMass] = UNSET - output_unit: Union[Unset, UnitDensity] = UNSET - source_unit: Union[Unset, UnitLength] = UNSET type: str = "density" - 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 - material_mass = self.material_mass - material_mass_unit: Union[Unset, UnitMass] = UNSET - if not isinstance(self.material_mass_unit, Unset): - material_mass_unit = self.material_mass_unit - output_unit: Union[Unset, UnitDensity] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - source_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.source_unit, Unset): - source_unit = self.source_unit - type = self.type +class volume(BaseModel): + """Get the volume of entities in the scene or the default scene.""" - 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 material_mass is not UNSET: - field_dict["material_mass"] = material_mass - if material_mass_unit is not UNSET: - field_dict["material_mass_unit"] = material_mass_unit - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if source_unit is not UNSET: - field_dict["source_unit"] = source_unit - field_dict["type"] = type + entity_ids: List[UUID] - return field_dict + output_unit: UnitVolume - @classmethod - def from_dict(cls: Type[UE], src_dict: Dict[str, Any]) -> UE: - d = src_dict.copy() - entity_ids = cast(List[str], d.pop("entity_ids", UNSET)) + source_unit: UnitLength - material_mass = d.pop("material_mass", UNSET) - - _material_mass_unit = d.pop("material_mass_unit", UNSET) - material_mass_unit: Union[Unset, UnitMass] - if isinstance(_material_mass_unit, Unset): - material_mass_unit = UNSET - if _material_mass_unit is None: - material_mass_unit = UNSET - else: - material_mass_unit = _material_mass_unit - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitDensity] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _source_unit = d.pop("source_unit", UNSET) - source_unit: Union[Unset, UnitLength] - if isinstance(_source_unit, Unset): - source_unit = UNSET - if _source_unit is None: - source_unit = UNSET - else: - source_unit = _source_unit - - type = d.pop("type", UNSET) - - density = cls( - entity_ids=entity_ids, - material_mass=material_mass, - material_mass_unit=material_mass_unit, - output_unit=output_unit, - source_unit=source_unit, - type=type, - ) - - density.additional_properties = d - return density - - @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 - - -BF = TypeVar("BF", bound="volume") - - -@attr.s(auto_attribs=True) -class volume: - """Get the volume of entities in the scene or the default scene.""" # noqa: E501 - - entity_ids: Union[Unset, List[str]] = UNSET - output_unit: Union[Unset, UnitVolume] = UNSET - source_unit: Union[Unset, UnitLength] = UNSET type: str = "volume" - 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 - output_unit: Union[Unset, UnitVolume] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - source_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.source_unit, Unset): - source_unit = self.source_unit - type = self.type +class center_of_mass(BaseModel): + """Get the center of mass of entities in the scene or the default scene.""" - 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 output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if source_unit is not UNSET: - field_dict["source_unit"] = source_unit - field_dict["type"] = type + entity_ids: List[UUID] - return field_dict + output_unit: UnitLength - @classmethod - def from_dict(cls: Type[BF], src_dict: Dict[str, Any]) -> BF: - d = src_dict.copy() - entity_ids = cast(List[str], d.pop("entity_ids", UNSET)) + source_unit: UnitLength - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitVolume] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _source_unit = d.pop("source_unit", UNSET) - source_unit: Union[Unset, UnitLength] - if isinstance(_source_unit, Unset): - source_unit = UNSET - if _source_unit is None: - source_unit = UNSET - else: - source_unit = _source_unit - - type = d.pop("type", UNSET) - - volume = cls( - entity_ids=entity_ids, - output_unit=output_unit, - source_unit=source_unit, - type=type, - ) - - volume.additional_properties = d - return volume - - @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 - - -UU = TypeVar("UU", bound="center_of_mass") - - -@attr.s(auto_attribs=True) -class center_of_mass: - """Get the center of mass of entities in the scene or the default scene.""" # noqa: E501 - - entity_ids: Union[Unset, List[str]] = UNSET - output_unit: Union[Unset, UnitLength] = UNSET - source_unit: Union[Unset, UnitLength] = UNSET type: str = "center_of_mass" - 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 - output_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - source_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.source_unit, Unset): - source_unit = self.source_unit - type = self.type +class surface_area(BaseModel): + """Get the surface area of entities in the scene or the default scene.""" - 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 output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if source_unit is not UNSET: - field_dict["source_unit"] = source_unit - field_dict["type"] = type + entity_ids: List[UUID] - return field_dict + output_unit: UnitArea - @classmethod - def from_dict(cls: Type[UU], src_dict: Dict[str, Any]) -> UU: - d = src_dict.copy() - entity_ids = cast(List[str], d.pop("entity_ids", UNSET)) + source_unit: UnitLength - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitLength] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _source_unit = d.pop("source_unit", UNSET) - source_unit: Union[Unset, UnitLength] - if isinstance(_source_unit, Unset): - source_unit = UNSET - if _source_unit is None: - source_unit = UNSET - else: - source_unit = _source_unit - - type = d.pop("type", UNSET) - - center_of_mass = cls( - entity_ids=entity_ids, - output_unit=output_unit, - source_unit=source_unit, - type=type, - ) - - center_of_mass.additional_properties = d - return center_of_mass - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -MB = TypeVar("MB", bound="surface_area") - - -@attr.s(auto_attribs=True) -class surface_area: - """Get the surface area of entities in the scene or the default scene.""" # noqa: E501 - - entity_ids: Union[Unset, List[str]] = UNSET - output_unit: Union[Unset, UnitArea] = UNSET - source_unit: Union[Unset, UnitLength] = UNSET type: str = "surface_area" - 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 - output_unit: Union[Unset, UnitArea] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - source_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.source_unit, Unset): - source_unit = self.source_unit - 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 output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if source_unit is not UNSET: - field_dict["source_unit"] = source_unit - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[MB], src_dict: Dict[str, Any]) -> MB: - d = src_dict.copy() - entity_ids = cast(List[str], d.pop("entity_ids", UNSET)) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitArea] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _source_unit = d.pop("source_unit", UNSET) - source_unit: Union[Unset, UnitLength] - if isinstance(_source_unit, Unset): - source_unit = UNSET - if _source_unit is None: - source_unit = UNSET - else: - source_unit = _source_unit - - type = d.pop("type", UNSET) - - surface_area = cls( - entity_ids=entity_ids, - output_unit=output_unit, - source_unit=source_unit, - type=type, - ) - - surface_area.additional_properties = d - return surface_area - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -TB = TypeVar("TB", bound="get_sketch_mode_plane") - - -@attr.s(auto_attribs=True) -class get_sketch_mode_plane: - """Get the plane of the sketch mode. This is useful for getting the normal of the plane after a user selects a plane.""" # noqa: E501 +class get_sketch_mode_plane(BaseModel): + """Get the plane of the sketch mode. This is useful for getting the normal of the plane after a user selects a plane.""" type: str = "get_sketch_mode_plane" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - type = self.type +class curve_set_constraint(BaseModel): + """Constrain a curve.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type + constraint_bound: PathComponentConstraintBound - return field_dict + constraint_type: PathComponentConstraintType - @classmethod - def from_dict(cls: Type[TB], src_dict: Dict[str, Any]) -> TB: - d = src_dict.copy() - type = d.pop("type", UNSET) + object_id: UUID - get_sketch_mode_plane = cls( - type=type, - ) - - get_sketch_mode_plane.additional_properties = d - return get_sketch_mode_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 - - -FJ = TypeVar("FJ", bound="curve_set_constraint") - - -@attr.s(auto_attribs=True) -class curve_set_constraint: - """Constrain a curve.""" # noqa: E501 - - constraint_bound: Union[Unset, PathComponentConstraintBound] = UNSET - constraint_type: Union[Unset, PathComponentConstraintType] = UNSET - object_id: Union[Unset, str] = UNSET type: str = "curve_set_constraint" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - constraint_bound: Union[Unset, PathComponentConstraintBound] = UNSET - if not isinstance(self.constraint_bound, Unset): - constraint_bound = self.constraint_bound - constraint_type: Union[Unset, PathComponentConstraintType] = UNSET - if not isinstance(self.constraint_type, Unset): - constraint_type = self.constraint_type - object_id = self.object_id - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if constraint_bound is not UNSET: - field_dict["constraint_bound"] = constraint_bound - if constraint_type is not UNSET: - field_dict["constraint_type"] = constraint_type - 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[FJ], src_dict: Dict[str, Any]) -> FJ: - d = src_dict.copy() - _constraint_bound = d.pop("constraint_bound", UNSET) - constraint_bound: Union[Unset, PathComponentConstraintBound] - if isinstance(_constraint_bound, Unset): - constraint_bound = UNSET - if _constraint_bound is None: - constraint_bound = UNSET - else: - constraint_bound = _constraint_bound - - _constraint_type = d.pop("constraint_type", UNSET) - constraint_type: Union[Unset, PathComponentConstraintType] - if isinstance(_constraint_type, Unset): - constraint_type = UNSET - if _constraint_type is None: - constraint_type = UNSET - else: - constraint_type = _constraint_type - - object_id = d.pop("object_id", UNSET) - - type = d.pop("type", UNSET) - - curve_set_constraint = cls( - constraint_bound=constraint_bound, - constraint_type=constraint_type, - object_id=object_id, - type=type, - ) - - curve_set_constraint.additional_properties = d - return curve_set_constraint - - @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 - GY = TypeVar("GY", bound="ModelingCmd") @@ -5230,510 +884,526 @@ class ModelingCmd: ): self.type = type - def to_dict(self) -> Dict[str, Any]: + def model_dump(self) -> Dict[str, Any]: if isinstance(self.type, start_path): - HB: start_path = self.type - return HB.to_dict() + ON: start_path = self.type + return ON.model_dump() elif isinstance(self.type, move_path_pen): - DU: move_path_pen = self.type - return DU.to_dict() + US: move_path_pen = self.type + return US.model_dump() elif isinstance(self.type, extend_path): - TY: extend_path = self.type - return TY.to_dict() + FH: extend_path = self.type + return FH.model_dump() elif isinstance(self.type, extrude): - GP: extrude = self.type - return GP.to_dict() + BB: extrude = self.type + return BB.model_dump() elif isinstance(self.type, close_path): - YO: close_path = self.type - return YO.to_dict() + TV: close_path = self.type + return TV.model_dump() elif isinstance(self.type, camera_drag_start): - WN: camera_drag_start = self.type - return WN.to_dict() + CE: camera_drag_start = self.type + return CE.model_dump() elif isinstance(self.type, camera_drag_move): - UW: camera_drag_move = self.type - return UW.to_dict() + LT: camera_drag_move = self.type + return LT.model_dump() elif isinstance(self.type, camera_drag_end): - HD: camera_drag_end = self.type - return HD.to_dict() + YY: camera_drag_end = self.type + return YY.model_dump() elif isinstance(self.type, default_camera_look_at): - RU: default_camera_look_at = self.type - return RU.to_dict() + FZ: default_camera_look_at = self.type + return FZ.model_dump() elif isinstance(self.type, default_camera_zoom): - QT: default_camera_zoom = self.type - return QT.to_dict() + NN: default_camera_zoom = self.type + return NN.model_dump() elif isinstance(self.type, default_camera_enable_sketch_mode): - HR: default_camera_enable_sketch_mode = self.type - return HR.to_dict() + VI: default_camera_enable_sketch_mode = self.type + return VI.model_dump() elif isinstance(self.type, default_camera_disable_sketch_mode): - VM: default_camera_disable_sketch_mode = self.type - return VM.to_dict() + QF: default_camera_disable_sketch_mode = self.type + return QF.model_dump() elif isinstance(self.type, default_camera_focus_on): - DQ: default_camera_focus_on = self.type - return DQ.to_dict() + OJ: default_camera_focus_on = self.type + return OJ.model_dump() elif isinstance(self.type, export): - PD: export = self.type - return PD.to_dict() + YF: export = self.type + return YF.model_dump() elif isinstance(self.type, entity_get_parent_id): - JL: entity_get_parent_id = self.type - return JL.to_dict() + LK: entity_get_parent_id = self.type + return LK.model_dump() elif isinstance(self.type, entity_get_num_children): - QA: entity_get_num_children = self.type - return QA.to_dict() + WB: entity_get_num_children = self.type + return WB.model_dump() elif isinstance(self.type, entity_get_child_uuid): - AU: entity_get_child_uuid = self.type - return AU.to_dict() + HC: entity_get_child_uuid = self.type + return HC.model_dump() elif isinstance(self.type, entity_get_all_child_uuids): - BL: entity_get_all_child_uuids = self.type - return BL.to_dict() + PV: entity_get_all_child_uuids = self.type + return PV.model_dump() elif isinstance(self.type, edit_mode_enter): - PZ: edit_mode_enter = self.type - return PZ.to_dict() + TP: edit_mode_enter = self.type + return TP.model_dump() elif isinstance(self.type, edit_mode_exit): - GE: edit_mode_exit = self.type - return GE.to_dict() + OM: edit_mode_exit = self.type + return OM.model_dump() elif isinstance(self.type, select_with_point): - HH: select_with_point = self.type - return HH.to_dict() + RS: select_with_point = self.type + return RS.model_dump() elif isinstance(self.type, select_clear): - AE: select_clear = self.type - return AE.to_dict() + MP: select_clear = self.type + return MP.model_dump() elif isinstance(self.type, select_add): - AB: select_add = self.type - return AB.to_dict() + RO: select_add = self.type + return RO.model_dump() elif isinstance(self.type, select_remove): - DW: select_remove = self.type - return DW.to_dict() + BA: select_remove = self.type + return BA.model_dump() elif isinstance(self.type, select_replace): - AV: select_replace = self.type - return AV.to_dict() + CB: select_replace = self.type + return CB.model_dump() elif isinstance(self.type, select_get): - WM: select_get = self.type - return WM.to_dict() + TO: select_get = self.type + return TO.model_dump() elif isinstance(self.type, highlight_set_entity): - MU: highlight_set_entity = self.type - return MU.to_dict() + EO: highlight_set_entity = self.type + return EO.model_dump() elif isinstance(self.type, highlight_set_entities): - WW: highlight_set_entities = self.type - return WW.to_dict() + QO: highlight_set_entities = self.type + return QO.model_dump() elif isinstance(self.type, new_annotation): - II: new_annotation = self.type - return II.to_dict() + IZ: new_annotation = self.type + return IZ.model_dump() elif isinstance(self.type, update_annotation): - OA: update_annotation = self.type - return OA.to_dict() + NK: update_annotation = self.type + return NK.model_dump() elif isinstance(self.type, object_visible): - CQ: object_visible = self.type - return CQ.to_dict() + QE: object_visible = self.type + return QE.model_dump() elif isinstance(self.type, object_bring_to_front): - RD: object_bring_to_front = self.type - return RD.to_dict() + KT: object_bring_to_front = self.type + return KT.model_dump() elif isinstance(self.type, get_entity_type): - KZ: get_entity_type = self.type - return KZ.to_dict() + GU: get_entity_type = self.type + return GU.model_dump() elif isinstance(self.type, solid2d_add_hole): - IU: solid2d_add_hole = self.type - return IU.to_dict() + UP: solid2d_add_hole = self.type + return UP.model_dump() elif isinstance(self.type, solid3d_get_all_edge_faces): - NQ: solid3d_get_all_edge_faces = self.type - return NQ.to_dict() + DJ: solid3d_get_all_edge_faces = self.type + return DJ.model_dump() elif isinstance(self.type, solid3d_get_all_opposite_edges): - BU: solid3d_get_all_opposite_edges = self.type - return BU.to_dict() + TR: solid3d_get_all_opposite_edges = self.type + return TR.model_dump() elif isinstance(self.type, solid3d_get_opposite_edge): - GR: solid3d_get_opposite_edge = self.type - return GR.to_dict() + JF: solid3d_get_opposite_edge = self.type + return JF.model_dump() elif isinstance(self.type, solid3d_get_next_adjacent_edge): - EJ: solid3d_get_next_adjacent_edge = self.type - return EJ.to_dict() + EL: solid3d_get_next_adjacent_edge = self.type + return EL.model_dump() elif isinstance(self.type, solid3d_get_prev_adjacent_edge): - LQ: solid3d_get_prev_adjacent_edge = self.type - return LQ.to_dict() + LF: solid3d_get_prev_adjacent_edge = self.type + return LF.model_dump() elif isinstance(self.type, send_object): - DP: send_object = self.type - return DP.to_dict() + GN: send_object = self.type + return GN.model_dump() elif isinstance(self.type, entity_set_opacity): - OF: entity_set_opacity = self.type - return OF.to_dict() + VJ: entity_set_opacity = self.type + return VJ.model_dump() elif isinstance(self.type, entity_fade): - OV: entity_fade = self.type - return OV.to_dict() + YW: entity_fade = self.type + return YW.model_dump() elif isinstance(self.type, make_plane): - FK: make_plane = self.type - return FK.to_dict() + NO: make_plane = self.type + return NO.model_dump() elif isinstance(self.type, plane_set_color): - PE: plane_set_color = self.type - return PE.to_dict() + RG: plane_set_color = self.type + return RG.model_dump() elif isinstance(self.type, set_tool): - FP: set_tool = self.type - return FP.to_dict() + LD: set_tool = self.type + return LD.model_dump() elif isinstance(self.type, mouse_move): - QL: mouse_move = self.type - return QL.to_dict() + TN: mouse_move = self.type + return TN.model_dump() elif isinstance(self.type, mouse_click): - ME: mouse_click = self.type - return ME.to_dict() + UG: mouse_click = self.type + return UG.model_dump() elif isinstance(self.type, sketch_mode_enable): - EB: sketch_mode_enable = self.type - return EB.to_dict() + NZ: sketch_mode_enable = self.type + return NZ.model_dump() elif isinstance(self.type, sketch_mode_disable): - VK: sketch_mode_disable = self.type - return VK.to_dict() + LO: sketch_mode_disable = self.type + return LO.model_dump() elif isinstance(self.type, curve_get_type): - ZC: curve_get_type = self.type - return ZC.to_dict() + OW: curve_get_type = self.type + return OW.model_dump() elif isinstance(self.type, curve_get_control_points): - BE: curve_get_control_points = self.type - return BE.to_dict() + PQ: curve_get_control_points = self.type + return PQ.model_dump() elif isinstance(self.type, take_snapshot): - CD: take_snapshot = self.type - return CD.to_dict() + OU: take_snapshot = self.type + return OU.model_dump() elif isinstance(self.type, make_axes_gizmo): - ZO: make_axes_gizmo = self.type - return ZO.to_dict() + XI: make_axes_gizmo = self.type + return XI.model_dump() elif isinstance(self.type, path_get_info): - EY: path_get_info = self.type - return EY.to_dict() + PS: path_get_info = self.type + return PS.model_dump() elif isinstance(self.type, path_get_curve_uuids_for_vertices): - RW: path_get_curve_uuids_for_vertices = self.type - return RW.to_dict() + XL: path_get_curve_uuids_for_vertices = self.type + return XL.model_dump() elif isinstance(self.type, path_get_vertex_uuids): - GQ: path_get_vertex_uuids = self.type - return GQ.to_dict() + FT: path_get_vertex_uuids = self.type + return FT.model_dump() elif isinstance(self.type, handle_mouse_drag_start): - GC: handle_mouse_drag_start = self.type - return GC.to_dict() + SC: handle_mouse_drag_start = self.type + return SC.model_dump() elif isinstance(self.type, handle_mouse_drag_move): - XE: handle_mouse_drag_move = self.type - return XE.to_dict() + JA: handle_mouse_drag_move = self.type + return JA.model_dump() elif isinstance(self.type, handle_mouse_drag_end): - RE: handle_mouse_drag_end = self.type - return RE.to_dict() + UK: handle_mouse_drag_end = self.type + return UK.model_dump() elif isinstance(self.type, remove_scene_objects): - MO: remove_scene_objects = self.type - return MO.to_dict() + MT: remove_scene_objects = self.type + return MT.model_dump() elif isinstance(self.type, plane_intersect_and_project): - FL: plane_intersect_and_project = self.type - return FL.to_dict() + TF: plane_intersect_and_project = self.type + return TF.model_dump() elif isinstance(self.type, curve_get_end_points): - KJ: curve_get_end_points = self.type - return KJ.to_dict() + JD: curve_get_end_points = self.type + return JD.model_dump() elif isinstance(self.type, reconfigure_stream): - PN: reconfigure_stream = self.type - return PN.to_dict() + BH: reconfigure_stream = self.type + return BH.model_dump() elif isinstance(self.type, import_files): - QY: import_files = self.type - return QY.to_dict() + CN: import_files = self.type + return CN.model_dump() elif isinstance(self.type, mass): - RC: mass = self.type - return RC.to_dict() + SO: mass = self.type + return SO.model_dump() elif isinstance(self.type, density): - XR: density = self.type - return XR.to_dict() + AM: density = self.type + return AM.model_dump() elif isinstance(self.type, volume): - ND: volume = self.type - return ND.to_dict() + SG: volume = self.type + return SG.model_dump() elif isinstance(self.type, center_of_mass): - PH: center_of_mass = self.type - return PH.to_dict() + SY: center_of_mass = self.type + return SY.model_dump() elif isinstance(self.type, surface_area): - OO: surface_area = self.type - return OO.to_dict() + WS: surface_area = self.type + return WS.model_dump() elif isinstance(self.type, get_sketch_mode_plane): - HP: get_sketch_mode_plane = self.type - return HP.to_dict() + MK: get_sketch_mode_plane = self.type + return MK.model_dump() elif isinstance(self.type, curve_set_constraint): - RL: curve_set_constraint = self.type - return RL.to_dict() + FY: curve_set_constraint = self.type + return FY.model_dump() raise Exception("Unknown type") @classmethod def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY: if d.get("type") == "start_path": - SF: start_path = start_path() - SF.from_dict(d) - return cls(type=SF) + PC: start_path = start_path(**d) + return cls(type=PC) elif d.get("type") == "move_path_pen": - BM: move_path_pen = move_path_pen() - BM.from_dict(d) - return cls(type=BM) + KQ: move_path_pen = move_path_pen(**d) + return cls(type=KQ) elif d.get("type") == "extend_path": - NC: extend_path = extend_path() - NC.from_dict(d) - return cls(type=NC) + NH: extend_path = extend_path(**d) + return cls(type=NH) elif d.get("type") == "extrude": - FF: extrude = extrude() - FF.from_dict(d) - return cls(type=FF) + PJ: extrude = extrude(**d) + return cls(type=PJ) elif d.get("type") == "close_path": - FS: close_path = close_path() - FS.from_dict(d) - return cls(type=FS) + CR: close_path = close_path(**d) + return cls(type=CR) elif d.get("type") == "camera_drag_start": - EQ: camera_drag_start = camera_drag_start() - EQ.from_dict(d) - return cls(type=EQ) + MS: camera_drag_start = camera_drag_start(**d) + return cls(type=MS) elif d.get("type") == "camera_drag_move": - MD: camera_drag_move = camera_drag_move() - MD.from_dict(d) - return cls(type=MD) + ED: camera_drag_move = camera_drag_move(**d) + return cls(type=ED) elif d.get("type") == "camera_drag_end": - UJ: camera_drag_end = camera_drag_end() - UJ.from_dict(d) - return cls(type=UJ) + DO: camera_drag_end = camera_drag_end(**d) + return cls(type=DO) elif d.get("type") == "default_camera_look_at": - DL: default_camera_look_at = default_camera_look_at() - DL.from_dict(d) - return cls(type=DL) + GL: default_camera_look_at = default_camera_look_at(**d) + return cls(type=GL) elif d.get("type") == "default_camera_zoom": - PT: default_camera_zoom = default_camera_zoom() - PT.from_dict(d) - return cls(type=PT) + OH: default_camera_zoom = default_camera_zoom(**d) + return cls(type=OH) elif d.get("type") == "default_camera_enable_sketch_mode": - VF: default_camera_enable_sketch_mode = default_camera_enable_sketch_mode() - VF.from_dict(d) - return cls(type=VF) - elif d.get("type") == "default_camera_disable_sketch_mode": - WH: default_camera_disable_sketch_mode = ( - default_camera_disable_sketch_mode() + ET: default_camera_enable_sketch_mode = default_camera_enable_sketch_mode( + **d ) - WH.from_dict(d) - return cls(type=WH) + return cls(type=ET) + elif d.get("type") == "default_camera_disable_sketch_mode": + DI: default_camera_disable_sketch_mode = default_camera_disable_sketch_mode( + **d + ) + return cls(type=DI) elif d.get("type") == "default_camera_focus_on": - UY: default_camera_focus_on = default_camera_focus_on() - UY.from_dict(d) - return cls(type=UY) + UF: default_camera_focus_on = default_camera_focus_on(**d) + return cls(type=UF) elif d.get("type") == "export": - SM: export = export() - SM.from_dict(d) - return cls(type=SM) + PY: export = export(**d) + return cls(type=PY) elif d.get("type") == "entity_get_parent_id": - CG: entity_get_parent_id = entity_get_parent_id() - CG.from_dict(d) - return cls(type=CG) + AR: entity_get_parent_id = entity_get_parent_id(**d) + return cls(type=AR) elif d.get("type") == "entity_get_num_children": - ZB: entity_get_num_children = entity_get_num_children() - ZB.from_dict(d) - return cls(type=ZB) + KK: entity_get_num_children = entity_get_num_children(**d) + return cls(type=KK) elif d.get("type") == "entity_get_child_uuid": - FX: entity_get_child_uuid = entity_get_child_uuid() - FX.from_dict(d) - return cls(type=FX) + FM: entity_get_child_uuid = entity_get_child_uuid(**d) + return cls(type=FM) elif d.get("type") == "entity_get_all_child_uuids": - KU: entity_get_all_child_uuids = entity_get_all_child_uuids() - KU.from_dict(d) - return cls(type=KU) + QI: entity_get_all_child_uuids = entity_get_all_child_uuids(**d) + return cls(type=QI) elif d.get("type") == "edit_mode_enter": - FA: edit_mode_enter = edit_mode_enter() - FA.from_dict(d) - return cls(type=FA) + CF: edit_mode_enter = edit_mode_enter(**d) + return cls(type=CF) elif d.get("type") == "edit_mode_exit": - JG: edit_mode_exit = edit_mode_exit() - JG.from_dict(d) - return cls(type=JG) + EN: edit_mode_exit = edit_mode_exit(**d) + return cls(type=EN) elif d.get("type") == "select_with_point": - RY: select_with_point = select_with_point() - RY.from_dict(d) - return cls(type=RY) + LR: select_with_point = select_with_point(**d) + return cls(type=LR) elif d.get("type") == "select_clear": - AD: select_clear = select_clear() - AD.from_dict(d) - return cls(type=AD) + WF: select_clear = select_clear(**d) + return cls(type=WF) elif d.get("type") == "select_add": - VY: select_add = select_add() - VY.from_dict(d) - return cls(type=VY) + DN: select_add = select_add(**d) + return cls(type=DN) elif d.get("type") == "select_remove": - MC: select_remove = select_remove() - MC.from_dict(d) - return cls(type=MC) + OR: select_remove = select_remove(**d) + return cls(type=OR) elif d.get("type") == "select_replace": - BR: select_replace = select_replace() - BR.from_dict(d) - return cls(type=BR) + LC: select_replace = select_replace(**d) + return cls(type=LC) elif d.get("type") == "select_get": - OK: select_get = select_get() - OK.from_dict(d) - return cls(type=OK) + ZP: select_get = select_get(**d) + return cls(type=ZP) elif d.get("type") == "highlight_set_entity": - OP: highlight_set_entity = highlight_set_entity() - OP.from_dict(d) - return cls(type=OP) + NY: highlight_set_entity = highlight_set_entity(**d) + return cls(type=NY) elif d.get("type") == "highlight_set_entities": - LV: highlight_set_entities = highlight_set_entities() - LV.from_dict(d) - return cls(type=LV) + KX: highlight_set_entities = highlight_set_entities(**d) + return cls(type=KX) elif d.get("type") == "new_annotation": - FC: new_annotation = new_annotation() - FC.from_dict(d) - return cls(type=FC) + WO: new_annotation = new_annotation(**d) + return cls(type=WO) elif d.get("type") == "update_annotation": - EI: update_annotation = update_annotation() - EI.from_dict(d) - return cls(type=EI) + UQ: update_annotation = update_annotation(**d) + return cls(type=UQ) elif d.get("type") == "object_visible": - JE: object_visible = object_visible() - JE.from_dict(d) - return cls(type=JE) + XH: object_visible = object_visible(**d) + return cls(type=XH) elif d.get("type") == "object_bring_to_front": - JW: object_bring_to_front = object_bring_to_front() - JW.from_dict(d) - return cls(type=JW) + BV: object_bring_to_front = object_bring_to_front(**d) + return cls(type=BV) elif d.get("type") == "get_entity_type": - AS: get_entity_type = get_entity_type() - AS.from_dict(d) - return cls(type=AS) + SS: get_entity_type = get_entity_type(**d) + return cls(type=SS) elif d.get("type") == "solid2d_add_hole": - YQ: solid2d_add_hole = solid2d_add_hole() - YQ.from_dict(d) - return cls(type=YQ) + AZ: solid2d_add_hole = solid2d_add_hole(**d) + return cls(type=AZ) elif d.get("type") == "solid3d_get_all_edge_faces": - EW: solid3d_get_all_edge_faces = solid3d_get_all_edge_faces() - EW.from_dict(d) - return cls(type=EW) + WJ: solid3d_get_all_edge_faces = solid3d_get_all_edge_faces(**d) + return cls(type=WJ) elif d.get("type") == "solid3d_get_all_opposite_edges": - BT: solid3d_get_all_opposite_edges = solid3d_get_all_opposite_edges() - BT.from_dict(d) - return cls(type=BT) + YD: solid3d_get_all_opposite_edges = solid3d_get_all_opposite_edges(**d) + return cls(type=YD) elif d.get("type") == "solid3d_get_opposite_edge": - AG: solid3d_get_opposite_edge = solid3d_get_opposite_edge() - AG.from_dict(d) - return cls(type=AG) + VP: solid3d_get_opposite_edge = solid3d_get_opposite_edge(**d) + return cls(type=VP) elif d.get("type") == "solid3d_get_next_adjacent_edge": - EA: solid3d_get_next_adjacent_edge = solid3d_get_next_adjacent_edge() - EA.from_dict(d) - return cls(type=EA) + ZG: solid3d_get_next_adjacent_edge = solid3d_get_next_adjacent_edge(**d) + return cls(type=ZG) elif d.get("type") == "solid3d_get_prev_adjacent_edge": - VW: solid3d_get_prev_adjacent_edge = solid3d_get_prev_adjacent_edge() - VW.from_dict(d) - return cls(type=VW) + CS: solid3d_get_prev_adjacent_edge = solid3d_get_prev_adjacent_edge(**d) + return cls(type=CS) elif d.get("type") == "send_object": - JO: send_object = send_object() - JO.from_dict(d) - return cls(type=JO) + GD: send_object = send_object(**d) + return cls(type=GD) elif d.get("type") == "entity_set_opacity": - TE: entity_set_opacity = entity_set_opacity() - TE.from_dict(d) - return cls(type=TE) + OX: entity_set_opacity = entity_set_opacity(**d) + return cls(type=OX) elif d.get("type") == "entity_fade": - WY: entity_fade = entity_fade() - WY.from_dict(d) - return cls(type=WY) + QX: entity_fade = entity_fade(**d) + return cls(type=QX) elif d.get("type") == "make_plane": - QV: make_plane = make_plane() - QV.from_dict(d) - return cls(type=QV) + VX: make_plane = make_plane(**d) + return cls(type=VX) elif d.get("type") == "plane_set_color": - BP: plane_set_color = plane_set_color() - BP.from_dict(d) - return cls(type=BP) + IT: plane_set_color = plane_set_color(**d) + return cls(type=IT) elif d.get("type") == "set_tool": - WI: set_tool = set_tool() - WI.from_dict(d) - return cls(type=WI) + UA: set_tool = set_tool(**d) + return cls(type=UA) elif d.get("type") == "mouse_move": - YR: mouse_move = mouse_move() - YR.from_dict(d) - return cls(type=YR) + MZ: mouse_move = mouse_move(**d) + return cls(type=MZ) elif d.get("type") == "mouse_click": - XK: mouse_click = mouse_click() - XK.from_dict(d) - return cls(type=XK) + CY: mouse_click = mouse_click(**d) + return cls(type=CY) elif d.get("type") == "sketch_mode_enable": - OB: sketch_mode_enable = sketch_mode_enable() - OB.from_dict(d) - return cls(type=OB) + LI: sketch_mode_enable = sketch_mode_enable(**d) + return cls(type=LI) elif d.get("type") == "sketch_mode_disable": - QQ: sketch_mode_disable = sketch_mode_disable() - QQ.from_dict(d) - return cls(type=QQ) + XJ: sketch_mode_disable = sketch_mode_disable(**d) + return cls(type=XJ) elif d.get("type") == "curve_get_type": - WX: curve_get_type = curve_get_type() - WX.from_dict(d) - return cls(type=WX) + JQ: curve_get_type = curve_get_type(**d) + return cls(type=JQ) elif d.get("type") == "curve_get_control_points": - HV: curve_get_control_points = curve_get_control_points() - HV.from_dict(d) - return cls(type=HV) + IM: curve_get_control_points = curve_get_control_points(**d) + return cls(type=IM) elif d.get("type") == "take_snapshot": - CL: take_snapshot = take_snapshot() - CL.from_dict(d) - return cls(type=CL) + KL: take_snapshot = take_snapshot(**d) + return cls(type=KL) elif d.get("type") == "make_axes_gizmo": - NJ: make_axes_gizmo = make_axes_gizmo() - NJ.from_dict(d) - return cls(type=NJ) + PO: make_axes_gizmo = make_axes_gizmo(**d) + return cls(type=PO) elif d.get("type") == "path_get_info": - UM: path_get_info = path_get_info() - UM.from_dict(d) - return cls(type=UM) + WR: path_get_info = path_get_info(**d) + return cls(type=WR) elif d.get("type") == "path_get_curve_uuids_for_vertices": - EM: path_get_curve_uuids_for_vertices = path_get_curve_uuids_for_vertices() - EM.from_dict(d) - return cls(type=EM) + ZX: path_get_curve_uuids_for_vertices = path_get_curve_uuids_for_vertices( + **d + ) + return cls(type=ZX) elif d.get("type") == "path_get_vertex_uuids": - VV: path_get_vertex_uuids = path_get_vertex_uuids() - VV.from_dict(d) - return cls(type=VV) + NX: path_get_vertex_uuids = path_get_vertex_uuids(**d) + return cls(type=NX) elif d.get("type") == "handle_mouse_drag_start": - RX: handle_mouse_drag_start = handle_mouse_drag_start() - RX.from_dict(d) - return cls(type=RX) + TX: handle_mouse_drag_start = handle_mouse_drag_start(**d) + return cls(type=TX) elif d.get("type") == "handle_mouse_drag_move": - TS: handle_mouse_drag_move = handle_mouse_drag_move() - TS.from_dict(d) - return cls(type=TS) + SK: handle_mouse_drag_move = handle_mouse_drag_move(**d) + return cls(type=SK) elif d.get("type") == "handle_mouse_drag_end": - CV: handle_mouse_drag_end = handle_mouse_drag_end() - CV.from_dict(d) - return cls(type=CV) + CX: handle_mouse_drag_end = handle_mouse_drag_end(**d) + return cls(type=CX) elif d.get("type") == "remove_scene_objects": - AO: remove_scene_objects = remove_scene_objects() - AO.from_dict(d) - return cls(type=AO) + LJ: remove_scene_objects = remove_scene_objects(**d) + return cls(type=LJ) elif d.get("type") == "plane_intersect_and_project": - GH: plane_intersect_and_project = plane_intersect_and_project() - GH.from_dict(d) - return cls(type=GH) + HF: plane_intersect_and_project = plane_intersect_and_project(**d) + return cls(type=HF) elif d.get("type") == "curve_get_end_points": - SI: curve_get_end_points = curve_get_end_points() - SI.from_dict(d) - return cls(type=SI) + RZ: curve_get_end_points = curve_get_end_points(**d) + return cls(type=RZ) elif d.get("type") == "reconfigure_stream": - AK: reconfigure_stream = reconfigure_stream() - AK.from_dict(d) - return cls(type=AK) + SX: reconfigure_stream = reconfigure_stream(**d) + return cls(type=SX) elif d.get("type") == "import_files": - BN: import_files = import_files() - BN.from_dict(d) - return cls(type=BN) + GS: import_files = import_files(**d) + return cls(type=GS) elif d.get("type") == "mass": - AQ: mass = mass() - AQ.from_dict(d) - return cls(type=AQ) + ZS: mass = mass(**d) + return cls(type=ZS) elif d.get("type") == "density": - IS: density = density() - IS.from_dict(d) - return cls(type=IS) + GK: density = density(**d) + return cls(type=GK) elif d.get("type") == "volume": - YN: volume = volume() - YN.from_dict(d) - return cls(type=YN) + QZ: volume = volume(**d) + return cls(type=QZ) elif d.get("type") == "center_of_mass": - MA: center_of_mass = center_of_mass() - MA.from_dict(d) - return cls(type=MA) + YK: center_of_mass = center_of_mass(**d) + return cls(type=YK) elif d.get("type") == "surface_area": - VE: surface_area = surface_area() - VE.from_dict(d) - return cls(type=VE) + SL: surface_area = surface_area(**d) + return cls(type=SL) elif d.get("type") == "get_sketch_mode_plane": - JX: get_sketch_mode_plane = get_sketch_mode_plane() - JX.from_dict(d) - return cls(type=JX) + TU: get_sketch_mode_plane = get_sketch_mode_plane(**d) + return cls(type=TU) elif d.get("type") == "curve_set_constraint": - HL: curve_set_constraint = curve_set_constraint() - HL.from_dict(d) - return cls(type=HL) + FD: curve_set_constraint = curve_set_constraint(**d) + return cls(type=FD) raise Exception("Unknown type") + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function( + cls, + handler( + Union[ + start_path, + move_path_pen, + extend_path, + extrude, + close_path, + camera_drag_start, + camera_drag_move, + camera_drag_end, + default_camera_look_at, + default_camera_zoom, + default_camera_enable_sketch_mode, + default_camera_disable_sketch_mode, + default_camera_focus_on, + export, + entity_get_parent_id, + entity_get_num_children, + entity_get_child_uuid, + entity_get_all_child_uuids, + edit_mode_enter, + edit_mode_exit, + select_with_point, + select_clear, + select_add, + select_remove, + select_replace, + select_get, + highlight_set_entity, + highlight_set_entities, + new_annotation, + update_annotation, + object_visible, + object_bring_to_front, + get_entity_type, + solid2d_add_hole, + solid3d_get_all_edge_faces, + solid3d_get_all_opposite_edges, + 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, + path_get_curve_uuids_for_vertices, + path_get_vertex_uuids, + handle_mouse_drag_start, + handle_mouse_drag_move, + handle_mouse_drag_end, + remove_scene_objects, + plane_intersect_and_project, + curve_get_end_points, + reconfigure_stream, + import_files, + mass, + density, + volume, + center_of_mass, + surface_area, + get_sketch_mode_plane, + curve_set_constraint, + ] + ), + ) diff --git a/kittycad/models/modeling_cmd_id.py b/kittycad/models/modeling_cmd_id.py index a2fce8cff..420478002 100644 --- a/kittycad/models/modeling_cmd_id.py +++ b/kittycad/models/modeling_cmd_id.py @@ -1,3 +1,17 @@ +from typing import Any + +from pydantic import GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema + + class ModelingCmdId(str): + """All commands have unique IDs. These should be randomly generated.""" + def __str__(self) -> str: return self + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function(cls, handler(str)) diff --git a/kittycad/models/modeling_cmd_req.py b/kittycad/models/modeling_cmd_req.py index 1c645d14c..e5ec8aa32 100644 --- a/kittycad/models/modeling_cmd_req.py +++ b/kittycad/models/modeling_cmd_req.py @@ -1,83 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast -import attr +from pydantic import BaseModel from ..models.modeling_cmd import ModelingCmd from ..models.modeling_cmd_id import ModelingCmdId -from ..types import UNSET, Unset - -SZ = TypeVar("SZ", bound="ModelingCmdReq") -@attr.s(auto_attribs=True) -class ModelingCmdReq: - """A graphics command submitted to the KittyCAD engine via the Modeling API.""" # noqa: E501 +class ModelingCmdReq(BaseModel): + """A graphics command submitted to the KittyCAD engine via the Modeling API.""" - cmd: Union[Unset, ModelingCmd] = UNSET - cmd_id: Union[Unset, ModelingCmdId] = UNSET + cmd: ModelingCmd - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - cmd: Union[Unset, ModelingCmd] = UNSET - if not isinstance(self.cmd, Unset): - cmd = self.cmd - cmd_id: Union[Unset, ModelingCmdId] = UNSET - if not isinstance(self.cmd_id, Unset): - cmd_id = self.cmd_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if cmd is not UNSET: - _cmd: ModelingCmd = cast(ModelingCmd, cmd) - field_dict["cmd"] = _cmd.to_dict() - if cmd_id is not UNSET: - field_dict["cmd_id"] = cmd_id - - return field_dict - - @classmethod - def from_dict(cls: Type[SZ], src_dict: Dict[str, Any]) -> SZ: - d = src_dict.copy() - _cmd = d.pop("cmd", UNSET) - cmd: Union[Unset, ModelingCmd] - if isinstance(_cmd, Unset): - cmd = UNSET - if _cmd is None: - cmd = UNSET - else: - cmd = ModelingCmd.from_dict(_cmd) - - _cmd_id = d.pop("cmd_id", UNSET) - cmd_id: Union[Unset, ModelingCmdId] - if isinstance(_cmd_id, Unset): - cmd_id = UNSET - if _cmd_id is None: - cmd_id = UNSET - else: - cmd_id = _cmd_id - - modeling_cmd_req = cls( - cmd=cmd, - cmd_id=cmd_id, - ) - - modeling_cmd_req.additional_properties = d - return modeling_cmd_req - - @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 + cmd_id: ModelingCmdId diff --git a/kittycad/models/mouse_click.py b/kittycad/models/mouse_click.py index 6e8aa99d4..9026ecf12 100644 --- a/kittycad/models/mouse_click.py +++ b/kittycad/models/mouse_click.py @@ -1,66 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -FN = TypeVar("FN", bound="MouseClick") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class MouseClick: - """The response from the `MouseClick` command.""" # noqa: E501 +class MouseClick(BaseModel): + """The response from the `MouseClick` command.""" - entities_modified: Union[Unset, List[str]] = UNSET - entities_selected: Union[Unset, List[str]] = UNSET + entities_modified: List[UUID] - 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[FN], src_dict: Dict[str, Any]) -> FN: - 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 + entities_selected: List[UUID] diff --git a/kittycad/models/new_address.py b/kittycad/models/new_address.py index 5b9dfc7f2..ab454d06e 100644 --- a/kittycad/models/new_address.py +++ b/kittycad/models/new_address.py @@ -1,115 +1,24 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr +from pydantic import BaseModel from ..models.country_code import CountryCode from ..models.uuid import Uuid -from ..types import UNSET, Unset - -YJ = TypeVar("YJ", bound="NewAddress") -@attr.s(auto_attribs=True) -class NewAddress: - """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`.""" # noqa: E501 +class NewAddress(BaseModel): + """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`.""" - city: Union[Unset, str] = UNSET - country: Union[Unset, CountryCode] = UNSET - state: Union[Unset, str] = UNSET - street1: Union[Unset, str] = UNSET - street2: Union[Unset, str] = UNSET - user_id: Union[Unset, str] = UNSET - zip: Union[Unset, str] = UNSET + city: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + country: CountryCode - def to_dict(self) -> Dict[str, Any]: - city = self.city - country: Union[Unset, CountryCode] = UNSET - if not isinstance(self.country, Unset): - country = self.country - state = self.state - street1 = self.street1 - street2 = self.street2 - user_id = self.user_id - zip = self.zip + state: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if city is not UNSET: - field_dict["city"] = city - if country is not UNSET: - field_dict["country"] = country - if state is not UNSET: - field_dict["state"] = state - if street1 is not UNSET: - field_dict["street1"] = street1 - if street2 is not UNSET: - field_dict["street2"] = street2 - if user_id is not UNSET: - field_dict["user_id"] = user_id - if zip is not UNSET: - field_dict["zip"] = zip + street1: Optional[str] = None - return field_dict + street2: Optional[str] = None - @classmethod - def from_dict(cls: Type[YJ], src_dict: Dict[str, Any]) -> YJ: - d = src_dict.copy() - city = d.pop("city", UNSET) + user_id: Uuid - _country = d.pop("country", UNSET) - country: Union[Unset, CountryCode] - if isinstance(_country, Unset): - country = UNSET - if _country is None: - country = UNSET - else: - country = _country - - state = d.pop("state", UNSET) - - street1 = d.pop("street1", UNSET) - - street2 = d.pop("street2", UNSET) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - zip = d.pop("zip", UNSET) - - new_address = cls( - city=city, - country=country, - state=state, - street1=street1, - street2=street2, - user_id=user_id, - zip=zip, - ) - - new_address.additional_properties = d - return new_address - - @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 + zip: Optional[str] = None diff --git a/kittycad/models/o_auth2_client_info.py b/kittycad/models/o_auth2_client_info.py index cda986c2f..25976196a 100644 --- a/kittycad/models/o_auth2_client_info.py +++ b/kittycad/models/o_auth2_client_info.py @@ -1,69 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -GA = TypeVar("GA", bound="OAuth2ClientInfo") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class OAuth2ClientInfo: - """Information about an OAuth 2.0 client.""" # noqa: E501 +class OAuth2ClientInfo(BaseModel): + """Information about an OAuth 2.0 client.""" - csrf_token: Union[Unset, str] = UNSET - pkce_code_verifier: Union[Unset, str] = UNSET - url: Union[Unset, str] = UNSET + csrf_token: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + pkce_code_verifier: Optional[str] = None - def to_dict(self) -> Dict[str, Any]: - csrf_token = self.csrf_token - pkce_code_verifier = self.pkce_code_verifier - url = self.url - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if csrf_token is not UNSET: - field_dict["csrf_token"] = csrf_token - if pkce_code_verifier is not UNSET: - field_dict["pkce_code_verifier"] = pkce_code_verifier - if url is not UNSET: - field_dict["url"] = url - - return field_dict - - @classmethod - def from_dict(cls: Type[GA], src_dict: Dict[str, Any]) -> GA: - d = src_dict.copy() - csrf_token = d.pop("csrf_token", UNSET) - - pkce_code_verifier = d.pop("pkce_code_verifier", UNSET) - - url = d.pop("url", UNSET) - - o_auth2_client_info = cls( - csrf_token=csrf_token, - pkce_code_verifier=pkce_code_verifier, - url=url, - ) - - o_auth2_client_info.additional_properties = d - return o_auth2_client_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 + url: Optional[str] = None diff --git a/kittycad/models/ok_modeling_cmd_response.py b/kittycad/models/ok_modeling_cmd_response.py index 4406be299..636634b3e 100644 --- a/kittycad/models/ok_modeling_cmd_response.py +++ b/kittycad/models/ok_modeling_cmd_response.py @@ -1,6 +1,8 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, Dict, Type, TypeVar, Union import attr +from pydantic import BaseModel, GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema from ..models.center_of_mass import CenterOfMass from ..models.curve_get_control_points import CurveGetControlPoints @@ -32,2069 +34,253 @@ from ..models.solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge from ..models.surface_area import SurfaceArea from ..models.take_snapshot import TakeSnapshot from ..models.volume import Volume -from ..types import UNSET, Unset - -FO = TypeVar("FO", bound="empty") -@attr.s(auto_attribs=True) -class empty: - """An empty response, used for any command that does not explicitly have a response defined here.""" # noqa: E501 +class empty(BaseModel): + """An empty response, used for any command that does not explicitly have a response defined here.""" type: str = "empty" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - type = self.type +class export(BaseModel): + """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`.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type + data: Export - return field_dict - - @classmethod - def from_dict(cls: Type[FO], src_dict: Dict[str, Any]) -> FO: - d = src_dict.copy() - type = d.pop("type", UNSET) - - empty = cls( - type=type, - ) - - empty.additional_properties = d - return empty - - @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 - - -KB = TypeVar("KB", 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 - - 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]: - data: Union[Unset, Export] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class select_with_point(BaseModel): + """The response from the `SelectWithPoint` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: Export = cast(Export, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: SelectWithPoint - return field_dict - - @classmethod - def from_dict(cls: Type[KB], src_dict: Dict[str, Any]) -> KB: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, Export] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = Export.from_dict(_data) - - type = d.pop("type", UNSET) - - export = cls( - data=data, - type=type, - ) - - export.additional_properties = d - return export - - @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 - - -QH = TypeVar("QH", bound="select_with_point") - - -@attr.s(auto_attribs=True) -class select_with_point: - """The response from the `SelectWithPoint` command.""" # noqa: E501 - - 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]: - data: Union[Unset, SelectWithPoint] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class highlight_set_entity(BaseModel): + """The response from the `HighlightSetEntity` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: SelectWithPoint = cast(SelectWithPoint, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: HighlightSetEntity - return field_dict - - @classmethod - def from_dict(cls: Type[QH], src_dict: Dict[str, Any]) -> QH: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, SelectWithPoint] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = SelectWithPoint.from_dict(_data) - - type = d.pop("type", UNSET) - - select_with_point = cls( - data=data, - type=type, - ) - - 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 - - -EV = TypeVar("EV", bound="highlight_set_entity") - - -@attr.s(auto_attribs=True) -class highlight_set_entity: - """The response from the `HighlightSetEntity` command.""" # noqa: E501 - - 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]: - data: Union[Unset, HighlightSetEntity] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class entity_get_child_uuid(BaseModel): + """The response from the `EntityGetChildUuid` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: HighlightSetEntity = cast(HighlightSetEntity, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: EntityGetChildUuid - return field_dict - - @classmethod - def from_dict(cls: Type[EV], src_dict: Dict[str, Any]) -> EV: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, HighlightSetEntity] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = HighlightSetEntity.from_dict(_data) - - type = d.pop("type", UNSET) - - highlight_set_entity = cls( - data=data, - type=type, - ) - - 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 - - -YL = TypeVar("YL", bound="entity_get_child_uuid") - - -@attr.s(auto_attribs=True) -class entity_get_child_uuid: - """The response from the `EntityGetChildUuid` command.""" # noqa: E501 - - 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]: - data: Union[Unset, EntityGetChildUuid] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class entity_get_num_children(BaseModel): + """The response from the `EntityGetNumChildren` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: EntityGetChildUuid = cast(EntityGetChildUuid, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: EntityGetNumChildren - return field_dict - - @classmethod - def from_dict(cls: Type[YL], src_dict: Dict[str, Any]) -> YL: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, EntityGetChildUuid] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = EntityGetChildUuid.from_dict(_data) - - type = d.pop("type", UNSET) - - entity_get_child_uuid = cls( - data=data, - type=type, - ) - - 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 - - -AN = TypeVar("AN", bound="entity_get_num_children") - - -@attr.s(auto_attribs=True) -class entity_get_num_children: - """The response from the `EntityGetNumChildren` command.""" # noqa: E501 - - 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]: - data: Union[Unset, EntityGetNumChildren] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class entity_get_parent_id(BaseModel): + """The response from the `EntityGetParentId` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: EntityGetNumChildren = cast(EntityGetNumChildren, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: EntityGetParentId - return field_dict - - @classmethod - def from_dict(cls: Type[AN], src_dict: Dict[str, Any]) -> AN: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, EntityGetNumChildren] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = EntityGetNumChildren.from_dict(_data) - - type = d.pop("type", UNSET) - - entity_get_num_children = cls( - data=data, - type=type, - ) - - 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 - - -UV = TypeVar("UV", bound="entity_get_parent_id") - - -@attr.s(auto_attribs=True) -class entity_get_parent_id: - """The response from the `EntityGetParentId` command.""" # noqa: E501 - - 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]: - data: Union[Unset, EntityGetParentId] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class entity_get_all_child_uuids(BaseModel): + """The response from the `EntityGetAllChildUuids` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: EntityGetParentId = cast(EntityGetParentId, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: EntityGetAllChildUuids - return field_dict - - @classmethod - def from_dict(cls: Type[UV], src_dict: Dict[str, Any]) -> UV: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, EntityGetParentId] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = EntityGetParentId.from_dict(_data) - - type = d.pop("type", UNSET) - - entity_get_parent_id = cls( - data=data, - type=type, - ) - - 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 - - -IB = TypeVar("IB", 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 - - 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]: - data: Union[Unset, EntityGetAllChildUuids] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class select_get(BaseModel): + """The response from the `SelectGet` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: EntityGetAllChildUuids = cast(EntityGetAllChildUuids, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: SelectGet - return field_dict - - @classmethod - def from_dict(cls: Type[IB], src_dict: Dict[str, Any]) -> IB: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, EntityGetAllChildUuids] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = EntityGetAllChildUuids.from_dict(_data) - - type = d.pop("type", UNSET) - - entity_get_all_child_uuids = cls( - data=data, - type=type, - ) - - 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 - - -EU = TypeVar("EU", bound="select_get") - - -@attr.s(auto_attribs=True) -class select_get: - """The response from the `SelectGet` command.""" # noqa: E501 - - 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]: - data: Union[Unset, SelectGet] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class get_entity_type(BaseModel): + """The response from the `GetEntityType` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: SelectGet = cast(SelectGet, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: GetEntityType - return field_dict - - @classmethod - def from_dict(cls: Type[EU], src_dict: Dict[str, Any]) -> EU: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, SelectGet] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = SelectGet.from_dict(_data) - - type = d.pop("type", UNSET) - - select_get = cls( - data=data, - type=type, - ) - - 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 - - -QW = TypeVar("QW", bound="get_entity_type") - - -@attr.s(auto_attribs=True) -class get_entity_type: - """The response from the `GetEntityType` command.""" # noqa: E501 - - 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]: - data: Union[Unset, GetEntityType] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class solid3d_get_all_edge_faces(BaseModel): + """The response from the `Solid3dGetAllEdgeFaces` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: GetEntityType = cast(GetEntityType, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: Solid3dGetAllEdgeFaces - return field_dict - - @classmethod - def from_dict(cls: Type[QW], src_dict: Dict[str, Any]) -> QW: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, GetEntityType] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = GetEntityType.from_dict(_data) - - type = d.pop("type", UNSET) - - get_entity_type = cls( - data=data, - type=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 - - -RN = TypeVar("RN", 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 - - 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]: - data: Union[Unset, Solid3dGetAllEdgeFaces] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class solid3d_get_all_opposite_edges(BaseModel): + """The response from the `Solid3dGetAllOppositeEdges` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: Solid3dGetAllEdgeFaces = cast(Solid3dGetAllEdgeFaces, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: Solid3dGetAllOppositeEdges - return field_dict - - @classmethod - def from_dict(cls: Type[RN], src_dict: Dict[str, Any]) -> RN: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, Solid3dGetAllEdgeFaces] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = Solid3dGetAllEdgeFaces.from_dict(_data) - - type = d.pop("type", UNSET) - - solid3d_get_all_edge_faces = cls( - data=data, - type=type, - ) - - 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 - - -JN = TypeVar("JN", 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 - - 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]: - data: Union[Unset, Solid3dGetAllOppositeEdges] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class solid3d_get_opposite_edge(BaseModel): + """The response from the `Solid3dGetOppositeEdge` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: Solid3dGetAllOppositeEdges = cast(Solid3dGetAllOppositeEdges, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: Solid3dGetOppositeEdge - return field_dict - - @classmethod - def from_dict(cls: Type[JN], src_dict: Dict[str, Any]) -> JN: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, Solid3dGetAllOppositeEdges] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = Solid3dGetAllOppositeEdges.from_dict(_data) - - type = d.pop("type", UNSET) - - solid3d_get_all_opposite_edges = cls( - data=data, - type=type, - ) - - 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 - - -BD = TypeVar("BD", bound="solid3d_get_opposite_edge") - - -@attr.s(auto_attribs=True) -class solid3d_get_opposite_edge: - """The response from the `Solid3dGetOppositeEdge` command.""" # noqa: E501 - - 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]: - data: Union[Unset, Solid3dGetOppositeEdge] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class solid3d_get_prev_adjacent_edge(BaseModel): + """The response from the `Solid3dGetPrevAdjacentEdge` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: Solid3dGetOppositeEdge = cast(Solid3dGetOppositeEdge, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: Solid3dGetPrevAdjacentEdge - return field_dict - - @classmethod - def from_dict(cls: Type[BD], src_dict: Dict[str, Any]) -> BD: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, Solid3dGetOppositeEdge] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = Solid3dGetOppositeEdge.from_dict(_data) - - type = d.pop("type", UNSET) - - solid3d_get_opposite_edge = cls( - data=data, - type=type, - ) - - 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 - - -XW = TypeVar("XW", 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 - - 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]: - data: Union[Unset, Solid3dGetPrevAdjacentEdge] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class solid3d_get_next_adjacent_edge(BaseModel): + """The response from the `Solid3dGetNextAdjacentEdge` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: Solid3dGetPrevAdjacentEdge = cast(Solid3dGetPrevAdjacentEdge, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: Solid3dGetNextAdjacentEdge - return field_dict - - @classmethod - def from_dict(cls: Type[XW], src_dict: Dict[str, Any]) -> XW: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, Solid3dGetPrevAdjacentEdge] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = Solid3dGetPrevAdjacentEdge.from_dict(_data) - - type = d.pop("type", UNSET) - - solid3d_get_prev_adjacent_edge = cls( - data=data, - type=type, - ) - - 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 - - -LP = TypeVar("LP", 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 - - 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]: - data: Union[Unset, Solid3dGetNextAdjacentEdge] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class mouse_click(BaseModel): + """The response from the `MouseClick` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: Solid3dGetNextAdjacentEdge = cast(Solid3dGetNextAdjacentEdge, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: MouseClick - return field_dict - - @classmethod - def from_dict(cls: Type[LP], src_dict: Dict[str, Any]) -> LP: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, Solid3dGetNextAdjacentEdge] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = Solid3dGetNextAdjacentEdge.from_dict(_data) - - type = d.pop("type", UNSET) - - solid3d_get_next_adjacent_edge = cls( - data=data, - type=type, - ) - - 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 - - -XN = TypeVar("XN", 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]: - data: Union[Unset, MouseClick] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class curve_get_type(BaseModel): + """The response from the `CurveGetType` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: MouseClick = cast(MouseClick, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: CurveGetType - return field_dict - - @classmethod - def from_dict(cls: Type[XN], src_dict: Dict[str, Any]) -> XN: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, MouseClick] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = MouseClick.from_dict(_data) - - 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 - - -PL = TypeVar("PL", 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]: - data: Union[Unset, CurveGetType] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class curve_get_control_points(BaseModel): + """The response from the `CurveGetControlPoints` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: CurveGetType = cast(CurveGetType, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: CurveGetControlPoints - return field_dict - - @classmethod - def from_dict(cls: Type[PL], src_dict: Dict[str, Any]) -> PL: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, CurveGetType] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = CurveGetType.from_dict(_data) - - 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 - - -XS = TypeVar("XS", 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]: - data: Union[Unset, CurveGetControlPoints] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class take_snapshot(BaseModel): + """The response from the `Take Snapshot` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: CurveGetControlPoints = cast(CurveGetControlPoints, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: TakeSnapshot - return field_dict - - @classmethod - def from_dict(cls: Type[XS], src_dict: Dict[str, Any]) -> XS: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, CurveGetControlPoints] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = CurveGetControlPoints.from_dict(_data) - - 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 - - -YB = TypeVar("YB", 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]: - data: Union[Unset, TakeSnapshot] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class path_get_info(BaseModel): + """The response from the `Path Get Info` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: TakeSnapshot = cast(TakeSnapshot, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: PathGetInfo - return field_dict - - @classmethod - def from_dict(cls: Type[YB], src_dict: Dict[str, Any]) -> YB: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, TakeSnapshot] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = TakeSnapshot.from_dict(_data) - - 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 - - -YX = TypeVar("YX", 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]: - data: Union[Unset, PathGetInfo] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class path_get_curve_uuids_for_vertices(BaseModel): + """The response from the `Path Get Curve UUIDs for Vertices` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: PathGetInfo = cast(PathGetInfo, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: PathGetCurveUuidsForVertices - return field_dict - - @classmethod - def from_dict(cls: Type[YX], src_dict: Dict[str, Any]) -> YX: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, PathGetInfo] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = PathGetInfo.from_dict(_data) - - 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 - - -LM = TypeVar("LM", bound="path_get_curve_uuids_for_vertices") - - -@attr.s(auto_attribs=True) -class path_get_curve_uuids_for_vertices: - """The response from the `Path Get Curve UUIDs for Vertices` command.""" # noqa: E501 - - data: Union[Unset, PathGetCurveUuidsForVertices] = UNSET type: str = "path_get_curve_uuids_for_vertices" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, PathGetCurveUuidsForVertices] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class path_get_vertex_uuids(BaseModel): + """The response from the `Path Get Vertex UUIDs` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: PathGetCurveUuidsForVertices = cast( - PathGetCurveUuidsForVertices, data - ) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: PathGetVertexUuids - return field_dict - - @classmethod - def from_dict(cls: Type[LM], src_dict: Dict[str, Any]) -> LM: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, PathGetCurveUuidsForVertices] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = PathGetCurveUuidsForVertices.from_dict(_data) - - type = d.pop("type", UNSET) - - path_get_curve_uuids_for_vertices = cls( - data=data, - type=type, - ) - - path_get_curve_uuids_for_vertices.additional_properties = d - return path_get_curve_uuids_for_vertices - - @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 - - -DM = TypeVar("DM", bound="path_get_vertex_uuids") - - -@attr.s(auto_attribs=True) -class path_get_vertex_uuids: - """The response from the `Path Get Vertex UUIDs` command.""" # noqa: E501 - - data: Union[Unset, PathGetVertexUuids] = UNSET type: str = "path_get_vertex_uuids" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, PathGetVertexUuids] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class plane_intersect_and_project(BaseModel): + """The response from the `PlaneIntersectAndProject` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: PathGetVertexUuids = cast(PathGetVertexUuids, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: PlaneIntersectAndProject - return field_dict - - @classmethod - def from_dict(cls: Type[DM], src_dict: Dict[str, Any]) -> DM: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, PathGetVertexUuids] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = PathGetVertexUuids.from_dict(_data) - - type = d.pop("type", UNSET) - - path_get_vertex_uuids = cls( - data=data, - type=type, - ) - - path_get_vertex_uuids.additional_properties = d - return path_get_vertex_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 - - -HZ = TypeVar("HZ", bound="plane_intersect_and_project") - - -@attr.s(auto_attribs=True) -class plane_intersect_and_project: - """The response from the `PlaneIntersectAndProject` command.""" # noqa: E501 - - data: Union[Unset, PlaneIntersectAndProject] = UNSET type: str = "plane_intersect_and_project" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, PlaneIntersectAndProject] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class curve_get_end_points(BaseModel): + """The response from the `CurveGetEndPoints` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: PlaneIntersectAndProject = cast(PlaneIntersectAndProject, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: CurveGetEndPoints - return field_dict - - @classmethod - def from_dict(cls: Type[HZ], src_dict: Dict[str, Any]) -> HZ: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, PlaneIntersectAndProject] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = PlaneIntersectAndProject.from_dict(_data) - - type = d.pop("type", UNSET) - - plane_intersect_and_project = cls( - data=data, - type=type, - ) - - plane_intersect_and_project.additional_properties = d - return plane_intersect_and_project - - @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 - - -CP = TypeVar("CP", bound="curve_get_end_points") - - -@attr.s(auto_attribs=True) -class curve_get_end_points: - """The response from the `CurveGetEndPoints` command.""" # noqa: E501 - - data: Union[Unset, CurveGetEndPoints] = UNSET type: str = "curve_get_end_points" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, CurveGetEndPoints] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class import_files(BaseModel): + """The response from the `ImportFiles` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: CurveGetEndPoints = cast(CurveGetEndPoints, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: ImportFiles - return field_dict - - @classmethod - def from_dict(cls: Type[CP], src_dict: Dict[str, Any]) -> CP: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, CurveGetEndPoints] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = CurveGetEndPoints.from_dict(_data) - - type = d.pop("type", UNSET) - - curve_get_end_points = cls( - data=data, - type=type, - ) - - curve_get_end_points.additional_properties = d - return curve_get_end_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 - - -IP = TypeVar("IP", bound="import_files") - - -@attr.s(auto_attribs=True) -class import_files: - """The response from the `ImportFiles` command.""" # noqa: E501 - - data: Union[Unset, ImportFiles] = UNSET type: str = "import_files" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, ImportFiles] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class mass(BaseModel): + """The response from the `Mass` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: ImportFiles = cast(ImportFiles, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: Mass - return field_dict - - @classmethod - def from_dict(cls: Type[IP], src_dict: Dict[str, Any]) -> IP: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, ImportFiles] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = ImportFiles.from_dict(_data) - - type = d.pop("type", UNSET) - - import_files = cls( - data=data, - type=type, - ) - - import_files.additional_properties = d - return import_files - - @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 - - -XV = TypeVar("XV", bound="mass") - - -@attr.s(auto_attribs=True) -class mass: - """The response from the `Mass` command.""" # noqa: E501 - - data: Union[Unset, Mass] = UNSET type: str = "mass" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, Mass] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class volume(BaseModel): + """The response from the `Volume` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: Mass = cast(Mass, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: Volume - return field_dict - - @classmethod - def from_dict(cls: Type[XV], src_dict: Dict[str, Any]) -> XV: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, Mass] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = Mass.from_dict(_data) - - type = d.pop("type", UNSET) - - mass = cls( - data=data, - type=type, - ) - - mass.additional_properties = d - return mass - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -TW = TypeVar("TW", bound="volume") - - -@attr.s(auto_attribs=True) -class volume: - """The response from the `Volume` command.""" # noqa: E501 - - data: Union[Unset, Volume] = UNSET type: str = "volume" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, Volume] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class density(BaseModel): + """The response from the `Density` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: Volume = cast(Volume, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: Density - return field_dict - - @classmethod - def from_dict(cls: Type[TW], src_dict: Dict[str, Any]) -> TW: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, Volume] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = Volume.from_dict(_data) - - type = d.pop("type", UNSET) - - volume = cls( - data=data, - type=type, - ) - - volume.additional_properties = d - return volume - - @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 - - -CH = TypeVar("CH", bound="density") - - -@attr.s(auto_attribs=True) -class density: - """The response from the `Density` command.""" # noqa: E501 - - data: Union[Unset, Density] = UNSET type: str = "density" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, Density] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class surface_area(BaseModel): + """The response from the `SurfaceArea` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: Density = cast(Density, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: SurfaceArea - return field_dict - - @classmethod - def from_dict(cls: Type[CH], src_dict: Dict[str, Any]) -> CH: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, Density] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = Density.from_dict(_data) - - type = d.pop("type", UNSET) - - density = cls( - data=data, - type=type, - ) - - density.additional_properties = d - return density - - @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 - - -MW = TypeVar("MW", bound="surface_area") - - -@attr.s(auto_attribs=True) -class surface_area: - """The response from the `SurfaceArea` command.""" # noqa: E501 - - data: Union[Unset, SurfaceArea] = UNSET type: str = "surface_area" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, SurfaceArea] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class center_of_mass(BaseModel): + """The response from the `CenterOfMass` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: SurfaceArea = cast(SurfaceArea, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: CenterOfMass - return field_dict - - @classmethod - def from_dict(cls: Type[MW], src_dict: Dict[str, Any]) -> MW: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, SurfaceArea] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = SurfaceArea.from_dict(_data) - - type = d.pop("type", UNSET) - - surface_area = cls( - data=data, - type=type, - ) - - surface_area.additional_properties = d - return surface_area - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -VN = TypeVar("VN", bound="center_of_mass") - - -@attr.s(auto_attribs=True) -class center_of_mass: - """The response from the `CenterOfMass` command.""" # noqa: E501 - - data: Union[Unset, CenterOfMass] = UNSET type: str = "center_of_mass" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, CenterOfMass] = UNSET - if not isinstance(self.data, Unset): - data = self.data - type = self.type +class get_sketch_mode_plane(BaseModel): + """The response from the `GetSketchModePlane` command.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - _data: CenterOfMass = cast(CenterOfMass, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type + data: GetSketchModePlane - return field_dict - - @classmethod - def from_dict(cls: Type[VN], src_dict: Dict[str, Any]) -> VN: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, CenterOfMass] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = CenterOfMass.from_dict(_data) - - type = d.pop("type", UNSET) - - center_of_mass = cls( - data=data, - type=type, - ) - - center_of_mass.additional_properties = d - return center_of_mass - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -WE = TypeVar("WE", bound="get_sketch_mode_plane") - - -@attr.s(auto_attribs=True) -class get_sketch_mode_plane: - """The response from the `GetSketchModePlane` command.""" # noqa: E501 - - data: Union[Unset, GetSketchModePlane] = UNSET type: str = "get_sketch_mode_plane" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, GetSketchModePlane] = UNSET - 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: - _data: GetSketchModePlane = cast(GetSketchModePlane, data) - field_dict["data"] = _data.to_dict() - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[WE], src_dict: Dict[str, Any]) -> WE: - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, GetSketchModePlane] - if isinstance(_data, Unset): - data = UNSET - if _data is None: - data = UNSET - else: - data = GetSketchModePlane.from_dict(_data) - - type = d.pop("type", UNSET) - - get_sketch_mode_plane = cls( - data=data, - type=type, - ) - - get_sketch_mode_plane.additional_properties = d - return get_sketch_mode_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 - GY = TypeVar("GY", bound="OkModelingCmdResponse") @@ -2176,228 +362,242 @@ class OkModelingCmdResponse: ): self.type = type - def to_dict(self) -> Dict[str, Any]: + def model_dump(self) -> Dict[str, Any]: if isinstance(self.type, empty): - YZ: empty = self.type - return YZ.to_dict() + TZ: empty = self.type + return TZ.model_dump() elif isinstance(self.type, export): - SV: export = self.type - return SV.to_dict() + RQ: export = self.type + return RQ.model_dump() elif isinstance(self.type, select_with_point): - ZF: select_with_point = self.type - return ZF.to_dict() + CM: select_with_point = self.type + return CM.model_dump() elif isinstance(self.type, highlight_set_entity): - RA: highlight_set_entity = self.type - return RA.to_dict() + WP: highlight_set_entity = self.type + return WP.model_dump() elif isinstance(self.type, entity_get_child_uuid): - KP: entity_get_child_uuid = self.type - return KP.to_dict() + LN: entity_get_child_uuid = self.type + return LN.model_dump() elif isinstance(self.type, entity_get_num_children): - HM: entity_get_num_children = self.type - return HM.to_dict() + MG: entity_get_num_children = self.type + return MG.model_dump() elif isinstance(self.type, entity_get_parent_id): - NT: entity_get_parent_id = self.type - return NT.to_dict() + BF: entity_get_parent_id = self.type + return BF.model_dump() elif isinstance(self.type, entity_get_all_child_uuids): - IH: entity_get_all_child_uuids = self.type - return IH.to_dict() + MB: entity_get_all_child_uuids = self.type + return MB.model_dump() elif isinstance(self.type, select_get): - WK: select_get = self.type - return WK.to_dict() + FJ: select_get = self.type + return FJ.model_dump() elif isinstance(self.type, get_entity_type): - CA: get_entity_type = self.type - return CA.to_dict() + SF: get_entity_type = self.type + return SF.model_dump() elif isinstance(self.type, solid3d_get_all_edge_faces): - AF: solid3d_get_all_edge_faces = self.type - return AF.to_dict() + BM: solid3d_get_all_edge_faces = self.type + return BM.model_dump() elif isinstance(self.type, solid3d_get_all_opposite_edges): - IY: solid3d_get_all_opposite_edges = self.type - return IY.to_dict() + NC: solid3d_get_all_opposite_edges = self.type + return NC.model_dump() elif isinstance(self.type, solid3d_get_opposite_edge): - QB: solid3d_get_opposite_edge = self.type - return QB.to_dict() + FF: solid3d_get_opposite_edge = self.type + return FF.model_dump() elif isinstance(self.type, solid3d_get_prev_adjacent_edge): - QN: solid3d_get_prev_adjacent_edge = self.type - return QN.to_dict() + FS: solid3d_get_prev_adjacent_edge = self.type + return FS.model_dump() elif isinstance(self.type, solid3d_get_next_adjacent_edge): - VL: solid3d_get_next_adjacent_edge = self.type - return VL.to_dict() + EQ: solid3d_get_next_adjacent_edge = self.type + return EQ.model_dump() elif isinstance(self.type, mouse_click): - IW: mouse_click = self.type - return IW.to_dict() + MD: mouse_click = self.type + return MD.model_dump() elif isinstance(self.type, curve_get_type): - LW: curve_get_type = self.type - return LW.to_dict() + UJ: curve_get_type = self.type + return UJ.model_dump() elif isinstance(self.type, curve_get_control_points): - ID: curve_get_control_points = self.type - return ID.to_dict() + DL: curve_get_control_points = self.type + return DL.model_dump() elif isinstance(self.type, take_snapshot): - NI: take_snapshot = self.type - return NI.to_dict() + PT: take_snapshot = self.type + return PT.model_dump() elif isinstance(self.type, path_get_info): - BY: path_get_info = self.type - return BY.to_dict() + VF: path_get_info = self.type + return VF.model_dump() elif isinstance(self.type, path_get_curve_uuids_for_vertices): - IC: path_get_curve_uuids_for_vertices = self.type - return IC.to_dict() + WH: path_get_curve_uuids_for_vertices = self.type + return WH.model_dump() elif isinstance(self.type, path_get_vertex_uuids): - SH: path_get_vertex_uuids = self.type - return SH.to_dict() + UY: path_get_vertex_uuids = self.type + return UY.model_dump() elif isinstance(self.type, plane_intersect_and_project): - RV: plane_intersect_and_project = self.type - return RV.to_dict() + SM: plane_intersect_and_project = self.type + return SM.model_dump() elif isinstance(self.type, curve_get_end_points): - TI: curve_get_end_points = self.type - return TI.to_dict() + CG: curve_get_end_points = self.type + return CG.model_dump() elif isinstance(self.type, import_files): - KO: import_files = self.type - return KO.to_dict() + ZB: import_files = self.type + return ZB.model_dump() elif isinstance(self.type, mass): - AL: mass = self.type - return AL.to_dict() + FX: mass = self.type + return FX.model_dump() elif isinstance(self.type, volume): - ZH: volume = self.type - return ZH.to_dict() + KU: volume = self.type + return KU.model_dump() elif isinstance(self.type, density): - KD: density = self.type - return KD.to_dict() + FA: density = self.type + return FA.model_dump() elif isinstance(self.type, surface_area): - YA: surface_area = self.type - return YA.to_dict() + JG: surface_area = self.type + return JG.model_dump() elif isinstance(self.type, center_of_mass): - WD: center_of_mass = self.type - return WD.to_dict() + RY: center_of_mass = self.type + return RY.model_dump() elif isinstance(self.type, get_sketch_mode_plane): - RJ: get_sketch_mode_plane = self.type - return RJ.to_dict() + AD: get_sketch_mode_plane = self.type + return AD.model_dump() raise Exception("Unknown type") @classmethod def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY: if d.get("type") == "empty": - GZ: empty = empty() - GZ.from_dict(d) - return cls(type=GZ) + AX: empty = empty(**d) + return cls(type=AX) elif d.get("type") == "export": - XB: export = export() - XB.from_dict(d) - return cls(type=XB) + ZL: export = export(**d) + return cls(type=ZL) elif d.get("type") == "select_with_point": - XM: select_with_point = select_with_point() - XM.from_dict(d) - return cls(type=XM) + OS: select_with_point = select_with_point(**d) + return cls(type=OS) elif d.get("type") == "highlight_set_entity": - TQ: highlight_set_entity = highlight_set_entity() - TQ.from_dict(d) - return cls(type=TQ) + XO: highlight_set_entity = highlight_set_entity(**d) + return cls(type=XO) elif d.get("type") == "entity_get_child_uuid": - SU: entity_get_child_uuid = entity_get_child_uuid() - SU.from_dict(d) - return cls(type=SU) + KR: entity_get_child_uuid = entity_get_child_uuid(**d) + return cls(type=KR) elif d.get("type") == "entity_get_num_children": - QD: entity_get_num_children = entity_get_num_children() - QD.from_dict(d) - return cls(type=QD) + UE: entity_get_num_children = entity_get_num_children(**d) + return cls(type=UE) elif d.get("type") == "entity_get_parent_id": - XC: entity_get_parent_id = entity_get_parent_id() - XC.from_dict(d) - return cls(type=XC) + UU: entity_get_parent_id = entity_get_parent_id(**d) + return cls(type=UU) elif d.get("type") == "entity_get_all_child_uuids": - IX: entity_get_all_child_uuids = entity_get_all_child_uuids() - IX.from_dict(d) - return cls(type=IX) + TB: entity_get_all_child_uuids = entity_get_all_child_uuids(**d) + return cls(type=TB) elif d.get("type") == "select_get": - YS: select_get = select_get() - YS.from_dict(d) - return cls(type=YS) + HB: select_get = select_get(**d) + return cls(type=HB) elif d.get("type") == "get_entity_type": - TT: get_entity_type = get_entity_type() - TT.from_dict(d) - return cls(type=TT) + DU: get_entity_type = get_entity_type(**d) + return cls(type=DU) elif d.get("type") == "solid3d_get_all_edge_faces": - CK: solid3d_get_all_edge_faces = solid3d_get_all_edge_faces() - CK.from_dict(d) - return cls(type=CK) + TY: solid3d_get_all_edge_faces = solid3d_get_all_edge_faces(**d) + return cls(type=TY) elif d.get("type") == "solid3d_get_all_opposite_edges": - BO: solid3d_get_all_opposite_edges = solid3d_get_all_opposite_edges() - BO.from_dict(d) - return cls(type=BO) + GP: solid3d_get_all_opposite_edges = solid3d_get_all_opposite_edges(**d) + return cls(type=GP) elif d.get("type") == "solid3d_get_opposite_edge": - VB: solid3d_get_opposite_edge = solid3d_get_opposite_edge() - VB.from_dict(d) - return cls(type=VB) + YO: solid3d_get_opposite_edge = solid3d_get_opposite_edge(**d) + return cls(type=YO) elif d.get("type") == "solid3d_get_prev_adjacent_edge": - RR: solid3d_get_prev_adjacent_edge = solid3d_get_prev_adjacent_edge() - RR.from_dict(d) - return cls(type=RR) + WN: solid3d_get_prev_adjacent_edge = solid3d_get_prev_adjacent_edge(**d) + return cls(type=WN) elif d.get("type") == "solid3d_get_next_adjacent_edge": - JS: solid3d_get_next_adjacent_edge = solid3d_get_next_adjacent_edge() - JS.from_dict(d) - return cls(type=JS) + UW: solid3d_get_next_adjacent_edge = solid3d_get_next_adjacent_edge(**d) + return cls(type=UW) elif d.get("type") == "mouse_click": - JU: mouse_click = mouse_click() - JU.from_dict(d) - return cls(type=JU) + HD: mouse_click = mouse_click(**d) + return cls(type=HD) elif d.get("type") == "curve_get_type": - MF: curve_get_type = curve_get_type() - MF.from_dict(d) - return cls(type=MF) + RU: curve_get_type = curve_get_type(**d) + return cls(type=RU) elif d.get("type") == "curve_get_control_points": - ER: curve_get_control_points = curve_get_control_points() - ER.from_dict(d) - return cls(type=ER) + QT: curve_get_control_points = curve_get_control_points(**d) + return cls(type=QT) elif d.get("type") == "take_snapshot": - GV: take_snapshot = take_snapshot() - GV.from_dict(d) - return cls(type=GV) + HR: take_snapshot = take_snapshot(**d) + return cls(type=HR) elif d.get("type") == "path_get_info": - SR: path_get_info = path_get_info() - SR.from_dict(d) - return cls(type=SR) + VM: path_get_info = path_get_info(**d) + return cls(type=VM) elif d.get("type") == "path_get_curve_uuids_for_vertices": - CU: path_get_curve_uuids_for_vertices = path_get_curve_uuids_for_vertices() - CU.from_dict(d) - return cls(type=CU) + DQ: path_get_curve_uuids_for_vertices = path_get_curve_uuids_for_vertices( + **d + ) + return cls(type=DQ) elif d.get("type") == "path_get_vertex_uuids": - OZ: path_get_vertex_uuids = path_get_vertex_uuids() - OZ.from_dict(d) - return cls(type=OZ) + PD: path_get_vertex_uuids = path_get_vertex_uuids(**d) + return cls(type=PD) elif d.get("type") == "plane_intersect_and_project": - HS: plane_intersect_and_project = plane_intersect_and_project() - HS.from_dict(d) - return cls(type=HS) + JL: plane_intersect_and_project = plane_intersect_and_project(**d) + return cls(type=JL) elif d.get("type") == "curve_get_end_points": - JB: curve_get_end_points = curve_get_end_points() - JB.from_dict(d) - return cls(type=JB) + QA: curve_get_end_points = curve_get_end_points(**d) + return cls(type=QA) elif d.get("type") == "import_files": - RP: import_files = import_files() - RP.from_dict(d) - return cls(type=RP) + AU: import_files = import_files(**d) + return cls(type=AU) elif d.get("type") == "mass": - PF: mass = mass() - PF.from_dict(d) - return cls(type=PF) + BL: mass = mass(**d) + return cls(type=BL) elif d.get("type") == "volume": - KV: volume = volume() - KV.from_dict(d) - return cls(type=KV) + PZ: volume = volume(**d) + return cls(type=PZ) elif d.get("type") == "density": - IN: density = density() - IN.from_dict(d) - return cls(type=IN) + GE: density = density(**d) + return cls(type=GE) elif d.get("type") == "surface_area": - QR: surface_area = surface_area() - QR.from_dict(d) - return cls(type=QR) + HH: surface_area = surface_area(**d) + return cls(type=HH) elif d.get("type") == "center_of_mass": - PG: center_of_mass = center_of_mass() - PG.from_dict(d) - return cls(type=PG) + AE: center_of_mass = center_of_mass(**d) + return cls(type=AE) elif d.get("type") == "get_sketch_mode_plane": - QS: get_sketch_mode_plane = get_sketch_mode_plane() - QS.from_dict(d) - return cls(type=QS) + AB: get_sketch_mode_plane = get_sketch_mode_plane(**d) + return cls(type=AB) raise Exception("Unknown type") + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function( + cls, + handler( + Union[ + empty, + export, + select_with_point, + highlight_set_entity, + entity_get_child_uuid, + entity_get_num_children, + entity_get_parent_id, + entity_get_all_child_uuids, + select_get, + get_entity_type, + solid3d_get_all_edge_faces, + solid3d_get_all_opposite_edges, + 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, + path_get_curve_uuids_for_vertices, + path_get_vertex_uuids, + plane_intersect_and_project, + curve_get_end_points, + import_files, + mass, + volume, + density, + surface_area, + center_of_mass, + get_sketch_mode_plane, + ] + ), + ) diff --git a/kittycad/models/ok_web_socket_response_data.py b/kittycad/models/ok_web_socket_response_data.py index 9a003cc8e..25da67582 100644 --- a/kittycad/models/ok_web_socket_response_data.py +++ b/kittycad/models/ok_web_socket_response_data.py @@ -1,344 +1,97 @@ from typing import Any, Dict, List, Type, TypeVar, Union import attr +from pydantic import BaseModel, GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema -from ..types import UNSET, Unset - -DE = TypeVar("DE", bound="ice_server_info") +from ..models.ice_server import IceServer +from ..models.ok_modeling_cmd_response import OkModelingCmdResponse +from ..models.raw_file import RawFile +from ..models.rtc_ice_candidate_init import RtcIceCandidateInit +from ..models.rtc_session_description import RtcSessionDescription -@attr.s(auto_attribs=True) -class ice_server_info: - """Information about the ICE servers.""" # noqa: E501 +class IceServerInfoData(BaseModel): + """""" + + ice_servers: List[IceServer] + + +class ice_server_info(BaseModel): + """Information about the ICE servers.""" + + data: IceServerInfoData - 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]: - data = self.data - type = self.type +class TrickleIceData(BaseModel): + """""" - 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[DE], src_dict: Dict[str, Any]) -> DE: - d = src_dict.copy() - data = d.pop("data", UNSET) - type = d.pop("type", UNSET) - - ice_server_info = cls( - data=data, - type=type, - ) - - ice_server_info.additional_properties = d - return ice_server_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 + candidate: RtcIceCandidateInit -PU = TypeVar("PU", bound="trickle_ice") +class trickle_ice(BaseModel): + """The trickle ICE candidate response.""" + data: TrickleIceData -@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 +class SdpAnswerData(BaseModel): + """""" - 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[PU], src_dict: Dict[str, Any]) -> PU: - 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 + answer: RtcSessionDescription -AP = TypeVar("AP", bound="sdp_answer") +class sdp_answer(BaseModel): + """The SDP answer response.""" + data: SdpAnswerData -@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 +class ModelingData(BaseModel): + """""" - 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[AP], src_dict: Dict[str, Any]) -> AP: - 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 + modeling_response: OkModelingCmdResponse -AA = TypeVar("AA", bound="modeling") +class modeling(BaseModel): + """The modeling command response.""" + data: ModelingData -@attr.s(auto_attribs=True) -class modeling: - """The modeling command response.""" # noqa: E501 - - 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]: - data = self.data - type = self.type +class ExportData(BaseModel): + """""" - 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[AA], src_dict: Dict[str, Any]) -> AA: - d = src_dict.copy() - data = d.pop("data", UNSET) - type = d.pop("type", UNSET) - - modeling = cls( - data=data, - type=type, - ) - - modeling.additional_properties = d - return modeling - - @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 + files: List[RawFile] -MH = TypeVar("MH", bound="export") +class export(BaseModel): + """The exported files.""" + data: ExportData -@attr.s(auto_attribs=True) -class export: - """The exported files.""" # noqa: E501 - - 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]: - 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[MH], src_dict: Dict[str, Any]) -> MH: - d = src_dict.copy() - data = d.pop("data", UNSET) - type = d.pop("type", UNSET) - - export = cls( - data=data, - type=type, - ) - - export.additional_properties = d - return export - - @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 +class MetricsRequestData(BaseModel): + """""" -OL = TypeVar("OL", bound="metrics_request") +class metrics_request(BaseModel): + """Request a collection of metrics, to include WebRTC.""" + data: MetricsRequestData -@attr.s(auto_attribs=True) -class metrics_request: - """Request a collection of metrics, to include WebRTC.""" # noqa: E501 - - data: Union[Unset, Any] = UNSET type: str = "metrics_request" - 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[OL], src_dict: Dict[str, Any]) -> OL: - d = src_dict.copy() - data = d.pop("data", UNSET) - type = d.pop("type", UNSET) - - metrics_request = cls( - data=data, - type=type, - ) - - metrics_request.additional_properties = d - return metrics_request - - @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 - GY = TypeVar("GY", bound="OkWebSocketResponseData") @@ -370,53 +123,65 @@ class OkWebSocketResponseData: ): self.type = type - def to_dict(self) -> Dict[str, Any]: + def model_dump(self) -> Dict[str, Any]: if isinstance(self.type, ice_server_info): - WA: ice_server_info = self.type - return WA.to_dict() + VY: ice_server_info = self.type + return VY.model_dump() elif isinstance(self.type, trickle_ice): - EP: trickle_ice = self.type - return EP.to_dict() + MC: trickle_ice = self.type + return MC.model_dump() elif isinstance(self.type, sdp_answer): - JY: sdp_answer = self.type - return JY.to_dict() + BR: sdp_answer = self.type + return BR.model_dump() elif isinstance(self.type, modeling): - BZ: modeling = self.type - return BZ.to_dict() + OK: modeling = self.type + return OK.model_dump() elif isinstance(self.type, export): - NL: export = self.type - return NL.to_dict() + OP: export = self.type + return OP.model_dump() elif isinstance(self.type, metrics_request): - MI: metrics_request = self.type - return MI.to_dict() + LV: metrics_request = self.type + return LV.model_dump() raise Exception("Unknown type") @classmethod def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY: if d.get("type") == "ice_server_info": - LA: ice_server_info = ice_server_info() - LA.from_dict(d) - return cls(type=LA) + DW: ice_server_info = ice_server_info(**d) + return cls(type=DW) elif d.get("type") == "trickle_ice": - CJ: trickle_ice = trickle_ice() - CJ.from_dict(d) - return cls(type=CJ) + AV: trickle_ice = trickle_ice(**d) + return cls(type=AV) elif d.get("type") == "sdp_answer": - FE: sdp_answer = sdp_answer() - FE.from_dict(d) - return cls(type=FE) + WM: sdp_answer = sdp_answer(**d) + return cls(type=WM) elif d.get("type") == "modeling": - NB: modeling = modeling() - NB.from_dict(d) - return cls(type=NB) + MU: modeling = modeling(**d) + return cls(type=MU) elif d.get("type") == "export": - TJ: export = export() - TJ.from_dict(d) - return cls(type=TJ) + WW: export = export(**d) + return cls(type=WW) elif d.get("type") == "metrics_request": - KS: metrics_request = metrics_request() - KS.from_dict(d) - return cls(type=KS) + II: metrics_request = metrics_request(**d) + return cls(type=II) raise Exception("Unknown type") + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function( + cls, + handler( + Union[ + ice_server_info, + trickle_ice, + sdp_answer, + modeling, + export, + metrics_request, + ] + ), + ) diff --git a/kittycad/models/onboarding.py b/kittycad/models/onboarding.py index c3f3fcc53..6cdda6292 100644 --- a/kittycad/models/onboarding.py +++ b/kittycad/models/onboarding.py @@ -1,73 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -VO = TypeVar("VO", bound="Onboarding") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Onboarding: - """Onboarding details""" # noqa: E501 +class Onboarding(BaseModel): + """Onboarding details""" - first_call_from__their_machine_date: Union[Unset, str] = UNSET - first_litterbox_execute_date: Union[Unset, str] = UNSET - first_token_date: Union[Unset, str] = UNSET + first_call_from_their_machine_date: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + first_litterbox_execute_date: Optional[str] = None - def to_dict(self) -> Dict[str, Any]: - first_call_from__their_machine_date = self.first_call_from__their_machine_date - first_litterbox_execute_date = self.first_litterbox_execute_date - first_token_date = self.first_token_date - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if first_call_from__their_machine_date is not UNSET: - field_dict[ - "first_call_from_their_machine_date" - ] = first_call_from__their_machine_date - if first_litterbox_execute_date is not UNSET: - field_dict["first_litterbox_execute_date"] = first_litterbox_execute_date - if first_token_date is not UNSET: - field_dict["first_token_date"] = first_token_date - - return field_dict - - @classmethod - def from_dict(cls: Type[VO], src_dict: Dict[str, Any]) -> VO: - d = src_dict.copy() - first_call_from__their_machine_date = d.pop( - "first_call_from_their_machine_date", UNSET - ) - - first_litterbox_execute_date = d.pop("first_litterbox_execute_date", UNSET) - - first_token_date = d.pop("first_token_date", UNSET) - - onboarding = cls( - first_call_from__their_machine_date=first_call_from__their_machine_date, - first_litterbox_execute_date=first_litterbox_execute_date, - first_token_date=first_token_date, - ) - - onboarding.additional_properties = d - return onboarding - - @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 + first_token_date: Optional[str] = None diff --git a/kittycad/models/output_file.py b/kittycad/models/output_file.py index 74c6b833d..73f665705 100644 --- a/kittycad/models/output_file.py +++ b/kittycad/models/output_file.py @@ -1,62 +1,11 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -JK = TypeVar("JK", bound="OutputFile") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class OutputFile: - """Output file contents.""" # noqa: E501 +class OutputFile(BaseModel): + """Output file contents.""" - contents: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + contents: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - contents = self.contents - name = self.name - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if contents is not UNSET: - field_dict["contents"] = contents - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: Type[JK], src_dict: Dict[str, Any]) -> JK: - d = src_dict.copy() - contents = d.pop("contents", UNSET) - - name = d.pop("name", UNSET) - - output_file = cls( - contents=contents, - name=name, - ) - - output_file.additional_properties = d - return output_file - - @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 + name: Optional[str] = None diff --git a/kittycad/models/output_format.py b/kittycad/models/output_format.py index 9fbf9f235..1378c512a 100644 --- a/kittycad/models/output_format.py +++ b/kittycad/models/output_format.py @@ -1,6 +1,8 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, Dict, Type, TypeVar, Union import attr +from pydantic import BaseModel, GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema from ..models.fbx_storage import FbxStorage from ..models.gltf_presentation import GltfPresentation @@ -10,536 +12,70 @@ from ..models.selection import Selection from ..models.stl_storage import StlStorage from ..models.system import System from ..models.unit_length import UnitLength -from ..types import UNSET, Unset - -DX = TypeVar("DX", bound="fbx") -@attr.s(auto_attribs=True) -class fbx: - """Autodesk Filmbox (FBX) format.""" # noqa: E501 +class fbx(BaseModel): + """Autodesk Filmbox (FBX) format.""" + + storage: FbxStorage - storage: Union[Unset, FbxStorage] = UNSET type: str = "fbx" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - storage: Union[Unset, FbxStorage] = UNSET - if not isinstance(self.storage, Unset): - storage = self.storage - type = self.type +class gltf(BaseModel): + """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.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if storage is not UNSET: - field_dict["storage"] = storage - field_dict["type"] = type + presentation: GltfPresentation - return field_dict + storage: GltfStorage - @classmethod - def from_dict(cls: Type[DX], src_dict: Dict[str, Any]) -> DX: - d = src_dict.copy() - _storage = d.pop("storage", UNSET) - storage: Union[Unset, FbxStorage] - if isinstance(_storage, Unset): - storage = UNSET - if _storage is None: - storage = UNSET - else: - storage = _storage - - 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 - - -LH = TypeVar("LH", 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]: - presentation: Union[Unset, GltfPresentation] = UNSET - if not isinstance(self.presentation, Unset): - presentation = self.presentation - storage: Union[Unset, GltfStorage] = UNSET - if not isinstance(self.storage, Unset): - storage = self.storage - type = self.type +class obj(BaseModel): + """Wavefront OBJ format.""" - 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 + coords: System - return field_dict - - @classmethod - def from_dict(cls: Type[LH], src_dict: Dict[str, Any]) -> LH: - d = src_dict.copy() - _presentation = d.pop("presentation", UNSET) - presentation: Union[Unset, GltfPresentation] - if isinstance(_presentation, Unset): - presentation = UNSET - if _presentation is None: - presentation = UNSET - else: - presentation = _presentation - - _storage = d.pop("storage", UNSET) - storage: Union[Unset, GltfStorage] - if isinstance(_storage, Unset): - storage = UNSET - if _storage is None: - storage = UNSET - else: - storage = _storage - - type = d.pop("type", UNSET) - - gltf = cls( - presentation=presentation, - storage=storage, - type=type, - ) - - gltf.additional_properties = d - return gltf - - @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 - - -XA = TypeVar("XA", bound="obj") - - -@attr.s(auto_attribs=True) -class obj: - """Wavefront OBJ format.""" # noqa: E501 - - coords: Union[Unset, System] = UNSET type: str = "obj" - units: Union[Unset, UnitLength] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - coords: Union[Unset, System] = UNSET - if not isinstance(self.coords, Unset): - coords = self.coords - type = self.type - units: Union[Unset, UnitLength] = UNSET - if not isinstance(self.units, Unset): - units = self.units - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if coords is not UNSET: - _coords: System = cast(System, coords) - field_dict["coords"] = _coords.to_dict() - field_dict["type"] = type - if units is not UNSET: - field_dict["units"] = units - - return field_dict - - @classmethod - def from_dict(cls: Type[XA], src_dict: Dict[str, Any]) -> XA: - d = src_dict.copy() - _coords = d.pop("coords", UNSET) - coords: Union[Unset, System] - if isinstance(_coords, Unset): - coords = UNSET - if _coords is None: - coords = UNSET - else: - coords = System.from_dict(_coords) - - type = d.pop("type", UNSET) - - _units = d.pop("units", UNSET) - units: Union[Unset, UnitLength] - if isinstance(_units, Unset): - units = UNSET - if _units is None: - units = UNSET - else: - units = _units - - obj = cls( - coords=coords, - type=type, - units=units, - ) - - obj.additional_properties = d - return obj - - @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 + units: UnitLength -QJ = TypeVar("QJ", bound="ply") +class ply(BaseModel): + """The PLY Polygon File Format.""" + coords: System -@attr.s(auto_attribs=True) -class ply: - """The PLY Polygon File Format.""" # noqa: E501 + selection: Selection + + storage: PlyStorage - coords: Union[Unset, System] = UNSET - selection: Union[Unset, Selection] = UNSET - storage: Union[Unset, PlyStorage] = UNSET type: str = "ply" - units: Union[Unset, UnitLength] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - coords: Union[Unset, System] = UNSET - if not isinstance(self.coords, Unset): - coords = self.coords - selection: Union[Unset, Selection] = UNSET - if not isinstance(self.selection, Unset): - selection = self.selection - storage: Union[Unset, PlyStorage] = UNSET - if not isinstance(self.storage, Unset): - storage = self.storage - type = self.type - units: Union[Unset, UnitLength] = UNSET - if not isinstance(self.units, Unset): - units = self.units - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if coords is not UNSET: - _coords: System = cast(System, coords) - field_dict["coords"] = _coords.to_dict() - if selection is not UNSET: - _selection: Selection = cast(Selection, selection) - field_dict["selection"] = _selection.to_dict() - if storage is not UNSET: - field_dict["storage"] = storage - field_dict["type"] = type - if units is not UNSET: - field_dict["units"] = units - - return field_dict - - @classmethod - def from_dict(cls: Type[QJ], src_dict: Dict[str, Any]) -> QJ: - d = src_dict.copy() - _coords = d.pop("coords", UNSET) - coords: Union[Unset, System] - if isinstance(_coords, Unset): - coords = UNSET - if _coords is None: - coords = UNSET - else: - coords = System.from_dict(_coords) - - _selection = d.pop("selection", UNSET) - selection: Union[Unset, Selection] - if isinstance(_selection, Unset): - selection = UNSET - if _selection is None: - selection = UNSET - else: - selection = Selection.from_dict(_selection) - - _storage = d.pop("storage", UNSET) - storage: Union[Unset, PlyStorage] - if isinstance(_storage, Unset): - storage = UNSET - if _storage is None: - storage = UNSET - else: - storage = _storage - - type = d.pop("type", UNSET) - - _units = d.pop("units", UNSET) - units: Union[Unset, UnitLength] - if isinstance(_units, Unset): - units = UNSET - if _units is None: - units = UNSET - else: - units = _units - - ply = cls( - coords=coords, - selection=selection, - storage=storage, - type=type, - units=units, - ) - - ply.additional_properties = d - return ply - - @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 + units: UnitLength -ES = TypeVar("ES", bound="step") +class step(BaseModel): + """ISO 10303-21 (STEP) format.""" + coords: System -@attr.s(auto_attribs=True) -class step: - """ISO 10303-21 (STEP) format.""" # noqa: E501 - - coords: Union[Unset, System] = UNSET type: str = "step" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - coords: Union[Unset, System] = UNSET - if not isinstance(self.coords, Unset): - coords = self.coords - type = self.type +class stl(BaseModel): + """*ST**ereo**L**ithography format.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if coords is not UNSET: - _coords: System = cast(System, coords) - field_dict["coords"] = _coords.to_dict() - field_dict["type"] = type + coords: System - return field_dict + selection: Selection - @classmethod - def from_dict(cls: Type[ES], src_dict: Dict[str, Any]) -> ES: - d = src_dict.copy() - _coords = d.pop("coords", UNSET) - coords: Union[Unset, System] - if isinstance(_coords, Unset): - coords = UNSET - if _coords is None: - coords = UNSET - else: - coords = System.from_dict(_coords) + storage: StlStorage - type = d.pop("type", UNSET) - - step = cls( - coords=coords, - type=type, - ) - - step.additional_properties = d - return step - - @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 - - -AI = TypeVar("AI", bound="stl") - - -@attr.s(auto_attribs=True) -class stl: - """*ST**ereo**L**ithography format.""" # noqa: E501 - - coords: Union[Unset, System] = UNSET - selection: Union[Unset, Selection] = UNSET - storage: Union[Unset, StlStorage] = UNSET type: str = "stl" - units: Union[Unset, UnitLength] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - coords: Union[Unset, System] = UNSET - if not isinstance(self.coords, Unset): - coords = self.coords - selection: Union[Unset, Selection] = UNSET - if not isinstance(self.selection, Unset): - selection = self.selection - storage: Union[Unset, StlStorage] = UNSET - if not isinstance(self.storage, Unset): - storage = self.storage - type = self.type - units: Union[Unset, UnitLength] = UNSET - if not isinstance(self.units, Unset): - units = self.units - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if coords is not UNSET: - _coords: System = cast(System, coords) - field_dict["coords"] = _coords.to_dict() - if selection is not UNSET: - _selection: Selection = cast(Selection, selection) - field_dict["selection"] = _selection.to_dict() - if storage is not UNSET: - field_dict["storage"] = storage - field_dict["type"] = type - if units is not UNSET: - field_dict["units"] = units - - return field_dict - - @classmethod - def from_dict(cls: Type[AI], src_dict: Dict[str, Any]) -> AI: - d = src_dict.copy() - _coords = d.pop("coords", UNSET) - coords: Union[Unset, System] - if isinstance(_coords, Unset): - coords = UNSET - if _coords is None: - coords = UNSET - else: - coords = System.from_dict(_coords) - - _selection = d.pop("selection", UNSET) - selection: Union[Unset, Selection] - if isinstance(_selection, Unset): - selection = UNSET - if _selection is None: - selection = UNSET - else: - selection = Selection.from_dict(_selection) - - _storage = d.pop("storage", UNSET) - storage: Union[Unset, StlStorage] - if isinstance(_storage, Unset): - storage = UNSET - if _storage is None: - storage = UNSET - else: - storage = _storage - - type = d.pop("type", UNSET) - - _units = d.pop("units", UNSET) - units: Union[Unset, UnitLength] - if isinstance(_units, Unset): - units = UNSET - if _units is None: - units = UNSET - else: - units = _units - - stl = cls( - coords=coords, - selection=selection, - storage=storage, - type=type, - units=units, - ) - - stl.additional_properties = d - return stl - - @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 + units: UnitLength GY = TypeVar("GY", bound="OutputFormat") @@ -572,53 +108,65 @@ class OutputFormat: ): self.type = type - def to_dict(self) -> Dict[str, Any]: + def model_dump(self) -> Dict[str, Any]: if isinstance(self.type, fbx): - MV: fbx = self.type - return MV.to_dict() + FC: fbx = self.type + return FC.model_dump() elif isinstance(self.type, gltf): - NW: gltf = self.type - return NW.to_dict() + EI: gltf = self.type + return EI.model_dump() elif isinstance(self.type, obj): - MR: obj = self.type - return MR.to_dict() + JE: obj = self.type + return JE.model_dump() elif isinstance(self.type, ply): - WG: ply = self.type - return WG.to_dict() + JW: ply = self.type + return JW.model_dump() elif isinstance(self.type, step): - DZ: step = self.type - return DZ.to_dict() + AS: step = self.type + return AS.model_dump() elif isinstance(self.type, stl): - UC: stl = self.type - return UC.to_dict() + YQ: stl = self.type + return YQ.model_dump() raise Exception("Unknown type") @classmethod def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY: if d.get("type") == "fbx": - LU: fbx = fbx() - LU.from_dict(d) - return cls(type=LU) + OA: fbx = fbx(**d) + return cls(type=OA) elif d.get("type") == "gltf": - EH: gltf = gltf() - EH.from_dict(d) - return cls(type=EH) + CQ: gltf = gltf(**d) + return cls(type=CQ) elif d.get("type") == "obj": - MY: obj = obj() - MY.from_dict(d) - return cls(type=MY) + RD: obj = obj(**d) + return cls(type=RD) elif d.get("type") == "ply": - WC: ply = ply() - WC.from_dict(d) - return cls(type=WC) + KZ: ply = ply(**d) + return cls(type=KZ) elif d.get("type") == "step": - ZT: step = step() - ZT.from_dict(d) - return cls(type=ZT) + IU: step = step(**d) + return cls(type=IU) elif d.get("type") == "stl": - VZ: stl = stl() - VZ.from_dict(d) - return cls(type=VZ) + NQ: stl = stl(**d) + return cls(type=NQ) raise Exception("Unknown type") + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function( + cls, + handler( + Union[ + fbx, + gltf, + obj, + ply, + step, + stl, + ] + ), + ) diff --git a/kittycad/models/path_get_curve_uuids_for_vertices.py b/kittycad/models/path_get_curve_uuids_for_vertices.py index 329eb18ba..c16aa9920 100644 --- a/kittycad/models/path_get_curve_uuids_for_vertices.py +++ b/kittycad/models/path_get_curve_uuids_for_vertices.py @@ -1,57 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -KY = TypeVar("KY", bound="PathGetCurveUuidsForVertices") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class PathGetCurveUuidsForVertices: - """The response from the `PathGetCurveUuidsForVertices` command.""" # noqa: E501 +class PathGetCurveUuidsForVertices(BaseModel): + """The response from the `PathGetCurveUuidsForVertices` command.""" - curve_ids: Union[Unset, List[str]] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - curve_ids: Union[Unset, List[str]] = UNSET - if not isinstance(self.curve_ids, Unset): - curve_ids = self.curve_ids - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if curve_ids is not UNSET: - field_dict["curve_ids"] = curve_ids - - return field_dict - - @classmethod - def from_dict(cls: Type[KY], src_dict: Dict[str, Any]) -> KY: - d = src_dict.copy() - curve_ids = cast(List[str], d.pop("curve_ids", UNSET)) - - path_get_curve_uuids_for_vertices = cls( - curve_ids=curve_ids, - ) - - path_get_curve_uuids_for_vertices.additional_properties = d - return path_get_curve_uuids_for_vertices - - @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 + curve_ids: List[UUID] diff --git a/kittycad/models/path_get_info.py b/kittycad/models/path_get_info.py index e37671d5b..8d9802424 100644 --- a/kittycad/models/path_get_info.py +++ b/kittycad/models/path_get_info.py @@ -1,63 +1,11 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -ZJ = TypeVar("ZJ", bound="PathGetInfo") +from ..models.path_segment_info import PathSegmentInfo -@attr.s(auto_attribs=True) -class PathGetInfo: - """The response from the `PathGetInfo` command.""" # noqa: E501 +class PathGetInfo(BaseModel): + """The response from the `PathGetInfo` command.""" - 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[ZJ], src_dict: Dict[str, Any]) -> ZJ: - 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 + segments: List[PathSegmentInfo] diff --git a/kittycad/models/path_get_vertex_uuids.py b/kittycad/models/path_get_vertex_uuids.py index a883c3a9d..9dd91c6b9 100644 --- a/kittycad/models/path_get_vertex_uuids.py +++ b/kittycad/models/path_get_vertex_uuids.py @@ -1,57 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -VS = TypeVar("VS", bound="PathGetVertexUuids") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class PathGetVertexUuids: - """The response from the `PathGetVertexUuids` command.""" # noqa: E501 +class PathGetVertexUuids(BaseModel): + """The response from the `PathGetVertexUuids` command.""" - vertex_ids: Union[Unset, List[str]] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - vertex_ids: Union[Unset, List[str]] = UNSET - if not isinstance(self.vertex_ids, Unset): - vertex_ids = self.vertex_ids - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if vertex_ids is not UNSET: - field_dict["vertex_ids"] = vertex_ids - - return field_dict - - @classmethod - def from_dict(cls: Type[VS], src_dict: Dict[str, Any]) -> VS: - d = src_dict.copy() - vertex_ids = cast(List[str], d.pop("vertex_ids", UNSET)) - - path_get_vertex_uuids = cls( - vertex_ids=vertex_ids, - ) - - path_get_vertex_uuids.additional_properties = d - return path_get_vertex_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 + vertex_ids: List[UUID] diff --git a/kittycad/models/path_segment.py b/kittycad/models/path_segment.py index 50848e966..07d7cc325 100644 --- a/kittycad/models/path_segment.py +++ b/kittycad/models/path_segment.py @@ -1,480 +1,77 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, Dict, Optional, Type, TypeVar, Union import attr +from pydantic import BaseModel, GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema from ..models.angle import Angle from ..models.point2d import Point2d from ..models.point3d import Point3d -from ..types import UNSET, Unset - -PM = TypeVar("PM", bound="line") -@attr.s(auto_attribs=True) -class line: - """A straight line segment. Goes from the current path "pen" to the given endpoint.""" # noqa: E501 +class line(BaseModel): + """A straight line segment. Goes from the current path "pen" to the given endpoint.""" + + end: Point3d + + relative: bool - end: Union[Unset, Point3d] = UNSET - relative: Union[Unset, bool] = False type: str = "line" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - end: Union[Unset, Point3d] = UNSET - if not isinstance(self.end, Unset): - end = self.end - relative = self.relative - type = self.type +class arc(BaseModel): + """A circular arc segment.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if end is not UNSET: - _end: Point3d = cast(Point3d, end) - field_dict["end"] = _end.to_dict() - if relative is not UNSET: - field_dict["relative"] = relative - field_dict["type"] = type + angle_end: float - return field_dict + angle_start: float - @classmethod - def from_dict(cls: Type[PM], src_dict: Dict[str, Any]) -> PM: - d = src_dict.copy() - _end = d.pop("end", UNSET) - end: Union[Unset, Point3d] - if isinstance(_end, Unset): - end = UNSET - if _end is None: - end = UNSET - else: - end = Point3d.from_dict(_end) + center: Point2d - relative = d.pop("relative", UNSET) + end: Optional[Angle] = None - type = d.pop("type", UNSET) + radius: float - line = cls( - end=end, - relative=relative, - type=type, - ) + relative: bool - line.additional_properties = d - return line + start: Optional[Angle] = None - @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 - - -HI = TypeVar("HI", bound="arc") - - -@attr.s(auto_attribs=True) -class arc: - """A circular arc segment.""" # noqa: E501 - - angle_end: Union[Unset, float] = UNSET - angle_start: Union[Unset, float] = UNSET - center: Union[Unset, Point2d] = UNSET - end: Union[Unset, Angle] = UNSET - radius: Union[Unset, float] = UNSET - relative: Union[Unset, bool] = False - start: Union[Unset, Angle] = UNSET type: str = "arc" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - angle_end = self.angle_end - angle_start = self.angle_start - center: Union[Unset, Point2d] = UNSET - if not isinstance(self.center, Unset): - center = self.center - end: Union[Unset, Angle] = UNSET - if not isinstance(self.end, Unset): - end = self.end - radius = self.radius - relative = self.relative - start: Union[Unset, Angle] = UNSET - if not isinstance(self.start, Unset): - start = self.start - type = self.type +class bezier(BaseModel): + """A cubic bezier curve segment. Start at the end of the current line, go through control point 1 and 2, then end at a given point.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if angle_end is not UNSET: - field_dict["angle_end"] = angle_end - if angle_start is not UNSET: - field_dict["angle_start"] = angle_start - if center is not UNSET: - _center: Point2d = cast(Point2d, center) - field_dict["center"] = _center.to_dict() - if end is not UNSET: - _end: Angle = cast(Angle, end) - field_dict["end"] = _end.to_dict() - if radius is not UNSET: - field_dict["radius"] = radius - if relative is not UNSET: - field_dict["relative"] = relative - if start is not UNSET: - _start: Angle = cast(Angle, start) - field_dict["start"] = _start.to_dict() - field_dict["type"] = type + control1: Point3d - return field_dict + control2: Point3d - @classmethod - def from_dict(cls: Type[HI], src_dict: Dict[str, Any]) -> HI: - d = src_dict.copy() - angle_end = d.pop("angle_end", UNSET) + end: Point3d - angle_start = d.pop("angle_start", UNSET) + relative: bool - _center = d.pop("center", UNSET) - center: Union[Unset, Point2d] - if isinstance(_center, Unset): - center = UNSET - if _center is None: - center = UNSET - else: - center = Point2d.from_dict(_center) - - _end = d.pop("end", UNSET) - end: Union[Unset, Angle] - if isinstance(_end, Unset): - end = UNSET - if _end is None: - end = UNSET - else: - end = Angle.from_dict(_end) - - radius = d.pop("radius", UNSET) - - relative = d.pop("relative", UNSET) - - _start = d.pop("start", UNSET) - start: Union[Unset, Angle] - if isinstance(_start, Unset): - start = UNSET - if _start is None: - start = UNSET - else: - start = Angle.from_dict(_start) - - type = d.pop("type", UNSET) - - arc = cls( - angle_end=angle_end, - angle_start=angle_start, - center=center, - end=end, - radius=radius, - relative=relative, - start=start, - type=type, - ) - - arc.additional_properties = d - return arc - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -XD = TypeVar("XD", bound="bezier") - - -@attr.s(auto_attribs=True) -class bezier: - """A cubic bezier curve segment. Start at the end of the current line, go through control point 1 and 2, then end at a given point.""" # noqa: E501 - - control1: Union[Unset, Point3d] = UNSET - control2: Union[Unset, Point3d] = UNSET - end: Union[Unset, Point3d] = UNSET - relative: Union[Unset, bool] = False type: str = "bezier" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - control1: Union[Unset, Point3d] = UNSET - if not isinstance(self.control1, Unset): - control1 = self.control1 - control2: Union[Unset, Point3d] = UNSET - if not isinstance(self.control2, Unset): - control2 = self.control2 - end: Union[Unset, Point3d] = UNSET - if not isinstance(self.end, Unset): - end = self.end - relative = self.relative - type = self.type +class tangential_arc(BaseModel): + """Adds a tangent arc from current pen position with the given radius and angle.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if control1 is not UNSET: - _control1: Point3d = cast(Point3d, control1) - field_dict["control1"] = _control1.to_dict() - if control2 is not UNSET: - _control2: Point3d = cast(Point3d, control2) - field_dict["control2"] = _control2.to_dict() - if end is not UNSET: - _end: Point3d = cast(Point3d, end) - field_dict["end"] = _end.to_dict() - if relative is not UNSET: - field_dict["relative"] = relative - field_dict["type"] = type + offset: Angle - return field_dict + radius: float - @classmethod - def from_dict(cls: Type[XD], src_dict: Dict[str, Any]) -> XD: - d = src_dict.copy() - _control1 = d.pop("control1", UNSET) - control1: Union[Unset, Point3d] - if isinstance(_control1, Unset): - control1 = UNSET - if _control1 is None: - control1 = UNSET - else: - control1 = Point3d.from_dict(_control1) - - _control2 = d.pop("control2", UNSET) - control2: Union[Unset, Point3d] - if isinstance(_control2, Unset): - control2 = UNSET - if _control2 is None: - control2 = UNSET - else: - control2 = Point3d.from_dict(_control2) - - _end = d.pop("end", UNSET) - end: Union[Unset, Point3d] - if isinstance(_end, Unset): - end = UNSET - if _end is None: - end = UNSET - else: - end = Point3d.from_dict(_end) - - relative = d.pop("relative", UNSET) - - type = d.pop("type", UNSET) - - bezier = cls( - control1=control1, - control2=control2, - end=end, - relative=relative, - type=type, - ) - - bezier.additional_properties = d - return bezier - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -HN = TypeVar("HN", bound="tangential_arc") - - -@attr.s(auto_attribs=True) -class tangential_arc: - """Adds a tangent arc from current pen position with the given radius and angle.""" # noqa: E501 - - offset: Union[Unset, Angle] = UNSET - radius: Union[Unset, float] = UNSET type: str = "tangential_arc" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - offset: Union[Unset, Angle] = UNSET - if not isinstance(self.offset, Unset): - offset = self.offset - radius = self.radius - type = self.type +class tangential_arc_to(BaseModel): + """Adds a tangent arc from current pen position to the new position.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if offset is not UNSET: - _offset: Angle = cast(Angle, offset) - field_dict["offset"] = _offset.to_dict() - if radius is not UNSET: - field_dict["radius"] = radius - field_dict["type"] = type + angle_snap_increment: Optional[Angle] = None - return field_dict + to: Point3d - @classmethod - def from_dict(cls: Type[HN], src_dict: Dict[str, Any]) -> HN: - d = src_dict.copy() - _offset = d.pop("offset", UNSET) - offset: Union[Unset, Angle] - if isinstance(_offset, Unset): - offset = UNSET - if _offset is None: - offset = UNSET - else: - offset = Angle.from_dict(_offset) - - radius = d.pop("radius", UNSET) - - type = d.pop("type", UNSET) - - tangential_arc = cls( - offset=offset, - radius=radius, - type=type, - ) - - tangential_arc.additional_properties = d - return tangential_arc - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties - - -OT = TypeVar("OT", bound="tangential_arc_to") - - -@attr.s(auto_attribs=True) -class tangential_arc_to: - """Adds a tangent arc from current pen position to the new position.""" # noqa: E501 - - angle_snap_increment: Union[Unset, Angle] = UNSET - to: Union[Unset, Point3d] = UNSET type: str = "tangential_arc_to" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - angle_snap_increment: Union[Unset, Angle] = UNSET - if not isinstance(self.angle_snap_increment, Unset): - angle_snap_increment = self.angle_snap_increment - to: Union[Unset, Point3d] = UNSET - if not isinstance(self.to, Unset): - to = self.to - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if angle_snap_increment is not UNSET: - _angle_snap_increment: Angle = cast(Angle, angle_snap_increment) - field_dict["angle_snap_increment"] = _angle_snap_increment.to_dict() - if to is not UNSET: - _to: Point3d = cast(Point3d, to) - field_dict["to"] = _to.to_dict() - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[OT], src_dict: Dict[str, Any]) -> OT: - d = src_dict.copy() - _angle_snap_increment = d.pop("angle_snap_increment", UNSET) - angle_snap_increment: Union[Unset, Angle] - if isinstance(_angle_snap_increment, Unset): - angle_snap_increment = UNSET - if _angle_snap_increment is None: - angle_snap_increment = UNSET - else: - angle_snap_increment = Angle.from_dict(_angle_snap_increment) - - _to = d.pop("to", UNSET) - to: Union[Unset, Point3d] - if isinstance(_to, Unset): - to = UNSET - if _to is None: - to = UNSET - else: - to = Point3d.from_dict(_to) - - type = d.pop("type", UNSET) - - tangential_arc_to = cls( - angle_snap_increment=angle_snap_increment, - to=to, - type=type, - ) - - tangential_arc_to.additional_properties = d - return tangential_arc_to - - @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 - GY = TypeVar("GY", bound="PathSegment") @@ -504,46 +101,58 @@ class PathSegment: ): self.type = type - def to_dict(self) -> Dict[str, Any]: + def model_dump(self) -> Dict[str, Any]: if isinstance(self.type, line): - AT: line = self.type - return AT.to_dict() + EW: line = self.type + return EW.model_dump() elif isinstance(self.type, arc): - KI: arc = self.type - return KI.to_dict() + BT: arc = self.type + return BT.model_dump() elif isinstance(self.type, bezier): - HW: bezier = self.type - return HW.to_dict() + AG: bezier = self.type + return AG.model_dump() elif isinstance(self.type, tangential_arc): - FR: tangential_arc = self.type - return FR.to_dict() + EA: tangential_arc = self.type + return EA.model_dump() elif isinstance(self.type, tangential_arc_to): - WZ: tangential_arc_to = self.type - return WZ.to_dict() + VW: tangential_arc_to = self.type + return VW.model_dump() raise Exception("Unknown type") @classmethod def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY: if d.get("type") == "line": - GF: line = line() - GF.from_dict(d) - return cls(type=GF) + BU: line = line(**d) + return cls(type=BU) elif d.get("type") == "arc": - RM: arc = arc() - RM.from_dict(d) - return cls(type=RM) + GR: arc = arc(**d) + return cls(type=GR) elif d.get("type") == "bezier": - UD: bezier = bezier() - UD.from_dict(d) - return cls(type=UD) + EJ: bezier = bezier(**d) + return cls(type=EJ) elif d.get("type") == "tangential_arc": - GT: tangential_arc = tangential_arc() - GT.from_dict(d) - return cls(type=GT) + LQ: tangential_arc = tangential_arc(**d) + return cls(type=LQ) elif d.get("type") == "tangential_arc_to": - BQ: tangential_arc_to = tangential_arc_to() - BQ.from_dict(d) - return cls(type=BQ) + DP: tangential_arc_to = tangential_arc_to(**d) + return cls(type=DP) raise Exception("Unknown type") + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function( + cls, + handler( + Union[ + line, + arc, + bezier, + tangential_arc, + tangential_arc_to, + ] + ), + ) diff --git a/kittycad/models/path_segment_info.py b/kittycad/models/path_segment_info.py index c6e050b76..23fc0884e 100644 --- a/kittycad/models/path_segment_info.py +++ b/kittycad/models/path_segment_info.py @@ -1,89 +1,16 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr +from pydantic import BaseModel from ..models.modeling_cmd_id import ModelingCmdId from ..models.path_command import PathCommand -from ..types import UNSET, Unset - -UH = TypeVar("UH", bound="PathSegmentInfo") -@attr.s(auto_attribs=True) -class PathSegmentInfo: - """Info about a path segment""" # noqa: E501 +class PathSegmentInfo(BaseModel): + """Info about a path segment""" - command: Union[Unset, PathCommand] = UNSET - command_id: Union[Unset, ModelingCmdId] = UNSET - relative: Union[Unset, bool] = False + command: PathCommand - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + command_id: Optional[ModelingCmdId] = None - def to_dict(self) -> Dict[str, Any]: - command: Union[Unset, PathCommand] = UNSET - if not isinstance(self.command, Unset): - command = self.command - command_id: Union[Unset, ModelingCmdId] = UNSET - if not isinstance(self.command_id, Unset): - command_id = self.command_id - relative = self.relative - - 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 - if relative is not UNSET: - field_dict["relative"] = relative - - return field_dict - - @classmethod - def from_dict(cls: Type[UH], src_dict: Dict[str, Any]) -> UH: - d = src_dict.copy() - _command = d.pop("command", UNSET) - command: Union[Unset, PathCommand] - if isinstance(_command, Unset): - command = UNSET - if _command is None: - command = UNSET - else: - command = _command - - _command_id = d.pop("command_id", UNSET) - command_id: Union[Unset, ModelingCmdId] - if isinstance(_command_id, Unset): - command_id = UNSET - if _command_id is None: - command_id = UNSET - else: - command_id = _command_id - - relative = d.pop("relative", UNSET) - - path_segment_info = cls( - command=command, - command_id=command_id, - relative=relative, - ) - - 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 + relative: bool diff --git a/kittycad/models/payment_intent.py b/kittycad/models/payment_intent.py index b6ff8915c..898aff479 100644 --- a/kittycad/models/payment_intent.py +++ b/kittycad/models/payment_intent.py @@ -1,55 +1,8 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -DC = TypeVar("DC", bound="PaymentIntent") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class PaymentIntent: - """A payment intent response.""" # noqa: E501 +class PaymentIntent(BaseModel): + """A payment intent response.""" - client_secret: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - client_secret = self.client_secret - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if client_secret is not UNSET: - field_dict["client_secret"] = client_secret - - return field_dict - - @classmethod - def from_dict(cls: Type[DC], src_dict: Dict[str, Any]) -> DC: - d = src_dict.copy() - client_secret = d.pop("client_secret", UNSET) - - payment_intent = cls( - client_secret=client_secret, - ) - - payment_intent.additional_properties = d - return payment_intent - - @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 + client_secret: str diff --git a/kittycad/models/payment_method.py b/kittycad/models/payment_method.py index 296c6d1b4..fca4338a4 100644 --- a/kittycad/models/payment_method.py +++ b/kittycad/models/payment_method.py @@ -1,132 +1,24 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Dict, Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.billing_info import BillingInfo from ..models.card_details import CardDetails from ..models.payment_method_type import PaymentMethodType -from ..types import UNSET, Unset - -CT = TypeVar("CT", bound="PaymentMethod") -@attr.s(auto_attribs=True) -class PaymentMethod: - """A payment method.""" # noqa: E501 +class PaymentMethod(BaseModel): + """A payment method.""" - billing_info: Union[Unset, BillingInfo] = UNSET - card: Union[Unset, CardDetails] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - id: Union[Unset, str] = UNSET - metadata: Union[Unset, Dict[str, str]] = UNSET - type: Union[Unset, PaymentMethodType] = UNSET + billing_info: BillingInfo - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + card: Optional[CardDetails] = None - def to_dict(self) -> Dict[str, Any]: - billing_info: Union[Unset, BillingInfo] = UNSET - if not isinstance(self.billing_info, Unset): - billing_info = self.billing_info - card: Union[Unset, CardDetails] = UNSET - if not isinstance(self.card, Unset): - card = self.card - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - id = self.id - metadata = self.metadata + created_at: datetime.datetime - type: Union[Unset, PaymentMethodType] = UNSET - if not isinstance(self.type, Unset): - type = self.type + id: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if billing_info is not UNSET: - _billing_info: BillingInfo = cast(BillingInfo, billing_info) - field_dict["billing_info"] = _billing_info.to_dict() - if card is not UNSET: - _card: CardDetails = cast(CardDetails, card) - field_dict["card"] = _card.to_dict() - if created_at is not UNSET: - field_dict["created_at"] = created_at - if id is not UNSET: - field_dict["id"] = id - if metadata is not UNSET: - field_dict["metadata"] = metadata - if type is not UNSET: - field_dict["type"] = type + metadata: Optional[Dict[str, str]] = None - return field_dict - - @classmethod - def from_dict(cls: Type[CT], src_dict: Dict[str, Any]) -> CT: - d = src_dict.copy() - _billing_info = d.pop("billing_info", UNSET) - billing_info: Union[Unset, BillingInfo] - if isinstance(_billing_info, Unset): - billing_info = UNSET - if _billing_info is None: - billing_info = UNSET - else: - billing_info = BillingInfo.from_dict(_billing_info) - - _card = d.pop("card", UNSET) - card: Union[Unset, CardDetails] - if isinstance(_card, Unset): - card = UNSET - if _card is None: - card = UNSET - else: - card = CardDetails.from_dict(_card) - - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) - - id = d.pop("id", UNSET) - - metadata = d.pop("metadata", UNSET) - - _type = d.pop("type", UNSET) - type: Union[Unset, PaymentMethodType] - if isinstance(_type, Unset): - type = UNSET - if _type is None: - type = UNSET - else: - type = _type - - payment_method = cls( - billing_info=billing_info, - card=card, - created_at=created_at, - id=id, - metadata=metadata, - type=type, - ) - - payment_method.additional_properties = d - return payment_method - - @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 + type: PaymentMethodType diff --git a/kittycad/models/payment_method_card_checks.py b/kittycad/models/payment_method_card_checks.py index 5446bd85e..f144a7a56 100644 --- a/kittycad/models/payment_method_card_checks.py +++ b/kittycad/models/payment_method_card_checks.py @@ -1,69 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -GX = TypeVar("GX", bound="PaymentMethodCardChecks") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class PaymentMethodCardChecks: - """Card checks.""" # noqa: E501 +class PaymentMethodCardChecks(BaseModel): + """Card checks.""" - address_line1_check: Union[Unset, str] = UNSET - address_postal_code_check: Union[Unset, str] = UNSET - cvc_check: Union[Unset, str] = UNSET + address_line1_check: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + address_postal_code_check: Optional[str] = None - def to_dict(self) -> Dict[str, Any]: - address_line1_check = self.address_line1_check - address_postal_code_check = self.address_postal_code_check - cvc_check = self.cvc_check - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if address_line1_check is not UNSET: - field_dict["address_line1_check"] = address_line1_check - if address_postal_code_check is not UNSET: - field_dict["address_postal_code_check"] = address_postal_code_check - if cvc_check is not UNSET: - field_dict["cvc_check"] = cvc_check - - return field_dict - - @classmethod - def from_dict(cls: Type[GX], src_dict: Dict[str, Any]) -> GX: - d = src_dict.copy() - address_line1_check = d.pop("address_line1_check", UNSET) - - address_postal_code_check = d.pop("address_postal_code_check", UNSET) - - cvc_check = d.pop("cvc_check", UNSET) - - payment_method_card_checks = cls( - address_line1_check=address_line1_check, - address_postal_code_check=address_postal_code_check, - cvc_check=cvc_check, - ) - - payment_method_card_checks.additional_properties = d - return payment_method_card_checks - - @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 + cvc_check: Optional[str] = None diff --git a/kittycad/models/plane_intersect_and_project.py b/kittycad/models/plane_intersect_and_project.py index 3f78b7eaf..633398e39 100644 --- a/kittycad/models/plane_intersect_and_project.py +++ b/kittycad/models/plane_intersect_and_project.py @@ -1,66 +1,11 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Optional -import attr +from pydantic import BaseModel from ..models.point2d import Point2d -from ..types import UNSET, Unset - -DG = TypeVar("DG", bound="PlaneIntersectAndProject") -@attr.s(auto_attribs=True) -class PlaneIntersectAndProject: - """Corresponding coordinates of given window coordinates, intersected on given plane.""" # noqa: E501 +class PlaneIntersectAndProject(BaseModel): + """Corresponding coordinates of given window coordinates, intersected on given plane.""" - plane_coordinates: Union[Unset, Point2d] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - plane_coordinates: Union[Unset, Point2d] = UNSET - if not isinstance(self.plane_coordinates, Unset): - plane_coordinates = self.plane_coordinates - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if plane_coordinates is not UNSET: - _plane_coordinates: Point2d = cast(Point2d, plane_coordinates) - field_dict["plane_coordinates"] = _plane_coordinates.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[DG], src_dict: Dict[str, Any]) -> DG: - d = src_dict.copy() - _plane_coordinates = d.pop("plane_coordinates", UNSET) - plane_coordinates: Union[Unset, Point2d] - if isinstance(_plane_coordinates, Unset): - plane_coordinates = UNSET - if _plane_coordinates is None: - plane_coordinates = UNSET - else: - plane_coordinates = Point2d.from_dict(_plane_coordinates) - - plane_intersect_and_project = cls( - plane_coordinates=plane_coordinates, - ) - - plane_intersect_and_project.additional_properties = d - return plane_intersect_and_project - - @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 + plane_coordinates: Optional[Point2d] = None diff --git a/kittycad/models/point2d.py b/kittycad/models/point2d.py index b6e0af2ca..ca4b15a70 100644 --- a/kittycad/models/point2d.py +++ b/kittycad/models/point2d.py @@ -1,62 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -SW = TypeVar("SW", bound="Point2d") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Point2d: - """A point in 2D space""" # noqa: E501 +class Point2d(BaseModel): + """A point in 2D space""" - x: Union[Unset, float] = UNSET - y: Union[Unset, float] = UNSET + x: float - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - x = self.x - y = self.y - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if x is not UNSET: - field_dict["x"] = x - if y is not UNSET: - field_dict["y"] = y - - return field_dict - - @classmethod - def from_dict(cls: Type[SW], src_dict: Dict[str, Any]) -> SW: - d = src_dict.copy() - x = d.pop("x", UNSET) - - y = d.pop("y", UNSET) - - point2d = cls( - x=x, - y=y, - ) - - point2d.additional_properties = d - return point2d - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + y: float diff --git a/kittycad/models/point3d.py b/kittycad/models/point3d.py index dd50e3391..16f842118 100644 --- a/kittycad/models/point3d.py +++ b/kittycad/models/point3d.py @@ -1,69 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -FQ = TypeVar("FQ", bound="Point3d") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Point3d: - """A point in 3D space""" # noqa: E501 +class Point3d(BaseModel): + """A point in 3D space""" - x: Union[Unset, float] = UNSET - y: Union[Unset, float] = UNSET - z: Union[Unset, float] = UNSET + x: float - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + y: float - def to_dict(self) -> Dict[str, Any]: - x = self.x - y = self.y - z = self.z - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if x is not UNSET: - field_dict["x"] = x - if y is not UNSET: - field_dict["y"] = y - if z is not UNSET: - field_dict["z"] = z - - return field_dict - - @classmethod - def from_dict(cls: Type[FQ], src_dict: Dict[str, Any]) -> FQ: - d = src_dict.copy() - x = d.pop("x", UNSET) - - y = d.pop("y", UNSET) - - z = d.pop("z", UNSET) - - point3d = cls( - x=x, - y=y, - z=z, - ) - - point3d.additional_properties = d - return point3d - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + z: float diff --git a/kittycad/models/pong.py b/kittycad/models/pong.py index bd22513fe..3f31d7b11 100644 --- a/kittycad/models/pong.py +++ b/kittycad/models/pong.py @@ -1,55 +1,8 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -IK = TypeVar("IK", bound="Pong") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Pong: - """The response from the `/ping` endpoint.""" # noqa: E501 +class Pong(BaseModel): + """The response from the `/ping` endpoint.""" - message: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - message = self.message - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if message is not UNSET: - field_dict["message"] = message - - return field_dict - - @classmethod - def from_dict(cls: Type[IK], src_dict: Dict[str, Any]) -> IK: - d = src_dict.copy() - message = d.pop("message", UNSET) - - pong = cls( - message=message, - ) - - pong.additional_properties = d - return pong - - @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 + message: str diff --git a/kittycad/models/raw_file.py b/kittycad/models/raw_file.py index ab4272e06..61bc11551 100644 --- a/kittycad/models/raw_file.py +++ b/kittycad/models/raw_file.py @@ -1,64 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast -import attr - -from ..types import UNSET, Unset - -NG = TypeVar("NG", bound="RawFile") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class RawFile: - """A raw file with unencoded contents to be passed over binary websockets.""" # noqa: E501 +class RawFile(BaseModel): + """A raw file with unencoded contents to be passed over binary websockets.""" - contents: Union[Unset, List[int]] = UNSET - name: Union[Unset, str] = UNSET + contents: bytes - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - contents: Union[Unset, List[int]] = UNSET - if not isinstance(self.contents, Unset): - contents = self.contents - name = self.name - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if contents is not UNSET: - field_dict["contents"] = contents - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: Type[NG], src_dict: Dict[str, Any]) -> NG: - d = src_dict.copy() - contents = cast(List[int], d.pop("contents", UNSET)) - - name = d.pop("name", UNSET) - - raw_file = cls( - contents=contents, - name=name, - ) - - raw_file.additional_properties = d - return raw_file - - @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 + name: str diff --git a/kittycad/models/rtc_ice_candidate_init.py b/kittycad/models/rtc_ice_candidate_init.py index 4ac2bcdd7..253605268 100644 --- a/kittycad/models/rtc_ice_candidate_init.py +++ b/kittycad/models/rtc_ice_candidate_init.py @@ -1,76 +1,15 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -DT = TypeVar("DT", bound="RtcIceCandidateInit") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class RtcIceCandidateInit: - """ICECandidateInit is used to serialize ice candidates""" # noqa: E501 +class RtcIceCandidateInit(BaseModel): + """ICECandidateInit is used to serialize ice candidates""" - candidate: Union[Unset, str] = UNSET - sdp_m_line_index: Union[Unset, int] = UNSET - sdp_mid: Union[Unset, str] = UNSET - username_fragment: Union[Unset, str] = UNSET + candidate: str - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + sdpMLineIndex: Optional[int] = None - def to_dict(self) -> Dict[str, Any]: - candidate = self.candidate - sdp_m_line_index = self.sdp_m_line_index - sdp_mid = self.sdp_mid - username_fragment = self.username_fragment + sdpMid: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if candidate is not UNSET: - field_dict["candidate"] = candidate - if sdp_m_line_index is not UNSET: - field_dict["sdpMLineIndex"] = sdp_m_line_index - if sdp_mid is not UNSET: - field_dict["sdpMid"] = sdp_mid - if username_fragment is not UNSET: - field_dict["usernameFragment"] = username_fragment - - return field_dict - - @classmethod - def from_dict(cls: Type[DT], src_dict: Dict[str, Any]) -> DT: - d = src_dict.copy() - candidate = d.pop("candidate", UNSET) - - sdp_m_line_index = d.pop("sdpMLineIndex", UNSET) - - sdp_mid = d.pop("sdpMid", UNSET) - - username_fragment = d.pop("usernameFragment", UNSET) - - rtc_ice_candidate_init = cls( - candidate=candidate, - sdp_m_line_index=sdp_m_line_index, - sdp_mid=sdp_mid, - username_fragment=username_fragment, - ) - - rtc_ice_candidate_init.additional_properties = d - return rtc_ice_candidate_init - - @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 + usernameFragment: Optional[str] = None diff --git a/kittycad/models/rtc_session_description.py b/kittycad/models/rtc_session_description.py index 5ba6734fd..d0996b8a1 100644 --- a/kittycad/models/rtc_session_description.py +++ b/kittycad/models/rtc_session_description.py @@ -1,72 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.rtc_sdp_type import RtcSdpType -from ..types import UNSET, Unset - -IF = TypeVar("IF", bound="RtcSessionDescription") -@attr.s(auto_attribs=True) -class RtcSessionDescription: - """SessionDescription is used to expose local and remote session descriptions.""" # noqa: E501 +class RtcSessionDescription(BaseModel): + """SessionDescription is used to expose local and remote session descriptions.""" - sdp: Union[Unset, str] = UNSET - type: Union[Unset, RtcSdpType] = UNSET + sdp: str - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - sdp = self.sdp - type: Union[Unset, RtcSdpType] = UNSET - if not isinstance(self.type, Unset): - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if sdp is not UNSET: - field_dict["sdp"] = sdp - if type is not UNSET: - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[IF], src_dict: Dict[str, Any]) -> IF: - d = src_dict.copy() - sdp = d.pop("sdp", UNSET) - - _type = d.pop("type", UNSET) - type: Union[Unset, RtcSdpType] - if isinstance(_type, Unset): - type = UNSET - if _type is None: - type = UNSET - else: - type = _type - - rtc_session_description = cls( - sdp=sdp, - type=type, - ) - - rtc_session_description.additional_properties = d - return rtc_session_description - - @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 + type: RtcSdpType diff --git a/kittycad/models/select_get.py b/kittycad/models/select_get.py index fde61a846..6b5627cce 100644 --- a/kittycad/models/select_get.py +++ b/kittycad/models/select_get.py @@ -1,57 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -MQ = TypeVar("MQ", bound="SelectGet") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class SelectGet: - """The response from the `SelectGet` command.""" # noqa: E501 +class SelectGet(BaseModel): + """The response from the `SelectGet` command.""" - 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[MQ], src_dict: Dict[str, Any]) -> MQ: - 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 + entity_ids: List[UUID] diff --git a/kittycad/models/select_with_point.py b/kittycad/models/select_with_point.py index bebfc59af..ca5fbe218 100644 --- a/kittycad/models/select_with_point.py +++ b/kittycad/models/select_with_point.py @@ -1,55 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -XZ = TypeVar("XZ", bound="SelectWithPoint") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class SelectWithPoint: - """The response from the `SelectWithPoint` command.""" # noqa: E501 +class SelectWithPoint(BaseModel): + """The response from the `SelectWithPoint` command.""" - 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[XZ], src_dict: Dict[str, Any]) -> XZ: - 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 + entity_id: Optional[UUID] = None diff --git a/kittycad/models/selection.py b/kittycad/models/selection.py index 1fc8d411f..be392baaa 100644 --- a/kittycad/models/selection.py +++ b/kittycad/models/selection.py @@ -1,286 +1,48 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, Dict, Type, TypeVar, Union import attr - -from ..types import UNSET, Unset - -KW = TypeVar("KW", bound="default_scene") +from pydantic import BaseModel, GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema -@attr.s(auto_attribs=True) -class default_scene: - """Visit the default scene.""" # noqa: E501 + +class default_scene(BaseModel): + """Visit the default scene.""" type: str = "default_scene" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - type = self.type +class scene_by_index(BaseModel): + """Visit the indexed scene.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type + index: int - return field_dict - - @classmethod - def from_dict(cls: Type[KW], src_dict: Dict[str, Any]) -> KW: - d = src_dict.copy() - type = d.pop("type", UNSET) - - default_scene = cls( - type=type, - ) - - default_scene.additional_properties = d - return default_scene - - @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 - - -HJ = TypeVar("HJ", bound="scene_by_index") - - -@attr.s(auto_attribs=True) -class scene_by_index: - """Visit the indexed scene.""" # noqa: E501 - - index: Union[Unset, int] = UNSET type: str = "scene_by_index" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - index = self.index - type = self.type +class scene_by_name(BaseModel): + """Visit the first scene with the given name.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if index is not UNSET: - field_dict["index"] = index - field_dict["type"] = type + name: str - return field_dict - - @classmethod - def from_dict(cls: Type[HJ], src_dict: Dict[str, Any]) -> HJ: - d = src_dict.copy() - index = d.pop("index", UNSET) - - type = d.pop("type", UNSET) - - scene_by_index = cls( - index=index, - type=type, - ) - - scene_by_index.additional_properties = d - return scene_by_index - - @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 - - -HA = TypeVar("HA", bound="scene_by_name") - - -@attr.s(auto_attribs=True) -class scene_by_name: - """Visit the first scene with the given name.""" # noqa: E501 - - name: Union[Unset, str] = UNSET type: str = "scene_by_name" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - name = self.name - type = self.type +class mesh_by_index(BaseModel): + """Visit the indexed mesh.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if name is not UNSET: - field_dict["name"] = name - field_dict["type"] = type + index: int - return field_dict - - @classmethod - def from_dict(cls: Type[HA], src_dict: Dict[str, Any]) -> HA: - d = src_dict.copy() - name = d.pop("name", UNSET) - - type = d.pop("type", UNSET) - - scene_by_name = cls( - name=name, - type=type, - ) - - scene_by_name.additional_properties = d - return scene_by_name - - @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 - - -ZM = TypeVar("ZM", bound="mesh_by_index") - - -@attr.s(auto_attribs=True) -class mesh_by_index: - """Visit the indexed mesh.""" # noqa: E501 - - index: Union[Unset, int] = UNSET type: str = "mesh_by_index" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - index = self.index - type = self.type +class mesh_by_name(BaseModel): + """Visit the first mesh with the given name.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if index is not UNSET: - field_dict["index"] = index - field_dict["type"] = type + name: str - return field_dict - - @classmethod - def from_dict(cls: Type[ZM], src_dict: Dict[str, Any]) -> ZM: - d = src_dict.copy() - index = d.pop("index", UNSET) - - type = d.pop("type", UNSET) - - mesh_by_index = cls( - index=index, - type=type, - ) - - mesh_by_index.additional_properties = d - return mesh_by_index - - @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 - - -BX = TypeVar("BX", bound="mesh_by_name") - - -@attr.s(auto_attribs=True) -class mesh_by_name: - """Visit the first mesh with the given name.""" # noqa: E501 - - name: Union[Unset, str] = UNSET type: str = "mesh_by_name" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - name = self.name - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if name is not UNSET: - field_dict["name"] = name - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[BX], src_dict: Dict[str, Any]) -> BX: - d = src_dict.copy() - name = d.pop("name", UNSET) - - type = d.pop("type", UNSET) - - mesh_by_name = cls( - name=name, - type=type, - ) - - mesh_by_name.additional_properties = d - return mesh_by_name - - @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 - GY = TypeVar("GY", bound="Selection") @@ -310,46 +72,58 @@ class Selection: ): self.type = type - def to_dict(self) -> Dict[str, Any]: + def model_dump(self) -> Dict[str, Any]: if isinstance(self.type, default_scene): - TD: default_scene = self.type - return TD.to_dict() + JO: default_scene = self.type + return JO.model_dump() elif isinstance(self.type, scene_by_index): - SQ: scene_by_index = self.type - return SQ.to_dict() + TE: scene_by_index = self.type + return TE.model_dump() elif isinstance(self.type, scene_by_name): - IL: scene_by_name = self.type - return IL.to_dict() + WY: scene_by_name = self.type + return WY.model_dump() elif isinstance(self.type, mesh_by_index): - YG: mesh_by_index = self.type - return YG.to_dict() + QV: mesh_by_index = self.type + return QV.model_dump() elif isinstance(self.type, mesh_by_name): - ZE: mesh_by_name = self.type - return ZE.to_dict() + BP: mesh_by_name = self.type + return BP.model_dump() raise Exception("Unknown type") @classmethod def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY: if d.get("type") == "default_scene": - NR: default_scene = default_scene() - NR.from_dict(d) - return cls(type=NR) + OF: default_scene = default_scene(**d) + return cls(type=OF) elif d.get("type") == "scene_by_index": - WV: scene_by_index = scene_by_index() - WV.from_dict(d) - return cls(type=WV) + OV: scene_by_index = scene_by_index(**d) + return cls(type=OV) elif d.get("type") == "scene_by_name": - JT: scene_by_name = scene_by_name() - JT.from_dict(d) - return cls(type=JT) + FK: scene_by_name = scene_by_name(**d) + return cls(type=FK) elif d.get("type") == "mesh_by_index": - DD: mesh_by_index = mesh_by_index() - DD.from_dict(d) - return cls(type=DD) + PE: mesh_by_index = mesh_by_index(**d) + return cls(type=PE) elif d.get("type") == "mesh_by_name": - UI: mesh_by_name = mesh_by_name() - UI.from_dict(d) - return cls(type=UI) + FP: mesh_by_name = mesh_by_name(**d) + return cls(type=FP) raise Exception("Unknown type") + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function( + cls, + handler( + Union[ + default_scene, + scene_by_index, + scene_by_name, + mesh_by_index, + mesh_by_name, + ] + ), + ) diff --git a/kittycad/models/session.py b/kittycad/models/session.py index b70e1f5b8..1cee5e33b 100644 --- a/kittycad/models/session.py +++ b/kittycad/models/session.py @@ -1,137 +1,23 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.uuid import Uuid -from ..types import UNSET, Unset - -IE = TypeVar("IE", bound="Session") -@attr.s(auto_attribs=True) -class Session: +class Session(BaseModel): """An authentication session. - For our UIs, these are automatically created by Next.js.""" # noqa: E501 + For our UIs, these are automatically created by Next.js.""" - created_at: Union[Unset, datetime.datetime] = UNSET - expires: Union[Unset, datetime.datetime] = UNSET - id: Union[Unset, str] = UNSET - session_token: Union[Unset, str] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + created_at: datetime.datetime - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + expires: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - expires: Union[Unset, str] = UNSET - if not isinstance(self.expires, Unset): - expires = self.expires.isoformat() - id = self.id - session_token = self.session_token - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + id: Uuid - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if created_at is not UNSET: - field_dict["created_at"] = created_at - if expires is not UNSET: - field_dict["expires"] = expires - if id is not UNSET: - field_dict["id"] = id - if session_token is not UNSET: - field_dict["session_token"] = session_token - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + session_token: Uuid - return field_dict + updated_at: datetime.datetime - @classmethod - def from_dict(cls: Type[IE], src_dict: Dict[str, Any]) -> IE: - d = src_dict.copy() - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) - - _expires = d.pop("expires", UNSET) - expires: Union[Unset, datetime.datetime] - if isinstance(_expires, Unset): - expires = UNSET - else: - expires = isoparse(_expires) - - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id - - _session_token = d.pop("session_token", UNSET) - session_token: Union[Unset, Uuid] - if isinstance(_session_token, Unset): - session_token = UNSET - if _session_token is None: - session_token = UNSET - else: - session_token = _session_token - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - session = cls( - created_at=created_at, - expires=expires, - id=id, - session_token=session_token, - updated_at=updated_at, - user_id=user_id, - ) - - session.additional_properties = d - return session - - @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 + user_id: Uuid diff --git a/kittycad/models/solid3d_get_all_edge_faces.py b/kittycad/models/solid3d_get_all_edge_faces.py index 5d210ae59..556a5fa77 100644 --- a/kittycad/models/solid3d_get_all_edge_faces.py +++ b/kittycad/models/solid3d_get_all_edge_faces.py @@ -1,57 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -JZ = TypeVar("JZ", bound="Solid3dGetAllEdgeFaces") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Solid3dGetAllEdgeFaces: - """The response from the `Solid3dGetAllEdgeFaces` command.""" # noqa: E501 +class Solid3dGetAllEdgeFaces(BaseModel): + """The response from the `Solid3dGetAllEdgeFaces` command.""" - 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[JZ], src_dict: Dict[str, Any]) -> JZ: - 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 + faces: List[UUID] diff --git a/kittycad/models/solid3d_get_all_opposite_edges.py b/kittycad/models/solid3d_get_all_opposite_edges.py index a6f46ff88..ecef1a52f 100644 --- a/kittycad/models/solid3d_get_all_opposite_edges.py +++ b/kittycad/models/solid3d_get_all_opposite_edges.py @@ -1,57 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -LS = TypeVar("LS", bound="Solid3dGetAllOppositeEdges") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Solid3dGetAllOppositeEdges: - """The response from the `Solid3dGetAllOppositeEdges` command.""" # noqa: E501 +class Solid3dGetAllOppositeEdges(BaseModel): + """The response from the `Solid3dGetAllOppositeEdges` command.""" - 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[LS], src_dict: Dict[str, Any]) -> LS: - 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 + edges: List[UUID] diff --git a/kittycad/models/solid3d_get_next_adjacent_edge.py b/kittycad/models/solid3d_get_next_adjacent_edge.py index 8bcf8ee90..916027813 100644 --- a/kittycad/models/solid3d_get_next_adjacent_edge.py +++ b/kittycad/models/solid3d_get_next_adjacent_edge.py @@ -1,55 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -WL = TypeVar("WL", bound="Solid3dGetNextAdjacentEdge") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Solid3dGetNextAdjacentEdge: - """The response from the `Solid3dGetNextAdjacentEdge` command.""" # noqa: E501 +class Solid3dGetNextAdjacentEdge(BaseModel): + """The response from the `Solid3dGetNextAdjacentEdge` command.""" - 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[WL], src_dict: Dict[str, Any]) -> WL: - 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 + edge: Optional[UUID] = None diff --git a/kittycad/models/solid3d_get_opposite_edge.py b/kittycad/models/solid3d_get_opposite_edge.py index b3582f2a3..d9fb4c2b6 100644 --- a/kittycad/models/solid3d_get_opposite_edge.py +++ b/kittycad/models/solid3d_get_opposite_edge.py @@ -1,55 +1,9 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -PA = TypeVar("PA", bound="Solid3dGetOppositeEdge") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Solid3dGetOppositeEdge: - """The response from the `Solid3dGetOppositeEdge` command.""" # noqa: E501 +class Solid3dGetOppositeEdge(BaseModel): + """The response from the `Solid3dGetOppositeEdge` command.""" - 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[PA], src_dict: Dict[str, Any]) -> PA: - 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 + edge: UUID diff --git a/kittycad/models/solid3d_get_prev_adjacent_edge.py b/kittycad/models/solid3d_get_prev_adjacent_edge.py index 3994fc89d..f058adfd0 100644 --- a/kittycad/models/solid3d_get_prev_adjacent_edge.py +++ b/kittycad/models/solid3d_get_prev_adjacent_edge.py @@ -1,55 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional +from uuid import UUID -import attr - -from ..types import UNSET, Unset - -SJ = TypeVar("SJ", bound="Solid3dGetPrevAdjacentEdge") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class Solid3dGetPrevAdjacentEdge: - """The response from the `Solid3dGetPrevAdjacentEdge` command.""" # noqa: E501 +class Solid3dGetPrevAdjacentEdge(BaseModel): + """The response from the `Solid3dGetPrevAdjacentEdge` command.""" - 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[SJ], src_dict: Dict[str, Any]) -> SJ: - 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 + edge: Optional[UUID] = None diff --git a/kittycad/models/success_web_socket_response.py b/kittycad/models/success_web_socket_response.py index 4a39e45e2..898aae765 100644 --- a/kittycad/models/success_web_socket_response.py +++ b/kittycad/models/success_web_socket_response.py @@ -1,80 +1,16 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Optional +from uuid import UUID -import attr +from pydantic import BaseModel from ..models.ok_web_socket_response_data import OkWebSocketResponseData -from ..types import UNSET, Unset - -ZV = TypeVar("ZV", bound="SuccessWebSocketResponse") -@attr.s(auto_attribs=True) -class SuccessWebSocketResponse: - """Successful Websocket response.""" # noqa: E501 +class SuccessWebSocketResponse(BaseModel): + """Successful Websocket response.""" - request_id: Union[Unset, str] = UNSET - resp: Union[Unset, OkWebSocketResponseData] = UNSET - success: Union[Unset, bool] = False + request_id: Optional[UUID] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + resp: OkWebSocketResponseData - def to_dict(self) -> Dict[str, Any]: - request_id = self.request_id - resp: Union[Unset, OkWebSocketResponseData] = UNSET - 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: - _resp: OkWebSocketResponseData = cast(OkWebSocketResponseData, resp) - field_dict["resp"] = _resp.to_dict() - if success is not UNSET: - field_dict["success"] = success - - return field_dict - - @classmethod - def from_dict(cls: Type[ZV], src_dict: Dict[str, Any]) -> ZV: - 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 - if _resp is None: - resp = UNSET - else: - resp = OkWebSocketResponseData.from_dict(_resp) - - 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 + success: bool diff --git a/kittycad/models/surface_area.py b/kittycad/models/surface_area.py index 5faff5ade..4bd66152c 100644 --- a/kittycad/models/surface_area.py +++ b/kittycad/models/surface_area.py @@ -1,72 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.unit_area import UnitArea -from ..types import UNSET, Unset - -TG = TypeVar("TG", bound="SurfaceArea") -@attr.s(auto_attribs=True) -class SurfaceArea: - """The surface area response.""" # noqa: E501 +class SurfaceArea(BaseModel): + """The surface area response.""" - output_unit: Union[Unset, UnitArea] = UNSET - surface_area: Union[Unset, float] = UNSET + output_unit: UnitArea - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - output_unit: Union[Unset, UnitArea] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - surface_area = self.surface_area - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if surface_area is not UNSET: - field_dict["surface_area"] = surface_area - - return field_dict - - @classmethod - def from_dict(cls: Type[TG], src_dict: Dict[str, Any]) -> TG: - d = src_dict.copy() - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitArea] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - surface_area = d.pop("surface_area", UNSET) - - surface_area = cls( - output_unit=output_unit, - surface_area=surface_area, - ) - - surface_area.additional_properties = d - return surface_area - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + surface_area: float diff --git a/kittycad/models/system.py b/kittycad/models/system.py index 41bb81110..6a6159f6a 100644 --- a/kittycad/models/system.py +++ b/kittycad/models/system.py @@ -1,15 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast -import attr +from pydantic import BaseModel from ..models.axis_direction_pair import AxisDirectionPair -from ..types import UNSET, Unset - -FW = TypeVar("FW", bound="System") -@attr.s(auto_attribs=True) -class System: +class System(BaseModel): """Co-ordinate system definition. The `up` axis must be orthogonal to the `forward` axis. @@ -17,74 +12,8 @@ class System: See [cglearn.eu] for background reading. [cglearn.eu](https://cglearn.eu/pub/computer-graphics/introduction-to-geometry#material-coordinate-systems-1) - """ # noqa: E501 + """ - forward: Union[Unset, AxisDirectionPair] = UNSET - up: Union[Unset, AxisDirectionPair] = UNSET + forward: AxisDirectionPair - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - forward: Union[Unset, AxisDirectionPair] = UNSET - if not isinstance(self.forward, Unset): - forward = self.forward - up: Union[Unset, AxisDirectionPair] = UNSET - if not isinstance(self.up, Unset): - up = self.up - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if forward is not UNSET: - _forward: AxisDirectionPair = cast(AxisDirectionPair, forward) - field_dict["forward"] = _forward.to_dict() - if up is not UNSET: - _up: AxisDirectionPair = cast(AxisDirectionPair, up) - field_dict["up"] = _up.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[FW], src_dict: Dict[str, Any]) -> FW: - d = src_dict.copy() - _forward = d.pop("forward", UNSET) - forward: Union[Unset, AxisDirectionPair] - if isinstance(_forward, Unset): - forward = UNSET - if _forward is None: - forward = UNSET - else: - forward = AxisDirectionPair.from_dict(_forward) - - _up = d.pop("up", UNSET) - up: Union[Unset, AxisDirectionPair] - if isinstance(_up, Unset): - up = UNSET - if _up is None: - up = UNSET - else: - up = AxisDirectionPair.from_dict(_up) - - system = cls( - forward=forward, - up=up, - ) - - system.additional_properties = d - return system - - @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 + up: AxisDirectionPair diff --git a/kittycad/models/take_snapshot.py b/kittycad/models/take_snapshot.py index 9983b3e9e..ed68eb242 100644 --- a/kittycad/models/take_snapshot.py +++ b/kittycad/models/take_snapshot.py @@ -1,63 +1,8 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..models.base64data import Base64Data -from ..types import UNSET, Unset - -DV = TypeVar("DV", bound="TakeSnapshot") +from pydantic import Base64Bytes, BaseModel -@attr.s(auto_attribs=True) -class TakeSnapshot: - """The response from the `TakeSnapshot` command.""" # noqa: E501 +class TakeSnapshot(BaseModel): + """The response from the `TakeSnapshot` command.""" - 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[DV], src_dict: Dict[str, Any]) -> DV: - 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 + contents: Base64Bytes diff --git a/kittycad/models/text_to_cad.py b/kittycad/models/text_to_cad.py index 69d5e19ac..96a3ee3c6 100644 --- a/kittycad/models/text_to_cad.py +++ b/kittycad/models/text_to_cad.py @@ -1,227 +1,39 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Dict, Optional -import attr -from dateutil.parser import isoparse +from pydantic import Base64Bytes, BaseModel from ..models.ai_feedback import AiFeedback from ..models.api_call_status import ApiCallStatus -from ..models.base64data import Base64Data from ..models.file_export_format import FileExportFormat from ..models.uuid import Uuid -from ..types import UNSET, Unset - -RB = TypeVar("RB", bound="TextToCad") -@attr.s(auto_attribs=True) -class TextToCad: - """A response from a text to CAD prompt.""" # noqa: E501 +class TextToCad(BaseModel): + """A response from a text to CAD prompt.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - feedback: Union[Unset, AiFeedback] = UNSET - id: Union[Unset, str] = UNSET - model_version: Union[Unset, str] = UNSET - output_format: Union[Unset, FileExportFormat] = UNSET - outputs: Union[Unset, Dict[str, Base64Data]] = UNSET - prompt: Union[Unset, str] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - feedback: Union[Unset, AiFeedback] = UNSET - if not isinstance(self.feedback, Unset): - feedback = self.feedback - id = self.id - model_version = self.model_version - output_format: Union[Unset, FileExportFormat] = UNSET - if not isinstance(self.output_format, Unset): - output_format = self.output_format - 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 - prompt = self.prompt - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if feedback is not UNSET: - field_dict["feedback"] = feedback - if id is not UNSET: - field_dict["id"] = id - if model_version is not UNSET: - field_dict["model_version"] = model_version - if output_format is not UNSET: - field_dict["output_format"] = output_format - if outputs is not UNSET: - field_dict["outputs"] = outputs - if prompt is not UNSET: - field_dict["prompt"] = prompt - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + feedback: Optional[AiFeedback] = None - return field_dict + id: Uuid - @classmethod - def from_dict(cls: Type[RB], src_dict: Dict[str, Any]) -> RB: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + model_version: str - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output_format: FileExportFormat - error = d.pop("error", UNSET) + outputs: Optional[Dict[str, Base64Bytes]] = None - _feedback = d.pop("feedback", UNSET) - feedback: Union[Unset, AiFeedback] - if isinstance(_feedback, Unset): - feedback = UNSET - if _feedback is None: - feedback = UNSET - else: - feedback = _feedback + prompt: str - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - model_version = d.pop("model_version", UNSET) + status: ApiCallStatus - _output_format = d.pop("output_format", UNSET) - output_format: Union[Unset, FileExportFormat] - if isinstance(_output_format, Unset): - output_format = UNSET - if _output_format is None: - output_format = UNSET - else: - output_format = _output_format + updated_at: datetime.datetime - _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 - - prompt = d.pop("prompt", UNSET) - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - text_to_cad = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - feedback=feedback, - id=id, - model_version=model_version, - output_format=output_format, - outputs=outputs, - prompt=prompt, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - text_to_cad.additional_properties = d - return text_to_cad - - @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 + user_id: Uuid diff --git a/kittycad/models/text_to_cad_create_body.py b/kittycad/models/text_to_cad_create_body.py index 1d1f74af2..9a9345ecd 100644 --- a/kittycad/models/text_to_cad_create_body.py +++ b/kittycad/models/text_to_cad_create_body.py @@ -1,55 +1,8 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr - -from ..types import UNSET, Unset - -CC = TypeVar("CC", bound="TextToCadCreateBody") +from pydantic import BaseModel -@attr.s(auto_attribs=True) -class TextToCadCreateBody: - """Body for generating models from text.""" # noqa: E501 +class TextToCadCreateBody(BaseModel): + """Body for generating models from text.""" - prompt: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - prompt = self.prompt - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if prompt is not UNSET: - field_dict["prompt"] = prompt - - return field_dict - - @classmethod - def from_dict(cls: Type[CC], src_dict: Dict[str, Any]) -> CC: - d = src_dict.copy() - prompt = d.pop("prompt", UNSET) - - text_to_cad_create_body = cls( - prompt=prompt, - ) - - text_to_cad_create_body.additional_properties = d - return text_to_cad_create_body - - @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 + prompt: str diff --git a/kittycad/models/text_to_cad_results_page.py b/kittycad/models/text_to_cad_results_page.py index ed1f6d21d..2396d1ca9 100644 --- a/kittycad/models/text_to_cad_results_page.py +++ b/kittycad/models/text_to_cad_results_page.py @@ -1,70 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List, Optional -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -BG = TypeVar("BG", bound="TextToCadResultsPage") +from ..models.text_to_cad import TextToCad -@attr.s(auto_attribs=True) -class TextToCadResultsPage: - """A single page of results""" # noqa: E501 +class TextToCadResultsPage(BaseModel): + """A single page of results""" - from ..models.text_to_cad import TextToCad + items: List[TextToCad] - items: Union[Unset, List[TextToCad]] = UNSET - next_page: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - from ..models.text_to_cad import TextToCad - - items: Union[Unset, List[TextToCad]] = UNSET - if not isinstance(self.items, Unset): - items = self.items - next_page = self.next_page - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if items is not UNSET: - field_dict["items"] = items - if next_page is not UNSET: - field_dict["next_page"] = next_page - - return field_dict - - @classmethod - def from_dict(cls: Type[BG], src_dict: Dict[str, Any]) -> BG: - d = src_dict.copy() - from ..models.text_to_cad import TextToCad - - items = cast(List[TextToCad], d.pop("items", UNSET)) - - next_page = d.pop("next_page", UNSET) - - text_to_cad_results_page = cls( - items=items, - next_page=next_page, - ) - - text_to_cad_results_page.additional_properties = d - return text_to_cad_results_page - - @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 + next_page: Optional[str] = None diff --git a/kittycad/models/unit_angle_conversion.py b/kittycad/models/unit_angle_conversion.py index e304c6db6..d8e21781b 100644 --- a/kittycad/models/unit_angle_conversion.py +++ b/kittycad/models/unit_angle_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_angle import UnitAngle from ..models.uuid import Uuid -from ..types import UNSET, Unset - -DB = TypeVar("DB", bound="UnitAngleConversion") -@attr.s(auto_attribs=True) -class UnitAngleConversion: - """Result of converting between units.""" # noqa: E501 +class UnitAngleConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitAngle] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitAngle] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitAngle] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitAngle] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[DB], src_dict: Dict[str, Any]) -> DB: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitAngle - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitAngle - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitAngle] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitAngle] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_angle_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_angle_conversion.additional_properties = d - return unit_angle_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_area_conversion.py b/kittycad/models/unit_area_conversion.py index 151b713ab..702b0a5bf 100644 --- a/kittycad/models/unit_area_conversion.py +++ b/kittycad/models/unit_area_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_area import UnitArea from ..models.uuid import Uuid -from ..types import UNSET, Unset - -AC = TypeVar("AC", bound="UnitAreaConversion") -@attr.s(auto_attribs=True) -class UnitAreaConversion: - """Result of converting between units.""" # noqa: E501 +class UnitAreaConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitArea] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitArea] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitArea] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitArea] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[AC], src_dict: Dict[str, Any]) -> AC: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitArea - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitArea - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitArea] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitArea] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_area_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_area_conversion.additional_properties = d - return unit_area_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_current_conversion.py b/kittycad/models/unit_current_conversion.py index 7339f28df..b701b8aa8 100644 --- a/kittycad/models/unit_current_conversion.py +++ b/kittycad/models/unit_current_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_current import UnitCurrent from ..models.uuid import Uuid -from ..types import UNSET, Unset - -YI = TypeVar("YI", bound="UnitCurrentConversion") -@attr.s(auto_attribs=True) -class UnitCurrentConversion: - """Result of converting between units.""" # noqa: E501 +class UnitCurrentConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitCurrent] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitCurrent] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitCurrent] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitCurrent] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[YI], src_dict: Dict[str, Any]) -> YI: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitCurrent - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitCurrent - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitCurrent] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitCurrent] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_current_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_current_conversion.additional_properties = d - return unit_current_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_energy_conversion.py b/kittycad/models/unit_energy_conversion.py index 7905ead3c..8ddca071a 100644 --- a/kittycad/models/unit_energy_conversion.py +++ b/kittycad/models/unit_energy_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_energy import UnitEnergy from ..models.uuid import Uuid -from ..types import UNSET, Unset - -XY = TypeVar("XY", bound="UnitEnergyConversion") -@attr.s(auto_attribs=True) -class UnitEnergyConversion: - """Result of converting between units.""" # noqa: E501 +class UnitEnergyConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitEnergy] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitEnergy] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitEnergy] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitEnergy] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[XY], src_dict: Dict[str, Any]) -> XY: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitEnergy - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitEnergy - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitEnergy] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitEnergy] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_energy_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_energy_conversion.additional_properties = d - return unit_energy_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_force_conversion.py b/kittycad/models/unit_force_conversion.py index ee17e2294..78302ecc0 100644 --- a/kittycad/models/unit_force_conversion.py +++ b/kittycad/models/unit_force_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_force import UnitForce from ..models.uuid import Uuid -from ..types import UNSET, Unset - -BW = TypeVar("BW", bound="UnitForceConversion") -@attr.s(auto_attribs=True) -class UnitForceConversion: - """Result of converting between units.""" # noqa: E501 +class UnitForceConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitForce] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitForce] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitForce] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitForce] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[BW], src_dict: Dict[str, Any]) -> BW: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitForce - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitForce - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitForce] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitForce] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_force_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_force_conversion.additional_properties = d - return unit_force_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_frequency_conversion.py b/kittycad/models/unit_frequency_conversion.py index ab45d7c3a..17ba590e9 100644 --- a/kittycad/models/unit_frequency_conversion.py +++ b/kittycad/models/unit_frequency_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_frequency import UnitFrequency from ..models.uuid import Uuid -from ..types import UNSET, Unset - -QG = TypeVar("QG", bound="UnitFrequencyConversion") -@attr.s(auto_attribs=True) -class UnitFrequencyConversion: - """Result of converting between units.""" # noqa: E501 +class UnitFrequencyConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitFrequency] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitFrequency] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitFrequency] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitFrequency] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[QG], src_dict: Dict[str, Any]) -> QG: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitFrequency - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitFrequency - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitFrequency] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitFrequency] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_frequency_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_frequency_conversion.additional_properties = d - return unit_frequency_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_length_conversion.py b/kittycad/models/unit_length_conversion.py index 2b328138f..aebfe5957 100644 --- a/kittycad/models/unit_length_conversion.py +++ b/kittycad/models/unit_length_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_length import UnitLength from ..models.uuid import Uuid -from ..types import UNSET, Unset - -ZK = TypeVar("ZK", bound="UnitLengthConversion") -@attr.s(auto_attribs=True) -class UnitLengthConversion: - """Result of converting between units.""" # noqa: E501 +class UnitLengthConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitLength] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitLength] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitLength] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[ZK], src_dict: Dict[str, Any]) -> ZK: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitLength - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitLength - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitLength] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitLength] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_length_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_length_conversion.additional_properties = d - return unit_length_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_mass_conversion.py b/kittycad/models/unit_mass_conversion.py index 33b226eaa..6ce5941bd 100644 --- a/kittycad/models/unit_mass_conversion.py +++ b/kittycad/models/unit_mass_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_mass import UnitMass from ..models.uuid import Uuid -from ..types import UNSET, Unset - -VQ = TypeVar("VQ", bound="UnitMassConversion") -@attr.s(auto_attribs=True) -class UnitMassConversion: - """Result of converting between units.""" # noqa: E501 +class UnitMassConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitMass] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitMass] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitMass] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitMass] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[VQ], src_dict: Dict[str, Any]) -> VQ: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitMass - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitMass - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitMass] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitMass] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_mass_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_mass_conversion.additional_properties = d - return unit_mass_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_power_conversion.py b/kittycad/models/unit_power_conversion.py index 83a1ebb9d..1de524fa0 100644 --- a/kittycad/models/unit_power_conversion.py +++ b/kittycad/models/unit_power_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_power import UnitPower from ..models.uuid import Uuid -from ..types import UNSET, Unset - -YC = TypeVar("YC", bound="UnitPowerConversion") -@attr.s(auto_attribs=True) -class UnitPowerConversion: - """Result of converting between units.""" # noqa: E501 +class UnitPowerConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitPower] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitPower] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitPower] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitPower] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[YC], src_dict: Dict[str, Any]) -> YC: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitPower - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitPower - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitPower] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitPower] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_power_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_power_conversion.additional_properties = d - return unit_power_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_pressure_conversion.py b/kittycad/models/unit_pressure_conversion.py index d36877d75..a5ba47a1c 100644 --- a/kittycad/models/unit_pressure_conversion.py +++ b/kittycad/models/unit_pressure_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_pressure import UnitPressure from ..models.uuid import Uuid -from ..types import UNSET, Unset - -NM = TypeVar("NM", bound="UnitPressureConversion") -@attr.s(auto_attribs=True) -class UnitPressureConversion: - """Result of converting between units.""" # noqa: E501 +class UnitPressureConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitPressure] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitPressure] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitPressure] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitPressure] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[NM], src_dict: Dict[str, Any]) -> NM: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitPressure - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitPressure - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitPressure] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitPressure] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_pressure_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_pressure_conversion.additional_properties = d - return unit_pressure_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_temperature_conversion.py b/kittycad/models/unit_temperature_conversion.py index 63204f319..6e6d3a13c 100644 --- a/kittycad/models/unit_temperature_conversion.py +++ b/kittycad/models/unit_temperature_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_temperature import UnitTemperature from ..models.uuid import Uuid -from ..types import UNSET, Unset - -IR = TypeVar("IR", bound="UnitTemperatureConversion") -@attr.s(auto_attribs=True) -class UnitTemperatureConversion: - """Result of converting between units.""" # noqa: E501 +class UnitTemperatureConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitTemperature] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitTemperature] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitTemperature] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitTemperature] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[IR], src_dict: Dict[str, Any]) -> IR: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitTemperature - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitTemperature - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitTemperature] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitTemperature] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_temperature_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_temperature_conversion.additional_properties = d - return unit_temperature_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_torque_conversion.py b/kittycad/models/unit_torque_conversion.py index 19c5e8b89..00b2c6a67 100644 --- a/kittycad/models/unit_torque_conversion.py +++ b/kittycad/models/unit_torque_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_torque import UnitTorque from ..models.uuid import Uuid -from ..types import UNSET, Unset - -EE = TypeVar("EE", bound="UnitTorqueConversion") -@attr.s(auto_attribs=True) -class UnitTorqueConversion: - """Result of converting between units.""" # noqa: E501 +class UnitTorqueConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitTorque] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitTorque] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitTorque] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitTorque] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[EE], src_dict: Dict[str, Any]) -> EE: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitTorque - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitTorque - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitTorque] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitTorque] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_torque_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_torque_conversion.additional_properties = d - return unit_torque_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/unit_volume_conversion.py b/kittycad/models/unit_volume_conversion.py index 35bcfadec..79f41b13b 100644 --- a/kittycad/models/unit_volume_conversion.py +++ b/kittycad/models/unit_volume_conversion.py @@ -1,206 +1,36 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.api_call_status import ApiCallStatus from ..models.unit_volume import UnitVolume from ..models.uuid import Uuid -from ..types import UNSET, Unset - -EZ = TypeVar("EZ", bound="UnitVolumeConversion") -@attr.s(auto_attribs=True) -class UnitVolumeConversion: - """Result of converting between units.""" # noqa: E501 +class UnitVolumeConversion(BaseModel): + """Result of converting between units.""" - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - error: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - input: Union[Unset, float] = UNSET - input_unit: Union[Unset, UnitVolume] = UNSET - output: Union[Unset, float] = UNSET - output_unit: Union[Unset, UnitVolume] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, ApiCallStatus] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET - user_id: Union[Unset, str] = UNSET + completed_at: Optional[datetime.datetime] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - error = self.error - id = self.id - input = self.input - input_unit: Union[Unset, UnitVolume] = UNSET - if not isinstance(self.input_unit, Unset): - input_unit = self.input_unit - output = self.output - output_unit: Union[Unset, UnitVolume] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, ApiCallStatus] = UNSET - if not isinstance(self.status, Unset): - status = self.status - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - user_id = self.user_id + error: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if created_at is not UNSET: - field_dict["created_at"] = created_at - if error is not UNSET: - field_dict["error"] = error - if id is not UNSET: - field_dict["id"] = id - if input is not UNSET: - field_dict["input"] = input - if input_unit is not UNSET: - field_dict["input_unit"] = input_unit - if output is not UNSET: - field_dict["output"] = output - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if started_at is not UNSET: - field_dict["started_at"] = started_at - if status is not UNSET: - field_dict["status"] = status - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if user_id is not UNSET: - field_dict["user_id"] = user_id + id: Uuid - return field_dict + input: Optional[float] = None - @classmethod - def from_dict(cls: Type[EZ], src_dict: Dict[str, Any]) -> EZ: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + input_unit: UnitVolume - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + output: Optional[float] = None - error = d.pop("error", UNSET) + output_unit: UnitVolume - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id + started_at: Optional[datetime.datetime] = None - input = d.pop("input", UNSET) + status: ApiCallStatus - _input_unit = d.pop("input_unit", UNSET) - input_unit: Union[Unset, UnitVolume] - if isinstance(_input_unit, Unset): - input_unit = UNSET - if _input_unit is None: - input_unit = UNSET - else: - input_unit = _input_unit + updated_at: datetime.datetime - output = d.pop("output", UNSET) - - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitVolume] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) - - _status = d.pop("status", UNSET) - status: Union[Unset, ApiCallStatus] - if isinstance(_status, Unset): - status = UNSET - if _status is None: - status = UNSET - else: - status = _status - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - _user_id = d.pop("user_id", UNSET) - user_id: Union[Unset, Uuid] - if isinstance(_user_id, Unset): - user_id = UNSET - if _user_id is None: - user_id = UNSET - else: - user_id = _user_id - - unit_volume_conversion = cls( - completed_at=completed_at, - created_at=created_at, - error=error, - id=id, - input=input, - input_unit=input_unit, - output=output, - output_unit=output_unit, - started_at=started_at, - status=status, - updated_at=updated_at, - user_id=user_id, - ) - - unit_volume_conversion.additional_properties = d - return unit_volume_conversion - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + user_id: Uuid diff --git a/kittycad/models/update_user.py b/kittycad/models/update_user.py index b5d6cefbb..4df335445 100644 --- a/kittycad/models/update_user.py +++ b/kittycad/models/update_user.py @@ -1,90 +1,20 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr - -from ..types import UNSET, Unset - -PB = TypeVar("PB", bound="UpdateUser") +from pydantic import BaseModel +from pydantic_extra_types.phone_number import PhoneNumber -@attr.s(auto_attribs=True) -class UpdateUser: - """The user-modifiable parts of a User.""" # noqa: E501 +class UpdateUser(BaseModel): + """The user-modifiable parts of a User.""" - company: Union[Unset, str] = UNSET - discord: Union[Unset, str] = UNSET - first_name: Union[Unset, str] = UNSET - github: Union[Unset, str] = UNSET - last_name: Union[Unset, str] = UNSET - phone: Union[Unset, str] = UNSET + company: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + discord: Optional[str] = None - def to_dict(self) -> Dict[str, Any]: - company = self.company - discord = self.discord - first_name = self.first_name - github = self.github - last_name = self.last_name - phone = self.phone + first_name: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if company is not UNSET: - field_dict["company"] = company - if discord is not UNSET: - field_dict["discord"] = discord - if first_name is not UNSET: - field_dict["first_name"] = first_name - if github is not UNSET: - field_dict["github"] = github - if last_name is not UNSET: - field_dict["last_name"] = last_name - if phone is not UNSET: - field_dict["phone"] = phone + github: Optional[str] = None - return field_dict + last_name: Optional[str] = None - @classmethod - def from_dict(cls: Type[PB], src_dict: Dict[str, Any]) -> PB: - d = src_dict.copy() - company = d.pop("company", UNSET) - - discord = d.pop("discord", UNSET) - - first_name = d.pop("first_name", UNSET) - - github = d.pop("github", UNSET) - - last_name = d.pop("last_name", UNSET) - - phone = d.pop("phone", UNSET) - - update_user = cls( - company=company, - discord=discord, - first_name=first_name, - github=github, - last_name=last_name, - phone=phone, - ) - - update_user.additional_properties = d - return update_user - - @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 + phone: Optional[PhoneNumber] = None diff --git a/kittycad/models/user.py b/kittycad/models/user.py index 7639ef22e..5b82657a8 100644 --- a/kittycad/models/user.py +++ b/kittycad/models/user.py @@ -1,170 +1,37 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel +from pydantic_extra_types.phone_number import PhoneNumber from ..models.uuid import Uuid -from ..types import UNSET, Unset - -GY = TypeVar("GY", bound="User") -@attr.s(auto_attribs=True) -class User: - """A user.""" # noqa: E501 +class User(BaseModel): + """A user.""" - company: Union[Unset, str] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - discord: Union[Unset, str] = UNSET - email: Union[Unset, str] = UNSET - email_verified: Union[Unset, datetime.datetime] = UNSET - first_name: Union[Unset, str] = UNSET - github: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - image: Union[Unset, str] = UNSET - last_name: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET - phone: Union[Unset, str] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET + company: Optional[str] = None - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + created_at: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - company = self.company - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - discord = self.discord - email = self.email - email_verified: Union[Unset, str] = UNSET - if not isinstance(self.email_verified, Unset): - email_verified = self.email_verified.isoformat() - first_name = self.first_name - github = self.github - id = self.id - image = self.image - last_name = self.last_name - name = self.name - phone = self.phone - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() + discord: Optional[str] = None - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if company is not UNSET: - field_dict["company"] = company - if created_at is not UNSET: - field_dict["created_at"] = created_at - if discord is not UNSET: - field_dict["discord"] = discord - if email is not UNSET: - field_dict["email"] = email - if email_verified is not UNSET: - field_dict["email_verified"] = email_verified - if first_name is not UNSET: - field_dict["first_name"] = first_name - if github is not UNSET: - field_dict["github"] = github - if id is not UNSET: - field_dict["id"] = id - if image is not UNSET: - field_dict["image"] = image - if last_name is not UNSET: - field_dict["last_name"] = last_name - if name is not UNSET: - field_dict["name"] = name - if phone is not UNSET: - field_dict["phone"] = phone - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at + email: Optional[str] = None - return field_dict + email_verified: Optional[datetime.datetime] = None - @classmethod - def from_dict(cls: Type[GY], src_dict: Dict[str, Any]) -> GY: - d = src_dict.copy() - company = d.pop("company", UNSET) + first_name: Optional[str] = None - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + github: Optional[str] = None - discord = d.pop("discord", UNSET) + id: Uuid - email = d.pop("email", UNSET) + image: str - _email_verified = d.pop("email_verified", UNSET) - email_verified: Union[Unset, datetime.datetime] - if isinstance(_email_verified, Unset): - email_verified = UNSET - else: - email_verified = isoparse(_email_verified) + last_name: Optional[str] = None - first_name = d.pop("first_name", UNSET) + name: Optional[str] = None - github = d.pop("github", UNSET) + phone: Optional[PhoneNumber] = None - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id - - image = d.pop("image", UNSET) - - last_name = d.pop("last_name", UNSET) - - name = d.pop("name", UNSET) - - phone = d.pop("phone", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - user = cls( - company=company, - created_at=created_at, - discord=discord, - email=email, - email_verified=email_verified, - first_name=first_name, - github=github, - id=id, - image=image, - last_name=last_name, - name=name, - phone=phone, - updated_at=updated_at, - ) - - user.additional_properties = d - return user - - @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 + updated_at: datetime.datetime diff --git a/kittycad/models/user_results_page.py b/kittycad/models/user_results_page.py index ecba596b7..f7faa3049 100644 --- a/kittycad/models/user_results_page.py +++ b/kittycad/models/user_results_page.py @@ -1,70 +1,13 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import List, Optional -import attr +from pydantic import BaseModel -from ..types import UNSET, Unset - -EC = TypeVar("EC", bound="UserResultsPage") +from ..models.user import User -@attr.s(auto_attribs=True) -class UserResultsPage: - """A single page of results""" # noqa: E501 +class UserResultsPage(BaseModel): + """A single page of results""" - from ..models.user import User + items: List[User] - items: Union[Unset, List[User]] = UNSET - next_page: Union[Unset, str] = UNSET - - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - from ..models.user import User - - items: Union[Unset, List[User]] = UNSET - if not isinstance(self.items, Unset): - items = self.items - next_page = self.next_page - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if items is not UNSET: - field_dict["items"] = items - if next_page is not UNSET: - field_dict["next_page"] = next_page - - return field_dict - - @classmethod - def from_dict(cls: Type[EC], src_dict: Dict[str, Any]) -> EC: - d = src_dict.copy() - from ..models.user import User - - items = cast(List[User], d.pop("items", UNSET)) - - next_page = d.pop("next_page", UNSET) - - user_results_page = cls( - items=items, - next_page=next_page, - ) - - user_results_page.additional_properties = d - return user_results_page - - @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 + next_page: Optional[str] = None diff --git a/kittycad/models/uuid.py b/kittycad/models/uuid.py index 89c0dbd36..d077c4a6e 100644 --- a/kittycad/models/uuid.py +++ b/kittycad/models/uuid.py @@ -1,3 +1,20 @@ +from typing import Any + +from pydantic import GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema + + class Uuid(str): + """A uuid stored as a varchar(191). + + A Version 4 UUID is a universally unique identifier that is generated using random numbers. + """ + def __str__(self) -> str: return self + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function(cls, handler(str)) diff --git a/kittycad/models/uuid_binary.py b/kittycad/models/uuid_binary.py index 36dc9f9e0..142b2f61b 100644 --- a/kittycad/models/uuid_binary.py +++ b/kittycad/models/uuid_binary.py @@ -1,3 +1,22 @@ +from typing import Any + +from pydantic import GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema + + class UuidBinary(str): + """A uuid stored as binary(16). + + Mysql binary(16) storage for UUIDs. Uses Version 7 UUID by default, a universally unique identifier that is generated using random numbers and a timestamp. UUIDv7 are recommended for database ids/primary keys because they are sequential and this helps with efficient indexing, especially on MySQL. For other uses cases, like API tokens, UUIDv4 makes more sense because it's completely random. + + However, both should be stored as binary on MySQL! Both versions use the same data format, so they can be used interchangeably with this data type. + """ + def __str__(self) -> str: return self + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function(cls, handler(str)) diff --git a/kittycad/models/verification_token.py b/kittycad/models/verification_token.py index 18e171428..240c02c77 100644 --- a/kittycad/models/verification_token.py +++ b/kittycad/models/verification_token.py @@ -1,116 +1,22 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Optional -import attr -from dateutil.parser import isoparse +from pydantic import BaseModel from ..models.uuid import Uuid -from ..types import UNSET, Unset - -HY = TypeVar("HY", bound="VerificationToken") -@attr.s(auto_attribs=True) -class VerificationToken: +class VerificationToken(BaseModel): """A verification token for a user. - This is typically used to verify a user's email address.""" # noqa: E501 + This is typically used to verify a user's email address.""" - created_at: Union[Unset, datetime.datetime] = UNSET - expires: Union[Unset, datetime.datetime] = UNSET - id: Union[Unset, str] = UNSET - identifier: Union[Unset, str] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET + created_at: datetime.datetime - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + expires: datetime.datetime - def to_dict(self) -> Dict[str, Any]: - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - expires: Union[Unset, str] = UNSET - if not isinstance(self.expires, Unset): - expires = self.expires.isoformat() - id = self.id - identifier = self.identifier - updated_at: Union[Unset, str] = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() + id: Uuid - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if created_at is not UNSET: - field_dict["created_at"] = created_at - if expires is not UNSET: - field_dict["expires"] = expires - if id is not UNSET: - field_dict["id"] = id - if identifier is not UNSET: - field_dict["identifier"] = identifier - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at + identifier: Optional[str] = None - return field_dict - - @classmethod - def from_dict(cls: Type[HY], src_dict: Dict[str, Any]) -> HY: - d = src_dict.copy() - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) - - _expires = d.pop("expires", UNSET) - expires: Union[Unset, datetime.datetime] - if isinstance(_expires, Unset): - expires = UNSET - else: - expires = isoparse(_expires) - - _id = d.pop("id", UNSET) - id: Union[Unset, Uuid] - if isinstance(_id, Unset): - id = UNSET - if _id is None: - id = UNSET - else: - id = _id - - identifier = d.pop("identifier", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = isoparse(_updated_at) - - verification_token = cls( - created_at=created_at, - expires=expires, - id=id, - identifier=identifier, - updated_at=updated_at, - ) - - verification_token.additional_properties = d - return verification_token - - @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 + updated_at: datetime.datetime diff --git a/kittycad/models/volume.py b/kittycad/models/volume.py index 021f712fd..43e43fbd8 100644 --- a/kittycad/models/volume.py +++ b/kittycad/models/volume.py @@ -1,72 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, Union -import attr +from pydantic import BaseModel from ..models.unit_volume import UnitVolume -from ..types import UNSET, Unset - -NV = TypeVar("NV", bound="Volume") -@attr.s(auto_attribs=True) -class Volume: - """The volume response.""" # noqa: E501 +class Volume(BaseModel): + """The volume response.""" - output_unit: Union[Unset, UnitVolume] = UNSET - volume: Union[Unset, float] = UNSET + output_unit: UnitVolume - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - output_unit: Union[Unset, UnitVolume] = UNSET - if not isinstance(self.output_unit, Unset): - output_unit = self.output_unit - volume = self.volume - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if output_unit is not UNSET: - field_dict["output_unit"] = output_unit - if volume is not UNSET: - field_dict["volume"] = volume - - return field_dict - - @classmethod - def from_dict(cls: Type[NV], src_dict: Dict[str, Any]) -> NV: - d = src_dict.copy() - _output_unit = d.pop("output_unit", UNSET) - output_unit: Union[Unset, UnitVolume] - if isinstance(_output_unit, Unset): - output_unit = UNSET - if _output_unit is None: - output_unit = UNSET - else: - output_unit = _output_unit - - volume = d.pop("volume", UNSET) - - volume = cls( - output_unit=output_unit, - volume=volume, - ) - - volume.additional_properties = d - return volume - - @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 + volume: float diff --git a/kittycad/models/web_socket_request.py b/kittycad/models/web_socket_request.py index ea8537bf4..312141678 100644 --- a/kittycad/models/web_socket_request.py +++ b/kittycad/models/web_socket_request.py @@ -1,412 +1,64 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, Dict, List, Type, TypeVar, Union import attr +from pydantic import BaseModel, GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema from ..models.client_metrics import ClientMetrics from ..models.modeling_cmd import ModelingCmd from ..models.modeling_cmd_id import ModelingCmdId +from ..models.modeling_cmd_req import ModelingCmdReq from ..models.rtc_ice_candidate_init import RtcIceCandidateInit from ..models.rtc_session_description import RtcSessionDescription -from ..types import UNSET, Unset - -ZI = TypeVar("ZI", bound="trickle_ice") -@attr.s(auto_attribs=True) -class trickle_ice: - """The trickle ICE candidate request.""" # noqa: E501 +class trickle_ice(BaseModel): + """The trickle ICE candidate request.""" + + candidate: RtcIceCandidateInit - candidate: Union[Unset, RtcIceCandidateInit] = UNSET type: str = "trickle_ice" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - candidate: Union[Unset, RtcIceCandidateInit] = UNSET - if not isinstance(self.candidate, Unset): - candidate = self.candidate - type = self.type +class sdp_offer(BaseModel): + """The SDP offer request.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if candidate is not UNSET: - _candidate: RtcIceCandidateInit = cast(RtcIceCandidateInit, candidate) - field_dict["candidate"] = _candidate.to_dict() - field_dict["type"] = type + offer: RtcSessionDescription - return field_dict - - @classmethod - def from_dict(cls: Type[ZI], src_dict: Dict[str, Any]) -> ZI: - d = src_dict.copy() - _candidate = d.pop("candidate", UNSET) - candidate: Union[Unset, RtcIceCandidateInit] - if isinstance(_candidate, Unset): - candidate = UNSET - if _candidate is None: - candidate = UNSET - else: - candidate = RtcIceCandidateInit.from_dict(_candidate) - - 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 - - -CZ = TypeVar("CZ", bound="sdp_offer") - - -@attr.s(auto_attribs=True) -class sdp_offer: - """The SDP offer request.""" # noqa: E501 - - offer: Union[Unset, RtcSessionDescription] = UNSET type: str = "sdp_offer" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - offer: Union[Unset, RtcSessionDescription] = UNSET - if not isinstance(self.offer, Unset): - offer = self.offer - type = self.type +class modeling_cmd_req(BaseModel): + """The modeling command request.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if offer is not UNSET: - _offer: RtcSessionDescription = cast(RtcSessionDescription, offer) - field_dict["offer"] = _offer.to_dict() - field_dict["type"] = type + cmd: ModelingCmd - return field_dict + cmd_id: ModelingCmdId - @classmethod - def from_dict(cls: Type[CZ], src_dict: Dict[str, Any]) -> CZ: - d = src_dict.copy() - _offer = d.pop("offer", UNSET) - offer: Union[Unset, RtcSessionDescription] - if isinstance(_offer, Unset): - offer = UNSET - if _offer is None: - offer = UNSET - else: - offer = RtcSessionDescription.from_dict(_offer) - - type = d.pop("type", UNSET) - - sdp_offer = cls( - offer=offer, - type=type, - ) - - sdp_offer.additional_properties = d - return sdp_offer - - @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 - - -OE = TypeVar("OE", bound="modeling_cmd_req") - - -@attr.s(auto_attribs=True) -class modeling_cmd_req: - """The modeling command request.""" # noqa: E501 - - cmd: Union[Unset, ModelingCmd] = UNSET - cmd_id: Union[Unset, ModelingCmdId] = UNSET type: str = "modeling_cmd_req" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - cmd: Union[Unset, ModelingCmd] = UNSET - if not isinstance(self.cmd, Unset): - cmd = self.cmd - cmd_id: Union[Unset, ModelingCmdId] = UNSET - if not isinstance(self.cmd_id, Unset): - cmd_id = self.cmd_id - type = self.type +class modeling_cmd_batch_req(BaseModel): + """A sequence of modeling requests. If any request fails, following requests will not be tried.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if cmd is not UNSET: - _cmd: ModelingCmd = cast(ModelingCmd, cmd) - field_dict["cmd"] = _cmd.to_dict() - if cmd_id is not UNSET: - field_dict["cmd_id"] = cmd_id - field_dict["type"] = type + requests: List[ModelingCmdReq] - return field_dict - - @classmethod - def from_dict(cls: Type[OE], src_dict: Dict[str, Any]) -> OE: - d = src_dict.copy() - _cmd = d.pop("cmd", UNSET) - cmd: Union[Unset, ModelingCmd] - if isinstance(_cmd, Unset): - cmd = UNSET - if _cmd is None: - cmd = UNSET - else: - cmd = ModelingCmd.from_dict(_cmd) - - _cmd_id = d.pop("cmd_id", UNSET) - cmd_id: Union[Unset, ModelingCmdId] - if isinstance(_cmd_id, Unset): - cmd_id = UNSET - if _cmd_id is None: - cmd_id = UNSET - else: - cmd_id = _cmd_id - - type = d.pop("type", UNSET) - - modeling_cmd_req = cls( - cmd=cmd, - cmd_id=cmd_id, - type=type, - ) - - modeling_cmd_req.additional_properties = d - return modeling_cmd_req - - @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 - - -QC = TypeVar("QC", bound="modeling_cmd_batch_req") - - -@attr.s(auto_attribs=True) -class modeling_cmd_batch_req: - """A sequence of modeling requests. If any request fails, following requests will not be tried.""" # noqa: E501 - - from ..models.modeling_cmd_req import ModelingCmdReq - - requests: Union[Unset, List[ModelingCmdReq]] = UNSET type: str = "modeling_cmd_batch_req" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - from ..models.modeling_cmd_req import ModelingCmdReq - - requests: Union[Unset, List[ModelingCmdReq]] = UNSET - if not isinstance(self.requests, Unset): - requests = self.requests - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if requests is not UNSET: - field_dict["requests"] = requests - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[QC], src_dict: Dict[str, Any]) -> QC: - d = src_dict.copy() - from ..models.modeling_cmd_req import ModelingCmdReq - - requests = cast(List[ModelingCmdReq], d.pop("requests", UNSET)) - - type = d.pop("type", UNSET) - - modeling_cmd_batch_req = cls( - requests=requests, - type=type, - ) - - modeling_cmd_batch_req.additional_properties = d - return modeling_cmd_batch_req - - @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 - - -JJ = TypeVar("JJ", bound="ping") - - -@attr.s(auto_attribs=True) -class ping: - """The client-to-server Ping to ensure the WebSocket stays alive.""" # noqa: E501 +class ping(BaseModel): + """The client-to-server Ping to ensure the WebSocket stays alive.""" type: str = "ping" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - type = self.type +class metrics_response(BaseModel): + """The response to a metrics collection request from the server.""" - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - field_dict["type"] = type + metrics: ClientMetrics - return field_dict - - @classmethod - def from_dict(cls: Type[JJ], src_dict: Dict[str, Any]) -> JJ: - 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 - - -OD = TypeVar("OD", bound="metrics_response") - - -@attr.s(auto_attribs=True) -class metrics_response: - """The response to a metrics collection request from the server.""" # noqa: E501 - - metrics: Union[Unset, ClientMetrics] = UNSET type: str = "metrics_response" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - metrics: Union[Unset, ClientMetrics] = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics - type = self.type - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if metrics is not UNSET: - _metrics: ClientMetrics = cast(ClientMetrics, metrics) - field_dict["metrics"] = _metrics.to_dict() - field_dict["type"] = type - - return field_dict - - @classmethod - def from_dict(cls: Type[OD], src_dict: Dict[str, Any]) -> OD: - d = src_dict.copy() - _metrics = d.pop("metrics", UNSET) - metrics: Union[Unset, ClientMetrics] - if isinstance(_metrics, Unset): - metrics = UNSET - if _metrics is None: - metrics = UNSET - else: - metrics = ClientMetrics.from_dict(_metrics) - - type = d.pop("type", UNSET) - - metrics_response = cls( - metrics=metrics, - type=type, - ) - - metrics_response.additional_properties = d - return metrics_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 - GY = TypeVar("GY", bound="WebSocketRequest") @@ -438,53 +90,65 @@ class WebSocketRequest: ): self.type = type - def to_dict(self) -> Dict[str, Any]: + def model_dump(self) -> Dict[str, Any]: if isinstance(self.type, trickle_ice): - ZY: trickle_ice = self.type - return ZY.to_dict() + WI: trickle_ice = self.type + return WI.model_dump() elif isinstance(self.type, sdp_offer): - GJ: sdp_offer = self.type - return GJ.to_dict() + YR: sdp_offer = self.type + return YR.model_dump() elif isinstance(self.type, modeling_cmd_req): - GM: modeling_cmd_req = self.type - return GM.to_dict() + XK: modeling_cmd_req = self.type + return XK.model_dump() elif isinstance(self.type, modeling_cmd_batch_req): - ZA: modeling_cmd_batch_req = self.type - return ZA.to_dict() + OB: modeling_cmd_batch_req = self.type + return OB.model_dump() elif isinstance(self.type, ping): - ZW: ping = self.type - return ZW.to_dict() + QQ: ping = self.type + return QQ.model_dump() elif isinstance(self.type, metrics_response): - DS: metrics_response = self.type - return DS.to_dict() + WX: metrics_response = self.type + return WX.model_dump() raise Exception("Unknown type") @classmethod def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY: if d.get("type") == "trickle_ice": - GW: trickle_ice = trickle_ice() - GW.from_dict(d) - return cls(type=GW) + QL: trickle_ice = trickle_ice(**d) + return cls(type=QL) elif d.get("type") == "sdp_offer": - QU: sdp_offer = sdp_offer() - QU.from_dict(d) - return cls(type=QU) + ME: sdp_offer = sdp_offer(**d) + return cls(type=ME) elif d.get("type") == "modeling_cmd_req": - XU: modeling_cmd_req = modeling_cmd_req() - XU.from_dict(d) - return cls(type=XU) + EB: modeling_cmd_req = modeling_cmd_req(**d) + return cls(type=EB) elif d.get("type") == "modeling_cmd_batch_req": - BC: modeling_cmd_batch_req = modeling_cmd_batch_req() - BC.from_dict(d) - return cls(type=BC) + VK: modeling_cmd_batch_req = modeling_cmd_batch_req(**d) + return cls(type=VK) elif d.get("type") == "ping": - MX: ping = ping() - MX.from_dict(d) - return cls(type=MX) + ZC: ping = ping(**d) + return cls(type=ZC) elif d.get("type") == "metrics_response": - ZQ: metrics_response = metrics_response() - ZQ.from_dict(d) - return cls(type=ZQ) + BE: metrics_response = metrics_response(**d) + return cls(type=BE) raise Exception("Unknown type") + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function( + cls, + handler( + Union[ + trickle_ice, + sdp_offer, + modeling_cmd_req, + modeling_cmd_batch_req, + ping, + metrics_response, + ] + ), + ) diff --git a/kittycad/models/web_socket_response.py b/kittycad/models/web_socket_response.py index 9bacf9297..7fe12b551 100644 --- a/kittycad/models/web_socket_response.py +++ b/kittycad/models/web_socket_response.py @@ -1,6 +1,8 @@ from typing import Any, Dict, Type, TypeVar, Union import attr +from pydantic import GetCoreSchemaHandler +from pydantic_core import CoreSchema, core_schema from .failure_web_socket_response import FailureWebSocketResponse from .success_web_socket_response import SuccessWebSocketResponse @@ -27,25 +29,37 @@ class WebSocketResponse: ): self.type = type - def to_dict(self) -> Dict[str, Any]: + def model_dump(self) -> Dict[str, Any]: if isinstance(self.type, SuccessWebSocketResponse): - XP: SuccessWebSocketResponse = self.type - return XP.to_dict() + HV: SuccessWebSocketResponse = self.type + return HV.model_dump() elif isinstance(self.type, FailureWebSocketResponse): - QM: FailureWebSocketResponse = self.type - return QM.to_dict() + CL: FailureWebSocketResponse = self.type + return CL.model_dump() raise Exception("Unknown type") @classmethod def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY: if d.get("success") is True: - VT: SuccessWebSocketResponse = SuccessWebSocketResponse() - VT.from_dict(d) - return cls(type=VT) + CD: SuccessWebSocketResponse = SuccessWebSocketResponse(**d) + return cls(type=CD) elif d.get("success") is False: - UR: FailureWebSocketResponse = FailureWebSocketResponse() - UR.from_dict(d) - return cls(type=UR) + ZO: FailureWebSocketResponse = FailureWebSocketResponse(**d) + return cls(type=ZO) raise Exception("Unknown type") + + @classmethod + def __get_pydantic_core_schema__( + cls, source_type: Any, handler: GetCoreSchemaHandler + ) -> CoreSchema: + return core_schema.no_info_after_validator_function( + cls, + handler( + Union[ + SuccessWebSocketResponse, + FailureWebSocketResponse, + ] + ), + ) diff --git a/poetry.lock b/poetry.lock index 225261251..a29eec2d3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -11,6 +11,20 @@ files = [ {file = "alabaster-0.7.13.tar.gz", hash = "sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2"}, ] +[[package]] +name = "annotated-types" +version = "0.6.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "annotated_types-0.6.0-py3-none-any.whl", hash = "sha256:0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43"}, + {file = "annotated_types-0.6.0.tar.gz", hash = "sha256:563339e807e53ffd9c267e99fc6d9ea23eb8443c08f112651963e24e22f84a5d"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} + [[package]] name = "anyascii" version = "0.3.2" @@ -159,20 +173,6 @@ d = ["aiohttp (>=3.7.4)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] -[[package]] -name = "bson" -version = "0.5.10" -description = "BSON codec for Python" -optional = false -python-versions = "*" -files = [ - {file = "bson-0.5.10.tar.gz", hash = "sha256:d6511b2ab051139a9123c184de1a04227262173ad593429d21e443d6462d6590"}, -] - -[package.dependencies] -python-dateutil = ">=2.4.0" -six = ">=1.9.0" - [[package]] name = "camel-case-switcher" version = "2.0" @@ -472,6 +472,25 @@ typing-inspect = ">=0.4.0" [package.extras] dev = ["flake8", "hypothesis", "ipython", "mypy (>=0.710)", "portray", "pytest (>=6.2.3)", "simplejson", "types-dataclasses"] +[[package]] +name = "dnspython" +version = "2.4.2" +description = "DNS toolkit" +optional = false +python-versions = ">=3.8,<4.0" +files = [ + {file = "dnspython-2.4.2-py3-none-any.whl", hash = "sha256:57c6fbaaeaaf39c891292012060beb141791735dbb4004798328fc2c467402d8"}, + {file = "dnspython-2.4.2.tar.gz", hash = "sha256:8dcfae8c7460a2f84b4072e26f1c9f4101ca20c071649cb7c34e8b6a93d58984"}, +] + +[package.extras] +dnssec = ["cryptography (>=2.6,<42.0)"] +doh = ["h2 (>=4.1.0)", "httpcore (>=0.17.3)", "httpx (>=0.24.1)"] +doq = ["aioquic (>=0.9.20)"] +idna = ["idna (>=2.1,<4.0)"] +trio = ["trio (>=0.14,<0.23)"] +wmi = ["wmi (>=1.5.1,<2.0.0)"] + [[package]] name = "docutils" version = "0.18.1" @@ -1447,6 +1466,159 @@ icu = ["PyICU (>=2.4,<3.0)"] osv = ["openapi-spec-validator (>=0.5.1,<0.6.0)"] ssv = ["swagger-spec-validator (>=2.4,<3.0)"] +[[package]] +name = "pydantic" +version = "2.5.2" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic-2.5.2-py3-none-any.whl", hash = "sha256:80c50fb8e3dcecfddae1adbcc00ec5822918490c99ab31f6cf6140ca1c1429f0"}, + {file = "pydantic-2.5.2.tar.gz", hash = "sha256:ff177ba64c6faf73d7afa2e8cad38fd456c0dbe01c9954e71038001cd15a6edd"}, +] + +[package.dependencies] +annotated-types = ">=0.4.0" +pydantic-core = "2.14.5" +typing-extensions = ">=4.6.1" + +[package.extras] +email = ["email-validator (>=2.0.0)"] + +[[package]] +name = "pydantic-core" +version = "2.14.5" +description = "" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic_core-2.14.5-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:7e88f5696153dc516ba6e79f82cc4747e87027205f0e02390c21f7cb3bd8abfd"}, + {file = "pydantic_core-2.14.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4641e8ad4efb697f38a9b64ca0523b557c7931c5f84e0fd377a9a3b05121f0de"}, + {file = "pydantic_core-2.14.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:774de879d212db5ce02dfbf5b0da9a0ea386aeba12b0b95674a4ce0593df3d07"}, + {file = "pydantic_core-2.14.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ebb4e035e28f49b6f1a7032920bb9a0c064aedbbabe52c543343d39341a5b2a3"}, + {file = "pydantic_core-2.14.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b53e9ad053cd064f7e473a5f29b37fc4cc9dc6d35f341e6afc0155ea257fc911"}, + {file = "pydantic_core-2.14.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8aa1768c151cf562a9992462239dfc356b3d1037cc5a3ac829bb7f3bda7cc1f9"}, + {file = "pydantic_core-2.14.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eac5c82fc632c599f4639a5886f96867ffced74458c7db61bc9a66ccb8ee3113"}, + {file = "pydantic_core-2.14.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2ae91f50ccc5810b2f1b6b858257c9ad2e08da70bf890dee02de1775a387c66"}, + {file = "pydantic_core-2.14.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:6b9ff467ffbab9110e80e8c8de3bcfce8e8b0fd5661ac44a09ae5901668ba997"}, + {file = "pydantic_core-2.14.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:61ea96a78378e3bd5a0be99b0e5ed00057b71f66115f5404d0dae4819f495093"}, + {file = "pydantic_core-2.14.5-cp310-none-win32.whl", hash = "sha256:bb4c2eda937a5e74c38a41b33d8c77220380a388d689bcdb9b187cf6224c9720"}, + {file = "pydantic_core-2.14.5-cp310-none-win_amd64.whl", hash = "sha256:b7851992faf25eac90bfcb7bfd19e1f5ffa00afd57daec8a0042e63c74a4551b"}, + {file = "pydantic_core-2.14.5-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:4e40f2bd0d57dac3feb3a3aed50f17d83436c9e6b09b16af271b6230a2915459"}, + {file = "pydantic_core-2.14.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ab1cdb0f14dc161ebc268c09db04d2c9e6f70027f3b42446fa11c153521c0e88"}, + {file = "pydantic_core-2.14.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aae7ea3a1c5bb40c93cad361b3e869b180ac174656120c42b9fadebf685d121b"}, + {file = "pydantic_core-2.14.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:60b7607753ba62cf0739177913b858140f11b8af72f22860c28eabb2f0a61937"}, + {file = "pydantic_core-2.14.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2248485b0322c75aee7565d95ad0e16f1c67403a470d02f94da7344184be770f"}, + {file = "pydantic_core-2.14.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:823fcc638f67035137a5cd3f1584a4542d35a951c3cc68c6ead1df7dac825c26"}, + {file = "pydantic_core-2.14.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96581cfefa9123accc465a5fd0cc833ac4d75d55cc30b633b402e00e7ced00a6"}, + {file = "pydantic_core-2.14.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a33324437018bf6ba1bb0f921788788641439e0ed654b233285b9c69704c27b4"}, + {file = "pydantic_core-2.14.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:9bd18fee0923ca10f9a3ff67d4851c9d3e22b7bc63d1eddc12f439f436f2aada"}, + {file = "pydantic_core-2.14.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:853a2295c00f1d4429db4c0fb9475958543ee80cfd310814b5c0ef502de24dda"}, + {file = "pydantic_core-2.14.5-cp311-none-win32.whl", hash = "sha256:cb774298da62aea5c80a89bd58c40205ab4c2abf4834453b5de207d59d2e1651"}, + {file = "pydantic_core-2.14.5-cp311-none-win_amd64.whl", hash = "sha256:e87fc540c6cac7f29ede02e0f989d4233f88ad439c5cdee56f693cc9c1c78077"}, + {file = "pydantic_core-2.14.5-cp311-none-win_arm64.whl", hash = "sha256:57d52fa717ff445cb0a5ab5237db502e6be50809b43a596fb569630c665abddf"}, + {file = "pydantic_core-2.14.5-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:e60f112ac88db9261ad3a52032ea46388378034f3279c643499edb982536a093"}, + {file = "pydantic_core-2.14.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6e227c40c02fd873c2a73a98c1280c10315cbebe26734c196ef4514776120aeb"}, + {file = "pydantic_core-2.14.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f0cbc7fff06a90bbd875cc201f94ef0ee3929dfbd5c55a06674b60857b8b85ed"}, + {file = "pydantic_core-2.14.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:103ef8d5b58596a731b690112819501ba1db7a36f4ee99f7892c40da02c3e189"}, + {file = "pydantic_core-2.14.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c949f04ecad823f81b1ba94e7d189d9dfb81edbb94ed3f8acfce41e682e48cef"}, + {file = "pydantic_core-2.14.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c1452a1acdf914d194159439eb21e56b89aa903f2e1c65c60b9d874f9b950e5d"}, + {file = "pydantic_core-2.14.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cb4679d4c2b089e5ef89756bc73e1926745e995d76e11925e3e96a76d5fa51fc"}, + {file = "pydantic_core-2.14.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:cf9d3fe53b1ee360e2421be95e62ca9b3296bf3f2fb2d3b83ca49ad3f925835e"}, + {file = "pydantic_core-2.14.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:70f4b4851dbb500129681d04cc955be2a90b2248d69273a787dda120d5cf1f69"}, + {file = "pydantic_core-2.14.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:59986de5710ad9613ff61dd9b02bdd2f615f1a7052304b79cc8fa2eb4e336d2d"}, + {file = "pydantic_core-2.14.5-cp312-none-win32.whl", hash = "sha256:699156034181e2ce106c89ddb4b6504c30db8caa86e0c30de47b3e0654543260"}, + {file = "pydantic_core-2.14.5-cp312-none-win_amd64.whl", hash = "sha256:5baab5455c7a538ac7e8bf1feec4278a66436197592a9bed538160a2e7d11e36"}, + {file = "pydantic_core-2.14.5-cp312-none-win_arm64.whl", hash = "sha256:e47e9a08bcc04d20975b6434cc50bf82665fbc751bcce739d04a3120428f3e27"}, + {file = "pydantic_core-2.14.5-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:af36f36538418f3806048f3b242a1777e2540ff9efaa667c27da63d2749dbce0"}, + {file = "pydantic_core-2.14.5-cp37-cp37m-macosx_11_0_arm64.whl", hash = "sha256:45e95333b8418ded64745f14574aa9bfc212cb4fbeed7a687b0c6e53b5e188cd"}, + {file = "pydantic_core-2.14.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e47a76848f92529879ecfc417ff88a2806438f57be4a6a8bf2961e8f9ca9ec7"}, + {file = "pydantic_core-2.14.5-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d81e6987b27bc7d101c8597e1cd2bcaa2fee5e8e0f356735c7ed34368c471550"}, + {file = "pydantic_core-2.14.5-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:34708cc82c330e303f4ce87758828ef6e457681b58ce0e921b6e97937dd1e2a3"}, + {file = "pydantic_core-2.14.5-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:652c1988019752138b974c28f43751528116bcceadad85f33a258869e641d753"}, + {file = "pydantic_core-2.14.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e4d090e73e0725b2904fdbdd8d73b8802ddd691ef9254577b708d413bf3006e"}, + {file = "pydantic_core-2.14.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5c7d5b5005f177764e96bd584d7bf28d6e26e96f2a541fdddb934c486e36fd59"}, + {file = "pydantic_core-2.14.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:a71891847f0a73b1b9eb86d089baee301477abef45f7eaf303495cd1473613e4"}, + {file = "pydantic_core-2.14.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a717aef6971208f0851a2420b075338e33083111d92041157bbe0e2713b37325"}, + {file = "pydantic_core-2.14.5-cp37-none-win32.whl", hash = "sha256:de790a3b5aa2124b8b78ae5faa033937a72da8efe74b9231698b5a1dd9be3405"}, + {file = "pydantic_core-2.14.5-cp37-none-win_amd64.whl", hash = "sha256:6c327e9cd849b564b234da821236e6bcbe4f359a42ee05050dc79d8ed2a91588"}, + {file = "pydantic_core-2.14.5-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:ef98ca7d5995a82f43ec0ab39c4caf6a9b994cb0b53648ff61716370eadc43cf"}, + {file = "pydantic_core-2.14.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c6eae413494a1c3f89055da7a5515f32e05ebc1a234c27674a6956755fb2236f"}, + {file = "pydantic_core-2.14.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcf4e6d85614f7a4956c2de5a56531f44efb973d2fe4a444d7251df5d5c4dcfd"}, + {file = "pydantic_core-2.14.5-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6637560562134b0e17de333d18e69e312e0458ee4455bdad12c37100b7cad706"}, + {file = "pydantic_core-2.14.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:77fa384d8e118b3077cccfcaf91bf83c31fe4dc850b5e6ee3dc14dc3d61bdba1"}, + {file = "pydantic_core-2.14.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:16e29bad40bcf97aac682a58861249ca9dcc57c3f6be22f506501833ddb8939c"}, + {file = "pydantic_core-2.14.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:531f4b4252fac6ca476fbe0e6f60f16f5b65d3e6b583bc4d87645e4e5ddde331"}, + {file = "pydantic_core-2.14.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:074f3d86f081ce61414d2dc44901f4f83617329c6f3ab49d2bc6c96948b2c26b"}, + {file = "pydantic_core-2.14.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c2adbe22ab4babbca99c75c5d07aaf74f43c3195384ec07ccbd2f9e3bddaecec"}, + {file = "pydantic_core-2.14.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:0f6116a558fd06d1b7c2902d1c4cf64a5bd49d67c3540e61eccca93f41418124"}, + {file = "pydantic_core-2.14.5-cp38-none-win32.whl", hash = "sha256:fe0a5a1025eb797752136ac8b4fa21aa891e3d74fd340f864ff982d649691867"}, + {file = "pydantic_core-2.14.5-cp38-none-win_amd64.whl", hash = "sha256:079206491c435b60778cf2b0ee5fd645e61ffd6e70c47806c9ed51fc75af078d"}, + {file = "pydantic_core-2.14.5-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:a6a16f4a527aae4f49c875da3cdc9508ac7eef26e7977952608610104244e1b7"}, + {file = "pydantic_core-2.14.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:abf058be9517dc877227ec3223f0300034bd0e9f53aebd63cf4456c8cb1e0863"}, + {file = "pydantic_core-2.14.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:49b08aae5013640a3bfa25a8eebbd95638ec3f4b2eaf6ed82cf0c7047133f03b"}, + {file = "pydantic_core-2.14.5-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c2d97e906b4ff36eb464d52a3bc7d720bd6261f64bc4bcdbcd2c557c02081ed2"}, + {file = "pydantic_core-2.14.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3128e0bbc8c091ec4375a1828d6118bc20404883169ac95ffa8d983b293611e6"}, + {file = "pydantic_core-2.14.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88e74ab0cdd84ad0614e2750f903bb0d610cc8af2cc17f72c28163acfcf372a4"}, + {file = "pydantic_core-2.14.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c339dabd8ee15f8259ee0f202679b6324926e5bc9e9a40bf981ce77c038553db"}, + {file = "pydantic_core-2.14.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3387277f1bf659caf1724e1afe8ee7dbc9952a82d90f858ebb931880216ea955"}, + {file = "pydantic_core-2.14.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ba6b6b3846cfc10fdb4c971980a954e49d447cd215ed5a77ec8190bc93dd7bc5"}, + {file = "pydantic_core-2.14.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ca61d858e4107ce5e1330a74724fe757fc7135190eb5ce5c9d0191729f033209"}, + {file = "pydantic_core-2.14.5-cp39-none-win32.whl", hash = "sha256:ec1e72d6412f7126eb7b2e3bfca42b15e6e389e1bc88ea0069d0cc1742f477c6"}, + {file = "pydantic_core-2.14.5-cp39-none-win_amd64.whl", hash = "sha256:c0b97ec434041827935044bbbe52b03d6018c2897349670ff8fe11ed24d1d4ab"}, + {file = "pydantic_core-2.14.5-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:79e0a2cdbdc7af3f4aee3210b1172ab53d7ddb6a2d8c24119b5706e622b346d0"}, + {file = "pydantic_core-2.14.5-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:678265f7b14e138d9a541ddabbe033012a2953315739f8cfa6d754cc8063e8ca"}, + {file = "pydantic_core-2.14.5-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:95b15e855ae44f0c6341ceb74df61b606e11f1087e87dcb7482377374aac6abe"}, + {file = "pydantic_core-2.14.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:09b0e985fbaf13e6b06a56d21694d12ebca6ce5414b9211edf6f17738d82b0f8"}, + {file = "pydantic_core-2.14.5-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3ad873900297bb36e4b6b3f7029d88ff9829ecdc15d5cf20161775ce12306f8a"}, + {file = "pydantic_core-2.14.5-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:2d0ae0d8670164e10accbeb31d5ad45adb71292032d0fdb9079912907f0085f4"}, + {file = "pydantic_core-2.14.5-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:d37f8ec982ead9ba0a22a996129594938138a1503237b87318392a48882d50b7"}, + {file = "pydantic_core-2.14.5-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:35613015f0ba7e14c29ac6c2483a657ec740e5ac5758d993fdd5870b07a61d8b"}, + {file = "pydantic_core-2.14.5-pp37-pypy37_pp73-macosx_10_7_x86_64.whl", hash = "sha256:ab4ea451082e684198636565224bbb179575efc1658c48281b2c866bfd4ddf04"}, + {file = "pydantic_core-2.14.5-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ce601907e99ea5b4adb807ded3570ea62186b17f88e271569144e8cca4409c7"}, + {file = "pydantic_core-2.14.5-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb2ed8b3fe4bf4506d6dab3b93b83bbc22237e230cba03866d561c3577517d18"}, + {file = "pydantic_core-2.14.5-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:70f947628e074bb2526ba1b151cee10e4c3b9670af4dbb4d73bc8a89445916b5"}, + {file = "pydantic_core-2.14.5-pp37-pypy37_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:4bc536201426451f06f044dfbf341c09f540b4ebdb9fd8d2c6164d733de5e634"}, + {file = "pydantic_core-2.14.5-pp37-pypy37_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f4791cf0f8c3104ac668797d8c514afb3431bc3305f5638add0ba1a5a37e0d88"}, + {file = "pydantic_core-2.14.5-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:038c9f763e650712b899f983076ce783175397c848da04985658e7628cbe873b"}, + {file = "pydantic_core-2.14.5-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:27548e16c79702f1e03f5628589c6057c9ae17c95b4c449de3c66b589ead0520"}, + {file = "pydantic_core-2.14.5-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c97bee68898f3f4344eb02fec316db93d9700fb1e6a5b760ffa20d71d9a46ce3"}, + {file = "pydantic_core-2.14.5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b9b759b77f5337b4ea024f03abc6464c9f35d9718de01cfe6bae9f2e139c397e"}, + {file = "pydantic_core-2.14.5-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:439c9afe34638ace43a49bf72d201e0ffc1a800295bed8420c2a9ca8d5e3dbb3"}, + {file = "pydantic_core-2.14.5-pp38-pypy38_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:ba39688799094c75ea8a16a6b544eb57b5b0f3328697084f3f2790892510d144"}, + {file = "pydantic_core-2.14.5-pp38-pypy38_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ccd4d5702bb90b84df13bd491be8d900b92016c5a455b7e14630ad7449eb03f8"}, + {file = "pydantic_core-2.14.5-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:81982d78a45d1e5396819bbb4ece1fadfe5f079335dd28c4ab3427cd95389944"}, + {file = "pydantic_core-2.14.5-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:7f8210297b04e53bc3da35db08b7302a6a1f4889c79173af69b72ec9754796b8"}, + {file = "pydantic_core-2.14.5-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:8c8a8812fe6f43a3a5b054af6ac2d7b8605c7bcab2804a8a7d68b53f3cd86e00"}, + {file = "pydantic_core-2.14.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:206ed23aecd67c71daf5c02c3cd19c0501b01ef3cbf7782db9e4e051426b3d0d"}, + {file = "pydantic_core-2.14.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c2027d05c8aebe61d898d4cffd774840a9cb82ed356ba47a90d99ad768f39789"}, + {file = "pydantic_core-2.14.5-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:40180930807ce806aa71eda5a5a5447abb6b6a3c0b4b3b1b1962651906484d68"}, + {file = "pydantic_core-2.14.5-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:615a0a4bff11c45eb3c1996ceed5bdaa2f7b432425253a7c2eed33bb86d80abc"}, + {file = "pydantic_core-2.14.5-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f5e412d717366e0677ef767eac93566582518fe8be923361a5c204c1a62eaafe"}, + {file = "pydantic_core-2.14.5-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:513b07e99c0a267b1d954243845d8a833758a6726a3b5d8948306e3fe14675e3"}, + {file = "pydantic_core-2.14.5.tar.gz", hash = "sha256:6d30226dfc816dd0fdf120cae611dd2215117e4f9b124af8c60ab9093b6e8e71"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + +[[package]] +name = "pydantic-extra-types" +version = "2.1.0" +description = "Extra Pydantic types." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic_extra_types-2.1.0-py3-none-any.whl", hash = "sha256:1b8aa83a2986b0bc6a7179834fdb423c5e0bcef6b2b4cd9261bf753ad7dcc483"}, + {file = "pydantic_extra_types-2.1.0.tar.gz", hash = "sha256:d07b869e733d33712b07d6b8cd7b0223077c23ae5a1e23bd0699a00401259ec7"}, +] + +[package.dependencies] +pydantic = ">=2.0.3" + +[package.extras] +all = ["phonenumbers (>=8,<9)", "pycountry (>=22,<23)"] + [[package]] name = "pyenchant" version = "3.2.2" @@ -1474,6 +1646,108 @@ files = [ [package.extras] plugins = ["importlib-metadata"] +[[package]] +name = "pymongo" +version = "4.6.0" +description = "Python driver for MongoDB " +optional = false +python-versions = ">=3.7" +files = [ + {file = "pymongo-4.6.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c011bd5ad03cc096f99ffcfdd18a1817354132c1331bed7a837a25226659845f"}, + {file = "pymongo-4.6.0-cp310-cp310-manylinux1_i686.whl", hash = "sha256:5e63146dbdb1eac207464f6e0cfcdb640c9c5ff0f57b754fa96fe252314a1dc6"}, + {file = "pymongo-4.6.0-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:2972dd1f1285866aba027eff2f4a2bbf8aa98563c2ced14cb34ee5602b36afdf"}, + {file = "pymongo-4.6.0-cp310-cp310-manylinux2014_i686.whl", hash = "sha256:a0be99b599da95b7a90a918dd927b20c434bea5e1c9b3efc6a3c6cd67c23f813"}, + {file = "pymongo-4.6.0-cp310-cp310-manylinux2014_ppc64le.whl", hash = "sha256:9b0f98481ad5dc4cb430a60bbb8869f05505283b9ae1c62bdb65eb5e020ee8e3"}, + {file = "pymongo-4.6.0-cp310-cp310-manylinux2014_s390x.whl", hash = "sha256:256c503a75bd71cf7fb9ebf889e7e222d49c6036a48aad5a619f98a0adf0e0d7"}, + {file = "pymongo-4.6.0-cp310-cp310-manylinux2014_x86_64.whl", hash = "sha256:b4ad70d7cac4ca0c7b31444a0148bd3af01a2662fa12b1ad6f57cd4a04e21766"}, + {file = "pymongo-4.6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5717a308a703dda2886a5796a07489c698b442f5e409cf7dc2ac93de8d61d764"}, + {file = "pymongo-4.6.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a8f7f9feecae53fa18d6a3ea7c75f9e9a1d4d20e5c3f9ce3fba83f07bcc4eee2"}, + {file = "pymongo-4.6.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:128b1485753106c54af481789cdfea12b90a228afca0b11fb3828309a907e10e"}, + {file = "pymongo-4.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3077a31633beef77d057c6523f5de7271ddef7bde5e019285b00c0cc9cac1e3"}, + {file = "pymongo-4.6.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ebf02c32afa6b67e5861a27183dd98ed88419a94a2ab843cc145fb0bafcc5b28"}, + {file = "pymongo-4.6.0-cp310-cp310-win32.whl", hash = "sha256:b14dd73f595199f4275bed4fb509277470d9b9059310537e3b3daba12b30c157"}, + {file = "pymongo-4.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:8adf014f2779992eba3b513e060d06f075f0ab2fb3ad956f413a102312f65cdf"}, + {file = "pymongo-4.6.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ba51129fcc510824b6ca6e2ce1c27e3e4d048b6e35d3ae6f7e517bed1b8b25ce"}, + {file = "pymongo-4.6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2973f113e079fb98515722cd728e1820282721ec9fd52830e4b73cabdbf1eb28"}, + {file = "pymongo-4.6.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:af425f323fce1b07755edd783581e7283557296946212f5b1a934441718e7528"}, + {file = "pymongo-4.6.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1ec71ac633b126c0775ed4604ca8f56c3540f5c21a1220639f299e7a544b55f9"}, + {file = "pymongo-4.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ec6c20385c5a58e16b1ea60c5e4993ea060540671d7d12664f385f2fb32fe79"}, + {file = "pymongo-4.6.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:85f2cdc400ee87f5952ebf2a117488f2525a3fb2e23863a8efe3e4ee9e54e4d1"}, + {file = "pymongo-4.6.0-cp311-cp311-win32.whl", hash = "sha256:7fc2bb8a74dcfcdd32f89528e38dcbf70a3a6594963d60dc9595e3b35b66e414"}, + {file = "pymongo-4.6.0-cp311-cp311-win_amd64.whl", hash = "sha256:6695d7136a435c1305b261a9ddb9b3ecec9863e05aab3935b96038145fd3a977"}, + {file = "pymongo-4.6.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:d603edea1ff7408638b2504905c032193b7dcee7af269802dbb35bc8c3310ed5"}, + {file = "pymongo-4.6.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79f41576b3022c2fe9780ae3e44202b2438128a25284a8ddfa038f0785d87019"}, + {file = "pymongo-4.6.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:49f2af6cf82509b15093ce3569229e0d53c90ad8ae2eef940652d4cf1f81e045"}, + {file = "pymongo-4.6.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ecd9e1fa97aa11bf67472220285775fa15e896da108f425e55d23d7540a712ce"}, + {file = "pymongo-4.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2d2be5c9c3488fa8a70f83ed925940f488eac2837a996708d98a0e54a861f212"}, + {file = "pymongo-4.6.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8ab6bcc8e424e07c1d4ba6df96f7fb963bcb48f590b9456de9ebd03b88084fe8"}, + {file = "pymongo-4.6.0-cp312-cp312-win32.whl", hash = "sha256:47aa128be2e66abd9d1a9b0437c62499d812d291f17b55185cb4aa33a5f710a4"}, + {file = "pymongo-4.6.0-cp312-cp312-win_amd64.whl", hash = "sha256:014e7049dd019a6663747ca7dae328943e14f7261f7c1381045dfc26a04fa330"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:288c21ab9531b037f7efa4e467b33176bc73a0c27223c141b822ab4a0e66ff2a"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:747c84f4e690fbe6999c90ac97246c95d31460d890510e4a3fa61b7d2b87aa34"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:055f5c266e2767a88bb585d01137d9c7f778b0195d3dbf4a487ef0638be9b651"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:82e620842e12e8cb4050d2643a81c8149361cd82c0a920fa5a15dc4ca8a4000f"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux2014_ppc64le.whl", hash = "sha256:6b18276f14b4b6d92e707ab6db19b938e112bd2f1dc3f9f1a628df58e4fd3f0d"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:680fa0fc719e1a3dcb81130858368f51d83667d431924d0bcf249644bce8f303"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:3919708594b86d0f5cdc713eb6fccd3f9b9532af09ea7a5d843c933825ef56c4"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db082f728160369d9a6ed2e722438291558fc15ce06d0a7d696a8dad735c236b"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1e4ed21029d80c4f62605ab16398fe1ce093fff4b5f22d114055e7d9fbc4adb0"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9bea9138b0fc6e2218147e9c6ce1ff76ff8e29dc00bb1b64842bd1ca107aee9f"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a0269811661ba93c472c8a60ea82640e838c2eb148d252720a09b5123f2c2fe"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6d6a1b1361f118e7fefa17ae3114e77f10ee1b228b20d50c47c9f351346180c8"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7e3b0127b260d4abae7b62203c4c7ef0874c901b55155692353db19de4b18bc4"}, + {file = "pymongo-4.6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a49aca4d961823b2846b739380c847e8964ff7ae0f0a683992b9d926054f0d6d"}, + {file = "pymongo-4.6.0-cp37-cp37m-win32.whl", hash = "sha256:09c7de516b08c57647176b9fc21d929d628e35bcebc7422220c89ae40b62126a"}, + {file = "pymongo-4.6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:81dd1308bd5630d2bb5980f00aa163b986b133f1e9ed66c66ce2a5bc3572e891"}, + {file = "pymongo-4.6.0-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:2f8c04277d879146eacda920476e93d520eff8bec6c022ac108cfa6280d84348"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux1_i686.whl", hash = "sha256:5802acc012bbb4bce4dff92973dff76482f30ef35dd4cb8ab5b0e06aa8f08c80"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:ccd785fafa1c931deff6a7116e9a0d402d59fabe51644b0d0c268295ff847b25"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:fe03bf25fae4b95d8afe40004a321df644400fdcba4c8e5e1a19c1085b740888"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:2ca0ba501898b2ec31e6c3acf90c31910944f01d454ad8e489213a156ccf1bda"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux2014_ppc64le.whl", hash = "sha256:10a379fb60f1b2406ae57b8899bacfe20567918c8e9d2d545e1b93628fcf2050"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:a4dc1319d0c162919ee7f4ee6face076becae2abbd351cc14f1fe70af5fb20d9"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:ddef295aaf80cefb0c1606f1995899efcb17edc6b327eb6589e234e614b87756"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:518c90bdd6e842c446d01a766b9136fec5ec6cc94f3b8c3f8b4a332786ee6b64"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b80a4ee19b3442c57c38afa978adca546521a8822d663310b63ae2a7d7b13f3a"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eb438a8bf6b695bf50d57e6a059ff09652a07968b2041178b3744ea785fcef9b"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e3db7d833a7c38c317dc95b54e27f1d27012e031b45a7c24e360b53197d5f6e7"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3729b8db02063da50eeb3db88a27670d85953afb9a7f14c213ac9e3dca93034b"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:39a1cd5d383b37285641d5a7a86be85274466ae336a61b51117155936529f9b3"}, + {file = "pymongo-4.6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:7b0e6361754ac596cd16bfc6ed49f69ffcd9b60b7bc4bcd3ea65c6a83475e4ff"}, + {file = "pymongo-4.6.0-cp38-cp38-win32.whl", hash = "sha256:806e094e9e85d8badc978af8c95b69c556077f11844655cb8cd2d1758769e521"}, + {file = "pymongo-4.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:1394c4737b325166a65ae7c145af1ebdb9fb153ebedd37cf91d676313e4a67b8"}, + {file = "pymongo-4.6.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a8273e1abbcff1d7d29cbbb1ea7e57d38be72f1af3c597c854168508b91516c2"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux1_i686.whl", hash = "sha256:e16ade71c93f6814d095d25cd6d28a90d63511ea396bd96e9ffcb886b278baaa"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:325701ae7b56daa5b0692305b7cb505ca50f80a1288abb32ff420a8a209b01ca"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:cc94f9fea17a5af8cf1a343597711a26b0117c0b812550d99934acb89d526ed2"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:21812453354b151200034750cd30b0140e82ec2a01fd4357390f67714a1bfbde"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux2014_ppc64le.whl", hash = "sha256:0634994b026336195778e5693583c060418d4ab453eff21530422690a97e1ee8"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:ad4f66fbb893b55f96f03020e67dcab49ffde0177c6565ccf9dec4fdf974eb61"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:2703a9f8f5767986b4f51c259ff452cc837c5a83c8ed5f5361f6e49933743b2f"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6bafea6061d63059d8bc2ffc545e2f049221c8a4457d236c5cd6a66678673eab"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f28ae33dc5a0b9cee06e95fd420e42155d83271ab75964baf747ce959cac5f52"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d16a534da0e39785687b7295e2fcf9a339f4a20689024983d11afaa4657f8507"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef67fedd863ffffd4adfd46d9d992b0f929c7f61a8307366d664d93517f2c78e"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:05c30fd35cc97f14f354916b45feea535d59060ef867446b5c3c7f9b609dd5dc"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1c63e3a2e8fb815c4b1f738c284a4579897e37c3cfd95fdb199229a1ccfb638a"}, + {file = "pymongo-4.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:e5e193f89f4f8c1fe273f9a6e6df915092c9f2af6db2d1afb8bd53855025c11f"}, + {file = "pymongo-4.6.0-cp39-cp39-win32.whl", hash = "sha256:a09bfb51953930e7e838972ddf646c5d5f984992a66d79da6ba7f6a8d8a890cd"}, + {file = "pymongo-4.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:107a234dc55affc5802acb3b6d83cbb8c87355b38a9457fcd8806bdeb8bce161"}, + {file = "pymongo-4.6.0.tar.gz", hash = "sha256:fb1c56d891f9e34303c451998ef62ba52659648bb0d75b03c5e4ac223a3342c2"}, +] + +[package.dependencies] +dnspython = ">=1.16.0,<3.0.0" + +[package.extras] +aws = ["pymongo-auth-aws (<2.0.0)"] +encryption = ["certifi", "pymongo[aws]", "pymongocrypt (>=1.6.0,<2.0.0)"] +gssapi = ["pykerberos", "winkerberos (>=0.5.0)"] +ocsp = ["certifi", "cryptography (>=2.5)", "pyopenssl (>=17.2.0)", "requests (<3.0.0)", "service-identity (>=18.1.0)"] +snappy = ["python-snappy"] +test = ["pytest (>=7)"] +zstd = ["zstandard"] + [[package]] name = "pyparsing" version = "3.0.9" @@ -2419,4 +2693,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "899d0a7b29fa63c1cfba0c1ec8a3f05225bdd428026214b043d472df8c995658" +content-hash = "5cdd2b4cefa8bb16090825a9db85511564b90b953da82e83d157910956a00492" diff --git a/pyproject.toml b/pyproject.toml index deb8c276b..6a3884986 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "kittycad" -version = "0.5.7" +version = "0.5.8" description = "A client library for accessing KittyCAD" authors = [] @@ -17,7 +17,9 @@ httpx = ">=0.15.4,<0.26.0" python = "^3.8" python-dateutil = "^2.8.0" websockets = "^11.0.3" -bson = "^0.5.10" +pymongo = "^4.6.0" +pydantic = "^2.5.2" +pydantic-extra-types = "^2.1.0" [tool.poetry.dev-dependencies] autoclasstoc = "^1.6.0"