diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 4fea93d71..163e8744c 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -35,4 +35,4 @@ jobs: - name: Run ruff shell: bash run: | - poetry run ruff check . + poetry run ruff check --format=github . diff --git a/generate/generate.py b/generate/generate.py index 937778b4c..1e82b22c8 100755 --- a/generate/generate.py +++ b/generate/generate.py @@ -5,7 +5,7 @@ import logging import os import random import re -from typing import List, Optional, Tuple +from typing import Any, Dict, List, Optional, Tuple import black import isort @@ -130,22 +130,35 @@ def generatePaths(cwd: str, parser: dict) -> dict: def generateTypeAndExamplePython( - name: str, schema: dict, data: dict + name: str, schema: dict, data: dict, import_path: Optional[str] ) -> Tuple[str, str, str]: parameter_type = "" parameter_example = "" example_imports = "" + ip: str = "" + if import_path is not None: + ip = import_path if "type" in schema: if "format" in schema and schema["format"] == "uuid": if name != "": parameter_type = name - example_imports = example_imports + ( - "from kittycad.models." - + camel_to_snake(parameter_type) - + " import " - + parameter_type - + "\n" - ) + if import_path is None: + example_imports = example_imports + ( + "from kittycad.models." + + camel_to_snake(parameter_type) + + " import " + + parameter_type + + "\n" + ) + else: + example_imports = example_imports + ( + "from kittycad.models." + + ip + + " import " + + parameter_type + + "\n" + ) + parameter_example = parameter_type + '("")' else: parameter_type = "str" @@ -159,13 +172,18 @@ def generateTypeAndExamplePython( parameter_type = name - example_imports = example_imports + ( - "from kittycad.models." - + camel_to_snake(parameter_type) - + " import " - + parameter_type - + "\n" - ) + if import_path is None: + example_imports = example_imports + ( + "from kittycad.models." + + camel_to_snake(parameter_type) + + " import " + + parameter_type + + "\n" + ) + else: + example_imports = example_imports + ( + "from kittycad.models." + ip + " import " + parameter_type + "\n" + ) parameter_example = ( parameter_type + "." + camel_to_screaming_snake(schema["enum"][0]) @@ -173,13 +191,22 @@ def generateTypeAndExamplePython( elif schema["type"] == "string": if name != "": parameter_type = name - example_imports = example_imports + ( - "from kittycad.models." - + camel_to_snake(parameter_type) - + " import " - + parameter_type - + "\n" - ) + if import_path is None: + example_imports = example_imports + ( + "from kittycad.models." + + camel_to_snake(parameter_type) + + " import " + + parameter_type + + "\n" + ) + else: + example_imports = example_imports + ( + "from kittycad.models." + + ip + + " import " + + parameter_type + + "\n" + ) parameter_example = parameter_type + '("")' else: parameter_type = "str" @@ -196,7 +223,7 @@ def generateTypeAndExamplePython( parameter_example = "3.14" elif schema["type"] == "array" and "items" in schema: items_type, items_example, items_imports = generateTypeAndExamplePython( - "", schema["items"], data + "", schema["items"], data, None ) example_imports = example_imports + items_imports parameter_type = "List[" + items_type + "]" @@ -207,6 +234,8 @@ def generateTypeAndExamplePython( parameter_example = parameter_example + "]" else: parameter_example = "[" + items_example + "]" + + example_imports = example_imports + ("from typing import List\n") elif schema["type"] == "object" and "properties" in schema: if name == "": logging.error("schema: %s", json.dumps(schema, indent=4)) @@ -214,13 +243,18 @@ def generateTypeAndExamplePython( parameter_type = name - example_imports = example_imports + ( - "from kittycad.models." - + camel_to_snake(parameter_type) - + " import " - + parameter_type - + "\n" - ) + if import_path is None: + example_imports = example_imports + ( + "from kittycad.models." + + camel_to_snake(parameter_type) + + " import " + + parameter_type + + "\n" + ) + else: + example_imports = example_imports + ( + "from kittycad.models." + ip + " import " + parameter_type + "\n" + ) parameter_example = name + "(" for property_name in schema["properties"]: prop = schema["properties"][property_name] @@ -232,7 +266,7 @@ def generateTypeAndExamplePython( prop_type, prop_example, prop_imports, - ) = generateTypeAndExamplePython("", prop, data) + ) = generateTypeAndExamplePython("", prop, data, None) example_imports = example_imports + prop_imports parameter_example = parameter_example + ( "\n" + property_name + "=" + prop_example + ",\n" @@ -245,7 +279,7 @@ def generateTypeAndExamplePython( and schema["additionalProperties"] is not False ): items_type, items_example, items_imports = generateTypeAndExamplePython( - "", schema["additionalProperties"], data + "", schema["additionalProperties"], data, None ) example_imports = example_imports + items_imports parameter_type = "Dict[str, " + items_type + "]" @@ -258,16 +292,18 @@ def generateTypeAndExamplePython( if isNestedObjectOneOf(schema): properties = schema["oneOf"][0]["properties"] for prop in properties: - return generateTypeAndExamplePython(prop, properties[prop], data) + return generateTypeAndExamplePython( + prop, properties[prop], data, camel_to_snake(name) + ) break - return generateTypeAndExamplePython(name, schema["oneOf"][0], data) + return generateTypeAndExamplePython(name, schema["oneOf"][0], data, None) elif "$ref" in schema: parameter_type = schema["$ref"].replace("#/components/schemas/", "") # Get the schema for the reference. ref_schema = data["components"]["schemas"][parameter_type] - return generateTypeAndExamplePython(parameter_type, ref_schema, data) + return generateTypeAndExamplePython(parameter_type, ref_schema, data, None) else: logging.error("schema: %s", json.dumps(schema, indent=4)) raise Exception("Unknown parameter type") @@ -297,7 +333,12 @@ def generatePath(path: str, name: str, method: str, endpoint: dict, data: dict) success_type = "" if len(endpoint_refs) > 0: - success_type = endpoint_refs[0] + if len(endpoint_refs) > 2: + er = getEndpointRefs(endpoint, data) + er.remove("Error") + success_type = "Union[" + ", ".join(er) + "]" + else: + success_type = endpoint_refs[0] if fn_name == "get_file_conversion" or fn_name == "create_file_conversion": fn_name += "_with_base64_helper" @@ -314,6 +355,15 @@ from kittycad.types import Response """ ) + if fn_name.endswith("_with_base64_helper"): + example_imports += ( + """from kittycad.api.""" + + tag_name + + """ import """ + + fn_name.replace("_with_base64_helper", "") + + "\n" + ) + # Iterate over the parameters. params_str = "" if "parameters" in endpoint: @@ -325,7 +375,7 @@ from kittycad.types import Response parameter_type, parameter_example, more_example_imports, - ) = generateTypeAndExamplePython("", parameter["schema"], data) + ) = generateTypeAndExamplePython("", parameter["schema"], data, None) example_imports = example_imports + more_example_imports if "nullable" in parameter["schema"] and parameter["schema"]["nullable"]: @@ -349,30 +399,42 @@ from kittycad.types import Response params_str += "body='',\n" elif request_body_type == "bytes": params_str += "body=bytes('some bytes', 'utf-8'),\n" - else: + elif request_body_schema: # Generate an example for the schema. - rbs: dict = request_body_schema + rbs: Dict[Any, Any] = request_body_schema ( body_type, body_example, more_example_imports, - ) = generateTypeAndExamplePython(request_body_type, rbs, data) + ) = generateTypeAndExamplePython(request_body_type, rbs, data, None) params_str += "body=" + body_example + ",\n" example_imports = example_imports + more_example_imports example_variable = "" + example_variable_response = "" + + response_type = getFunctionResultType(endpoint, endpoint_refs) + detailed_response_type = getDetailedFunctionResultType(endpoint, endpoint_refs) if ( success_type != "str" and success_type != "dict" and success_type != "None" and success_type != "" ): - example_imports = example_imports + ( - """from kittycad.models import """ - + success_type.replace("List[", "").replace("]", "") - ) - example_variable = "fc: " + success_type + " = " - "response: Response[" + success_type + "] = " + for endpoint_ref in endpoint_refs: + if endpoint_ref == "Error": + continue + example_imports = example_imports + ( + """from kittycad.models import """ + + endpoint_ref.replace("List[", "").replace("]", "") + + "\n" + ) + example_imports = example_imports + "from typing import Union, Any, Optional\n" + example_variable = "result: " + response_type + " = " + + example_imports = example_imports + "from kittycad.types import Response\n" + example_imports = example_imports + "from kittycad.models import Error\n" + example_variable_response = "response: " + detailed_response_type + " = " # Add some new lines. example_imports = example_imports + "\n\n" @@ -389,9 +451,30 @@ from kittycad.types import Response + fn_name + """.sync(client=client,\n""" + params_str - + """)""" + + """) +""" ) + if ( + success_type != "str" + and success_type != "dict" + and success_type != "None" + and success_type != "" + ): + short_sync_example = short_sync_example + ( + """ + if isinstance(result, Error) or result == None: + print(result) + raise Exception("Error in response") + + body: """ + + success_type + + """ = result + print(body) + +""" + ) + # This longer example we use for generating tests. # We only show the short example in the docs since it is much more intuitive to MEs example = ( @@ -405,8 +488,8 @@ from kittycad.types import Response # OR if you need more info (e.g. status_code) """ - + example_variable - + fn_name + + example_variable_response + + fn_name.replace("_with_base64_helper", "") + """.sync_detailed(client=client,\n""" + params_str + """) @@ -430,9 +513,9 @@ async def test_""" # OR run async with more info """ - + example_variable + + example_variable_response + "await " - + fn_name + + fn_name.replace("_with_base64_helper", "") + """.asyncio_detailed(client=client,\n""" + params_str + """)""" @@ -588,131 +671,157 @@ async def test_""" f.write("\n") f.write("\n") - f.write( - "def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, " - + ", ".join(endpoint_refs) - + "]]:\n" - ) - # Iterate over the responses. - responses = endpoint["responses"] - for response_code in responses: - response = responses[response_code] - if response_code == "default": - f.write("\treturn None\n") - else: - f.write( - "\tif response.status_code == " - + response_code.replace("XX", "00") - + ":\n" - ) - is_one_of = False - if "content" in response: - content = response["content"] - for content_type in content: - if content_type == "application/json": - json = content[content_type]["schema"] - if "$ref" in json: - ref = json["$ref"].replace("#/components/schemas/", "") - schema = data["components"]["schemas"][ref] - # Let's check if it is a oneOf. - if "oneOf" in schema: - is_one_of = True - # We want to parse each of the possible types. - f.write("\t\tdata = response.json()\n") - for index, one_of in enumerate(schema["oneOf"]): - ref = getOneOfRefType(one_of) - f.write("\t\ttry:\n") - f.write("\t\t\tif not isinstance(data, dict):\n") - f.write("\t\t\t\traise TypeError()\n") - option_name = "option_" + camel_to_snake(ref) - f.write( - "\t\t\t" - + option_name - + " = " - + ref - + ".from_dict(data)\n" - ) - f.write("\t\t\treturn " + option_name + "\n") - f.write("\t\texcept ValueError:\n") - if index == len(schema["oneOf"]) - 1: - # On the last one raise the error. - f.write("\t\t\traise\n") - else: - f.write("\t\t\tpass\n") - f.write("\t\texcept TypeError:\n") - if index == len(schema["oneOf"]) - 1: - # On the last one raise the error. - f.write("\t\t\traise\n") - else: - f.write("\t\t\tpass\n") - else: - f.write( - "\t\tresponse_" - + response_code - + " = " - + ref - + ".from_dict(response.json())\n" - ) - elif "type" in json: - if json["type"] == "array": - items = json["items"] - if "$ref" in items: - ref = items["$ref"].replace( - "#/components/schemas/", "" - ) - f.write("\t\tresponse_" + response_code + " = [\n") - f.write("\t\t\t" + ref + ".from_dict(item)\n") - f.write("\t\t\tfor item in response.json()\n") - f.write("\t\t]\n") - else: - raise Exception("Unknown array type") - elif json["type"] == "string": - f.write( - "\t\tresponse_" - + response_code - + " = response.text\n" - ) - else: - raise Exception("Unknown type", json["type"]) - else: - f.write( - "\t\tresponse_" + response_code + " = response.json()\n" - ) + if len(endpoint_refs) > 0: + f.write( + "def _parse_response(*, response: httpx.Response) -> " + + response_type + + ":\n" + ) + else: + f.write("def _parse_response(*, response: httpx.Response):\n") - elif "$ref" in response: - schema_name = response["$ref"].replace("#/components/responses/", "") - schema = data["components"]["responses"][schema_name] - if "content" in schema: - content = schema["content"] + # Iterate over the responses. + if len(endpoint_refs) > 0: + responses = endpoint["responses"] + for response_code in responses: + response = responses[response_code] + if response_code == "default": + # This is no content. + f.write("\treturn None\n") + elif response_code == "204" or response_code == "302": + # This is no content. + f.write("\treturn None\n") + else: + f.write( + "\tif response.status_code == " + + response_code.replace("XX", "00") + + ":\n" + ) + is_one_of = False + if "content" in response: + content = response["content"] for content_type in content: if content_type == "application/json": json = content[content_type]["schema"] if "$ref" in json: ref = json["$ref"].replace("#/components/schemas/", "") + schema = data["components"]["schemas"][ref] + # Let's check if it is a oneOf. + if "oneOf" in schema: + is_one_of = True + # We want to parse each of the possible types. + f.write("\t\tdata = response.json()\n") + for index, one_of in enumerate(schema["oneOf"]): + ref = getOneOfRefType(one_of) + f.write("\t\ttry:\n") + f.write( + "\t\t\tif not isinstance(data, dict):\n" + ) + f.write("\t\t\t\traise TypeError()\n") + option_name = "option_" + camel_to_snake(ref) + f.write( + "\t\t\t" + + option_name + + " = " + + ref + + ".from_dict(data)\n" + ) + f.write("\t\t\treturn " + option_name + "\n") + f.write("\t\texcept ValueError:\n") + if index == len(schema["oneOf"]) - 1: + # On the last one raise the error. + f.write("\t\t\traise\n") + else: + f.write("\t\t\tpass\n") + f.write("\t\texcept TypeError:\n") + if index == len(schema["oneOf"]) - 1: + # On the last one raise the error. + f.write("\t\t\traise\n") + else: + f.write("\t\t\tpass\n") + else: + f.write( + "\t\tresponse_" + + response_code + + " = " + + ref + + ".from_dict(response.json())\n" + ) + elif "type" in json: + if json["type"] == "array": + items = json["items"] + if "$ref" in items: + ref = items["$ref"].replace( + "#/components/schemas/", "" + ) + f.write( + "\t\tresponse_" + response_code + " = [\n" + ) + f.write("\t\t\t" + ref + ".from_dict(item)\n") + f.write("\t\t\tfor item in response.json()\n") + f.write("\t\t]\n") + else: + raise Exception("Unknown array type") + elif json["type"] == "string": + f.write( + "\t\tresponse_" + + response_code + + " = response.text\n" + ) + else: + raise Exception("Unknown type", json["type"]) + else: f.write( "\t\tresponse_" + response_code - + " = " - + ref - + ".from_dict(response.json())\n" + + " = response.json()\n" ) - else: - f.write("\t\tresponse_" + response_code + " = None\n") - if not is_one_of: - f.write("\t\treturn response_" + response_code + "\n") + elif "$ref" in response: + schema_name = response["$ref"].replace( + "#/components/responses/", "" + ) + schema = data["components"]["responses"][schema_name] + if "content" in schema: + content = schema["content"] + for content_type in content: + if content_type == "application/json": + json = content[content_type]["schema"] + if "$ref" in json: + ref = json["$ref"].replace( + "#/components/schemas/", "" + ) + f.write( + "\t\tresponse_" + + response_code + + " = " + + ref + + ".from_dict(response.json())\n" + ) + else: + print(endpoint) + raise Exception("response not supported") - # End the method. - f.write("\treturn None\n") + if not is_one_of: + f.write("\t\treturn response_" + response_code + "\n") + + # End the method. + f.write("\treturn Error.from_dict(response.json())\n") + else: + f.write("\treturn\n") # Define the build response method. f.write("\n") f.write("\n") - f.write( - "def _build_response(*, response: httpx.Response) -> Response[Union[Any, " - + ", ".join(endpoint_refs) - + "]]:\n" - ) + if len(endpoint_refs) > 0: + f.write( + "def _build_response(*, response: httpx.Response) -> " + + detailed_response_type + + ":\n" + ) + else: + f.write("def _build_response(*, response: httpx.Response) -> Response[Any]:\n") + f.write("\treturn Response(\n") f.write("\t\tstatus_code=response.status_code,\n") f.write("\t\tcontent=response.content,\n") @@ -776,7 +885,12 @@ async def test_""" f.write("\tclient: Client,\n") for optional_arg in optional_args: f.write(optional_arg) - f.write(") -> Response[Union[Any, " + ", ".join(endpoint_refs) + "]]:\n") + + if len(endpoint_refs) > 0: + f.write(") -> " + detailed_response_type + ":\n") + else: + f.write(") -> Response[Any]:\n") + f.write("\tkwargs = _get_kwargs(\n") params = get_function_parameters(endpoint, request_body_type) for param in params: @@ -847,7 +961,12 @@ async def test_""" f.write("\tclient: Client,\n") for optional_arg in optional_args: f.write(optional_arg) - f.write(") -> Optional[Union[Any, " + ", ".join(endpoint_refs) + "]]:\n") + + if len(endpoint_refs) > 0: + f.write(") -> " + response_type + ":\n") + else: + f.write("):\n") + if "description" in endpoint: f.write('\t""" ' + endpoint["description"] + ' """ # noqa: E501\n') f.write("\n") @@ -914,7 +1033,12 @@ async def test_""" f.write("\tclient: Client,\n") for optional_arg in optional_args: f.write(optional_arg) - f.write(") -> Response[Union[Any, " + ", ".join(endpoint_refs) + "]]:\n") + + if len(endpoint_refs) > 0: + f.write(") -> " + detailed_response_type + ":\n") + else: + f.write(") -> Response[Any]:\n") + f.write("\tkwargs = _get_kwargs(\n") params = get_function_parameters(endpoint, request_body_type) for param in params: @@ -983,7 +1107,12 @@ async def test_""" f.write("\tclient: Client,\n") for optional_arg in optional_args: f.write(optional_arg) - f.write(") -> Optional[Union[Any, " + ", ".join(endpoint_refs) + "]]:\n") + + if len(endpoint_refs) > 0: + f.write(") -> " + response_type + ":\n") + else: + f.write("):\n") + if "description" in endpoint: f.write('\t""" ' + endpoint["description"] + ' """ # noqa: E501\n') f.write("\n") @@ -1819,7 +1948,10 @@ def getEndpointRefs(endpoint: dict, data: dict) -> List[str]: # all the possible outcomes. ref = json["$ref"].replace("#/components/schemas/", "") schema = data["components"]["schemas"][ref] - if "oneOf" in schema: + if isNestedObjectOneOf(schema) or isEnumWithDocsOneOf(schema): + if ref not in refs: + refs.append(ref) + elif isTypedObjectOneOf(schema): for t in schema["oneOf"]: ref = getOneOfRefType(t) if ref not in refs: @@ -2000,7 +2132,11 @@ def get_function_parameters( def getOneOfRefType(schema: dict) -> str: - if "type" in schema["properties"]: + if ( + "type" in schema["properties"] + and "enum" in schema["properties"]["type"] + and len(schema["properties"]["type"]["enum"]) == 1 + ): t = schema["properties"]["type"]["enum"][0] return t @@ -2008,6 +2144,9 @@ def getOneOfRefType(schema: dict) -> str: def isNestedObjectOneOf(schema: dict) -> bool: + if "oneOf" not in schema: + return False + is_nested_object = False for one_of in schema["oneOf"]: # Check if each are an object w 1 property in it. @@ -2031,6 +2170,9 @@ def isNestedObjectOneOf(schema: dict) -> bool: def isEnumWithDocsOneOf(schema: dict) -> bool: + if "oneOf" not in schema: + return False + is_enum_with_docs = False for one_of in schema["oneOf"]: if one_of["type"] == "string" and "enum" in one_of and len(one_of["enum"]) == 1: @@ -2042,6 +2184,53 @@ def isEnumWithDocsOneOf(schema: dict) -> bool: return is_enum_with_docs +def isTypedObjectOneOf(schema: dict) -> bool: + if "oneOf" not in schema: + return False + + is_typed_object = False + for one_of in schema["oneOf"]: + if ( + "type" in one_of["properties"] + and "enum" in one_of["properties"]["type"] + and len(one_of["properties"]["type"]["enum"]) == 1 + ): + is_typed_object = True + else: + is_typed_object = False + break + + return is_typed_object + + +def hasNoContentResponse(endpoint: dict) -> bool: + responses = endpoint["responses"] + for response_code in responses: + if ( + response_code == "default" + or response_code == "204" + or response_code == "302" + ): + return True + + return False + + +def getFunctionResultType(endpoint: dict, endpoint_refs: List[str]) -> str: + result = ", ".join(endpoint_refs) + if len(endpoint_refs) > 1: + result = "Optional[Union[" + result + "]]" + + if hasNoContentResponse(endpoint): + result = "Optional[" + result + "]" + + return result + + +def getDetailedFunctionResultType(endpoint: dict, endpoint_refs: List[str]) -> str: + return "Response[" + getFunctionResultType(endpoint, endpoint_refs) + "]" + + # generate a random letter in the range A - Z # do not use O or I. def randletter(): diff --git a/kittycad/api/ai/create_image_to_3d.py b/kittycad/api/ai/create_image_to_3d.py index e53228897..87d7cc238 100644 --- a/kittycad/api/ai/create_image_to_3d.py +++ b/kittycad/api/ai/create_image_to_3d.py @@ -33,7 +33,7 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Mesh, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[Mesh, Error]]: if response.status_code == 200: response_200 = Mesh.from_dict(response.json()) return response_200 @@ -43,10 +43,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Mesh, Er if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Mesh, Error]]: +def _build_response( + *, response: httpx.Response +) -> Response[Optional[Union[Mesh, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -61,7 +63,7 @@ def sync_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, Mesh, Error]]: +) -> Response[Optional[Union[Mesh, Error]]]: kwargs = _get_kwargs( input_format=input_format, output_format=output_format, @@ -83,7 +85,7 @@ def sync( body: bytes, *, client: Client, -) -> Optional[Union[Any, Mesh, Error]]: +) -> Optional[Union[Mesh, Error]]: """This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501 return sync_detailed( @@ -100,7 +102,7 @@ async def asyncio_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, Mesh, Error]]: +) -> Response[Optional[Union[Mesh, Error]]]: kwargs = _get_kwargs( input_format=input_format, output_format=output_format, @@ -120,7 +122,7 @@ async def asyncio( body: bytes, *, client: Client, -) -> Optional[Union[Any, Mesh, Error]]: +) -> Optional[Union[Mesh, Error]]: """This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501 return ( diff --git a/kittycad/api/ai/create_text_to_3d.py b/kittycad/api/ai/create_text_to_3d.py index 6ea670c6f..8dda9b4f0 100644 --- a/kittycad/api/ai/create_text_to_3d.py +++ b/kittycad/api/ai/create_text_to_3d.py @@ -35,7 +35,7 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Mesh, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[Mesh, Error]]: if response.status_code == 200: response_200 = Mesh.from_dict(response.json()) return response_200 @@ -45,10 +45,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Mesh, Er if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Mesh, Error]]: +def _build_response( + *, response: httpx.Response +) -> Response[Optional[Union[Mesh, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -62,7 +64,7 @@ def sync_detailed( prompt: str, *, client: Client, -) -> Response[Union[Any, Mesh, Error]]: +) -> Response[Optional[Union[Mesh, Error]]]: kwargs = _get_kwargs( output_format=output_format, prompt=prompt, @@ -82,7 +84,7 @@ def sync( prompt: str, *, client: Client, -) -> Optional[Union[Any, Mesh, Error]]: +) -> Optional[Union[Mesh, Error]]: """This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501 return sync_detailed( @@ -97,7 +99,7 @@ async def asyncio_detailed( prompt: str, *, client: Client, -) -> Response[Union[Any, Mesh, Error]]: +) -> Response[Optional[Union[Mesh, Error]]]: kwargs = _get_kwargs( output_format=output_format, prompt=prompt, @@ -115,7 +117,7 @@ async def asyncio( prompt: str, *, client: Client, -) -> Optional[Union[Any, Mesh, Error]]: +) -> Optional[Union[Mesh, Error]]: """This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501 return ( diff --git a/kittycad/api/api_calls/get_api_call.py b/kittycad/api/api_calls/get_api_call.py index 24702f02e..556a6d22f 100644 --- a/kittycad/api/api_calls/get_api_call.py +++ b/kittycad/api/api_calls/get_api_call.py @@ -28,7 +28,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, ApiCallWithPrice, Error]]: +) -> Optional[Union[ApiCallWithPrice, Error]]: if response.status_code == 200: response_200 = ApiCallWithPrice.from_dict(response.json()) return response_200 @@ -38,12 +38,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, ApiCallWithPrice, Error]]: +) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -56,7 +56,7 @@ def sync_detailed( id: str, *, client: Client, -) -> Response[Union[Any, ApiCallWithPrice, Error]]: +) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: kwargs = _get_kwargs( id=id, client=client, @@ -74,7 +74,7 @@ def sync( id: str, *, client: Client, -) -> Optional[Union[Any, ApiCallWithPrice, Error]]: +) -> Optional[Union[ApiCallWithPrice, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user. If the user is not authenticated to view the specified API call, then it is not returned. Only KittyCAD employees can view API calls for other users.""" # noqa: E501 @@ -89,7 +89,7 @@ async def asyncio_detailed( id: str, *, client: Client, -) -> Response[Union[Any, ApiCallWithPrice, Error]]: +) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: kwargs = _get_kwargs( id=id, client=client, @@ -105,7 +105,7 @@ async def asyncio( id: str, *, client: Client, -) -> Optional[Union[Any, ApiCallWithPrice, Error]]: +) -> Optional[Union[ApiCallWithPrice, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user. If the user is not authenticated to view the specified API call, then it is not returned. Only KittyCAD employees can view API calls for other users.""" # noqa: E501 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 e00b52b19..93c52b28e 100644 --- a/kittycad/api/api_calls/get_api_call_for_user.py +++ b/kittycad/api/api_calls/get_api_call_for_user.py @@ -28,7 +28,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, ApiCallWithPrice, Error]]: +) -> Optional[Union[ApiCallWithPrice, Error]]: if response.status_code == 200: response_200 = ApiCallWithPrice.from_dict(response.json()) return response_200 @@ -38,12 +38,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, ApiCallWithPrice, Error]]: +) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -56,7 +56,7 @@ def sync_detailed( id: str, *, client: Client, -) -> Response[Union[Any, ApiCallWithPrice, Error]]: +) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: kwargs = _get_kwargs( id=id, client=client, @@ -74,7 +74,7 @@ def sync( id: str, *, client: Client, -) -> Optional[Union[Any, ApiCallWithPrice, Error]]: +) -> Optional[Union[ApiCallWithPrice, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.""" # noqa: E501 return sync_detailed( @@ -87,7 +87,7 @@ async def asyncio_detailed( id: str, *, client: Client, -) -> Response[Union[Any, ApiCallWithPrice, Error]]: +) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: kwargs = _get_kwargs( id=id, client=client, @@ -103,7 +103,7 @@ async def asyncio( id: str, *, client: Client, -) -> Optional[Union[Any, ApiCallWithPrice, Error]]: +) -> Optional[Union[ApiCallWithPrice, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.""" # noqa: E501 return ( diff --git a/kittycad/api/api_calls/get_api_call_metrics.py b/kittycad/api/api_calls/get_api_call_metrics.py index 1b3cb5d91..7a57321d9 100644 --- a/kittycad/api/api_calls/get_api_call_metrics.py +++ b/kittycad/api/api_calls/get_api_call_metrics.py @@ -34,7 +34,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, List[ApiCallQueryGroup], Error]]: +) -> Optional[Union[List[ApiCallQueryGroup], Error]]: if response.status_code == 200: response_200 = [ApiCallQueryGroup.from_dict(item) for item in response.json()] return response_200 @@ -44,12 +44,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, List[ApiCallQueryGroup], Error]]: +) -> Response[Optional[Union[List[ApiCallQueryGroup], Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -62,7 +62,7 @@ def sync_detailed( group_by: ApiCallQueryGroupBy, *, client: Client, -) -> Response[Union[Any, List[ApiCallQueryGroup], Error]]: +) -> Response[Optional[Union[List[ApiCallQueryGroup], Error]]]: kwargs = _get_kwargs( group_by=group_by, client=client, @@ -80,7 +80,7 @@ def sync( group_by: ApiCallQueryGroupBy, *, client: Client, -) -> Optional[Union[Any, List[ApiCallQueryGroup], Error]]: +) -> Optional[Union[List[ApiCallQueryGroup], Error]]: """This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.""" # noqa: E501 return sync_detailed( @@ -93,7 +93,7 @@ async def asyncio_detailed( group_by: ApiCallQueryGroupBy, *, client: Client, -) -> Response[Union[Any, List[ApiCallQueryGroup], Error]]: +) -> Response[Optional[Union[List[ApiCallQueryGroup], Error]]]: kwargs = _get_kwargs( group_by=group_by, client=client, @@ -109,7 +109,7 @@ async def asyncio( group_by: ApiCallQueryGroupBy, *, client: Client, -) -> Optional[Union[Any, List[ApiCallQueryGroup], Error]]: +) -> Optional[Union[List[ApiCallQueryGroup], Error]]: """This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.""" # noqa: E501 return ( diff --git a/kittycad/api/api_calls/get_async_operation.py b/kittycad/api/api_calls/get_async_operation.py index 5560f42b6..9bd1f9de1 100644 --- a/kittycad/api/api_calls/get_async_operation.py +++ b/kittycad/api/api_calls/get_async_operation.py @@ -35,7 +35,6 @@ def _parse_response( *, response: httpx.Response ) -> Optional[ Union[ - Any, FileConversion, FileCenterOfMass, FileMass, @@ -107,21 +106,22 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response ) -> Response[ - Union[ - Any, - FileConversion, - FileCenterOfMass, - FileMass, - FileVolume, - FileDensity, - FileSurfaceArea, - Error, + Optional[ + Union[ + FileConversion, + FileCenterOfMass, + FileMass, + FileVolume, + FileDensity, + FileSurfaceArea, + Error, + ] ] ]: return Response( @@ -137,15 +137,16 @@ def sync_detailed( *, client: Client, ) -> Response[ - Union[ - Any, - FileConversion, - FileCenterOfMass, - FileMass, - FileVolume, - FileDensity, - FileSurfaceArea, - Error, + Optional[ + Union[ + FileConversion, + FileCenterOfMass, + FileMass, + FileVolume, + FileDensity, + FileSurfaceArea, + Error, + ] ] ]: kwargs = _get_kwargs( @@ -167,7 +168,6 @@ def sync( client: Client, ) -> Optional[ Union[ - Any, FileConversion, FileCenterOfMass, FileMass, @@ -193,15 +193,16 @@ async def asyncio_detailed( *, client: Client, ) -> Response[ - Union[ - Any, - FileConversion, - FileCenterOfMass, - FileMass, - FileVolume, - FileDensity, - FileSurfaceArea, - Error, + Optional[ + Union[ + FileConversion, + FileCenterOfMass, + FileMass, + FileVolume, + FileDensity, + FileSurfaceArea, + Error, + ] ] ]: kwargs = _get_kwargs( @@ -221,7 +222,6 @@ async def asyncio( client: Client, ) -> Optional[ Union[ - Any, FileConversion, FileCenterOfMass, FileMass, diff --git a/kittycad/api/api_calls/list_api_calls.py b/kittycad/api/api_calls/list_api_calls.py index ba87d5cfa..e0be435d9 100644 --- a/kittycad/api/api_calls/list_api_calls.py +++ b/kittycad/api/api_calls/list_api_calls.py @@ -46,7 +46,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: if response.status_code == 200: response_200 = ApiCallWithPriceResultsPage.from_dict(response.json()) return response_200 @@ -56,12 +56,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -98,7 +98,7 @@ def sync( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: """This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501 return sync_detailed( @@ -115,7 +115,7 @@ async def asyncio_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -135,7 +135,7 @@ async def asyncio( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: """This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501 return ( 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 2109bdc48..55a631c59 100644 --- a/kittycad/api/api_calls/list_api_calls_for_user.py +++ b/kittycad/api/api_calls/list_api_calls_for_user.py @@ -47,7 +47,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: if response.status_code == 200: response_200 = ApiCallWithPriceResultsPage.from_dict(response.json()) return response_200 @@ -57,12 +57,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -78,7 +78,7 @@ def sync_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: kwargs = _get_kwargs( id=id, limit=limit, @@ -102,7 +102,7 @@ def sync( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if "me" is passed as the user id. Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user. If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id. @@ -124,7 +124,7 @@ async def asyncio_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: kwargs = _get_kwargs( id=id, limit=limit, @@ -146,7 +146,7 @@ async def asyncio( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if "me" is passed as the user id. Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user. If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id. diff --git a/kittycad/api/api_calls/list_async_operations.py b/kittycad/api/api_calls/list_async_operations.py index 4c42dec2a..40e790444 100644 --- a/kittycad/api/api_calls/list_async_operations.py +++ b/kittycad/api/api_calls/list_async_operations.py @@ -53,7 +53,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, AsyncApiCallResultsPage, Error]]: +) -> Optional[Union[AsyncApiCallResultsPage, Error]]: if response.status_code == 200: response_200 = AsyncApiCallResultsPage.from_dict(response.json()) return response_200 @@ -63,12 +63,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, AsyncApiCallResultsPage, Error]]: +) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -84,7 +84,7 @@ def sync_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, AsyncApiCallResultsPage, Error]]: +) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -108,7 +108,7 @@ def sync( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, AsyncApiCallResultsPage, Error]]: +) -> Optional[Union[AsyncApiCallResultsPage, Error]]: """For async file conversion operations, this endpoint does not return the contents of converted files (`output`). To get the contents use the `/async/operations/{id}` endpoint. This endpoint requires authentication by a KittyCAD employee.""" # noqa: E501 @@ -128,7 +128,7 @@ async def asyncio_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, AsyncApiCallResultsPage, Error]]: +) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -150,7 +150,7 @@ async def asyncio( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, AsyncApiCallResultsPage, Error]]: +) -> Optional[Union[AsyncApiCallResultsPage, Error]]: """For async file conversion operations, this endpoint does not return the contents of converted files (`output`). To get the contents use the `/async/operations/{id}` endpoint. This endpoint requires authentication by a KittyCAD employee.""" # noqa: E501 diff --git a/kittycad/api/api_calls/user_list_api_calls.py b/kittycad/api/api_calls/user_list_api_calls.py index e3f26e88e..591aaf5a6 100644 --- a/kittycad/api/api_calls/user_list_api_calls.py +++ b/kittycad/api/api_calls/user_list_api_calls.py @@ -46,7 +46,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: if response.status_code == 200: response_200 = ApiCallWithPriceResultsPage.from_dict(response.json()) return response_200 @@ -56,12 +56,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -98,7 +98,7 @@ def sync( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user. The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501 @@ -116,7 +116,7 @@ async def asyncio_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -136,7 +136,7 @@ async def asyncio( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]: +) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user. The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501 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 1652384aa..51ccafb06 100644 --- a/kittycad/api/api_tokens/create_api_token_for_user.py +++ b/kittycad/api/api_tokens/create_api_token_for_user.py @@ -25,9 +25,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, ApiToken, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiToken, Error]]: if response.status_code == 201: response_201 = ApiToken.from_dict(response.json()) return response_201 @@ -37,12 +35,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, ApiToken, Error]]: +) -> Response[Optional[Union[ApiToken, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +52,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any, ApiToken, Error]]: +) -> Response[Optional[Union[ApiToken, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -70,7 +68,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, ApiToken, Error]]: +) -> Optional[Union[ApiToken, Error]]: """This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.""" # noqa: E501 return sync_detailed( @@ -81,7 +79,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, ApiToken, Error]]: +) -> Response[Optional[Union[ApiToken, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -95,7 +93,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, ApiToken, Error]]: +) -> Optional[Union[ApiToken, Error]]: """This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.""" # noqa: E501 return ( 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 51f70fdce..c62507666 100644 --- a/kittycad/api/api_tokens/delete_api_token_for_user.py +++ b/kittycad/api/api_tokens/delete_api_token_for_user.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional import httpx @@ -27,20 +27,18 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]: - if response.status_code == 204: - response_204 = None - return response_204 +def _parse_response(*, response: httpx.Response) -> Optional[Error]: + return None if response.status_code == 400: response_4XX = Error.from_dict(response.json()) return response_4XX if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: +def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: return Response( status_code=response.status_code, content=response.content, @@ -53,7 +51,7 @@ def sync_detailed( token: str, *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( token=token, client=client, @@ -71,7 +69,7 @@ def sync( token: str, *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user. This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.""" # noqa: E501 @@ -85,7 +83,7 @@ async def asyncio_detailed( token: str, *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( token=token, client=client, @@ -101,7 +99,7 @@ async def asyncio( token: str, *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user. This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.""" # noqa: E501 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 dadb4900d..d683d3190 100644 --- a/kittycad/api/api_tokens/get_api_token_for_user.py +++ b/kittycad/api/api_tokens/get_api_token_for_user.py @@ -28,9 +28,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, ApiToken, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiToken, Error]]: if response.status_code == 200: response_200 = ApiToken.from_dict(response.json()) return response_200 @@ -40,12 +38,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, ApiToken, Error]]: +) -> Response[Optional[Union[ApiToken, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -58,7 +56,7 @@ def sync_detailed( token: str, *, client: Client, -) -> Response[Union[Any, ApiToken, Error]]: +) -> Response[Optional[Union[ApiToken, Error]]]: kwargs = _get_kwargs( token=token, client=client, @@ -76,7 +74,7 @@ def sync( token: str, *, client: Client, -) -> Optional[Union[Any, ApiToken, Error]]: +) -> Optional[Union[ApiToken, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501 return sync_detailed( @@ -89,7 +87,7 @@ async def asyncio_detailed( token: str, *, client: Client, -) -> Response[Union[Any, ApiToken, Error]]: +) -> Response[Optional[Union[ApiToken, Error]]]: kwargs = _get_kwargs( token=token, client=client, @@ -105,7 +103,7 @@ async def asyncio( token: str, *, client: Client, -) -> Optional[Union[Any, ApiToken, Error]]: +) -> Optional[Union[ApiToken, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501 return ( 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 882a7b358..bf93246bd 100644 --- a/kittycad/api/api_tokens/list_api_tokens_for_user.py +++ b/kittycad/api/api_tokens/list_api_tokens_for_user.py @@ -46,7 +46,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, ApiTokenResultsPage, Error]]: +) -> Optional[Union[ApiTokenResultsPage, Error]]: if response.status_code == 200: response_200 = ApiTokenResultsPage.from_dict(response.json()) return response_200 @@ -56,12 +56,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, ApiTokenResultsPage, Error]]: +) -> Response[Optional[Union[ApiTokenResultsPage, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, ApiTokenResultsPage, Error]]: +) -> Response[Optional[Union[ApiTokenResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -98,7 +98,7 @@ def sync( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, ApiTokenResultsPage, Error]]: +) -> Optional[Union[ApiTokenResultsPage, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user. The API tokens are returned in order of creation, with the most recently created API tokens first.""" # noqa: E501 @@ -116,7 +116,7 @@ async def asyncio_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, ApiTokenResultsPage, Error]]: +) -> Response[Optional[Union[ApiTokenResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -136,7 +136,7 @@ async def asyncio( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, ApiTokenResultsPage, Error]]: +) -> Optional[Union[ApiTokenResultsPage, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user. The API tokens are returned in order of creation, with the most recently created API tokens first.""" # noqa: E501 diff --git a/kittycad/api/apps/apps_github_callback.py b/kittycad/api/apps/apps_github_callback.py index 35763c666..eaf24bfb8 100644 --- a/kittycad/api/apps/apps_github_callback.py +++ b/kittycad/api/apps/apps_github_callback.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional import httpx @@ -24,20 +24,18 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]: - if response.status_code == 204: - response_204 = None - return response_204 +def _parse_response(*, response: httpx.Response) -> Optional[Error]: + return None if response.status_code == 400: response_4XX = Error.from_dict(response.json()) return response_4XX if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: +def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: return Response( status_code=response.status_code, content=response.content, @@ -49,7 +47,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: def sync_detailed( *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( client=client, ) @@ -65,7 +63,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos. The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501 @@ -77,7 +75,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( client=client, ) @@ -91,7 +89,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos. The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501 diff --git a/kittycad/api/apps/apps_github_consent.py b/kittycad/api/apps/apps_github_consent.py index 6e29dbc1e..44dba3298 100644 --- a/kittycad/api/apps/apps_github_consent.py +++ b/kittycad/api/apps/apps_github_consent.py @@ -27,7 +27,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, AppClientInfo, Error]]: +) -> Optional[Union[AppClientInfo, Error]]: if response.status_code == 200: response_200 = AppClientInfo.from_dict(response.json()) return response_200 @@ -37,12 +37,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, AppClientInfo, Error]]: +) -> Response[Optional[Union[AppClientInfo, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +54,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any, AppClientInfo, Error]]: +) -> Response[Optional[Union[AppClientInfo, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, AppClientInfo, Error]]: +) -> Optional[Union[AppClientInfo, Error]]: """This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos. The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501 @@ -82,7 +82,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, AppClientInfo, Error]]: +) -> Response[Optional[Union[AppClientInfo, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -96,7 +96,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, AppClientInfo, Error]]: +) -> Optional[Union[AppClientInfo, Error]]: """This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos. The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501 diff --git a/kittycad/api/apps/apps_github_webhook.py b/kittycad/api/apps/apps_github_webhook.py index 496b4b1fc..94ff3e58c 100644 --- a/kittycad/api/apps/apps_github_webhook.py +++ b/kittycad/api/apps/apps_github_webhook.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional import httpx @@ -26,20 +26,18 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]: - if response.status_code == 204: - response_204 = None - return response_204 +def _parse_response(*, response: httpx.Response) -> Optional[Error]: + return None if response.status_code == 400: response_4XX = Error.from_dict(response.json()) return response_4XX if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: +def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: return Response( status_code=response.status_code, content=response.content, @@ -52,7 +50,7 @@ def sync_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( body=body, client=client, @@ -70,7 +68,7 @@ def sync( body: bytes, *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """These come from the GitHub app.""" # noqa: E501 return sync_detailed( @@ -83,7 +81,7 @@ async def asyncio_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( body=body, client=client, @@ -99,7 +97,7 @@ async def asyncio( body: bytes, *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """These come from the GitHub app.""" # noqa: E501 return ( diff --git a/kittycad/api/constant/get_physics_constant.py b/kittycad/api/constant/get_physics_constant.py index 3642c93eb..2751a325a 100644 --- a/kittycad/api/constant/get_physics_constant.py +++ b/kittycad/api/constant/get_physics_constant.py @@ -31,7 +31,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, PhysicsConstant, Error]]: +) -> Optional[Union[PhysicsConstant, Error]]: if response.status_code == 200: response_200 = PhysicsConstant.from_dict(response.json()) return response_200 @@ -41,12 +41,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, PhysicsConstant, Error]]: +) -> Response[Optional[Union[PhysicsConstant, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -59,7 +59,7 @@ def sync_detailed( constant: PhysicsConstantName, *, client: Client, -) -> Response[Union[Any, PhysicsConstant, Error]]: +) -> Response[Optional[Union[PhysicsConstant, Error]]]: kwargs = _get_kwargs( constant=constant, client=client, @@ -77,7 +77,7 @@ def sync( constant: PhysicsConstantName, *, client: Client, -) -> Optional[Union[Any, PhysicsConstant, Error]]: +) -> Optional[Union[PhysicsConstant, Error]]: return sync_detailed( constant=constant, @@ -89,7 +89,7 @@ async def asyncio_detailed( constant: PhysicsConstantName, *, client: Client, -) -> Response[Union[Any, PhysicsConstant, Error]]: +) -> Response[Optional[Union[PhysicsConstant, Error]]]: kwargs = _get_kwargs( constant=constant, client=client, @@ -105,7 +105,7 @@ async def asyncio( constant: PhysicsConstantName, *, client: Client, -) -> Optional[Union[Any, PhysicsConstant, Error]]: +) -> Optional[Union[PhysicsConstant, Error]]: return ( await asyncio_detailed( diff --git a/kittycad/api/drawing/cmd.py b/kittycad/api/drawing/cmd.py index dd197f130..988ca6d84 100644 --- a/kittycad/api/drawing/cmd.py +++ b/kittycad/api/drawing/cmd.py @@ -27,7 +27,7 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, dict, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]]: if response.status_code == 200: response_200 = response.json() return response_200 @@ -37,10 +37,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, dict, Er if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, dict, Error]]: +def _build_response( + *, response: httpx.Response +) -> Response[Optional[Union[dict, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -53,7 +55,7 @@ def sync_detailed( body: DrawingCmdReq, *, client: Client, -) -> Response[Union[Any, dict, Error]]: +) -> Response[Optional[Union[dict, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -71,7 +73,7 @@ def sync( body: DrawingCmdReq, *, client: Client, -) -> Optional[Union[Any, dict, Error]]: +) -> Optional[Union[dict, Error]]: """Response depends on which command was submitted, so unfortunately the OpenAPI schema can't generate the right response type.""" # noqa: E501 return sync_detailed( @@ -84,7 +86,7 @@ async def asyncio_detailed( body: DrawingCmdReq, *, client: Client, -) -> Response[Union[Any, dict, Error]]: +) -> Response[Optional[Union[dict, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -100,7 +102,7 @@ async def asyncio( body: DrawingCmdReq, *, client: Client, -) -> Optional[Union[Any, dict, Error]]: +) -> Optional[Union[dict, Error]]: """Response depends on which command was submitted, so unfortunately the OpenAPI schema can't generate the right response type.""" # noqa: E501 return ( diff --git a/kittycad/api/drawing/cmd_batch.py b/kittycad/api/drawing/cmd_batch.py index e8fc768d6..bfbdf6a7c 100644 --- a/kittycad/api/drawing/cmd_batch.py +++ b/kittycad/api/drawing/cmd_batch.py @@ -30,7 +30,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, DrawingOutcomes, Error]]: +) -> Optional[Union[DrawingOutcomes, Error]]: if response.status_code == 200: response_200 = DrawingOutcomes.from_dict(response.json()) return response_200 @@ -40,12 +40,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, DrawingOutcomes, Error]]: +) -> Response[Optional[Union[DrawingOutcomes, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -58,7 +58,7 @@ def sync_detailed( body: DrawingCmdReqBatch, *, client: Client, -) -> Response[Union[Any, DrawingOutcomes, Error]]: +) -> Response[Optional[Union[DrawingOutcomes, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -76,7 +76,7 @@ def sync( body: DrawingCmdReqBatch, *, client: Client, -) -> Optional[Union[Any, DrawingOutcomes, Error]]: +) -> Optional[Union[DrawingOutcomes, Error]]: return sync_detailed( body=body, @@ -88,7 +88,7 @@ async def asyncio_detailed( body: DrawingCmdReqBatch, *, client: Client, -) -> Response[Union[Any, DrawingOutcomes, Error]]: +) -> Response[Optional[Union[DrawingOutcomes, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -104,7 +104,7 @@ async def asyncio( body: DrawingCmdReqBatch, *, client: Client, -) -> Optional[Union[Any, DrawingOutcomes, Error]]: +) -> Optional[Union[DrawingOutcomes, Error]]: return ( await asyncio_detailed( diff --git a/kittycad/api/executor/create_executor_term.py b/kittycad/api/executor/create_executor_term.py index a2deb49c6..3fc3641c6 100644 --- a/kittycad/api/executor/create_executor_term.py +++ b/kittycad/api/executor/create_executor_term.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict import httpx @@ -23,16 +23,11 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any,]]: - return None - return None +def _parse_response(*, response: httpx.Response): + return -def _build_response( - *, response: httpx.Response -) -> Response[Union[Any,]]: +def _build_response(*, response: httpx.Response) -> Response[Any]: return Response( status_code=response.status_code, content=response.content, @@ -44,7 +39,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any,]]: +) -> Response[Any]: kwargs = _get_kwargs( client=client, ) @@ -60,7 +55,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any,]]: +): """Attach to a docker container to create an interactive terminal.""" # noqa: E501 return sync_detailed( @@ -71,7 +66,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any,]]: +) -> Response[Any]: kwargs = _get_kwargs( client=client, ) @@ -85,7 +80,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any,]]: +): """Attach to a docker container to create an interactive terminal.""" # noqa: E501 return ( diff --git a/kittycad/api/executor/create_file_execution.py b/kittycad/api/executor/create_file_execution.py index c272a6ad6..cb6086da1 100644 --- a/kittycad/api/executor/create_file_execution.py +++ b/kittycad/api/executor/create_file_execution.py @@ -35,9 +35,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, CodeOutput, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[CodeOutput, Error]]: if response.status_code == 200: response_200 = CodeOutput.from_dict(response.json()) return response_200 @@ -47,12 +45,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, CodeOutput, Error]]: +) -> Response[Optional[Union[CodeOutput, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -67,7 +65,7 @@ def sync_detailed( *, client: Client, output: Optional[str] = None, -) -> Response[Union[Any, CodeOutput, Error]]: +) -> Response[Optional[Union[CodeOutput, Error]]]: kwargs = _get_kwargs( lang=lang, output=output, @@ -89,7 +87,7 @@ def sync( *, client: Client, output: Optional[str] = None, -) -> Optional[Union[Any, CodeOutput, Error]]: +) -> Optional[Union[CodeOutput, Error]]: return sync_detailed( lang=lang, @@ -105,7 +103,7 @@ async def asyncio_detailed( *, client: Client, output: Optional[str] = None, -) -> Response[Union[Any, CodeOutput, Error]]: +) -> Response[Optional[Union[CodeOutput, Error]]]: kwargs = _get_kwargs( lang=lang, output=output, @@ -125,7 +123,7 @@ async def asyncio( *, client: Client, output: Optional[str] = None, -) -> Optional[Union[Any, CodeOutput, Error]]: +) -> Optional[Union[CodeOutput, Error]]: return ( await asyncio_detailed( diff --git a/kittycad/api/file/create_file_center_of_mass.py b/kittycad/api/file/create_file_center_of_mass.py index eb401a429..8f35d32c7 100644 --- a/kittycad/api/file/create_file_center_of_mass.py +++ b/kittycad/api/file/create_file_center_of_mass.py @@ -36,7 +36,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, FileCenterOfMass, Error]]: +) -> Optional[Union[FileCenterOfMass, Error]]: if response.status_code == 201: response_201 = FileCenterOfMass.from_dict(response.json()) return response_201 @@ -46,12 +46,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, FileCenterOfMass, Error]]: +) -> Response[Optional[Union[FileCenterOfMass, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -65,7 +65,7 @@ def sync_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileCenterOfMass, Error]]: +) -> Response[Optional[Union[FileCenterOfMass, Error]]]: kwargs = _get_kwargs( src_format=src_format, body=body, @@ -85,7 +85,7 @@ def sync( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileCenterOfMass, Error]]: +) -> Optional[Union[FileCenterOfMass, Error]]: """Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 @@ -101,7 +101,7 @@ async def asyncio_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileCenterOfMass, Error]]: +) -> Response[Optional[Union[FileCenterOfMass, Error]]]: kwargs = _get_kwargs( src_format=src_format, body=body, @@ -119,7 +119,7 @@ async def asyncio( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileCenterOfMass, Error]]: +) -> Optional[Union[FileCenterOfMass, Error]]: """Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 diff --git a/kittycad/api/file/create_file_conversion.py b/kittycad/api/file/create_file_conversion.py index 238c72cf0..ecfc84167 100644 --- a/kittycad/api/file/create_file_conversion.py +++ b/kittycad/api/file/create_file_conversion.py @@ -35,7 +35,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, FileConversion, Error]]: +) -> Optional[Union[FileConversion, Error]]: if response.status_code == 201: response_201 = FileConversion.from_dict(response.json()) return response_201 @@ -45,12 +45,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, FileConversion, Error]]: +) -> Response[Optional[Union[FileConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -65,7 +65,7 @@ def sync_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileConversion, Error]]: +) -> Response[Optional[Union[FileConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -87,7 +87,7 @@ def sync( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileConversion, Error]]: +) -> Optional[Union[FileConversion, Error]]: """Convert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously. If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 @@ -106,7 +106,7 @@ async def asyncio_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileConversion, Error]]: +) -> Response[Optional[Union[FileConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -126,7 +126,7 @@ async def asyncio( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileConversion, Error]]: +) -> Optional[Union[FileConversion, Error]]: """Convert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously. If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 diff --git a/kittycad/api/file/create_file_density.py b/kittycad/api/file/create_file_density.py index dc44bffef..9446c4363 100644 --- a/kittycad/api/file/create_file_density.py +++ b/kittycad/api/file/create_file_density.py @@ -40,9 +40,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, FileDensity, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[FileDensity, Error]]: if response.status_code == 201: response_201 = FileDensity.from_dict(response.json()) return response_201 @@ -52,12 +50,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, FileDensity, Error]]: +) -> Response[Optional[Union[FileDensity, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -72,7 +70,7 @@ def sync_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileDensity, Error]]: +) -> Response[Optional[Union[FileDensity, Error]]]: kwargs = _get_kwargs( material_mass=material_mass, src_format=src_format, @@ -94,7 +92,7 @@ def sync( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileDensity, Error]]: +) -> Optional[Union[FileDensity, Error]]: """Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 @@ -112,7 +110,7 @@ async def asyncio_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileDensity, Error]]: +) -> Response[Optional[Union[FileDensity, Error]]]: kwargs = _get_kwargs( material_mass=material_mass, src_format=src_format, @@ -132,7 +130,7 @@ async def asyncio( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileDensity, Error]]: +) -> Optional[Union[FileDensity, Error]]: """Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 diff --git a/kittycad/api/file/create_file_mass.py b/kittycad/api/file/create_file_mass.py index fb34a8ba8..a539bf787 100644 --- a/kittycad/api/file/create_file_mass.py +++ b/kittycad/api/file/create_file_mass.py @@ -40,9 +40,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, FileMass, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[FileMass, Error]]: if response.status_code == 201: response_201 = FileMass.from_dict(response.json()) return response_201 @@ -52,12 +50,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, FileMass, Error]]: +) -> Response[Optional[Union[FileMass, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -72,7 +70,7 @@ def sync_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileMass, Error]]: +) -> Response[Optional[Union[FileMass, Error]]]: kwargs = _get_kwargs( material_density=material_density, src_format=src_format, @@ -94,7 +92,7 @@ def sync( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileMass, Error]]: +) -> Optional[Union[FileMass, Error]]: """Get the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 @@ -112,7 +110,7 @@ async def asyncio_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileMass, Error]]: +) -> Response[Optional[Union[FileMass, Error]]]: kwargs = _get_kwargs( material_density=material_density, src_format=src_format, @@ -132,7 +130,7 @@ async def asyncio( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileMass, Error]]: +) -> Optional[Union[FileMass, Error]]: """Get the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 diff --git a/kittycad/api/file/create_file_surface_area.py b/kittycad/api/file/create_file_surface_area.py index 41bcb6824..f6ef09cf8 100644 --- a/kittycad/api/file/create_file_surface_area.py +++ b/kittycad/api/file/create_file_surface_area.py @@ -36,7 +36,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, FileSurfaceArea, Error]]: +) -> Optional[Union[FileSurfaceArea, Error]]: if response.status_code == 201: response_201 = FileSurfaceArea.from_dict(response.json()) return response_201 @@ -46,12 +46,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, FileSurfaceArea, Error]]: +) -> Response[Optional[Union[FileSurfaceArea, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -65,7 +65,7 @@ def sync_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileSurfaceArea, Error]]: +) -> Response[Optional[Union[FileSurfaceArea, Error]]]: kwargs = _get_kwargs( src_format=src_format, body=body, @@ -85,7 +85,7 @@ def sync( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileSurfaceArea, Error]]: +) -> Optional[Union[FileSurfaceArea, Error]]: """Get the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 @@ -101,7 +101,7 @@ async def asyncio_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileSurfaceArea, Error]]: +) -> Response[Optional[Union[FileSurfaceArea, Error]]]: kwargs = _get_kwargs( src_format=src_format, body=body, @@ -119,7 +119,7 @@ async def asyncio( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileSurfaceArea, Error]]: +) -> Optional[Union[FileSurfaceArea, Error]]: """Get the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 diff --git a/kittycad/api/file/create_file_volume.py b/kittycad/api/file/create_file_volume.py index df219d6bd..f90b2ae70 100644 --- a/kittycad/api/file/create_file_volume.py +++ b/kittycad/api/file/create_file_volume.py @@ -34,9 +34,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, FileVolume, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[FileVolume, Error]]: if response.status_code == 201: response_201 = FileVolume.from_dict(response.json()) return response_201 @@ -46,12 +44,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, FileVolume, Error]]: +) -> Response[Optional[Union[FileVolume, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -65,7 +63,7 @@ def sync_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileVolume, Error]]: +) -> Response[Optional[Union[FileVolume, Error]]]: kwargs = _get_kwargs( src_format=src_format, body=body, @@ -85,7 +83,7 @@ def sync( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileVolume, Error]]: +) -> Optional[Union[FileVolume, Error]]: """Get the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 @@ -101,7 +99,7 @@ async def asyncio_detailed( body: bytes, *, client: Client, -) -> Response[Union[Any, FileVolume, Error]]: +) -> Response[Optional[Union[FileVolume, Error]]]: kwargs = _get_kwargs( src_format=src_format, body=body, @@ -119,7 +117,7 @@ async def asyncio( body: bytes, *, client: Client, -) -> Optional[Union[Any, FileVolume, Error]]: +) -> Optional[Union[FileVolume, Error]]: """Get the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501 diff --git a/kittycad/api/hidden/auth_email.py b/kittycad/api/hidden/auth_email.py index 511db5745..127686fae 100644 --- a/kittycad/api/hidden/auth_email.py +++ b/kittycad/api/hidden/auth_email.py @@ -30,7 +30,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, VerificationToken, Error]]: +) -> Optional[Union[VerificationToken, Error]]: if response.status_code == 201: response_201 = VerificationToken.from_dict(response.json()) return response_201 @@ -40,12 +40,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, VerificationToken, Error]]: +) -> Response[Optional[Union[VerificationToken, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -58,7 +58,7 @@ def sync_detailed( body: EmailAuthenticationForm, *, client: Client, -) -> Response[Union[Any, VerificationToken, Error]]: +) -> Response[Optional[Union[VerificationToken, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -76,7 +76,7 @@ def sync( body: EmailAuthenticationForm, *, client: Client, -) -> Optional[Union[Any, VerificationToken, Error]]: +) -> Optional[Union[VerificationToken, Error]]: return sync_detailed( body=body, @@ -88,7 +88,7 @@ async def asyncio_detailed( body: EmailAuthenticationForm, *, client: Client, -) -> Response[Union[Any, VerificationToken, Error]]: +) -> Response[Optional[Union[VerificationToken, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -104,7 +104,7 @@ async def asyncio( body: EmailAuthenticationForm, *, client: Client, -) -> Optional[Union[Any, VerificationToken, Error]]: +) -> Optional[Union[VerificationToken, Error]]: return ( await asyncio_detailed( diff --git a/kittycad/api/hidden/auth_email_callback.py b/kittycad/api/hidden/auth_email_callback.py index c6f22cc65..a7f74df47 100644 --- a/kittycad/api/hidden/auth_email_callback.py +++ b/kittycad/api/hidden/auth_email_callback.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional import httpx @@ -42,20 +42,18 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]: - if response.status_code == 302: - response_302 = None - return response_302 +def _parse_response(*, response: httpx.Response) -> Optional[Error]: + return None if response.status_code == 400: response_4XX = Error.from_dict(response.json()) return response_4XX if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: +def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: return Response( status_code=response.status_code, content=response.content, @@ -70,7 +68,7 @@ def sync_detailed( *, client: Client, callback_url: Optional[str] = None, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( callback_url=callback_url, email=email, @@ -92,7 +90,7 @@ def sync( *, client: Client, callback_url: Optional[str] = None, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: return sync_detailed( callback_url=callback_url, @@ -108,7 +106,7 @@ async def asyncio_detailed( *, client: Client, callback_url: Optional[str] = None, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( callback_url=callback_url, email=email, @@ -128,7 +126,7 @@ async def asyncio( *, client: Client, callback_url: Optional[str] = None, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: return ( await asyncio_detailed( diff --git a/kittycad/api/hidden/logout.py b/kittycad/api/hidden/logout.py index 061fd68b0..fd9c5aea5 100644 --- a/kittycad/api/hidden/logout.py +++ b/kittycad/api/hidden/logout.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional import httpx @@ -24,20 +24,18 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]: - if response.status_code == 204: - response_204 = None - return response_204 +def _parse_response(*, response: httpx.Response) -> Optional[Error]: + return None if response.status_code == 400: response_4XX = Error.from_dict(response.json()) return response_4XX if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: +def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: return Response( status_code=response.status_code, content=response.content, @@ -49,7 +47,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: def sync_detailed( *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( client=client, ) @@ -65,7 +63,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This is used in logout scenarios.""" # noqa: E501 return sync_detailed( @@ -76,7 +74,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( client=client, ) @@ -90,7 +88,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This is used in logout scenarios.""" # noqa: E501 return ( diff --git a/kittycad/api/meta/get_ai_plugin_manifest.py b/kittycad/api/meta/get_ai_plugin_manifest.py index b2d30c16a..fa7e858ca 100644 --- a/kittycad/api/meta/get_ai_plugin_manifest.py +++ b/kittycad/api/meta/get_ai_plugin_manifest.py @@ -27,7 +27,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, AiPluginManifest, Error]]: +) -> Optional[Union[AiPluginManifest, Error]]: if response.status_code == 200: response_200 = AiPluginManifest.from_dict(response.json()) return response_200 @@ -37,12 +37,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, AiPluginManifest, Error]]: +) -> Response[Optional[Union[AiPluginManifest, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +54,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any, AiPluginManifest, Error]]: +) -> Response[Optional[Union[AiPluginManifest, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, AiPluginManifest, Error]]: +) -> Optional[Union[AiPluginManifest, Error]]: return sync_detailed( client=client, @@ -80,7 +80,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, AiPluginManifest, Error]]: +) -> Response[Optional[Union[AiPluginManifest, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -94,7 +94,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, AiPluginManifest, Error]]: +) -> Optional[Union[AiPluginManifest, Error]]: return ( await asyncio_detailed( diff --git a/kittycad/api/meta/get_metadata.py b/kittycad/api/meta/get_metadata.py index 8a69067b4..8769ac7aa 100644 --- a/kittycad/api/meta/get_metadata.py +++ b/kittycad/api/meta/get_metadata.py @@ -25,9 +25,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, Metadata, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[Metadata, Error]]: if response.status_code == 200: response_200 = Metadata.from_dict(response.json()) return response_200 @@ -37,12 +35,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, Metadata, Error]]: +) -> Response[Optional[Union[Metadata, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +52,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any, Metadata, Error]]: +) -> Response[Optional[Union[Metadata, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -70,7 +68,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, Metadata, Error]]: +) -> Optional[Union[Metadata, Error]]: """This includes information on any of our other distributed systems it is connected to. You must be a KittyCAD employee to perform this request.""" # noqa: E501 @@ -82,7 +80,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, Metadata, Error]]: +) -> Response[Optional[Union[Metadata, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -96,7 +94,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, Metadata, Error]]: +) -> Optional[Union[Metadata, Error]]: """This includes information on any of our other distributed systems it is connected to. You must be a KittyCAD employee to perform this request.""" # noqa: E501 diff --git a/kittycad/api/meta/get_openai_schema.py b/kittycad/api/meta/get_openai_schema.py index a3490f9ad..19623cd2d 100644 --- a/kittycad/api/meta/get_openai_schema.py +++ b/kittycad/api/meta/get_openai_schema.py @@ -24,7 +24,7 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, dict, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]]: if response.status_code == 200: response_200 = response.json() return response_200 @@ -34,10 +34,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, dict, Er if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, dict, Error]]: +def _build_response( + *, response: httpx.Response +) -> Response[Optional[Union[dict, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -49,7 +51,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, dict, Er def sync_detailed( *, client: Client, -) -> Response[Union[Any, dict, Error]]: +) -> Response[Optional[Union[dict, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -65,7 +67,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, dict, Error]]: +) -> Optional[Union[dict, Error]]: """This is the same as the OpenAPI schema, BUT it has some modifications to make it compatible with OpenAI. For example, descriptions must be < 300 chars.""" # noqa: E501 return sync_detailed( @@ -76,7 +78,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, dict, Error]]: +) -> Response[Optional[Union[dict, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -90,7 +92,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, dict, Error]]: +) -> Optional[Union[dict, Error]]: """This is the same as the OpenAPI schema, BUT it has some modifications to make it compatible with OpenAI. For example, descriptions must be < 300 chars.""" # noqa: E501 return ( diff --git a/kittycad/api/meta/get_schema.py b/kittycad/api/meta/get_schema.py index 5267bb7fa..5ec2817bf 100644 --- a/kittycad/api/meta/get_schema.py +++ b/kittycad/api/meta/get_schema.py @@ -24,7 +24,7 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, dict, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]]: if response.status_code == 200: response_200 = response.json() return response_200 @@ -34,10 +34,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, dict, Er if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, dict, Error]]: +def _build_response( + *, response: httpx.Response +) -> Response[Optional[Union[dict, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -49,7 +51,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, dict, Er def sync_detailed( *, client: Client, -) -> Response[Union[Any, dict, Error]]: +) -> Response[Optional[Union[dict, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -65,7 +67,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, dict, Error]]: +) -> Optional[Union[dict, Error]]: return sync_detailed( client=client, @@ -75,7 +77,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, dict, Error]]: +) -> Response[Optional[Union[dict, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -89,7 +91,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, dict, Error]]: +) -> Optional[Union[dict, Error]]: return ( await asyncio_detailed( diff --git a/kittycad/api/meta/ping.py b/kittycad/api/meta/ping.py index 525ca28a6..234ca143b 100644 --- a/kittycad/api/meta/ping.py +++ b/kittycad/api/meta/ping.py @@ -25,7 +25,7 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Pong, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[Pong, Error]]: if response.status_code == 200: response_200 = Pong.from_dict(response.json()) return response_200 @@ -35,10 +35,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Pong, Er if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Pong, Error]]: +def _build_response( + *, response: httpx.Response +) -> Response[Optional[Union[Pong, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -50,7 +52,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, Pong, Er def sync_detailed( *, client: Client, -) -> Response[Union[Any, Pong, Error]]: +) -> Response[Optional[Union[Pong, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -66,7 +68,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, Pong, Error]]: +) -> Optional[Union[Pong, Error]]: return sync_detailed( client=client, @@ -76,7 +78,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, Pong, Error]]: +) -> Response[Optional[Union[Pong, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -90,7 +92,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, Pong, Error]]: +) -> Optional[Union[Pong, Error]]: return ( await asyncio_detailed( diff --git a/kittycad/api/payments/create_payment_information_for_user.py b/kittycad/api/payments/create_payment_information_for_user.py index b32904854..e7ab7e6ca 100644 --- a/kittycad/api/payments/create_payment_information_for_user.py +++ b/kittycad/api/payments/create_payment_information_for_user.py @@ -28,9 +28,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, Customer, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]: if response.status_code == 201: response_201 = Customer.from_dict(response.json()) return response_201 @@ -40,12 +38,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, Customer, Error]]: +) -> Response[Optional[Union[Customer, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -58,7 +56,7 @@ def sync_detailed( body: BillingInfo, *, client: Client, -) -> Response[Union[Any, Customer, Error]]: +) -> Response[Optional[Union[Customer, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -76,7 +74,7 @@ def sync( body: BillingInfo, *, client: Client, -) -> Optional[Union[Any, Customer, Error]]: +) -> Optional[Union[Customer, Error]]: """This includes billing address, phone, and name. This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.""" # noqa: E501 @@ -90,7 +88,7 @@ async def asyncio_detailed( body: BillingInfo, *, client: Client, -) -> Response[Union[Any, Customer, Error]]: +) -> Response[Optional[Union[Customer, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -106,7 +104,7 @@ async def asyncio( body: BillingInfo, *, client: Client, -) -> Optional[Union[Any, Customer, Error]]: +) -> Optional[Union[Customer, Error]]: """This includes billing address, phone, and name. This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.""" # noqa: E501 diff --git a/kittycad/api/payments/create_payment_intent_for_user.py b/kittycad/api/payments/create_payment_intent_for_user.py index 2765f5853..fb2b39a80 100644 --- a/kittycad/api/payments/create_payment_intent_for_user.py +++ b/kittycad/api/payments/create_payment_intent_for_user.py @@ -27,7 +27,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, PaymentIntent, Error]]: +) -> Optional[Union[PaymentIntent, Error]]: if response.status_code == 201: response_201 = PaymentIntent.from_dict(response.json()) return response_201 @@ -37,12 +37,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, PaymentIntent, Error]]: +) -> Response[Optional[Union[PaymentIntent, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +54,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any, PaymentIntent, Error]]: +) -> Response[Optional[Union[PaymentIntent, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, PaymentIntent, Error]]: +) -> Optional[Union[PaymentIntent, Error]]: """This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.""" # noqa: E501 return sync_detailed( @@ -81,7 +81,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, PaymentIntent, Error]]: +) -> Response[Optional[Union[PaymentIntent, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -95,7 +95,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, PaymentIntent, Error]]: +) -> Optional[Union[PaymentIntent, Error]]: """This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.""" # noqa: E501 return ( diff --git a/kittycad/api/payments/delete_payment_information_for_user.py b/kittycad/api/payments/delete_payment_information_for_user.py index afe98e3f9..de1079c6b 100644 --- a/kittycad/api/payments/delete_payment_information_for_user.py +++ b/kittycad/api/payments/delete_payment_information_for_user.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional import httpx @@ -24,20 +24,18 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]: - if response.status_code == 204: - response_204 = None - return response_204 +def _parse_response(*, response: httpx.Response) -> Optional[Error]: + return None if response.status_code == 400: response_4XX = Error.from_dict(response.json()) return response_4XX if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: +def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: return Response( status_code=response.status_code, content=response.content, @@ -49,7 +47,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: def sync_detailed( *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( client=client, ) @@ -65,7 +63,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This includes billing address, phone, and name. This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.""" # noqa: E501 @@ -77,7 +75,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( client=client, ) @@ -91,7 +89,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This includes billing address, phone, and name. This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.""" # noqa: E501 diff --git a/kittycad/api/payments/delete_payment_method_for_user.py b/kittycad/api/payments/delete_payment_method_for_user.py index 4a9387a1e..354b250b1 100644 --- a/kittycad/api/payments/delete_payment_method_for_user.py +++ b/kittycad/api/payments/delete_payment_method_for_user.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional import httpx @@ -25,20 +25,18 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]: - if response.status_code == 204: - response_204 = None - return response_204 +def _parse_response(*, response: httpx.Response) -> Optional[Error]: + return None if response.status_code == 400: response_4XX = Error.from_dict(response.json()) return response_4XX if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: +def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: return Response( status_code=response.status_code, content=response.content, @@ -51,7 +49,7 @@ def sync_detailed( id: str, *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( id=id, client=client, @@ -69,7 +67,7 @@ def sync( id: str, *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.""" # noqa: E501 return sync_detailed( @@ -82,7 +80,7 @@ async def asyncio_detailed( id: str, *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( id=id, client=client, @@ -98,7 +96,7 @@ async def asyncio( id: str, *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.""" # noqa: E501 return ( diff --git a/kittycad/api/payments/get_payment_balance_for_user.py b/kittycad/api/payments/get_payment_balance_for_user.py index 0c8d244fa..551191640 100644 --- a/kittycad/api/payments/get_payment_balance_for_user.py +++ b/kittycad/api/payments/get_payment_balance_for_user.py @@ -27,7 +27,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, CustomerBalance, Error]]: +) -> Optional[Union[CustomerBalance, Error]]: if response.status_code == 200: response_200 = CustomerBalance.from_dict(response.json()) return response_200 @@ -37,12 +37,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, CustomerBalance, Error]]: +) -> Response[Optional[Union[CustomerBalance, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +54,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any, CustomerBalance, Error]]: +) -> Response[Optional[Union[CustomerBalance, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, CustomerBalance, Error]]: +) -> Optional[Union[CustomerBalance, Error]]: """This endpoint requires authentication by any KittyCAD user. It gets the balance information for the authenticated user.""" # noqa: E501 return sync_detailed( @@ -81,7 +81,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, CustomerBalance, Error]]: +) -> Response[Optional[Union[CustomerBalance, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -95,7 +95,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, CustomerBalance, Error]]: +) -> Optional[Union[CustomerBalance, Error]]: """This endpoint requires authentication by any KittyCAD user. It gets the balance information for the authenticated user.""" # noqa: E501 return ( diff --git a/kittycad/api/payments/get_payment_information_for_user.py b/kittycad/api/payments/get_payment_information_for_user.py index d1d0e2757..ec2d0dcfa 100644 --- a/kittycad/api/payments/get_payment_information_for_user.py +++ b/kittycad/api/payments/get_payment_information_for_user.py @@ -25,9 +25,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, Customer, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]: if response.status_code == 200: response_200 = Customer.from_dict(response.json()) return response_200 @@ -37,12 +35,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, Customer, Error]]: +) -> Response[Optional[Union[Customer, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +52,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any, Customer, Error]]: +) -> Response[Optional[Union[Customer, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -70,7 +68,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, Customer, Error]]: +) -> Optional[Union[Customer, Error]]: """This includes billing address, phone, and name. This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.""" # noqa: E501 @@ -82,7 +80,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, Customer, Error]]: +) -> Response[Optional[Union[Customer, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -96,7 +94,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, Customer, Error]]: +) -> Optional[Union[Customer, Error]]: """This includes billing address, phone, and name. This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.""" # noqa: E501 diff --git a/kittycad/api/payments/list_invoices_for_user.py b/kittycad/api/payments/list_invoices_for_user.py index 5afe4ad61..75b62c369 100644 --- a/kittycad/api/payments/list_invoices_for_user.py +++ b/kittycad/api/payments/list_invoices_for_user.py @@ -27,7 +27,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, List[Invoice], Error]]: +) -> Optional[Union[List[Invoice], Error]]: if response.status_code == 200: response_200 = [Invoice.from_dict(item) for item in response.json()] return response_200 @@ -37,12 +37,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, List[Invoice], Error]]: +) -> Response[Optional[Union[List[Invoice], Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +54,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any, List[Invoice], Error]]: +) -> Response[Optional[Union[List[Invoice], Error]]]: kwargs = _get_kwargs( client=client, ) @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, List[Invoice], Error]]: +) -> Optional[Union[List[Invoice], Error]]: """This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.""" # noqa: E501 return sync_detailed( @@ -81,7 +81,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, List[Invoice], Error]]: +) -> Response[Optional[Union[List[Invoice], Error]]]: kwargs = _get_kwargs( client=client, ) @@ -95,7 +95,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, List[Invoice], Error]]: +) -> Optional[Union[List[Invoice], Error]]: """This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.""" # noqa: E501 return ( diff --git a/kittycad/api/payments/list_payment_methods_for_user.py b/kittycad/api/payments/list_payment_methods_for_user.py index 36ac907e6..4b70f76f7 100644 --- a/kittycad/api/payments/list_payment_methods_for_user.py +++ b/kittycad/api/payments/list_payment_methods_for_user.py @@ -27,7 +27,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, List[PaymentMethod], Error]]: +) -> Optional[Union[List[PaymentMethod], Error]]: if response.status_code == 200: response_200 = [PaymentMethod.from_dict(item) for item in response.json()] return response_200 @@ -37,12 +37,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, List[PaymentMethod], Error]]: +) -> Response[Optional[Union[List[PaymentMethod], Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +54,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any, List[PaymentMethod], Error]]: +) -> Response[Optional[Union[List[PaymentMethod], Error]]]: kwargs = _get_kwargs( client=client, ) @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, List[PaymentMethod], Error]]: +) -> Optional[Union[List[PaymentMethod], Error]]: """This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.""" # noqa: E501 return sync_detailed( @@ -81,7 +81,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, List[PaymentMethod], Error]]: +) -> Response[Optional[Union[List[PaymentMethod], Error]]]: kwargs = _get_kwargs( client=client, ) @@ -95,7 +95,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, List[PaymentMethod], Error]]: +) -> Optional[Union[List[PaymentMethod], Error]]: """This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.""" # noqa: E501 return ( diff --git a/kittycad/api/payments/update_payment_information_for_user.py b/kittycad/api/payments/update_payment_information_for_user.py index d7b537881..6e6fc748b 100644 --- a/kittycad/api/payments/update_payment_information_for_user.py +++ b/kittycad/api/payments/update_payment_information_for_user.py @@ -28,9 +28,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, Customer, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]: if response.status_code == 200: response_200 = Customer.from_dict(response.json()) return response_200 @@ -40,12 +38,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, Customer, Error]]: +) -> Response[Optional[Union[Customer, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -58,7 +56,7 @@ def sync_detailed( body: BillingInfo, *, client: Client, -) -> Response[Union[Any, Customer, Error]]: +) -> Response[Optional[Union[Customer, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -76,7 +74,7 @@ def sync( body: BillingInfo, *, client: Client, -) -> Optional[Union[Any, Customer, Error]]: +) -> Optional[Union[Customer, Error]]: """This includes billing address, phone, and name. This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.""" # noqa: E501 @@ -90,7 +88,7 @@ async def asyncio_detailed( body: BillingInfo, *, client: Client, -) -> Response[Union[Any, Customer, Error]]: +) -> Response[Optional[Union[Customer, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -106,7 +104,7 @@ async def asyncio( body: BillingInfo, *, client: Client, -) -> Optional[Union[Any, Customer, Error]]: +) -> Optional[Union[Customer, Error]]: """This includes billing address, phone, and name. This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.""" # noqa: E501 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 c4f4fa0e4..657a3b034 100644 --- a/kittycad/api/payments/validate_customer_tax_information_for_user.py +++ b/kittycad/api/payments/validate_customer_tax_information_for_user.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional import httpx @@ -24,20 +24,18 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]: - if response.status_code == 204: - response_204 = None - return response_204 +def _parse_response(*, response: httpx.Response) -> Optional[Error]: + return None if response.status_code == 400: response_4XX = Error.from_dict(response.json()) return response_4XX if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: +def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: return Response( status_code=response.status_code, content=response.content, @@ -49,7 +47,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: def sync_detailed( *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( client=client, ) @@ -65,7 +63,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This endpoint requires authentication by any KittyCAD user. It will return an error if the customer's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501 return sync_detailed( @@ -76,7 +74,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( client=client, ) @@ -90,7 +88,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This endpoint requires authentication by any KittyCAD user. It will return an error if the customer's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_acceleration_unit_conversion.py b/kittycad/api/unit/get_acceleration_unit_conversion.py index 35d76da3c..c2b57bba3 100644 --- a/kittycad/api/unit/get_acceleration_unit_conversion.py +++ b/kittycad/api/unit/get_acceleration_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitAccelerationConversion, Error]]: +) -> Optional[Union[UnitAccelerationConversion, Error]]: if response.status_code == 200: response_200 = UnitAccelerationConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitAccelerationConversion, Error]]: +) -> Response[Optional[Union[UnitAccelerationConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitAccelerationConversion, Error]]: +) -> Response[Optional[Union[UnitAccelerationConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitAccelerationConversion, Error]]: +) -> Optional[Union[UnitAccelerationConversion, Error]]: """Convert an acceleration unit value to another acceleration unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitAccelerationConversion, Error]]: +) -> Response[Optional[Union[UnitAccelerationConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitAccelerationConversion, Error]]: +) -> Optional[Union[UnitAccelerationConversion, Error]]: """Convert an acceleration unit value to another acceleration unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_angle_unit_conversion.py b/kittycad/api/unit/get_angle_unit_conversion.py index fd69b5970..c3a38c0d0 100644 --- a/kittycad/api/unit/get_angle_unit_conversion.py +++ b/kittycad/api/unit/get_angle_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitAngleConversion, Error]]: +) -> Optional[Union[UnitAngleConversion, Error]]: if response.status_code == 200: response_200 = UnitAngleConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitAngleConversion, Error]]: +) -> Response[Optional[Union[UnitAngleConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitAngleConversion, Error]]: +) -> Response[Optional[Union[UnitAngleConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitAngleConversion, Error]]: +) -> Optional[Union[UnitAngleConversion, Error]]: """Convert an angle unit value to another angle unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitAngleConversion, Error]]: +) -> Response[Optional[Union[UnitAngleConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitAngleConversion, Error]]: +) -> Optional[Union[UnitAngleConversion, Error]]: """Convert an angle unit value to another angle unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_angular_velocity_unit_conversion.py b/kittycad/api/unit/get_angular_velocity_unit_conversion.py index 80e7f5737..a3b95122e 100644 --- a/kittycad/api/unit/get_angular_velocity_unit_conversion.py +++ b/kittycad/api/unit/get_angular_velocity_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitAngularVelocityConversion, Error]]: +) -> Optional[Union[UnitAngularVelocityConversion, Error]]: if response.status_code == 200: response_200 = UnitAngularVelocityConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitAngularVelocityConversion, Error]]: +) -> Response[Optional[Union[UnitAngularVelocityConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitAngularVelocityConversion, Error]]: +) -> Response[Optional[Union[UnitAngularVelocityConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitAngularVelocityConversion, Error]]: +) -> Optional[Union[UnitAngularVelocityConversion, Error]]: """Convert an angular velocity unit value to another angular velocity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitAngularVelocityConversion, Error]]: +) -> Response[Optional[Union[UnitAngularVelocityConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitAngularVelocityConversion, Error]]: +) -> Optional[Union[UnitAngularVelocityConversion, Error]]: """Convert an angular velocity unit value to another angular velocity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_area_unit_conversion.py b/kittycad/api/unit/get_area_unit_conversion.py index 5cbe9b132..7349a6dd8 100644 --- a/kittycad/api/unit/get_area_unit_conversion.py +++ b/kittycad/api/unit/get_area_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitAreaConversion, Error]]: +) -> Optional[Union[UnitAreaConversion, Error]]: if response.status_code == 200: response_200 = UnitAreaConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitAreaConversion, Error]]: +) -> Response[Optional[Union[UnitAreaConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitAreaConversion, Error]]: +) -> Response[Optional[Union[UnitAreaConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitAreaConversion, Error]]: +) -> Optional[Union[UnitAreaConversion, Error]]: """Convert an area unit value to another area unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitAreaConversion, Error]]: +) -> Response[Optional[Union[UnitAreaConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitAreaConversion, Error]]: +) -> Optional[Union[UnitAreaConversion, Error]]: """Convert an area unit value to another area unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_charge_unit_conversion.py b/kittycad/api/unit/get_charge_unit_conversion.py index 583e097de..17388feb9 100644 --- a/kittycad/api/unit/get_charge_unit_conversion.py +++ b/kittycad/api/unit/get_charge_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitChargeConversion, Error]]: +) -> Optional[Union[UnitChargeConversion, Error]]: if response.status_code == 200: response_200 = UnitChargeConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitChargeConversion, Error]]: +) -> Response[Optional[Union[UnitChargeConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitChargeConversion, Error]]: +) -> Response[Optional[Union[UnitChargeConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitChargeConversion, Error]]: +) -> Optional[Union[UnitChargeConversion, Error]]: """Convert a charge unit value to another charge unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitChargeConversion, Error]]: +) -> Response[Optional[Union[UnitChargeConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitChargeConversion, Error]]: +) -> Optional[Union[UnitChargeConversion, Error]]: """Convert a charge unit value to another charge unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_concentration_unit_conversion.py b/kittycad/api/unit/get_concentration_unit_conversion.py index e296dbcdc..3409567a5 100644 --- a/kittycad/api/unit/get_concentration_unit_conversion.py +++ b/kittycad/api/unit/get_concentration_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitConcentrationConversion, Error]]: +) -> Optional[Union[UnitConcentrationConversion, Error]]: if response.status_code == 200: response_200 = UnitConcentrationConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitConcentrationConversion, Error]]: +) -> Response[Optional[Union[UnitConcentrationConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitConcentrationConversion, Error]]: +) -> Response[Optional[Union[UnitConcentrationConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitConcentrationConversion, Error]]: +) -> Optional[Union[UnitConcentrationConversion, Error]]: """Convert a concentration unit value to another concentration unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitConcentrationConversion, Error]]: +) -> Response[Optional[Union[UnitConcentrationConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitConcentrationConversion, Error]]: +) -> Optional[Union[UnitConcentrationConversion, Error]]: """Convert a concentration unit value to another concentration unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_data_transfer_rate_unit_conversion.py b/kittycad/api/unit/get_data_transfer_rate_unit_conversion.py index 1ea1cdb05..a26f7e66a 100644 --- a/kittycad/api/unit/get_data_transfer_rate_unit_conversion.py +++ b/kittycad/api/unit/get_data_transfer_rate_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitDataTransferRateConversion, Error]]: +) -> Optional[Union[UnitDataTransferRateConversion, Error]]: if response.status_code == 200: response_200 = UnitDataTransferRateConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitDataTransferRateConversion, Error]]: +) -> Response[Optional[Union[UnitDataTransferRateConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitDataTransferRateConversion, Error]]: +) -> Response[Optional[Union[UnitDataTransferRateConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitDataTransferRateConversion, Error]]: +) -> Optional[Union[UnitDataTransferRateConversion, Error]]: """Convert a data transfer rate unit value to another data transfer rate unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitDataTransferRateConversion, Error]]: +) -> Response[Optional[Union[UnitDataTransferRateConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitDataTransferRateConversion, Error]]: +) -> Optional[Union[UnitDataTransferRateConversion, Error]]: """Convert a data transfer rate unit value to another data transfer rate unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_data_unit_conversion.py b/kittycad/api/unit/get_data_unit_conversion.py index 652c38b68..2a31b04d3 100644 --- a/kittycad/api/unit/get_data_unit_conversion.py +++ b/kittycad/api/unit/get_data_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitDataConversion, Error]]: +) -> Optional[Union[UnitDataConversion, Error]]: if response.status_code == 200: response_200 = UnitDataConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitDataConversion, Error]]: +) -> Response[Optional[Union[UnitDataConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitDataConversion, Error]]: +) -> Response[Optional[Union[UnitDataConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitDataConversion, Error]]: +) -> Optional[Union[UnitDataConversion, Error]]: """Convert a data unit value to another data unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitDataConversion, Error]]: +) -> Response[Optional[Union[UnitDataConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitDataConversion, Error]]: +) -> Optional[Union[UnitDataConversion, Error]]: """Convert a data unit value to another data unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_density_unit_conversion.py b/kittycad/api/unit/get_density_unit_conversion.py index d41dbcd5e..3baff6a55 100644 --- a/kittycad/api/unit/get_density_unit_conversion.py +++ b/kittycad/api/unit/get_density_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitDensityConversion, Error]]: +) -> Optional[Union[UnitDensityConversion, Error]]: if response.status_code == 200: response_200 = UnitDensityConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitDensityConversion, Error]]: +) -> Response[Optional[Union[UnitDensityConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitDensityConversion, Error]]: +) -> Response[Optional[Union[UnitDensityConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitDensityConversion, Error]]: +) -> Optional[Union[UnitDensityConversion, Error]]: """Convert a density unit value to another density unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitDensityConversion, Error]]: +) -> Response[Optional[Union[UnitDensityConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitDensityConversion, Error]]: +) -> Optional[Union[UnitDensityConversion, Error]]: """Convert a density unit value to another density unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_energy_unit_conversion.py b/kittycad/api/unit/get_energy_unit_conversion.py index 7fc10bad5..de84fa187 100644 --- a/kittycad/api/unit/get_energy_unit_conversion.py +++ b/kittycad/api/unit/get_energy_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitEnergyConversion, Error]]: +) -> Optional[Union[UnitEnergyConversion, Error]]: if response.status_code == 200: response_200 = UnitEnergyConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitEnergyConversion, Error]]: +) -> Response[Optional[Union[UnitEnergyConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitEnergyConversion, Error]]: +) -> Response[Optional[Union[UnitEnergyConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitEnergyConversion, Error]]: +) -> Optional[Union[UnitEnergyConversion, Error]]: """Convert a energy unit value to another energy unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitEnergyConversion, Error]]: +) -> Response[Optional[Union[UnitEnergyConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitEnergyConversion, Error]]: +) -> Optional[Union[UnitEnergyConversion, Error]]: """Convert a energy unit value to another energy unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_force_unit_conversion.py b/kittycad/api/unit/get_force_unit_conversion.py index 2456c10f6..f62fe7336 100644 --- a/kittycad/api/unit/get_force_unit_conversion.py +++ b/kittycad/api/unit/get_force_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitForceConversion, Error]]: +) -> Optional[Union[UnitForceConversion, Error]]: if response.status_code == 200: response_200 = UnitForceConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitForceConversion, Error]]: +) -> Response[Optional[Union[UnitForceConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitForceConversion, Error]]: +) -> Response[Optional[Union[UnitForceConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitForceConversion, Error]]: +) -> Optional[Union[UnitForceConversion, Error]]: """Convert a force unit value to another force unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitForceConversion, Error]]: +) -> Response[Optional[Union[UnitForceConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitForceConversion, Error]]: +) -> Optional[Union[UnitForceConversion, Error]]: """Convert a force unit value to another force unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_illuminance_unit_conversion.py b/kittycad/api/unit/get_illuminance_unit_conversion.py index 3799e3e31..067161fbd 100644 --- a/kittycad/api/unit/get_illuminance_unit_conversion.py +++ b/kittycad/api/unit/get_illuminance_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitIlluminanceConversion, Error]]: +) -> Optional[Union[UnitIlluminanceConversion, Error]]: if response.status_code == 200: response_200 = UnitIlluminanceConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitIlluminanceConversion, Error]]: +) -> Response[Optional[Union[UnitIlluminanceConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitIlluminanceConversion, Error]]: +) -> Response[Optional[Union[UnitIlluminanceConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitIlluminanceConversion, Error]]: +) -> Optional[Union[UnitIlluminanceConversion, Error]]: """Convert a illuminance unit value to another illuminance unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitIlluminanceConversion, Error]]: +) -> Response[Optional[Union[UnitIlluminanceConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitIlluminanceConversion, Error]]: +) -> Optional[Union[UnitIlluminanceConversion, Error]]: """Convert a illuminance unit value to another illuminance unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_length_unit_conversion.py b/kittycad/api/unit/get_length_unit_conversion.py index bd23922e0..ee4d504bc 100644 --- a/kittycad/api/unit/get_length_unit_conversion.py +++ b/kittycad/api/unit/get_length_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitLengthConversion, Error]]: +) -> Optional[Union[UnitLengthConversion, Error]]: if response.status_code == 200: response_200 = UnitLengthConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitLengthConversion, Error]]: +) -> Response[Optional[Union[UnitLengthConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitLengthConversion, Error]]: +) -> Response[Optional[Union[UnitLengthConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitLengthConversion, Error]]: +) -> Optional[Union[UnitLengthConversion, Error]]: """Convert a length unit value to another length unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitLengthConversion, Error]]: +) -> Response[Optional[Union[UnitLengthConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitLengthConversion, Error]]: +) -> Optional[Union[UnitLengthConversion, Error]]: """Convert a length unit value to another length unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_magnetic_field_strength_unit_conversion.py b/kittycad/api/unit/get_magnetic_field_strength_unit_conversion.py index 37343722b..812d8dcef 100644 --- a/kittycad/api/unit/get_magnetic_field_strength_unit_conversion.py +++ b/kittycad/api/unit/get_magnetic_field_strength_unit_conversion.py @@ -42,7 +42,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitMagneticFieldStrengthConversion, Error]]: +) -> Optional[Union[UnitMagneticFieldStrengthConversion, Error]]: if response.status_code == 200: response_200 = UnitMagneticFieldStrengthConversion.from_dict(response.json()) return response_200 @@ -52,12 +52,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitMagneticFieldStrengthConversion, Error]]: +) -> Response[Optional[Union[UnitMagneticFieldStrengthConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -72,7 +72,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMagneticFieldStrengthConversion, Error]]: +) -> Response[Optional[Union[UnitMagneticFieldStrengthConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -94,7 +94,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMagneticFieldStrengthConversion, Error]]: +) -> Optional[Union[UnitMagneticFieldStrengthConversion, Error]]: """Convert a magnetic field strength unit value to another magnetic field strength unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -111,7 +111,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMagneticFieldStrengthConversion, Error]]: +) -> Response[Optional[Union[UnitMagneticFieldStrengthConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -131,7 +131,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMagneticFieldStrengthConversion, Error]]: +) -> Optional[Union[UnitMagneticFieldStrengthConversion, Error]]: """Convert a magnetic field strength unit value to another magnetic field strength unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_magnetic_flux_unit_conversion.py b/kittycad/api/unit/get_magnetic_flux_unit_conversion.py index 1ca3126e1..3196911e6 100644 --- a/kittycad/api/unit/get_magnetic_flux_unit_conversion.py +++ b/kittycad/api/unit/get_magnetic_flux_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitMagneticFluxConversion, Error]]: +) -> Optional[Union[UnitMagneticFluxConversion, Error]]: if response.status_code == 200: response_200 = UnitMagneticFluxConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitMagneticFluxConversion, Error]]: +) -> Response[Optional[Union[UnitMagneticFluxConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMagneticFluxConversion, Error]]: +) -> Response[Optional[Union[UnitMagneticFluxConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMagneticFluxConversion, Error]]: +) -> Optional[Union[UnitMagneticFluxConversion, Error]]: """Convert a magnetic flux unit value to another magnetic flux unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMagneticFluxConversion, Error]]: +) -> Response[Optional[Union[UnitMagneticFluxConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMagneticFluxConversion, Error]]: +) -> Optional[Union[UnitMagneticFluxConversion, Error]]: """Convert a magnetic flux unit value to another magnetic flux unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_mass_unit_conversion.py b/kittycad/api/unit/get_mass_unit_conversion.py index 840abb6ad..f5850d759 100644 --- a/kittycad/api/unit/get_mass_unit_conversion.py +++ b/kittycad/api/unit/get_mass_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitMassConversion, Error]]: +) -> Optional[Union[UnitMassConversion, Error]]: if response.status_code == 200: response_200 = UnitMassConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitMassConversion, Error]]: +) -> Response[Optional[Union[UnitMassConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMassConversion, Error]]: +) -> Response[Optional[Union[UnitMassConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMassConversion, Error]]: +) -> Optional[Union[UnitMassConversion, Error]]: """Convert a mass unit value to another mass unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMassConversion, Error]]: +) -> Response[Optional[Union[UnitMassConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMassConversion, Error]]: +) -> Optional[Union[UnitMassConversion, Error]]: """Convert a mass unit value to another mass unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_metric_power_cubed_unit_conversion.py b/kittycad/api/unit/get_metric_power_cubed_unit_conversion.py index 83e39295f..ffecee030 100644 --- a/kittycad/api/unit/get_metric_power_cubed_unit_conversion.py +++ b/kittycad/api/unit/get_metric_power_cubed_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitMetricPowerCubedConversion, Error]]: +) -> Optional[Union[UnitMetricPowerCubedConversion, Error]]: if response.status_code == 200: response_200 = UnitMetricPowerCubedConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitMetricPowerCubedConversion, Error]]: +) -> Response[Optional[Union[UnitMetricPowerCubedConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMetricPowerCubedConversion, Error]]: +) -> Response[Optional[Union[UnitMetricPowerCubedConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMetricPowerCubedConversion, Error]]: +) -> Optional[Union[UnitMetricPowerCubedConversion, Error]]: """Convert a metric cubed unit value to another metric cubed unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMetricPowerCubedConversion, Error]]: +) -> Response[Optional[Union[UnitMetricPowerCubedConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMetricPowerCubedConversion, Error]]: +) -> Optional[Union[UnitMetricPowerCubedConversion, Error]]: """Convert a metric cubed unit value to another metric cubed unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_metric_power_squared_unit_conversion.py b/kittycad/api/unit/get_metric_power_squared_unit_conversion.py index 1ada4d4b7..75b696e67 100644 --- a/kittycad/api/unit/get_metric_power_squared_unit_conversion.py +++ b/kittycad/api/unit/get_metric_power_squared_unit_conversion.py @@ -40,7 +40,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitMetricPowerSquaredConversion, Error]]: +) -> Optional[Union[UnitMetricPowerSquaredConversion, Error]]: if response.status_code == 200: response_200 = UnitMetricPowerSquaredConversion.from_dict(response.json()) return response_200 @@ -50,12 +50,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitMetricPowerSquaredConversion, Error]]: +) -> Response[Optional[Union[UnitMetricPowerSquaredConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -70,7 +70,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMetricPowerSquaredConversion, Error]]: +) -> Response[Optional[Union[UnitMetricPowerSquaredConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -92,7 +92,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMetricPowerSquaredConversion, Error]]: +) -> Optional[Union[UnitMetricPowerSquaredConversion, Error]]: """Convert a metric squared unit value to another metric squared unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -109,7 +109,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMetricPowerSquaredConversion, Error]]: +) -> Response[Optional[Union[UnitMetricPowerSquaredConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -129,7 +129,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMetricPowerSquaredConversion, Error]]: +) -> Optional[Union[UnitMetricPowerSquaredConversion, Error]]: """Convert a metric squared unit value to another metric squared unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_metric_power_unit_conversion.py b/kittycad/api/unit/get_metric_power_unit_conversion.py index 998b93b18..3a9c583f8 100644 --- a/kittycad/api/unit/get_metric_power_unit_conversion.py +++ b/kittycad/api/unit/get_metric_power_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitMetricPowerConversion, Error]]: +) -> Optional[Union[UnitMetricPowerConversion, Error]]: if response.status_code == 200: response_200 = UnitMetricPowerConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitMetricPowerConversion, Error]]: +) -> Response[Optional[Union[UnitMetricPowerConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMetricPowerConversion, Error]]: +) -> Response[Optional[Union[UnitMetricPowerConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMetricPowerConversion, Error]]: +) -> Optional[Union[UnitMetricPowerConversion, Error]]: """Convert a metric unit value to another metric unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitMetricPowerConversion, Error]]: +) -> Response[Optional[Union[UnitMetricPowerConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitMetricPowerConversion, Error]]: +) -> Optional[Union[UnitMetricPowerConversion, Error]]: """Convert a metric unit value to another metric unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_power_unit_conversion.py b/kittycad/api/unit/get_power_unit_conversion.py index 741533bf5..530da8634 100644 --- a/kittycad/api/unit/get_power_unit_conversion.py +++ b/kittycad/api/unit/get_power_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitPowerConversion, Error]]: +) -> Optional[Union[UnitPowerConversion, Error]]: if response.status_code == 200: response_200 = UnitPowerConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitPowerConversion, Error]]: +) -> Response[Optional[Union[UnitPowerConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitPowerConversion, Error]]: +) -> Response[Optional[Union[UnitPowerConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitPowerConversion, Error]]: +) -> Optional[Union[UnitPowerConversion, Error]]: """Convert a power unit value to another power unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitPowerConversion, Error]]: +) -> Response[Optional[Union[UnitPowerConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitPowerConversion, Error]]: +) -> Optional[Union[UnitPowerConversion, Error]]: """Convert a power unit value to another power unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_pressure_unit_conversion.py b/kittycad/api/unit/get_pressure_unit_conversion.py index 3687eb5fa..fab14f329 100644 --- a/kittycad/api/unit/get_pressure_unit_conversion.py +++ b/kittycad/api/unit/get_pressure_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitPressureConversion, Error]]: +) -> Optional[Union[UnitPressureConversion, Error]]: if response.status_code == 200: response_200 = UnitPressureConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitPressureConversion, Error]]: +) -> Response[Optional[Union[UnitPressureConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitPressureConversion, Error]]: +) -> Response[Optional[Union[UnitPressureConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitPressureConversion, Error]]: +) -> Optional[Union[UnitPressureConversion, Error]]: """Convert a pressure unit value to another pressure unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitPressureConversion, Error]]: +) -> Response[Optional[Union[UnitPressureConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitPressureConversion, Error]]: +) -> Optional[Union[UnitPressureConversion, Error]]: """Convert a pressure unit value to another pressure unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_radiation_unit_conversion.py b/kittycad/api/unit/get_radiation_unit_conversion.py index 5eab5c8df..ca8ac661e 100644 --- a/kittycad/api/unit/get_radiation_unit_conversion.py +++ b/kittycad/api/unit/get_radiation_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitRadiationConversion, Error]]: +) -> Optional[Union[UnitRadiationConversion, Error]]: if response.status_code == 200: response_200 = UnitRadiationConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitRadiationConversion, Error]]: +) -> Response[Optional[Union[UnitRadiationConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitRadiationConversion, Error]]: +) -> Response[Optional[Union[UnitRadiationConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitRadiationConversion, Error]]: +) -> Optional[Union[UnitRadiationConversion, Error]]: """Convert a radiation unit value to another radiation unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitRadiationConversion, Error]]: +) -> Response[Optional[Union[UnitRadiationConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitRadiationConversion, Error]]: +) -> Optional[Union[UnitRadiationConversion, Error]]: """Convert a radiation unit value to another radiation unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_radioactivity_unit_conversion.py b/kittycad/api/unit/get_radioactivity_unit_conversion.py index 2e58f98fc..0340bef5e 100644 --- a/kittycad/api/unit/get_radioactivity_unit_conversion.py +++ b/kittycad/api/unit/get_radioactivity_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitRadioactivityConversion, Error]]: +) -> Optional[Union[UnitRadioactivityConversion, Error]]: if response.status_code == 200: response_200 = UnitRadioactivityConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitRadioactivityConversion, Error]]: +) -> Response[Optional[Union[UnitRadioactivityConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitRadioactivityConversion, Error]]: +) -> Response[Optional[Union[UnitRadioactivityConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitRadioactivityConversion, Error]]: +) -> Optional[Union[UnitRadioactivityConversion, Error]]: """Convert a radioactivity unit value to another radioactivity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitRadioactivityConversion, Error]]: +) -> Response[Optional[Union[UnitRadioactivityConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitRadioactivityConversion, Error]]: +) -> Optional[Union[UnitRadioactivityConversion, Error]]: """Convert a radioactivity unit value to another radioactivity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_solid_angle_unit_conversion.py b/kittycad/api/unit/get_solid_angle_unit_conversion.py index 4c38cbfc4..17baec75b 100644 --- a/kittycad/api/unit/get_solid_angle_unit_conversion.py +++ b/kittycad/api/unit/get_solid_angle_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitSolidAngleConversion, Error]]: +) -> Optional[Union[UnitSolidAngleConversion, Error]]: if response.status_code == 200: response_200 = UnitSolidAngleConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitSolidAngleConversion, Error]]: +) -> Response[Optional[Union[UnitSolidAngleConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitSolidAngleConversion, Error]]: +) -> Response[Optional[Union[UnitSolidAngleConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitSolidAngleConversion, Error]]: +) -> Optional[Union[UnitSolidAngleConversion, Error]]: """Convert a solid angle unit value to another solid angle unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitSolidAngleConversion, Error]]: +) -> Response[Optional[Union[UnitSolidAngleConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitSolidAngleConversion, Error]]: +) -> Optional[Union[UnitSolidAngleConversion, Error]]: """Convert a solid angle unit value to another solid angle unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_temperature_unit_conversion.py b/kittycad/api/unit/get_temperature_unit_conversion.py index 618b29350..6927b3223 100644 --- a/kittycad/api/unit/get_temperature_unit_conversion.py +++ b/kittycad/api/unit/get_temperature_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitTemperatureConversion, Error]]: +) -> Optional[Union[UnitTemperatureConversion, Error]]: if response.status_code == 200: response_200 = UnitTemperatureConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitTemperatureConversion, Error]]: +) -> Response[Optional[Union[UnitTemperatureConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitTemperatureConversion, Error]]: +) -> Response[Optional[Union[UnitTemperatureConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitTemperatureConversion, Error]]: +) -> Optional[Union[UnitTemperatureConversion, Error]]: """Convert a temperature unit value to another temperature unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitTemperatureConversion, Error]]: +) -> Response[Optional[Union[UnitTemperatureConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitTemperatureConversion, Error]]: +) -> Optional[Union[UnitTemperatureConversion, Error]]: """Convert a temperature unit value to another temperature unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_time_unit_conversion.py b/kittycad/api/unit/get_time_unit_conversion.py index 925bdacdf..93890afe3 100644 --- a/kittycad/api/unit/get_time_unit_conversion.py +++ b/kittycad/api/unit/get_time_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitTimeConversion, Error]]: +) -> Optional[Union[UnitTimeConversion, Error]]: if response.status_code == 200: response_200 = UnitTimeConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitTimeConversion, Error]]: +) -> Response[Optional[Union[UnitTimeConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitTimeConversion, Error]]: +) -> Response[Optional[Union[UnitTimeConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitTimeConversion, Error]]: +) -> Optional[Union[UnitTimeConversion, Error]]: """Convert a time unit value to another time unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitTimeConversion, Error]]: +) -> Response[Optional[Union[UnitTimeConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitTimeConversion, Error]]: +) -> Optional[Union[UnitTimeConversion, Error]]: """Convert a time unit value to another time unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_velocity_unit_conversion.py b/kittycad/api/unit/get_velocity_unit_conversion.py index bb3c288b4..7712ad4f7 100644 --- a/kittycad/api/unit/get_velocity_unit_conversion.py +++ b/kittycad/api/unit/get_velocity_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitVelocityConversion, Error]]: +) -> Optional[Union[UnitVelocityConversion, Error]]: if response.status_code == 200: response_200 = UnitVelocityConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitVelocityConversion, Error]]: +) -> Response[Optional[Union[UnitVelocityConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitVelocityConversion, Error]]: +) -> Response[Optional[Union[UnitVelocityConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitVelocityConversion, Error]]: +) -> Optional[Union[UnitVelocityConversion, Error]]: """Convert a velocity unit value to another velocity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitVelocityConversion, Error]]: +) -> Response[Optional[Union[UnitVelocityConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitVelocityConversion, Error]]: +) -> Optional[Union[UnitVelocityConversion, Error]]: """Convert a velocity unit value to another velocity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_voltage_unit_conversion.py b/kittycad/api/unit/get_voltage_unit_conversion.py index c325d622e..9d04210bf 100644 --- a/kittycad/api/unit/get_voltage_unit_conversion.py +++ b/kittycad/api/unit/get_voltage_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitVoltageConversion, Error]]: +) -> Optional[Union[UnitVoltageConversion, Error]]: if response.status_code == 200: response_200 = UnitVoltageConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitVoltageConversion, Error]]: +) -> Response[Optional[Union[UnitVoltageConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitVoltageConversion, Error]]: +) -> Response[Optional[Union[UnitVoltageConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitVoltageConversion, Error]]: +) -> Optional[Union[UnitVoltageConversion, Error]]: """Convert a voltage unit value to another voltage unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitVoltageConversion, Error]]: +) -> Response[Optional[Union[UnitVoltageConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitVoltageConversion, Error]]: +) -> Optional[Union[UnitVoltageConversion, Error]]: """Convert a voltage unit value to another voltage unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/unit/get_volume_unit_conversion.py b/kittycad/api/unit/get_volume_unit_conversion.py index 2006e71f9..d4dbec768 100644 --- a/kittycad/api/unit/get_volume_unit_conversion.py +++ b/kittycad/api/unit/get_volume_unit_conversion.py @@ -38,7 +38,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UnitVolumeConversion, Error]]: +) -> Optional[Union[UnitVolumeConversion, Error]]: if response.status_code == 200: response_200 = UnitVolumeConversion.from_dict(response.json()) return response_200 @@ -48,12 +48,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UnitVolumeConversion, Error]]: +) -> Response[Optional[Union[UnitVolumeConversion, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -68,7 +68,7 @@ def sync_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitVolumeConversion, Error]]: +) -> Response[Optional[Union[UnitVolumeConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -90,7 +90,7 @@ def sync( value: float, *, client: Client, -) -> Optional[Union[Any, UnitVolumeConversion, Error]]: +) -> Optional[Union[UnitVolumeConversion, Error]]: """Convert a volume unit value to another volume unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return sync_detailed( @@ -107,7 +107,7 @@ async def asyncio_detailed( value: float, *, client: Client, -) -> Response[Union[Any, UnitVolumeConversion, Error]]: +) -> Response[Optional[Union[UnitVolumeConversion, Error]]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -127,7 +127,7 @@ async def asyncio( value: float, *, client: Client, -) -> Optional[Union[Any, UnitVolumeConversion, Error]]: +) -> Optional[Union[UnitVolumeConversion, Error]]: """Convert a volume unit value to another volume unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 return ( diff --git a/kittycad/api/users/delete_user_self.py b/kittycad/api/users/delete_user_self.py index c0ef2cae6..7d9d1797f 100644 --- a/kittycad/api/users/delete_user_self.py +++ b/kittycad/api/users/delete_user_self.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional import httpx @@ -24,20 +24,18 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]: - if response.status_code == 204: - response_204 = None - return response_204 +def _parse_response(*, response: httpx.Response) -> Optional[Error]: + return None if response.status_code == 400: response_4XX = Error.from_dict(response.json()) return response_4XX if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: +def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]: return Response( status_code=response.status_code, content=response.content, @@ -49,7 +47,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]: def sync_detailed( *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( client=client, ) @@ -65,7 +63,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This endpoint requires authentication by any KittyCAD user. It deletes the authenticated user from KittyCAD's database. This call will only succeed if all invoices associated with the user have been paid in full and there is no outstanding balance.""" # noqa: E501 @@ -77,7 +75,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, Error]]: +) -> Response[Optional[Error]]: kwargs = _get_kwargs( client=client, ) @@ -91,7 +89,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, Error]]: +) -> Optional[Error]: """This endpoint requires authentication by any KittyCAD user. It deletes the authenticated user from KittyCAD's database. This call will only succeed if all invoices associated with the user have been paid in full and there is no outstanding balance.""" # noqa: E501 diff --git a/kittycad/api/users/get_session_for_user.py b/kittycad/api/users/get_session_for_user.py index 2a4076127..4d0b53116 100644 --- a/kittycad/api/users/get_session_for_user.py +++ b/kittycad/api/users/get_session_for_user.py @@ -26,9 +26,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, Session, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[Session, Error]]: if response.status_code == 200: response_200 = Session.from_dict(response.json()) return response_200 @@ -38,12 +36,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, Session, Error]]: +) -> Response[Optional[Union[Session, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -56,7 +54,7 @@ def sync_detailed( token: str, *, client: Client, -) -> Response[Union[Any, Session, Error]]: +) -> Response[Optional[Union[Session, Error]]]: kwargs = _get_kwargs( token=token, client=client, @@ -74,7 +72,7 @@ def sync( token: str, *, client: Client, -) -> Optional[Union[Any, Session, Error]]: +) -> Optional[Union[Session, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501 return sync_detailed( @@ -87,7 +85,7 @@ async def asyncio_detailed( token: str, *, client: Client, -) -> Response[Union[Any, Session, Error]]: +) -> Response[Optional[Union[Session, Error]]]: kwargs = _get_kwargs( token=token, client=client, @@ -103,7 +101,7 @@ async def asyncio( token: str, *, client: Client, -) -> Optional[Union[Any, Session, Error]]: +) -> Optional[Union[Session, Error]]: """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501 return ( diff --git a/kittycad/api/users/get_user.py b/kittycad/api/users/get_user.py index 5607a4011..9b9b27f2b 100644 --- a/kittycad/api/users/get_user.py +++ b/kittycad/api/users/get_user.py @@ -26,7 +26,7 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, User, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]: if response.status_code == 200: response_200 = User.from_dict(response.json()) return response_200 @@ -36,10 +36,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, User, Er if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, User, Error]]: +def _build_response( + *, response: httpx.Response +) -> Response[Optional[Union[User, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -52,7 +54,7 @@ def sync_detailed( id: str, *, client: Client, -) -> Response[Union[Any, User, Error]]: +) -> Response[Optional[Union[User, Error]]]: kwargs = _get_kwargs( id=id, client=client, @@ -70,7 +72,7 @@ def sync( id: str, *, client: Client, -) -> Optional[Union[Any, User, Error]]: +) -> Optional[Union[User, Error]]: """To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user. Alternatively, to get information about the authenticated user, use `/user` endpoint. To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501 @@ -85,7 +87,7 @@ async def asyncio_detailed( id: str, *, client: Client, -) -> Response[Union[Any, User, Error]]: +) -> Response[Optional[Union[User, Error]]]: kwargs = _get_kwargs( id=id, client=client, @@ -101,7 +103,7 @@ async def asyncio( id: str, *, client: Client, -) -> Optional[Union[Any, User, Error]]: +) -> Optional[Union[User, Error]]: """To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user. Alternatively, to get information about the authenticated user, use `/user` endpoint. To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501 diff --git a/kittycad/api/users/get_user_extended.py b/kittycad/api/users/get_user_extended.py index c5e916eef..f20f0b904 100644 --- a/kittycad/api/users/get_user_extended.py +++ b/kittycad/api/users/get_user_extended.py @@ -28,7 +28,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, ExtendedUser, Error]]: +) -> Optional[Union[ExtendedUser, Error]]: if response.status_code == 200: response_200 = ExtendedUser.from_dict(response.json()) return response_200 @@ -38,12 +38,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, ExtendedUser, Error]]: +) -> Response[Optional[Union[ExtendedUser, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -56,7 +56,7 @@ def sync_detailed( id: str, *, client: Client, -) -> Response[Union[Any, ExtendedUser, Error]]: +) -> Response[Optional[Union[ExtendedUser, Error]]]: kwargs = _get_kwargs( id=id, client=client, @@ -74,7 +74,7 @@ def sync( id: str, *, client: Client, -) -> Optional[Union[Any, ExtendedUser, Error]]: +) -> Optional[Union[ExtendedUser, Error]]: """To get information about yourself, use `/users-extended/me` as the endpoint. By doing so you will get the user information for the authenticated user. Alternatively, to get information about the authenticated user, use `/user/extended` endpoint. To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501 @@ -89,7 +89,7 @@ async def asyncio_detailed( id: str, *, client: Client, -) -> Response[Union[Any, ExtendedUser, Error]]: +) -> Response[Optional[Union[ExtendedUser, Error]]]: kwargs = _get_kwargs( id=id, client=client, @@ -105,7 +105,7 @@ async def asyncio( id: str, *, client: Client, -) -> Optional[Union[Any, ExtendedUser, Error]]: +) -> Optional[Union[ExtendedUser, Error]]: """To get information about yourself, use `/users-extended/me` as the endpoint. By doing so you will get the user information for the authenticated user. Alternatively, to get information about the authenticated user, use `/user/extended` endpoint. To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501 diff --git a/kittycad/api/users/get_user_front_hash_self.py b/kittycad/api/users/get_user_front_hash_self.py index 8072e6f50..11eff4edb 100644 --- a/kittycad/api/users/get_user_front_hash_self.py +++ b/kittycad/api/users/get_user_front_hash_self.py @@ -24,7 +24,7 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, str, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[str, Error]]: if response.status_code == 200: response_200 = response.text return response_200 @@ -34,10 +34,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, str, Err if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, str, Error]]: +def _build_response( + *, response: httpx.Response +) -> Response[Optional[Union[str, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -49,7 +51,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, str, Err def sync_detailed( *, client: Client, -) -> Response[Union[Any, str, Error]]: +) -> Response[Optional[Union[str, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -65,7 +67,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, str, Error]]: +) -> Optional[Union[str, Error]]: """This info is sent to front when initialing the front chat, it prevents impersonations using js hacks in the browser""" # noqa: E501 return sync_detailed( @@ -76,7 +78,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, str, Error]]: +) -> Response[Optional[Union[str, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -90,7 +92,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, str, Error]]: +) -> Optional[Union[str, Error]]: """This info is sent to front when initialing the front chat, it prevents impersonations using js hacks in the browser""" # noqa: E501 return ( diff --git a/kittycad/api/users/get_user_onboarding_self.py b/kittycad/api/users/get_user_onboarding_self.py index 592d76d74..219c56b5e 100644 --- a/kittycad/api/users/get_user_onboarding_self.py +++ b/kittycad/api/users/get_user_onboarding_self.py @@ -25,9 +25,7 @@ def _get_kwargs( } -def _parse_response( - *, response: httpx.Response -) -> Optional[Union[Any, Onboarding, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[Onboarding, Error]]: if response.status_code == 200: response_200 = Onboarding.from_dict(response.json()) return response_200 @@ -37,12 +35,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, Onboarding, Error]]: +) -> Response[Optional[Union[Onboarding, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +52,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any, Onboarding, Error]]: +) -> Response[Optional[Union[Onboarding, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -70,7 +68,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, Onboarding, Error]]: +) -> Optional[Union[Onboarding, Error]]: """Checks key part of their api usage to determine their onboarding progress""" # noqa: E501 return sync_detailed( @@ -81,7 +79,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, Onboarding, Error]]: +) -> Response[Optional[Union[Onboarding, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -95,7 +93,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, Onboarding, Error]]: +) -> Optional[Union[Onboarding, Error]]: """Checks key part of their api usage to determine their onboarding progress""" # noqa: E501 return ( diff --git a/kittycad/api/users/get_user_self.py b/kittycad/api/users/get_user_self.py index 82103f300..35e76cf60 100644 --- a/kittycad/api/users/get_user_self.py +++ b/kittycad/api/users/get_user_self.py @@ -25,7 +25,7 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, User, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]: if response.status_code == 200: response_200 = User.from_dict(response.json()) return response_200 @@ -35,10 +35,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, User, Er if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, User, Error]]: +def _build_response( + *, response: httpx.Response +) -> Response[Optional[Union[User, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -50,7 +52,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, User, Er def sync_detailed( *, client: Client, -) -> Response[Union[Any, User, Error]]: +) -> Response[Optional[Union[User, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -66,7 +68,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, User, Error]]: +) -> Optional[Union[User, Error]]: """Get the user information for the authenticated user. Alternatively, you can also use the `/users/me` endpoint.""" # noqa: E501 @@ -78,7 +80,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, User, Error]]: +) -> Response[Optional[Union[User, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -92,7 +94,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, User, Error]]: +) -> Optional[Union[User, Error]]: """Get the user information for the authenticated user. Alternatively, you can also use the `/users/me` endpoint.""" # noqa: E501 diff --git a/kittycad/api/users/get_user_self_extended.py b/kittycad/api/users/get_user_self_extended.py index 674464d56..a36f17c9b 100644 --- a/kittycad/api/users/get_user_self_extended.py +++ b/kittycad/api/users/get_user_self_extended.py @@ -27,7 +27,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, ExtendedUser, Error]]: +) -> Optional[Union[ExtendedUser, Error]]: if response.status_code == 200: response_200 = ExtendedUser.from_dict(response.json()) return response_200 @@ -37,12 +37,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, ExtendedUser, Error]]: +) -> Response[Optional[Union[ExtendedUser, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +54,7 @@ def _build_response( def sync_detailed( *, client: Client, -) -> Response[Union[Any, ExtendedUser, Error]]: +) -> Response[Optional[Union[ExtendedUser, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: Client, -) -> Optional[Union[Any, ExtendedUser, Error]]: +) -> Optional[Union[ExtendedUser, Error]]: """Get the user information for the authenticated user. Alternatively, you can also use the `/users-extended/me` endpoint.""" # noqa: E501 @@ -82,7 +82,7 @@ def sync( async def asyncio_detailed( *, client: Client, -) -> Response[Union[Any, ExtendedUser, Error]]: +) -> Response[Optional[Union[ExtendedUser, Error]]]: kwargs = _get_kwargs( client=client, ) @@ -96,7 +96,7 @@ async def asyncio_detailed( async def asyncio( *, client: Client, -) -> Optional[Union[Any, ExtendedUser, Error]]: +) -> Optional[Union[ExtendedUser, Error]]: """Get the user information for the authenticated user. Alternatively, you can also use the `/users-extended/me` endpoint.""" # noqa: E501 diff --git a/kittycad/api/users/list_users.py b/kittycad/api/users/list_users.py index d47646de7..a10a8a7e8 100644 --- a/kittycad/api/users/list_users.py +++ b/kittycad/api/users/list_users.py @@ -46,7 +46,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, UserResultsPage, Error]]: +) -> Optional[Union[UserResultsPage, Error]]: if response.status_code == 200: response_200 = UserResultsPage.from_dict(response.json()) return response_200 @@ -56,12 +56,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, UserResultsPage, Error]]: +) -> Response[Optional[Union[UserResultsPage, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, UserResultsPage, Error]]: +) -> Response[Optional[Union[UserResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -98,7 +98,7 @@ def sync( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, UserResultsPage, Error]]: +) -> Optional[Union[UserResultsPage, Error]]: """This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501 return sync_detailed( @@ -115,7 +115,7 @@ async def asyncio_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, UserResultsPage, Error]]: +) -> Response[Optional[Union[UserResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -135,7 +135,7 @@ async def asyncio( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, UserResultsPage, Error]]: +) -> Optional[Union[UserResultsPage, Error]]: """This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501 return ( diff --git a/kittycad/api/users/list_users_extended.py b/kittycad/api/users/list_users_extended.py index 35c2728c4..cbcfc383b 100644 --- a/kittycad/api/users/list_users_extended.py +++ b/kittycad/api/users/list_users_extended.py @@ -46,7 +46,7 @@ def _get_kwargs( def _parse_response( *, response: httpx.Response -) -> Optional[Union[Any, ExtendedUserResultsPage, Error]]: +) -> Optional[Union[ExtendedUserResultsPage, Error]]: if response.status_code == 200: response_200 = ExtendedUserResultsPage.from_dict(response.json()) return response_200 @@ -56,12 +56,12 @@ def _parse_response( if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) def _build_response( *, response: httpx.Response -) -> Response[Union[Any, ExtendedUserResultsPage, Error]]: +) -> Response[Optional[Union[ExtendedUserResultsPage, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, ExtendedUserResultsPage, Error]]: +) -> Response[Optional[Union[ExtendedUserResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -98,7 +98,7 @@ def sync( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, ExtendedUserResultsPage, Error]]: +) -> Optional[Union[ExtendedUserResultsPage, Error]]: """This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501 return sync_detailed( @@ -115,7 +115,7 @@ async def asyncio_detailed( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Response[Union[Any, ExtendedUserResultsPage, Error]]: +) -> Response[Optional[Union[ExtendedUserResultsPage, Error]]]: kwargs = _get_kwargs( limit=limit, page_token=page_token, @@ -135,7 +135,7 @@ async def asyncio( client: Client, limit: Optional[int] = None, page_token: Optional[str] = None, -) -> Optional[Union[Any, ExtendedUserResultsPage, Error]]: +) -> Optional[Union[ExtendedUserResultsPage, Error]]: """This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501 return ( diff --git a/kittycad/api/users/update_user_self.py b/kittycad/api/users/update_user_self.py index 755350a4d..9fcc991b4 100644 --- a/kittycad/api/users/update_user_self.py +++ b/kittycad/api/users/update_user_self.py @@ -28,7 +28,7 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, User, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]: if response.status_code == 200: response_200 = User.from_dict(response.json()) return response_200 @@ -38,10 +38,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, User, Er if response.status_code == 500: response_5XX = Error.from_dict(response.json()) return response_5XX - return None + return Error.from_dict(response.json()) -def _build_response(*, response: httpx.Response) -> Response[Union[Any, User, Error]]: +def _build_response( + *, response: httpx.Response +) -> Response[Optional[Union[User, Error]]]: return Response( status_code=response.status_code, content=response.content, @@ -54,7 +56,7 @@ def sync_detailed( body: UpdateUser, *, client: Client, -) -> Response[Union[Any, User, Error]]: +) -> Response[Optional[Union[User, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -72,7 +74,7 @@ def sync( body: UpdateUser, *, client: Client, -) -> Optional[Union[Any, User, Error]]: +) -> Optional[Union[User, Error]]: """This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.""" # noqa: E501 return sync_detailed( @@ -85,7 +87,7 @@ async def asyncio_detailed( body: UpdateUser, *, client: Client, -) -> Response[Union[Any, User, Error]]: +) -> Response[Optional[Union[User, Error]]]: kwargs = _get_kwargs( body=body, client=client, @@ -101,7 +103,7 @@ async def asyncio( body: UpdateUser, *, client: Client, -) -> Optional[Union[Any, User, Error]]: +) -> Optional[Union[User, Error]]: """This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.""" # noqa: E501 return ( diff --git a/kittycad/client_test.py b/kittycad/client_test.py index 7c70fea07..3dc4f9b23 100644 --- a/kittycad/client_test.py +++ b/kittycad/client_test.py @@ -1,4 +1,5 @@ import os +from typing import Union import pytest @@ -15,6 +16,7 @@ from .models import ( ApiCallStatus, ApiTokenResultsPage, CreatedAtSortMode, + Error, ExtendedUserResultsPage, FileConversion, FileExportFormat, @@ -31,9 +33,9 @@ def test_get_session(): client = ClientFromEnv() # Get the session. - session: User = get_user_self.sync(client=client) + session: Union[User, Error, None] = get_user_self.sync(client=client) - assert session is not None + assert isinstance(session, User) print(f"Session: {session}") @@ -44,11 +46,11 @@ async def test_get_api_tokens_async(): client = ClientFromEnv() # List API tokens. - fc: ApiTokenResultsPage = list_api_tokens_for_user.sync( - client=client, sort_by=CreatedAtSortMode + fc: Union[ApiTokenResultsPage, Error, None] = list_api_tokens_for_user.sync( + client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING ) - assert fc is not None + assert isinstance(fc, ApiTokenResultsPage) print(f"fc: {fc}") @@ -59,9 +61,9 @@ async def test_get_session_async(): client = ClientFromEnv() # Get the session. - session: User = await get_user_self.asyncio(client=client) + session: Union[User, Error, None] = await get_user_self.asyncio(client=client) - assert session is not None + assert isinstance(session, User) print(f"Session: {session}") @@ -71,9 +73,9 @@ def test_ping(): client = ClientFromEnv() # Get the message. - message: Pong = ping.sync(client=client) + message: Union[Pong, Error, None] = ping.sync(client=client) - assert message is not None + assert isinstance(message, Pong) print(f"Message: {message}") @@ -84,9 +86,9 @@ async def test_ping_async(): client = ClientFromEnv() # Get the message. - message: Pong = await ping.asyncio(client=client) + message: Union[Pong, Error, None] = await ping.asyncio(client=client) - assert message is not None + assert isinstance(message, Pong) print(f"Message: {message}") @@ -101,14 +103,18 @@ def test_file_convert_stl(): file.close() # Get the fc. - fc: FileConversion = create_file_conversion_with_base64_helper.sync( + result: Union[ + FileConversion, Error, None + ] = create_file_conversion_with_base64_helper.sync( client=client, body=content, src_format=FileImportFormat.STL, output_format=FileExportFormat.OBJ, ) - assert fc is not None + assert isinstance(result, FileConversion) + + fc: FileConversion = result print(f"FileConversion: {fc}") @@ -130,14 +136,18 @@ async def test_file_convert_stl_async(): file.close() # Get the fc. - fc: FileConversion = await create_file_conversion_with_base64_helper.asyncio( + result: Union[ + FileConversion, Error, None + ] = await create_file_conversion_with_base64_helper.asyncio( client=client, body=content, src_format=FileImportFormat.STL, output_format=FileExportFormat.OBJ, ) - assert fc is not None + assert isinstance(result, FileConversion) + + fc: FileConversion = result print(f"FileConversion: {fc}") @@ -156,14 +166,16 @@ def test_file_mass(): file.close() # Get the fc. - fm: FileMass = create_file_mass.sync( + result: Union[FileMass, Error, None] = create_file_mass.sync( client=client, body=content, src_format=FileImportFormat.OBJ, material_density=1.0, ) - assert fm is not None + assert isinstance(result, FileMass) + + fm: FileMass = result print(f"FileMass: {fm}") @@ -185,11 +197,13 @@ def test_file_volume(): file.close() # Get the fc. - fv: FileVolume = create_file_volume.sync( + result: Union[FileVolume, Error, None] = create_file_volume.sync( client=client, body=content, src_format=FileImportFormat.OBJ ) - assert fv is not None + assert isinstance(result, FileVolume) + + fv: FileVolume = result print(f"FileVolume: {fv}") @@ -205,11 +219,10 @@ def test_list_users(): # Create our client. client = ClientFromEnv() - response: ExtendedUserResultsPage = list_users_extended.sync( + response: Union[ExtendedUserResultsPage, Error, None] = list_users_extended.sync( sort_by=CreatedAtSortMode.CREATED_AT_DESCENDING, client=client, limit=10 ) - print(f"ExtendedUserResultsPage: {response}") + assert isinstance(response, ExtendedUserResultsPage) - assert response is not None - assert response.items is not None + print(f"ExtendedUserResultsPage: {response}") diff --git a/kittycad/examples_test.py b/kittycad/examples_test.py index 833542007..626d0fb41 100644 --- a/kittycad/examples_test.py +++ b/kittycad/examples_test.py @@ -1,3 +1,5 @@ +from typing import List, Optional, Union + import pytest from kittycad.api.ai import create_image_to_3d, create_text_to_3d @@ -27,6 +29,7 @@ from kittycad.api.drawing import cmd, cmd_batch from kittycad.api.executor import create_executor_term, create_file_execution from kittycad.api.file import ( create_file_center_of_mass, + create_file_conversion, create_file_conversion_with_base64_helper, create_file_density, create_file_mass, @@ -98,12 +101,76 @@ from kittycad.api.users import ( update_user_self, ) from kittycad.client import ClientFromEnv +from kittycad.models import ( + AiPluginManifest, + ApiCallQueryGroup, + ApiCallWithPrice, + ApiCallWithPriceResultsPage, + ApiToken, + ApiTokenResultsPage, + AppClientInfo, + AsyncApiCallResultsPage, + CodeOutput, + Customer, + CustomerBalance, + DrawingOutcomes, + Error, + ExtendedUser, + ExtendedUserResultsPage, + FileCenterOfMass, + FileConversion, + FileDensity, + FileMass, + FileSurfaceArea, + FileVolume, + Invoice, + Mesh, + Metadata, + Onboarding, + PaymentIntent, + PaymentMethod, + PhysicsConstant, + Pong, + Session, + UnitAccelerationConversion, + UnitAngleConversion, + UnitAngularVelocityConversion, + UnitAreaConversion, + UnitChargeConversion, + UnitConcentrationConversion, + UnitDataConversion, + UnitDataTransferRateConversion, + UnitDensityConversion, + UnitEnergyConversion, + UnitForceConversion, + UnitIlluminanceConversion, + UnitLengthConversion, + UnitMagneticFieldStrengthConversion, + UnitMagneticFluxConversion, + UnitMassConversion, + UnitMetricPowerConversion, + UnitMetricPowerCubedConversion, + UnitMetricPowerSquaredConversion, + UnitPowerConversion, + UnitPressureConversion, + UnitRadiationConversion, + UnitRadioactivityConversion, + UnitSolidAngleConversion, + UnitTemperatureConversion, + UnitTimeConversion, + UnitVelocityConversion, + UnitVoltageConversion, + UnitVolumeConversion, + User, + UserResultsPage, + VerificationToken, +) from kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy from kittycad.models.api_call_status import ApiCallStatus from kittycad.models.billing_info import BillingInfo from kittycad.models.code_language import CodeLanguage from kittycad.models.created_at_sort_mode import CreatedAtSortMode -from kittycad.models.draw_circle import DrawCircle +from kittycad.models.drawing_cmd import DrawCircle from kittycad.models.drawing_cmd_id import DrawingCmdId from kittycad.models.drawing_cmd_req import DrawingCmdReq from kittycad.models.drawing_cmd_req_batch import DrawingCmdReqBatch @@ -142,6 +209,7 @@ from kittycad.models.unit_velocity_format import UnitVelocityFormat from kittycad.models.unit_voltage_format import UnitVoltageFormat from kittycad.models.unit_volume_format import UnitVolumeFormat from kittycad.models.update_user import UpdateUser +from kittycad.types import Response @pytest.mark.skip @@ -181,12 +249,21 @@ def test_get_ai_plugin_manifest(): # Create our client. client = ClientFromEnv() - get_ai_plugin_manifest.sync( + result: Optional[Union[AiPluginManifest, Error]] = get_ai_plugin_manifest.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: AiPluginManifest = result + print(body) + # OR if you need more info (e.g. status_code) - get_ai_plugin_manifest.sync_detailed( + response: Response[ + Optional[Union[AiPluginManifest, Error]] + ] = get_ai_plugin_manifest.sync_detailed( client=client, ) @@ -198,12 +275,16 @@ async def test_get_ai_plugin_manifest_async(): # Create our client. client = ClientFromEnv() - await get_ai_plugin_manifest.asyncio( + result: Optional[ + Union[AiPluginManifest, Error] + ] = await get_ai_plugin_manifest.asyncio( client=client, ) # OR run async with more info - await get_ai_plugin_manifest.asyncio_detailed( + response: Response[ + Optional[Union[AiPluginManifest, Error]] + ] = await get_ai_plugin_manifest.asyncio_detailed( client=client, ) @@ -213,12 +294,19 @@ def test_get_metadata(): # Create our client. client = ClientFromEnv() - get_metadata.sync( + result: Optional[Union[Metadata, Error]] = get_metadata.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Metadata = result + print(body) + # OR if you need more info (e.g. status_code) - get_metadata.sync_detailed( + response: Response[Optional[Union[Metadata, Error]]] = get_metadata.sync_detailed( client=client, ) @@ -230,12 +318,14 @@ async def test_get_metadata_async(): # Create our client. client = ClientFromEnv() - await get_metadata.asyncio( + result: Optional[Union[Metadata, Error]] = await get_metadata.asyncio( client=client, ) # OR run async with more info - await get_metadata.asyncio_detailed( + response: Response[ + Optional[Union[Metadata, Error]] + ] = await get_metadata.asyncio_detailed( client=client, ) @@ -245,15 +335,22 @@ def test_create_image_to_3d(): # Create our client. client = ClientFromEnv() - create_image_to_3d.sync( + result: Optional[Union[Mesh, Error]] = create_image_to_3d.sync( client=client, input_format=ImageType.PNG, output_format=FileExportFormat.DAE, body=bytes("some bytes", "utf-8"), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Mesh = result + print(body) + # OR if you need more info (e.g. status_code) - create_image_to_3d.sync_detailed( + response: Response[Optional[Union[Mesh, Error]]] = create_image_to_3d.sync_detailed( client=client, input_format=ImageType.PNG, output_format=FileExportFormat.DAE, @@ -268,7 +365,7 @@ async def test_create_image_to_3d_async(): # Create our client. client = ClientFromEnv() - await create_image_to_3d.asyncio( + result: Optional[Union[Mesh, Error]] = await create_image_to_3d.asyncio( client=client, input_format=ImageType.PNG, output_format=FileExportFormat.DAE, @@ -276,7 +373,9 @@ async def test_create_image_to_3d_async(): ) # OR run async with more info - await create_image_to_3d.asyncio_detailed( + response: Response[ + Optional[Union[Mesh, Error]] + ] = await create_image_to_3d.asyncio_detailed( client=client, input_format=ImageType.PNG, output_format=FileExportFormat.DAE, @@ -289,14 +388,21 @@ def test_create_text_to_3d(): # Create our client. client = ClientFromEnv() - create_text_to_3d.sync( + result: Optional[Union[Mesh, Error]] = create_text_to_3d.sync( client=client, output_format=FileExportFormat.DAE, prompt="", ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Mesh = result + print(body) + # OR if you need more info (e.g. status_code) - create_text_to_3d.sync_detailed( + response: Response[Optional[Union[Mesh, Error]]] = create_text_to_3d.sync_detailed( client=client, output_format=FileExportFormat.DAE, prompt="", @@ -310,14 +416,16 @@ async def test_create_text_to_3d_async(): # Create our client. client = ClientFromEnv() - await create_text_to_3d.asyncio( + result: Optional[Union[Mesh, Error]] = await create_text_to_3d.asyncio( client=client, output_format=FileExportFormat.DAE, prompt="", ) # OR run async with more info - await create_text_to_3d.asyncio_detailed( + response: Response[ + Optional[Union[Mesh, Error]] + ] = await create_text_to_3d.asyncio_detailed( client=client, output_format=FileExportFormat.DAE, prompt="", @@ -329,13 +437,22 @@ def test_get_api_call_metrics(): # Create our client. client = ClientFromEnv() - get_api_call_metrics.sync( + result: Optional[Union[List[ApiCallQueryGroup], Error]] = get_api_call_metrics.sync( client=client, group_by=ApiCallQueryGroupBy.EMAIL, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: List[ApiCallQueryGroup] = result + print(body) + # OR if you need more info (e.g. status_code) - get_api_call_metrics.sync_detailed( + response: Response[ + Optional[Union[List[ApiCallQueryGroup], Error]] + ] = get_api_call_metrics.sync_detailed( client=client, group_by=ApiCallQueryGroupBy.EMAIL, ) @@ -348,13 +465,17 @@ async def test_get_api_call_metrics_async(): # Create our client. client = ClientFromEnv() - await get_api_call_metrics.asyncio( + result: Optional[ + Union[List[ApiCallQueryGroup], Error] + ] = await get_api_call_metrics.asyncio( client=client, group_by=ApiCallQueryGroupBy.EMAIL, ) # OR run async with more info - await get_api_call_metrics.asyncio_detailed( + response: Response[ + Optional[Union[List[ApiCallQueryGroup], Error]] + ] = await get_api_call_metrics.asyncio_detailed( client=client, group_by=ApiCallQueryGroupBy.EMAIL, ) @@ -365,15 +486,24 @@ def test_list_api_calls(): # Create our client. client = ClientFromEnv() - list_api_calls.sync( + result: Optional[Union[ApiCallWithPriceResultsPage, Error]] = list_api_calls.sync( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] page_token=None, # Optional[str] ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ApiCallWithPriceResultsPage = result + print(body) + # OR if you need more info (e.g. status_code) - list_api_calls.sync_detailed( + response: Response[ + Optional[Union[ApiCallWithPriceResultsPage, Error]] + ] = list_api_calls.sync_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -388,7 +518,9 @@ async def test_list_api_calls_async(): # Create our client. client = ClientFromEnv() - await list_api_calls.asyncio( + result: Optional[ + Union[ApiCallWithPriceResultsPage, Error] + ] = await list_api_calls.asyncio( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -396,7 +528,9 @@ async def test_list_api_calls_async(): ) # OR run async with more info - await list_api_calls.asyncio_detailed( + response: Response[ + Optional[Union[ApiCallWithPriceResultsPage, Error]] + ] = await list_api_calls.asyncio_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -409,13 +543,22 @@ def test_get_api_call(): # Create our client. client = ClientFromEnv() - get_api_call.sync( + result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call.sync( client=client, id="", ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ApiCallWithPrice = result + print(body) + # OR if you need more info (e.g. status_code) - get_api_call.sync_detailed( + response: Response[ + Optional[Union[ApiCallWithPrice, Error]] + ] = get_api_call.sync_detailed( client=client, id="", ) @@ -428,13 +571,15 @@ async def test_get_api_call_async(): # Create our client. client = ClientFromEnv() - await get_api_call.asyncio( + result: Optional[Union[ApiCallWithPrice, Error]] = await get_api_call.asyncio( client=client, id="", ) # OR run async with more info - await get_api_call.asyncio_detailed( + response: Response[ + Optional[Union[ApiCallWithPrice, Error]] + ] = await get_api_call.asyncio_detailed( client=client, id="", ) @@ -445,12 +590,19 @@ def test_apps_github_callback(): # Create our client. client = ClientFromEnv() - apps_github_callback.sync( + result: Optional[Error] = apps_github_callback.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + # OR if you need more info (e.g. status_code) - apps_github_callback.sync_detailed( + response: Response[Optional[Error]] = apps_github_callback.sync_detailed( client=client, ) @@ -462,12 +614,12 @@ async def test_apps_github_callback_async(): # Create our client. client = ClientFromEnv() - await apps_github_callback.asyncio( + result: Optional[Error] = await apps_github_callback.asyncio( client=client, ) # OR run async with more info - await apps_github_callback.asyncio_detailed( + response: Response[Optional[Error]] = await apps_github_callback.asyncio_detailed( client=client, ) @@ -477,12 +629,21 @@ def test_apps_github_consent(): # Create our client. client = ClientFromEnv() - apps_github_consent.sync( + result: Optional[Union[AppClientInfo, Error]] = apps_github_consent.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: AppClientInfo = result + print(body) + # OR if you need more info (e.g. status_code) - apps_github_consent.sync_detailed( + response: Response[ + Optional[Union[AppClientInfo, Error]] + ] = apps_github_consent.sync_detailed( client=client, ) @@ -494,12 +655,14 @@ async def test_apps_github_consent_async(): # Create our client. client = ClientFromEnv() - await apps_github_consent.asyncio( + result: Optional[Union[AppClientInfo, Error]] = await apps_github_consent.asyncio( client=client, ) # OR run async with more info - await apps_github_consent.asyncio_detailed( + response: Response[ + Optional[Union[AppClientInfo, Error]] + ] = await apps_github_consent.asyncio_detailed( client=client, ) @@ -509,13 +672,20 @@ def test_apps_github_webhook(): # Create our client. client = ClientFromEnv() - apps_github_webhook.sync( + result: Optional[Error] = apps_github_webhook.sync( client=client, body=bytes("some bytes", "utf-8"), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + # OR if you need more info (e.g. status_code) - apps_github_webhook.sync_detailed( + response: Response[Optional[Error]] = apps_github_webhook.sync_detailed( client=client, body=bytes("some bytes", "utf-8"), ) @@ -528,13 +698,13 @@ async def test_apps_github_webhook_async(): # Create our client. client = ClientFromEnv() - await apps_github_webhook.asyncio( + result: Optional[Error] = await apps_github_webhook.asyncio( client=client, body=bytes("some bytes", "utf-8"), ) # OR run async with more info - await apps_github_webhook.asyncio_detailed( + response: Response[Optional[Error]] = await apps_github_webhook.asyncio_detailed( client=client, body=bytes("some bytes", "utf-8"), ) @@ -545,7 +715,9 @@ def test_list_async_operations(): # Create our client. client = ClientFromEnv() - list_async_operations.sync( + result: Optional[ + Union[AsyncApiCallResultsPage, Error] + ] = list_async_operations.sync( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, status=ApiCallStatus.QUEUED, @@ -553,8 +725,17 @@ def test_list_async_operations(): page_token=None, # Optional[str] ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: AsyncApiCallResultsPage = result + print(body) + # OR if you need more info (e.g. status_code) - list_async_operations.sync_detailed( + response: Response[ + Optional[Union[AsyncApiCallResultsPage, Error]] + ] = list_async_operations.sync_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, status=ApiCallStatus.QUEUED, @@ -570,7 +751,9 @@ async def test_list_async_operations_async(): # Create our client. client = ClientFromEnv() - await list_async_operations.asyncio( + result: Optional[ + Union[AsyncApiCallResultsPage, Error] + ] = await list_async_operations.asyncio( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, status=ApiCallStatus.QUEUED, @@ -579,7 +762,9 @@ async def test_list_async_operations_async(): ) # OR run async with more info - await list_async_operations.asyncio_detailed( + response: Response[ + Optional[Union[AsyncApiCallResultsPage, Error]] + ] = await list_async_operations.asyncio_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, status=ApiCallStatus.QUEUED, @@ -593,13 +778,49 @@ def test_get_async_operation(): # Create our client. client = ClientFromEnv() - get_async_operation.sync( + result: Optional[ + Union[ + FileConversion, + FileCenterOfMass, + FileMass, + FileVolume, + FileDensity, + FileSurfaceArea, + Error, + ] + ] = get_async_operation.sync( client=client, id="", ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Union[ + FileConversion, + FileCenterOfMass, + FileMass, + FileVolume, + FileDensity, + FileSurfaceArea, + ] = result + print(body) + # OR if you need more info (e.g. status_code) - get_async_operation.sync_detailed( + response: Response[ + Optional[ + Union[ + FileConversion, + FileCenterOfMass, + FileMass, + FileVolume, + FileDensity, + FileSurfaceArea, + Error, + ] + ] + ] = get_async_operation.sync_detailed( client=client, id="", ) @@ -612,13 +833,35 @@ async def test_get_async_operation_async(): # Create our client. client = ClientFromEnv() - await get_async_operation.asyncio( + result: Optional[ + Union[ + FileConversion, + FileCenterOfMass, + FileMass, + FileVolume, + FileDensity, + FileSurfaceArea, + Error, + ] + ] = await get_async_operation.asyncio( client=client, id="", ) # OR run async with more info - await get_async_operation.asyncio_detailed( + response: Response[ + Optional[ + Union[ + FileConversion, + FileCenterOfMass, + FileMass, + FileVolume, + FileDensity, + FileSurfaceArea, + Error, + ] + ] + ] = await get_async_operation.asyncio_detailed( client=client, id="", ) @@ -629,15 +872,24 @@ def test_auth_email(): # Create our client. client = ClientFromEnv() - auth_email.sync( + result: Optional[Union[VerificationToken, Error]] = auth_email.sync( client=client, body=EmailAuthenticationForm( email="", ), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: VerificationToken = result + print(body) + # OR if you need more info (e.g. status_code) - auth_email.sync_detailed( + response: Response[ + Optional[Union[VerificationToken, Error]] + ] = auth_email.sync_detailed( client=client, body=EmailAuthenticationForm( email="", @@ -652,7 +904,7 @@ async def test_auth_email_async(): # Create our client. client = ClientFromEnv() - await auth_email.asyncio( + result: Optional[Union[VerificationToken, Error]] = await auth_email.asyncio( client=client, body=EmailAuthenticationForm( email="", @@ -660,7 +912,9 @@ async def test_auth_email_async(): ) # OR run async with more info - await auth_email.asyncio_detailed( + response: Response[ + Optional[Union[VerificationToken, Error]] + ] = await auth_email.asyncio_detailed( client=client, body=EmailAuthenticationForm( email="", @@ -673,15 +927,22 @@ def test_auth_email_callback(): # Create our client. client = ClientFromEnv() - auth_email_callback.sync( + result: Optional[Error] = auth_email_callback.sync( client=client, email="", token="", callback_url=None, # Optional[str] ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + # OR if you need more info (e.g. status_code) - auth_email_callback.sync_detailed( + response: Response[Optional[Error]] = auth_email_callback.sync_detailed( client=client, email="", token="", @@ -696,7 +957,7 @@ async def test_auth_email_callback_async(): # Create our client. client = ClientFromEnv() - await auth_email_callback.asyncio( + result: Optional[Error] = await auth_email_callback.asyncio( client=client, email="", token="", @@ -704,7 +965,7 @@ async def test_auth_email_callback_async(): ) # OR run async with more info - await auth_email_callback.asyncio_detailed( + response: Response[Optional[Error]] = await auth_email_callback.asyncio_detailed( client=client, email="", token="", @@ -717,13 +978,22 @@ def test_get_physics_constant(): # Create our client. client = ClientFromEnv() - get_physics_constant.sync( + result: Optional[Union[PhysicsConstant, Error]] = get_physics_constant.sync( client=client, constant=PhysicsConstantName.PI, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: PhysicsConstant = result + print(body) + # OR if you need more info (e.g. status_code) - get_physics_constant.sync_detailed( + response: Response[ + Optional[Union[PhysicsConstant, Error]] + ] = get_physics_constant.sync_detailed( client=client, constant=PhysicsConstantName.PI, ) @@ -736,13 +1006,17 @@ async def test_get_physics_constant_async(): # Create our client. client = ClientFromEnv() - await get_physics_constant.asyncio( + result: Optional[ + Union[PhysicsConstant, Error] + ] = await get_physics_constant.asyncio( client=client, constant=PhysicsConstantName.PI, ) # OR run async with more info - await get_physics_constant.asyncio_detailed( + response: Response[ + Optional[Union[PhysicsConstant, Error]] + ] = await get_physics_constant.asyncio_detailed( client=client, constant=PhysicsConstantName.PI, ) @@ -763,7 +1037,7 @@ def test_cmd(): ], radius=3.14, ), - cmd_id=DrawingCmdId(""), + cmd_id=DrawingCmdId(""), file_id="", ), ) @@ -779,7 +1053,7 @@ def test_cmd(): ], radius=3.14, ), - cmd_id=DrawingCmdId(""), + cmd_id=DrawingCmdId(""), file_id="", ), ) @@ -802,7 +1076,7 @@ async def test_cmd_async(): ], radius=3.14, ), - cmd_id=DrawingCmdId(""), + cmd_id=DrawingCmdId(""), file_id="", ), ) @@ -818,7 +1092,7 @@ async def test_cmd_async(): ], radius=3.14, ), - cmd_id=DrawingCmdId(""), + cmd_id=DrawingCmdId(""), file_id="", ), ) @@ -829,7 +1103,7 @@ def test_cmd_batch(): # Create our client. client = ClientFromEnv() - cmd_batch.sync( + result: Optional[Union[DrawingOutcomes, Error]] = cmd_batch.sync( client=client, body=DrawingCmdReqBatch( cmds={ @@ -841,7 +1115,7 @@ def test_cmd_batch(): ], radius=3.14, ), - cmd_id=DrawingCmdId(""), + cmd_id=DrawingCmdId(""), file_id="", ) }, @@ -849,8 +1123,17 @@ def test_cmd_batch(): ), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: DrawingOutcomes = result + print(body) + # OR if you need more info (e.g. status_code) - cmd_batch.sync_detailed( + response: Response[ + Optional[Union[DrawingOutcomes, Error]] + ] = cmd_batch.sync_detailed( client=client, body=DrawingCmdReqBatch( cmds={ @@ -862,7 +1145,7 @@ def test_cmd_batch(): ], radius=3.14, ), - cmd_id=DrawingCmdId(""), + cmd_id=DrawingCmdId(""), file_id="", ) }, @@ -878,7 +1161,7 @@ async def test_cmd_batch_async(): # Create our client. client = ClientFromEnv() - await cmd_batch.asyncio( + result: Optional[Union[DrawingOutcomes, Error]] = await cmd_batch.asyncio( client=client, body=DrawingCmdReqBatch( cmds={ @@ -890,7 +1173,7 @@ async def test_cmd_batch_async(): ], radius=3.14, ), - cmd_id=DrawingCmdId(""), + cmd_id=DrawingCmdId(""), file_id="", ) }, @@ -899,7 +1182,9 @@ async def test_cmd_batch_async(): ) # OR run async with more info - await cmd_batch.asyncio_detailed( + response: Response[ + Optional[Union[DrawingOutcomes, Error]] + ] = await cmd_batch.asyncio_detailed( client=client, body=DrawingCmdReqBatch( cmds={ @@ -911,7 +1196,7 @@ async def test_cmd_batch_async(): ], radius=3.14, ), - cmd_id=DrawingCmdId(""), + cmd_id=DrawingCmdId(""), file_id="", ) }, @@ -925,14 +1210,23 @@ def test_create_file_center_of_mass(): # Create our client. client = ClientFromEnv() - create_file_center_of_mass.sync( + result: Optional[Union[FileCenterOfMass, Error]] = create_file_center_of_mass.sync( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: FileCenterOfMass = result + print(body) + # OR if you need more info (e.g. status_code) - create_file_center_of_mass.sync_detailed( + response: Response[ + Optional[Union[FileCenterOfMass, Error]] + ] = create_file_center_of_mass.sync_detailed( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), @@ -946,14 +1240,18 @@ async def test_create_file_center_of_mass_async(): # Create our client. client = ClientFromEnv() - await create_file_center_of_mass.asyncio( + result: Optional[ + Union[FileCenterOfMass, Error] + ] = await create_file_center_of_mass.asyncio( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), ) # OR run async with more info - await create_file_center_of_mass.asyncio_detailed( + response: Response[ + Optional[Union[FileCenterOfMass, Error]] + ] = await create_file_center_of_mass.asyncio_detailed( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), @@ -965,15 +1263,26 @@ def test_create_file_conversion_with_base64_helper(): # Create our client. client = ClientFromEnv() - create_file_conversion_with_base64_helper.sync( + result: Optional[ + Union[FileConversion, Error] + ] = create_file_conversion_with_base64_helper.sync( client=client, output_format=FileExportFormat.DAE, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: FileConversion = result + print(body) + # OR if you need more info (e.g. status_code) - create_file_conversion_with_base64_helper.sync_detailed( + response: Response[ + Optional[Union[FileConversion, Error]] + ] = create_file_conversion.sync_detailed( client=client, output_format=FileExportFormat.DAE, src_format=FileImportFormat.DAE, @@ -988,7 +1297,9 @@ async def test_create_file_conversion_with_base64_helper_async(): # Create our client. client = ClientFromEnv() - await create_file_conversion_with_base64_helper.asyncio( + result: Optional[ + Union[FileConversion, Error] + ] = await create_file_conversion_with_base64_helper.asyncio( client=client, output_format=FileExportFormat.DAE, src_format=FileImportFormat.DAE, @@ -996,13 +1307,13 @@ async def test_create_file_conversion_with_base64_helper_async(): ) # OR run async with more info - ( - await create_file_conversion_with_base64_helper.asyncio_detailed( - client=client, - output_format=FileExportFormat.DAE, - src_format=FileImportFormat.DAE, - body=bytes("some bytes", "utf-8"), - ) + response: Response[ + Optional[Union[FileConversion, Error]] + ] = await create_file_conversion.asyncio_detailed( + client=client, + output_format=FileExportFormat.DAE, + src_format=FileImportFormat.DAE, + body=bytes("some bytes", "utf-8"), ) @@ -1011,15 +1322,24 @@ def test_create_file_density(): # Create our client. client = ClientFromEnv() - create_file_density.sync( + result: Optional[Union[FileDensity, Error]] = create_file_density.sync( client=client, material_mass=3.14, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: FileDensity = result + print(body) + # OR if you need more info (e.g. status_code) - create_file_density.sync_detailed( + response: Response[ + Optional[Union[FileDensity, Error]] + ] = create_file_density.sync_detailed( client=client, material_mass=3.14, src_format=FileImportFormat.DAE, @@ -1034,7 +1354,7 @@ async def test_create_file_density_async(): # Create our client. client = ClientFromEnv() - await create_file_density.asyncio( + result: Optional[Union[FileDensity, Error]] = await create_file_density.asyncio( client=client, material_mass=3.14, src_format=FileImportFormat.DAE, @@ -1042,7 +1362,9 @@ async def test_create_file_density_async(): ) # OR run async with more info - await create_file_density.asyncio_detailed( + response: Response[ + Optional[Union[FileDensity, Error]] + ] = await create_file_density.asyncio_detailed( client=client, material_mass=3.14, src_format=FileImportFormat.DAE, @@ -1055,15 +1377,24 @@ def test_create_file_execution(): # Create our client. client = ClientFromEnv() - create_file_execution.sync( + result: Optional[Union[CodeOutput, Error]] = create_file_execution.sync( client=client, lang=CodeLanguage.GO, output=None, # Optional[str] body=bytes("some bytes", "utf-8"), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: CodeOutput = result + print(body) + # OR if you need more info (e.g. status_code) - create_file_execution.sync_detailed( + response: Response[ + Optional[Union[CodeOutput, Error]] + ] = create_file_execution.sync_detailed( client=client, lang=CodeLanguage.GO, output=None, # Optional[str] @@ -1078,7 +1409,7 @@ async def test_create_file_execution_async(): # Create our client. client = ClientFromEnv() - await create_file_execution.asyncio( + result: Optional[Union[CodeOutput, Error]] = await create_file_execution.asyncio( client=client, lang=CodeLanguage.GO, output=None, # Optional[str] @@ -1086,7 +1417,9 @@ async def test_create_file_execution_async(): ) # OR run async with more info - await create_file_execution.asyncio_detailed( + response: Response[ + Optional[Union[CodeOutput, Error]] + ] = await create_file_execution.asyncio_detailed( client=client, lang=CodeLanguage.GO, output=None, # Optional[str] @@ -1099,15 +1432,24 @@ def test_create_file_mass(): # Create our client. client = ClientFromEnv() - create_file_mass.sync( + result: Optional[Union[FileMass, Error]] = create_file_mass.sync( client=client, material_density=3.14, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: FileMass = result + print(body) + # OR if you need more info (e.g. status_code) - create_file_mass.sync_detailed( + response: Response[ + Optional[Union[FileMass, Error]] + ] = create_file_mass.sync_detailed( client=client, material_density=3.14, src_format=FileImportFormat.DAE, @@ -1122,7 +1464,7 @@ async def test_create_file_mass_async(): # Create our client. client = ClientFromEnv() - await create_file_mass.asyncio( + result: Optional[Union[FileMass, Error]] = await create_file_mass.asyncio( client=client, material_density=3.14, src_format=FileImportFormat.DAE, @@ -1130,7 +1472,9 @@ async def test_create_file_mass_async(): ) # OR run async with more info - await create_file_mass.asyncio_detailed( + response: Response[ + Optional[Union[FileMass, Error]] + ] = await create_file_mass.asyncio_detailed( client=client, material_density=3.14, src_format=FileImportFormat.DAE, @@ -1143,14 +1487,23 @@ def test_create_file_surface_area(): # Create our client. client = ClientFromEnv() - create_file_surface_area.sync( + result: Optional[Union[FileSurfaceArea, Error]] = create_file_surface_area.sync( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: FileSurfaceArea = result + print(body) + # OR if you need more info (e.g. status_code) - create_file_surface_area.sync_detailed( + response: Response[ + Optional[Union[FileSurfaceArea, Error]] + ] = create_file_surface_area.sync_detailed( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), @@ -1164,14 +1517,18 @@ async def test_create_file_surface_area_async(): # Create our client. client = ClientFromEnv() - await create_file_surface_area.asyncio( + result: Optional[ + Union[FileSurfaceArea, Error] + ] = await create_file_surface_area.asyncio( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), ) # OR run async with more info - await create_file_surface_area.asyncio_detailed( + response: Response[ + Optional[Union[FileSurfaceArea, Error]] + ] = await create_file_surface_area.asyncio_detailed( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), @@ -1183,14 +1540,23 @@ def test_create_file_volume(): # Create our client. client = ClientFromEnv() - create_file_volume.sync( + result: Optional[Union[FileVolume, Error]] = create_file_volume.sync( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: FileVolume = result + print(body) + # OR if you need more info (e.g. status_code) - create_file_volume.sync_detailed( + response: Response[ + Optional[Union[FileVolume, Error]] + ] = create_file_volume.sync_detailed( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), @@ -1204,14 +1570,16 @@ async def test_create_file_volume_async(): # Create our client. client = ClientFromEnv() - await create_file_volume.asyncio( + result: Optional[Union[FileVolume, Error]] = await create_file_volume.asyncio( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), ) # OR run async with more info - await create_file_volume.asyncio_detailed( + response: Response[ + Optional[Union[FileVolume, Error]] + ] = await create_file_volume.asyncio_detailed( client=client, src_format=FileImportFormat.DAE, body=bytes("some bytes", "utf-8"), @@ -1223,12 +1591,19 @@ def test_logout(): # Create our client. client = ClientFromEnv() - logout.sync( + result: Optional[Error] = logout.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + # OR if you need more info (e.g. status_code) - logout.sync_detailed( + response: Response[Optional[Error]] = logout.sync_detailed( client=client, ) @@ -1240,12 +1615,12 @@ async def test_logout_async(): # Create our client. client = ClientFromEnv() - await logout.asyncio( + result: Optional[Error] = await logout.asyncio( client=client, ) # OR run async with more info - await logout.asyncio_detailed( + response: Response[Optional[Error]] = await logout.asyncio_detailed( client=client, ) @@ -1287,12 +1662,19 @@ def test_ping(): # Create our client. client = ClientFromEnv() - ping.sync( + result: Optional[Union[Pong, Error]] = ping.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Pong = result + print(body) + # OR if you need more info (e.g. status_code) - ping.sync_detailed( + response: Response[Optional[Union[Pong, Error]]] = ping.sync_detailed( client=client, ) @@ -1304,12 +1686,12 @@ async def test_ping_async(): # Create our client. client = ClientFromEnv() - await ping.asyncio( + result: Optional[Union[Pong, Error]] = await ping.asyncio( client=client, ) # OR run async with more info - await ping.asyncio_detailed( + response: Response[Optional[Union[Pong, Error]]] = await ping.asyncio_detailed( client=client, ) @@ -1319,15 +1701,26 @@ def test_get_acceleration_unit_conversion(): # Create our client. client = ClientFromEnv() - get_acceleration_unit_conversion.sync( + result: Optional[ + Union[UnitAccelerationConversion, Error] + ] = get_acceleration_unit_conversion.sync( client=client, output_format=UnitAccelerationFormat.METERS_PER_SECOND_SQUARED, src_format=UnitAccelerationFormat.METERS_PER_SECOND_SQUARED, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitAccelerationConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_acceleration_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitAccelerationConversion, Error]] + ] = get_acceleration_unit_conversion.sync_detailed( client=client, output_format=UnitAccelerationFormat.METERS_PER_SECOND_SQUARED, src_format=UnitAccelerationFormat.METERS_PER_SECOND_SQUARED, @@ -1342,7 +1735,9 @@ async def test_get_acceleration_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_acceleration_unit_conversion.asyncio( + result: Optional[ + Union[UnitAccelerationConversion, Error] + ] = await get_acceleration_unit_conversion.asyncio( client=client, output_format=UnitAccelerationFormat.METERS_PER_SECOND_SQUARED, src_format=UnitAccelerationFormat.METERS_PER_SECOND_SQUARED, @@ -1350,13 +1745,13 @@ async def test_get_acceleration_unit_conversion_async(): ) # OR run async with more info - ( - await get_acceleration_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitAccelerationFormat.METERS_PER_SECOND_SQUARED, - src_format=UnitAccelerationFormat.METERS_PER_SECOND_SQUARED, - value=3.14, - ) + response: Response[ + Optional[Union[UnitAccelerationConversion, Error]] + ] = await get_acceleration_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitAccelerationFormat.METERS_PER_SECOND_SQUARED, + src_format=UnitAccelerationFormat.METERS_PER_SECOND_SQUARED, + value=3.14, ) @@ -1365,15 +1760,26 @@ def test_get_angle_unit_conversion(): # Create our client. client = ClientFromEnv() - get_angle_unit_conversion.sync( + result: Optional[ + Union[UnitAngleConversion, Error] + ] = get_angle_unit_conversion.sync( client=client, output_format=UnitAngleFormat.RADIAN, src_format=UnitAngleFormat.RADIAN, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitAngleConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_angle_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitAngleConversion, Error]] + ] = get_angle_unit_conversion.sync_detailed( client=client, output_format=UnitAngleFormat.RADIAN, src_format=UnitAngleFormat.RADIAN, @@ -1388,7 +1794,9 @@ async def test_get_angle_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_angle_unit_conversion.asyncio( + result: Optional[ + Union[UnitAngleConversion, Error] + ] = await get_angle_unit_conversion.asyncio( client=client, output_format=UnitAngleFormat.RADIAN, src_format=UnitAngleFormat.RADIAN, @@ -1396,7 +1804,9 @@ async def test_get_angle_unit_conversion_async(): ) # OR run async with more info - await get_angle_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitAngleConversion, Error]] + ] = await get_angle_unit_conversion.asyncio_detailed( client=client, output_format=UnitAngleFormat.RADIAN, src_format=UnitAngleFormat.RADIAN, @@ -1409,21 +1819,30 @@ def test_get_angular_velocity_unit_conversion(): # Create our client. client = ClientFromEnv() - get_angular_velocity_unit_conversion.sync( + result: Optional[ + Union[UnitAngularVelocityConversion, Error] + ] = get_angular_velocity_unit_conversion.sync( client=client, output_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, src_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitAngularVelocityConversion = result + print(body) + # OR if you need more info (e.g. status_code) - ( - get_angular_velocity_unit_conversion.sync_detailed( - client=client, - output_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, - src_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, - value=3.14, - ) + response: Response[ + Optional[Union[UnitAngularVelocityConversion, Error]] + ] = get_angular_velocity_unit_conversion.sync_detailed( + client=client, + output_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, + src_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, + value=3.14, ) @@ -1434,23 +1853,23 @@ async def test_get_angular_velocity_unit_conversion_async(): # Create our client. client = ClientFromEnv() - ( - await get_angular_velocity_unit_conversion.asyncio( - client=client, - output_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, - src_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, - value=3.14, - ) + result: Optional[ + Union[UnitAngularVelocityConversion, Error] + ] = await get_angular_velocity_unit_conversion.asyncio( + client=client, + output_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, + src_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, + value=3.14, ) # OR run async with more info - ( - await get_angular_velocity_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, - src_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, - value=3.14, - ) + response: Response[ + Optional[Union[UnitAngularVelocityConversion, Error]] + ] = await get_angular_velocity_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, + src_format=UnitAngularVelocityFormat.RADIANS_PER_SECOND, + value=3.14, ) @@ -1459,15 +1878,24 @@ def test_get_area_unit_conversion(): # Create our client. client = ClientFromEnv() - get_area_unit_conversion.sync( + result: Optional[Union[UnitAreaConversion, Error]] = get_area_unit_conversion.sync( client=client, output_format=UnitAreaFormat.SQUARE_METER, src_format=UnitAreaFormat.SQUARE_METER, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitAreaConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_area_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitAreaConversion, Error]] + ] = get_area_unit_conversion.sync_detailed( client=client, output_format=UnitAreaFormat.SQUARE_METER, src_format=UnitAreaFormat.SQUARE_METER, @@ -1482,7 +1910,9 @@ async def test_get_area_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_area_unit_conversion.asyncio( + result: Optional[ + Union[UnitAreaConversion, Error] + ] = await get_area_unit_conversion.asyncio( client=client, output_format=UnitAreaFormat.SQUARE_METER, src_format=UnitAreaFormat.SQUARE_METER, @@ -1490,7 +1920,9 @@ async def test_get_area_unit_conversion_async(): ) # OR run async with more info - await get_area_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitAreaConversion, Error]] + ] = await get_area_unit_conversion.asyncio_detailed( client=client, output_format=UnitAreaFormat.SQUARE_METER, src_format=UnitAreaFormat.SQUARE_METER, @@ -1503,15 +1935,26 @@ def test_get_charge_unit_conversion(): # Create our client. client = ClientFromEnv() - get_charge_unit_conversion.sync( + result: Optional[ + Union[UnitChargeConversion, Error] + ] = get_charge_unit_conversion.sync( client=client, output_format=UnitChargeFormat.COULOMB, src_format=UnitChargeFormat.COULOMB, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitChargeConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_charge_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitChargeConversion, Error]] + ] = get_charge_unit_conversion.sync_detailed( client=client, output_format=UnitChargeFormat.COULOMB, src_format=UnitChargeFormat.COULOMB, @@ -1526,7 +1969,9 @@ async def test_get_charge_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_charge_unit_conversion.asyncio( + result: Optional[ + Union[UnitChargeConversion, Error] + ] = await get_charge_unit_conversion.asyncio( client=client, output_format=UnitChargeFormat.COULOMB, src_format=UnitChargeFormat.COULOMB, @@ -1534,7 +1979,9 @@ async def test_get_charge_unit_conversion_async(): ) # OR run async with more info - await get_charge_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitChargeConversion, Error]] + ] = await get_charge_unit_conversion.asyncio_detailed( client=client, output_format=UnitChargeFormat.COULOMB, src_format=UnitChargeFormat.COULOMB, @@ -1547,15 +1994,26 @@ def test_get_concentration_unit_conversion(): # Create our client. client = ClientFromEnv() - get_concentration_unit_conversion.sync( + result: Optional[ + Union[UnitConcentrationConversion, Error] + ] = get_concentration_unit_conversion.sync( client=client, output_format=UnitConcentrationFormat.PARTS_PER_MILLION, src_format=UnitConcentrationFormat.PARTS_PER_MILLION, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitConcentrationConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_concentration_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitConcentrationConversion, Error]] + ] = get_concentration_unit_conversion.sync_detailed( client=client, output_format=UnitConcentrationFormat.PARTS_PER_MILLION, src_format=UnitConcentrationFormat.PARTS_PER_MILLION, @@ -1570,7 +2028,9 @@ async def test_get_concentration_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_concentration_unit_conversion.asyncio( + result: Optional[ + Union[UnitConcentrationConversion, Error] + ] = await get_concentration_unit_conversion.asyncio( client=client, output_format=UnitConcentrationFormat.PARTS_PER_MILLION, src_format=UnitConcentrationFormat.PARTS_PER_MILLION, @@ -1578,13 +2038,13 @@ async def test_get_concentration_unit_conversion_async(): ) # OR run async with more info - ( - await get_concentration_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitConcentrationFormat.PARTS_PER_MILLION, - src_format=UnitConcentrationFormat.PARTS_PER_MILLION, - value=3.14, - ) + response: Response[ + Optional[Union[UnitConcentrationConversion, Error]] + ] = await get_concentration_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitConcentrationFormat.PARTS_PER_MILLION, + src_format=UnitConcentrationFormat.PARTS_PER_MILLION, + value=3.14, ) @@ -1593,21 +2053,30 @@ def test_get_data_transfer_rate_unit_conversion(): # Create our client. client = ClientFromEnv() - get_data_transfer_rate_unit_conversion.sync( + result: Optional[ + Union[UnitDataTransferRateConversion, Error] + ] = get_data_transfer_rate_unit_conversion.sync( client=client, output_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, src_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitDataTransferRateConversion = result + print(body) + # OR if you need more info (e.g. status_code) - ( - get_data_transfer_rate_unit_conversion.sync_detailed( - client=client, - output_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, - src_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, - value=3.14, - ) + response: Response[ + Optional[Union[UnitDataTransferRateConversion, Error]] + ] = get_data_transfer_rate_unit_conversion.sync_detailed( + client=client, + output_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, + src_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, + value=3.14, ) @@ -1618,23 +2087,23 @@ async def test_get_data_transfer_rate_unit_conversion_async(): # Create our client. client = ClientFromEnv() - ( - await get_data_transfer_rate_unit_conversion.asyncio( - client=client, - output_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, - src_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, - value=3.14, - ) + result: Optional[ + Union[UnitDataTransferRateConversion, Error] + ] = await get_data_transfer_rate_unit_conversion.asyncio( + client=client, + output_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, + src_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, + value=3.14, ) # OR run async with more info - ( - await get_data_transfer_rate_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, - src_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, - value=3.14, - ) + response: Response[ + Optional[Union[UnitDataTransferRateConversion, Error]] + ] = await get_data_transfer_rate_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, + src_format=UnitDataTransferRateFormat.BYTES_PER_SECOND, + value=3.14, ) @@ -1643,15 +2112,24 @@ def test_get_data_unit_conversion(): # Create our client. client = ClientFromEnv() - get_data_unit_conversion.sync( + result: Optional[Union[UnitDataConversion, Error]] = get_data_unit_conversion.sync( client=client, output_format=UnitDataFormat.BYTE, src_format=UnitDataFormat.BYTE, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitDataConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_data_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitDataConversion, Error]] + ] = get_data_unit_conversion.sync_detailed( client=client, output_format=UnitDataFormat.BYTE, src_format=UnitDataFormat.BYTE, @@ -1666,7 +2144,9 @@ async def test_get_data_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_data_unit_conversion.asyncio( + result: Optional[ + Union[UnitDataConversion, Error] + ] = await get_data_unit_conversion.asyncio( client=client, output_format=UnitDataFormat.BYTE, src_format=UnitDataFormat.BYTE, @@ -1674,7 +2154,9 @@ async def test_get_data_unit_conversion_async(): ) # OR run async with more info - await get_data_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitDataConversion, Error]] + ] = await get_data_unit_conversion.asyncio_detailed( client=client, output_format=UnitDataFormat.BYTE, src_format=UnitDataFormat.BYTE, @@ -1687,15 +2169,26 @@ def test_get_density_unit_conversion(): # Create our client. client = ClientFromEnv() - get_density_unit_conversion.sync( + result: Optional[ + Union[UnitDensityConversion, Error] + ] = get_density_unit_conversion.sync( client=client, output_format=UnitDensityFormat.KILOGRAMS_PER_CUBIC_METER, src_format=UnitDensityFormat.KILOGRAMS_PER_CUBIC_METER, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitDensityConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_density_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitDensityConversion, Error]] + ] = get_density_unit_conversion.sync_detailed( client=client, output_format=UnitDensityFormat.KILOGRAMS_PER_CUBIC_METER, src_format=UnitDensityFormat.KILOGRAMS_PER_CUBIC_METER, @@ -1710,7 +2203,9 @@ async def test_get_density_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_density_unit_conversion.asyncio( + result: Optional[ + Union[UnitDensityConversion, Error] + ] = await get_density_unit_conversion.asyncio( client=client, output_format=UnitDensityFormat.KILOGRAMS_PER_CUBIC_METER, src_format=UnitDensityFormat.KILOGRAMS_PER_CUBIC_METER, @@ -1718,7 +2213,9 @@ async def test_get_density_unit_conversion_async(): ) # OR run async with more info - await get_density_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitDensityConversion, Error]] + ] = await get_density_unit_conversion.asyncio_detailed( client=client, output_format=UnitDensityFormat.KILOGRAMS_PER_CUBIC_METER, src_format=UnitDensityFormat.KILOGRAMS_PER_CUBIC_METER, @@ -1731,15 +2228,26 @@ def test_get_energy_unit_conversion(): # Create our client. client = ClientFromEnv() - get_energy_unit_conversion.sync( + result: Optional[ + Union[UnitEnergyConversion, Error] + ] = get_energy_unit_conversion.sync( client=client, output_format=UnitEnergyFormat.JOULE, src_format=UnitEnergyFormat.JOULE, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitEnergyConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_energy_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitEnergyConversion, Error]] + ] = get_energy_unit_conversion.sync_detailed( client=client, output_format=UnitEnergyFormat.JOULE, src_format=UnitEnergyFormat.JOULE, @@ -1754,7 +2262,9 @@ async def test_get_energy_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_energy_unit_conversion.asyncio( + result: Optional[ + Union[UnitEnergyConversion, Error] + ] = await get_energy_unit_conversion.asyncio( client=client, output_format=UnitEnergyFormat.JOULE, src_format=UnitEnergyFormat.JOULE, @@ -1762,7 +2272,9 @@ async def test_get_energy_unit_conversion_async(): ) # OR run async with more info - await get_energy_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitEnergyConversion, Error]] + ] = await get_energy_unit_conversion.asyncio_detailed( client=client, output_format=UnitEnergyFormat.JOULE, src_format=UnitEnergyFormat.JOULE, @@ -1775,15 +2287,26 @@ def test_get_force_unit_conversion(): # Create our client. client = ClientFromEnv() - get_force_unit_conversion.sync( + result: Optional[ + Union[UnitForceConversion, Error] + ] = get_force_unit_conversion.sync( client=client, output_format=UnitForceFormat.NEWTON, src_format=UnitForceFormat.NEWTON, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitForceConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_force_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitForceConversion, Error]] + ] = get_force_unit_conversion.sync_detailed( client=client, output_format=UnitForceFormat.NEWTON, src_format=UnitForceFormat.NEWTON, @@ -1798,7 +2321,9 @@ async def test_get_force_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_force_unit_conversion.asyncio( + result: Optional[ + Union[UnitForceConversion, Error] + ] = await get_force_unit_conversion.asyncio( client=client, output_format=UnitForceFormat.NEWTON, src_format=UnitForceFormat.NEWTON, @@ -1806,7 +2331,9 @@ async def test_get_force_unit_conversion_async(): ) # OR run async with more info - await get_force_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitForceConversion, Error]] + ] = await get_force_unit_conversion.asyncio_detailed( client=client, output_format=UnitForceFormat.NEWTON, src_format=UnitForceFormat.NEWTON, @@ -1819,15 +2346,26 @@ def test_get_illuminance_unit_conversion(): # Create our client. client = ClientFromEnv() - get_illuminance_unit_conversion.sync( + result: Optional[ + Union[UnitIlluminanceConversion, Error] + ] = get_illuminance_unit_conversion.sync( client=client, output_format=UnitIlluminanceFormat.LUX, src_format=UnitIlluminanceFormat.LUX, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitIlluminanceConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_illuminance_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitIlluminanceConversion, Error]] + ] = get_illuminance_unit_conversion.sync_detailed( client=client, output_format=UnitIlluminanceFormat.LUX, src_format=UnitIlluminanceFormat.LUX, @@ -1842,7 +2380,9 @@ async def test_get_illuminance_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_illuminance_unit_conversion.asyncio( + result: Optional[ + Union[UnitIlluminanceConversion, Error] + ] = await get_illuminance_unit_conversion.asyncio( client=client, output_format=UnitIlluminanceFormat.LUX, src_format=UnitIlluminanceFormat.LUX, @@ -1850,13 +2390,13 @@ async def test_get_illuminance_unit_conversion_async(): ) # OR run async with more info - ( - await get_illuminance_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitIlluminanceFormat.LUX, - src_format=UnitIlluminanceFormat.LUX, - value=3.14, - ) + response: Response[ + Optional[Union[UnitIlluminanceConversion, Error]] + ] = await get_illuminance_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitIlluminanceFormat.LUX, + src_format=UnitIlluminanceFormat.LUX, + value=3.14, ) @@ -1865,15 +2405,26 @@ def test_get_length_unit_conversion(): # Create our client. client = ClientFromEnv() - get_length_unit_conversion.sync( + result: Optional[ + Union[UnitLengthConversion, Error] + ] = get_length_unit_conversion.sync( client=client, output_format=UnitLengthFormat.METER, src_format=UnitLengthFormat.METER, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitLengthConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_length_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitLengthConversion, Error]] + ] = get_length_unit_conversion.sync_detailed( client=client, output_format=UnitLengthFormat.METER, src_format=UnitLengthFormat.METER, @@ -1888,7 +2439,9 @@ async def test_get_length_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_length_unit_conversion.asyncio( + result: Optional[ + Union[UnitLengthConversion, Error] + ] = await get_length_unit_conversion.asyncio( client=client, output_format=UnitLengthFormat.METER, src_format=UnitLengthFormat.METER, @@ -1896,7 +2449,9 @@ async def test_get_length_unit_conversion_async(): ) # OR run async with more info - await get_length_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitLengthConversion, Error]] + ] = await get_length_unit_conversion.asyncio_detailed( client=client, output_format=UnitLengthFormat.METER, src_format=UnitLengthFormat.METER, @@ -1909,23 +2464,30 @@ def test_get_magnetic_field_strength_unit_conversion(): # Create our client. client = ClientFromEnv() - ( - get_magnetic_field_strength_unit_conversion.sync( - client=client, - output_format=UnitMagneticFieldStrengthFormat.TESLA, - src_format=UnitMagneticFieldStrengthFormat.TESLA, - value=3.14, - ) + result: Optional[ + Union[UnitMagneticFieldStrengthConversion, Error] + ] = get_magnetic_field_strength_unit_conversion.sync( + client=client, + output_format=UnitMagneticFieldStrengthFormat.TESLA, + src_format=UnitMagneticFieldStrengthFormat.TESLA, + value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitMagneticFieldStrengthConversion = result + print(body) + # OR if you need more info (e.g. status_code) - ( - get_magnetic_field_strength_unit_conversion.sync_detailed( - client=client, - output_format=UnitMagneticFieldStrengthFormat.TESLA, - src_format=UnitMagneticFieldStrengthFormat.TESLA, - value=3.14, - ) + response: Response[ + Optional[Union[UnitMagneticFieldStrengthConversion, Error]] + ] = get_magnetic_field_strength_unit_conversion.sync_detailed( + client=client, + output_format=UnitMagneticFieldStrengthFormat.TESLA, + src_format=UnitMagneticFieldStrengthFormat.TESLA, + value=3.14, ) @@ -1936,23 +2498,23 @@ async def test_get_magnetic_field_strength_unit_conversion_async(): # Create our client. client = ClientFromEnv() - ( - await get_magnetic_field_strength_unit_conversion.asyncio( - client=client, - output_format=UnitMagneticFieldStrengthFormat.TESLA, - src_format=UnitMagneticFieldStrengthFormat.TESLA, - value=3.14, - ) + result: Optional[ + Union[UnitMagneticFieldStrengthConversion, Error] + ] = await get_magnetic_field_strength_unit_conversion.asyncio( + client=client, + output_format=UnitMagneticFieldStrengthFormat.TESLA, + src_format=UnitMagneticFieldStrengthFormat.TESLA, + value=3.14, ) # OR run async with more info - ( - await get_magnetic_field_strength_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitMagneticFieldStrengthFormat.TESLA, - src_format=UnitMagneticFieldStrengthFormat.TESLA, - value=3.14, - ) + response: Response[ + Optional[Union[UnitMagneticFieldStrengthConversion, Error]] + ] = await get_magnetic_field_strength_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitMagneticFieldStrengthFormat.TESLA, + src_format=UnitMagneticFieldStrengthFormat.TESLA, + value=3.14, ) @@ -1961,15 +2523,26 @@ def test_get_magnetic_flux_unit_conversion(): # Create our client. client = ClientFromEnv() - get_magnetic_flux_unit_conversion.sync( + result: Optional[ + Union[UnitMagneticFluxConversion, Error] + ] = get_magnetic_flux_unit_conversion.sync( client=client, output_format=UnitMagneticFluxFormat.WEBER, src_format=UnitMagneticFluxFormat.WEBER, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitMagneticFluxConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_magnetic_flux_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitMagneticFluxConversion, Error]] + ] = get_magnetic_flux_unit_conversion.sync_detailed( client=client, output_format=UnitMagneticFluxFormat.WEBER, src_format=UnitMagneticFluxFormat.WEBER, @@ -1984,7 +2557,9 @@ async def test_get_magnetic_flux_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_magnetic_flux_unit_conversion.asyncio( + result: Optional[ + Union[UnitMagneticFluxConversion, Error] + ] = await get_magnetic_flux_unit_conversion.asyncio( client=client, output_format=UnitMagneticFluxFormat.WEBER, src_format=UnitMagneticFluxFormat.WEBER, @@ -1992,13 +2567,13 @@ async def test_get_magnetic_flux_unit_conversion_async(): ) # OR run async with more info - ( - await get_magnetic_flux_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitMagneticFluxFormat.WEBER, - src_format=UnitMagneticFluxFormat.WEBER, - value=3.14, - ) + response: Response[ + Optional[Union[UnitMagneticFluxConversion, Error]] + ] = await get_magnetic_flux_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitMagneticFluxFormat.WEBER, + src_format=UnitMagneticFluxFormat.WEBER, + value=3.14, ) @@ -2007,15 +2582,24 @@ def test_get_mass_unit_conversion(): # Create our client. client = ClientFromEnv() - get_mass_unit_conversion.sync( + result: Optional[Union[UnitMassConversion, Error]] = get_mass_unit_conversion.sync( client=client, output_format=UnitMassFormat.GRAM, src_format=UnitMassFormat.GRAM, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitMassConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_mass_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitMassConversion, Error]] + ] = get_mass_unit_conversion.sync_detailed( client=client, output_format=UnitMassFormat.GRAM, src_format=UnitMassFormat.GRAM, @@ -2030,7 +2614,9 @@ async def test_get_mass_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_mass_unit_conversion.asyncio( + result: Optional[ + Union[UnitMassConversion, Error] + ] = await get_mass_unit_conversion.asyncio( client=client, output_format=UnitMassFormat.GRAM, src_format=UnitMassFormat.GRAM, @@ -2038,7 +2624,9 @@ async def test_get_mass_unit_conversion_async(): ) # OR run async with more info - await get_mass_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitMassConversion, Error]] + ] = await get_mass_unit_conversion.asyncio_detailed( client=client, output_format=UnitMassFormat.GRAM, src_format=UnitMassFormat.GRAM, @@ -2051,21 +2639,30 @@ def test_get_metric_power_cubed_unit_conversion(): # Create our client. client = ClientFromEnv() - get_metric_power_cubed_unit_conversion.sync( + result: Optional[ + Union[UnitMetricPowerCubedConversion, Error] + ] = get_metric_power_cubed_unit_conversion.sync( client=client, output_format=UnitMetricPower.ATTO, src_format=UnitMetricPower.ATTO, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitMetricPowerCubedConversion = result + print(body) + # OR if you need more info (e.g. status_code) - ( - get_metric_power_cubed_unit_conversion.sync_detailed( - client=client, - output_format=UnitMetricPower.ATTO, - src_format=UnitMetricPower.ATTO, - value=3.14, - ) + response: Response[ + Optional[Union[UnitMetricPowerCubedConversion, Error]] + ] = get_metric_power_cubed_unit_conversion.sync_detailed( + client=client, + output_format=UnitMetricPower.ATTO, + src_format=UnitMetricPower.ATTO, + value=3.14, ) @@ -2076,23 +2673,23 @@ async def test_get_metric_power_cubed_unit_conversion_async(): # Create our client. client = ClientFromEnv() - ( - await get_metric_power_cubed_unit_conversion.asyncio( - client=client, - output_format=UnitMetricPower.ATTO, - src_format=UnitMetricPower.ATTO, - value=3.14, - ) + result: Optional[ + Union[UnitMetricPowerCubedConversion, Error] + ] = await get_metric_power_cubed_unit_conversion.asyncio( + client=client, + output_format=UnitMetricPower.ATTO, + src_format=UnitMetricPower.ATTO, + value=3.14, ) # OR run async with more info - ( - await get_metric_power_cubed_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitMetricPower.ATTO, - src_format=UnitMetricPower.ATTO, - value=3.14, - ) + response: Response[ + Optional[Union[UnitMetricPowerCubedConversion, Error]] + ] = await get_metric_power_cubed_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitMetricPower.ATTO, + src_format=UnitMetricPower.ATTO, + value=3.14, ) @@ -2101,15 +2698,26 @@ def test_get_metric_power_unit_conversion(): # Create our client. client = ClientFromEnv() - get_metric_power_unit_conversion.sync( + result: Optional[ + Union[UnitMetricPowerConversion, Error] + ] = get_metric_power_unit_conversion.sync( client=client, output_format=UnitMetricPower.ATTO, src_format=UnitMetricPower.ATTO, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitMetricPowerConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_metric_power_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitMetricPowerConversion, Error]] + ] = get_metric_power_unit_conversion.sync_detailed( client=client, output_format=UnitMetricPower.ATTO, src_format=UnitMetricPower.ATTO, @@ -2124,7 +2732,9 @@ async def test_get_metric_power_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_metric_power_unit_conversion.asyncio( + result: Optional[ + Union[UnitMetricPowerConversion, Error] + ] = await get_metric_power_unit_conversion.asyncio( client=client, output_format=UnitMetricPower.ATTO, src_format=UnitMetricPower.ATTO, @@ -2132,13 +2742,13 @@ async def test_get_metric_power_unit_conversion_async(): ) # OR run async with more info - ( - await get_metric_power_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitMetricPower.ATTO, - src_format=UnitMetricPower.ATTO, - value=3.14, - ) + response: Response[ + Optional[Union[UnitMetricPowerConversion, Error]] + ] = await get_metric_power_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitMetricPower.ATTO, + src_format=UnitMetricPower.ATTO, + value=3.14, ) @@ -2147,23 +2757,30 @@ def test_get_metric_power_squared_unit_conversion(): # Create our client. client = ClientFromEnv() - ( - get_metric_power_squared_unit_conversion.sync( - client=client, - output_format=UnitMetricPower.ATTO, - src_format=UnitMetricPower.ATTO, - value=3.14, - ) + result: Optional[ + Union[UnitMetricPowerSquaredConversion, Error] + ] = get_metric_power_squared_unit_conversion.sync( + client=client, + output_format=UnitMetricPower.ATTO, + src_format=UnitMetricPower.ATTO, + value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitMetricPowerSquaredConversion = result + print(body) + # OR if you need more info (e.g. status_code) - ( - get_metric_power_squared_unit_conversion.sync_detailed( - client=client, - output_format=UnitMetricPower.ATTO, - src_format=UnitMetricPower.ATTO, - value=3.14, - ) + response: Response[ + Optional[Union[UnitMetricPowerSquaredConversion, Error]] + ] = get_metric_power_squared_unit_conversion.sync_detailed( + client=client, + output_format=UnitMetricPower.ATTO, + src_format=UnitMetricPower.ATTO, + value=3.14, ) @@ -2174,23 +2791,23 @@ async def test_get_metric_power_squared_unit_conversion_async(): # Create our client. client = ClientFromEnv() - ( - await get_metric_power_squared_unit_conversion.asyncio( - client=client, - output_format=UnitMetricPower.ATTO, - src_format=UnitMetricPower.ATTO, - value=3.14, - ) + result: Optional[ + Union[UnitMetricPowerSquaredConversion, Error] + ] = await get_metric_power_squared_unit_conversion.asyncio( + client=client, + output_format=UnitMetricPower.ATTO, + src_format=UnitMetricPower.ATTO, + value=3.14, ) # OR run async with more info - ( - await get_metric_power_squared_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitMetricPower.ATTO, - src_format=UnitMetricPower.ATTO, - value=3.14, - ) + response: Response[ + Optional[Union[UnitMetricPowerSquaredConversion, Error]] + ] = await get_metric_power_squared_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitMetricPower.ATTO, + src_format=UnitMetricPower.ATTO, + value=3.14, ) @@ -2199,15 +2816,26 @@ def test_get_power_unit_conversion(): # Create our client. client = ClientFromEnv() - get_power_unit_conversion.sync( + result: Optional[ + Union[UnitPowerConversion, Error] + ] = get_power_unit_conversion.sync( client=client, output_format=UnitPowerFormat.WATT, src_format=UnitPowerFormat.WATT, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitPowerConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_power_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitPowerConversion, Error]] + ] = get_power_unit_conversion.sync_detailed( client=client, output_format=UnitPowerFormat.WATT, src_format=UnitPowerFormat.WATT, @@ -2222,7 +2850,9 @@ async def test_get_power_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_power_unit_conversion.asyncio( + result: Optional[ + Union[UnitPowerConversion, Error] + ] = await get_power_unit_conversion.asyncio( client=client, output_format=UnitPowerFormat.WATT, src_format=UnitPowerFormat.WATT, @@ -2230,7 +2860,9 @@ async def test_get_power_unit_conversion_async(): ) # OR run async with more info - await get_power_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitPowerConversion, Error]] + ] = await get_power_unit_conversion.asyncio_detailed( client=client, output_format=UnitPowerFormat.WATT, src_format=UnitPowerFormat.WATT, @@ -2243,15 +2875,26 @@ def test_get_pressure_unit_conversion(): # Create our client. client = ClientFromEnv() - get_pressure_unit_conversion.sync( + result: Optional[ + Union[UnitPressureConversion, Error] + ] = get_pressure_unit_conversion.sync( client=client, output_format=UnitPressureFormat.PASCAL, src_format=UnitPressureFormat.PASCAL, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitPressureConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_pressure_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitPressureConversion, Error]] + ] = get_pressure_unit_conversion.sync_detailed( client=client, output_format=UnitPressureFormat.PASCAL, src_format=UnitPressureFormat.PASCAL, @@ -2266,7 +2909,9 @@ async def test_get_pressure_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_pressure_unit_conversion.asyncio( + result: Optional[ + Union[UnitPressureConversion, Error] + ] = await get_pressure_unit_conversion.asyncio( client=client, output_format=UnitPressureFormat.PASCAL, src_format=UnitPressureFormat.PASCAL, @@ -2274,7 +2919,9 @@ async def test_get_pressure_unit_conversion_async(): ) # OR run async with more info - await get_pressure_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitPressureConversion, Error]] + ] = await get_pressure_unit_conversion.asyncio_detailed( client=client, output_format=UnitPressureFormat.PASCAL, src_format=UnitPressureFormat.PASCAL, @@ -2287,15 +2934,26 @@ def test_get_radiation_unit_conversion(): # Create our client. client = ClientFromEnv() - get_radiation_unit_conversion.sync( + result: Optional[ + Union[UnitRadiationConversion, Error] + ] = get_radiation_unit_conversion.sync( client=client, output_format=UnitRadiationFormat.GRAY, src_format=UnitRadiationFormat.GRAY, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitRadiationConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_radiation_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitRadiationConversion, Error]] + ] = get_radiation_unit_conversion.sync_detailed( client=client, output_format=UnitRadiationFormat.GRAY, src_format=UnitRadiationFormat.GRAY, @@ -2310,7 +2968,9 @@ async def test_get_radiation_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_radiation_unit_conversion.asyncio( + result: Optional[ + Union[UnitRadiationConversion, Error] + ] = await get_radiation_unit_conversion.asyncio( client=client, output_format=UnitRadiationFormat.GRAY, src_format=UnitRadiationFormat.GRAY, @@ -2318,7 +2978,9 @@ async def test_get_radiation_unit_conversion_async(): ) # OR run async with more info - await get_radiation_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitRadiationConversion, Error]] + ] = await get_radiation_unit_conversion.asyncio_detailed( client=client, output_format=UnitRadiationFormat.GRAY, src_format=UnitRadiationFormat.GRAY, @@ -2331,15 +2993,26 @@ def test_get_radioactivity_unit_conversion(): # Create our client. client = ClientFromEnv() - get_radioactivity_unit_conversion.sync( + result: Optional[ + Union[UnitRadioactivityConversion, Error] + ] = get_radioactivity_unit_conversion.sync( client=client, output_format=UnitRadioactivityFormat.BECQUEREL, src_format=UnitRadioactivityFormat.BECQUEREL, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitRadioactivityConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_radioactivity_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitRadioactivityConversion, Error]] + ] = get_radioactivity_unit_conversion.sync_detailed( client=client, output_format=UnitRadioactivityFormat.BECQUEREL, src_format=UnitRadioactivityFormat.BECQUEREL, @@ -2354,7 +3027,9 @@ async def test_get_radioactivity_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_radioactivity_unit_conversion.asyncio( + result: Optional[ + Union[UnitRadioactivityConversion, Error] + ] = await get_radioactivity_unit_conversion.asyncio( client=client, output_format=UnitRadioactivityFormat.BECQUEREL, src_format=UnitRadioactivityFormat.BECQUEREL, @@ -2362,13 +3037,13 @@ async def test_get_radioactivity_unit_conversion_async(): ) # OR run async with more info - ( - await get_radioactivity_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitRadioactivityFormat.BECQUEREL, - src_format=UnitRadioactivityFormat.BECQUEREL, - value=3.14, - ) + response: Response[ + Optional[Union[UnitRadioactivityConversion, Error]] + ] = await get_radioactivity_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitRadioactivityFormat.BECQUEREL, + src_format=UnitRadioactivityFormat.BECQUEREL, + value=3.14, ) @@ -2377,15 +3052,26 @@ def test_get_solid_angle_unit_conversion(): # Create our client. client = ClientFromEnv() - get_solid_angle_unit_conversion.sync( + result: Optional[ + Union[UnitSolidAngleConversion, Error] + ] = get_solid_angle_unit_conversion.sync( client=client, output_format=UnitSolidAngleFormat.STERADIAN, src_format=UnitSolidAngleFormat.STERADIAN, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitSolidAngleConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_solid_angle_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitSolidAngleConversion, Error]] + ] = get_solid_angle_unit_conversion.sync_detailed( client=client, output_format=UnitSolidAngleFormat.STERADIAN, src_format=UnitSolidAngleFormat.STERADIAN, @@ -2400,7 +3086,9 @@ async def test_get_solid_angle_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_solid_angle_unit_conversion.asyncio( + result: Optional[ + Union[UnitSolidAngleConversion, Error] + ] = await get_solid_angle_unit_conversion.asyncio( client=client, output_format=UnitSolidAngleFormat.STERADIAN, src_format=UnitSolidAngleFormat.STERADIAN, @@ -2408,13 +3096,13 @@ async def test_get_solid_angle_unit_conversion_async(): ) # OR run async with more info - ( - await get_solid_angle_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitSolidAngleFormat.STERADIAN, - src_format=UnitSolidAngleFormat.STERADIAN, - value=3.14, - ) + response: Response[ + Optional[Union[UnitSolidAngleConversion, Error]] + ] = await get_solid_angle_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitSolidAngleFormat.STERADIAN, + src_format=UnitSolidAngleFormat.STERADIAN, + value=3.14, ) @@ -2423,15 +3111,26 @@ def test_get_temperature_unit_conversion(): # Create our client. client = ClientFromEnv() - get_temperature_unit_conversion.sync( + result: Optional[ + Union[UnitTemperatureConversion, Error] + ] = get_temperature_unit_conversion.sync( client=client, output_format=UnitTemperatureFormat.KELVIN, src_format=UnitTemperatureFormat.KELVIN, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitTemperatureConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_temperature_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitTemperatureConversion, Error]] + ] = get_temperature_unit_conversion.sync_detailed( client=client, output_format=UnitTemperatureFormat.KELVIN, src_format=UnitTemperatureFormat.KELVIN, @@ -2446,7 +3145,9 @@ async def test_get_temperature_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_temperature_unit_conversion.asyncio( + result: Optional[ + Union[UnitTemperatureConversion, Error] + ] = await get_temperature_unit_conversion.asyncio( client=client, output_format=UnitTemperatureFormat.KELVIN, src_format=UnitTemperatureFormat.KELVIN, @@ -2454,13 +3155,13 @@ async def test_get_temperature_unit_conversion_async(): ) # OR run async with more info - ( - await get_temperature_unit_conversion.asyncio_detailed( - client=client, - output_format=UnitTemperatureFormat.KELVIN, - src_format=UnitTemperatureFormat.KELVIN, - value=3.14, - ) + response: Response[ + Optional[Union[UnitTemperatureConversion, Error]] + ] = await get_temperature_unit_conversion.asyncio_detailed( + client=client, + output_format=UnitTemperatureFormat.KELVIN, + src_format=UnitTemperatureFormat.KELVIN, + value=3.14, ) @@ -2469,15 +3170,24 @@ def test_get_time_unit_conversion(): # Create our client. client = ClientFromEnv() - get_time_unit_conversion.sync( + result: Optional[Union[UnitTimeConversion, Error]] = get_time_unit_conversion.sync( client=client, output_format=UnitTimeFormat.SECOND, src_format=UnitTimeFormat.SECOND, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitTimeConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_time_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitTimeConversion, Error]] + ] = get_time_unit_conversion.sync_detailed( client=client, output_format=UnitTimeFormat.SECOND, src_format=UnitTimeFormat.SECOND, @@ -2492,7 +3202,9 @@ async def test_get_time_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_time_unit_conversion.asyncio( + result: Optional[ + Union[UnitTimeConversion, Error] + ] = await get_time_unit_conversion.asyncio( client=client, output_format=UnitTimeFormat.SECOND, src_format=UnitTimeFormat.SECOND, @@ -2500,7 +3212,9 @@ async def test_get_time_unit_conversion_async(): ) # OR run async with more info - await get_time_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitTimeConversion, Error]] + ] = await get_time_unit_conversion.asyncio_detailed( client=client, output_format=UnitTimeFormat.SECOND, src_format=UnitTimeFormat.SECOND, @@ -2513,15 +3227,26 @@ def test_get_velocity_unit_conversion(): # Create our client. client = ClientFromEnv() - get_velocity_unit_conversion.sync( + result: Optional[ + Union[UnitVelocityConversion, Error] + ] = get_velocity_unit_conversion.sync( client=client, output_format=UnitVelocityFormat.METERS_PER_SECOND, src_format=UnitVelocityFormat.METERS_PER_SECOND, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitVelocityConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_velocity_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitVelocityConversion, Error]] + ] = get_velocity_unit_conversion.sync_detailed( client=client, output_format=UnitVelocityFormat.METERS_PER_SECOND, src_format=UnitVelocityFormat.METERS_PER_SECOND, @@ -2536,7 +3261,9 @@ async def test_get_velocity_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_velocity_unit_conversion.asyncio( + result: Optional[ + Union[UnitVelocityConversion, Error] + ] = await get_velocity_unit_conversion.asyncio( client=client, output_format=UnitVelocityFormat.METERS_PER_SECOND, src_format=UnitVelocityFormat.METERS_PER_SECOND, @@ -2544,7 +3271,9 @@ async def test_get_velocity_unit_conversion_async(): ) # OR run async with more info - await get_velocity_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitVelocityConversion, Error]] + ] = await get_velocity_unit_conversion.asyncio_detailed( client=client, output_format=UnitVelocityFormat.METERS_PER_SECOND, src_format=UnitVelocityFormat.METERS_PER_SECOND, @@ -2557,15 +3286,26 @@ def test_get_voltage_unit_conversion(): # Create our client. client = ClientFromEnv() - get_voltage_unit_conversion.sync( + result: Optional[ + Union[UnitVoltageConversion, Error] + ] = get_voltage_unit_conversion.sync( client=client, output_format=UnitVoltageFormat.VOLT, src_format=UnitVoltageFormat.VOLT, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitVoltageConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_voltage_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitVoltageConversion, Error]] + ] = get_voltage_unit_conversion.sync_detailed( client=client, output_format=UnitVoltageFormat.VOLT, src_format=UnitVoltageFormat.VOLT, @@ -2580,7 +3320,9 @@ async def test_get_voltage_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_voltage_unit_conversion.asyncio( + result: Optional[ + Union[UnitVoltageConversion, Error] + ] = await get_voltage_unit_conversion.asyncio( client=client, output_format=UnitVoltageFormat.VOLT, src_format=UnitVoltageFormat.VOLT, @@ -2588,7 +3330,9 @@ async def test_get_voltage_unit_conversion_async(): ) # OR run async with more info - await get_voltage_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitVoltageConversion, Error]] + ] = await get_voltage_unit_conversion.asyncio_detailed( client=client, output_format=UnitVoltageFormat.VOLT, src_format=UnitVoltageFormat.VOLT, @@ -2601,15 +3345,26 @@ def test_get_volume_unit_conversion(): # Create our client. client = ClientFromEnv() - get_volume_unit_conversion.sync( + result: Optional[ + Union[UnitVolumeConversion, Error] + ] = get_volume_unit_conversion.sync( client=client, output_format=UnitVolumeFormat.CUBIC_METER, src_format=UnitVolumeFormat.CUBIC_METER, value=3.14, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UnitVolumeConversion = result + print(body) + # OR if you need more info (e.g. status_code) - get_volume_unit_conversion.sync_detailed( + response: Response[ + Optional[Union[UnitVolumeConversion, Error]] + ] = get_volume_unit_conversion.sync_detailed( client=client, output_format=UnitVolumeFormat.CUBIC_METER, src_format=UnitVolumeFormat.CUBIC_METER, @@ -2624,7 +3379,9 @@ async def test_get_volume_unit_conversion_async(): # Create our client. client = ClientFromEnv() - await get_volume_unit_conversion.asyncio( + result: Optional[ + Union[UnitVolumeConversion, Error] + ] = await get_volume_unit_conversion.asyncio( client=client, output_format=UnitVolumeFormat.CUBIC_METER, src_format=UnitVolumeFormat.CUBIC_METER, @@ -2632,7 +3389,9 @@ async def test_get_volume_unit_conversion_async(): ) # OR run async with more info - await get_volume_unit_conversion.asyncio_detailed( + response: Response[ + Optional[Union[UnitVolumeConversion, Error]] + ] = await get_volume_unit_conversion.asyncio_detailed( client=client, output_format=UnitVolumeFormat.CUBIC_METER, src_format=UnitVolumeFormat.CUBIC_METER, @@ -2645,12 +3404,19 @@ def test_delete_user_self(): # Create our client. client = ClientFromEnv() - delete_user_self.sync( + result: Optional[Error] = delete_user_self.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + # OR if you need more info (e.g. status_code) - delete_user_self.sync_detailed( + response: Response[Optional[Error]] = delete_user_self.sync_detailed( client=client, ) @@ -2662,12 +3428,12 @@ async def test_delete_user_self_async(): # Create our client. client = ClientFromEnv() - await delete_user_self.asyncio( + result: Optional[Error] = await delete_user_self.asyncio( client=client, ) # OR run async with more info - await delete_user_self.asyncio_detailed( + response: Response[Optional[Error]] = await delete_user_self.asyncio_detailed( client=client, ) @@ -2677,12 +3443,19 @@ def test_get_user_self(): # Create our client. client = ClientFromEnv() - get_user_self.sync( + result: Optional[Union[User, Error]] = get_user_self.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: User = result + print(body) + # OR if you need more info (e.g. status_code) - get_user_self.sync_detailed( + response: Response[Optional[Union[User, Error]]] = get_user_self.sync_detailed( client=client, ) @@ -2694,12 +3467,14 @@ async def test_get_user_self_async(): # Create our client. client = ClientFromEnv() - await get_user_self.asyncio( + result: Optional[Union[User, Error]] = await get_user_self.asyncio( client=client, ) # OR run async with more info - await get_user_self.asyncio_detailed( + response: Response[ + Optional[Union[User, Error]] + ] = await get_user_self.asyncio_detailed( client=client, ) @@ -2709,7 +3484,7 @@ def test_update_user_self(): # Create our client. client = ClientFromEnv() - update_user_self.sync( + result: Optional[Union[User, Error]] = update_user_self.sync( client=client, body=UpdateUser( company="", @@ -2721,8 +3496,15 @@ def test_update_user_self(): ), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: User = result + print(body) + # OR if you need more info (e.g. status_code) - update_user_self.sync_detailed( + response: Response[Optional[Union[User, Error]]] = update_user_self.sync_detailed( client=client, body=UpdateUser( company="", @@ -2742,7 +3524,7 @@ async def test_update_user_self_async(): # Create our client. client = ClientFromEnv() - await update_user_self.asyncio( + result: Optional[Union[User, Error]] = await update_user_self.asyncio( client=client, body=UpdateUser( company="", @@ -2755,7 +3537,9 @@ async def test_update_user_self_async(): ) # OR run async with more info - await update_user_self.asyncio_detailed( + response: Response[ + Optional[Union[User, Error]] + ] = await update_user_self.asyncio_detailed( client=client, body=UpdateUser( company="", @@ -2773,15 +3557,26 @@ def test_user_list_api_calls(): # Create our client. client = ClientFromEnv() - user_list_api_calls.sync( + result: Optional[ + Union[ApiCallWithPriceResultsPage, Error] + ] = user_list_api_calls.sync( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] page_token=None, # Optional[str] ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ApiCallWithPriceResultsPage = result + print(body) + # OR if you need more info (e.g. status_code) - user_list_api_calls.sync_detailed( + response: Response[ + Optional[Union[ApiCallWithPriceResultsPage, Error]] + ] = user_list_api_calls.sync_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -2796,7 +3591,9 @@ async def test_user_list_api_calls_async(): # Create our client. client = ClientFromEnv() - await user_list_api_calls.asyncio( + result: Optional[ + Union[ApiCallWithPriceResultsPage, Error] + ] = await user_list_api_calls.asyncio( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -2804,7 +3601,9 @@ async def test_user_list_api_calls_async(): ) # OR run async with more info - await user_list_api_calls.asyncio_detailed( + response: Response[ + Optional[Union[ApiCallWithPriceResultsPage, Error]] + ] = await user_list_api_calls.asyncio_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -2817,13 +3616,22 @@ def test_get_api_call_for_user(): # Create our client. client = ClientFromEnv() - get_api_call_for_user.sync( + result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_user.sync( client=client, id="", ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ApiCallWithPrice = result + print(body) + # OR if you need more info (e.g. status_code) - get_api_call_for_user.sync_detailed( + response: Response[ + Optional[Union[ApiCallWithPrice, Error]] + ] = get_api_call_for_user.sync_detailed( client=client, id="", ) @@ -2836,13 +3644,17 @@ async def test_get_api_call_for_user_async(): # Create our client. client = ClientFromEnv() - await get_api_call_for_user.asyncio( + result: Optional[ + Union[ApiCallWithPrice, Error] + ] = await get_api_call_for_user.asyncio( client=client, id="", ) # OR run async with more info - await get_api_call_for_user.asyncio_detailed( + response: Response[ + Optional[Union[ApiCallWithPrice, Error]] + ] = await get_api_call_for_user.asyncio_detailed( client=client, id="", ) @@ -2853,15 +3665,24 @@ def test_list_api_tokens_for_user(): # Create our client. client = ClientFromEnv() - list_api_tokens_for_user.sync( + result: Optional[Union[ApiTokenResultsPage, Error]] = list_api_tokens_for_user.sync( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] page_token=None, # Optional[str] ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ApiTokenResultsPage = result + print(body) + # OR if you need more info (e.g. status_code) - list_api_tokens_for_user.sync_detailed( + response: Response[ + Optional[Union[ApiTokenResultsPage, Error]] + ] = list_api_tokens_for_user.sync_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -2876,7 +3697,9 @@ async def test_list_api_tokens_for_user_async(): # Create our client. client = ClientFromEnv() - await list_api_tokens_for_user.asyncio( + result: Optional[ + Union[ApiTokenResultsPage, Error] + ] = await list_api_tokens_for_user.asyncio( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -2884,7 +3707,9 @@ async def test_list_api_tokens_for_user_async(): ) # OR run async with more info - await list_api_tokens_for_user.asyncio_detailed( + response: Response[ + Optional[Union[ApiTokenResultsPage, Error]] + ] = await list_api_tokens_for_user.asyncio_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -2897,12 +3722,21 @@ def test_create_api_token_for_user(): # Create our client. client = ClientFromEnv() - create_api_token_for_user.sync( + result: Optional[Union[ApiToken, Error]] = create_api_token_for_user.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ApiToken = result + print(body) + # OR if you need more info (e.g. status_code) - create_api_token_for_user.sync_detailed( + response: Response[ + Optional[Union[ApiToken, Error]] + ] = create_api_token_for_user.sync_detailed( client=client, ) @@ -2914,12 +3748,14 @@ async def test_create_api_token_for_user_async(): # Create our client. client = ClientFromEnv() - await create_api_token_for_user.asyncio( + result: Optional[Union[ApiToken, Error]] = await create_api_token_for_user.asyncio( client=client, ) # OR run async with more info - await create_api_token_for_user.asyncio_detailed( + response: Response[ + Optional[Union[ApiToken, Error]] + ] = await create_api_token_for_user.asyncio_detailed( client=client, ) @@ -2929,13 +3765,20 @@ def test_delete_api_token_for_user(): # Create our client. client = ClientFromEnv() - delete_api_token_for_user.sync( + result: Optional[Error] = delete_api_token_for_user.sync( client=client, token="", ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + # OR if you need more info (e.g. status_code) - delete_api_token_for_user.sync_detailed( + response: Response[Optional[Error]] = delete_api_token_for_user.sync_detailed( client=client, token="", ) @@ -2948,13 +3791,15 @@ async def test_delete_api_token_for_user_async(): # Create our client. client = ClientFromEnv() - await delete_api_token_for_user.asyncio( + result: Optional[Error] = await delete_api_token_for_user.asyncio( client=client, token="", ) # OR run async with more info - await delete_api_token_for_user.asyncio_detailed( + response: Response[ + Optional[Error] + ] = await delete_api_token_for_user.asyncio_detailed( client=client, token="", ) @@ -2965,13 +3810,22 @@ def test_get_api_token_for_user(): # Create our client. client = ClientFromEnv() - get_api_token_for_user.sync( + result: Optional[Union[ApiToken, Error]] = get_api_token_for_user.sync( client=client, token="", ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ApiToken = result + print(body) + # OR if you need more info (e.g. status_code) - get_api_token_for_user.sync_detailed( + response: Response[ + Optional[Union[ApiToken, Error]] + ] = get_api_token_for_user.sync_detailed( client=client, token="", ) @@ -2984,13 +3838,15 @@ async def test_get_api_token_for_user_async(): # Create our client. client = ClientFromEnv() - await get_api_token_for_user.asyncio( + result: Optional[Union[ApiToken, Error]] = await get_api_token_for_user.asyncio( client=client, token="", ) # OR run async with more info - await get_api_token_for_user.asyncio_detailed( + response: Response[ + Optional[Union[ApiToken, Error]] + ] = await get_api_token_for_user.asyncio_detailed( client=client, token="", ) @@ -3001,12 +3857,21 @@ def test_get_user_self_extended(): # Create our client. client = ClientFromEnv() - get_user_self_extended.sync( + result: Optional[Union[ExtendedUser, Error]] = get_user_self_extended.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ExtendedUser = result + print(body) + # OR if you need more info (e.g. status_code) - get_user_self_extended.sync_detailed( + response: Response[ + Optional[Union[ExtendedUser, Error]] + ] = get_user_self_extended.sync_detailed( client=client, ) @@ -3018,12 +3883,14 @@ async def test_get_user_self_extended_async(): # Create our client. client = ClientFromEnv() - await get_user_self_extended.asyncio( + result: Optional[Union[ExtendedUser, Error]] = await get_user_self_extended.asyncio( client=client, ) # OR run async with more info - await get_user_self_extended.asyncio_detailed( + response: Response[ + Optional[Union[ExtendedUser, Error]] + ] = await get_user_self_extended.asyncio_detailed( client=client, ) @@ -3065,12 +3932,21 @@ def test_get_user_onboarding_self(): # Create our client. client = ClientFromEnv() - get_user_onboarding_self.sync( + result: Optional[Union[Onboarding, Error]] = get_user_onboarding_self.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Onboarding = result + print(body) + # OR if you need more info (e.g. status_code) - get_user_onboarding_self.sync_detailed( + response: Response[ + Optional[Union[Onboarding, Error]] + ] = get_user_onboarding_self.sync_detailed( client=client, ) @@ -3082,12 +3958,14 @@ async def test_get_user_onboarding_self_async(): # Create our client. client = ClientFromEnv() - await get_user_onboarding_self.asyncio( + result: Optional[Union[Onboarding, Error]] = await get_user_onboarding_self.asyncio( client=client, ) # OR run async with more info - await get_user_onboarding_self.asyncio_detailed( + response: Response[ + Optional[Union[Onboarding, Error]] + ] = await get_user_onboarding_self.asyncio_detailed( client=client, ) @@ -3097,12 +3975,21 @@ def test_delete_payment_information_for_user(): # Create our client. client = ClientFromEnv() - delete_payment_information_for_user.sync( + result: Optional[Error] = delete_payment_information_for_user.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + # OR if you need more info (e.g. status_code) - delete_payment_information_for_user.sync_detailed( + response: Response[ + Optional[Error] + ] = delete_payment_information_for_user.sync_detailed( client=client, ) @@ -3114,12 +4001,14 @@ async def test_delete_payment_information_for_user_async(): # Create our client. client = ClientFromEnv() - await delete_payment_information_for_user.asyncio( + result: Optional[Error] = await delete_payment_information_for_user.asyncio( client=client, ) # OR run async with more info - await delete_payment_information_for_user.asyncio_detailed( + response: Response[ + Optional[Error] + ] = await delete_payment_information_for_user.asyncio_detailed( client=client, ) @@ -3129,12 +4018,21 @@ def test_get_payment_information_for_user(): # Create our client. client = ClientFromEnv() - get_payment_information_for_user.sync( + result: Optional[Union[Customer, Error]] = get_payment_information_for_user.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Customer = result + print(body) + # OR if you need more info (e.g. status_code) - get_payment_information_for_user.sync_detailed( + response: Response[ + Optional[Union[Customer, Error]] + ] = get_payment_information_for_user.sync_detailed( client=client, ) @@ -3146,12 +4044,16 @@ async def test_get_payment_information_for_user_async(): # Create our client. client = ClientFromEnv() - await get_payment_information_for_user.asyncio( + result: Optional[ + Union[Customer, Error] + ] = await get_payment_information_for_user.asyncio( client=client, ) # OR run async with more info - await get_payment_information_for_user.asyncio_detailed( + response: Response[ + Optional[Union[Customer, Error]] + ] = await get_payment_information_for_user.asyncio_detailed( client=client, ) @@ -3161,7 +4063,7 @@ def test_create_payment_information_for_user(): # Create our client. client = ClientFromEnv() - create_payment_information_for_user.sync( + result: Optional[Union[Customer, Error]] = create_payment_information_for_user.sync( client=client, body=BillingInfo( name="", @@ -3169,8 +4071,17 @@ def test_create_payment_information_for_user(): ), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Customer = result + print(body) + # OR if you need more info (e.g. status_code) - create_payment_information_for_user.sync_detailed( + response: Response[ + Optional[Union[Customer, Error]] + ] = create_payment_information_for_user.sync_detailed( client=client, body=BillingInfo( name="", @@ -3186,7 +4097,9 @@ async def test_create_payment_information_for_user_async(): # Create our client. client = ClientFromEnv() - await create_payment_information_for_user.asyncio( + result: Optional[ + Union[Customer, Error] + ] = await create_payment_information_for_user.asyncio( client=client, body=BillingInfo( name="", @@ -3195,7 +4108,9 @@ async def test_create_payment_information_for_user_async(): ) # OR run async with more info - await create_payment_information_for_user.asyncio_detailed( + response: Response[ + Optional[Union[Customer, Error]] + ] = await create_payment_information_for_user.asyncio_detailed( client=client, body=BillingInfo( name="", @@ -3209,7 +4124,7 @@ def test_update_payment_information_for_user(): # Create our client. client = ClientFromEnv() - update_payment_information_for_user.sync( + result: Optional[Union[Customer, Error]] = update_payment_information_for_user.sync( client=client, body=BillingInfo( name="", @@ -3217,8 +4132,17 @@ def test_update_payment_information_for_user(): ), ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Customer = result + print(body) + # OR if you need more info (e.g. status_code) - update_payment_information_for_user.sync_detailed( + response: Response[ + Optional[Union[Customer, Error]] + ] = update_payment_information_for_user.sync_detailed( client=client, body=BillingInfo( name="", @@ -3234,7 +4158,9 @@ async def test_update_payment_information_for_user_async(): # Create our client. client = ClientFromEnv() - await update_payment_information_for_user.asyncio( + result: Optional[ + Union[Customer, Error] + ] = await update_payment_information_for_user.asyncio( client=client, body=BillingInfo( name="", @@ -3243,7 +4169,9 @@ async def test_update_payment_information_for_user_async(): ) # OR run async with more info - await update_payment_information_for_user.asyncio_detailed( + response: Response[ + Optional[Union[Customer, Error]] + ] = await update_payment_information_for_user.asyncio_detailed( client=client, body=BillingInfo( name="", @@ -3257,12 +4185,21 @@ def test_get_payment_balance_for_user(): # Create our client. client = ClientFromEnv() - get_payment_balance_for_user.sync( + result: Optional[Union[CustomerBalance, Error]] = get_payment_balance_for_user.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: CustomerBalance = result + print(body) + # OR if you need more info (e.g. status_code) - get_payment_balance_for_user.sync_detailed( + response: Response[ + Optional[Union[CustomerBalance, Error]] + ] = get_payment_balance_for_user.sync_detailed( client=client, ) @@ -3274,12 +4211,16 @@ async def test_get_payment_balance_for_user_async(): # Create our client. client = ClientFromEnv() - await get_payment_balance_for_user.asyncio( + result: Optional[ + Union[CustomerBalance, Error] + ] = await get_payment_balance_for_user.asyncio( client=client, ) # OR run async with more info - await get_payment_balance_for_user.asyncio_detailed( + response: Response[ + Optional[Union[CustomerBalance, Error]] + ] = await get_payment_balance_for_user.asyncio_detailed( client=client, ) @@ -3289,12 +4230,21 @@ def test_create_payment_intent_for_user(): # Create our client. client = ClientFromEnv() - create_payment_intent_for_user.sync( + result: Optional[Union[PaymentIntent, Error]] = create_payment_intent_for_user.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: PaymentIntent = result + print(body) + # OR if you need more info (e.g. status_code) - create_payment_intent_for_user.sync_detailed( + response: Response[ + Optional[Union[PaymentIntent, Error]] + ] = create_payment_intent_for_user.sync_detailed( client=client, ) @@ -3306,12 +4256,16 @@ async def test_create_payment_intent_for_user_async(): # Create our client. client = ClientFromEnv() - await create_payment_intent_for_user.asyncio( + result: Optional[ + Union[PaymentIntent, Error] + ] = await create_payment_intent_for_user.asyncio( client=client, ) # OR run async with more info - await create_payment_intent_for_user.asyncio_detailed( + response: Response[ + Optional[Union[PaymentIntent, Error]] + ] = await create_payment_intent_for_user.asyncio_detailed( client=client, ) @@ -3321,12 +4275,21 @@ def test_list_invoices_for_user(): # Create our client. client = ClientFromEnv() - list_invoices_for_user.sync( + result: Optional[Union[List[Invoice], Error]] = list_invoices_for_user.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: List[Invoice] = result + print(body) + # OR if you need more info (e.g. status_code) - list_invoices_for_user.sync_detailed( + response: Response[ + Optional[Union[List[Invoice], Error]] + ] = list_invoices_for_user.sync_detailed( client=client, ) @@ -3338,12 +4301,16 @@ async def test_list_invoices_for_user_async(): # Create our client. client = ClientFromEnv() - await list_invoices_for_user.asyncio( + result: Optional[ + Union[List[Invoice], Error] + ] = await list_invoices_for_user.asyncio( client=client, ) # OR run async with more info - await list_invoices_for_user.asyncio_detailed( + response: Response[ + Optional[Union[List[Invoice], Error]] + ] = await list_invoices_for_user.asyncio_detailed( client=client, ) @@ -3353,12 +4320,23 @@ def test_list_payment_methods_for_user(): # Create our client. client = ClientFromEnv() - list_payment_methods_for_user.sync( + result: Optional[ + Union[List[PaymentMethod], Error] + ] = list_payment_methods_for_user.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: List[PaymentMethod] = result + print(body) + # OR if you need more info (e.g. status_code) - list_payment_methods_for_user.sync_detailed( + response: Response[ + Optional[Union[List[PaymentMethod], Error]] + ] = list_payment_methods_for_user.sync_detailed( client=client, ) @@ -3370,12 +4348,16 @@ async def test_list_payment_methods_for_user_async(): # Create our client. client = ClientFromEnv() - await list_payment_methods_for_user.asyncio( + result: Optional[ + Union[List[PaymentMethod], Error] + ] = await list_payment_methods_for_user.asyncio( client=client, ) # OR run async with more info - await list_payment_methods_for_user.asyncio_detailed( + response: Response[ + Optional[Union[List[PaymentMethod], Error]] + ] = await list_payment_methods_for_user.asyncio_detailed( client=client, ) @@ -3385,13 +4367,20 @@ def test_delete_payment_method_for_user(): # Create our client. client = ClientFromEnv() - delete_payment_method_for_user.sync( + result: Optional[Error] = delete_payment_method_for_user.sync( client=client, id="", ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + # OR if you need more info (e.g. status_code) - delete_payment_method_for_user.sync_detailed( + response: Response[Optional[Error]] = delete_payment_method_for_user.sync_detailed( client=client, id="", ) @@ -3404,13 +4393,15 @@ async def test_delete_payment_method_for_user_async(): # Create our client. client = ClientFromEnv() - await delete_payment_method_for_user.asyncio( + result: Optional[Error] = await delete_payment_method_for_user.asyncio( client=client, id="", ) # OR run async with more info - await delete_payment_method_for_user.asyncio_detailed( + response: Response[ + Optional[Error] + ] = await delete_payment_method_for_user.asyncio_detailed( client=client, id="", ) @@ -3421,12 +4412,21 @@ def test_validate_customer_tax_information_for_user(): # Create our client. client = ClientFromEnv() - validate_customer_tax_information_for_user.sync( + result: Optional[Error] = validate_customer_tax_information_for_user.sync( client=client, ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + # OR if you need more info (e.g. status_code) - validate_customer_tax_information_for_user.sync_detailed( + response: Response[ + Optional[Error] + ] = validate_customer_tax_information_for_user.sync_detailed( client=client, ) @@ -3438,12 +4438,14 @@ async def test_validate_customer_tax_information_for_user_async(): # Create our client. client = ClientFromEnv() - await validate_customer_tax_information_for_user.asyncio( + result: Optional[Error] = await validate_customer_tax_information_for_user.asyncio( client=client, ) # OR run async with more info - await validate_customer_tax_information_for_user.asyncio_detailed( + response: Response[ + Optional[Error] + ] = await validate_customer_tax_information_for_user.asyncio_detailed( client=client, ) @@ -3453,13 +4455,22 @@ def test_get_session_for_user(): # Create our client. client = ClientFromEnv() - get_session_for_user.sync( + result: Optional[Union[Session, Error]] = get_session_for_user.sync( client=client, token="", ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Session = result + print(body) + # OR if you need more info (e.g. status_code) - get_session_for_user.sync_detailed( + response: Response[ + Optional[Union[Session, Error]] + ] = get_session_for_user.sync_detailed( client=client, token="", ) @@ -3472,13 +4483,15 @@ async def test_get_session_for_user_async(): # Create our client. client = ClientFromEnv() - await get_session_for_user.asyncio( + result: Optional[Union[Session, Error]] = await get_session_for_user.asyncio( client=client, token="", ) # OR run async with more info - await get_session_for_user.asyncio_detailed( + response: Response[ + Optional[Union[Session, Error]] + ] = await get_session_for_user.asyncio_detailed( client=client, token="", ) @@ -3489,15 +4502,24 @@ def test_list_users(): # Create our client. client = ClientFromEnv() - list_users.sync( + result: Optional[Union[UserResultsPage, Error]] = list_users.sync( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] page_token=None, # Optional[str] ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: UserResultsPage = result + print(body) + # OR if you need more info (e.g. status_code) - list_users.sync_detailed( + response: Response[ + Optional[Union[UserResultsPage, Error]] + ] = list_users.sync_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -3512,7 +4534,7 @@ async def test_list_users_async(): # Create our client. client = ClientFromEnv() - await list_users.asyncio( + result: Optional[Union[UserResultsPage, Error]] = await list_users.asyncio( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -3520,7 +4542,9 @@ async def test_list_users_async(): ) # OR run async with more info - await list_users.asyncio_detailed( + response: Response[ + Optional[Union[UserResultsPage, Error]] + ] = await list_users.asyncio_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -3533,15 +4557,24 @@ def test_list_users_extended(): # Create our client. client = ClientFromEnv() - list_users_extended.sync( + result: Optional[Union[ExtendedUserResultsPage, Error]] = list_users_extended.sync( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] page_token=None, # Optional[str] ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ExtendedUserResultsPage = result + print(body) + # OR if you need more info (e.g. status_code) - list_users_extended.sync_detailed( + response: Response[ + Optional[Union[ExtendedUserResultsPage, Error]] + ] = list_users_extended.sync_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -3556,7 +4589,9 @@ async def test_list_users_extended_async(): # Create our client. client = ClientFromEnv() - await list_users_extended.asyncio( + result: Optional[ + Union[ExtendedUserResultsPage, Error] + ] = await list_users_extended.asyncio( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -3564,7 +4599,9 @@ async def test_list_users_extended_async(): ) # OR run async with more info - await list_users_extended.asyncio_detailed( + response: Response[ + Optional[Union[ExtendedUserResultsPage, Error]] + ] = await list_users_extended.asyncio_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, limit=None, # Optional[int] @@ -3577,13 +4614,22 @@ def test_get_user_extended(): # Create our client. client = ClientFromEnv() - get_user_extended.sync( + result: Optional[Union[ExtendedUser, Error]] = get_user_extended.sync( client=client, id="", ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ExtendedUser = result + print(body) + # OR if you need more info (e.g. status_code) - get_user_extended.sync_detailed( + response: Response[ + Optional[Union[ExtendedUser, Error]] + ] = get_user_extended.sync_detailed( client=client, id="", ) @@ -3596,13 +4642,15 @@ async def test_get_user_extended_async(): # Create our client. client = ClientFromEnv() - await get_user_extended.asyncio( + result: Optional[Union[ExtendedUser, Error]] = await get_user_extended.asyncio( client=client, id="", ) # OR run async with more info - await get_user_extended.asyncio_detailed( + response: Response[ + Optional[Union[ExtendedUser, Error]] + ] = await get_user_extended.asyncio_detailed( client=client, id="", ) @@ -3613,13 +4661,20 @@ def test_get_user(): # Create our client. client = ClientFromEnv() - get_user.sync( + result: Optional[Union[User, Error]] = get_user.sync( client=client, id="", ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: User = result + print(body) + # OR if you need more info (e.g. status_code) - get_user.sync_detailed( + response: Response[Optional[Union[User, Error]]] = get_user.sync_detailed( client=client, id="", ) @@ -3632,13 +4687,13 @@ async def test_get_user_async(): # Create our client. client = ClientFromEnv() - await get_user.asyncio( + result: Optional[Union[User, Error]] = await get_user.asyncio( client=client, id="", ) # OR run async with more info - await get_user.asyncio_detailed( + response: Response[Optional[Union[User, Error]]] = await get_user.asyncio_detailed( client=client, id="", ) @@ -3649,7 +4704,9 @@ def test_list_api_calls_for_user(): # Create our client. client = ClientFromEnv() - list_api_calls_for_user.sync( + result: Optional[ + Union[ApiCallWithPriceResultsPage, Error] + ] = list_api_calls_for_user.sync( client=client, id="", sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, @@ -3657,8 +4714,17 @@ def test_list_api_calls_for_user(): page_token=None, # Optional[str] ) + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ApiCallWithPriceResultsPage = result + print(body) + # OR if you need more info (e.g. status_code) - list_api_calls_for_user.sync_detailed( + response: Response[ + Optional[Union[ApiCallWithPriceResultsPage, Error]] + ] = list_api_calls_for_user.sync_detailed( client=client, id="", sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, @@ -3674,7 +4740,9 @@ async def test_list_api_calls_for_user_async(): # Create our client. client = ClientFromEnv() - await list_api_calls_for_user.asyncio( + result: Optional[ + Union[ApiCallWithPriceResultsPage, Error] + ] = await list_api_calls_for_user.asyncio( client=client, id="", sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, @@ -3683,7 +4751,9 @@ async def test_list_api_calls_for_user_async(): ) # OR run async with more info - await list_api_calls_for_user.asyncio_detailed( + response: Response[ + Optional[Union[ApiCallWithPriceResultsPage, Error]] + ] = await list_api_calls_for_user.asyncio_detailed( client=client, id="", sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, diff --git a/pyproject.toml b/pyproject.toml index 3a9145286..d0b8d1d0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,6 +91,7 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" # We exclude init files since otherwise ruff will delete all the unused imports. # This code comes from here: https://beta.ruff.rs/docs/rules/#pyflakes-f "__init__.py" = ["F401"] +"examples_test.py" = ["F841"] [tool.mypy] exclude = [] diff --git a/spec.json b/spec.json index 01b485bf7..c4164eba3 100644 --- a/spec.json +++ b/spec.json @@ -20481,4 +20481,4 @@ "name": "users" } ] -} \ No newline at end of file +}