better and clean;

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2023-05-08 12:58:35 -07:00
parent c209414459
commit 8cf515b39f
92 changed files with 2619 additions and 1373 deletions

View File

@ -35,4 +35,4 @@ jobs:
- name: Run ruff
shell: bash
run: |
poetry run ruff check .
poetry run ruff check --format=github .

View File

@ -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,15 +130,19 @@ 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
if import_path is None:
example_imports = example_imports + (
"from kittycad.models."
+ camel_to_snake(parameter_type)
@ -146,6 +150,15 @@ def generateTypeAndExamplePython(
+ parameter_type
+ "\n"
)
else:
example_imports = example_imports + (
"from kittycad.models."
+ ip
+ " import "
+ parameter_type
+ "\n"
)
parameter_example = parameter_type + '("<uuid>")'
else:
parameter_type = "str"
@ -159,6 +172,7 @@ def generateTypeAndExamplePython(
parameter_type = name
if import_path is None:
example_imports = example_imports + (
"from kittycad.models."
+ camel_to_snake(parameter_type)
@ -166,6 +180,10 @@ def generateTypeAndExamplePython(
+ 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,6 +191,7 @@ def generateTypeAndExamplePython(
elif schema["type"] == "string":
if name != "":
parameter_type = name
if import_path is None:
example_imports = example_imports + (
"from kittycad.models."
+ camel_to_snake(parameter_type)
@ -180,6 +199,14 @@ def generateTypeAndExamplePython(
+ parameter_type
+ "\n"
)
else:
example_imports = example_imports + (
"from kittycad.models."
+ ip
+ " import "
+ parameter_type
+ "\n"
)
parameter_example = parameter_type + '("<string>")'
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,6 +243,7 @@ def generateTypeAndExamplePython(
parameter_type = name
if import_path is None:
example_imports = example_imports + (
"from kittycad.models."
+ camel_to_snake(parameter_type)
@ -221,6 +251,10 @@ def generateTypeAndExamplePython(
+ 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,6 +333,11 @@ def generatePath(path: str, name: str, method: str, endpoint: dict, data: dict)
success_type = ""
if len(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":
@ -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='<string>',\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 != ""
):
for endpoint_ref in endpoint_refs:
if endpoint_ref == "Error":
continue
example_imports = example_imports + (
"""from kittycad.models import """
+ success_type.replace("List[", "").replace("]", "")
+ endpoint_ref.replace("List[", "").replace("]", "")
+ "\n"
)
example_variable = "fc: " + success_type + " = "
"response: Response[" + success_type + "] = "
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,7 +451,28 @@ 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.
@ -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,16 +671,25 @@ async def test_"""
f.write("\n")
f.write("\n")
if len(endpoint_refs) > 0:
f.write(
"def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, "
+ ", ".join(endpoint_refs)
+ "]]:\n"
"def _parse_response(*, response: httpx.Response) -> "
+ response_type
+ ":\n"
)
else:
f.write("def _parse_response(*, response: httpx.Response):\n")
# 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(
@ -622,7 +714,9 @@ async def test_"""
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\tif not isinstance(data, dict):\n"
)
f.write("\t\t\t\traise TypeError()\n")
option_name = "option_" + camel_to_snake(ref)
f.write(
@ -660,7 +754,9 @@ async def test_"""
ref = items["$ref"].replace(
"#/components/schemas/", ""
)
f.write("\t\tresponse_" + response_code + " = [\n")
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")
@ -676,11 +772,15 @@ async def test_"""
raise Exception("Unknown type", json["type"])
else:
f.write(
"\t\tresponse_" + response_code + " = response.json()\n"
"\t\tresponse_"
+ response_code
+ " = response.json()\n"
)
elif "$ref" in response:
schema_name = response["$ref"].replace("#/components/responses/", "")
schema_name = response["$ref"].replace(
"#/components/responses/", ""
)
schema = data["components"]["responses"][schema_name]
if "content" in schema:
content = schema["content"]
@ -688,7 +788,9 @@ async def test_"""
if content_type == "application/json":
json = content[content_type]["schema"]
if "$ref" in json:
ref = json["$ref"].replace("#/components/schemas/", "")
ref = json["$ref"].replace(
"#/components/schemas/", ""
)
f.write(
"\t\tresponse_"
+ response_code
@ -697,22 +799,29 @@ async def test_"""
+ ".from_dict(response.json())\n"
)
else:
f.write("\t\tresponse_" + response_code + " = None\n")
print(endpoint)
raise Exception("response not supported")
if not is_one_of:
f.write("\t\treturn response_" + response_code + "\n")
# End the method.
f.write("\treturn None\n")
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")
if len(endpoint_refs) > 0:
f.write(
"def _build_response(*, response: httpx.Response) -> Response[Union[Any, "
+ ", ".join(endpoint_refs)
+ "]]:\n"
"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():

View File

@ -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 (

View File

@ -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 (

View File

@ -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

View File

@ -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 (

View File

@ -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 (

View File

@ -35,7 +35,6 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,
@ -107,14 +106,14 @@ 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[
Optional[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,
@ -123,6 +122,7 @@ def _build_response(
FileSurfaceArea,
Error,
]
]
]:
return Response(
status_code=response.status_code,
@ -137,8 +137,8 @@ def sync_detailed(
*,
client: Client,
) -> Response[
Optional[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,
@ -147,6 +147,7 @@ def sync_detailed(
FileSurfaceArea,
Error,
]
]
]:
kwargs = _get_kwargs(
id=id,
@ -167,7 +168,6 @@ def sync(
client: Client,
) -> Optional[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,
@ -193,8 +193,8 @@ async def asyncio_detailed(
*,
client: Client,
) -> Response[
Optional[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,
@ -203,6 +203,7 @@ async def asyncio_detailed(
FileSurfaceArea,
Error,
]
]
]:
kwargs = _get_kwargs(
id=id,
@ -221,7 +222,6 @@ async def asyncio(
client: Client,
) -> Optional[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,

View File

@ -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 (

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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 (

View File

@ -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

View File

@ -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 (

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 (

View File

@ -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(

View File

@ -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 (

View File

@ -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(

View File

@ -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 (

View File

@ -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(

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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(

View File

@ -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(

View File

@ -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 (

View File

@ -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(

View File

@ -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

View File

@ -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 (

View File

@ -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(

View File

@ -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(

View File

@ -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

View File

@ -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 (

View File

@ -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

View File

@ -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 (

View File

@ -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 (

View File

@ -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

View File

@ -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 (

View File

@ -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 (

View File

@ -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

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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

View File

@ -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 (

View File

@ -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

View File

@ -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

View File

@ -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 (

View File

@ -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 (

View File

@ -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

View File

@ -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

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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}")

File diff suppressed because it is too large Load Diff

View File

@ -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 = []