Compare commits

...

16 Commits

Author SHA1 Message Date
d9d73522fd fixes
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-28 17:22:38 -08:00
243ed3222a updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-28 17:07:29 -08:00
098e1fa97d fixes
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-28 17:05:43 -08:00
738659dfbc fixes
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-28 16:43:20 -08:00
5054fd19d3 fixes
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-28 16:37:47 -08:00
058b4dc40a got further
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-28 15:17:44 -08:00
373b5ef4ae better
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-28 14:29:16 -08:00
6b8807feea improvements
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-28 14:16:05 -08:00
b6aa9ab98b better working ws
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-28 13:13:13 -08:00
be246702fd Bump urllib3 from 1.26.15 to 1.26.18 (#161)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.15 to 1.26.18.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.15...1.26.18)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-27 16:01:44 -08:00
68d7a6d9a3 Bump pillow from 10.0.0 to 10.0.1 (#158)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.0.0 to 10.0.1.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.0.0...10.0.1)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-27 16:01:35 -08:00
6b2fe3decb Update api spec (#162)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-27 16:01:20 -08:00
4f29f55190 updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-10-17 19:39:06 -07:00
6ad21a2c87 Update api spec (#159)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-17 15:35:56 -07:00
036965255a Update api spec (#157)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-12 11:02:59 -05:00
4120a139cd Update api spec (#152)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-29 18:04:23 -07:00
301 changed files with 37524 additions and 34142 deletions

View File

@ -1,4 +1,6 @@
from typing import Any, Dict, Optional, Union, List from typing import Iterator, Any, Dict, Optional, Union, List
import json
import bson
from websockets.sync.client import connect as ws_connect from websockets.sync.client import connect as ws_connect
from websockets.client import connect as ws_connect_async from websockets.client import connect as ws_connect_async
@ -16,27 +18,38 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
{% for arg in args %} {% for arg in args %}
{% if arg.in_query %}
{% if arg.is_optional == False %} {% if arg.is_optional == False %}
{{arg.name}}: {{arg.type}}, {{arg.name}}: {{arg.type}},
{% endif %} {% endif %}
{% endif %}
{% endfor %} {% endfor %}
*, *,
client: Client, client: Client,
{% for arg in args %} {% for arg in args %}
{% if arg.in_query %}
{% if arg.is_optional %} {% if arg.is_optional %}
{{arg.name}}: {{arg.type}}, {{arg.name}}: {{arg.type}},
{% endif %} {% endif %}
{% endif %}
{% endfor %} {% endfor %}
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{{url_template}}".format(client.base_url{% for arg in args %}{% if arg.in_url %}, {{arg.name}}={{arg.name}}{% endif %}{% endfor %}) # noqa: E501 url = "{{url_template}}".format(client.base_url{% for arg in args %}{% if arg.in_url %}, {{arg.name}}={{arg.name}}{% endif %}{% endfor %}) # noqa: E501
{% for arg in args %} {% for arg in args %}
{% if arg.in_query %} {% if arg.in_query %}
if {{arg.name}} is not None: if {{arg.name}} is not None:
{% if arg.type == "bool" %}
if "?" in url:
url = url + "&{{arg.name}}=" + str({{arg.name}}).lower()
else:
url = url + "?{{arg.name}}=" + str({{arg.name}}).lower()
{% else %}
if "?" in url: if "?" in url:
url = url + "&{{arg.name}}=" + str({{arg.name}}) url = url + "&{{arg.name}}=" + str({{arg.name}})
else: else:
url = url + "?{{arg.name}}=" + str({{arg.name}}) url = url + "?{{arg.name}}=" + str({{arg.name}})
{% endif %} {% endif %}
{% endif %}
{% endfor %} {% endfor %}
@ -48,66 +61,140 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
{% if has_request_body %}"content": body,{% endif %}
} }
def sync( def sync(
{% for arg in args %} {% for arg in args %}
{% if arg.in_query %}
{% if arg.is_optional == False %} {% if arg.is_optional == False %}
{{arg.name}}: {{arg.type}}, {{arg.name}}: {{arg.type}},
{% endif %} {% endif %}
{% endif %}
{% endfor %} {% endfor %}
*, *,
client: Client, client: Client,
{% for arg in args %} {% for arg in args %}
{% if arg.in_query %}
{% if arg.is_optional %} {% if arg.is_optional %}
{{arg.name}}: {{arg.type}}, {{arg.name}}: {{arg.type}},
{% endif %} {% endif %}
{% endif %}
{% endfor %} {% endfor %}
) -> ClientConnection: ) -> ClientConnection:
{%if docs%}"""{{docs}}""" # noqa: E501{% endif %} {%if docs%}"""{{docs}}""" # noqa: E501{% endif %}
kwargs = _get_kwargs( kwargs = _get_kwargs(
{% for arg in args %} {% for arg in args %}
{% if arg.in_query %}
{{arg.name}}={{arg.name}}, {{arg.name}}={{arg.name}},
{% endif %}
{% endfor %} {% endfor %}
client=client, client=client,
) )
with ws_connect(kwargs["url"].replace("https://", "wss://"), additional_headers=kwargs["headers"]) as websocket: return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=None, compression=None, max_size=None) # type: ignore
return websocket # type: ignore
# Return an error if we got here.
return Error(message="An error occurred while connecting to the websocket.")
async def asyncio( async def asyncio(
{% for arg in args %} {% for arg in args %}
{% if arg.in_query %}
{% if arg.is_optional == False %} {% if arg.is_optional == False %}
{{arg.name}}: {{arg.type}}, {{arg.name}}: {{arg.type}},
{% endif %} {% endif %}
{% endif %}
{% endfor %} {% endfor %}
*, *,
client: Client, client: Client,
{% for arg in args %} {% for arg in args %}
{% if arg.in_query %}
{% if arg.is_optional %} {% if arg.is_optional %}
{{arg.name}}: {{arg.type}}, {{arg.name}}: {{arg.type}},
{% endif %} {% endif %}
{% endif %}
{% endfor %} {% endfor %}
) -> WebSocketClientProtocol: ) -> WebSocketClientProtocol:
{%if docs%}"""{{docs}}""" # noqa: E501{% endif %} {%if docs%}"""{{docs}}""" # noqa: E501{% endif %}
kwargs = _get_kwargs( kwargs = _get_kwargs(
{% for arg in args %} {% for arg in args %}
{% if arg.in_query %}
{{arg.name}}={{arg.name}}, {{arg.name}}={{arg.name}},
{% endif %}
{% endfor %} {% endfor %}
client=client, client=client,
) )
async with ws_connect_async(kwargs["url"].replace("https://", "wss://"), extra_headers=kwargs["headers"]) as websocket: return await ws_connect_async(kwargs["url"].replace("http", "ws"), extra_headers=kwargs["headers"])
return websocket
# Return an error if we got here.
return Error(message="An error occurred while connecting to the websocket.") {% if has_request_body %}
class WebSocket:
"""A websocket connection to the API endpoint."""
ws: ClientConnection
def __init__(self,
{% for arg in args %}
{% if arg.in_query %}
{% if arg.is_optional == False %}
{{arg.name}}: {{arg.type}},
{% endif %}
{% endif %}
{% endfor %}
client: Client,
{% for arg in args %}
{% if arg.in_query %}
{% if arg.is_optional %}
{{arg.name}}: {{arg.type}},
{% endif %}
{% endif %}
{% endfor %}
):
self.ws = sync(
{% for arg in args %}
{% if arg.in_query %}
{{arg.name}},
{% endif %}
{% endfor %}
client=client,
)
def __enter__(self,
):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.close()
def __iter__(self) -> Iterator[{{response_type}}]:
"""
Iterate on incoming messages.
The iterator calls :meth:`recv` and yields messages in an infinite loop.
It exits when the connection is closed normally. It raises a
:exc:`~websockets.exceptions.ConnectionClosedError` exception after a
protocol error or a network failure.
"""
for message in self.ws:
yield {{response_type}}.from_dict(json.loads(message))
def send(self, data:{% for arg in args %}{%if arg.name == "body" %}{{arg.type}}{% endif %}{% endfor %}):
"""Send data to the websocket."""
self.ws.send(json.dumps(data.to_dict()))
def send_binary(self, data:{% for arg in args %}{%if arg.name == "body" %}{{arg.type}}{% endif %}{% endfor %}):
"""Send data as bson to the websocket."""
self.ws.send(bson.BSON.encode(data.to_dict()))
def recv(self) -> {{response_type}}:
"""Receive data from the websocket."""
message = self.ws.recv()
return {{response_type}}.from_dict(json.loads(message))
def close(self):
"""Close the websocket."""
self.ws.close()
{%endif%}

View File

@ -28,11 +28,18 @@ def _get_kwargs(
{% for arg in args %} {% for arg in args %}
{% if arg.in_query %} {% if arg.in_query %}
if {{arg.name}} is not None: if {{arg.name}} is not None:
{% if arg.type == "bool" %}
if "?" in url:
url = url + "&{{arg.name}}=" + str({{arg.name}}).lower()
else:
url = url + "?{{arg.name}}=" + str({{arg.name}}).lower()
{% else %}
if "?" in url: if "?" in url:
url = url + "&{{arg.name}}=" + str({{arg.name}}) url = url + "&{{arg.name}}=" + str({{arg.name}})
else: else:
url = url + "?{{arg.name}}=" + str({{arg.name}}) url = url + "?{{arg.name}}=" + str({{arg.name}})
{% endif %} {% endif %}
{% endif %}
{% endfor %} {% endfor %}

View File

@ -35,7 +35,7 @@ def main():
# Add the client information to the generation. # Add the client information to the generation.
data["info"]["x-python"] = { data["info"]["x-python"] = {
"client": """# Create a client with your token. "client": """# Create a client with your token.
from kittycad import Client from kittycad.client import Client
client = Client(token="$TOKEN") client = Client(token="$TOKEN")
@ -43,7 +43,7 @@ client = Client(token="$TOKEN")
# Create a new client with your token parsed from the environment variable: # Create a new client with your token parsed from the environment variable:
# `KITTYCAD_API_TOKEN`. # `KITTYCAD_API_TOKEN`.
from kittycad import ClientFromEnv from kittycad.client import ClientFromEnv
client = ClientFromEnv() client = ClientFromEnv()
@ -433,6 +433,7 @@ from kittycad.types import Response
for optional_arg in optional_args: for optional_arg in optional_args:
params_str += optional_arg params_str += optional_arg
body_example = "{}"
if request_body_type: if request_body_type:
if request_body_type == "str": if request_body_type == "str":
params_str += "body='<string>',\n" params_str += "body='<string>',\n"
@ -443,10 +444,20 @@ from kittycad.types import Response
rbs: Dict[Any, Any] = request_body_schema rbs: Dict[Any, Any] = request_body_schema
( (
body_type, body_type,
body_example, body_ex,
more_example_imports, more_example_imports,
) = generateTypeAndExamplePython(request_body_type, rbs, data, None, None) ) = generateTypeAndExamplePython(request_body_type, rbs, data, None, None)
body_example = body_ex
if "x-dropshot-websocket" not in endpoint:
params_str += "body=" + body_example + ",\n" params_str += "body=" + body_example + ",\n"
else:
body_example = request_body_type + "(" + body_example + ")"
example_imports = (
example_imports
+ "from kittycad.models import "
+ request_body_type
+ "\n"
)
example_imports = example_imports + more_example_imports example_imports = example_imports + more_example_imports
example_variable = "" example_variable = ""
@ -559,6 +570,7 @@ async def test_"""
# Generate the websocket examples. # Generate the websocket examples.
if "x-dropshot-websocket" in endpoint: if "x-dropshot-websocket" in endpoint:
if request_body_type is None:
short_sync_example = ( short_sync_example = (
"""def test_""" """def test_"""
+ fn_name + fn_name
@ -580,6 +592,32 @@ async def test_"""
for message in websocket: for message in websocket:
print(message) print(message)
"""
)
else:
short_sync_example = (
"""def test_"""
+ fn_name
+ """():
# Create our client.
client = ClientFromEnv()
# Connect to the websocket.
websocket = """
+ fn_name
+ """.WebSocket(client=client,"""
+ params_str
+ """)
# Send a message.
websocket.send("""
+ body_example
+ """)
# Get a message.
message = websocket.recv()
print(message)
""" """
) )
@ -683,6 +721,11 @@ async def test_"""
if len(endpoint_refs) == 0: if len(endpoint_refs) == 0:
template_info["response_type"] = "" template_info["response_type"] = ""
if "x-dropshot-websocket" in endpoint:
template_info["response_type"] = (
template_info["response_type"].replace("Optional[", "").replace("]", "")
)
if "description" in endpoint: if "description" in endpoint:
template_info["docs"] = endpoint["description"] template_info["docs"] = endpoint["description"]
@ -1195,20 +1238,85 @@ def generateAnyOfType(path: str, name: str, schema: dict, data: dict):
all_options.append(object_name) all_options.append(object_name)
# Write the sum type. # Write the sum type.
f.write("from typing import Union\n") description = getAnyOfDescription(schema)
f.write(name + " = Union[") content = generateUnionType(all_options, name, description)
f.write(content)
for num, option in enumerate(all_options, start=0):
if num == 0:
f.write(option)
else:
f.write(", " + option + "")
f.write("]\n")
# Close the file. # Close the file.
f.close() f.close()
def getAnyOfDescription(schema: dict) -> str:
if "description" in schema:
return schema["description"]
else:
return ""
def generateUnionType(types: List[str], name: str, description: str) -> str:
ArgType = TypedDict(
"ArgType",
{
"name": str,
"var0": str,
"var1": str,
"check": str,
"value": str,
},
)
TemplateType = TypedDict(
"TemplateType",
{
"types": List[ArgType],
"description": str,
"name": str,
},
)
template_info: TemplateType = {
"types": [],
"description": description,
"name": name,
}
for type in types:
if type == "SuccessWebSocketResponse":
template_info["types"].append(
{
"name": type,
"var0": randletter(),
"var1": randletter(),
"check": "success",
"value": "True",
}
)
elif type == "FailureWebSocketResponse":
template_info["types"].append(
{
"name": type,
"var0": randletter(),
"var1": randletter(),
"check": "success",
"value": "False",
}
)
else:
template_info["types"].append(
{
"name": type,
"var0": randletter(),
"var1": randletter(),
"check": "type",
"value": '"' + type + '"',
}
)
environment = jinja2.Environment(loader=jinja2.FileSystemLoader("generate/"))
template_file = "union-type.py.jinja2"
template = environment.get_template(template_file)
content = template.render(**template_info)
return content
def generateOneOfType(path: str, name: str, schema: dict, data: dict): def generateOneOfType(path: str, name: str, schema: dict, data: dict):
logging.info("generating type: ", name, " at: ", path) logging.info("generating type: ", name, " at: ", path)
@ -1309,20 +1417,21 @@ def generateOneOfType(path: str, name: str, schema: dict, data: dict):
f.write("from typing import Any\n") f.write("from typing import Any\n")
f.write(name + " = Any") f.write(name + " = Any")
else: else:
f.write("from typing import Union\n") description = getOneOfDescription(schema)
f.write(name + " = Union[") content = generateUnionType(all_options, name, description)
f.write(content)
for num, option in enumerate(all_options, start=0):
if num == 0:
f.write(option)
else:
f.write(", " + option + "")
f.write("]\n")
# Close the file. # Close the file.
f.close() f.close()
def getOneOfDescription(schema: dict) -> str:
if "description" in schema:
return schema["description"]
else:
return ""
def generateObjectTypeCode( def generateObjectTypeCode(
name: str, schema: dict, type_name: str, data: dict, tag: Optional[str] name: str, schema: dict, type_name: str, data: dict, tag: Optional[str]
) -> str: ) -> str:
@ -1391,6 +1500,9 @@ def generateObjectTypeCode(
# Iternate over the properties. # Iternate over the properties.
for property_name in schema["properties"]: for property_name in schema["properties"]:
property_schema = schema["properties"][property_name]
if "allOf" in property_schema and len(property_schema["allOf"]) == 1:
property_schema = property_schema["allOf"][0]
if property_name == tag: if property_name == tag:
f.write( f.write(
"\t\tfield_dict['" "\t\tfield_dict['"
@ -1404,6 +1516,44 @@ def generateObjectTypeCode(
f.write( f.write(
"\t\tif " + clean_parameter_name(property_name) + " is not UNSET:\n" "\t\tif " + clean_parameter_name(property_name) + " is not UNSET:\n"
) )
# We only want .to_dict on nested objects.
if "$ref" in property_schema:
ref = property_schema["$ref"].replace("#/components/schemas/", "")
actual_schema = data["components"]["schemas"][ref]
is_enum = isEnumWithDocsOneOf(actual_schema)
if (
"properties" in actual_schema
or "oneOf" in actual_schema
or "anyOf" in actual_schema
or "allOf" in actual_schema
) and not is_enum:
f.write(
"\t\t\t_"
+ property_name
+ ": "
+ ref
+ " = cast("
+ ref
+ ", "
+ clean_parameter_name(property_name)
+ ")\n"
)
f.write(
"\t\t\tfield_dict['"
+ property_name
+ "'] = _"
+ property_name
+ ".to_dict()\n"
)
else:
f.write(
"\t\t\tfield_dict['"
+ property_name
+ "'] = "
+ clean_parameter_name(property_name)
+ "\n"
)
else:
f.write( f.write(
"\t\t\tfield_dict['" "\t\t\tfield_dict['"
+ property_name + property_name
@ -1709,6 +1859,7 @@ def renderTypeToDict(f, property_name: str, property_schema: dict, data: dict):
) )
elif "$ref" in property_schema: elif "$ref" in property_schema:
ref = property_schema["$ref"].replace("#/components/schemas/", "") ref = property_schema["$ref"].replace("#/components/schemas/", "")
f.write("\t\t" + property_name + ": Union[Unset, " + ref + "] = UNSET\n")
f.write( f.write(
"\t\tif not isinstance(self." "\t\tif not isinstance(self."
+ clean_parameter_name(property_name) + clean_parameter_name(property_name)
@ -1729,6 +1880,7 @@ def renderTypeToDict(f, property_name: str, property_schema: dict, data: dict):
return renderTypeToDict( return renderTypeToDict(
f, property_name, data["components"]["schemas"][ref], data f, property_name, data["components"]["schemas"][ref], data
) )
f.write("\t\t" + property_name + ": Union[Unset, " + ref + "] = UNSET\n")
f.write( f.write(
"\t\tif not isinstance(self." "\t\tif not isinstance(self."
+ clean_parameter_name(property_name) + clean_parameter_name(property_name)
@ -2160,7 +2312,7 @@ def renderTypeFromDict(f, property_name: str, property_schema: dict, data: dict)
elif "$ref" in property_schema: elif "$ref" in property_schema:
ref = property_schema["$ref"].replace("#/components/schemas/", "") ref = property_schema["$ref"].replace("#/components/schemas/", "")
# Get the type for the reference. # Get the type for the reference.
data["components"]["schemas"][ref] actual_schema = data["components"]["schemas"][ref]
f.write( f.write(
"\t\t_" "\t\t_"
@ -2180,14 +2332,33 @@ def renderTypeFromDict(f, property_name: str, property_schema: dict, data: dict)
"\t\tif isinstance(_" + clean_parameter_name(property_name) + ", Unset):\n" "\t\tif isinstance(_" + clean_parameter_name(property_name) + ", Unset):\n"
) )
f.write("\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n") f.write("\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n")
f.write("\t\tif _" + clean_parameter_name(property_name) + " is None:\n")
f.write("\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n")
f.write("\t\telse:\n") f.write("\t\telse:\n")
is_enum = isEnumWithDocsOneOf(actual_schema)
if (
"properties" in actual_schema
or "oneOf" in actual_schema
or "anyOf" in actual_schema
or "allOf" in actual_schema
) and not is_enum:
f.write(
"\t\t\t"
+ clean_parameter_name(property_name)
+ " = "
+ ref
+ ".from_dict(_"
+ clean_parameter_name(property_name)
+ ")\n"
)
else:
f.write( f.write(
"\t\t\t" "\t\t\t"
+ clean_parameter_name(property_name) + clean_parameter_name(property_name)
+ " = _" + " = _"
+ clean_parameter_name(property_name) + clean_parameter_name(property_name)
+ " # type: ignore[arg-type]\n" + "\n"
) )
f.write("\n") f.write("\n")

View File

@ -0,0 +1,50 @@
from typing import Dict, Any, Union, Type, TypeVar
from typing_extensions import Self
import attr
from ..types import UNSET, Unset
GY = TypeVar("GY", bound="{{name}}")
@attr.s(auto_attribs=True)
class {{name}}:
{% if description %}
"""{{description}}"""
{% endif %}
type: Union[
{% for type in types %}
{{type.name}},
{% endfor %}
]
def __init__(self,
type: Union[
{% for type in types %}
{{type.name}},
{% endfor %}
]):
self.type = type
def to_dict(self) -> Dict[str, Any]:
{% for type in types %}{% if loop.first %}
if isinstance(self.type, {{type.name}}):
{{type.var0}} : {{type.name}} = self.type
return {{type.var0}}.to_dict()
{% else %}elif isinstance(self.type, {{type.name}}):
{{type.var0}} : {{type.name}} = self.type
return {{type.var0}}.to_dict()
{% endif %}{% endfor %}
raise Exception("Unknown type")
@classmethod
def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY:
{% for type in types %}{% if loop.first %}
if d.get("{{type.check}}") == {{type.value}}:
{{type.var1}} : {{type.name}} = {{type.name}}()
{{type.var1}}.from_dict(d)
return cls(type={{type.var1}})
{% else %}elif d.get("{{type.check}}") == {{type.value}}:
{{type.var1}} : {{type.name}} = {{type.name}}()
{{type.var1}}.from_dict(d)
return cls(type={{type.var1}})
{% endif %}{% endfor %}
raise Exception("Unknown type")

View File

@ -3,40 +3,40 @@
"op": "add", "op": "add",
"path": "/info/x-python", "path": "/info/x-python",
"value": { "value": {
"client": "# Create a client with your token.\nfrom kittycad import Client\n\nclient = Client(token=\"$TOKEN\")\n\n# - OR -\n\n# Create a new client with your token parsed from the environment variable:\n# `KITTYCAD_API_TOKEN`.\nfrom kittycad import ClientFromEnv\n\nclient = ClientFromEnv()\n\n# NOTE: The python library additionally implements asyncio, however all the code samples we\n# show below use the sync functions for ease of use and understanding.\n# Check out the library docs at:\n# https://python.api.docs.kittycad.io/_autosummary/kittycad.api.html#module-kittycad.api\n# for more details.", "client": "# Create a client with your token.\nfrom kittycad.client import Client\n\nclient = Client(token=\"$TOKEN\")\n\n# - OR -\n\n# Create a new client with your token parsed from the environment variable:\n# `KITTYCAD_API_TOKEN`.\nfrom kittycad.client import ClientFromEnv\n\nclient = ClientFromEnv()\n\n# NOTE: The python library additionally implements asyncio, however all the code samples we\n# show below use the sync functions for ease of use and understanding.\n# Check out the library docs at:\n# https://python.api.docs.kittycad.io/_autosummary/kittycad.api.html#module-kittycad.api\n# for more details.",
"install": "pip install kittycad" "install": "pip install kittycad"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1unit~1conversion~1torque~1{input_unit}~1{output_unit}/get/x-python", "path": "/paths/~1users-extended~1{id}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_torque_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTorqueConversion\nfrom kittycad.models.unit_torque import UnitTorque\nfrom kittycad.types import Response\n\n\ndef example_get_torque_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTorqueConversion, Error]\n ] = get_torque_unit_conversion.sync(\n client=client,\n input_unit=UnitTorque.NEWTON_METRES,\n output_unit=UnitTorque.NEWTON_METRES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTorqueConversion = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_extended.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_torque_unit_conversion.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_extended.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1file~1execute~1{lang}/post/x-python", "path": "/paths/~1file~1volume/post/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.executor import create_file_execution\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CodeOutput, Error\nfrom kittycad.models.code_language import CodeLanguage\nfrom kittycad.types import Response\n\n\ndef example_create_file_execution():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[CodeOutput, Error]] = create_file_execution.sync(\n client=client,\n lang=CodeLanguage.GO,\n output=None, # Optional[str]\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CodeOutput = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_volume\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileVolume\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_create_file_volume():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileVolume, Error]] = create_file_volume.sync(\n client=client,\n output_unit=UnitVolume.CM3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileVolume = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_file_execution.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_volume.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1ai~1image-to-3d~1{input_format}~1{output_format}/post/x-python", "path": "/paths/~1ai-prompts~1{id}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_image_to_3d\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Mesh\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.image_type import ImageType\nfrom kittycad.types import Response\n\n\ndef example_create_image_to_3d():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Mesh, Error]] = create_image_to_3d.sync(\n client=client,\n input_format=ImageType.PNG,\n output_format=FileExportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Mesh = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_ai_prompt\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPrompt, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_prompt():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPrompt, Error]] = get_ai_prompt.sync(\n client=client,\n id=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPrompt = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_image_to_3d.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_ai_prompt.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1ping/get/x-python", "path": "/paths/~1unit~1conversion~1angle~1{input_unit}~1{output_unit}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import ping\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Pong\nfrom kittycad.types import Response\n\n\ndef example_ping():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Pong, Error]] = ping.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Pong = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_angle_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAngleConversion\nfrom kittycad.models.unit_angle import UnitAngle\nfrom kittycad.types import Response\n\n\ndef example_get_angle_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAngleConversion, Error]\n ] = get_angle_unit_conversion.sync(\n client=client,\n input_unit=UnitAngle.DEGREES,\n output_unit=UnitAngle.DEGREES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAngleConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.ping.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_angle_unit_conversion.html"
} }
}, },
{ {
@ -49,154 +49,42 @@
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1apps~1github~1callback/get/x-python", "path": "/paths/~1user~1payment~1intent/post/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_callback.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_intent_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentIntent\nfrom kittycad.types import Response\n\n\ndef example_create_payment_intent_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PaymentIntent, Error]\n ] = create_payment_intent_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PaymentIntent = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_callback.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_intent_for_user.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1api-call-metrics/get/x-python", "path": "/paths/~1user~1text-to-cad~1{id}/post/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_metrics\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallQueryGroup, Error\nfrom kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_metrics():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[ApiCallQueryGroup], Error]\n ] = get_api_call_metrics.sync(\n client=client,\n group_by=ApiCallQueryGroupBy.EMAIL,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[ApiCallQueryGroup] = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad_model_feedback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.models.ai_feedback import AiFeedback\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad_model_feedback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = create_text_to_cad_model_feedback.sync(\n client=client,\n id=\"<uuid>\",\n feedback=AiFeedback.THUMBS_UP,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_metrics.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_cad_model_feedback.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1user~1api-calls/get/x-python", "path": "/paths/~1user~1text-to-cad~1{id}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import user_list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_user_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = user_list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_text_to_cad_model_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.types import Response\n\n\ndef example_get_text_to_cad_model_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCad, Error]\n ] = get_text_to_cad_model_for_user.sync(\n client=client,\n id=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.user_list_api_calls.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_text_to_cad_model_for_user.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1file~1conversion~1{src_format}~1{output_format}/post/x-python", "path": "/paths/~1ai-prompts/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileConversion\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.types import Response\n\n\ndef example_create_file_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileConversion, Error]] = create_file_conversion.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileConversion = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_ai_prompts\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPromptResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_ai_prompts():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPromptResultsPage, Error]] = list_ai_prompts.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPromptResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_conversion.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_ai_prompts.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1async~1operations/get/x-python", "path": "/paths/~1unit~1conversion~1torque~1{input_unit}~1{output_unit}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_async_operations\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AsyncApiCallResultsPage, Error\nfrom kittycad.models.api_call_status import ApiCallStatus\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_async_operations():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AsyncApiCallResultsPage, Error]\n ] = list_async_operations.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n status=ApiCallStatus.QUEUED,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AsyncApiCallResultsPage = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_torque_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTorqueConversion\nfrom kittycad.models.unit_torque import UnitTorque\nfrom kittycad.types import Response\n\n\ndef example_get_torque_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTorqueConversion, Error]\n ] = get_torque_unit_conversion.sync(\n client=client,\n input_unit=UnitTorque.NEWTON_METRES,\n output_unit=UnitTorque.NEWTON_METRES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTorqueConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_async_operations.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_torque_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1methods/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_payment_methods_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentMethod\nfrom kittycad.types import Response\n\n\ndef example_list_payment_methods_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[PaymentMethod], Error]\n ] = list_payment_methods_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[PaymentMethod] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_payment_methods_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1temperature~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_temperature_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTemperatureConversion\nfrom kittycad.models.unit_temperature import UnitTemperature\nfrom kittycad.types import Response\n\n\ndef example_get_temperature_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTemperatureConversion, Error]\n ] = get_temperature_unit_conversion.sync(\n client=client,\n input_unit=UnitTemperature.CELSIUS,\n output_unit=UnitTemperature.CELSIUS,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTemperatureConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_temperature_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1current~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_current_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitCurrentConversion\nfrom kittycad.models.unit_current import UnitCurrent\nfrom kittycad.types import Response\n\n\ndef example_get_current_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitCurrentConversion, Error]\n ] = get_current_unit_conversion.sync(\n client=client,\n input_unit=UnitCurrent.AMPERES,\n output_unit=UnitCurrent.AMPERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitCurrentConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_current_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1pressure~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_pressure_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPressureConversion\nfrom kittycad.models.unit_pressure import UnitPressure\nfrom kittycad.types import Response\n\n\ndef example_get_pressure_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPressureConversion, Error]\n ] = get_pressure_unit_conversion.sync(\n client=client,\n input_unit=UnitPressure.ATMOSPHERES,\n output_unit=UnitPressure.ATMOSPHERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPressureConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_pressure_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1center-of-mass/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_center_of_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileCenterOfMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_create_file_center_of_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileCenterOfMass, Error]\n ] = create_file_center_of_mass.sync(\n client=client,\n output_unit=UnitLength.CM,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileCenterOfMass = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_center_of_mass.html"
}
},
{
"op": "add",
"path": "/paths/~1api-calls/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1onboarding/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_onboarding_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Onboarding\nfrom kittycad.types import Response\n\n\ndef example_get_user_onboarding_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Onboarding, Error]] = get_user_onboarding_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Onboarding = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_onboarding_self.html"
}
},
{
"op": "add",
"path": "/paths/~1/get/x-python",
"value": {
"example": "from kittycad.api.meta import get_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_schema.sync(\n client=client,\n )\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_schema.html"
}
},
{
"op": "add",
"path": "/paths/~1openai~1openapi.json/get/x-python",
"value": {
"example": "from kittycad.api.meta import get_openai_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_openai_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_openai_schema.sync(\n client=client,\n )\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_openai_schema.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1force~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_force_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitForceConversion\nfrom kittycad.models.unit_force import UnitForce\nfrom kittycad.types import Response\n\n\ndef example_get_force_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitForceConversion, Error]\n ] = get_force_unit_conversion.sync(\n client=client,\n input_unit=UnitForce.DYNES,\n output_unit=UnitForce.DYNES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitForceConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_force_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1front-hash/get/x-python",
"value": {
"example": "from kittycad.api.users import get_user_front_hash_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_user_front_hash_self():\n # Create our client.\n client = ClientFromEnv()\n\n get_user_front_hash_self.sync(\n client=client,\n )\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_front_hash_self.html"
}
},
{
"op": "add",
"path": "/paths/~1apps~1github~1consent/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_consent\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AppClientInfo, Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_consent():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AppClientInfo, Error]] = apps_github_consent.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AppClientInfo = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_consent.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1length~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_length_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitLengthConversion\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_get_length_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitLengthConversion, Error]\n ] = get_length_unit_conversion.sync(\n client=client,\n input_unit=UnitLength.CM,\n output_unit=UnitLength.CM,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitLengthConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_length_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1methods~1{id}/delete/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_method_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_method_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_method_for_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_method_for_user.html"
} }
}, },
{ {
@ -209,26 +97,18 @@
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1.well-known~1ai-plugin.json/get/x-python", "path": "/paths/~1ping/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_ai_plugin_manifest\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPluginManifest, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_plugin_manifest():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AiPluginManifest, Error]\n ] = get_ai_plugin_manifest.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPluginManifest = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import ping\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Pong\nfrom kittycad.types import Response\n\n\ndef example_ping():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Pong, Error]] = ping.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Pong = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_ai_plugin_manifest.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.ping.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1file~1density/post/x-python", "path": "/paths/~1users~1{id}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_density\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileDensity\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_density():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileDensity, Error]] = create_file_density.sync(\n client=client,\n material_mass=3.14,\n material_mass_unit=UnitMass.G,\n output_unit=UnitDensity.LB_FT3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileDensity = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_density.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user.html"
}
},
{
"op": "add",
"path": "/paths/~1auth~1email~1callback/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_auth_email_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = auth_email_callback.sync(\n client=client,\n email=\"<string>\",\n token=\"<string>\",\n callback_url=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email_callback.html"
} }
}, },
{ {
@ -239,6 +119,270 @@
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_power_unit_conversion.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_power_unit_conversion.html"
} }
}, },
{
"op": "add",
"path": "/paths/~1user~1api-calls/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import user_list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_user_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = user_list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.user_list_api_calls.html"
}
},
{
"op": "add",
"path": "/paths/~1ws~1executor~1term/get/x-python",
"value": {
"example": "from kittycad.api.executor import create_executor_term\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_create_executor_term():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n websocket = create_executor_term.sync(\n client=client,\n )\n\n # Send a message.\n websocket.send(\"{}\")\n\n # Get the messages.\n for message in websocket:\n print(message)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_executor_term.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1tax/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import validate_customer_tax_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_validate_customer_tax_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = validate_customer_tax_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.validate_customer_tax_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1api-call-metrics/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_metrics\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallQueryGroup, Error\nfrom kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_metrics():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[ApiCallQueryGroup], Error]\n ] = get_api_call_metrics.sync(\n client=client,\n group_by=ApiCallQueryGroupBy.EMAIL,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[ApiCallQueryGroup] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_metrics.html"
}
},
{
"op": "add",
"path": "/paths/~1ws~1modeling~1commands/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.modeling import modeling_commands_ws\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, WebSocketRequest, WebSocketResponse\nfrom kittycad.models.rtc_sdp_type import RtcSdpType\nfrom kittycad.models.rtc_session_description import RtcSessionDescription\nfrom kittycad.models.web_socket_request import sdp_offer\nfrom kittycad.types import Response\n\n\ndef example_modeling_commands_ws():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n websocket = modeling_commands_ws.WebSocket(\n client=client,\n fps=10,\n unlocked_framerate=False,\n video_res_height=10,\n video_res_width=10,\n webrtc=False,\n )\n\n # Send a message.\n websocket.send(\n WebSocketRequest(\n sdp_offer(\n offer=RtcSessionDescription(\n sdp=\"<string>\",\n type=RtcSdpType.UNSPECIFIED,\n ),\n )\n )\n )\n\n # Get a message.\n message = websocket.recv()\n print(message)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.modeling_commands_ws.html"
}
},
{
"op": "add",
"path": "/paths/~1.well-known~1ai-plugin.json/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_ai_plugin_manifest\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPluginManifest, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_plugin_manifest():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AiPluginManifest, Error]\n ] = get_ai_plugin_manifest.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPluginManifest = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_ai_plugin_manifest.html"
}
},
{
"op": "add",
"path": "/paths/~1logout/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import logout\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_logout():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = logout.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.logout.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1temperature~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_temperature_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTemperatureConversion\nfrom kittycad.models.unit_temperature import UnitTemperature\nfrom kittycad.types import Response\n\n\ndef example_get_temperature_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTemperatureConversion, Error]\n ] = get_temperature_unit_conversion.sync(\n client=client,\n input_unit=UnitTemperature.CELSIUS,\n output_unit=UnitTemperature.CELSIUS,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTemperatureConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_temperature_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1api-calls~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1pressure~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_pressure_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPressureConversion\nfrom kittycad.models.unit_pressure import UnitPressure\nfrom kittycad.types import Response\n\n\ndef example_get_pressure_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPressureConversion, Error]\n ] = get_pressure_unit_conversion.sync(\n client=client,\n input_unit=UnitPressure.ATMOSPHERES,\n output_unit=UnitPressure.ATMOSPHERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPressureConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_pressure_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1async~1operations/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_async_operations\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AsyncApiCallResultsPage, Error\nfrom kittycad.models.api_call_status import ApiCallStatus\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_async_operations():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AsyncApiCallResultsPage, Error]\n ] = list_async_operations.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n status=ApiCallStatus.QUEUED,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AsyncApiCallResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_async_operations.html"
}
},
{
"op": "add",
"path": "/paths/~1openai~1openapi.json/get/x-python",
"value": {
"example": "from kittycad.api.meta import get_openai_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_openai_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_openai_schema.sync(\n client=client,\n )\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_openai_schema.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1session~1{token}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_session_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Session\nfrom kittycad.types import Response\n\n\ndef example_get_session_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Session, Error]] = get_session_for_user.sync(\n client=client,\n token=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Session = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_session_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/put/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_update_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = update_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"<string>\",\n phone=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/delete/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = get_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_create_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = create_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"<string>\",\n phone=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1users-extended/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ExtendedUserResultsPage, Error]\n ] = list_users_extended.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUserResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users_extended.html"
}
},
{
"op": "add",
"path": "/paths/~1apps~1github~1webhook/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_webhook\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_webhook():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_webhook.sync(\n client=client,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_webhook.html"
}
},
{
"op": "add",
"path": "/paths/~1ai~1text-to-cad~1{output_format}/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.text_to_cad_create_body import TextToCadCreateBody\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[TextToCad, Error]] = create_text_to_cad.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n body=TextToCadCreateBody(\n prompt=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_cad.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1current~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_current_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitCurrentConversion\nfrom kittycad.models.unit_current import UnitCurrent\nfrom kittycad.types import Response\n\n\ndef example_get_current_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitCurrentConversion, Error]\n ] = get_current_unit_conversion.sync(\n client=client,\n input_unit=UnitCurrent.AMPERES,\n output_unit=UnitCurrent.AMPERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitCurrentConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_current_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1length~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_length_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitLengthConversion\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_get_length_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitLengthConversion, Error]\n ] = get_length_unit_conversion.sync(\n client=client,\n input_unit=UnitLength.CM,\n output_unit=UnitLength.CM,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitLengthConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_length_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1apps~1github~1consent/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_consent\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AppClientInfo, Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_consent():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AppClientInfo, Error]] = apps_github_consent.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AppClientInfo = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_consent.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1force~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_force_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitForceConversion\nfrom kittycad.models.unit_force import UnitForce\nfrom kittycad.types import Response\n\n\ndef example_get_force_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitForceConversion, Error]\n ] = get_force_unit_conversion.sync(\n client=client,\n input_unit=UnitForce.DYNES,\n output_unit=UnitForce.DYNES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitForceConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_force_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1users~1{id}~1api-calls/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls_for_user.sync(\n client=client,\n id=\"<string>\",\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1onboarding/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_onboarding_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Onboarding\nfrom kittycad.types import Response\n\n\ndef example_get_user_onboarding_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Onboarding, Error]] = get_user_onboarding_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Onboarding = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_onboarding_self.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1area~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_area_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAreaConversion\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_get_area_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAreaConversion, Error]\n ] = get_area_unit_conversion.sync(\n client=client,\n input_unit=UnitArea.CM2,\n output_unit=UnitArea.CM2,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAreaConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_area_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1api-calls/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1conversion~1{src_format}~1{output_format}/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileConversion\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.types import Response\n\n\ndef example_create_file_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileConversion, Error]] = create_file_conversion.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1text-to-cad/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_text_to_cad_models_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCadResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_text_to_cad_models_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCadResultsPage, Error]\n ] = list_text_to_cad_models_for_user.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCadResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_text_to_cad_models_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1energy~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_energy_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitEnergyConversion\nfrom kittycad.models.unit_energy import UnitEnergy\nfrom kittycad.types import Response\n\n\ndef example_get_energy_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitEnergyConversion, Error]\n ] = get_energy_unit_conversion.sync(\n client=client,\n input_unit=UnitEnergy.BTU,\n output_unit=UnitEnergy.BTU,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitEnergyConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_energy_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1internal~1discord~1api-token~1{discord_id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import internal_get_api_token_for_discord_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_internal_get_api_token_for_discord_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiToken, Error]\n ] = internal_get_api_token_for_discord_user.sync(\n client=client,\n discord_id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.internal_get_api_token_for_discord_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1methods/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_payment_methods_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentMethod\nfrom kittycad.types import Response\n\n\ndef example_list_payment_methods_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[PaymentMethod], Error]\n ] = list_payment_methods_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[PaymentMethod] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_payment_methods_for_user.html"
}
},
{ {
"op": "add", "op": "add",
"path": "/paths/~1user/put/x-python", "path": "/paths/~1user/put/x-python",
@ -265,10 +409,42 @@
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1ws~1modeling~1commands/get/x-python", "path": "/paths/~1apps~1github~1callback/get/x-python",
"value": { "value": {
"example": "from kittycad.api.modeling import modeling_commands_ws\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_modeling_commands_ws():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n websocket = modeling_commands_ws.sync(\n client=client,\n fps=10,\n unlocked_framerate=False,\n video_res_height=10,\n video_res_width=10,\n webrtc=False,\n )\n\n # Send a message.\n websocket.send(\"{}\")\n\n # Get the messages.\n for message in websocket:\n print(message)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_callback.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.modeling_commands_ws.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_callback.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1front-hash/get/x-python",
"value": {
"example": "from kittycad.api.users import get_user_front_hash_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_user_front_hash_self():\n # Create our client.\n client = ClientFromEnv()\n\n get_user_front_hash_self.sync(\n client=client,\n )\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_front_hash_self.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1mass/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileMass, Error]] = create_file_mass.sync(\n client=client,\n material_density=3.14,\n material_density_unit=UnitDensity.LB_FT3,\n output_unit=UnitMass.G,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileMass = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_mass.html"
}
},
{
"op": "add",
"path": "/paths/~1/get/x-python",
"value": {
"example": "from kittycad.api.meta import get_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_schema.sync(\n client=client,\n )\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_schema.html"
}
},
{
"op": "add",
"path": "/paths/~1api-calls~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call.html"
} }
}, },
{ {
@ -281,10 +457,58 @@
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1unit~1conversion~1frequency~1{input_unit}~1{output_unit}/get/x-python", "path": "/paths/~1unit~1conversion~1volume~1{input_unit}~1{output_unit}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_frequency_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitFrequencyConversion\nfrom kittycad.models.unit_frequency import UnitFrequency\nfrom kittycad.types import Response\n\n\ndef example_get_frequency_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitFrequencyConversion, Error]\n ] = get_frequency_unit_conversion.sync(\n client=client,\n input_unit=UnitFrequency.GIGAHERTZ,\n output_unit=UnitFrequency.GIGAHERTZ,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitFrequencyConversion = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_volume_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitVolumeConversion\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_get_volume_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitVolumeConversion, Error]\n ] = get_volume_unit_conversion.sync(\n client=client,\n input_unit=UnitVolume.CM3,\n output_unit=UnitVolume.CM3,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitVolumeConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_frequency_unit_conversion.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_volume_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1methods~1{id}/delete/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_method_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_method_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_method_for_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_method_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1center-of-mass/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_center_of_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileCenterOfMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_create_file_center_of_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileCenterOfMass, Error]\n ] = create_file_center_of_mass.sync(\n client=client,\n output_unit=UnitLength.CM,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileCenterOfMass = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_center_of_mass.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1execute~1{lang}/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.executor import create_file_execution\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CodeOutput, Error\nfrom kittycad.models.code_language import CodeLanguage\nfrom kittycad.types import Response\n\n\ndef example_create_file_execution():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[CodeOutput, Error]] = create_file_execution.sync(\n client=client,\n lang=CodeLanguage.GO,\n output=None, # Optional[str]\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CodeOutput = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_file_execution.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1surface-area/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_surface_area\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileSurfaceArea\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_create_file_surface_area():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileSurfaceArea, Error]\n ] = create_file_surface_area.sync(\n client=client,\n output_unit=UnitArea.CM2,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileSurfaceArea = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_surface_area.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1balance/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1density/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_density\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileDensity\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_density():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileDensity, Error]] = create_file_density.sync(\n client=client,\n material_mass=3.14,\n material_mass_unit=UnitMass.G,\n output_unit=UnitDensity.LB_FT3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileDensity = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_density.html"
} }
}, },
{ {
@ -305,58 +529,26 @@
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1users~1{id}~1api-calls/get/x-python", "path": "/paths/~1user~1extended/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls_for_user.sync(\n client=client,\n id=\"<string>\",\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_self_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_self_extended.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls_for_user.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self_extended.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1unit~1conversion~1area~1{input_unit}~1{output_unit}/get/x-python", "path": "/paths/~1async~1operations~1{id}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_area_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAreaConversion\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_get_area_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAreaConversion, Error]\n ] = get_area_unit_conversion.sync(\n client=client,\n input_unit=UnitArea.CM2,\n output_unit=UnitArea.CM2,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAreaConversion = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_async_operation\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import (\n Error,\n FileCenterOfMass,\n FileConversion,\n FileDensity,\n FileMass,\n FileSurfaceArea,\n FileVolume,\n TextToCad,\n)\nfrom kittycad.types import Response\n\n\ndef example_get_async_operation():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n TextToCad,\n Error,\n ]\n ] = get_async_operation.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n TextToCad,\n ] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_area_unit_conversion.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_async_operation.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1users/get/x-python", "path": "/paths/~1unit~1conversion~1frequency~1{input_unit}~1{output_unit}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[UserResultsPage, Error]] = list_users.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UserResultsPage = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_frequency_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitFrequencyConversion\nfrom kittycad.models.unit_frequency import UnitFrequency\nfrom kittycad.types import Response\n\n\ndef example_get_frequency_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitFrequencyConversion, Error]\n ] = get_frequency_unit_conversion.sync(\n client=client,\n input_unit=UnitFrequency.GIGAHERTZ,\n output_unit=UnitFrequency.GIGAHERTZ,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitFrequencyConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_frequency_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1users~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user.html"
}
},
{
"op": "add",
"path": "/paths/~1ai~1text-to-3d~1{output_format}/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_3d\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Mesh\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_3d():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Mesh, Error]] = create_text_to_3d.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n prompt=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Mesh = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_3d.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1mass/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileMass, Error]] = create_file_mass.sync(\n client=client,\n material_density=3.14,\n material_density_unit=UnitDensity.LB_FT3,\n output_unit=UnitMass.G,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileMass = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_mass.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1volume/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_volume\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileVolume\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_create_file_volume():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileVolume, Error]] = create_file_volume.sync(\n client=client,\n output_unit=UnitVolume.CM3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileVolume = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_volume.html"
} }
}, },
{ {
@ -369,18 +561,18 @@
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1user~1extended/get/x-python", "path": "/paths/~1users/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_self_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_self_extended.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[UserResultsPage, Error]] = list_users.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UserResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self_extended.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1file~1surface-area/post/x-python", "path": "/paths/~1auth~1email~1callback/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_surface_area\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileSurfaceArea\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_create_file_surface_area():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileSurfaceArea, Error]\n ] = create_file_surface_area.sync(\n client=client,\n output_unit=UnitArea.CM2,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileSurfaceArea = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_auth_email_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = auth_email_callback.sync(\n client=client,\n email=\"<string>\",\n token=\"<string>\",\n callback_url=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_surface_area.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email_callback.html"
} }
}, },
{ {
@ -398,157 +590,5 @@
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import get_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = get_api_token_for_user.sync(\n client=client,\n token=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import get_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = get_api_token_for_user.sync(\n client=client,\n token=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.get_api_token_for_user.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.get_api_token_for_user.html"
} }
},
{
"op": "add",
"path": "/paths/~1user~1session~1{token}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_session_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Session\nfrom kittycad.types import Response\n\n\ndef example_get_session_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Session, Error]] = get_session_for_user.sync(\n client=client,\n token=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Session = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_session_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1logout/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import logout\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_logout():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = logout.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.logout.html"
}
},
{
"op": "add",
"path": "/paths/~1apps~1github~1webhook/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_webhook\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_webhook():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_webhook.sync(\n client=client,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_webhook.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1angle~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_angle_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAngleConversion\nfrom kittycad.models.unit_angle import UnitAngle\nfrom kittycad.types import Response\n\n\ndef example_get_angle_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAngleConversion, Error]\n ] = get_angle_unit_conversion.sync(\n client=client,\n input_unit=UnitAngle.DEGREES,\n output_unit=UnitAngle.DEGREES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAngleConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_angle_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1tax/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import validate_customer_tax_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_validate_customer_tax_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = validate_customer_tax_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.validate_customer_tax_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1balance/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1intent/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_intent_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentIntent\nfrom kittycad.types import Response\n\n\ndef example_create_payment_intent_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PaymentIntent, Error]\n ] = create_payment_intent_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PaymentIntent = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_intent_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1api-calls~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call.html"
}
},
{
"op": "add",
"path": "/paths/~1async~1operations~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_async_operation\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import (\n Error,\n FileCenterOfMass,\n FileConversion,\n FileDensity,\n FileMass,\n FileSurfaceArea,\n FileVolume,\n)\nfrom kittycad.types import Response\n\n\ndef example_get_async_operation():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n Error,\n ]\n ] = get_async_operation.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n ] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_async_operation.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1energy~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_energy_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitEnergyConversion\nfrom kittycad.models.unit_energy import UnitEnergy\nfrom kittycad.types import Response\n\n\ndef example_get_energy_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitEnergyConversion, Error]\n ] = get_energy_unit_conversion.sync(\n client=client,\n input_unit=UnitEnergy.BTU,\n output_unit=UnitEnergy.BTU,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitEnergyConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_energy_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1users-extended/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ExtendedUserResultsPage, Error]\n ] = list_users_extended.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUserResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users_extended.html"
}
},
{
"op": "add",
"path": "/paths/~1users-extended~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_extended.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_extended.html"
}
},
{
"op": "add",
"path": "/paths/~1ws~1executor~1term/get/x-python",
"value": {
"example": "from kittycad.api.executor import create_executor_term\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_create_executor_term():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n websocket = create_executor_term.sync(\n client=client,\n )\n\n # Send a message.\n websocket.send(\"{}\")\n\n # Get the messages.\n for message in websocket:\n print(message)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_executor_term.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = get_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/delete/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_create_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = create_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"<string>\",\n phone=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/put/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_update_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = update_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"<string>\",\n phone=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1api-calls~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1volume~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_volume_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitVolumeConversion\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_get_volume_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitVolumeConversion, Error]\n ] = get_volume_unit_conversion.sync(\n client=client,\n input_unit=UnitVolume.CM3,\n output_unit=UnitVolume.CM3,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitVolumeConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_volume_unit_conversion.html"
}
} }
] ]

View File

@ -1,243 +0,0 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.file_export_format import FileExportFormat
from ...models.image_type import ImageType
from ...models.mesh import Mesh
from ...types import Response
def _get_kwargs(
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/ai/image-to-3d/{input_format}/{output_format}".format(client.base_url, input_format=input_format,output_format=output_format,) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
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
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 Error.from_dict(response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[Mesh, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> Response[Optional[Union[Mesh, Error]]]:
kwargs = _get_kwargs(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> 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(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> Response[Optional[Union[Mesh, Error]]]:
kwargs = _get_kwargs(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> 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 (
await asyncio_detailed(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
)
).parsed

View File

@ -1,208 +0,0 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.file_export_format import FileExportFormat
from ...models.mesh import Mesh
from ...types import Response
def _get_kwargs(
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/ai/text-to-3d/{output_format}".format(client.base_url, output_format=output_format,) # noqa: E501
if prompt is not None:
if "?" in url:
url = url + "&prompt=" + str(prompt)
else:
url = url + "?prompt=" + str(prompt)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
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
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 Error.from_dict(response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[Mesh, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
) -> Response[Optional[Union[Mesh, Error]]]:
kwargs = _get_kwargs(
output_format=output_format,
prompt=prompt,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
) -> 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(
output_format=output_format,
prompt=prompt,
client=client,
).parsed
async def asyncio_detailed(
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
) -> Response[Optional[Union[Mesh, Error]]]:
kwargs = _get_kwargs(
output_format=output_format,
prompt=prompt,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
) -> 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 (
await asyncio_detailed(
output_format=output_format,
prompt=prompt,
client=client,
)
).parsed

View File

@ -0,0 +1,135 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.file_export_format import FileExportFormat
from ...models.text_to_cad import TextToCad
from ...models.text_to_cad_create_body import TextToCadCreateBody
from ...types import Response
def _get_kwargs(
output_format: FileExportFormat,
body: TextToCadCreateBody,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/ai/text-to-cad/{output_format}".format(
client.base_url,
output_format=output_format,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[TextToCad, Error]]:
if response.status_code == 201:
response_201 = TextToCad.from_dict(response.json())
return response_201
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 Error.from_dict(response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[TextToCad, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: FileExportFormat,
body: TextToCadCreateBody,
*,
client: Client,
) -> Response[Optional[Union[TextToCad, Error]]]:
kwargs = _get_kwargs(
output_format=output_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
output_format: FileExportFormat,
body: TextToCadCreateBody,
*,
client: Client,
) -> Optional[Union[TextToCad, Error]]:
"""Because our source of truth for the resulting model is a STEP file, you will always have STEP file contents when you list your generated models. Any other formats you request here will also be returned when you list your generated models.
This 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.
One thing to note, if you hit the cache, this endpoint will return right away. So you only have to wait if the status is not `Completed` or `Failed`.
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(
output_format=output_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
output_format: FileExportFormat,
body: TextToCadCreateBody,
*,
client: Client,
) -> Response[Optional[Union[TextToCad, Error]]]:
kwargs = _get_kwargs(
output_format=output_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
output_format: FileExportFormat,
body: TextToCadCreateBody,
*,
client: Client,
) -> Optional[Union[TextToCad, Error]]:
"""Because our source of truth for the resulting model is a STEP file, you will always have STEP file contents when you list your generated models. Any other formats you request here will also be returned when you list your generated models.
This 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.
One thing to note, if you hit the cache, this endpoint will return right away. So you only have to wait if the status is not `Completed` or `Failed`.
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 (
await asyncio_detailed(
output_format=output_format,
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,126 @@
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.ai_feedback import AiFeedback
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
feedback: AiFeedback,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/text-to-cad/{id}".format(
client.base_url,
id=id,
) # noqa: E501
if feedback is not None:
if "?" in url:
url = url + "&feedback=" + str(feedback)
else:
url = url + "?feedback=" + str(feedback)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
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 Error.from_dict(response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
feedback: AiFeedback,
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
id=id,
feedback=feedback,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: str,
feedback: AiFeedback,
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by any KittyCAD user. The user must be the owner of the text-to-CAD model, in order to give feedback.""" # noqa: E501
return sync_detailed(
id=id,
feedback=feedback,
client=client,
).parsed
async def asyncio_detailed(
id: str,
feedback: AiFeedback,
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
id=id,
feedback=feedback,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
id: str,
feedback: AiFeedback,
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by any KittyCAD user. The user must be the owner of the text-to-CAD model, in order to give feedback.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
feedback=feedback,
client=client,
)
).parsed

View File

@ -0,0 +1,115 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.ai_prompt import AiPrompt
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/ai-prompts/{id}".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[AiPrompt, Error]]:
if response.status_code == 200:
response_200 = AiPrompt.from_dict(response.json())
return response_200
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 Error.from_dict(response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[AiPrompt, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
) -> Response[Optional[Union[AiPrompt, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
) -> Optional[Union[AiPrompt, Error]]:
"""This endpoint requires authentication by a KittyCAD employee.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Optional[Union[AiPrompt, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
) -> Optional[Union[AiPrompt, Error]]:
"""This endpoint requires authentication by a KittyCAD employee.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,115 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.text_to_cad import TextToCad
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/text-to-cad/{id}".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[TextToCad, Error]]:
if response.status_code == 200:
response_200 = TextToCad.from_dict(response.json())
return response_200
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 Error.from_dict(response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[TextToCad, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
) -> Response[Optional[Union[TextToCad, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
) -> Optional[Union[TextToCad, Error]]:
"""This endpoint requires authentication by any KittyCAD user. The user must be the owner of the text-to-CAD model.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Optional[Union[TextToCad, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
) -> Optional[Union[TextToCad, Error]]:
"""This endpoint requires authentication by any KittyCAD user. The user must be the owner of the text-to-CAD model.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,159 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.ai_prompt_results_page import AiPromptResultsPage
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...models.error import Error
from ...types import Response
def _get_kwargs(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/ai-prompts".format(
client.base_url,
) # noqa: E501
if limit is not None:
if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)
if page_token is not None:
if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)
if sort_by is not None:
if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[AiPromptResultsPage, Error]]:
if response.status_code == 200:
response_200 = AiPromptResultsPage.from_dict(response.json())
return response_200
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 Error.from_dict(response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[AiPromptResultsPage, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[AiPromptResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[AiPromptResultsPage, Error]]:
"""For text-to-cad prompts, this will always return the STEP file contents as well as the format the user originally requested.
This endpoint requires authentication by a KittyCAD employee.
The AI prompts are returned in order of creation, with the most recently created AI prompts first.
""" # noqa: E501
return sync_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
).parsed
async def asyncio_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[AiPromptResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[AiPromptResultsPage, Error]]:
"""For text-to-cad prompts, this will always return the STEP file contents as well as the format the user originally requested.
This endpoint requires authentication by a KittyCAD employee.
The AI prompts are returned in order of creation, with the most recently created AI prompts first.
""" # noqa: E501
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -0,0 +1,159 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...models.error import Error
from ...models.text_to_cad_results_page import TextToCadResultsPage
from ...types import Response
def _get_kwargs(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/user/text-to-cad".format(
client.base_url,
) # noqa: E501
if limit is not None:
if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)
if page_token is not None:
if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)
if sort_by is not None:
if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[TextToCadResultsPage, Error]]:
if response.status_code == 200:
response_200 = TextToCadResultsPage.from_dict(response.json())
return response_200
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 Error.from_dict(response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[TextToCadResultsPage, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[TextToCadResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[TextToCadResultsPage, Error]]:
"""This will always return the STEP file contents as well as the format the user originally requested.
This endpoint requires authentication by any KittyCAD user. It returns the text-to-CAD models for the authenticated user.
The text-to-CAD models are returned in order of creation, with the most recently created text-to-CAD models first.
""" # noqa: E501
return sync_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
).parsed
async def asyncio_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[TextToCadResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[TextToCadResultsPage, Error]]:
"""This will always return the STEP file contents as well as the format the user originally requested.
This endpoint requires authentication by any KittyCAD user. It returns the text-to-CAD models for the authenticated user.
The text-to-CAD models are returned in order of creation, with the most recently created text-to-CAD models first.
""" # noqa: E501
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -9,22 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/api-calls/{id}".format(client.base_url, id=id,) # noqa: E501 url = "{}/api-calls/{id}".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -34,11 +26,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPrice, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPrice, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = ApiCallWithPrice.from_dict(response.json()) response_200 = ApiCallWithPrice.from_dict(response.json())
return response_200 return response_200
@ -51,7 +44,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPr
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: ) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
@ -64,21 +56,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: ) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -91,45 +74,27 @@ def sync_detailed(
def sync( def sync(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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. """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. 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 Only KittyCAD employees can view API calls for other users.""" # noqa: E501
return sync_detailed( return sync_detailed(
id=id, id=id,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: ) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -140,16 +105,9 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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. """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. If the user is not authenticated to view the specified API call, then it is not returned.
@ -157,9 +115,7 @@ Only KittyCAD employees can view API calls for other users.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
id=id, id=id,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,22 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/api-calls/{id}".format(client.base_url, id=id,) # noqa: E501 url = "{}/user/api-calls/{id}".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -34,11 +26,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPrice, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPrice, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = ApiCallWithPrice.from_dict(response.json()) response_200 = ApiCallWithPrice.from_dict(response.json())
return response_200 return response_200
@ -51,7 +44,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPr
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: ) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
@ -64,21 +56,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: ) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -91,43 +74,25 @@ def sync_detailed(
def sync( def sync(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.""" # noqa: E501
return sync_detailed( return sync_detailed(
id=id, id=id,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]: ) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -138,24 +103,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
id=id, id=id,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,19 +10,13 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
group_by: ApiCallQueryGroupBy, group_by: ApiCallQueryGroupBy,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/api-call-metrics".format(client.base_url, ) # noqa: E501 url = "{}/api-call-metrics".format(
client.base_url,
) # noqa: E501
if group_by is not None: if group_by is not None:
if "?" in url: if "?" in url:
@ -30,9 +24,6 @@ def _get_kwargs(
else: else:
url = url + "?group_by=" + str(group_by) url = url + "?group_by=" + str(group_by)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -41,16 +32,14 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[List[ApiCallQueryGroup], Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[List[ApiCallQueryGroup], Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = [ response_200 = [ApiCallQueryGroup.from_dict(item) for item in response.json()]
ApiCallQueryGroup.from_dict(item)
for item in response.json()
]
return response_200 return response_200
if response.status_code == 400: if response.status_code == 400:
response_4XX = Error.from_dict(response.json()) response_4XX = Error.from_dict(response.json())
@ -61,7 +50,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[List[ApiCallQ
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[List[ApiCallQueryGroup], Error]]]: ) -> Response[Optional[Union[List[ApiCallQueryGroup], Error]]]:
@ -74,21 +62,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
group_by: ApiCallQueryGroupBy, group_by: ApiCallQueryGroupBy,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[List[ApiCallQueryGroup], Error]]]: ) -> Response[Optional[Union[List[ApiCallQueryGroup], Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
group_by=group_by, group_by=group_by,
client=client, client=client,
) )
@ -101,43 +80,25 @@ def sync_detailed(
def sync( def sync(
group_by: ApiCallQueryGroupBy, group_by: ApiCallQueryGroupBy,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.""" # noqa: E501
return sync_detailed( return sync_detailed(
group_by=group_by, group_by=group_by,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
group_by: ApiCallQueryGroupBy, group_by: ApiCallQueryGroupBy,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[List[ApiCallQueryGroup], Error]]]: ) -> Response[Optional[Union[List[ApiCallQueryGroup], Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
group_by=group_by, group_by=group_by,
client=client, client=client,
) )
@ -148,24 +109,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
group_by: ApiCallQueryGroupBy, group_by: ApiCallQueryGroupBy,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
group_by=group_by, group_by=group_by,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,26 +10,19 @@ from ...models.file_density import FileDensity
from ...models.file_mass import FileMass from ...models.file_mass import FileMass
from ...models.file_surface_area import FileSurfaceArea from ...models.file_surface_area import FileSurfaceArea
from ...models.file_volume import FileVolume from ...models.file_volume import FileVolume
from ...models.text_to_cad import TextToCad
from ...types import Response from ...types import Response
def _get_kwargs( def _get_kwargs(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/async/operations/{id}".format(client.base_url, id=id,) # noqa: E501 url = "{}/async/operations/{id}".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -39,11 +32,23 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[
Union[
FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
TextToCad,
Error,
]
]:
if response.status_code == 200: if response.status_code == 200:
data = response.json() data = response.json()
try: try:
@ -96,6 +101,15 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[FileConversio
raise TypeError() raise TypeError()
option_file_surface_area = FileSurfaceArea.from_dict(data) option_file_surface_area = FileSurfaceArea.from_dict(data)
return option_file_surface_area return option_file_surface_area
except ValueError:
pass
except TypeError:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option_text_to_cad = TextToCad.from_dict(data)
return option_text_to_cad
except ValueError: except ValueError:
raise raise
except TypeError: except TypeError:
@ -109,10 +123,22 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[FileConversio
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]]: ) -> Response[
Optional[
Union[
FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
TextToCad,
Error,
]
]
]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -122,21 +148,25 @@ def _build_response(
def sync_detailed( def sync_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[
Optional[
Union[
) -> Response[Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]]: FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
TextToCad,
Error,
]
]
]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -149,46 +179,53 @@ def sync_detailed(
def sync( def sync(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[
Union[
FileConversion,
) -> Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]] : FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
TextToCad,
Error,
]
]:
"""Get the status and output of an async operation. """Get the status and output of an async operation.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user. This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.
If the user is not authenticated to view the specified async operation, then it is not returned. If the user is not authenticated to view the specified async operation, then it is not returned.
Only KittyCAD employees with the proper access can view async operations for other users.""" # noqa: E501 Only KittyCAD employees with the proper access can view async operations for other users.
""" # noqa: E501
return sync_detailed( return sync_detailed(
id=id, id=id,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[
Optional[
Union[
) -> Response[Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]]: FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
TextToCad,
Error,
]
]
]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -199,27 +236,30 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[
Union[
FileConversion,
) -> Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]] : FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
TextToCad,
Error,
]
]:
"""Get the status and output of an async operation. """Get the status and output of an async operation.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user. This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.
If the user is not authenticated to view the specified async operation, then it is not returned. If the user is not authenticated to view the specified async operation, then it is not returned.
Only KittyCAD employees with the proper access can view async operations for other users.""" # noqa: E501 Only KittyCAD employees with the proper access can view async operations for other users.
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
id=id, id=id,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,31 +10,15 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/api-calls".format(client.base_url, ) # noqa: E501 url = "{}/api-calls".format(
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -42,25 +26,18 @@ def _get_kwargs(
else: else:
url = url + "?limit=" + str(limit) url = url + "?limit=" + str(limit)
if page_token is not None: if page_token is not None:
if "?" in url: if "?" in url:
url = url + "&page_token=" + str(page_token) url = url + "&page_token=" + str(page_token)
else: else:
url = url + "?page_token=" + str(page_token) url = url + "?page_token=" + str(page_token)
if sort_by is not None: if sort_by is not None:
if "?" in url: if "?" in url:
url = url + "&sort_by=" + str(sort_by) url = url + "&sort_by=" + str(sort_by)
else: else:
url = url + "?sort_by=" + str(sort_by) url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -69,11 +46,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPriceResultsPage, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.from_dict(response.json()) response_200 = ApiCallWithPriceResultsPage.from_dict(response.json())
return response_200 return response_200
@ -86,7 +64,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPr
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: ) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
@ -99,37 +76,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: ) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -142,75 +98,33 @@ def sync_detailed(
def sync( def sync(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[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 """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( return sync_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: ) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -221,40 +135,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[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 """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 ( return (
await asyncio_detailed( await asyncio_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,39 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
id: str, id: str,
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/users/{id}/api-calls".format(client.base_url, id=id,) # noqa: E501 url = "{}/users/{id}/api-calls".format(
client.base_url,
id=id,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -50,25 +28,18 @@ def _get_kwargs(
else: else:
url = url + "?limit=" + str(limit) url = url + "?limit=" + str(limit)
if page_token is not None: if page_token is not None:
if "?" in url: if "?" in url:
url = url + "&page_token=" + str(page_token) url = url + "&page_token=" + str(page_token)
else: else:
url = url + "?page_token=" + str(page_token) url = url + "?page_token=" + str(page_token)
if sort_by is not None: if sort_by is not None:
if "?" in url: if "?" in url:
url = url + "&sort_by=" + str(sort_by) url = url + "&sort_by=" + str(sort_by)
else: else:
url = url + "?sort_by=" + str(sort_by) url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -77,11 +48,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPriceResultsPage, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.from_dict(response.json()) response_200 = ApiCallWithPriceResultsPage.from_dict(response.json())
return response_200 return response_200
@ -94,7 +66,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPr
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: ) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
@ -107,45 +78,18 @@ def _build_response(
def sync_detailed( def sync_detailed(
id: str, id: str,
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: ) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -158,94 +102,41 @@ def sync_detailed(
def sync( def sync(
id: str, id: str,
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[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. """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. 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. If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.
The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501 The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
return sync_detailed( return sync_detailed(
id=id, id=id,
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
id: str, id: str,
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: ) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -256,51 +147,25 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
id: str, id: str,
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[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. """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. 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. If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.
The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501 The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
id=id, id=id,
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -11,37 +11,16 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
status: ApiCallStatus, status: ApiCallStatus,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/async/operations".format(client.base_url, ) # noqa: E501 url = "{}/async/operations".format(
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -49,33 +28,24 @@ def _get_kwargs(
else: else:
url = url + "?limit=" + str(limit) url = url + "?limit=" + str(limit)
if page_token is not None: if page_token is not None:
if "?" in url: if "?" in url:
url = url + "&page_token=" + str(page_token) url = url + "&page_token=" + str(page_token)
else: else:
url = url + "?page_token=" + str(page_token) url = url + "?page_token=" + str(page_token)
if sort_by is not None: if sort_by is not None:
if "?" in url: if "?" in url:
url = url + "&sort_by=" + str(sort_by) url = url + "&sort_by=" + str(sort_by)
else: else:
url = url + "?sort_by=" + str(sort_by) url = url + "?sort_by=" + str(sort_by)
if status is not None: if status is not None:
if "?" in url: if "?" in url:
url = url + "&status=" + str(status) url = url + "&status=" + str(status)
else: else:
url = url + "?status=" + str(status) url = url + "?status=" + str(status)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -84,11 +54,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[AsyncApiCallResultsPage, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[AsyncApiCallResultsPage, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = AsyncApiCallResultsPage.from_dict(response.json()) response_200 = AsyncApiCallResultsPage.from_dict(response.json())
return response_200 return response_200
@ -101,7 +72,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[AsyncApiCallR
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]: ) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]:
@ -114,45 +84,18 @@ def _build_response(
def sync_detailed( def sync_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
status: ApiCallStatus, status: ApiCallStatus,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]: ) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
status=status, status=status,
client=client, client=client,
) )
@ -165,92 +108,38 @@ def sync_detailed(
def sync( def sync(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
status: ApiCallStatus, status: ApiCallStatus,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[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. """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 This endpoint requires authentication by a KittyCAD employee.""" # noqa: E501
return sync_detailed( return sync_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
status=status, status=status,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
status: ApiCallStatus, status: ApiCallStatus,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]: ) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
status=status, status=status,
client=client, client=client,
) )
@ -261,49 +150,22 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
status: ApiCallStatus, status: ApiCallStatus,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[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. """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 This endpoint requires authentication by a KittyCAD employee.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
status=status, status=status,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,31 +10,15 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/api-calls".format(client.base_url, ) # noqa: E501 url = "{}/user/api-calls".format(
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -42,25 +26,18 @@ def _get_kwargs(
else: else:
url = url + "?limit=" + str(limit) url = url + "?limit=" + str(limit)
if page_token is not None: if page_token is not None:
if "?" in url: if "?" in url:
url = url + "&page_token=" + str(page_token) url = url + "&page_token=" + str(page_token)
else: else:
url = url + "?page_token=" + str(page_token) url = url + "?page_token=" + str(page_token)
if sort_by is not None: if sort_by is not None:
if "?" in url: if "?" in url:
url = url + "&sort_by=" + str(sort_by) url = url + "&sort_by=" + str(sort_by)
else: else:
url = url + "?sort_by=" + str(sort_by) url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -69,11 +46,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPriceResultsPage, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.from_dict(response.json()) response_200 = ApiCallWithPriceResultsPage.from_dict(response.json())
return response_200 return response_200
@ -86,7 +64,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPr
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: ) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
@ -99,37 +76,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: ) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -142,76 +98,35 @@ def sync_detailed(
def sync( def sync(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: ) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
"""This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user. """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 The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
return sync_detailed( return sync_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]: ) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -222,41 +137,21 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]: ) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
"""This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user. """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 The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/api-tokens".format(client.base_url, ) # noqa: E501 url = "{}/user/api-tokens".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,7 +24,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -43,7 +40,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiToken, Err
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[ApiToken, Error]]]: ) -> Response[Optional[Union[ApiToken, Error]]]:
@ -56,13 +52,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ApiToken, Error]]]: ) -> Response[Optional[Union[ApiToken, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -75,27 +68,21 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ApiToken, Error]]]: ) -> Response[Optional[Union[ApiToken, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -106,16 +93,13 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,22 +8,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/api-tokens/{token}".format(client.base_url, token=token,) # noqa: E501 url = "{}/user/api-tokens/{token}".format(
client.base_url,
token=token,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -33,7 +25,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -48,10 +39,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Error] :
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -61,21 +49,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
token=token, token=token,
client=client, client=client,
) )
@ -88,44 +67,27 @@ def sync_detailed(
def sync( def sync(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user. """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 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
return sync_detailed( return sync_detailed(
token=token, token=token,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
token=token, token=token,
client=client, client=client,
) )
@ -136,25 +98,17 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user. """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 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
return ( return (
await asyncio_detailed( await asyncio_detailed(
token=token, token=token,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,22 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/api-tokens/{token}".format(client.base_url, token=token,) # noqa: E501 url = "{}/user/api-tokens/{token}".format(
client.base_url,
token=token,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -34,7 +26,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -51,7 +42,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiToken, Err
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[ApiToken, Error]]]: ) -> Response[Optional[Union[ApiToken, Error]]]:
@ -64,21 +54,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ApiToken, Error]]]: ) -> Response[Optional[Union[ApiToken, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
token=token, token=token,
client=client, client=client,
) )
@ -91,43 +72,25 @@ def sync_detailed(
def sync( def sync(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501
return sync_detailed( return sync_detailed(
token=token, token=token,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ApiToken, Error]]]: ) -> Response[Optional[Union[ApiToken, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
token=token, token=token,
client=client, client=client,
) )
@ -138,24 +101,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
token=token, token=token,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,31 +10,15 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/api-tokens".format(client.base_url, ) # noqa: E501 url = "{}/user/api-tokens".format(
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -42,25 +26,18 @@ def _get_kwargs(
else: else:
url = url + "?limit=" + str(limit) url = url + "?limit=" + str(limit)
if page_token is not None: if page_token is not None:
if "?" in url: if "?" in url:
url = url + "&page_token=" + str(page_token) url = url + "&page_token=" + str(page_token)
else: else:
url = url + "?page_token=" + str(page_token) url = url + "?page_token=" + str(page_token)
if sort_by is not None: if sort_by is not None:
if "?" in url: if "?" in url:
url = url + "&sort_by=" + str(sort_by) url = url + "&sort_by=" + str(sort_by)
else: else:
url = url + "?sort_by=" + str(sort_by) url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -69,11 +46,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiTokenResultsPage, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiTokenResultsPage, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = ApiTokenResultsPage.from_dict(response.json()) response_200 = ApiTokenResultsPage.from_dict(response.json())
return response_200 return response_200
@ -86,7 +64,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiTokenResul
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[ApiTokenResultsPage, Error]]]: ) -> Response[Optional[Union[ApiTokenResultsPage, Error]]]:
@ -99,37 +76,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiTokenResultsPage, Error]]]: ) -> Response[Optional[Union[ApiTokenResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -142,76 +98,35 @@ def sync_detailed(
def sync( def sync(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[ApiTokenResultsPage, Error]]: ) -> Optional[Union[ApiTokenResultsPage, Error]]:
"""This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user. """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 The API tokens are returned in order of creation, with the most recently created API tokens first.
""" # noqa: E501
return sync_detailed( return sync_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiTokenResultsPage, Error]]]: ) -> Response[Optional[Union[ApiTokenResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -222,41 +137,21 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[ApiTokenResultsPage, Error]]: ) -> Optional[Union[ApiTokenResultsPage, Error]]:
"""This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user. """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 The API tokens are returned in order of creation, with the most recently created API tokens first.
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,14 +8,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/apps/github/callback".format(client.base_url, ) # noqa: E501 url = "{}/apps/github/callback".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -25,7 +23,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -40,10 +37,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Error] :
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -53,13 +47,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -72,28 +63,23 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos. """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 The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.
""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -104,17 +90,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos. """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 The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/apps/github/consent".format(client.base_url, ) # noqa: E501 url = "{}/apps/github/consent".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,11 +24,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[AppClientInfo, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[AppClientInfo, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = AppClientInfo.from_dict(response.json()) response_200 = AppClientInfo.from_dict(response.json())
return response_200 return response_200
@ -43,7 +42,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[AppClientInfo
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[AppClientInfo, Error]]]: ) -> Response[Optional[Union[AppClientInfo, Error]]]:
@ -56,13 +54,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[AppClientInfo, Error]]]: ) -> Response[Optional[Union[AppClientInfo, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -75,28 +70,23 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[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. """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 The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.
""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[AppClientInfo, Error]]]: ) -> Response[Optional[Union[AppClientInfo, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -107,17 +97,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[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. """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 The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,22 +8,13 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/apps/github/webhook".format(client.base_url, ) # noqa: E501 url = "{}/apps/github/webhook".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -48,10 +39,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Error] :
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -61,21 +49,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
body=body, body=body,
client=client, client=client,
) )
@ -88,43 +67,25 @@ def sync_detailed(
def sync( def sync(
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""These come from the GitHub app.""" # noqa: E501 """These come from the GitHub app.""" # noqa: E501
return sync_detailed( return sync_detailed(
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
body=body, body=body,
client=client, client=client,
) )
@ -135,24 +96,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""These come from the GitHub app.""" # noqa: E501 """These come from the GitHub app.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -4,19 +4,14 @@ from websockets.client import WebSocketClientProtocol, connect as ws_connect_asy
from websockets.sync.client import ClientConnection, connect as ws_connect from websockets.sync.client import ClientConnection, connect as ws_connect
from ...client import Client from ...client import Client
from ...models.error import Error
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/ws/executor/term".format(client.base_url) # noqa: E501 url = "{}/ws/executor/term".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -25,46 +20,32 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def sync( def sync(
*, *,
client: Client, client: Client,
) -> ClientConnection: ) -> ClientConnection:
"""Attach to a docker container to create an interactive terminal.""" # noqa: E501 """Attach to a docker container to create an interactive terminal.""" # noqa: E501
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
with ws_connect(kwargs["url"].replace("https://", "wss://"), additional_headers=kwargs["headers"]) as websocket: return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=None, compression=None, max_size=None) # type: ignore
return websocket # type: ignore
# Return an error if we got here.
return Error(message="An error occurred while connecting to the websocket.")
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> WebSocketClientProtocol: ) -> WebSocketClientProtocol:
"""Attach to a docker container to create an interactive terminal.""" # noqa: E501 """Attach to a docker container to create an interactive terminal.""" # noqa: E501
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
async with ws_connect_async(kwargs["url"].replace("https://", "wss://"), extra_headers=kwargs["headers"]) as websocket: return await ws_connect_async(
return websocket kwargs["url"].replace("http", "ws"), extra_headers=kwargs["headers"]
)
# Return an error if we got here.
return Error(message="An error occurred while connecting to the websocket.")

View File

@ -10,33 +10,16 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
lang: CodeLanguage, lang: CodeLanguage,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
output: Optional[str] = None, output: Optional[str] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/file/execute/{lang}".format(client.base_url, lang=lang,) # noqa: E501 url = "{}/file/execute/{lang}".format(
client.base_url,
lang=lang,
) # noqa: E501
if output is not None: if output is not None:
if "?" in url: if "?" in url:
@ -44,11 +27,6 @@ def _get_kwargs(
else: else:
url = url + "?output=" + str(output) url = url + "?output=" + str(output)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -74,7 +52,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[CodeOutput, E
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[CodeOutput, Error]]]: ) -> Response[Optional[Union[CodeOutput, Error]]]:
@ -87,37 +64,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
lang: CodeLanguage, lang: CodeLanguage,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
output: Optional[str] = None, output: Optional[str] = None,
) -> Response[Optional[Union[CodeOutput, Error]]]: ) -> Response[Optional[Union[CodeOutput, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
lang=lang, lang=lang,
output=output, output=output,
body=body, body=body,
client=client, client=client,
) )
@ -130,75 +86,31 @@ def sync_detailed(
def sync( def sync(
lang: CodeLanguage, lang: CodeLanguage,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
output: Optional[str] = None, output: Optional[str] = None,
) -> Optional[Union[CodeOutput, Error]]: ) -> Optional[Union[CodeOutput, Error]]:
return sync_detailed( return sync_detailed(
lang=lang, lang=lang,
output=output, output=output,
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
lang: CodeLanguage, lang: CodeLanguage,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
output: Optional[str] = None, output: Optional[str] = None,
) -> Response[Optional[Union[CodeOutput, Error]]]: ) -> Response[Optional[Union[CodeOutput, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
lang=lang, lang=lang,
output=output, output=output,
body=body, body=body,
client=client, client=client,
) )
@ -209,40 +121,17 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
lang: CodeLanguage, lang: CodeLanguage,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
output: Optional[str] = None, output: Optional[str] = None,
) -> Optional[Union[CodeOutput, Error]]: ) -> Optional[Union[CodeOutput, Error]]:
return ( return (
await asyncio_detailed( await asyncio_detailed(
lang=lang, lang=lang,
output=output, output=output,
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -11,31 +11,15 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
output_unit: UnitLength, output_unit: UnitLength,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/file/center-of-mass".format(client.base_url, ) # noqa: E501 url = "{}/file/center-of-mass".format(
client.base_url,
) # noqa: E501
if output_unit is not None: if output_unit is not None:
if "?" in url: if "?" in url:
@ -43,19 +27,12 @@ def _get_kwargs(
else: else:
url = url + "?output_unit=" + str(output_unit) url = url + "?output_unit=" + str(output_unit)
if src_format is not None: if src_format is not None:
if "?" in url: if "?" in url:
url = url + "&src_format=" + str(src_format) url = url + "&src_format=" + str(src_format)
else: else:
url = url + "?src_format=" + str(src_format) url = url + "?src_format=" + str(src_format)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -68,7 +45,9 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[FileCenterOfMass, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[FileCenterOfMass, Error]]:
if response.status_code == 201: if response.status_code == 201:
response_201 = FileCenterOfMass.from_dict(response.json()) response_201 = FileCenterOfMass.from_dict(response.json())
return response_201 return response_201
@ -81,7 +60,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[FileCenterOfM
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[FileCenterOfMass, Error]]]: ) -> Response[Optional[Union[FileCenterOfMass, Error]]]:
@ -94,37 +72,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
output_unit: UnitLength, output_unit: UnitLength,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileCenterOfMass, Error]]]: ) -> Response[Optional[Union[FileCenterOfMass, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -137,79 +94,38 @@ def sync_detailed(
def sync( def sync(
output_unit: UnitLength, output_unit: UnitLength,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileCenterOfMass, Error]]: ) -> Optional[Union[FileCenterOfMass, Error]]:
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale. """We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
This endpoint returns the cartesian co-ordinate in world space measure units. This endpoint returns the cartesian coordinate in world space measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported. In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. 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 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
return sync_detailed( return sync_detailed(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
output_unit: UnitLength, output_unit: UnitLength,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileCenterOfMass, Error]]]: ) -> Response[Optional[Union[FileCenterOfMass, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -220,44 +136,24 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
output_unit: UnitLength, output_unit: UnitLength,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileCenterOfMass, Error]]: ) -> Optional[Union[FileCenterOfMass, Error]]:
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale. """We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
This endpoint returns the cartesian co-ordinate in world space measure units. This endpoint returns the cartesian coordinate in world space measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported. In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. 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 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
return ( return (
await asyncio_detailed( await asyncio_detailed(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -11,38 +11,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
output_format: FileExportFormat, output_format: FileExportFormat,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/file/conversion/{src_format}/{output_format}".format(client.base_url, output_format=output_format,src_format=src_format,) # noqa: E501 url = "{}/file/conversion/{src_format}/{output_format}".format(
client.base_url,
output_format=output_format,
src_format=src_format,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -56,7 +35,9 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[FileConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[FileConversion, Error]]:
if response.status_code == 201: if response.status_code == 201:
response_201 = FileConversion.from_dict(response.json()) response_201 = FileConversion.from_dict(response.json())
return response_201 return response_201
@ -69,7 +50,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[FileConversio
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[FileConversion, Error]]]: ) -> Response[Optional[Union[FileConversion, Error]]]:
@ -82,37 +62,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
output_format: FileExportFormat, output_format: FileExportFormat,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileConversion, Error]]]: ) -> Response[Optional[Union[FileConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
output_format=output_format, output_format=output_format,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -125,78 +84,37 @@ def sync_detailed(
def sync( def sync(
output_format: FileExportFormat, output_format: FileExportFormat,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileConversion, Error]]: ) -> Optional[Union[FileConversion, Error]]:
"""If you wish to specify the conversion options, use the `/file/conversion` endpoint instead. """If you wish to specify the conversion options, use the `/file/conversion` endpoint instead.
Convert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously. 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 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 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
return sync_detailed( return sync_detailed(
output_format=output_format, output_format=output_format,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
output_format: FileExportFormat, output_format: FileExportFormat,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileConversion, Error]]]: ) -> Response[Optional[Union[FileConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
output_format=output_format, output_format=output_format,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -207,43 +125,23 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
output_format: FileExportFormat, output_format: FileExportFormat,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileConversion, Error]]: ) -> Optional[Union[FileConversion, Error]]:
"""If you wish to specify the conversion options, use the `/file/conversion` endpoint instead. """If you wish to specify the conversion options, use the `/file/conversion` endpoint instead.
Convert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously. 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 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 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
return ( return (
await asyncio_detailed( await asyncio_detailed(
output_format=output_format, output_format=output_format,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -12,43 +12,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
material_mass: float, material_mass: float,
material_mass_unit: UnitMass, material_mass_unit: UnitMass,
output_unit: UnitDensity, output_unit: UnitDensity,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/file/density".format(client.base_url, ) # noqa: E501 url = "{}/file/density".format(
client.base_url,
) # noqa: E501
if material_mass is not None: if material_mass is not None:
if "?" in url: if "?" in url:
@ -56,35 +30,24 @@ def _get_kwargs(
else: else:
url = url + "?material_mass=" + str(material_mass) url = url + "?material_mass=" + str(material_mass)
if material_mass_unit is not None: if material_mass_unit is not None:
if "?" in url: if "?" in url:
url = url + "&material_mass_unit=" + str(material_mass_unit) url = url + "&material_mass_unit=" + str(material_mass_unit)
else: else:
url = url + "?material_mass_unit=" + str(material_mass_unit) url = url + "?material_mass_unit=" + str(material_mass_unit)
if output_unit is not None: if output_unit is not None:
if "?" in url: if "?" in url:
url = url + "&output_unit=" + str(output_unit) url = url + "&output_unit=" + str(output_unit)
else: else:
url = url + "?output_unit=" + str(output_unit) url = url + "?output_unit=" + str(output_unit)
if src_format is not None: if src_format is not None:
if "?" in url: if "?" in url:
url = url + "&src_format=" + str(src_format) url = url + "&src_format=" + str(src_format)
else: else:
url = url + "?src_format=" + str(src_format) url = url + "?src_format=" + str(src_format)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -110,7 +73,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[FileDensity,
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[FileDensity, Error]]]: ) -> Response[Optional[Union[FileDensity, Error]]]:
@ -123,53 +85,20 @@ def _build_response(
def sync_detailed( def sync_detailed(
material_mass: float, material_mass: float,
material_mass_unit: UnitMass, material_mass_unit: UnitMass,
output_unit: UnitDensity, output_unit: UnitDensity,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileDensity, Error]]]: ) -> Response[Optional[Union[FileDensity, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
material_mass=material_mass, material_mass=material_mass,
material_mass_unit=material_mass_unit, material_mass_unit=material_mass_unit,
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -182,111 +111,46 @@ def sync_detailed(
def sync( def sync(
material_mass: float, material_mass: float,
material_mass_unit: UnitMass, material_mass_unit: UnitMass,
output_unit: UnitDensity, output_unit: UnitDensity,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileDensity, Error]]: ) -> Optional[Union[FileDensity, Error]]:
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale. """We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
This endpoint assumes if you are giving a material mass in a specific mass units, we return a density in mass unit per cubic measure unit. This endpoint assumes if you are giving a material mass in a specific mass units, we return a density in mass unit per cubic measure unit.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported. In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. 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 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
return sync_detailed( return sync_detailed(
material_mass=material_mass, material_mass=material_mass,
material_mass_unit=material_mass_unit, material_mass_unit=material_mass_unit,
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
material_mass: float, material_mass: float,
material_mass_unit: UnitMass, material_mass_unit: UnitMass,
output_unit: UnitDensity, output_unit: UnitDensity,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileDensity, Error]]]: ) -> Response[Optional[Union[FileDensity, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
material_mass=material_mass, material_mass=material_mass,
material_mass_unit=material_mass_unit, material_mass_unit=material_mass_unit,
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -297,60 +161,28 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
material_mass: float, material_mass: float,
material_mass_unit: UnitMass, material_mass_unit: UnitMass,
output_unit: UnitDensity, output_unit: UnitDensity,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileDensity, Error]]: ) -> Optional[Union[FileDensity, Error]]:
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale. """We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
This endpoint assumes if you are giving a material mass in a specific mass units, we return a density in mass unit per cubic measure unit. This endpoint assumes if you are giving a material mass in a specific mass units, we return a density in mass unit per cubic measure unit.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported. In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. 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 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
return ( return (
await asyncio_detailed( await asyncio_detailed(
material_mass=material_mass, material_mass=material_mass,
material_mass_unit=material_mass_unit, material_mass_unit=material_mass_unit,
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -12,43 +12,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
material_density: float, material_density: float,
material_density_unit: UnitDensity, material_density_unit: UnitDensity,
output_unit: UnitMass, output_unit: UnitMass,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/file/mass".format(client.base_url, ) # noqa: E501 url = "{}/file/mass".format(
client.base_url,
) # noqa: E501
if material_density is not None: if material_density is not None:
if "?" in url: if "?" in url:
@ -56,35 +30,24 @@ def _get_kwargs(
else: else:
url = url + "?material_density=" + str(material_density) url = url + "?material_density=" + str(material_density)
if material_density_unit is not None: if material_density_unit is not None:
if "?" in url: if "?" in url:
url = url + "&material_density_unit=" + str(material_density_unit) url = url + "&material_density_unit=" + str(material_density_unit)
else: else:
url = url + "?material_density_unit=" + str(material_density_unit) url = url + "?material_density_unit=" + str(material_density_unit)
if output_unit is not None: if output_unit is not None:
if "?" in url: if "?" in url:
url = url + "&output_unit=" + str(output_unit) url = url + "&output_unit=" + str(output_unit)
else: else:
url = url + "?output_unit=" + str(output_unit) url = url + "?output_unit=" + str(output_unit)
if src_format is not None: if src_format is not None:
if "?" in url: if "?" in url:
url = url + "&src_format=" + str(src_format) url = url + "&src_format=" + str(src_format)
else: else:
url = url + "?src_format=" + str(src_format) url = url + "?src_format=" + str(src_format)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -110,7 +73,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[FileMass, Err
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[FileMass, Error]]]: ) -> Response[Optional[Union[FileMass, Error]]]:
@ -123,53 +85,20 @@ def _build_response(
def sync_detailed( def sync_detailed(
material_density: float, material_density: float,
material_density_unit: UnitDensity, material_density_unit: UnitDensity,
output_unit: UnitMass, output_unit: UnitMass,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileMass, Error]]]: ) -> Response[Optional[Union[FileMass, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
material_density=material_density, material_density=material_density,
material_density_unit=material_density_unit, material_density_unit=material_density_unit,
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -182,111 +111,46 @@ def sync_detailed(
def sync( def sync(
material_density: float, material_density: float,
material_density_unit: UnitDensity, material_density_unit: UnitDensity,
output_unit: UnitMass, output_unit: UnitMass,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileMass, Error]]: ) -> Optional[Union[FileMass, Error]]:
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale. """We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
This endpoint assumes if you are giving a material density in a specific mass unit per cubic measure unit, we return a mass in mass units. The same mass units as passed in the material density. This endpoint assumes if you are giving a material density in a specific mass unit per cubic measure unit, we return a mass in mass units. The same mass units as passed in the material density.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported. In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. 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 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
return sync_detailed( return sync_detailed(
material_density=material_density, material_density=material_density,
material_density_unit=material_density_unit, material_density_unit=material_density_unit,
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
material_density: float, material_density: float,
material_density_unit: UnitDensity, material_density_unit: UnitDensity,
output_unit: UnitMass, output_unit: UnitMass,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileMass, Error]]]: ) -> Response[Optional[Union[FileMass, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
material_density=material_density, material_density=material_density,
material_density_unit=material_density_unit, material_density_unit=material_density_unit,
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -297,60 +161,28 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
material_density: float, material_density: float,
material_density_unit: UnitDensity, material_density_unit: UnitDensity,
output_unit: UnitMass, output_unit: UnitMass,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileMass, Error]]: ) -> Optional[Union[FileMass, Error]]:
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale. """We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
This endpoint assumes if you are giving a material density in a specific mass unit per cubic measure unit, we return a mass in mass units. The same mass units as passed in the material density. This endpoint assumes if you are giving a material density in a specific mass unit per cubic measure unit, we return a mass in mass units. The same mass units as passed in the material density.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported. In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. 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 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
return ( return (
await asyncio_detailed( await asyncio_detailed(
material_density=material_density, material_density=material_density,
material_density_unit=material_density_unit, material_density_unit=material_density_unit,
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -11,31 +11,15 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
output_unit: UnitArea, output_unit: UnitArea,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/file/surface-area".format(client.base_url, ) # noqa: E501 url = "{}/file/surface-area".format(
client.base_url,
) # noqa: E501
if output_unit is not None: if output_unit is not None:
if "?" in url: if "?" in url:
@ -43,19 +27,12 @@ def _get_kwargs(
else: else:
url = url + "?output_unit=" + str(output_unit) url = url + "?output_unit=" + str(output_unit)
if src_format is not None: if src_format is not None:
if "?" in url: if "?" in url:
url = url + "&src_format=" + str(src_format) url = url + "&src_format=" + str(src_format)
else: else:
url = url + "?src_format=" + str(src_format) url = url + "?src_format=" + str(src_format)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -68,7 +45,9 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[FileSurfaceArea, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[FileSurfaceArea, Error]]:
if response.status_code == 201: if response.status_code == 201:
response_201 = FileSurfaceArea.from_dict(response.json()) response_201 = FileSurfaceArea.from_dict(response.json())
return response_201 return response_201
@ -81,7 +60,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[FileSurfaceAr
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[FileSurfaceArea, Error]]]: ) -> Response[Optional[Union[FileSurfaceArea, Error]]]:
@ -94,37 +72,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
output_unit: UnitArea, output_unit: UnitArea,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileSurfaceArea, Error]]]: ) -> Response[Optional[Union[FileSurfaceArea, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -137,79 +94,38 @@ def sync_detailed(
def sync( def sync(
output_unit: UnitArea, output_unit: UnitArea,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileSurfaceArea, Error]]: ) -> Optional[Union[FileSurfaceArea, Error]]:
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale. """We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
This endpoint returns the square measure units. This endpoint returns the square measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported. In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. 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 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
return sync_detailed( return sync_detailed(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
output_unit: UnitArea, output_unit: UnitArea,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileSurfaceArea, Error]]]: ) -> Response[Optional[Union[FileSurfaceArea, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -220,44 +136,24 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
output_unit: UnitArea, output_unit: UnitArea,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileSurfaceArea, Error]]: ) -> Optional[Union[FileSurfaceArea, Error]]:
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale. """We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
This endpoint returns the square measure units. This endpoint returns the square measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported. In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. 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 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
return ( return (
await asyncio_detailed( await asyncio_detailed(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -11,31 +11,15 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
output_unit: UnitVolume, output_unit: UnitVolume,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/file/volume".format(client.base_url, ) # noqa: E501 url = "{}/file/volume".format(
client.base_url,
) # noqa: E501
if output_unit is not None: if output_unit is not None:
if "?" in url: if "?" in url:
@ -43,19 +27,12 @@ def _get_kwargs(
else: else:
url = url + "?output_unit=" + str(output_unit) url = url + "?output_unit=" + str(output_unit)
if src_format is not None: if src_format is not None:
if "?" in url: if "?" in url:
url = url + "&src_format=" + str(src_format) url = url + "&src_format=" + str(src_format)
else: else:
url = url + "?src_format=" + str(src_format) url = url + "?src_format=" + str(src_format)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -81,7 +58,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[FileVolume, E
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[FileVolume, Error]]]: ) -> Response[Optional[Union[FileVolume, Error]]]:
@ -94,37 +70,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
output_unit: UnitVolume, output_unit: UnitVolume,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileVolume, Error]]]: ) -> Response[Optional[Union[FileVolume, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -137,79 +92,38 @@ def sync_detailed(
def sync( def sync(
output_unit: UnitVolume, output_unit: UnitVolume,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileVolume, Error]]: ) -> Optional[Union[FileVolume, Error]]:
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale. """We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
This endpoint returns the cubic measure units. This endpoint returns the cubic measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported. In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. 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 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
return sync_detailed( return sync_detailed(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
output_unit: UnitVolume, output_unit: UnitVolume,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[FileVolume, Error]]]: ) -> Response[Optional[Union[FileVolume, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
@ -220,44 +134,24 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
output_unit: UnitVolume, output_unit: UnitVolume,
src_format: FileImportFormat, src_format: FileImportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[FileVolume, Error]]: ) -> Optional[Union[FileVolume, Error]]:
"""We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale. """We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.
This endpoint returns the cubic measure units. This endpoint returns the cubic measure units.
In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported. In the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.
Get the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously. 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 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
return ( return (
await asyncio_detailed( await asyncio_detailed(
output_unit=output_unit, output_unit=output_unit,
src_format=src_format, src_format=src_format,
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,22 +10,13 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
body: EmailAuthenticationForm, body: EmailAuthenticationForm,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/auth/email".format(client.base_url, ) # noqa: E501 url = "{}/auth/email".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -39,7 +30,9 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[VerificationToken, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[VerificationToken, Error]]:
if response.status_code == 201: if response.status_code == 201:
response_201 = VerificationToken.from_dict(response.json()) response_201 = VerificationToken.from_dict(response.json())
return response_201 return response_201
@ -52,7 +45,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[VerificationT
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[VerificationToken, Error]]]: ) -> Response[Optional[Union[VerificationToken, Error]]]:
@ -65,21 +57,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
body: EmailAuthenticationForm, body: EmailAuthenticationForm,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[VerificationToken, Error]]]: ) -> Response[Optional[Union[VerificationToken, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
body=body, body=body,
client=client, client=client,
) )
@ -92,43 +75,23 @@ def sync_detailed(
def sync( def sync(
body: EmailAuthenticationForm, body: EmailAuthenticationForm,
*, *,
client: Client, client: Client,
) -> Optional[Union[VerificationToken, Error]]: ) -> Optional[Union[VerificationToken, Error]]:
return sync_detailed( return sync_detailed(
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
body: EmailAuthenticationForm, body: EmailAuthenticationForm,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[VerificationToken, Error]]]: ) -> Response[Optional[Union[VerificationToken, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
body=body, body=body,
client=client, client=client,
) )
@ -139,24 +102,13 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
body: EmailAuthenticationForm, body: EmailAuthenticationForm,
*, *,
client: Client, client: Client,
) -> Optional[Union[VerificationToken, Error]]: ) -> Optional[Union[VerificationToken, Error]]:
return ( return (
await asyncio_detailed( await asyncio_detailed(
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,31 +8,15 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
email: str, email: str,
token: str, token: str,
*, *,
client: Client, client: Client,
callback_url: Optional[str] = None, callback_url: Optional[str] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/auth/email/callback".format(client.base_url, ) # noqa: E501 url = "{}/auth/email/callback".format(
client.base_url,
) # noqa: E501
if callback_url is not None: if callback_url is not None:
if "?" in url: if "?" in url:
@ -40,25 +24,18 @@ def _get_kwargs(
else: else:
url = url + "?callback_url=" + str(callback_url) url = url + "?callback_url=" + str(callback_url)
if email is not None: if email is not None:
if "?" in url: if "?" in url:
url = url + "&email=" + str(email) url = url + "&email=" + str(email)
else: else:
url = url + "?email=" + str(email) url = url + "?email=" + str(email)
if token is not None: if token is not None:
if "?" in url: if "?" in url:
url = url + "&token=" + str(token) url = url + "&token=" + str(token)
else: else:
url = url + "?token=" + str(token) url = url + "?token=" + str(token)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -67,7 +44,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -82,10 +58,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Error] :
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -95,37 +68,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
email: str, email: str,
token: str, token: str,
*, *,
client: Client, client: Client,
callback_url: Optional[str] = None, callback_url: Optional[str] = None,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
callback_url=callback_url, callback_url=callback_url,
email=email, email=email,
token=token, token=token,
client=client, client=client,
) )
@ -138,75 +90,31 @@ def sync_detailed(
def sync( def sync(
email: str, email: str,
token: str, token: str,
*, *,
client: Client, client: Client,
callback_url: Optional[str] = None, callback_url: Optional[str] = None,
) -> Optional[Error]: ) -> Optional[Error]:
return sync_detailed( return sync_detailed(
callback_url=callback_url, callback_url=callback_url,
email=email, email=email,
token=token, token=token,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
email: str, email: str,
token: str, token: str,
*, *,
client: Client, client: Client,
callback_url: Optional[str] = None, callback_url: Optional[str] = None,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
callback_url=callback_url, callback_url=callback_url,
email=email, email=email,
token=token, token=token,
client=client, client=client,
) )
@ -217,40 +125,17 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
email: str, email: str,
token: str, token: str,
*, *,
client: Client, client: Client,
callback_url: Optional[str] = None, callback_url: Optional[str] = None,
) -> Optional[Error]: ) -> Optional[Error]:
return ( return (
await asyncio_detailed( await asyncio_detailed(
callback_url=callback_url, callback_url=callback_url,
email=email, email=email,
token=token, token=token,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,14 +8,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/logout".format(client.base_url, ) # noqa: E501 url = "{}/logout".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -25,7 +23,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -40,10 +37,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Error] :
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -53,13 +47,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -72,27 +63,21 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This is used in logout scenarios.""" # noqa: E501 """This is used in logout scenarios.""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -103,16 +88,13 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This is used in logout scenarios.""" # noqa: E501 """This is used in logout scenarios.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/.well-known/ai-plugin.json".format(client.base_url, ) # noqa: E501 url = "{}/.well-known/ai-plugin.json".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,11 +24,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[AiPluginManifest, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[AiPluginManifest, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = AiPluginManifest.from_dict(response.json()) response_200 = AiPluginManifest.from_dict(response.json())
return response_200 return response_200
@ -43,7 +42,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[AiPluginManif
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[AiPluginManifest, Error]]]: ) -> Response[Optional[Union[AiPluginManifest, Error]]]:
@ -56,13 +54,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[AiPluginManifest, Error]]]: ) -> Response[Optional[Union[AiPluginManifest, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -75,27 +70,19 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[AiPluginManifest, Error]]: ) -> Optional[Union[AiPluginManifest, Error]]:
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[AiPluginManifest, Error]]]: ) -> Response[Optional[Union[AiPluginManifest, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -106,16 +93,11 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[AiPluginManifest, Error]]: ) -> Optional[Union[AiPluginManifest, Error]]:
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/_meta/info".format(client.base_url, ) # noqa: E501 url = "{}/_meta/info".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,7 +24,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -43,7 +40,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Metadata, Err
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[Metadata, Error]]]: ) -> Response[Optional[Union[Metadata, Error]]]:
@ -56,13 +52,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Metadata, Error]]]: ) -> Response[Optional[Union[Metadata, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -75,28 +68,22 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[Metadata, Error]]: ) -> Optional[Union[Metadata, Error]]:
"""This includes information on any of our other distributed systems it is connected to. """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 You must be a KittyCAD employee to perform this request.""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Metadata, Error]]]: ) -> Response[Optional[Union[Metadata, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -107,17 +94,14 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[Metadata, Error]]: ) -> Optional[Union[Metadata, Error]]:
"""This includes information on any of our other distributed systems it is connected to. """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 You must be a KittyCAD employee to perform this request.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,14 +8,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/openai/openapi.json".format(client.base_url, ) # noqa: E501 url = "{}/openai/openapi.json".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -25,7 +23,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -42,7 +39,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]]
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[dict, Error]]]: ) -> Response[Optional[Union[dict, Error]]]:
@ -55,13 +51,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[dict, Error]]]: ) -> Response[Optional[Union[dict, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -74,27 +67,21 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[dict, Error]]]: ) -> Response[Optional[Union[dict, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -105,16 +92,13 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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 ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,14 +8,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/".format(client.base_url, ) # noqa: E501 url = "{}/".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -25,7 +23,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -42,7 +39,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]]
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[dict, Error]]]: ) -> Response[Optional[Union[dict, Error]]]:
@ -55,13 +51,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[dict, Error]]]: ) -> Response[Optional[Union[dict, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -74,27 +67,19 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[dict, Error]]: ) -> Optional[Union[dict, Error]]:
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[dict, Error]]]: ) -> Response[Optional[Union[dict, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -105,16 +90,11 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[dict, Error]]: ) -> Optional[Union[dict, Error]]:
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -0,0 +1,117 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.api_token import ApiToken
from ...models.error import Error
from ...types import Response
def _get_kwargs(
discord_id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/internal/discord/api-token/{discord_id}".format(
client.base_url,
discord_id=discord_id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
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
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 Error.from_dict(response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ApiToken, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
discord_id: str,
*,
client: Client,
) -> Response[Optional[Union[ApiToken, Error]]]:
kwargs = _get_kwargs(
discord_id=discord_id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
discord_id: str,
*,
client: Client,
) -> Optional[Union[ApiToken, Error]]:
"""This endpoint allows us to run API calls from our discord bot on behalf of a user. The user must have a discord account linked to their KittyCAD Account via oauth2 for this to work.
You must be a KittyCAD employee to use this endpoint.""" # noqa: E501
return sync_detailed(
discord_id=discord_id,
client=client,
).parsed
async def asyncio_detailed(
discord_id: str,
*,
client: Client,
) -> Response[Optional[Union[ApiToken, Error]]]:
kwargs = _get_kwargs(
discord_id=discord_id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
discord_id: str,
*,
client: Client,
) -> Optional[Union[ApiToken, Error]]:
"""This endpoint allows us to run API calls from our discord bot on behalf of a user. The user must have a discord account linked to their KittyCAD Account via oauth2 for this to work.
You must be a KittyCAD employee to use this endpoint.""" # noqa: E501
return (
await asyncio_detailed(
discord_id=discord_id,
client=client,
)
).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/ping".format(client.base_url, ) # noqa: E501 url = "{}/ping".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,7 +24,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -43,7 +40,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Pong, Error]]
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[Pong, Error]]]: ) -> Response[Optional[Union[Pong, Error]]]:
@ -56,13 +52,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Pong, Error]]]: ) -> Response[Optional[Union[Pong, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -75,27 +68,19 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[Pong, Error]]: ) -> Optional[Union[Pong, Error]]:
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Pong, Error]]]: ) -> Response[Optional[Union[Pong, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -106,16 +91,11 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[Pong, Error]]: ) -> Optional[Union[Pong, Error]]:
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -1,66 +1,37 @@
from typing import Any, Dict import json
from typing import Any, Dict, Iterator
import bson
from websockets.client import WebSocketClientProtocol, connect as ws_connect_async from websockets.client import WebSocketClientProtocol, connect as ws_connect_async
from websockets.sync.client import ClientConnection, connect as ws_connect from websockets.sync.client import ClientConnection, connect as ws_connect
from ...client import Client from ...client import Client
from ...models.error import Error from ...models.web_socket_request import WebSocketRequest
from ...models.web_socket_response import WebSocketResponse
def _get_kwargs( def _get_kwargs(
fps: int, fps: int,
unlocked_framerate: bool, unlocked_framerate: bool,
video_res_height: int, video_res_height: int,
video_res_width: int, video_res_width: int,
webrtc: bool, webrtc: bool,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/ws/modeling/commands".format(client.base_url) # noqa: E501 url = "{}/ws/modeling/commands".format(client.base_url) # noqa: E501
if fps is not None: if fps is not None:
if "?" in url: if "?" in url:
url = url + "&fps=" + str(fps) url = url + "&fps=" + str(fps)
else: else:
url = url + "?fps=" + str(fps) url = url + "?fps=" + str(fps)
if unlocked_framerate is not None: if unlocked_framerate is not None:
if "?" in url: if "?" in url:
url = url + "&unlocked_framerate=" + str(unlocked_framerate) url = url + "&unlocked_framerate=" + str(unlocked_framerate).lower()
else: else:
url = url + "?unlocked_framerate=" + str(unlocked_framerate) url = url + "?unlocked_framerate=" + str(unlocked_framerate).lower()
if video_res_height is not None: if video_res_height is not None:
if "?" in url: if "?" in url:
@ -68,24 +39,17 @@ def _get_kwargs(
else: else:
url = url + "?video_res_height=" + str(video_res_height) url = url + "?video_res_height=" + str(video_res_height)
if video_res_width is not None: if video_res_width is not None:
if "?" in url: if "?" in url:
url = url + "&video_res_width=" + str(video_res_width) url = url + "&video_res_width=" + str(video_res_width)
else: else:
url = url + "?video_res_width=" + str(video_res_width) url = url + "?video_res_width=" + str(video_res_width)
if webrtc is not None: if webrtc is not None:
if "?" in url: if "?" in url:
url = url + "&webrtc=" + str(webrtc) url = url + "&webrtc=" + str(webrtc).lower()
else: else:
url = url + "?webrtc=" + str(webrtc) url = url + "?webrtc=" + str(webrtc).lower()
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -95,126 +59,115 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def sync( def sync(
fps: int, fps: int,
unlocked_framerate: bool, unlocked_framerate: bool,
video_res_height: int, video_res_height: int,
video_res_width: int, video_res_width: int,
webrtc: bool, webrtc: bool,
*, *,
client: Client, client: Client,
) -> ClientConnection: ) -> ClientConnection:
"""Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.""" # noqa: E501 """Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.""" # noqa: E501
kwargs = _get_kwargs( kwargs = _get_kwargs(
fps=fps, fps=fps,
unlocked_framerate=unlocked_framerate, unlocked_framerate=unlocked_framerate,
video_res_height=video_res_height, video_res_height=video_res_height,
video_res_width=video_res_width, video_res_width=video_res_width,
webrtc=webrtc, webrtc=webrtc,
client=client, client=client,
) )
with ws_connect(kwargs["url"].replace("https://", "wss://"), additional_headers=kwargs["headers"]) as websocket: return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=None, compression=None, max_size=None) # type: ignore
return websocket # type: ignore
# Return an error if we got here.
return Error(message="An error occurred while connecting to the websocket.")
async def asyncio( async def asyncio(
fps: int, fps: int,
unlocked_framerate: bool, unlocked_framerate: bool,
video_res_height: int, video_res_height: int,
video_res_width: int, video_res_width: int,
webrtc: bool, webrtc: bool,
*, *,
client: Client, client: Client,
) -> WebSocketClientProtocol: ) -> WebSocketClientProtocol:
"""Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.""" # noqa: E501 """Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.""" # noqa: E501
kwargs = _get_kwargs( kwargs = _get_kwargs(
fps=fps, fps=fps,
unlocked_framerate=unlocked_framerate, unlocked_framerate=unlocked_framerate,
video_res_height=video_res_height, video_res_height=video_res_height,
video_res_width=video_res_width, video_res_width=video_res_width,
webrtc=webrtc, webrtc=webrtc,
client=client, client=client,
) )
async with ws_connect_async(kwargs["url"].replace("https://", "wss://"), extra_headers=kwargs["headers"]) as websocket: return await ws_connect_async(
return websocket kwargs["url"].replace("http", "ws"), extra_headers=kwargs["headers"]
)
# Return an error if we got here.
return Error(message="An error occurred while connecting to the websocket.") class WebSocket:
"""A websocket connection to the API endpoint."""
ws: ClientConnection
def __init__(
self,
fps: int,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
webrtc: bool,
client: Client,
):
self.ws = sync(
fps,
unlocked_framerate,
video_res_height,
video_res_width,
webrtc,
client=client,
)
def __enter__(
self,
):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.close()
def __iter__(self) -> Iterator[WebSocketResponse]:
"""
Iterate on incoming messages.
The iterator calls :meth:`recv` and yields messages in an infinite loop.
It exits when the connection is closed normally. It raises a
:exc:`~websockets.exceptions.ConnectionClosedError` exception after a
protocol error or a network failure.
"""
for message in self.ws:
yield WebSocketResponse.from_dict(json.loads(message))
def send(self, data: WebSocketRequest):
"""Send data to the websocket."""
self.ws.send(json.dumps(data.to_dict()))
def send_binary(self, data: WebSocketRequest):
"""Send data as bson to the websocket."""
self.ws.send(bson.BSON.encode(data.to_dict()))
def recv(self) -> WebSocketResponse:
"""Receive data from the websocket."""
message = self.ws.recv()
return WebSocketResponse.from_dict(json.loads(message))
def close(self):
"""Close the websocket."""
self.ws.close()

View File

@ -10,22 +10,13 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
body: BillingInfo, body: BillingInfo,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment".format(client.base_url, ) # noqa: E501 url = "{}/user/payment".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -52,7 +43,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Err
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[Customer, Error]]]: ) -> Response[Optional[Union[Customer, Error]]]:
@ -65,21 +55,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
body: BillingInfo, body: BillingInfo,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Customer, Error]]]: ) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
body=body, body=body,
client=client, client=client,
) )
@ -92,44 +73,27 @@ def sync_detailed(
def sync( def sync(
body: BillingInfo, body: BillingInfo,
*, *,
client: Client, client: Client,
) -> Optional[Union[Customer, Error]]: ) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name. """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 This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.
""" # noqa: E501
return sync_detailed( return sync_detailed(
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
body: BillingInfo, body: BillingInfo,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Customer, Error]]]: ) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
body=body, body=body,
client=client, client=client,
) )
@ -140,25 +104,17 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
body: BillingInfo, body: BillingInfo,
*, *,
client: Client, client: Client,
) -> Optional[Union[Customer, Error]]: ) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name. """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 This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment/intent".format(client.base_url, ) # noqa: E501 url = "{}/user/payment/intent".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,11 +24,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[PaymentIntent, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[PaymentIntent, Error]]:
if response.status_code == 201: if response.status_code == 201:
response_201 = PaymentIntent.from_dict(response.json()) response_201 = PaymentIntent.from_dict(response.json())
return response_201 return response_201
@ -43,7 +42,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[PaymentIntent
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[PaymentIntent, Error]]]: ) -> Response[Optional[Union[PaymentIntent, Error]]]:
@ -56,13 +54,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[PaymentIntent, Error]]]: ) -> Response[Optional[Union[PaymentIntent, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -75,27 +70,21 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[PaymentIntent, Error]]]: ) -> Response[Optional[Union[PaymentIntent, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -106,16 +95,13 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,14 +8,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment".format(client.base_url, ) # noqa: E501 url = "{}/user/payment".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -25,7 +23,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -40,10 +37,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Error] :
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -53,13 +47,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -72,28 +63,23 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This includes billing address, phone, and name. """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 This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.
""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -104,17 +90,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This includes billing address, phone, and name. """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 This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,22 +8,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment/methods/{id}".format(client.base_url, id=id,) # noqa: E501 url = "{}/user/payment/methods/{id}".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -33,7 +25,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -48,10 +39,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Error] :
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -61,21 +49,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -88,43 +67,25 @@ def sync_detailed(
def sync( def sync(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.""" # noqa: E501 """This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.""" # noqa: E501
return sync_detailed( return sync_detailed(
id=id, id=id,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -135,24 +96,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.""" # noqa: E501 """This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
id=id, id=id,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment/balance".format(client.base_url, ) # noqa: E501 url = "{}/user/payment/balance".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,11 +24,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[CustomerBalance, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[CustomerBalance, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = CustomerBalance.from_dict(response.json()) response_200 = CustomerBalance.from_dict(response.json())
return response_200 return response_200
@ -43,7 +42,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[CustomerBalan
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[CustomerBalance, Error]]]: ) -> Response[Optional[Union[CustomerBalance, Error]]]:
@ -56,13 +54,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]: ) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -75,27 +70,21 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It gets the balance information for the authenticated user.""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]: ) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -106,16 +95,13 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It gets the balance information for the authenticated user.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment".format(client.base_url, ) # noqa: E501 url = "{}/user/payment".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,7 +24,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -43,7 +40,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Err
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[Customer, Error]]]: ) -> Response[Optional[Union[Customer, Error]]]:
@ -56,13 +52,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Customer, Error]]]: ) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -75,28 +68,23 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[Customer, Error]]: ) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name. """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 This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.
""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Customer, Error]]]: ) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -107,17 +95,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[Customer, Error]]: ) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name. """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 This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment/invoices".format(client.base_url, ) # noqa: E501 url = "{}/user/payment/invoices".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,16 +24,14 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[List[Invoice], Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[List[Invoice], Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = [ response_200 = [Invoice.from_dict(item) for item in response.json()]
Invoice.from_dict(item)
for item in response.json()
]
return response_200 return response_200
if response.status_code == 400: if response.status_code == 400:
response_4XX = Error.from_dict(response.json()) response_4XX = Error.from_dict(response.json())
@ -46,7 +42,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[List[Invoice]
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[List[Invoice], Error]]]: ) -> Response[Optional[Union[List[Invoice], Error]]]:
@ -59,13 +54,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[List[Invoice], Error]]]: ) -> Response[Optional[Union[List[Invoice], Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -78,27 +70,21 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[List[Invoice], Error]]]: ) -> Response[Optional[Union[List[Invoice], Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -109,16 +95,13 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment/methods".format(client.base_url, ) # noqa: E501 url = "{}/user/payment/methods".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,16 +24,14 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[List[PaymentMethod], Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[List[PaymentMethod], Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = [ response_200 = [PaymentMethod.from_dict(item) for item in response.json()]
PaymentMethod.from_dict(item)
for item in response.json()
]
return response_200 return response_200
if response.status_code == 400: if response.status_code == 400:
response_4XX = Error.from_dict(response.json()) response_4XX = Error.from_dict(response.json())
@ -46,7 +42,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[List[PaymentM
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[List[PaymentMethod], Error]]]: ) -> Response[Optional[Union[List[PaymentMethod], Error]]]:
@ -59,13 +54,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[List[PaymentMethod], Error]]]: ) -> Response[Optional[Union[List[PaymentMethod], Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -78,27 +70,21 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[List[PaymentMethod], Error]]]: ) -> Response[Optional[Union[List[PaymentMethod], Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -109,16 +95,13 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,22 +10,13 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
body: BillingInfo, body: BillingInfo,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment".format(client.base_url, ) # noqa: E501 url = "{}/user/payment".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -52,7 +43,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Err
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[Customer, Error]]]: ) -> Response[Optional[Union[Customer, Error]]]:
@ -65,21 +55,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
body: BillingInfo, body: BillingInfo,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Customer, Error]]]: ) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
body=body, body=body,
client=client, client=client,
) )
@ -92,44 +73,27 @@ def sync_detailed(
def sync( def sync(
body: BillingInfo, body: BillingInfo,
*, *,
client: Client, client: Client,
) -> Optional[Union[Customer, Error]]: ) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name. """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 This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.
""" # noqa: E501
return sync_detailed( return sync_detailed(
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
body: BillingInfo, body: BillingInfo,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Customer, Error]]]: ) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
body=body, body=body,
client=client, client=client,
) )
@ -140,25 +104,17 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
body: BillingInfo, body: BillingInfo,
*, *,
client: Client, client: Client,
) -> Optional[Union[Customer, Error]]: ) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name. """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 This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,14 +8,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment/tax".format(client.base_url, ) # noqa: E501 url = "{}/user/payment/tax".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -25,7 +23,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -40,10 +37,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Error] :
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -53,13 +47,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -72,27 +63,21 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[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 """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( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -103,16 +88,13 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[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 """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 ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitAngle, input_unit: UnitAngle,
output_unit: UnitAngle, output_unit: UnitAngle,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/angle/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/angle/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitAngleConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitAngleConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitAngleConversion.from_dict(response.json()) response_200 = UnitAngleConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitAngleConv
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitAngleConversion, Error]]]: ) -> Response[Optional[Union[UnitAngleConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitAngle, input_unit: UnitAngle,
output_unit: UnitAngle, output_unit: UnitAngle,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitAngleConversion, Error]]]: ) -> Response[Optional[Union[UnitAngleConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitAngle, input_unit: UnitAngle,
output_unit: UnitAngle, output_unit: UnitAngle,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitAngle, input_unit: UnitAngle,
output_unit: UnitAngle, output_unit: UnitAngle,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitAngleConversion, Error]]]: ) -> Response[Optional[Union[UnitAngleConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitAngle, input_unit: UnitAngle,
output_unit: UnitAngle, output_unit: UnitAngle,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """Convert an angle unit value to another angle unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitArea, input_unit: UnitArea,
output_unit: UnitArea, output_unit: UnitArea,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/area/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/area/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitAreaConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitAreaConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitAreaConversion.from_dict(response.json()) response_200 = UnitAreaConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitAreaConve
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitAreaConversion, Error]]]: ) -> Response[Optional[Union[UnitAreaConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitArea, input_unit: UnitArea,
output_unit: UnitArea, output_unit: UnitArea,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitAreaConversion, Error]]]: ) -> Response[Optional[Union[UnitAreaConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitArea, input_unit: UnitArea,
output_unit: UnitArea, output_unit: UnitArea,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitArea, input_unit: UnitArea,
output_unit: UnitArea, output_unit: UnitArea,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitAreaConversion, Error]]]: ) -> Response[Optional[Union[UnitAreaConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitArea, input_unit: UnitArea,
output_unit: UnitArea, output_unit: UnitArea,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """Convert an area unit value to another area unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitCurrent, input_unit: UnitCurrent,
output_unit: UnitCurrent, output_unit: UnitCurrent,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/current/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/current/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitCurrentConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitCurrentConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitCurrentConversion.from_dict(response.json()) response_200 = UnitCurrentConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitCurrentCo
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitCurrentConversion, Error]]]: ) -> Response[Optional[Union[UnitCurrentConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitCurrent, input_unit: UnitCurrent,
output_unit: UnitCurrent, output_unit: UnitCurrent,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitCurrentConversion, Error]]]: ) -> Response[Optional[Union[UnitCurrentConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitCurrent, input_unit: UnitCurrent,
output_unit: UnitCurrent, output_unit: UnitCurrent,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[UnitCurrentConversion, Error]]: ) -> Optional[Union[UnitCurrentConversion, Error]]:
"""Convert a current unit value to another current unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 """Convert a current unit value to another current unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitCurrent, input_unit: UnitCurrent,
output_unit: UnitCurrent, output_unit: UnitCurrent,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitCurrentConversion, Error]]]: ) -> Response[Optional[Union[UnitCurrentConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitCurrent, input_unit: UnitCurrent,
output_unit: UnitCurrent, output_unit: UnitCurrent,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[UnitCurrentConversion, Error]]: ) -> Optional[Union[UnitCurrentConversion, Error]]:
"""Convert a current unit value to another current unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 """Convert a current unit value to another current unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitEnergy, input_unit: UnitEnergy,
output_unit: UnitEnergy, output_unit: UnitEnergy,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/energy/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/energy/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitEnergyConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitEnergyConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitEnergyConversion.from_dict(response.json()) response_200 = UnitEnergyConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitEnergyCon
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitEnergyConversion, Error]]]: ) -> Response[Optional[Union[UnitEnergyConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitEnergy, input_unit: UnitEnergy,
output_unit: UnitEnergy, output_unit: UnitEnergy,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitEnergyConversion, Error]]]: ) -> Response[Optional[Union[UnitEnergyConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitEnergy, input_unit: UnitEnergy,
output_unit: UnitEnergy, output_unit: UnitEnergy,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitEnergy, input_unit: UnitEnergy,
output_unit: UnitEnergy, output_unit: UnitEnergy,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitEnergyConversion, Error]]]: ) -> Response[Optional[Union[UnitEnergyConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitEnergy, input_unit: UnitEnergy,
output_unit: UnitEnergy, output_unit: UnitEnergy,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """Convert a energy unit value to another energy unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitForce, input_unit: UnitForce,
output_unit: UnitForce, output_unit: UnitForce,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/force/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/force/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitForceConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitForceConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitForceConversion.from_dict(response.json()) response_200 = UnitForceConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitForceConv
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitForceConversion, Error]]]: ) -> Response[Optional[Union[UnitForceConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitForce, input_unit: UnitForce,
output_unit: UnitForce, output_unit: UnitForce,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitForceConversion, Error]]]: ) -> Response[Optional[Union[UnitForceConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitForce, input_unit: UnitForce,
output_unit: UnitForce, output_unit: UnitForce,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitForce, input_unit: UnitForce,
output_unit: UnitForce, output_unit: UnitForce,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitForceConversion, Error]]]: ) -> Response[Optional[Union[UnitForceConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitForce, input_unit: UnitForce,
output_unit: UnitForce, output_unit: UnitForce,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """Convert a force unit value to another force unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitFrequency, input_unit: UnitFrequency,
output_unit: UnitFrequency, output_unit: UnitFrequency,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/frequency/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/frequency/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitFrequencyConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitFrequencyConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitFrequencyConversion.from_dict(response.json()) response_200 = UnitFrequencyConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitFrequency
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitFrequencyConversion, Error]]]: ) -> Response[Optional[Union[UnitFrequencyConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitFrequency, input_unit: UnitFrequency,
output_unit: UnitFrequency, output_unit: UnitFrequency,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitFrequencyConversion, Error]]]: ) -> Response[Optional[Union[UnitFrequencyConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitFrequency, input_unit: UnitFrequency,
output_unit: UnitFrequency, output_unit: UnitFrequency,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[UnitFrequencyConversion, Error]]: ) -> Optional[Union[UnitFrequencyConversion, Error]]:
"""Convert a frequency unit value to another frequency unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 """Convert a frequency unit value to another frequency unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitFrequency, input_unit: UnitFrequency,
output_unit: UnitFrequency, output_unit: UnitFrequency,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitFrequencyConversion, Error]]]: ) -> Response[Optional[Union[UnitFrequencyConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitFrequency, input_unit: UnitFrequency,
output_unit: UnitFrequency, output_unit: UnitFrequency,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[UnitFrequencyConversion, Error]]: ) -> Optional[Union[UnitFrequencyConversion, Error]]:
"""Convert a frequency unit value to another frequency unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 """Convert a frequency unit value to another frequency unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitLength, input_unit: UnitLength,
output_unit: UnitLength, output_unit: UnitLength,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/length/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/length/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitLengthConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitLengthConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitLengthConversion.from_dict(response.json()) response_200 = UnitLengthConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitLengthCon
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitLengthConversion, Error]]]: ) -> Response[Optional[Union[UnitLengthConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitLength, input_unit: UnitLength,
output_unit: UnitLength, output_unit: UnitLength,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitLengthConversion, Error]]]: ) -> Response[Optional[Union[UnitLengthConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitLength, input_unit: UnitLength,
output_unit: UnitLength, output_unit: UnitLength,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitLength, input_unit: UnitLength,
output_unit: UnitLength, output_unit: UnitLength,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitLengthConversion, Error]]]: ) -> Response[Optional[Union[UnitLengthConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitLength, input_unit: UnitLength,
output_unit: UnitLength, output_unit: UnitLength,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """Convert a length unit value to another length unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitMass, input_unit: UnitMass,
output_unit: UnitMass, output_unit: UnitMass,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/mass/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/mass/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitMassConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitMassConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitMassConversion.from_dict(response.json()) response_200 = UnitMassConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitMassConve
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitMassConversion, Error]]]: ) -> Response[Optional[Union[UnitMassConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitMass, input_unit: UnitMass,
output_unit: UnitMass, output_unit: UnitMass,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitMassConversion, Error]]]: ) -> Response[Optional[Union[UnitMassConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitMass, input_unit: UnitMass,
output_unit: UnitMass, output_unit: UnitMass,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitMass, input_unit: UnitMass,
output_unit: UnitMass, output_unit: UnitMass,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitMassConversion, Error]]]: ) -> Response[Optional[Union[UnitMassConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitMass, input_unit: UnitMass,
output_unit: UnitMass, output_unit: UnitMass,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """Convert a mass unit value to another mass unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitPower, input_unit: UnitPower,
output_unit: UnitPower, output_unit: UnitPower,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/power/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/power/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitPowerConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitPowerConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitPowerConversion.from_dict(response.json()) response_200 = UnitPowerConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitPowerConv
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitPowerConversion, Error]]]: ) -> Response[Optional[Union[UnitPowerConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitPower, input_unit: UnitPower,
output_unit: UnitPower, output_unit: UnitPower,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitPowerConversion, Error]]]: ) -> Response[Optional[Union[UnitPowerConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitPower, input_unit: UnitPower,
output_unit: UnitPower, output_unit: UnitPower,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitPower, input_unit: UnitPower,
output_unit: UnitPower, output_unit: UnitPower,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitPowerConversion, Error]]]: ) -> Response[Optional[Union[UnitPowerConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitPower, input_unit: UnitPower,
output_unit: UnitPower, output_unit: UnitPower,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """Convert a power unit value to another power unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitPressure, input_unit: UnitPressure,
output_unit: UnitPressure, output_unit: UnitPressure,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/pressure/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/pressure/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitPressureConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitPressureConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitPressureConversion.from_dict(response.json()) response_200 = UnitPressureConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitPressureC
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitPressureConversion, Error]]]: ) -> Response[Optional[Union[UnitPressureConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitPressure, input_unit: UnitPressure,
output_unit: UnitPressure, output_unit: UnitPressure,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitPressureConversion, Error]]]: ) -> Response[Optional[Union[UnitPressureConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitPressure, input_unit: UnitPressure,
output_unit: UnitPressure, output_unit: UnitPressure,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitPressure, input_unit: UnitPressure,
output_unit: UnitPressure, output_unit: UnitPressure,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitPressureConversion, Error]]]: ) -> Response[Optional[Union[UnitPressureConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitPressure, input_unit: UnitPressure,
output_unit: UnitPressure, output_unit: UnitPressure,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """Convert a pressure unit value to another pressure unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitTemperature, input_unit: UnitTemperature,
output_unit: UnitTemperature, output_unit: UnitTemperature,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/temperature/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/temperature/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitTemperatureConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitTemperatureConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitTemperatureConversion.from_dict(response.json()) response_200 = UnitTemperatureConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitTemperatu
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitTemperatureConversion, Error]]]: ) -> Response[Optional[Union[UnitTemperatureConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitTemperature, input_unit: UnitTemperature,
output_unit: UnitTemperature, output_unit: UnitTemperature,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitTemperatureConversion, Error]]]: ) -> Response[Optional[Union[UnitTemperatureConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitTemperature, input_unit: UnitTemperature,
output_unit: UnitTemperature, output_unit: UnitTemperature,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitTemperature, input_unit: UnitTemperature,
output_unit: UnitTemperature, output_unit: UnitTemperature,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitTemperatureConversion, Error]]]: ) -> Response[Optional[Union[UnitTemperatureConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitTemperature, input_unit: UnitTemperature,
output_unit: UnitTemperature, output_unit: UnitTemperature,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """Convert a temperature unit value to another temperature unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitTorque, input_unit: UnitTorque,
output_unit: UnitTorque, output_unit: UnitTorque,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/torque/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/torque/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitTorqueConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitTorqueConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitTorqueConversion.from_dict(response.json()) response_200 = UnitTorqueConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitTorqueCon
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitTorqueConversion, Error]]]: ) -> Response[Optional[Union[UnitTorqueConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitTorque, input_unit: UnitTorque,
output_unit: UnitTorque, output_unit: UnitTorque,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitTorqueConversion, Error]]]: ) -> Response[Optional[Union[UnitTorqueConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitTorque, input_unit: UnitTorque,
output_unit: UnitTorque, output_unit: UnitTorque,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[UnitTorqueConversion, Error]]: ) -> Optional[Union[UnitTorqueConversion, Error]]:
"""Convert a torque unit value to another torque unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 """Convert a torque unit value to another torque unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitTorque, input_unit: UnitTorque,
output_unit: UnitTorque, output_unit: UnitTorque,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitTorqueConversion, Error]]]: ) -> Response[Optional[Union[UnitTorqueConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitTorque, input_unit: UnitTorque,
output_unit: UnitTorque, output_unit: UnitTorque,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[UnitTorqueConversion, Error]]: ) -> Optional[Union[UnitTorqueConversion, Error]]:
"""Convert a torque unit value to another torque unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501 """Convert a torque unit value to another torque unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,35 +10,17 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_unit: UnitVolume, input_unit: UnitVolume,
output_unit: UnitVolume, output_unit: UnitVolume,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/unit/conversion/volume/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501 url = "{}/unit/conversion/volume/{input_unit}/{output_unit}".format(
client.base_url,
input_unit=input_unit,
output_unit=output_unit,
) # noqa: E501
if value is not None: if value is not None:
if "?" in url: if "?" in url:
@ -46,9 +28,6 @@ def _get_kwargs(
else: else:
url = url + "?value=" + str(value) url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -57,11 +36,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitVolumeConversion, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitVolumeConversion, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UnitVolumeConversion.from_dict(response.json()) response_200 = UnitVolumeConversion.from_dict(response.json())
return response_200 return response_200
@ -74,7 +54,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitVolumeCon
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UnitVolumeConversion, Error]]]: ) -> Response[Optional[Union[UnitVolumeConversion, Error]]]:
@ -87,37 +66,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_unit: UnitVolume, input_unit: UnitVolume,
output_unit: UnitVolume, output_unit: UnitVolume,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitVolumeConversion, Error]]]: ) -> Response[Optional[Union[UnitVolumeConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -130,75 +88,33 @@ def sync_detailed(
def sync( def sync(
input_unit: UnitVolume, input_unit: UnitVolume,
output_unit: UnitVolume, output_unit: UnitVolume,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_unit: UnitVolume, input_unit: UnitVolume,
output_unit: UnitVolume, output_unit: UnitVolume,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[UnitVolumeConversion, Error]]]: ) -> Response[Optional[Union[UnitVolumeConversion, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
@ -209,40 +125,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_unit: UnitVolume, input_unit: UnitVolume,
output_unit: UnitVolume, output_unit: UnitVolume,
value: float, value: float,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """Convert a volume unit value to another volume unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
input_unit=input_unit, input_unit=input_unit,
output_unit=output_unit, output_unit=output_unit,
value=value, value=value,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,14 +8,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user".format(client.base_url, ) # noqa: E501 url = "{}/user".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -25,7 +23,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -40,10 +37,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Error] :
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Error]]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -53,13 +47,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -72,28 +63,23 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This endpoint requires authentication by any KittyCAD user. It deletes the authenticated user from KittyCAD's database. """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 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
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Error]]: ) -> Response[Optional[Error]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -104,17 +90,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Error]: ) -> Optional[Error]:
"""This endpoint requires authentication by any KittyCAD user. It deletes the authenticated user from KittyCAD's database. """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 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
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,22 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/session/{token}".format(client.base_url, token=token,) # noqa: E501 url = "{}/user/session/{token}".format(
client.base_url,
token=token,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -34,7 +26,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -51,7 +42,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Session, Erro
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[Session, Error]]]: ) -> Response[Optional[Union[Session, Error]]]:
@ -64,21 +54,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Session, Error]]]: ) -> Response[Optional[Union[Session, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
token=token, token=token,
client=client, client=client,
) )
@ -91,43 +72,25 @@ def sync_detailed(
def sync( def sync(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501
return sync_detailed( return sync_detailed(
token=token, token=token,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Session, Error]]]: ) -> Response[Optional[Union[Session, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
token=token, token=token,
client=client, client=client,
) )
@ -138,24 +101,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
token: str, token: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
token=token, token=token,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,22 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/users/{id}".format(client.base_url, id=id,) # noqa: E501 url = "{}/users/{id}".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -34,7 +26,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -51,7 +42,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[User, Error]]]: ) -> Response[Optional[Union[User, Error]]]:
@ -64,21 +54,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[User, Error]]]: ) -> Response[Optional[Union[User, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -91,45 +72,27 @@ def sync_detailed(
def sync( def sync(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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. """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. 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 To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501
return sync_detailed( return sync_detailed(
id=id, id=id,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[User, Error]]]: ) -> Response[Optional[Union[User, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -140,16 +103,9 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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. """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. Alternatively, to get information about the authenticated user, use `/user` endpoint.
@ -157,9 +113,7 @@ To get information about any KittyCAD user, you must be a KittyCAD employee."""
return ( return (
await asyncio_detailed( await asyncio_detailed(
id=id, id=id,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,22 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/users-extended/{id}".format(client.base_url, id=id,) # noqa: E501 url = "{}/users-extended/{id}".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -34,11 +26,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[ExtendedUser, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ExtendedUser, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = ExtendedUser.from_dict(response.json()) response_200 = ExtendedUser.from_dict(response.json())
return response_200 return response_200
@ -51,7 +44,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[ExtendedUser,
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[ExtendedUser, Error]]]: ) -> Response[Optional[Union[ExtendedUser, Error]]]:
@ -64,21 +56,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ExtendedUser, Error]]]: ) -> Response[Optional[Union[ExtendedUser, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -91,45 +74,27 @@ def sync_detailed(
def sync( def sync(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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. """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. 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 To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501
return sync_detailed( return sync_detailed(
id=id, id=id,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ExtendedUser, Error]]]: ) -> Response[Optional[Union[ExtendedUser, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -140,16 +105,9 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[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. """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. Alternatively, to get information about the authenticated user, use `/user/extended` endpoint.
@ -157,9 +115,7 @@ To get information about any KittyCAD user, you must be a KittyCAD employee."""
return ( return (
await asyncio_detailed( await asyncio_detailed(
id=id, id=id,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,14 +8,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/front-hash".format(client.base_url, ) # noqa: E501 url = "{}/user/front-hash".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -25,7 +23,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -42,7 +39,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[str, Error]]
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[str, Error]]]: ) -> Response[Optional[Union[str, Error]]]:
@ -55,13 +51,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[str, Error]]]: ) -> Response[Optional[Union[str, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -74,27 +67,21 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """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( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[str, Error]]]: ) -> Response[Optional[Union[str, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -105,16 +92,13 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[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 """This info is sent to front when initialing the front chat, it prevents impersonations using js hacks in the browser""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/onboarding".format(client.base_url, ) # noqa: E501 url = "{}/user/onboarding".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,7 +24,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -43,7 +40,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Onboarding, E
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[Onboarding, Error]]]: ) -> Response[Optional[Union[Onboarding, Error]]]:
@ -56,13 +52,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Onboarding, Error]]]: ) -> Response[Optional[Union[Onboarding, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -75,27 +68,21 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[Onboarding, Error]]: ) -> Optional[Union[Onboarding, Error]]:
"""Checks key part of their api usage to determine their onboarding progress""" # noqa: E501 """Checks key part of their api usage to determine their onboarding progress""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Onboarding, Error]]]: ) -> Response[Optional[Union[Onboarding, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -106,16 +93,13 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[Onboarding, Error]]: ) -> Optional[Union[Onboarding, Error]]:
"""Checks key part of their api usage to determine their onboarding progress""" # noqa: E501 """Checks key part of their api usage to determine their onboarding progress""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user".format(client.base_url, ) # noqa: E501 url = "{}/user".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,7 +24,6 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -43,7 +40,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[User, Error]]]: ) -> Response[Optional[Union[User, Error]]]:
@ -56,13 +52,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[User, Error]]]: ) -> Response[Optional[Union[User, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -75,28 +68,22 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[User, Error]]: ) -> Optional[Union[User, Error]]:
"""Get the user information for the authenticated user. """Get the user information for the authenticated user.
Alternatively, you can also use the `/users/me` endpoint.""" # noqa: E501 Alternatively, you can also use the `/users/me` endpoint.""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[User, Error]]]: ) -> Response[Optional[Union[User, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -107,17 +94,14 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[User, Error]]: ) -> Optional[Union[User, Error]]:
"""Get the user information for the authenticated user. """Get the user information for the authenticated user.
Alternatively, you can also use the `/users/me` endpoint.""" # noqa: E501 Alternatively, you can also use the `/users/me` endpoint.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,12 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/extended".format(client.base_url, ) # noqa: E501 url = "{}/user/extended".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -26,11 +24,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[ExtendedUser, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ExtendedUser, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = ExtendedUser.from_dict(response.json()) response_200 = ExtendedUser.from_dict(response.json())
return response_200 return response_200
@ -43,7 +42,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[ExtendedUser,
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[ExtendedUser, Error]]]: ) -> Response[Optional[Union[ExtendedUser, Error]]]:
@ -56,13 +54,10 @@ def _build_response(
def sync_detailed( def sync_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ExtendedUser, Error]]]: ) -> Response[Optional[Union[ExtendedUser, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -75,28 +70,22 @@ def sync_detailed(
def sync( def sync(
*, *,
client: Client, client: Client,
) -> Optional[Union[ExtendedUser, Error]]: ) -> Optional[Union[ExtendedUser, Error]]:
"""Get the user information for the authenticated user. """Get the user information for the authenticated user.
Alternatively, you can also use the `/users-extended/me` endpoint.""" # noqa: E501 Alternatively, you can also use the `/users-extended/me` endpoint.""" # noqa: E501
return sync_detailed( return sync_detailed(
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[ExtendedUser, Error]]]: ) -> Response[Optional[Union[ExtendedUser, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
) )
@ -107,17 +96,14 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: Client, client: Client,
) -> Optional[Union[ExtendedUser, Error]]: ) -> Optional[Union[ExtendedUser, Error]]:
"""Get the user information for the authenticated user. """Get the user information for the authenticated user.
Alternatively, you can also use the `/users-extended/me` endpoint.""" # noqa: E501 Alternatively, you can also use the `/users-extended/me` endpoint.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,31 +10,15 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/users".format(client.base_url, ) # noqa: E501 url = "{}/users".format(
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -42,25 +26,18 @@ def _get_kwargs(
else: else:
url = url + "?limit=" + str(limit) url = url + "?limit=" + str(limit)
if page_token is not None: if page_token is not None:
if "?" in url: if "?" in url:
url = url + "&page_token=" + str(page_token) url = url + "&page_token=" + str(page_token)
else: else:
url = url + "?page_token=" + str(page_token) url = url + "?page_token=" + str(page_token)
if sort_by is not None: if sort_by is not None:
if "?" in url: if "?" in url:
url = url + "&sort_by=" + str(sort_by) url = url + "&sort_by=" + str(sort_by)
else: else:
url = url + "?sort_by=" + str(sort_by) url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -69,11 +46,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[UserResultsPage, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UserResultsPage, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = UserResultsPage.from_dict(response.json()) response_200 = UserResultsPage.from_dict(response.json())
return response_200 return response_200
@ -86,7 +64,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[UserResultsPa
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[UserResultsPage, Error]]]: ) -> Response[Optional[Union[UserResultsPage, Error]]]:
@ -99,37 +76,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[UserResultsPage, Error]]]: ) -> Response[Optional[Union[UserResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -142,75 +98,33 @@ def sync_detailed(
def sync( def sync(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[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 """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( return sync_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[UserResultsPage, Error]]]: ) -> Response[Optional[Union[UserResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -221,40 +135,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[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 """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 ( return (
await asyncio_detailed( await asyncio_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,31 +10,15 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/users-extended".format(client.base_url, ) # noqa: E501 url = "{}/users-extended".format(
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -42,25 +26,18 @@ def _get_kwargs(
else: else:
url = url + "?limit=" + str(limit) url = url + "?limit=" + str(limit)
if page_token is not None: if page_token is not None:
if "?" in url: if "?" in url:
url = url + "&page_token=" + str(page_token) url = url + "&page_token=" + str(page_token)
else: else:
url = url + "?page_token=" + str(page_token) url = url + "?page_token=" + str(page_token)
if sort_by is not None: if sort_by is not None:
if "?" in url: if "?" in url:
url = url + "&sort_by=" + str(sort_by) url = url + "&sort_by=" + str(sort_by)
else: else:
url = url + "?sort_by=" + str(sort_by) url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -69,11 +46,12 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Union[ExtendedUserResultsPage, Error]] : def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ExtendedUserResultsPage, Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = ExtendedUserResultsPage.from_dict(response.json()) response_200 = ExtendedUserResultsPage.from_dict(response.json())
return response_200 return response_200
@ -86,7 +64,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[ExtendedUserR
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[ExtendedUserResultsPage, Error]]]: ) -> Response[Optional[Union[ExtendedUserResultsPage, Error]]]:
@ -99,37 +76,16 @@ def _build_response(
def sync_detailed( def sync_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[ExtendedUserResultsPage, Error]]]: ) -> Response[Optional[Union[ExtendedUserResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -142,75 +98,33 @@ def sync_detailed(
def sync( def sync(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[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 """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( return sync_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Response[Optional[Union[ExtendedUserResultsPage, Error]]]: ) -> Response[Optional[Union[ExtendedUserResultsPage, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
@ -221,40 +135,19 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
sort_by: CreatedAtSortMode, sort_by: CreatedAtSortMode,
*, *,
client: Client, client: Client,
limit: Optional[int] = None, limit: Optional[int] = None,
page_token: Optional[str] = None, page_token: Optional[str] = None,
) -> Optional[Union[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 """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 ( return (
await asyncio_detailed( await asyncio_detailed(
limit=limit, limit=limit,
page_token=page_token, page_token=page_token,
sort_by=sort_by, sort_by=sort_by,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,22 +10,13 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
body: UpdateUser, body: UpdateUser,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user".format(client.base_url, ) # noqa: E501 url = "{}/user".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers() headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
@ -52,7 +43,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]
return Error.from_dict(response.json()) return Error.from_dict(response.json())
def _build_response( def _build_response(
*, response: httpx.Response *, response: httpx.Response
) -> Response[Optional[Union[User, Error]]]: ) -> Response[Optional[Union[User, Error]]]:
@ -65,21 +55,12 @@ def _build_response(
def sync_detailed( def sync_detailed(
body: UpdateUser, body: UpdateUser,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[User, Error]]]: ) -> Response[Optional[Union[User, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
body=body, body=body,
client=client, client=client,
) )
@ -92,43 +73,25 @@ def sync_detailed(
def sync( def sync(
body: UpdateUser, body: UpdateUser,
*, *,
client: Client, client: Client,
) -> Optional[Union[User, Error]]: ) -> Optional[Union[User, Error]]:
"""This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.""" # noqa: E501 """This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.""" # noqa: E501
return sync_detailed( return sync_detailed(
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
body: UpdateUser, body: UpdateUser,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[User, Error]]]: ) -> Response[Optional[Union[User, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
body=body, body=body,
client=client, client=client,
) )
@ -139,24 +102,15 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
body: UpdateUser, body: UpdateUser,
*, *,
client: Client, client: Client,
) -> Optional[Union[User, Error]]: ) -> Optional[Union[User, Error]]:
"""This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.""" # noqa: E501 """This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -38,6 +38,10 @@ class Client:
"""Get a new client matching this one with a new timeout (in seconds)""" """Get a new client matching this one with a new timeout (in seconds)"""
return attr.evolve(self, timeout=timeout) return attr.evolve(self, timeout=timeout)
def with_base_url(self, url: str) -> "Client":
"""Get a new client matching this one with a new base url"""
return attr.evolve(self, base_url=url)
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class ClientFromEnv(Client): class ClientFromEnv(Client):

View File

@ -1,4 +1,6 @@
import json
import os import os
import uuid
from typing import Dict, Optional, Union from typing import Dict, Optional, Union
import pytest import pytest
@ -6,6 +8,7 @@ import pytest
from .api.api_tokens import list_api_tokens_for_user from .api.api_tokens import list_api_tokens_for_user
from .api.file import create_file_conversion, create_file_mass, create_file_volume from .api.file import create_file_conversion, create_file_mass, create_file_volume
from .api.meta import ping from .api.meta import ping
from .api.modeling import modeling_commands_ws
from .api.users import get_user_self, list_users_extended from .api.users import get_user_self, list_users_extended
from .client import ClientFromEnv from .client import ClientFromEnv
from .models import ( from .models import (
@ -20,12 +23,17 @@ from .models import (
FileImportFormat, FileImportFormat,
FileMass, FileMass,
FileVolume, FileVolume,
ModelingCmd,
ModelingCmdId,
Pong, Pong,
UnitDensity, UnitDensity,
UnitMass, UnitMass,
UnitVolume, UnitVolume,
User, User,
WebSocketRequest,
) )
from .models.modeling_cmd import start_path
from .models.web_socket_request import modeling_cmd_req
from .types import Unset from .types import Unset
@ -283,3 +291,31 @@ def test_list_users():
assert isinstance(response, ExtendedUserResultsPage) assert isinstance(response, ExtendedUserResultsPage)
print(f"ExtendedUserResultsPage: {response}") print(f"ExtendedUserResultsPage: {response}")
def test_ws():
# Create our client.
client = ClientFromEnv()
# Connect to the websocket.
with modeling_commands_ws.WebSocket(
client=client,
fps=30,
unlocked_framerate=False,
video_res_height=360,
video_res_width=480,
webrtc=False,
) as websocket:
# Send a message.
id = uuid.uuid4()
req = WebSocketRequest(
modeling_cmd_req(cmd=ModelingCmd(start_path()), cmd_id=ModelingCmdId(id))
)
json.dumps(req.to_dict())
websocket.send(req)
# Get the messages.
while True:
message = websocket.recv()
print(json.dumps(message.to_dict()))
break

View File

@ -2,7 +2,14 @@ from typing import List, Optional, Union
import pytest import pytest
from kittycad.api.ai import create_image_to_3d, create_text_to_3d from kittycad.api.ai import (
create_text_to_cad,
create_text_to_cad_model_feedback,
get_ai_prompt,
get_text_to_cad_model_for_user,
list_ai_prompts,
list_text_to_cad_models_for_user,
)
from kittycad.api.api_calls import ( from kittycad.api.api_calls import (
get_api_call, get_api_call,
get_api_call_for_user, get_api_call_for_user,
@ -39,6 +46,7 @@ from kittycad.api.meta import (
get_metadata, get_metadata,
get_openai_schema, get_openai_schema,
get_schema, get_schema,
internal_get_api_token_for_discord_user,
ping, ping,
) )
from kittycad.api.modeling import modeling_commands_ws from kittycad.api.modeling import modeling_commands_ws
@ -85,6 +93,8 @@ from kittycad.api.users import (
from kittycad.client import ClientFromEnv from kittycad.client import ClientFromEnv
from kittycad.models import ( from kittycad.models import (
AiPluginManifest, AiPluginManifest,
AiPrompt,
AiPromptResultsPage,
ApiCallQueryGroup, ApiCallQueryGroup,
ApiCallWithPrice, ApiCallWithPrice,
ApiCallWithPriceResultsPage, ApiCallWithPriceResultsPage,
@ -105,13 +115,14 @@ from kittycad.models import (
FileSurfaceArea, FileSurfaceArea,
FileVolume, FileVolume,
Invoice, Invoice,
Mesh,
Metadata, Metadata,
Onboarding, Onboarding,
PaymentIntent, PaymentIntent,
PaymentMethod, PaymentMethod,
Pong, Pong,
Session, Session,
TextToCad,
TextToCadResultsPage,
UnitAngleConversion, UnitAngleConversion,
UnitAreaConversion, UnitAreaConversion,
UnitCurrentConversion, UnitCurrentConversion,
@ -128,7 +139,9 @@ from kittycad.models import (
User, User,
UserResultsPage, UserResultsPage,
VerificationToken, VerificationToken,
WebSocketRequest,
) )
from kittycad.models.ai_feedback import AiFeedback
from kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy from kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy
from kittycad.models.api_call_status import ApiCallStatus from kittycad.models.api_call_status import ApiCallStatus
from kittycad.models.billing_info import BillingInfo from kittycad.models.billing_info import BillingInfo
@ -137,7 +150,9 @@ from kittycad.models.created_at_sort_mode import CreatedAtSortMode
from kittycad.models.email_authentication_form import EmailAuthenticationForm from kittycad.models.email_authentication_form import EmailAuthenticationForm
from kittycad.models.file_export_format import FileExportFormat from kittycad.models.file_export_format import FileExportFormat
from kittycad.models.file_import_format import FileImportFormat from kittycad.models.file_import_format import FileImportFormat
from kittycad.models.image_type import ImageType from kittycad.models.rtc_sdp_type import RtcSdpType
from kittycad.models.rtc_session_description import RtcSessionDescription
from kittycad.models.text_to_cad_create_body import TextToCadCreateBody
from kittycad.models.unit_angle import UnitAngle from kittycad.models.unit_angle import UnitAngle
from kittycad.models.unit_area import UnitArea from kittycad.models.unit_area import UnitArea
from kittycad.models.unit_current import UnitCurrent from kittycad.models.unit_current import UnitCurrent
@ -153,6 +168,7 @@ from kittycad.models.unit_temperature import UnitTemperature
from kittycad.models.unit_torque import UnitTorque from kittycad.models.unit_torque import UnitTorque
from kittycad.models.unit_volume import UnitVolume from kittycad.models.unit_volume import UnitVolume
from kittycad.models.update_user import UpdateUser from kittycad.models.update_user import UpdateUser
from kittycad.models.web_socket_request import sdp_offer
from kittycad.types import Response from kittycad.types import Response
@ -275,104 +291,161 @@ async def test_get_metadata_async():
@pytest.mark.skip @pytest.mark.skip
def test_create_image_to_3d(): def test_list_ai_prompts():
# Create our client. # Create our client.
client = ClientFromEnv() client = ClientFromEnv()
result: Optional[Union[Mesh, Error]] = create_image_to_3d.sync( result: Optional[Union[AiPromptResultsPage, Error]] = list_ai_prompts.sync(
client=client, client=client,
input_format=ImageType.PNG, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
output_format=FileExportFormat.FBX, limit=None, # Optional[int]
body=bytes("some bytes", "utf-8"), page_token=None, # Optional[str]
) )
if isinstance(result, Error) or result is None: if isinstance(result, Error) or result is None:
print(result) print(result)
raise Exception("Error in response") raise Exception("Error in response")
body: Mesh = result body: AiPromptResultsPage = result
print(body) print(body)
# OR if you need more info (e.g. status_code) # OR if you need more info (e.g. status_code)
response: Response[Optional[Union[Mesh, Error]]] = create_image_to_3d.sync_detailed( response: Response[
Optional[Union[AiPromptResultsPage, Error]]
] = list_ai_prompts.sync_detailed(
client=client, client=client,
input_format=ImageType.PNG, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
output_format=FileExportFormat.FBX, limit=None, # Optional[int]
body=bytes("some bytes", "utf-8"), page_token=None, # Optional[str]
) )
# OR run async # OR run async
@pytest.mark.asyncio @pytest.mark.asyncio
@pytest.mark.skip @pytest.mark.skip
async def test_create_image_to_3d_async(): async def test_list_ai_prompts_async():
# Create our client. # Create our client.
client = ClientFromEnv() client = ClientFromEnv()
result: Optional[Union[Mesh, Error]] = await create_image_to_3d.asyncio( result: Optional[Union[AiPromptResultsPage, Error]] = await list_ai_prompts.asyncio(
client=client, client=client,
input_format=ImageType.PNG, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
output_format=FileExportFormat.FBX, limit=None, # Optional[int]
body=bytes("some bytes", "utf-8"), page_token=None, # Optional[str]
) )
# OR run async with more info # OR run async with more info
response: Response[ response: Response[
Optional[Union[Mesh, Error]] Optional[Union[AiPromptResultsPage, Error]]
] = await create_image_to_3d.asyncio_detailed( ] = await list_ai_prompts.asyncio_detailed(
client=client, client=client,
input_format=ImageType.PNG, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
output_format=FileExportFormat.FBX, limit=None, # Optional[int]
body=bytes("some bytes", "utf-8"), page_token=None, # Optional[str]
) )
@pytest.mark.skip @pytest.mark.skip
def test_create_text_to_3d(): def test_get_ai_prompt():
# Create our client. # Create our client.
client = ClientFromEnv() client = ClientFromEnv()
result: Optional[Union[Mesh, Error]] = create_text_to_3d.sync( result: Optional[Union[AiPrompt, Error]] = get_ai_prompt.sync(
client=client, client=client,
output_format=FileExportFormat.FBX, id="<uuid>",
prompt="<string>",
) )
if isinstance(result, Error) or result is None: if isinstance(result, Error) or result is None:
print(result) print(result)
raise Exception("Error in response") raise Exception("Error in response")
body: Mesh = result body: AiPrompt = result
print(body) print(body)
# OR if you need more info (e.g. status_code) # OR if you need more info (e.g. status_code)
response: Response[Optional[Union[Mesh, Error]]] = create_text_to_3d.sync_detailed( response: Response[Optional[Union[AiPrompt, Error]]] = get_ai_prompt.sync_detailed(
client=client, client=client,
output_format=FileExportFormat.FBX, id="<uuid>",
prompt="<string>",
) )
# OR run async # OR run async
@pytest.mark.asyncio @pytest.mark.asyncio
@pytest.mark.skip @pytest.mark.skip
async def test_create_text_to_3d_async(): async def test_get_ai_prompt_async():
# Create our client. # Create our client.
client = ClientFromEnv() client = ClientFromEnv()
result: Optional[Union[Mesh, Error]] = await create_text_to_3d.asyncio( result: Optional[Union[AiPrompt, Error]] = await get_ai_prompt.asyncio(
client=client, client=client,
output_format=FileExportFormat.FBX, id="<uuid>",
prompt="<string>",
) )
# OR run async with more info # OR run async with more info
response: Response[ response: Response[
Optional[Union[Mesh, Error]] Optional[Union[AiPrompt, Error]]
] = await create_text_to_3d.asyncio_detailed( ] = await get_ai_prompt.asyncio_detailed(
client=client,
id="<uuid>",
)
@pytest.mark.skip
def test_create_text_to_cad():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[TextToCad, Error]] = create_text_to_cad.sync(
client=client, client=client,
output_format=FileExportFormat.FBX, output_format=FileExportFormat.FBX,
body=TextToCadCreateBody(
prompt="<string>", prompt="<string>",
),
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: TextToCad = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[
Optional[Union[TextToCad, Error]]
] = create_text_to_cad.sync_detailed(
client=client,
output_format=FileExportFormat.FBX,
body=TextToCadCreateBody(
prompt="<string>",
),
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_create_text_to_cad_async():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[TextToCad, Error]] = await create_text_to_cad.asyncio(
client=client,
output_format=FileExportFormat.FBX,
body=TextToCadCreateBody(
prompt="<string>",
),
)
# OR run async with more info
response: Response[
Optional[Union[TextToCad, Error]]
] = await create_text_to_cad.asyncio_detailed(
client=client,
output_format=FileExportFormat.FBX,
body=TextToCadCreateBody(
prompt="<string>",
),
) )
@ -730,6 +803,7 @@ def test_get_async_operation():
FileVolume, FileVolume,
FileDensity, FileDensity,
FileSurfaceArea, FileSurfaceArea,
TextToCad,
Error, Error,
] ]
] = get_async_operation.sync( ] = get_async_operation.sync(
@ -748,6 +822,7 @@ def test_get_async_operation():
FileVolume, FileVolume,
FileDensity, FileDensity,
FileSurfaceArea, FileSurfaceArea,
TextToCad,
] = result ] = result
print(body) print(body)
@ -761,6 +836,7 @@ def test_get_async_operation():
FileVolume, FileVolume,
FileDensity, FileDensity,
FileSurfaceArea, FileSurfaceArea,
TextToCad,
Error, Error,
] ]
] ]
@ -785,6 +861,7 @@ async def test_get_async_operation_async():
FileVolume, FileVolume,
FileDensity, FileDensity,
FileSurfaceArea, FileSurfaceArea,
TextToCad,
Error, Error,
] ]
] = await get_async_operation.asyncio( ] = await get_async_operation.asyncio(
@ -802,6 +879,7 @@ async def test_get_async_operation_async():
FileVolume, FileVolume,
FileDensity, FileDensity,
FileSurfaceArea, FileSurfaceArea,
TextToCad,
Error, Error,
] ]
] ]
@ -1324,6 +1402,57 @@ async def test_create_file_volume_async():
) )
@pytest.mark.skip
def test_internal_get_api_token_for_discord_user():
# Create our client.
client = ClientFromEnv()
result: Optional[
Union[ApiToken, Error]
] = internal_get_api_token_for_discord_user.sync(
client=client,
discord_id="<string>",
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: ApiToken = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[
Optional[Union[ApiToken, Error]]
] = internal_get_api_token_for_discord_user.sync_detailed(
client=client,
discord_id="<string>",
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_internal_get_api_token_for_discord_user_async():
# Create our client.
client = ClientFromEnv()
result: Optional[
Union[ApiToken, Error]
] = await internal_get_api_token_for_discord_user.asyncio(
client=client,
discord_id="<string>",
)
# OR run async with more info
response: Response[
Optional[Union[ApiToken, Error]]
] = await internal_get_api_token_for_discord_user.asyncio_detailed(
client=client,
discord_id="<string>",
)
@pytest.mark.skip @pytest.mark.skip
def test_logout(): def test_logout():
# Create our client. # Create our client.
@ -2197,45 +2326,6 @@ async def test_get_volume_unit_conversion_async():
) )
@pytest.mark.skip
def test_delete_user_self():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = delete_user_self.sync(
client=client,
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: Error = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[Optional[Error]] = delete_user_self.sync_detailed(
client=client,
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_delete_user_self_async():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = await delete_user_self.asyncio(
client=client,
)
# OR run async with more info
response: Response[Optional[Error]] = await delete_user_self.asyncio_detailed(
client=client,
)
@pytest.mark.skip @pytest.mark.skip
def test_get_user_self(): def test_get_user_self():
# Create our client. # Create our client.
@ -2350,6 +2440,45 @@ async def test_update_user_self_async():
) )
@pytest.mark.skip
def test_delete_user_self():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = delete_user_self.sync(
client=client,
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: Error = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[Optional[Error]] = delete_user_self.sync_detailed(
client=client,
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_delete_user_self_async():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = await delete_user_self.asyncio(
client=client,
)
# OR run async with more info
response: Response[Optional[Error]] = await delete_user_self.asyncio_detailed(
client=client,
)
@pytest.mark.skip @pytest.mark.skip
def test_user_list_api_calls(): def test_user_list_api_calls():
# Create our client. # Create our client.
@ -2558,51 +2687,6 @@ async def test_create_api_token_for_user_async():
) )
@pytest.mark.skip
def test_delete_api_token_for_user():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = delete_api_token_for_user.sync(
client=client,
token="<uuid>",
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: Error = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[Optional[Error]] = delete_api_token_for_user.sync_detailed(
client=client,
token="<uuid>",
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_delete_api_token_for_user_async():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = await delete_api_token_for_user.asyncio(
client=client,
token="<uuid>",
)
# OR run async with more info
response: Response[
Optional[Error]
] = await delete_api_token_for_user.asyncio_detailed(
client=client,
token="<uuid>",
)
@pytest.mark.skip @pytest.mark.skip
def test_get_api_token_for_user(): def test_get_api_token_for_user():
# Create our client. # Create our client.
@ -2650,6 +2734,51 @@ async def test_get_api_token_for_user_async():
) )
@pytest.mark.skip
def test_delete_api_token_for_user():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = delete_api_token_for_user.sync(
client=client,
token="<uuid>",
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: Error = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[Optional[Error]] = delete_api_token_for_user.sync_detailed(
client=client,
token="<uuid>",
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_delete_api_token_for_user_async():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = await delete_api_token_for_user.asyncio(
client=client,
token="<uuid>",
)
# OR run async with more info
response: Response[
Optional[Error]
] = await delete_api_token_for_user.asyncio_detailed(
client=client,
token="<uuid>",
)
@pytest.mark.skip @pytest.mark.skip
def test_get_user_self_extended(): def test_get_user_self_extended():
# Create our client. # Create our client.
@ -2768,49 +2897,6 @@ async def test_get_user_onboarding_self_async():
) )
@pytest.mark.skip
def test_delete_payment_information_for_user():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = delete_payment_information_for_user.sync(
client=client,
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: Error = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[
Optional[Error]
] = delete_payment_information_for_user.sync_detailed(
client=client,
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_delete_payment_information_for_user_async():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = await delete_payment_information_for_user.asyncio(
client=client,
)
# OR run async with more info
response: Response[
Optional[Error]
] = await delete_payment_information_for_user.asyncio_detailed(
client=client,
)
@pytest.mark.skip @pytest.mark.skip
def test_get_payment_information_for_user(): def test_get_payment_information_for_user():
# Create our client. # Create our client.
@ -2856,6 +2942,67 @@ async def test_get_payment_information_for_user_async():
) )
@pytest.mark.skip
def test_update_payment_information_for_user():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[Customer, Error]] = update_payment_information_for_user.sync(
client=client,
body=BillingInfo(
name="<string>",
phone="<string>",
),
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: Customer = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[
Optional[Union[Customer, Error]]
] = update_payment_information_for_user.sync_detailed(
client=client,
body=BillingInfo(
name="<string>",
phone="<string>",
),
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_update_payment_information_for_user_async():
# Create our client.
client = ClientFromEnv()
result: Optional[
Union[Customer, Error]
] = await update_payment_information_for_user.asyncio(
client=client,
body=BillingInfo(
name="<string>",
phone="<string>",
),
)
# OR run async with more info
response: Response[
Optional[Union[Customer, Error]]
] = await update_payment_information_for_user.asyncio_detailed(
client=client,
body=BillingInfo(
name="<string>",
phone="<string>",
),
)
@pytest.mark.skip @pytest.mark.skip
def test_create_payment_information_for_user(): def test_create_payment_information_for_user():
# Create our client. # Create our client.
@ -2918,63 +3065,45 @@ async def test_create_payment_information_for_user_async():
@pytest.mark.skip @pytest.mark.skip
def test_update_payment_information_for_user(): def test_delete_payment_information_for_user():
# Create our client. # Create our client.
client = ClientFromEnv() client = ClientFromEnv()
result: Optional[Union[Customer, Error]] = update_payment_information_for_user.sync( result: Optional[Error] = delete_payment_information_for_user.sync(
client=client, client=client,
body=BillingInfo(
name="<string>",
phone="<string>",
),
) )
if isinstance(result, Error) or result is None: if isinstance(result, Error) or result is None:
print(result) print(result)
raise Exception("Error in response") raise Exception("Error in response")
body: Customer = result body: Error = result
print(body) print(body)
# OR if you need more info (e.g. status_code) # OR if you need more info (e.g. status_code)
response: Response[ response: Response[
Optional[Union[Customer, Error]] Optional[Error]
] = update_payment_information_for_user.sync_detailed( ] = delete_payment_information_for_user.sync_detailed(
client=client, client=client,
body=BillingInfo(
name="<string>",
phone="<string>",
),
) )
# OR run async # OR run async
@pytest.mark.asyncio @pytest.mark.asyncio
@pytest.mark.skip @pytest.mark.skip
async def test_update_payment_information_for_user_async(): async def test_delete_payment_information_for_user_async():
# Create our client. # Create our client.
client = ClientFromEnv() client = ClientFromEnv()
result: Optional[ result: Optional[Error] = await delete_payment_information_for_user.asyncio(
Union[Customer, Error]
] = await update_payment_information_for_user.asyncio(
client=client, client=client,
body=BillingInfo(
name="<string>",
phone="<string>",
),
) )
# OR run async with more info # OR run async with more info
response: Response[ response: Response[
Optional[Union[Customer, Error]] Optional[Error]
] = await update_payment_information_for_user.asyncio_detailed( ] = await delete_payment_information_for_user.asyncio_detailed(
client=client, client=client,
body=BillingInfo(
name="<string>",
phone="<string>",
),
) )
@ -3295,6 +3424,165 @@ async def test_get_session_for_user_async():
) )
@pytest.mark.skip
def test_list_text_to_cad_models_for_user():
# Create our client.
client = ClientFromEnv()
result: Optional[
Union[TextToCadResultsPage, Error]
] = list_text_to_cad_models_for_user.sync(
client=client,
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
limit=None, # Optional[int]
page_token=None, # Optional[str]
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: TextToCadResultsPage = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[
Optional[Union[TextToCadResultsPage, Error]]
] = list_text_to_cad_models_for_user.sync_detailed(
client=client,
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
limit=None, # Optional[int]
page_token=None, # Optional[str]
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_list_text_to_cad_models_for_user_async():
# Create our client.
client = ClientFromEnv()
result: Optional[
Union[TextToCadResultsPage, Error]
] = await list_text_to_cad_models_for_user.asyncio(
client=client,
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
limit=None, # Optional[int]
page_token=None, # Optional[str]
)
# OR run async with more info
response: Response[
Optional[Union[TextToCadResultsPage, Error]]
] = await list_text_to_cad_models_for_user.asyncio_detailed(
client=client,
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
limit=None, # Optional[int]
page_token=None, # Optional[str]
)
@pytest.mark.skip
def test_get_text_to_cad_model_for_user():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[TextToCad, Error]] = get_text_to_cad_model_for_user.sync(
client=client,
id="<uuid>",
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: TextToCad = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[
Optional[Union[TextToCad, Error]]
] = get_text_to_cad_model_for_user.sync_detailed(
client=client,
id="<uuid>",
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_get_text_to_cad_model_for_user_async():
# Create our client.
client = ClientFromEnv()
result: Optional[
Union[TextToCad, Error]
] = await get_text_to_cad_model_for_user.asyncio(
client=client,
id="<uuid>",
)
# OR run async with more info
response: Response[
Optional[Union[TextToCad, Error]]
] = await get_text_to_cad_model_for_user.asyncio_detailed(
client=client,
id="<uuid>",
)
@pytest.mark.skip
def test_create_text_to_cad_model_feedback():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = create_text_to_cad_model_feedback.sync(
client=client,
id="<uuid>",
feedback=AiFeedback.THUMBS_UP,
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: Error = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[
Optional[Error]
] = create_text_to_cad_model_feedback.sync_detailed(
client=client,
id="<uuid>",
feedback=AiFeedback.THUMBS_UP,
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_create_text_to_cad_model_feedback_async():
# Create our client.
client = ClientFromEnv()
result: Optional[Error] = await create_text_to_cad_model_feedback.asyncio(
client=client,
id="<uuid>",
feedback=AiFeedback.THUMBS_UP,
)
# OR run async with more info
response: Response[
Optional[Error]
] = await create_text_to_cad_model_feedback.asyncio_detailed(
client=client,
id="<uuid>",
feedback=AiFeedback.THUMBS_UP,
)
@pytest.mark.skip @pytest.mark.skip
def test_list_users(): def test_list_users():
# Create our client. # Create our client.
@ -3604,7 +3892,7 @@ def test_modeling_commands_ws():
client = ClientFromEnv() client = ClientFromEnv()
# Connect to the websocket. # Connect to the websocket.
websocket = modeling_commands_ws.sync( websocket = modeling_commands_ws.WebSocket(
client=client, client=client,
fps=10, fps=10,
unlocked_framerate=False, unlocked_framerate=False,
@ -3614,10 +3902,19 @@ def test_modeling_commands_ws():
) )
# Send a message. # Send a message.
websocket.send("{}") websocket.send(
WebSocketRequest(
sdp_offer(
offer=RtcSessionDescription(
sdp="<string>",
type=RtcSdpType.UNSPECIFIED,
),
)
)
)
# Get the messages. # Get a message.
for message in websocket: message = websocket.recv()
print(message) print(message)

View File

@ -1,12 +1,16 @@
""" Contains all the data models used in inputs/outputs """ """ Contains all the data models used in inputs/outputs """
from .account_provider import AccountProvider from .account_provider import AccountProvider
from .ai_feedback import AiFeedback
from .ai_plugin_api import AiPluginApi from .ai_plugin_api import AiPluginApi
from .ai_plugin_api_type import AiPluginApiType from .ai_plugin_api_type import AiPluginApiType
from .ai_plugin_auth import AiPluginAuth from .ai_plugin_auth import AiPluginAuth
from .ai_plugin_auth_type import AiPluginAuthType from .ai_plugin_auth_type import AiPluginAuthType
from .ai_plugin_http_auth_type import AiPluginHttpAuthType from .ai_plugin_http_auth_type import AiPluginHttpAuthType
from .ai_plugin_manifest import AiPluginManifest from .ai_plugin_manifest import AiPluginManifest
from .ai_prompt import AiPrompt
from .ai_prompt_results_page import AiPromptResultsPage
from .ai_prompt_type import AiPromptType
from .angle import Angle from .angle import Angle
from .annotation_line_end import AnnotationLineEnd from .annotation_line_end import AnnotationLineEnd
from .annotation_line_end_options import AnnotationLineEndOptions from .annotation_line_end_options import AnnotationLineEndOptions
@ -85,12 +89,12 @@ from .file_system_metadata import FileSystemMetadata
from .file_volume import FileVolume from .file_volume import FileVolume
from .gateway import Gateway from .gateway import Gateway
from .get_entity_type import GetEntityType from .get_entity_type import GetEntityType
from .get_sketch_mode_plane import GetSketchModePlane
from .gltf_presentation import GltfPresentation from .gltf_presentation import GltfPresentation
from .gltf_storage import GltfStorage from .gltf_storage import GltfStorage
from .highlight_set_entity import HighlightSetEntity from .highlight_set_entity import HighlightSetEntity
from .ice_server import IceServer from .ice_server import IceServer
from .image_format import ImageFormat from .image_format import ImageFormat
from .image_type import ImageType
from .import_file import ImportFile from .import_file import ImportFile
from .import_files import ImportFiles from .import_files import ImportFiles
from .input_format import InputFormat from .input_format import InputFormat
@ -103,12 +107,12 @@ from .jetstream_config import JetstreamConfig
from .jetstream_stats import JetstreamStats from .jetstream_stats import JetstreamStats
from .leaf_node import LeafNode from .leaf_node import LeafNode
from .mass import Mass from .mass import Mass
from .mesh import Mesh
from .meta_cluster_info import MetaClusterInfo from .meta_cluster_info import MetaClusterInfo
from .metadata import Metadata from .metadata import Metadata
from .method import Method from .method import Method
from .modeling_cmd import ModelingCmd from .modeling_cmd import ModelingCmd
from .modeling_cmd_id import ModelingCmdId from .modeling_cmd_id import ModelingCmdId
from .modeling_cmd_req import ModelingCmdReq
from .mouse_click import MouseClick from .mouse_click import MouseClick
from .new_address import NewAddress from .new_address import NewAddress
from .o_auth2_client_info import OAuth2ClientInfo from .o_auth2_client_info import OAuth2ClientInfo
@ -119,8 +123,11 @@ from .onboarding import Onboarding
from .output_file import OutputFile from .output_file import OutputFile
from .output_format import OutputFormat from .output_format import OutputFormat
from .path_command import PathCommand from .path_command import PathCommand
from .path_component_constraint_bound import PathComponentConstraintBound
from .path_component_constraint_type import PathComponentConstraintType
from .path_get_curve_uuids_for_vertices import PathGetCurveUuidsForVertices from .path_get_curve_uuids_for_vertices import PathGetCurveUuidsForVertices
from .path_get_info import PathGetInfo from .path_get_info import PathGetInfo
from .path_get_vertex_uuids import PathGetVertexUuids
from .path_segment import PathSegment from .path_segment import PathSegment
from .path_segment_info import PathSegmentInfo from .path_segment_info import PathSegmentInfo
from .payment_intent import PaymentIntent from .payment_intent import PaymentIntent
@ -131,7 +138,6 @@ from .plane_intersect_and_project import PlaneIntersectAndProject
from .ply_storage import PlyStorage from .ply_storage import PlyStorage
from .point2d import Point2d from .point2d import Point2d
from .point3d import Point3d from .point3d import Point3d
from .point_e_metadata import PointEMetadata
from .pong import Pong from .pong import Pong
from .raw_file import RawFile from .raw_file import RawFile
from .rtc_ice_candidate_init import RtcIceCandidateInit from .rtc_ice_candidate_init import RtcIceCandidateInit
@ -141,6 +147,7 @@ from .scene_selection_type import SceneSelectionType
from .scene_tool_type import SceneToolType from .scene_tool_type import SceneToolType
from .select_get import SelectGet from .select_get import SelectGet
from .select_with_point import SelectWithPoint from .select_with_point import SelectWithPoint
from .selection import Selection
from .session import Session from .session import Session
from .solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces from .solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces
from .solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges from .solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges
@ -152,6 +159,9 @@ from .success_web_socket_response import SuccessWebSocketResponse
from .surface_area import SurfaceArea from .surface_area import SurfaceArea
from .system import System from .system import System
from .take_snapshot import TakeSnapshot from .take_snapshot import TakeSnapshot
from .text_to_cad import TextToCad
from .text_to_cad_create_body import TextToCadCreateBody
from .text_to_cad_results_page import TextToCadResultsPage
from .unit_angle import UnitAngle from .unit_angle import UnitAngle
from .unit_angle_conversion import UnitAngleConversion from .unit_angle_conversion import UnitAngleConversion
from .unit_area import UnitArea from .unit_area import UnitArea
@ -183,6 +193,7 @@ from .update_user import UpdateUser
from .user import User from .user import User
from .user_results_page import UserResultsPage from .user_results_page import UserResultsPage
from .uuid import Uuid from .uuid import Uuid
from .uuid_binary import UuidBinary
from .verification_token import VerificationToken from .verification_token import VerificationToken
from .volume import Volume from .volume import Volume
from .web_socket_request import WebSocketRequest from .web_socket_request import WebSocketRequest

View File

@ -3,10 +3,13 @@ from enum import Enum
class AccountProvider(str, Enum): class AccountProvider(str, Enum):
"""An account provider.""" # noqa: E501 """An account provider.""" # noqa: E501
"""# The Discord account provider. """ # noqa: E501
DISCORD = "discord"
"""# The Google account provider. """ # noqa: E501 """# The Google account provider. """ # noqa: E501
GOOGLE = 'google' GOOGLE = "google"
"""# The GitHub account provider. """ # noqa: E501 """# The GitHub account provider. """ # noqa: E501
GITHUB = 'github' GITHUB = "github"
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -0,0 +1,13 @@
from enum import Enum
class AiFeedback(str, Enum):
"""Human feedback on an AI response.""" # noqa: E501
"""# Thumbs up. """ # noqa: E501
THUMBS_UP = "thumbs_up"
"""# Thumbs down. """ # noqa: E501
THUMBS_DOWN = "thumbs_down"
def __str__(self) -> str:
return str(self.value)

View File

@ -7,9 +7,11 @@ from ..types import UNSET, Unset
SB = TypeVar("SB", bound="AiPluginApi") SB = TypeVar("SB", bound="AiPluginApi")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class AiPluginApi: class AiPluginApi:
"""AI plugin api information.""" # noqa: E501 """AI plugin api information.""" # noqa: E501
is_user_authenticated: Union[Unset, bool] = False is_user_authenticated: Union[Unset, bool] = False
type: Union[Unset, AiPluginApiType] = UNSET type: Union[Unset, AiPluginApiType] = UNSET
url: Union[Unset, str] = UNSET url: Union[Unset, str] = UNSET
@ -18,6 +20,7 @@ class AiPluginApi:
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
is_user_authenticated = self.is_user_authenticated is_user_authenticated = self.is_user_authenticated
type: Union[Unset, AiPluginApiType] = UNSET
if not isinstance(self.type, Unset): if not isinstance(self.type, Unset):
type = self.type type = self.type
url = self.url url = self.url
@ -26,11 +29,11 @@ class AiPluginApi:
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if is_user_authenticated is not UNSET: if is_user_authenticated is not UNSET:
field_dict['is_user_authenticated'] = is_user_authenticated field_dict["is_user_authenticated"] = is_user_authenticated
if type is not UNSET: if type is not UNSET:
field_dict['type'] = type field_dict["type"] = type
if url is not UNSET: if url is not UNSET:
field_dict['url'] = url field_dict["url"] = url
return field_dict return field_dict
@ -43,12 +46,13 @@ class AiPluginApi:
type: Union[Unset, AiPluginApiType] type: Union[Unset, AiPluginApiType]
if isinstance(_type, Unset): if isinstance(_type, Unset):
type = UNSET type = UNSET
if _type is None:
type = UNSET
else: else:
type = _type # type: ignore[arg-type] type = _type
url = d.pop("url", UNSET) url = d.pop("url", UNSET)
ai_plugin_api = cls( ai_plugin_api = cls(
is_user_authenticated=is_user_authenticated, is_user_authenticated=is_user_authenticated,
type=type, type=type,

View File

@ -3,8 +3,9 @@ from enum import Enum
class AiPluginApiType(str, Enum): class AiPluginApiType(str, Enum):
"""AI plugin api type.""" # noqa: E501 """AI plugin api type.""" # noqa: E501
"""# An OpenAPI specification. """ # noqa: E501 """# An OpenAPI specification. """ # noqa: E501
OPENAPI = 'openapi' OPENAPI = "openapi"
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -8,17 +8,21 @@ from ..types import UNSET, Unset
NP = TypeVar("NP", bound="AiPluginAuth") NP = TypeVar("NP", bound="AiPluginAuth")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class AiPluginAuth: class AiPluginAuth:
"""AI plugin auth information.""" # noqa: E501 """AI plugin auth information.""" # noqa: E501
authorization_type: Union[Unset, AiPluginHttpAuthType] = UNSET authorization_type: Union[Unset, AiPluginHttpAuthType] = UNSET
type: Union[Unset, AiPluginAuthType] = UNSET type: Union[Unset, AiPluginAuthType] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
authorization_type: Union[Unset, AiPluginHttpAuthType] = UNSET
if not isinstance(self.authorization_type, Unset): if not isinstance(self.authorization_type, Unset):
authorization_type = self.authorization_type authorization_type = self.authorization_type
type: Union[Unset, AiPluginAuthType] = UNSET
if not isinstance(self.type, Unset): if not isinstance(self.type, Unset):
type = self.type type = self.type
@ -26,9 +30,9 @@ class AiPluginAuth:
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if authorization_type is not UNSET: if authorization_type is not UNSET:
field_dict['authorization_type'] = authorization_type field_dict["authorization_type"] = authorization_type
if type is not UNSET: if type is not UNSET:
field_dict['type'] = type field_dict["type"] = type
return field_dict return field_dict
@ -39,16 +43,19 @@ class AiPluginAuth:
authorization_type: Union[Unset, AiPluginHttpAuthType] authorization_type: Union[Unset, AiPluginHttpAuthType]
if isinstance(_authorization_type, Unset): if isinstance(_authorization_type, Unset):
authorization_type = UNSET authorization_type = UNSET
if _authorization_type is None:
authorization_type = UNSET
else: else:
authorization_type = _authorization_type # type: ignore[arg-type] authorization_type = _authorization_type
_type = d.pop("type", UNSET) _type = d.pop("type", UNSET)
type: Union[Unset, AiPluginAuthType] type: Union[Unset, AiPluginAuthType]
if isinstance(_type, Unset): if isinstance(_type, Unset):
type = UNSET type = UNSET
if _type is None:
type = UNSET
else: else:
type = _type # type: ignore[arg-type] type = _type
ai_plugin_auth = cls( ai_plugin_auth = cls(
authorization_type=authorization_type, authorization_type=authorization_type,

View File

@ -3,14 +3,15 @@ from enum import Enum
class AiPluginAuthType(str, Enum): class AiPluginAuthType(str, Enum):
"""AI plugin auth type.""" # noqa: E501 """AI plugin auth type.""" # noqa: E501
"""# None. """ # noqa: E501 """# None. """ # noqa: E501
NONE = 'none' NONE = "none"
"""# User http. """ # noqa: E501 """# User http. """ # noqa: E501
USER_HTTP = 'user_http' USER_HTTP = "user_http"
"""# Service http. """ # noqa: E501 """# Service http. """ # noqa: E501
SERVICE_HTTP = 'service_http' SERVICE_HTTP = "service_http"
"""# OAuth. """ # noqa: E501 """# OAuth. """ # noqa: E501
OAUTH = 'oauth' OAUTH = "oauth"
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -3,10 +3,11 @@ from enum import Enum
class AiPluginHttpAuthType(str, Enum): class AiPluginHttpAuthType(str, Enum):
"""AI plugin http auth type.""" # noqa: E501 """AI plugin http auth type.""" # noqa: E501
"""# Basic. """ # noqa: E501 """# Basic. """ # noqa: E501
BASIC = 'basic' BASIC = "basic"
"""# Bearer. """ # noqa: E501 """# Bearer. """ # noqa: E501
BEARER = 'bearer' BEARER = "bearer"
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, List, Type, TypeVar, Union from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr import attr
@ -8,11 +8,14 @@ from ..types import UNSET, Unset
SA = TypeVar("SA", bound="AiPluginManifest") SA = TypeVar("SA", bound="AiPluginManifest")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class AiPluginManifest: class AiPluginManifest:
"""AI plugin manifest. """AI plugin manifest.
This is used for OpenAI's ChatGPT plugins. You can read more about them [here](https://platform.openai.com/docs/plugins/getting-started/plugin-manifest). """ # noqa: E501 This is used for OpenAI's ChatGPT plugins. You can read more about them [here](https://platform.openai.com/docs/plugins/getting-started/plugin-manifest).
""" # noqa: E501
api: Union[Unset, AiPluginApi] = UNSET api: Union[Unset, AiPluginApi] = UNSET
auth: Union[Unset, AiPluginAuth] = UNSET auth: Union[Unset, AiPluginAuth] = UNSET
contact_email: Union[Unset, str] = UNSET contact_email: Union[Unset, str] = UNSET
@ -27,8 +30,10 @@ This is used for OpenAI's ChatGPT plugins. You can read more about them [here](h
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
api: Union[Unset, AiPluginApi] = UNSET
if not isinstance(self.api, Unset): if not isinstance(self.api, Unset):
api = self.api api = self.api
auth: Union[Unset, AiPluginAuth] = UNSET
if not isinstance(self.auth, Unset): if not isinstance(self.auth, Unset):
auth = self.auth auth = self.auth
contact_email = self.contact_email contact_email = self.contact_email
@ -44,25 +49,27 @@ This is used for OpenAI's ChatGPT plugins. You can read more about them [here](h
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if api is not UNSET: if api is not UNSET:
field_dict['api'] = api _api: AiPluginApi = cast(AiPluginApi, api)
field_dict["api"] = _api.to_dict()
if auth is not UNSET: if auth is not UNSET:
field_dict['auth'] = auth _auth: AiPluginAuth = cast(AiPluginAuth, auth)
field_dict["auth"] = _auth.to_dict()
if contact_email is not UNSET: if contact_email is not UNSET:
field_dict['contact_email'] = contact_email field_dict["contact_email"] = contact_email
if description_for_human is not UNSET: if description_for_human is not UNSET:
field_dict['description_for_human'] = description_for_human field_dict["description_for_human"] = description_for_human
if description_for_model is not UNSET: if description_for_model is not UNSET:
field_dict['description_for_model'] = description_for_model field_dict["description_for_model"] = description_for_model
if legal_info_url is not UNSET: if legal_info_url is not UNSET:
field_dict['legal_info_url'] = legal_info_url field_dict["legal_info_url"] = legal_info_url
if logo_url is not UNSET: if logo_url is not UNSET:
field_dict['logo_url'] = logo_url field_dict["logo_url"] = logo_url
if name_for_human is not UNSET: if name_for_human is not UNSET:
field_dict['name_for_human'] = name_for_human field_dict["name_for_human"] = name_for_human
if name_for_model is not UNSET: if name_for_model is not UNSET:
field_dict['name_for_model'] = name_for_model field_dict["name_for_model"] = name_for_model
if schema_version is not UNSET: if schema_version is not UNSET:
field_dict['schema_version'] = schema_version field_dict["schema_version"] = schema_version
return field_dict return field_dict
@ -73,15 +80,19 @@ This is used for OpenAI's ChatGPT plugins. You can read more about them [here](h
api: Union[Unset, AiPluginApi] api: Union[Unset, AiPluginApi]
if isinstance(_api, Unset): if isinstance(_api, Unset):
api = UNSET api = UNSET
if _api is None:
api = UNSET
else: else:
api = _api # type: ignore[arg-type] api = AiPluginApi.from_dict(_api)
_auth = d.pop("auth", UNSET) _auth = d.pop("auth", UNSET)
auth: Union[Unset, AiPluginAuth] auth: Union[Unset, AiPluginAuth]
if isinstance(_auth, Unset): if isinstance(_auth, Unset):
auth = UNSET auth = UNSET
if _auth is None:
auth = UNSET
else: else:
auth = _auth # type: ignore[arg-type] auth = AiPluginAuth.from_dict(_auth)
contact_email = d.pop("contact_email", UNSET) contact_email = d.pop("contact_email", UNSET)
@ -99,7 +110,6 @@ This is used for OpenAI's ChatGPT plugins. You can read more about them [here](h
schema_version = d.pop("schema_version", UNSET) schema_version = d.pop("schema_version", UNSET)
ai_plugin_manifest = cls( ai_plugin_manifest = cls(
api=api, api=api,
auth=auth, auth=auth,

View File

@ -0,0 +1,223 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from ..models.ai_feedback import AiFeedback
from ..models.ai_prompt_type import AiPromptType
from ..models.api_call_status import ApiCallStatus
from ..models.uuid import Uuid
from ..models.uuid_binary import UuidBinary
from ..types import UNSET, Unset
GO = TypeVar("GO", bound="AiPrompt")
@attr.s(auto_attribs=True)
class AiPrompt:
"""An AI prompt.""" # noqa: E501
completed_at: Union[Unset, datetime.datetime] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
error: Union[Unset, str] = UNSET
feedback: Union[Unset, AiFeedback] = UNSET
id: Union[Unset, UuidBinary] = UNSET
metadata: Union[Unset, Any] = UNSET
model_version: Union[Unset, str] = UNSET
output_file: Union[Unset, str] = UNSET
prompt: Union[Unset, str] = UNSET
started_at: Union[Unset, datetime.datetime] = UNSET
status: Union[Unset, ApiCallStatus] = UNSET
type: Union[Unset, AiPromptType] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
user_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
completed_at: Union[Unset, str] = UNSET
if not isinstance(self.completed_at, Unset):
completed_at = self.completed_at.isoformat()
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
error = self.error
feedback: Union[Unset, AiFeedback] = UNSET
if not isinstance(self.feedback, Unset):
feedback = self.feedback
id: Union[Unset, UuidBinary] = UNSET
if not isinstance(self.id, Unset):
id = self.id
metadata = self.metadata
model_version = self.model_version
output_file = self.output_file
prompt = self.prompt
started_at: Union[Unset, str] = UNSET
if not isinstance(self.started_at, Unset):
started_at = self.started_at.isoformat()
status: Union[Unset, ApiCallStatus] = UNSET
if not isinstance(self.status, Unset):
status = self.status
type: Union[Unset, AiPromptType] = UNSET
if not isinstance(self.type, Unset):
type = self.type
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
user_id = self.user_id
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if completed_at is not UNSET:
field_dict["completed_at"] = completed_at
if created_at is not UNSET:
field_dict["created_at"] = created_at
if error is not UNSET:
field_dict["error"] = error
if feedback is not UNSET:
field_dict["feedback"] = feedback
if id is not UNSET:
field_dict["id"] = id
if metadata is not UNSET:
field_dict["metadata"] = metadata
if model_version is not UNSET:
field_dict["model_version"] = model_version
if output_file is not UNSET:
field_dict["output_file"] = output_file
if prompt is not UNSET:
field_dict["prompt"] = prompt
if started_at is not UNSET:
field_dict["started_at"] = started_at
if status is not UNSET:
field_dict["status"] = status
if type is not UNSET:
field_dict["type"] = type
if updated_at is not UNSET:
field_dict["updated_at"] = updated_at
if user_id is not UNSET:
field_dict["user_id"] = user_id
return field_dict
@classmethod
def from_dict(cls: Type[GO], src_dict: Dict[str, Any]) -> GO:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
if isinstance(_completed_at, Unset):
completed_at = UNSET
else:
completed_at = isoparse(_completed_at)
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
error = d.pop("error", UNSET)
_feedback = d.pop("feedback", UNSET)
feedback: Union[Unset, AiFeedback]
if isinstance(_feedback, Unset):
feedback = UNSET
if _feedback is None:
feedback = UNSET
else:
feedback = _feedback
_id = d.pop("id", UNSET)
id: Union[Unset, UuidBinary]
if isinstance(_id, Unset):
id = UNSET
if _id is None:
id = UNSET
else:
id = _id
metadata = d.pop("metadata", UNSET)
model_version = d.pop("model_version", UNSET)
output_file = d.pop("output_file", UNSET)
prompt = d.pop("prompt", UNSET)
_started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime]
if isinstance(_started_at, Unset):
started_at = UNSET
else:
started_at = isoparse(_started_at)
_status = d.pop("status", UNSET)
status: Union[Unset, ApiCallStatus]
if isinstance(_status, Unset):
status = UNSET
if _status is None:
status = UNSET
else:
status = _status
_type = d.pop("type", UNSET)
type: Union[Unset, AiPromptType]
if isinstance(_type, Unset):
type = UNSET
if _type is None:
type = UNSET
else:
type = _type
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]
if isinstance(_updated_at, Unset):
updated_at = UNSET
else:
updated_at = isoparse(_updated_at)
_user_id = d.pop("user_id", UNSET)
user_id: Union[Unset, Uuid]
if isinstance(_user_id, Unset):
user_id = UNSET
if _user_id is None:
user_id = UNSET
else:
user_id = _user_id
ai_prompt = cls(
completed_at=completed_at,
created_at=created_at,
error=error,
feedback=feedback,
id=id,
metadata=metadata,
model_version=model_version,
output_file=output_file,
prompt=prompt,
started_at=started_at,
status=status,
type=type,
updated_at=updated_at,
user_id=user_id,
)
ai_prompt.additional_properties = d
return ai_prompt
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -0,0 +1,70 @@
from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from ..types import UNSET, Unset
PI = TypeVar("PI", bound="AiPromptResultsPage")
@attr.s(auto_attribs=True)
class AiPromptResultsPage:
"""A single page of results""" # noqa: E501
from ..models.ai_prompt import AiPrompt
items: Union[Unset, List[AiPrompt]] = UNSET
next_page: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
from ..models.ai_prompt import AiPrompt
items: Union[Unset, List[AiPrompt]] = UNSET
if not isinstance(self.items, Unset):
items = self.items
next_page = self.next_page
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if items is not UNSET:
field_dict["items"] = items
if next_page is not UNSET:
field_dict["next_page"] = next_page
return field_dict
@classmethod
def from_dict(cls: Type[PI], src_dict: Dict[str, Any]) -> PI:
d = src_dict.copy()
from ..models.ai_prompt import AiPrompt
items = cast(List[AiPrompt], d.pop("items", UNSET))
next_page = d.pop("next_page", UNSET)
ai_prompt_results_page = cls(
items=items,
next_page=next_page,
)
ai_prompt_results_page.additional_properties = d
return ai_prompt_results_page
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -0,0 +1,11 @@
from enum import Enum
class AiPromptType(str, Enum):
"""A type of AI prompt.""" # noqa: E501
"""# Text to CAD. """ # noqa: E501
TEXT_TO_CAD = "text_to_cad"
def __str__(self) -> str:
return str(self.value)

View File

@ -5,17 +5,20 @@ import attr
from ..models.unit_angle import UnitAngle from ..models.unit_angle import UnitAngle
from ..types import UNSET, Unset from ..types import UNSET, Unset
GO = TypeVar("GO", bound="Angle") UZ = TypeVar("UZ", bound="Angle")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class Angle: class Angle:
"""An angle, with a specific unit.""" # noqa: E501 """An angle, with a specific unit.""" # noqa: E501
unit: Union[Unset, UnitAngle] = UNSET unit: Union[Unset, UnitAngle] = UNSET
value: Union[Unset, float] = UNSET value: Union[Unset, float] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
unit: Union[Unset, UnitAngle] = UNSET
if not isinstance(self.unit, Unset): if not isinstance(self.unit, Unset):
unit = self.unit unit = self.unit
value = self.value value = self.value
@ -24,25 +27,26 @@ class Angle:
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if unit is not UNSET: if unit is not UNSET:
field_dict['unit'] = unit field_dict["unit"] = unit
if value is not UNSET: if value is not UNSET:
field_dict['value'] = value field_dict["value"] = value
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[GO], src_dict: Dict[str, Any]) -> GO: def from_dict(cls: Type[UZ], src_dict: Dict[str, Any]) -> UZ:
d = src_dict.copy() d = src_dict.copy()
_unit = d.pop("unit", UNSET) _unit = d.pop("unit", UNSET)
unit: Union[Unset, UnitAngle] unit: Union[Unset, UnitAngle]
if isinstance(_unit, Unset): if isinstance(_unit, Unset):
unit = UNSET unit = UNSET
if _unit is None:
unit = UNSET
else: else:
unit = _unit # type: ignore[arg-type] unit = _unit
value = d.pop("value", UNSET) value = d.pop("value", UNSET)
angle = cls( angle = cls(
unit=unit, unit=unit,
value=value, value=value,

View File

@ -3,8 +3,9 @@ from enum import Enum
class AnnotationLineEnd(str, Enum): class AnnotationLineEnd(str, Enum):
"""Annotation line end type""" # noqa: E501 """Annotation line end type""" # noqa: E501
NONE = 'none'
ARROW = 'arrow' NONE = "none"
ARROW = "arrow"
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -5,19 +5,23 @@ import attr
from ..models.annotation_line_end import AnnotationLineEnd from ..models.annotation_line_end import AnnotationLineEnd
from ..types import UNSET, Unset from ..types import UNSET, Unset
PI = TypeVar("PI", bound="AnnotationLineEndOptions") FB = TypeVar("FB", bound="AnnotationLineEndOptions")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class AnnotationLineEndOptions: class AnnotationLineEndOptions:
"""Options for annotation text""" # noqa: E501 """Options for annotation text""" # noqa: E501
end: Union[Unset, AnnotationLineEnd] = UNSET end: Union[Unset, AnnotationLineEnd] = UNSET
start: Union[Unset, AnnotationLineEnd] = UNSET start: Union[Unset, AnnotationLineEnd] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
end: Union[Unset, AnnotationLineEnd] = UNSET
if not isinstance(self.end, Unset): if not isinstance(self.end, Unset):
end = self.end end = self.end
start: Union[Unset, AnnotationLineEnd] = UNSET
if not isinstance(self.start, Unset): if not isinstance(self.start, Unset):
start = self.start start = self.start
@ -25,29 +29,32 @@ class AnnotationLineEndOptions:
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if end is not UNSET: if end is not UNSET:
field_dict['end'] = end field_dict["end"] = end
if start is not UNSET: if start is not UNSET:
field_dict['start'] = start field_dict["start"] = start
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[PI], src_dict: Dict[str, Any]) -> PI: def from_dict(cls: Type[FB], src_dict: Dict[str, Any]) -> FB:
d = src_dict.copy() d = src_dict.copy()
_end = d.pop("end", UNSET) _end = d.pop("end", UNSET)
end: Union[Unset, AnnotationLineEnd] end: Union[Unset, AnnotationLineEnd]
if isinstance(_end, Unset): if isinstance(_end, Unset):
end = UNSET end = UNSET
if _end is None:
end = UNSET
else: else:
end = _end # type: ignore[arg-type] end = _end
_start = d.pop("start", UNSET) _start = d.pop("start", UNSET)
start: Union[Unset, AnnotationLineEnd] start: Union[Unset, AnnotationLineEnd]
if isinstance(_start, Unset): if isinstance(_start, Unset):
start = UNSET start = UNSET
if _start is None:
start = UNSET
else: else:
start = _start # type: ignore[arg-type] start = _start
annotation_line_end_options = cls( annotation_line_end_options = cls(
end=end, end=end,

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, List, Type, TypeVar, Union from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr import attr
@ -8,11 +8,13 @@ from ..models.color import Color
from ..models.point3d import Point3d from ..models.point3d import Point3d
from ..types import UNSET, Unset from ..types import UNSET, Unset
UZ = TypeVar("UZ", bound="AnnotationOptions") QP = TypeVar("QP", bound="AnnotationOptions")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class AnnotationOptions: class AnnotationOptions:
"""Options for annotations""" # noqa: E501 """Options for annotations""" # noqa: E501
color: Union[Unset, Color] = UNSET color: Union[Unset, Color] = UNSET
line_ends: Union[Unset, AnnotationLineEndOptions] = UNSET line_ends: Union[Unset, AnnotationLineEndOptions] = UNSET
line_width: Union[Unset, float] = UNSET line_width: Union[Unset, float] = UNSET
@ -22,13 +24,17 @@ class AnnotationOptions:
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
color: Union[Unset, Color] = UNSET
if not isinstance(self.color, Unset): if not isinstance(self.color, Unset):
color = self.color color = self.color
line_ends: Union[Unset, AnnotationLineEndOptions] = UNSET
if not isinstance(self.line_ends, Unset): if not isinstance(self.line_ends, Unset):
line_ends = self.line_ends line_ends = self.line_ends
line_width = self.line_width line_width = self.line_width
position: Union[Unset, Point3d] = UNSET
if not isinstance(self.position, Unset): if not isinstance(self.position, Unset):
position = self.position position = self.position
text: Union[Unset, AnnotationTextOptions] = UNSET
if not isinstance(self.text, Unset): if not isinstance(self.text, Unset):
text = self.text text = self.text
@ -36,34 +42,44 @@ class AnnotationOptions:
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if color is not UNSET: if color is not UNSET:
field_dict['color'] = color _color: Color = cast(Color, color)
field_dict["color"] = _color.to_dict()
if line_ends is not UNSET: if line_ends is not UNSET:
field_dict['line_ends'] = line_ends _line_ends: AnnotationLineEndOptions = cast(
AnnotationLineEndOptions, line_ends
)
field_dict["line_ends"] = _line_ends.to_dict()
if line_width is not UNSET: if line_width is not UNSET:
field_dict['line_width'] = line_width field_dict["line_width"] = line_width
if position is not UNSET: if position is not UNSET:
field_dict['position'] = position _position: Point3d = cast(Point3d, position)
field_dict["position"] = _position.to_dict()
if text is not UNSET: if text is not UNSET:
field_dict['text'] = text _text: AnnotationTextOptions = cast(AnnotationTextOptions, text)
field_dict["text"] = _text.to_dict()
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[UZ], src_dict: Dict[str, Any]) -> UZ: def from_dict(cls: Type[QP], src_dict: Dict[str, Any]) -> QP:
d = src_dict.copy() d = src_dict.copy()
_color = d.pop("color", UNSET) _color = d.pop("color", UNSET)
color: Union[Unset, Color] color: Union[Unset, Color]
if isinstance(_color, Unset): if isinstance(_color, Unset):
color = UNSET color = UNSET
if _color is None:
color = UNSET
else: else:
color = _color # type: ignore[arg-type] color = Color.from_dict(_color)
_line_ends = d.pop("line_ends", UNSET) _line_ends = d.pop("line_ends", UNSET)
line_ends: Union[Unset, AnnotationLineEndOptions] line_ends: Union[Unset, AnnotationLineEndOptions]
if isinstance(_line_ends, Unset): if isinstance(_line_ends, Unset):
line_ends = UNSET line_ends = UNSET
if _line_ends is None:
line_ends = UNSET
else: else:
line_ends = _line_ends # type: ignore[arg-type] line_ends = AnnotationLineEndOptions.from_dict(_line_ends)
line_width = d.pop("line_width", UNSET) line_width = d.pop("line_width", UNSET)
@ -71,16 +87,19 @@ class AnnotationOptions:
position: Union[Unset, Point3d] position: Union[Unset, Point3d]
if isinstance(_position, Unset): if isinstance(_position, Unset):
position = UNSET position = UNSET
if _position is None:
position = UNSET
else: else:
position = _position # type: ignore[arg-type] position = Point3d.from_dict(_position)
_text = d.pop("text", UNSET) _text = d.pop("text", UNSET)
text: Union[Unset, AnnotationTextOptions] text: Union[Unset, AnnotationTextOptions]
if isinstance(_text, Unset): if isinstance(_text, Unset):
text = UNSET text = UNSET
if _text is None:
text = UNSET
else: else:
text = _text # type: ignore[arg-type] text = AnnotationTextOptions.from_dict(_text)
annotation_options = cls( annotation_options = cls(
color=color, color=color,

View File

@ -2,10 +2,11 @@ from enum import Enum
class AnnotationTextAlignmentX(str, Enum): class AnnotationTextAlignmentX(str, Enum):
""" Horizontal Text aligment """ # noqa: E501 """Horizontal Text alignment""" # noqa: E501
LEFT = 'left'
CENTER = 'center' LEFT = "left"
RIGHT = 'right' CENTER = "center"
RIGHT = "right"
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

Some files were not shown because too many files have changed in this diff Show More