Compare commits

...

29 Commits

Author SHA1 Message Date
12c164620b updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-09-29 16:05:40 -07:00
31cd9e532d bump version
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-09-29 15:52:28 -07:00
29b0200c4c Update api spec (#145)
* YOYO NEW API SPEC!

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-29 15:51:03 -07:00
ba3fb82a86 Bump pytest from 7.4.1 to 7.4.2 (#146)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.1 to 7.4.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.1...7.4.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-29 15:26:35 -07:00
4c10c47b4a Bump ruff from 0.0.286 to 0.0.291 (#151)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.286 to 0.0.291.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.0.286...v0.0.291)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-29 15:22:27 -07:00
2e279da9c1 Bump httpx from 0.24.0 to 0.25.0 (#147)
Bumps [httpx](https://github.com/encode/httpx) from 0.24.0 to 0.25.0.
- [Release notes](https://github.com/encode/httpx/releases)
- [Changelog](https://github.com/encode/httpx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/encode/httpx/compare/0.24.0...0.25.0)

---
updated-dependencies:
- dependency-name: httpx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-29 15:17:30 -07:00
12e5baef9e Bump types-toml from 0.10.8.6 to 0.10.8.7 (#144)
Bumps [types-toml](https://github.com/python/typeshed) from 0.10.8.6 to 0.10.8.7.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-toml
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-29 15:14:19 -07:00
0ef8f505ad Bump sphinx-autodoc-typehints from 1.19.1 to 1.24.0 (#141)
Bumps [sphinx-autodoc-typehints](https://github.com/tox-dev/sphinx-autodoc-typehints) from 1.19.1 to 1.24.0.
- [Release notes](https://github.com/tox-dev/sphinx-autodoc-typehints/releases)
- [Changelog](https://github.com/tox-dev/sphinx-autodoc-typehints/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tox-dev/sphinx-autodoc-typehints/compare/1.19.1...1.24.0)

---
updated-dependencies:
- dependency-name: sphinx-autodoc-typehints
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-29 15:09:19 -07:00
01a73859d4 Update api spec (#140)
* YOYO NEW API SPEC!

* bump version

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* I have generated the latest API!

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-06 11:27:00 -07:00
f63509a1eb Bump pytest from 7.3.1 to 7.4.1 (#138)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.1 to 7.4.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.3.1...7.4.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 11:04:43 -07:00
7cb8d5327f Bump jsonpatch from 1.32 to 1.33 (#137)
Bumps [jsonpatch](https://github.com/stefankoegl/python-json-patch) from 1.32 to 1.33.
- [Commits](https://github.com/stefankoegl/python-json-patch/compare/v1.32...v1.33)

---
updated-dependencies:
- dependency-name: jsonpatch
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 11:01:18 -07:00
1f9a787c15 Bump types-python-dateutil from 2.8.19.12 to 2.8.19.14 (#134)
Bumps [types-python-dateutil](https://github.com/python/typeshed) from 2.8.19.12 to 2.8.19.14.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-python-dateutil
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 10:58:42 -07:00
3e2c9450dc Bump pytest-cov from 4.0.0 to 4.1.0 (#136)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 4.0.0 to 4.1.0.
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 10:51:02 -07:00
eb8d1b77bb Bump actions/checkout from 3 to 4 (#139)
* Bump actions/checkout from 3 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* I have generated the latest API!

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-06 10:47:43 -07:00
d5184bf172 Bump pytest-asyncio from 0.21.0 to 0.21.1 (#133)
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.21.0 to 0.21.1.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.21.0...v0.21.1)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 10:47:22 -07:00
3cad86c5a3 updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-08-30 18:39:19 -07:00
63824cd04f Update api spec (#132)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-30 18:30:23 -07:00
816904419e Bump tornado from 6.3.1 to 6.3.3 (#130)
Bumps [tornado](https://github.com/tornadoweb/tornado) from 6.3.1 to 6.3.3.
- [Changelog](https://github.com/tornadoweb/tornado/blob/master/docs/releases.rst)
- [Commits](https://github.com/tornadoweb/tornado/compare/v6.3.1...v6.3.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 18:30:12 -07:00
e68857f4c9 Bump certifi from 2022.12.7 to 2023.7.22 (#131)
Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.12.7 to 2023.7.22.
- [Commits](https://github.com/certifi/python-certifi/compare/2022.12.07...2023.07.22)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 18:30:00 -07:00
db1bd33c79 fixes
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-08-30 16:59:35 -07:00
dea0d637fe fixes
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-08-30 16:24:09 -07:00
2e1c75769f updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-08-30 16:18:39 -07:00
8162fa1964 Update api spec (#127)
* YOYO NEW API SPEC!

* bump version

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* some fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes #128

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mypy fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-30 15:59:51 -07:00
d737fb4e8f Update ruff requirement from ^0.0.284 to ^0.0.286 (#129)
Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.0.284...v0.0.286)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 12:24:05 -07:00
686ec0cb36 bump versino
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-08-17 14:39:54 -07:00
f522911d7b Update api spec (#125)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-17 14:30:53 -07:00
1e693890ef fix
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-08-17 14:13:56 -07:00
755a4fd789 Revert "fixes"
This reverts commit 581c06a943.
2023-08-17 14:02:51 -07:00
581c06a943 fixes
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-08-17 14:01:41 -07:00
318 changed files with 32970 additions and 22050 deletions

View File

@ -15,7 +15,7 @@ jobs:
black: black:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4

View File

@ -22,7 +22,7 @@ jobs:
python-version: [3.8, 3.9] python-version: [3.8, 3.9]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:

View File

@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:

View File

@ -16,7 +16,7 @@ jobs:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
ref: ${{ github.event.pull_request.head.ref }} ref: ${{ github.event.pull_request.head.ref }}
- name: Run generate - name: Run generate

View File

@ -8,7 +8,7 @@ jobs:
name: make-release name: make-release
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
with: with:
python-version: '3.x' python-version: '3.x'

View File

@ -15,7 +15,7 @@ jobs:
mypy: mypy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4

View File

@ -15,7 +15,7 @@ jobs:
ruff: ruff:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4

View File

@ -15,7 +15,7 @@ jobs:
name: update-spec name: update-spec
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: make generate - name: make generate
shell: bash shell: bash
run: | run: |
@ -34,7 +34,7 @@ jobs:
echo "No files changed, proceeding"; echo "No files changed, proceeding";
fi fi
# Checkout the docs repo since we will want to update the files there. # Checkout the docs repo since we will want to update the files there.
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
repository: 'kittycad/website' repository: 'kittycad/website'
path: 'docs' path: 'docs'

1
.gitignore vendored
View File

@ -22,7 +22,6 @@ dmypy.json
/coverage.xml /coverage.xml
/.coverage /.coverage
poetry.lock
testing testing
# Sphinx documentation # Sphinx documentation

1939
assets/ORIGINALVOXEL-3.obj Normal file

File diff suppressed because it is too large Load Diff

View File

@ -61,10 +61,19 @@ client = ClientFromEnv()
# Create the json patch document. # Create the json patch document.
patch = jsonpatch.make_patch(original, data) patch = jsonpatch.make_patch(original, data)
# Convert this to a dict.
patch = json.loads(patch.to_string())
new_patch = []
# Make sure we aren't changing any components/schemas.
for index, p in enumerate(patch):
if not p["path"].startswith("/components"):
new_patch.append(p)
# Rewrite the spec back out. # Rewrite the spec back out.
patch_file = os.path.join(cwd, "kittycad.py.patch.json") patch_file = os.path.join(cwd, "kittycad.py.patch.json")
f = open(patch_file, "w") f = open(patch_file, "w")
f.write(patch.to_string()) f.write(json.dumps(new_patch, indent=2))
f.close() f.close()
# Write all the examples to a file. # Write all the examples to a file.
@ -379,9 +388,6 @@ def generatePath(path: str, name: str, method: str, endpoint: dict, data: dict)
else: else:
success_type = endpoint_refs[0] success_type = endpoint_refs[0]
if fn_name == "get_file_conversion" or fn_name == "create_file_conversion":
fn_name += "_with_base64_helper"
example_imports = ( example_imports = (
""" """
from kittycad.client import ClientFromEnv from kittycad.client import ClientFromEnv
@ -394,15 +400,6 @@ from kittycad.types import Response
""" """
) )
if fn_name.endswith("_with_base64_helper"):
example_imports += (
"""from kittycad.api."""
+ tag_name
+ """ import """
+ fn_name.replace("_with_base64_helper", "")
+ "\n"
)
# Iterate over the parameters. # Iterate over the parameters.
params_str = "" params_str = ""
if "parameters" in endpoint: if "parameters" in endpoint:
@ -475,15 +472,6 @@ from kittycad.types import Response
example_imports + "from typing import Union, Any, Optional, List, Tuple\n" example_imports + "from typing import Union, Any, Optional, List, Tuple\n"
) )
if fn_name.endswith("_with_base64_helper"):
example_variable = (
"result: "
+ response_type.replace(
"FileConversion", "Tuple[FileConversion, bytes]"
)
+ " = "
)
else:
example_variable = "result: " + response_type + " = " example_variable = "result: " + response_type + " = "
example_imports = example_imports + "from kittycad.types import Response\n" example_imports = example_imports + "from kittycad.types import Response\n"
@ -516,10 +504,6 @@ from kittycad.types import Response
and success_type != "" and success_type != ""
): ):
example_success_type = success_type example_success_type = success_type
if fn_name.endswith("_with_base64_helper"):
example_success_type = example_success_type.replace(
"FileConversion", "Tuple[FileConversion, bytes]"
)
short_sync_example = short_sync_example + ( short_sync_example = short_sync_example + (
""" """
@ -541,7 +525,7 @@ from kittycad.types import Response
# OR if you need more info (e.g. status_code) # OR if you need more info (e.g. status_code)
""" """
+ example_variable_response + example_variable_response
+ fn_name.replace("_with_base64_helper", "") + fn_name
+ """.sync_detailed(client=client,\n""" + """.sync_detailed(client=client,\n"""
+ params_str + params_str
+ """) + """)
@ -567,7 +551,7 @@ async def test_"""
""" """
+ example_variable_response + example_variable_response
+ "await " + "await "
+ fn_name.replace("_with_base64_helper", "") + fn_name
+ """.asyncio_detailed(client=client,\n""" + """.asyncio_detailed(client=client,\n"""
+ params_str + params_str
+ """)""" + """)"""
@ -963,6 +947,13 @@ def generateTypes(cwd: str, parser: dict):
generateType(path, key, schema, data) generateType(path, key, schema, data)
f.write("from ." + camel_to_snake(key) + " import " + key + "\n") f.write("from ." + camel_to_snake(key) + " import " + key + "\n")
# This is a hot fix for the empty type.
# We likely need a better way to handle this.
f.write("from .empty import Empty\n")
# Add the Base64Data type.
f.write("from .base64data import Base64Data\n")
# Close the file. # Close the file.
f.close() f.close()
@ -994,6 +985,8 @@ def generateType(path: str, name: str, schema: dict, data: dict):
return return
elif "oneOf" in schema: elif "oneOf" in schema:
generateOneOfType(file_path, name, schema, data) generateOneOfType(file_path, name, schema, data)
elif "anyOf" in schema:
generateAnyOfType(file_path, name, schema, data)
else: else:
logging.error("schema: ", [schema]) logging.error("schema: ", [schema])
logging.error("unsupported type: ", name) logging.error("unsupported type: ", name)
@ -1099,6 +1092,123 @@ def generateEnumTypeCode(
return value return value
def generateAnyOfType(path: str, name: str, schema: dict, data: dict):
logging.info("generating type: ", name, " at: ", path)
if isEnumWithDocsOneOf(schema):
additional_docs = []
enum = []
# We want to treat this as an enum with additional docs.
for any_of in schema["anyOf"]:
enum.append(any_of["enum"][0])
if "description" in any_of:
additional_docs.append(any_of["description"])
else:
additional_docs.append("")
# Write the enum.
schema["enum"] = enum
schema["type"] = "string"
generateEnumType(path, name, schema, "string", additional_docs)
# return early.
return
# Open our file.
f = open(path, "w")
# Import the refs if there are any.
all_options = []
for any_of in schema["anyOf"]:
if "allOf" in any_of:
for all_of in any_of["allOf"]:
if "$ref" in all_of:
ref = all_of["$ref"]
ref_name = ref[ref.rfind("/") + 1 :]
f.write(
"from ."
+ camel_to_snake(ref_name)
+ " import "
+ ref_name
+ "\n"
)
all_options.append(ref_name)
if "$ref" in any_of:
ref = any_of["$ref"]
ref_name = ref[ref.rfind("/") + 1 :]
f.write("from ." + camel_to_snake(ref_name) + " import " + ref_name + "\n")
all_options.append(ref_name)
if isNestedObjectOneOf(schema):
# We want to write each of the nested objects.
for any_of in schema["anyOf"]:
# Get the nested object.
if "properties" in any_of:
for prop_name in any_of["properties"]:
nested_object = any_of["properties"][prop_name]
if nested_object == {}:
f.write("from typing import Any\n")
f.write(prop_name + " = Any\n")
f.write("\n")
all_options.append(prop_name)
elif "$ref" in nested_object:
ref = nested_object["$ref"]
ref_name = ref[ref.rfind("/") + 1 :]
f.write(
"from ."
+ camel_to_snake(ref_name)
+ " import "
+ ref_name
+ "\n"
)
f.write("\n")
if prop_name != ref_name:
f.write(prop_name + " = " + ref_name + "\n")
f.write("\n")
all_options.append(prop_name)
else:
object_code = generateObjectTypeCode(
prop_name, nested_object, "object", data, None
)
f.write(object_code)
f.write("\n")
all_options.append(prop_name)
elif "type" in any_of and any_of["type"] == "string":
enum_code = generateEnumTypeCode(
any_of["enum"][0], any_of, "string", []
)
f.write(enum_code)
f.write("\n")
all_options.append(any_of["enum"][0])
# Check if each any_of has the same enum of one.
tag = getTagAnyOf(schema)
if tag is not None:
# Generate each of the options from the tag.
for any_of in schema["anyOf"]:
# Get the value of the tag.
object_name = any_of["properties"][tag]["enum"][0]
object_code = generateObjectTypeCode(
object_name, any_of, "object", data, tag
)
f.write(object_code)
f.write("\n")
all_options.append(object_name)
# Write the sum type.
f.write("from typing import Union\n")
f.write(name + " = Union[")
for num, option in enumerate(all_options, start=0):
if num == 0:
f.write(option)
else:
f.write(", " + option + "")
f.write("]\n")
# Close the file.
f.close()
def generateOneOfType(path: str, name: str, schema: dict, data: dict): def generateOneOfType(path: str, name: str, schema: dict, data: dict):
logging.info("generating type: ", name, " at: ", path) logging.info("generating type: ", name, " at: ", path)
@ -1219,8 +1329,11 @@ def generateObjectTypeCode(
f = io.StringIO() f = io.StringIO()
has_date_time = hasDateTime(schema) has_date_time = hasDateTime(schema)
has_base_64 = hasBase64(schema)
if has_date_time: if has_date_time:
f.write("import datetime\n") f.write("import datetime\n")
if has_base_64:
f.write("from ..models.base64data import Base64Data\n")
f.write( f.write(
"from typing import Any, Dict, List, Type, TypeVar, Union, cast, deprecated\n" "from typing import Any, Dict, List, Type, TypeVar, Union, cast, deprecated\n"
) )
@ -1407,6 +1520,22 @@ def renderTypeToDict(f, property_name: str, property_schema: dict, data: dict):
) )
# return early # return early
return return
elif property_schema["format"] == "byte":
f.write("\t\t" + property_name + ": Union[Unset, str] = UNSET\n")
f.write(
"\t\tif not isinstance(self."
+ clean_parameter_name(property_name)
+ ", Unset):\n"
)
f.write(
"\t\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ ".get_encoded()\n"
)
# return early
return
f.write( f.write(
"\t\t" "\t\t"
@ -1439,6 +1568,79 @@ def renderTypeToDict(f, property_name: str, property_schema: dict, data: dict):
+ clean_parameter_name(property_name) + clean_parameter_name(property_name)
+ "\n" + "\n"
) )
elif "additionalProperties" in property_schema and property_type == "object":
if "$ref" in property_schema["additionalProperties"]:
ref = property_schema["additionalProperties"]["$ref"].replace(
"#/components/schemas/", ""
)
f.write(
"\t\t" + property_name + ": Union[Unset, Dict[str, Any]] = UNSET\n"
)
f.write(
"\t\tif not isinstance(self."
+ clean_parameter_name(property_name)
+ ", Unset):\n"
)
f.write("\t\t\tnew_dict: Dict[str, Any] = {}\n")
f.write(
"\t\t\tfor key, value in self."
+ clean_parameter_name(property_name)
+ ".items():\n"
)
f.write("\t\t\t\tnew_dict[key] = value.to_dict()\n")
f.write(
"\t\t\t" + clean_parameter_name(property_name) + " = new_dict\n"
)
elif (
"type" in property_schema["additionalProperties"]
and property_schema["additionalProperties"]["type"] == "integer"
):
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ "\n"
)
f.write("\n")
elif (
"format" in property_schema["additionalProperties"]
and property_schema["additionalProperties"]["format"] == "byte"
):
f.write(
"\t\t" + property_name + ": Union[Unset, Dict[str, str]] = UNSET\n"
)
f.write(
"\t\tif not isinstance(self."
+ clean_parameter_name(property_name)
+ ", Unset):\n"
)
f.write("\t\t\tnew_dict: Dict[str, str] = {}\n")
f.write(
"\t\t\tfor key, value in self."
+ clean_parameter_name(property_name)
+ ".items():\n"
)
f.write("\t\t\t\tnew_dict[key] = value.get_encoded()\n")
f.write(
"\t\t\t" + clean_parameter_name(property_name) + " = new_dict\n"
)
elif (
"type" in property_schema["additionalProperties"]
and property_schema["additionalProperties"]["type"] == "string"
):
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ " = self."
+ clean_parameter_name(property_name)
+ "\n"
)
f.write("\n")
else:
# Throw an error.
print("property: ", property_schema)
raise Exception("Unknown property type")
elif property_type == "array": elif property_type == "array":
if "items" in property_schema: if "items" in property_schema:
if "$ref" in property_schema["items"]: if "$ref" in property_schema["items"]:
@ -1573,9 +1775,59 @@ def renderTypeInit(f, property_name: str, property_schema: dict, data: dict):
) )
# Return early. # Return early.
return return
elif property_schema["format"] == "byte":
f.write(
"\t" + property_name + ": Union[Unset, Base64Data] = UNSET\n"
)
# Return early.
return
f.write("\t" + property_name + ": Union[Unset, str] = UNSET\n") f.write("\t" + property_name + ": Union[Unset, str] = UNSET\n")
elif "additionalProperties" in property_schema and property_type == "object":
if "$ref" in property_schema["additionalProperties"]:
ref = property_schema["additionalProperties"]["$ref"].replace(
"#/components/schemas/", ""
)
# Make sure we import the model.
f.write(
"\tfrom ..models." + camel_to_snake(ref) + " import " + ref + "\n"
)
f.write(
"\t"
+ property_name
+ ": Union[Unset, Dict[str, "
+ ref
+ "]] = UNSET\n"
)
elif (
"type" in property_schema["additionalProperties"]
and property_schema["additionalProperties"]["type"] == "integer"
):
f.write(
"\t" + property_name + ": Union[Unset, Dict[str, int]] = UNSET\n"
)
elif (
"format" in property_schema["additionalProperties"]
and property_schema["additionalProperties"]["format"] == "byte"
):
f.write(
"\t"
+ property_name
+ ": Union[Unset, Dict[str, Base64Data]] = UNSET\n"
)
elif (
"type" in property_schema["additionalProperties"]
and property_schema["additionalProperties"]["type"] == "string"
):
f.write(
"\t" + property_name + ": Union[Unset, Dict[str, str]] = UNSET\n"
)
else:
# Throw an error.
print("property: ", property_schema)
raise Exception("Unknown property type")
elif property_type == "object": elif property_type == "object":
# TODO: we need to get the name of the object
f.write("\t" + property_name + ": Union[Unset, Any] = UNSET\n") f.write("\t" + property_name + ": Union[Unset, Any] = UNSET\n")
elif property_type == "integer": elif property_type == "integer":
f.write("\t" + property_name + ": Union[Unset, int] = UNSET\n") f.write("\t" + property_name + ": Union[Unset, int] = UNSET\n")
@ -1694,6 +1946,38 @@ def renderTypeFromDict(f, property_name: str, property_schema: dict, data: dict)
f.write("\n") f.write("\n")
# Return early. # Return early.
return return
elif property_schema["format"] == "byte":
f.write(
"\t\t_"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ ": Union[Unset, Base64Data]\n"
)
f.write(
"\t\tif isinstance(_"
+ clean_parameter_name(property_name)
+ ", Unset):\n"
)
f.write(
"\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n"
)
f.write("\t\telse:\n")
f.write(
"\t\t\t"
+ clean_parameter_name(property_name)
+ " = Base64Data(bytes(_"
+ clean_parameter_name(property_name)
+ ", 'utf-8'))\n"
)
f.write("\n")
# Return early.
return
f.write( f.write(
"\t\t" "\t\t"
@ -1730,6 +2014,90 @@ def renderTypeFromDict(f, property_name: str, property_schema: dict, data: dict)
+ '", UNSET)\n' + '", UNSET)\n'
) )
f.write("\n") f.write("\n")
elif "additionalProperties" in property_schema and property_type == "object":
if "$ref" in property_schema["additionalProperties"]:
ref = property_schema["additionalProperties"]["$ref"].replace(
"#/components/schemas/", ""
)
f.write(
"\t\t_"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
f.write(
"\t\tif isinstance(_"
+ clean_parameter_name(property_name)
+ ", Unset):\n"
)
f.write("\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n")
f.write("\t\telse:\n")
f.write(
"\t\t\tnew_map: Dict[str, "
+ ref
+ "] = {}\n\t\t\tfor k, v in _"
+ clean_parameter_name(property_name)
+ ".items():\n\t\t\t\tnew_map[k] = "
+ ref
+ ".from_dict(v) # type: ignore\n\t\t\t"
+ clean_parameter_name(property_name)
+ " = new_map # type: ignore\n"
)
f.write("\n")
elif (
"type" in property_schema["additionalProperties"]
and property_schema["additionalProperties"]["type"] == "integer"
):
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
f.write("\n")
elif (
"format" in property_schema["additionalProperties"]
and property_schema["additionalProperties"]["format"] == "byte"
):
f.write(
"\t\t_"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
f.write(
"\t\tif isinstance(_"
+ clean_parameter_name(property_name)
+ ", Unset):\n"
)
f.write("\t\t\t" + clean_parameter_name(property_name) + " = UNSET\n")
f.write(
"\t\telse:\n\t\t\tnew_map: Dict[str, Base64Data] = {}\n\t\t\tfor k, v in _"
+ clean_parameter_name(property_name)
+ ".items():\n\t\t\t\tnew_map[k] = Base64Data(bytes(v, 'utf-8'))\n\t\t\t"
+ clean_parameter_name(property_name)
+ " = new_map # type: ignore\n"
)
f.write("\n")
elif (
"type" in property_schema["additionalProperties"]
and property_schema["additionalProperties"]["type"] == "string"
):
f.write(
"\t\t"
+ clean_parameter_name(property_name)
+ ' = d.pop("'
+ property_name
+ '", UNSET)\n'
)
f.write("\n")
else:
# Throw an error.
print("property: ", property_schema)
raise Exception("Unknown property type")
elif property_type == "array": elif property_type == "array":
if "items" in property_schema: if "items" in property_schema:
if "$ref" in property_schema["items"]: if "$ref" in property_schema["items"]:
@ -1861,6 +2229,27 @@ def hasDateTime(schema: dict) -> bool:
return False return False
def hasBase64(schema: dict) -> bool:
# Generate the type.
if "type" in schema:
type_name = schema["type"]
if type_name == "object":
if "additionalProperties" in schema:
return hasBase64(schema["additionalProperties"])
# Iternate over the properties.
if "properties" in schema:
for property_name in schema["properties"]:
property_schema = schema["properties"][property_name]
has_base64 = hasBase64(property_schema)
if has_base64:
return True
elif type_name == "string" and "format" in schema:
if schema["format"] == "byte":
return True
return False
def getRefs(schema: dict) -> List[str]: def getRefs(schema: dict) -> List[str]:
refs = [] refs = []
if "$ref" in schema: if "$ref" in schema:
@ -1888,6 +2277,9 @@ def getRefs(schema: dict) -> List[str]:
for ref in schema_refs: for ref in schema_refs:
if ref not in refs: if ref not in refs:
refs.append(ref) refs.append(ref)
elif schema == {"type": "object"}:
# do nothing
pass
else: else:
logging.error("unsupported type: ", schema) logging.error("unsupported type: ", schema)
raise Exception("unsupported type: ", schema) raise Exception("unsupported type: ", schema)
@ -2074,7 +2466,7 @@ def camel_to_screaming_snake(name: str):
# Change `file_conversion` to `FileConversion` # Change `file_conversion` to `FileConversion`
def snake_to_title(name: str): def snake_to_title(name: str):
return name.title().replace("_", "") return name.title().replace("_", "").replace("3D", "3d")
def get_function_parameters( def get_function_parameters(
@ -2145,6 +2537,34 @@ def isNestedObjectOneOf(schema: dict) -> bool:
return is_nested_object return is_nested_object
def getTagAnyOf(schema: dict) -> Optional[str]:
tag = None
for any_of in schema["anyOf"]:
has_tag = False
# Check if each are an object w 1 property in it.
if "type" in any_of and any_of["type"] == "object" and "properties" in any_of:
for prop_name in any_of["properties"]:
prop = any_of["properties"][prop_name]
if (
"type" in prop
and prop["type"] == "string"
and "enum" in prop
and len(prop["enum"]) == 1
):
if tag is not None and tag != prop_name:
has_tag = False
break
else:
has_tag = True
tag = prop_name
if has_tag is False:
tag = None
break
return tag
def getTagOneOf(schema: dict) -> Optional[str]: def getTagOneOf(schema: dict) -> Optional[str]:
tag = None tag = None
for one_of in schema["oneOf"]: for one_of in schema["oneOf"]:

View File

@ -5,10 +5,14 @@ set -o pipefail
# Fix for ci. # Fix for ci.
git config --global --add safe.directory /home/user/src git config --global --add safe.directory /home/user/src
git add kittycad/models/base64data.py
git add kittycad/models/empty.py
# Cleanup old stuff. # Cleanup old stuff.
rm -rf kittycad/models rm -rf kittycad/models
rm -rf kittycad/api rm -rf kittycad/api
git checkout kittycad/api/file/*_with_base64_helper.py &>/dev/null git checkout kittycad/models/base64data.py
git checkout kittycad/models/empty.py
# Generate new. # Generate new.
poetry run python generate/generate.py poetry run python generate/generate.py
@ -17,7 +21,7 @@ poetry run python generate/generate.py
poetry run isort . poetry run isort .
poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py
poetry run ruff check --fix . poetry run ruff check --fix .
poetry run mypy . poetry run mypy . || true
# Run the tests. # Run the tests.

File diff suppressed because one or more lines are too long

View File

@ -11,17 +11,38 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
input_format: ImageType, input_format: ImageType,
output_format: FileExportFormat, output_format: FileExportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/ai/image-to-3d/{input_format}/{output_format}".format( url = "{}/ai/image-to-3d/{input_format}/{output_format}".format(client.base_url, input_format=input_format,output_format=output_format,) # noqa: E501
client.base_url,
input_format=input_format,
output_format=output_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()
@ -48,6 +69,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Mesh, 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[Mesh, Error]]]: ) -> Response[Optional[Union[Mesh, Error]]]:
@ -60,16 +82,37 @@ def _build_response(
def sync_detailed( def sync_detailed(
input_format: ImageType, input_format: ImageType,
output_format: FileExportFormat, output_format: FileExportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Mesh, Error]]]: ) -> Response[Optional[Union[Mesh, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_format=input_format, input_format=input_format,
output_format=output_format, output_format=output_format,
body=body, body=body,
client=client, client=client,
) )
@ -82,33 +125,75 @@ def sync_detailed(
def sync( def sync(
input_format: ImageType, input_format: ImageType,
output_format: FileExportFormat, output_format: FileExportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[Mesh, Error]] : ) -> Optional[Union[Mesh, Error]] :
"""This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501 """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( return sync_detailed(
input_format=input_format, input_format=input_format,
output_format=output_format, output_format=output_format,
body=body, body=body,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
input_format: ImageType, input_format: ImageType,
output_format: FileExportFormat, output_format: FileExportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Mesh, Error]]]: ) -> Response[Optional[Union[Mesh, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
input_format=input_format, input_format=input_format,
output_format=output_format, output_format=output_format,
body=body, body=body,
client=client, client=client,
) )
@ -119,19 +204,40 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
input_format: ImageType, input_format: ImageType,
output_format: FileExportFormat, output_format: FileExportFormat,
body: bytes, body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[Mesh, Error]] : ) -> Optional[Union[Mesh, Error]] :
"""This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501 """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 ( return (
await asyncio_detailed( await asyncio_detailed(
input_format=input_format, input_format=input_format,
output_format=output_format, output_format=output_format,
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,15 +10,27 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
output_format: FileExportFormat, output_format: FileExportFormat,
prompt: str, prompt: str,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/ai/text-to-3d/{output_format}".format( url = "{}/ai/text-to-3d/{output_format}".format(client.base_url, output_format=output_format,) # noqa: E501
client.base_url,
output_format=output_format,
) # noqa: E501
if prompt is not None: if prompt is not None:
if "?" in url: if "?" in url:
@ -26,6 +38,9 @@ def _get_kwargs(
else: else:
url = url + "?prompt=" + str(prompt) url = url + "?prompt=" + str(prompt)
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,6 +49,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -50,6 +66,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Mesh, 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[Mesh, Error]]]: ) -> Response[Optional[Union[Mesh, Error]]]:
@ -62,14 +79,29 @@ def _build_response(
def sync_detailed( def sync_detailed(
output_format: FileExportFormat, output_format: FileExportFormat,
prompt: str, prompt: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Mesh, Error]]]: ) -> Response[Optional[Union[Mesh, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
output_format=output_format, output_format=output_format,
prompt=prompt, prompt=prompt,
client=client, client=client,
) )
@ -82,29 +114,59 @@ def sync_detailed(
def sync( def sync(
output_format: FileExportFormat, output_format: FileExportFormat,
prompt: str, prompt: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[Mesh, Error]] : ) -> Optional[Union[Mesh, Error]] :
"""This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501 """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( return sync_detailed(
output_format=output_format, output_format=output_format,
prompt=prompt, prompt=prompt,
client=client, client=client,
).parsed ).parsed
async def asyncio_detailed( async def asyncio_detailed(
output_format: FileExportFormat, output_format: FileExportFormat,
prompt: str, prompt: str,
*, *,
client: Client, client: Client,
) -> Response[Optional[Union[Mesh, Error]]]: ) -> Response[Optional[Union[Mesh, Error]]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
output_format=output_format, output_format=output_format,
prompt=prompt, prompt=prompt,
client=client, client=client,
) )
@ -115,17 +177,32 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
output_format: FileExportFormat, output_format: FileExportFormat,
prompt: str, prompt: str,
*, *,
client: Client, client: Client,
) -> Optional[Union[Mesh, Error]] : ) -> Optional[Union[Mesh, Error]] :
"""This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501 """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 ( return (
await asyncio_detailed( await asyncio_detailed(
output_format=output_format, output_format=output_format,
prompt=prompt, prompt=prompt,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,22 @@ 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( url = "{}/api-calls/{id}".format(client.base_url, id=id,) # noqa: E501
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()
@ -26,12 +34,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPrice, Error]] :
*, 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
@ -44,6 +51,7 @@ def _parse_response(
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]]]:
@ -56,12 +64,21 @@ 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,
) )
@ -74,27 +91,45 @@ 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,
) )
@ -105,9 +140,16 @@ 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.
@ -115,7 +157,9 @@ async def asyncio(
return ( return (
await asyncio_detailed( await asyncio_detailed(
id=id, id=id,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,22 @@ 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( url = "{}/user/api-calls/{id}".format(client.base_url, id=id,) # noqa: E501
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()
@ -26,12 +34,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPrice, Error]] :
*, 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
@ -44,6 +51,7 @@ def _parse_response(
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]]]:
@ -56,12 +64,21 @@ 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,
) )
@ -74,25 +91,43 @@ 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,
) )
@ -103,15 +138,24 @@ 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,13 +10,19 @@ 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( url = "{}/api-call-metrics".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if group_by is not None: if group_by is not None:
if "?" in url: if "?" in url:
@ -24,6 +30,9 @@ 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()
@ -32,14 +41,16 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[List[ApiCallQueryGroup], Error]] :
*, response: httpx.Response
) -> Optional[Union[List[ApiCallQueryGroup], Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = [ApiCallQueryGroup.from_dict(item) for item in response.json()] response_200 = [
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())
@ -50,6 +61,7 @@ def _parse_response(
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]]]:
@ -62,12 +74,21 @@ 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,
) )
@ -80,25 +101,43 @@ 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,
) )
@ -109,15 +148,24 @@ 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

@ -14,14 +14,22 @@ 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( url = "{}/async/operations/{id}".format(client.base_url, id=id,) # noqa: E501
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()
@ -31,22 +39,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]] :
*, response: httpx.Response
) -> Optional[
Union[
FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
Error,
]
]:
if response.status_code == 200: if response.status_code == 200:
data = response.json() data = response.json()
try: try:
@ -112,21 +109,10 @@ def _parse_response(
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[ ) -> Response[Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]]:
Optional[
Union[
FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
Error,
]
]
]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
@ -136,24 +122,21 @@ def _build_response(
def sync_detailed( def sync_detailed(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Response[
Optional[
Union[
FileConversion, ) -> Response[Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]]:
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
Error,
]
]
]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -166,51 +149,46 @@ def sync_detailed(
def sync( def sync(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[
Union[
FileConversion,
FileCenterOfMass, ) -> Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]] :
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
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. Only KittyCAD employees with the proper access can view async operations for other users.""" # noqa: E501
""" # 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[
FileConversion, ) -> Response[Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]]:
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
Error,
]
]
]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
id=id, id=id,
client=client, client=client,
) )
@ -221,29 +199,27 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
id: str, id: str,
*, *,
client: Client, client: Client,
) -> Optional[
Union[
FileConversion,
FileCenterOfMass, ) -> Optional[Union[FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]] :
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
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. Only KittyCAD employees with the proper access can view async operations for other users.""" # noqa: E501
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
id=id, id=id,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -10,15 +10,31 @@ 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( url = "{}/api-calls".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -26,18 +42,25 @@ 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()
@ -46,12 +69,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPriceResultsPage, Error]] :
*, 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
@ -64,6 +86,7 @@ def _parse_response(
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]]]:
@ -76,16 +99,37 @@ 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,
) )
@ -98,33 +142,75 @@ 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,
) )
@ -135,19 +221,40 @@ 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,17 +10,39 @@ 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( url = "{}/users/{id}/api-calls".format(client.base_url, id=id,) # noqa: E501
client.base_url,
id=id,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -28,18 +50,25 @@ 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()
@ -48,12 +77,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPriceResultsPage, Error]] :
*, 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
@ -66,6 +94,7 @@ def _parse_response(
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]]]:
@ -78,18 +107,45 @@ 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,
) )
@ -102,41 +158,94 @@ 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. The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501
""" # 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,
) )
@ -147,25 +256,51 @@ 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. The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501
""" # 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,16 +11,37 @@ 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( url = "{}/async/operations".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -28,24 +49,33 @@ 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()
@ -54,12 +84,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[AsyncApiCallResultsPage, Error]] :
*, 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
@ -72,6 +101,7 @@ def _parse_response(
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]]]:
@ -84,18 +114,45 @@ 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,
) )
@ -108,38 +165,92 @@ 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,
) )
@ -150,22 +261,49 @@ 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,15 +10,31 @@ 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( url = "{}/user/api-calls".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -26,18 +42,25 @@ 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()
@ -46,12 +69,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPriceResultsPage, Error]] :
*, 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
@ -64,6 +86,7 @@ def _parse_response(
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]]]:
@ -76,16 +99,37 @@ 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,
) )
@ -98,35 +142,76 @@ 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. The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501
""" # 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,
) )
@ -137,21 +222,41 @@ 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. The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501
""" # 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,12 +9,14 @@ 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( url = "{}/user/api-tokens".format(client.base_url, ) # noqa: E501
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()
@ -24,6 +26,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -40,6 +43,7 @@ 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]]]:
@ -52,10 +56,13 @@ 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,
) )
@ -68,21 +75,27 @@ 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,
) )
@ -93,13 +106,16 @@ 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,14 +8,22 @@ 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( url = "{}/user/api-tokens/{token}".format(client.base_url, token=token,) # noqa: E501
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()
@ -25,6 +33,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -39,7 +48,10 @@ 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,
@ -49,12 +61,21 @@ def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
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,
) )
@ -67,27 +88,44 @@ 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. 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
""" # 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,
) )
@ -98,17 +136,25 @@ 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. 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
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
token=token, token=token,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,22 @@ 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( url = "{}/user/api-tokens/{token}".format(client.base_url, token=token,) # noqa: E501
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()
@ -26,6 +34,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -42,6 +51,7 @@ 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]]]:
@ -54,12 +64,21 @@ 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,
) )
@ -72,25 +91,43 @@ 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,
) )
@ -101,15 +138,24 @@ 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,15 +10,31 @@ 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( url = "{}/user/api-tokens".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -26,18 +42,25 @@ 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()
@ -46,12 +69,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiTokenResultsPage, Error]] :
*, 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
@ -64,6 +86,7 @@ def _parse_response(
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]]]:
@ -76,16 +99,37 @@ 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,
) )
@ -98,35 +142,76 @@ 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. The API tokens are returned in order of creation, with the most recently created API tokens first.""" # noqa: E501
""" # 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,
) )
@ -137,21 +222,41 @@ 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. The API tokens are returned in order of creation, with the most recently created API tokens first.""" # noqa: E501
""" # 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,12 +8,14 @@ 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( url = "{}/apps/github/callback".format(client.base_url, ) # noqa: E501
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()
@ -23,6 +25,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -37,7 +40,10 @@ 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,
@ -47,10 +53,13 @@ def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
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,
) )
@ -63,23 +72,28 @@ 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. The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501
""" # 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,
) )
@ -90,15 +104,17 @@ 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. The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

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

View File

@ -8,13 +8,22 @@ 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( url = "{}/apps/github/webhook".format(client.base_url, ) # noqa: E501
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 +48,10 @@ 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,
@ -49,12 +61,21 @@ def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
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,
) )
@ -67,25 +88,43 @@ 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,
) )
@ -96,15 +135,24 @@ 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

@ -8,11 +8,15 @@ 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()
@ -21,42 +25,45 @@ 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( with ws_connect(kwargs["url"].replace("https://", "wss://"), additional_headers=kwargs["headers"]) as websocket:
kwargs["url"].replace("https://", "wss://"),
additional_headers=kwargs["headers"],
) as websocket:
return websocket # type: ignore return websocket # type: ignore
# Return an error if we got here. # Return an error if we got here.
return Error(message="An error occurred while connecting to the websocket.") 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( async with ws_connect_async(kwargs["url"].replace("https://", "wss://"), extra_headers=kwargs["headers"]) as websocket:
kwargs["url"].replace("https://", "wss://"), extra_headers=kwargs["headers"]
) as websocket:
return websocket return websocket
# Return an error if we got here. # Return an error if we got here.

View File

@ -10,16 +10,33 @@ 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( url = "{}/file/execute/{lang}".format(client.base_url, lang=lang,) # noqa: E501
client.base_url,
lang=lang,
) # noqa: E501
if output is not None: if output is not None:
if "?" in url: if "?" in url:
@ -27,6 +44,11 @@ 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()
@ -52,6 +74,7 @@ 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]]]:
@ -64,16 +87,37 @@ 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,
) )
@ -86,31 +130,75 @@ 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,
) )
@ -121,17 +209,40 @@ 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,15 +11,31 @@ 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( url = "{}/file/center-of-mass".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if output_unit is not None: if output_unit is not None:
if "?" in url: if "?" in url:
@ -27,12 +43,19 @@ 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()
@ -45,9 +68,7 @@ def _get_kwargs(
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[FileCenterOfMass, Error]] :
*, 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
@ -60,6 +81,7 @@ def _parse_response(
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]]]:
@ -72,16 +94,37 @@ 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,
) )
@ -94,38 +137,79 @@ 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 co-ordinate 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. 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
""" # 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,
) )
@ -136,24 +220,44 @@ 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 co-ordinate 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. 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
""" # 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,17 +11,38 @@ 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( url = "{}/file/conversion/{src_format}/{output_format}".format(client.base_url, output_format=output_format,src_format=src_format,) # noqa: E501
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()
@ -35,9 +56,7 @@ def _get_kwargs(
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[FileConversion, Error]] :
*, 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
@ -50,6 +69,7 @@ def _parse_response(
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]]]:
@ -62,16 +82,37 @@ 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,
) )
@ -84,37 +125,78 @@ 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. 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
""" # 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,
) )
@ -125,23 +207,43 @@ 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. 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
""" # 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

@ -1,58 +0,0 @@
import base64
from typing import Any, Optional, Tuple, Union
from ...api.file.create_file_conversion import asyncio as fc_asyncio, sync as fc_sync
from ...client import Client
from ...models import Error, FileConversion, FileExportFormat, FileImportFormat
def sync(
src_format: FileImportFormat,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, Tuple[FileConversion, bytes], Error]]:
"""Convert a CAD file from one format to another. If the file being converted is larger than a certain size it will be performed asynchronously. This function automatically base64 encodes the request body and base64 decodes the request output."""
encoded = base64.b64encode(body)
fc = fc_sync(
src_format=src_format,
output_format=output_format,
body=encoded,
client=client,
)
if isinstance(fc, FileConversion) and fc.output != "":
if isinstance(fc.output, str):
b = base64.b64decode(fc.output + "===")
return (fc, b)
return fc
async def asyncio(
src_format: FileImportFormat,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, Tuple[FileConversion, bytes], Error]]:
"""Convert a CAD file from one format to another. If the file being converted is larger than a certain size it will be performed asynchronously. This function automatically base64 encodes the request body and base64 decodes the request output."""
encoded = base64.b64encode(body)
fc = await fc_asyncio(
src_format=src_format,
output_format=output_format,
body=encoded,
client=client,
)
if isinstance(fc, FileConversion) and fc.output != "":
if isinstance(fc.output, str):
b = base64.b64decode(fc.output + "===")
return (fc, b)
return fc

View File

@ -12,17 +12,43 @@ 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( url = "{}/file/density".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if material_mass is not None: if material_mass is not None:
if "?" in url: if "?" in url:
@ -30,24 +56,35 @@ 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()
@ -73,6 +110,7 @@ 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]]]:
@ -85,20 +123,53 @@ 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,
) )
@ -111,46 +182,111 @@ 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. 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
""" # 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,
) )
@ -161,28 +297,60 @@ 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. 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
""" # 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,17 +12,43 @@ 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( url = "{}/file/mass".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if material_density is not None: if material_density is not None:
if "?" in url: if "?" in url:
@ -30,24 +56,35 @@ 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()
@ -73,6 +110,7 @@ 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]]]:
@ -85,20 +123,53 @@ 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,
) )
@ -111,46 +182,111 @@ 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. 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
""" # 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,
) )
@ -161,28 +297,60 @@ 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. 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
""" # 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,15 +11,31 @@ 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( url = "{}/file/surface-area".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if output_unit is not None: if output_unit is not None:
if "?" in url: if "?" in url:
@ -27,12 +43,19 @@ 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()
@ -45,9 +68,7 @@ def _get_kwargs(
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[FileSurfaceArea, Error]] :
*, 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
@ -60,6 +81,7 @@ def _parse_response(
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]]]:
@ -72,16 +94,37 @@ 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,
) )
@ -94,38 +137,79 @@ 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. 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
""" # 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,
) )
@ -136,24 +220,44 @@ 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. 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
""" # 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,15 +11,31 @@ 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( url = "{}/file/volume".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if output_unit is not None: if output_unit is not None:
if "?" in url: if "?" in url:
@ -27,12 +43,19 @@ 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()
@ -58,6 +81,7 @@ 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]]]:
@ -70,16 +94,37 @@ 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,
) )
@ -92,38 +137,79 @@ 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. 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
""" # 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,
) )
@ -134,24 +220,44 @@ 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. 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
""" # 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

@ -1,47 +0,0 @@
import base64
from typing import Any, Optional, Tuple, Union
from ...api.api_calls.get_async_operation import asyncio as fc_asyncio, sync as fc_sync
from ...client import Client
from ...models import Error
from ...models.file_conversion import FileConversion
def sync(
id: str,
*,
client: Client,
) -> Optional[Union[Any, Tuple[FileConversion, bytes], Error]]:
"""Get the status of a file conversion. This function automatically base64 decodes the output response if there is one."""
fc = fc_sync(
id=id,
client=client,
)
if isinstance(fc, FileConversion) and fc.output != "":
if isinstance(fc.output, str):
b = base64.b64decode(fc.output + "===")
return (fc, b)
return fc
async def asyncio(
id: str,
*,
client: Client,
) -> Optional[Union[Any, Tuple[FileConversion, bytes], Error]]:
"""Get the status of a file conversion. This function automatically base64 decodes the output response if there is one."""
fc = await fc_asyncio(
id=id,
client=client,
)
if isinstance(fc, FileConversion) and fc.output != "":
if isinstance(fc.output, str):
b = base64.b64decode(fc.output + "===")
return (fc, b)
return fc

View File

@ -10,13 +10,22 @@ 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( url = "{}/auth/email".format(client.base_url, ) # noqa: E501
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()
@ -30,9 +39,7 @@ def _get_kwargs(
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[VerificationToken, Error]] :
*, 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
@ -45,6 +52,7 @@ def _parse_response(
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]]]:
@ -57,12 +65,21 @@ 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,
) )
@ -75,23 +92,43 @@ 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,
) )
@ -102,13 +139,24 @@ 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,15 +8,31 @@ 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( url = "{}/auth/email/callback".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if callback_url is not None: if callback_url is not None:
if "?" in url: if "?" in url:
@ -24,18 +40,25 @@ 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()
@ -44,6 +67,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -58,7 +82,10 @@ 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,
@ -68,16 +95,37 @@ def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
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,
) )
@ -90,31 +138,75 @@ 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,
) )
@ -125,17 +217,40 @@ 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,12 +8,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/logout".format( url = "{}/logout".format(client.base_url, ) # noqa: E501
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()
@ -23,6 +25,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -37,7 +40,10 @@ 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,
@ -47,10 +53,13 @@ def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
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,
) )
@ -63,21 +72,27 @@ 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,
) )
@ -88,13 +103,16 @@ 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,12 +9,14 @@ 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( url = "{}/.well-known/ai-plugin.json".format(client.base_url, ) # noqa: E501
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()
@ -24,12 +26,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[AiPluginManifest, Error]] :
*, 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
@ -42,6 +43,7 @@ def _parse_response(
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]]]:
@ -54,10 +56,13 @@ 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,
) )
@ -70,19 +75,27 @@ 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,
) )
@ -93,11 +106,16 @@ 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,12 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/_meta/info".format( url = "{}/_meta/info".format(client.base_url, ) # noqa: E501
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()
@ -24,6 +26,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -40,6 +43,7 @@ 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]]]:
@ -52,10 +56,13 @@ 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,
) )
@ -68,22 +75,28 @@ 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,
) )
@ -94,14 +107,17 @@ 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,12 +8,14 @@ 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( url = "{}/openai/openapi.json".format(client.base_url, ) # noqa: E501
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()
@ -23,6 +25,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -39,6 +42,7 @@ 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]]]:
@ -51,10 +55,13 @@ 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,
) )
@ -67,21 +74,27 @@ 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,
) )
@ -92,13 +105,16 @@ 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,12 +8,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/".format( url = "{}/".format(client.base_url, ) # noqa: E501
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()
@ -23,6 +25,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -39,6 +42,7 @@ 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]]]:
@ -51,10 +55,13 @@ 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,
) )
@ -67,19 +74,27 @@ 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,
) )
@ -90,11 +105,16 @@ 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

@ -9,12 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/ping".format( url = "{}/ping".format(client.base_url, ) # noqa: E501
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()
@ -24,6 +26,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -40,6 +43,7 @@ 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]]]:
@ -52,10 +56,13 @@ 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,
) )
@ -68,19 +75,27 @@ 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,
) )
@ -91,11 +106,16 @@ 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,115 +0,0 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.modeling_cmd_req import ModelingCmdReq
from ...types import Response
def _get_kwargs(
body: ModelingCmdReq,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/modeling/cmd".format(
client.base_url,
) # 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[dict, Error]]:
if response.status_code == 200:
response_200 = 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[dict, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: ModelingCmdReq,
*,
client: Client,
) -> Response[Optional[Union[dict, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: ModelingCmdReq,
*,
client: Client,
) -> Optional[Union[dict, Error]]:
"""Response depends on which command was submitted, so unfortunately the OpenAPI schema can't generate the right response type.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: ModelingCmdReq,
*,
client: Client,
) -> Response[Optional[Union[dict, Error]]]:
kwargs = _get_kwargs(
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(
body: ModelingCmdReq,
*,
client: Client,
) -> Optional[Union[dict, Error]]:
"""Response depends on which command was submitted, so unfortunately the OpenAPI schema can't generate the right response type.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -1,114 +0,0 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.modeling_cmd_req_batch import ModelingCmdReqBatch
from ...models.modeling_outcomes import ModelingOutcomes
from ...types import Response
def _get_kwargs(
body: ModelingCmdReqBatch,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/modeling/cmd-batch".format(
client.base_url,
) # 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[ModelingOutcomes, Error]]:
if response.status_code == 200:
response_200 = ModelingOutcomes.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[ModelingOutcomes, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: ModelingCmdReqBatch,
*,
client: Client,
) -> Response[Optional[Union[ModelingOutcomes, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: ModelingCmdReqBatch,
*,
client: Client,
) -> Optional[Union[ModelingOutcomes, Error]]:
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: ModelingCmdReqBatch,
*,
client: Client,
) -> Response[Optional[Union[ModelingOutcomes, Error]]]:
kwargs = _get_kwargs(
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(
body: ModelingCmdReqBatch,
*,
client: Client,
) -> Optional[Union[ModelingOutcomes, Error]]:
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -8,39 +8,85 @@ from ...models.error import Error
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,
*, *,
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)
else: else:
url = url + "?unlocked_framerate=" + str(unlocked_framerate) url = url + "?unlocked_framerate=" + str(unlocked_framerate)
if video_res_height is not None: if video_res_height is not None:
if "?" in url: if "?" in url:
url = url + "&video_res_height=" + str(video_res_height) url = url + "&video_res_height=" + str(video_res_height)
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 "?" in url:
url = url + "&webrtc=" + str(webrtc)
else:
url = url + "?webrtc=" + str(webrtc)
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()
@ -49,58 +95,125 @@ 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,
*, *,
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,
client=client, client=client,
) )
with ws_connect( with ws_connect(kwargs["url"].replace("https://", "wss://"), additional_headers=kwargs["headers"]) as websocket:
kwargs["url"].replace("https://", "wss://"),
additional_headers=kwargs["headers"],
) as websocket:
return websocket # type: ignore return websocket # type: ignore
# Return an error if we got here. # Return an error if we got here.
return Error(message="An error occurred while connecting to the websocket.") 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,
*, *,
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,
client=client, client=client,
) )
async with ws_connect_async( async with ws_connect_async(kwargs["url"].replace("https://", "wss://"), extra_headers=kwargs["headers"]) as websocket:
kwargs["url"].replace("https://", "wss://"), extra_headers=kwargs["headers"]
) as websocket:
return websocket return websocket
# Return an error if we got here. # Return an error if we got here.

View File

@ -10,13 +10,22 @@ 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( url = "{}/user/payment".format(client.base_url, ) # noqa: E501
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()
@ -43,6 +52,7 @@ 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]]]:
@ -55,12 +65,21 @@ 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,
) )
@ -73,27 +92,44 @@ 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. This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.""" # noqa: E501
""" # 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,
) )
@ -104,17 +140,25 @@ 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. This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.""" # noqa: E501
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,12 +9,14 @@ 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( url = "{}/user/payment/intent".format(client.base_url, ) # noqa: E501
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()
@ -24,12 +26,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[PaymentIntent, Error]] :
*, 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
@ -42,6 +43,7 @@ def _parse_response(
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]]]:
@ -54,10 +56,13 @@ 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,
) )
@ -70,21 +75,27 @@ 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,
) )
@ -95,13 +106,16 @@ 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,12 +8,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment".format( url = "{}/user/payment".format(client.base_url, ) # noqa: E501
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()
@ -23,6 +25,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -37,7 +40,10 @@ 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,
@ -47,10 +53,13 @@ def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
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,
) )
@ -63,23 +72,28 @@ 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. This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.""" # noqa: E501
""" # 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,
) )
@ -90,15 +104,17 @@ 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. This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.""" # noqa: E501
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,14 +8,22 @@ 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( url = "{}/user/payment/methods/{id}".format(client.base_url, id=id,) # noqa: E501
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()
@ -25,6 +33,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -39,7 +48,10 @@ 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,
@ -49,12 +61,21 @@ def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
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,
) )
@ -67,25 +88,43 @@ 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,
) )
@ -96,15 +135,24 @@ 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,12 +9,14 @@ 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( url = "{}/user/payment/balance".format(client.base_url, ) # noqa: E501
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()
@ -24,12 +26,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[CustomerBalance, Error]] :
*, 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
@ -42,6 +43,7 @@ def _parse_response(
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]]]:
@ -54,10 +56,13 @@ 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,
) )
@ -70,21 +75,27 @@ 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,
) )
@ -95,13 +106,16 @@ 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,12 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/payment".format( url = "{}/user/payment".format(client.base_url, ) # noqa: E501
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()
@ -24,6 +26,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -40,6 +43,7 @@ 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]]]:
@ -52,10 +56,13 @@ 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,
) )
@ -68,23 +75,28 @@ 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. This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.""" # noqa: E501
""" # 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,
) )
@ -95,15 +107,17 @@ 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. This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.""" # noqa: E501
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,12 +9,14 @@ 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( url = "{}/user/payment/invoices".format(client.base_url, ) # noqa: E501
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()
@ -24,14 +26,16 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[List[Invoice], Error]] :
*, response: httpx.Response
) -> Optional[Union[List[Invoice], Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = [Invoice.from_dict(item) for item in response.json()] response_200 = [
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())
@ -42,6 +46,7 @@ def _parse_response(
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]]]:
@ -54,10 +59,13 @@ 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,
) )
@ -70,21 +78,27 @@ 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,
) )
@ -95,13 +109,16 @@ 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,12 +9,14 @@ 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( url = "{}/user/payment/methods".format(client.base_url, ) # noqa: E501
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()
@ -24,14 +26,16 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[List[PaymentMethod], Error]] :
*, response: httpx.Response
) -> Optional[Union[List[PaymentMethod], Error]]:
if response.status_code == 200: if response.status_code == 200:
response_200 = [PaymentMethod.from_dict(item) for item in response.json()] response_200 = [
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())
@ -42,6 +46,7 @@ def _parse_response(
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]]]:
@ -54,10 +59,13 @@ 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,
) )
@ -70,21 +78,27 @@ 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,
) )
@ -95,13 +109,16 @@ 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,13 +10,22 @@ 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( url = "{}/user/payment".format(client.base_url, ) # noqa: E501
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()
@ -43,6 +52,7 @@ 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]]]:
@ -55,12 +65,21 @@ 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,
) )
@ -73,27 +92,44 @@ 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. This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.""" # noqa: E501
""" # 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,
) )
@ -104,17 +140,25 @@ 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. This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.""" # noqa: E501
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
body=body, body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,12 +8,14 @@ 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( url = "{}/user/payment/tax".format(client.base_url, ) # noqa: E501
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()
@ -23,6 +25,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -37,7 +40,10 @@ 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,
@ -47,10 +53,13 @@ def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
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,
) )
@ -63,21 +72,27 @@ 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,
) )
@ -88,13 +103,16 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/angle/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitAngleConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/area/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitAreaConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/current/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitCurrentConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/energy/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitEnergyConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/force/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitForceConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/frequency/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitFrequencyConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/length/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitLengthConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/mass/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitMassConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/power/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitPowerConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/pressure/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitPressureConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/temperature/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitTemperatureConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/torque/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitTorqueConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,17 +10,35 @@ 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( url = "{}/unit/conversion/volume/{input_unit}/{output_unit}".format(client.base_url, input_unit=input_unit,output_unit=output_unit,) # noqa: E501
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:
@ -28,6 +46,9 @@ 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()
@ -36,12 +57,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UnitVolumeConversion, Error]] :
*, 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
@ -54,6 +74,7 @@ def _parse_response(
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]]]:
@ -66,16 +87,37 @@ 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,
) )
@ -88,33 +130,75 @@ 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,
) )
@ -125,19 +209,40 @@ 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,12 +8,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user".format( url = "{}/user".format(client.base_url, ) # noqa: E501
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()
@ -23,6 +25,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -37,7 +40,10 @@ 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,
@ -47,10 +53,13 @@ def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
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,
) )
@ -63,23 +72,28 @@ 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. 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
""" # 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,
) )
@ -90,15 +104,17 @@ 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. 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
""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,22 @@ 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( url = "{}/user/session/{token}".format(client.base_url, token=token,) # noqa: E501
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()
@ -26,6 +34,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -42,6 +51,7 @@ 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]]]:
@ -54,12 +64,21 @@ 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,
) )
@ -72,25 +91,43 @@ 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,
) )
@ -101,15 +138,24 @@ 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,14 +9,22 @@ 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( url = "{}/users/{id}".format(client.base_url, id=id,) # noqa: E501
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()
@ -26,6 +34,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -42,6 +51,7 @@ 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]]]:
@ -54,12 +64,21 @@ 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,
) )
@ -72,27 +91,45 @@ 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,
) )
@ -103,9 +140,16 @@ 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.
@ -113,7 +157,9 @@ async def asyncio(
return ( return (
await asyncio_detailed( await asyncio_detailed(
id=id, id=id,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -9,14 +9,22 @@ 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( url = "{}/users-extended/{id}".format(client.base_url, id=id,) # noqa: E501
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()
@ -26,12 +34,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[ExtendedUser, Error]] :
*, 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
@ -44,6 +51,7 @@ def _parse_response(
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,12 +64,21 @@ 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,
) )
@ -74,27 +91,45 @@ 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,
) )
@ -105,9 +140,16 @@ 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.
@ -115,7 +157,9 @@ async def asyncio(
return ( return (
await asyncio_detailed( await asyncio_detailed(
id=id, id=id,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -8,12 +8,14 @@ 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( url = "{}/user/front-hash".format(client.base_url, ) # noqa: E501
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()
@ -23,6 +25,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -39,6 +42,7 @@ 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]]]:
@ -51,10 +55,13 @@ 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,
) )
@ -67,21 +74,27 @@ 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,
) )
@ -92,13 +105,16 @@ 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,12 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/onboarding".format( url = "{}/user/onboarding".format(client.base_url, ) # noqa: E501
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()
@ -24,6 +26,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -40,6 +43,7 @@ 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]]]:
@ -52,10 +56,13 @@ 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,
) )
@ -68,21 +75,27 @@ 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,
) )
@ -93,13 +106,16 @@ 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,12 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user".format( url = "{}/user".format(client.base_url, ) # noqa: E501
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()
@ -24,6 +26,7 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
@ -40,6 +43,7 @@ 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]]]:
@ -52,10 +56,13 @@ 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,
) )
@ -68,22 +75,28 @@ 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,
) )
@ -94,14 +107,17 @@ 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,12 +9,14 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/user/extended".format( url = "{}/user/extended".format(client.base_url, ) # noqa: E501
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()
@ -24,12 +26,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[ExtendedUser, Error]] :
*, 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
@ -42,6 +43,7 @@ def _parse_response(
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]]]:
@ -54,10 +56,13 @@ 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,
) )
@ -70,22 +75,28 @@ 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,
) )
@ -96,14 +107,17 @@ 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,15 +10,31 @@ 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( url = "{}/users".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -26,18 +42,25 @@ 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()
@ -46,12 +69,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[UserResultsPage, Error]] :
*, 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
@ -64,6 +86,7 @@ def _parse_response(
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]]]:
@ -76,16 +99,37 @@ 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,
) )
@ -98,33 +142,75 @@ 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,
) )
@ -135,19 +221,40 @@ 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,15 +10,31 @@ 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( url = "{}/users-extended".format(client.base_url, ) # noqa: E501
client.base_url,
) # noqa: E501
if limit is not None: if limit is not None:
if "?" in url: if "?" in url:
@ -26,18 +42,25 @@ 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()
@ -46,12 +69,11 @@ def _get_kwargs(
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
} }
def _parse_response( def _parse_response(*, response: httpx.Response) -> Optional[Union[ExtendedUserResultsPage, Error]] :
*, 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
@ -64,6 +86,7 @@ def _parse_response(
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]]]:
@ -76,16 +99,37 @@ 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,
) )
@ -98,33 +142,75 @@ 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,
) )
@ -135,19 +221,40 @@ 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,13 +10,22 @@ 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( url = "{}/user".format(client.base_url, ) # noqa: E501
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()
@ -43,6 +52,7 @@ 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]]]:
@ -55,12 +65,21 @@ 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,
) )
@ -73,25 +92,43 @@ 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,
) )
@ -102,15 +139,24 @@ 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

@ -1,20 +1,17 @@
import os import os
from typing import Tuple, Union from typing import Dict, Optional, Union
import pytest 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 ( from .api.file import create_file_conversion, create_file_mass, create_file_volume
create_file_conversion_with_base64_helper,
create_file_mass,
create_file_volume,
)
from .api.meta import ping from .api.meta import ping
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 (
ApiCallStatus, ApiCallStatus,
ApiTokenResultsPage, ApiTokenResultsPage,
Base64Data,
CreatedAtSortMode, CreatedAtSortMode,
Error, Error,
ExtendedUserResultsPage, ExtendedUserResultsPage,
@ -29,6 +26,7 @@ from .models import (
UnitVolume, UnitVolume,
User, User,
) )
from .types import Unset
def test_get_session(): def test_get_session():
@ -106,19 +104,16 @@ def test_file_convert_stl():
file.close() file.close()
# Get the fc. # Get the fc.
result: Union[ result: Optional[Union[FileConversion, Error]] = create_file_conversion.sync(
Tuple[FileConversion, bytes], Error, None
] = create_file_conversion_with_base64_helper.sync(
client=client, client=client,
body=content, body=content,
src_format=FileImportFormat.STL, src_format=FileImportFormat.STL,
output_format=FileExportFormat.OBJ, output_format=FileExportFormat.OBJ,
) )
r: Tuple[FileConversion, bytes] = result # type: ignore assert isinstance(result, FileConversion)
b: bytes = r[1] fc: FileConversion = result
fc: FileConversion = r[0]
print(f"FileConversion: {fc}") print(f"FileConversion: {fc}")
@ -127,8 +122,12 @@ def test_file_convert_stl():
print(f"FileConversion: {fc}") print(f"FileConversion: {fc}")
assert not isinstance(fc.outputs, Unset)
outputs: Dict[str, Base64Data] = fc.outputs
# Make sure the bytes are not empty. # Make sure the bytes are not empty.
assert len(b) > 0 for key, value in outputs.items():
assert len(value.get_decoded()) > 0
@pytest.mark.asyncio @pytest.mark.asyncio
@ -142,19 +141,18 @@ async def test_file_convert_stl_async():
file.close() file.close()
# Get the fc. # Get the fc.
result: Union[ result: Optional[
Tuple[FileConversion, bytes], Error, None Union[FileConversion, Error]
] = await create_file_conversion_with_base64_helper.asyncio( ] = await create_file_conversion.asyncio(
client=client, client=client,
body=content, body=content,
src_format=FileImportFormat.STL, src_format=FileImportFormat.STL,
output_format=FileExportFormat.OBJ, output_format=FileExportFormat.OBJ,
) )
r: Tuple[FileConversion, bytes] = result # type: ignore assert isinstance(result, FileConversion)
b: bytes = r[1] fc: FileConversion = result
fc: FileConversion = r[0]
print(f"FileConversion: {fc}") print(f"FileConversion: {fc}")
@ -163,8 +161,51 @@ async def test_file_convert_stl_async():
print(f"FileConversion: {fc}") print(f"FileConversion: {fc}")
assert not isinstance(fc.outputs, Unset)
outputs: Dict[str, Base64Data] = fc.outputs
# Make sure the bytes are not empty. # Make sure the bytes are not empty.
assert len(b) > 0 for key, value in outputs.items():
assert len(value.get_decoded()) > 0
@pytest.mark.asyncio
async def test_file_convert_obj_async():
# Create our client.
client = ClientFromEnv()
dir_path = os.path.dirname(os.path.realpath(__file__))
file = open(os.path.join(dir_path, "../assets/ORIGINALVOXEL-3.obj"), "rb")
content = file.read()
file.close()
# Get the fc.
result: Optional[
Union[FileConversion, Error]
] = await create_file_conversion.asyncio(
client=client,
body=content,
src_format=FileImportFormat.OBJ,
output_format=FileExportFormat.STL,
)
assert isinstance(result, FileConversion)
fc: FileConversion = result
print(f"FileConversion: {fc}")
assert fc.id is not None
assert fc.status == ApiCallStatus.COMPLETED
print(f"FileConversion: {fc}")
assert not isinstance(fc.outputs, Unset)
outputs: Dict[str, Base64Data] = fc.outputs
# Make sure the bytes are not empty.
for key, value in outputs.items():
assert len(value.get_decoded()) > 0
def test_file_mass(): def test_file_mass():

View File

@ -1,4 +1,4 @@
from typing import List, Optional, Tuple, Union from typing import List, Optional, Union
import pytest import pytest
@ -28,7 +28,6 @@ from kittycad.api.executor import create_executor_term, create_file_execution
from kittycad.api.file import ( from kittycad.api.file import (
create_file_center_of_mass, create_file_center_of_mass,
create_file_conversion, create_file_conversion,
create_file_conversion_with_base64_helper,
create_file_density, create_file_density,
create_file_mass, create_file_mass,
create_file_surface_area, create_file_surface_area,
@ -42,7 +41,7 @@ from kittycad.api.meta import (
get_schema, get_schema,
ping, ping,
) )
from kittycad.api.modeling import cmd, cmd_batch, modeling_commands_ws from kittycad.api.modeling import modeling_commands_ws
from kittycad.api.payments import ( from kittycad.api.payments import (
create_payment_information_for_user, create_payment_information_for_user,
create_payment_intent_for_user, create_payment_intent_for_user,
@ -108,7 +107,6 @@ from kittycad.models import (
Invoice, Invoice,
Mesh, Mesh,
Metadata, Metadata,
ModelingOutcomes,
Onboarding, Onboarding,
PaymentIntent, PaymentIntent,
PaymentMethod, PaymentMethod,
@ -140,11 +138,6 @@ 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.image_type import ImageType
from kittycad.models.modeling_cmd import move_path_pen
from kittycad.models.modeling_cmd_id import ModelingCmdId
from kittycad.models.modeling_cmd_req import ModelingCmdReq
from kittycad.models.modeling_cmd_req_batch import ModelingCmdReqBatch
from kittycad.models.point3d import Point3d
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
@ -289,7 +282,7 @@ def test_create_image_to_3d():
result: Optional[Union[Mesh, Error]] = create_image_to_3d.sync( result: Optional[Union[Mesh, Error]] = create_image_to_3d.sync(
client=client, client=client,
input_format=ImageType.PNG, input_format=ImageType.PNG,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -304,7 +297,7 @@ def test_create_image_to_3d():
response: Response[Optional[Union[Mesh, Error]]] = create_image_to_3d.sync_detailed( response: Response[Optional[Union[Mesh, Error]]] = create_image_to_3d.sync_detailed(
client=client, client=client,
input_format=ImageType.PNG, input_format=ImageType.PNG,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -319,7 +312,7 @@ async def test_create_image_to_3d_async():
result: Optional[Union[Mesh, Error]] = await create_image_to_3d.asyncio( result: Optional[Union[Mesh, Error]] = await create_image_to_3d.asyncio(
client=client, client=client,
input_format=ImageType.PNG, input_format=ImageType.PNG,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -329,7 +322,7 @@ async def test_create_image_to_3d_async():
] = await create_image_to_3d.asyncio_detailed( ] = await create_image_to_3d.asyncio_detailed(
client=client, client=client,
input_format=ImageType.PNG, input_format=ImageType.PNG,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -341,7 +334,7 @@ def test_create_text_to_3d():
result: Optional[Union[Mesh, Error]] = create_text_to_3d.sync( result: Optional[Union[Mesh, Error]] = create_text_to_3d.sync(
client=client, client=client,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
prompt="<string>", prompt="<string>",
) )
@ -355,7 +348,7 @@ def test_create_text_to_3d():
# 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[Mesh, Error]]] = create_text_to_3d.sync_detailed(
client=client, client=client,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
prompt="<string>", prompt="<string>",
) )
@ -369,7 +362,7 @@ async def test_create_text_to_3d_async():
result: Optional[Union[Mesh, Error]] = await create_text_to_3d.asyncio( result: Optional[Union[Mesh, Error]] = await create_text_to_3d.asyncio(
client=client, client=client,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
prompt="<string>", prompt="<string>",
) )
@ -378,7 +371,7 @@ async def test_create_text_to_3d_async():
Optional[Union[Mesh, Error]] Optional[Union[Mesh, Error]]
] = await create_text_to_3d.asyncio_detailed( ] = await create_text_to_3d.asyncio_detailed(
client=client, client=client,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
prompt="<string>", prompt="<string>",
) )
@ -932,7 +925,7 @@ def test_create_file_center_of_mass():
result: Optional[Union[FileCenterOfMass, Error]] = create_file_center_of_mass.sync( result: Optional[Union[FileCenterOfMass, Error]] = create_file_center_of_mass.sync(
client=client, client=client,
output_unit=UnitLength.CM, output_unit=UnitLength.CM,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -949,7 +942,7 @@ def test_create_file_center_of_mass():
] = create_file_center_of_mass.sync_detailed( ] = create_file_center_of_mass.sync_detailed(
client=client, client=client,
output_unit=UnitLength.CM, output_unit=UnitLength.CM,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -966,7 +959,7 @@ async def test_create_file_center_of_mass_async():
] = await create_file_center_of_mass.asyncio( ] = await create_file_center_of_mass.asyncio(
client=client, client=client,
output_unit=UnitLength.CM, output_unit=UnitLength.CM,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -976,22 +969,20 @@ async def test_create_file_center_of_mass_async():
] = await create_file_center_of_mass.asyncio_detailed( ] = await create_file_center_of_mass.asyncio_detailed(
client=client, client=client,
output_unit=UnitLength.CM, output_unit=UnitLength.CM,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@pytest.mark.skip @pytest.mark.skip
def test_create_file_conversion_with_base64_helper(): def test_create_file_conversion():
# Create our client. # Create our client.
client = ClientFromEnv() client = ClientFromEnv()
result: Optional[ result: Optional[Union[FileConversion, Error]] = create_file_conversion.sync(
Union[Tuple[FileConversion, bytes], Error]
] = create_file_conversion_with_base64_helper.sync(
client=client, client=client,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -999,7 +990,7 @@ def test_create_file_conversion_with_base64_helper():
print(result) print(result)
raise Exception("Error in response") raise Exception("Error in response")
body: Tuple[FileConversion, bytes] = result body: FileConversion = 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)
@ -1007,8 +998,8 @@ def test_create_file_conversion_with_base64_helper():
Optional[Union[FileConversion, Error]] Optional[Union[FileConversion, Error]]
] = create_file_conversion.sync_detailed( ] = create_file_conversion.sync_detailed(
client=client, client=client,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1016,16 +1007,16 @@ def test_create_file_conversion_with_base64_helper():
# OR run async # OR run async
@pytest.mark.asyncio @pytest.mark.asyncio
@pytest.mark.skip @pytest.mark.skip
async def test_create_file_conversion_with_base64_helper_async(): async def test_create_file_conversion_async():
# Create our client. # Create our client.
client = ClientFromEnv() client = ClientFromEnv()
result: Optional[ result: Optional[
Union[Tuple[FileConversion, bytes], Error] Union[FileConversion, Error]
] = await create_file_conversion_with_base64_helper.asyncio( ] = await create_file_conversion.asyncio(
client=client, client=client,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1034,8 +1025,8 @@ async def test_create_file_conversion_with_base64_helper_async():
Optional[Union[FileConversion, Error]] Optional[Union[FileConversion, Error]]
] = await create_file_conversion.asyncio_detailed( ] = await create_file_conversion.asyncio_detailed(
client=client, client=client,
output_format=FileExportFormat.GLTF, output_format=FileExportFormat.FBX,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1050,7 +1041,7 @@ def test_create_file_density():
material_mass=3.14, material_mass=3.14,
material_mass_unit=UnitMass.G, material_mass_unit=UnitMass.G,
output_unit=UnitDensity.LB_FT3, output_unit=UnitDensity.LB_FT3,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1069,7 +1060,7 @@ def test_create_file_density():
material_mass=3.14, material_mass=3.14,
material_mass_unit=UnitMass.G, material_mass_unit=UnitMass.G,
output_unit=UnitDensity.LB_FT3, output_unit=UnitDensity.LB_FT3,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1086,7 +1077,7 @@ async def test_create_file_density_async():
material_mass=3.14, material_mass=3.14,
material_mass_unit=UnitMass.G, material_mass_unit=UnitMass.G,
output_unit=UnitDensity.LB_FT3, output_unit=UnitDensity.LB_FT3,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1098,7 +1089,7 @@ async def test_create_file_density_async():
material_mass=3.14, material_mass=3.14,
material_mass_unit=UnitMass.G, material_mass_unit=UnitMass.G,
output_unit=UnitDensity.LB_FT3, output_unit=UnitDensity.LB_FT3,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1168,7 +1159,7 @@ def test_create_file_mass():
material_density=3.14, material_density=3.14,
material_density_unit=UnitDensity.LB_FT3, material_density_unit=UnitDensity.LB_FT3,
output_unit=UnitMass.G, output_unit=UnitMass.G,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1187,7 +1178,7 @@ def test_create_file_mass():
material_density=3.14, material_density=3.14,
material_density_unit=UnitDensity.LB_FT3, material_density_unit=UnitDensity.LB_FT3,
output_unit=UnitMass.G, output_unit=UnitMass.G,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1204,7 +1195,7 @@ async def test_create_file_mass_async():
material_density=3.14, material_density=3.14,
material_density_unit=UnitDensity.LB_FT3, material_density_unit=UnitDensity.LB_FT3,
output_unit=UnitMass.G, output_unit=UnitMass.G,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1216,7 +1207,7 @@ async def test_create_file_mass_async():
material_density=3.14, material_density=3.14,
material_density_unit=UnitDensity.LB_FT3, material_density_unit=UnitDensity.LB_FT3,
output_unit=UnitMass.G, output_unit=UnitMass.G,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1229,7 +1220,7 @@ def test_create_file_surface_area():
result: Optional[Union[FileSurfaceArea, Error]] = create_file_surface_area.sync( result: Optional[Union[FileSurfaceArea, Error]] = create_file_surface_area.sync(
client=client, client=client,
output_unit=UnitArea.CM2, output_unit=UnitArea.CM2,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1246,7 +1237,7 @@ def test_create_file_surface_area():
] = create_file_surface_area.sync_detailed( ] = create_file_surface_area.sync_detailed(
client=client, client=client,
output_unit=UnitArea.CM2, output_unit=UnitArea.CM2,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1263,7 +1254,7 @@ async def test_create_file_surface_area_async():
] = await create_file_surface_area.asyncio( ] = await create_file_surface_area.asyncio(
client=client, client=client,
output_unit=UnitArea.CM2, output_unit=UnitArea.CM2,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1273,7 +1264,7 @@ async def test_create_file_surface_area_async():
] = await create_file_surface_area.asyncio_detailed( ] = await create_file_surface_area.asyncio_detailed(
client=client, client=client,
output_unit=UnitArea.CM2, output_unit=UnitArea.CM2,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1286,7 +1277,7 @@ def test_create_file_volume():
result: Optional[Union[FileVolume, Error]] = create_file_volume.sync( result: Optional[Union[FileVolume, Error]] = create_file_volume.sync(
client=client, client=client,
output_unit=UnitVolume.CM3, output_unit=UnitVolume.CM3,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1303,7 +1294,7 @@ def test_create_file_volume():
] = create_file_volume.sync_detailed( ] = create_file_volume.sync_detailed(
client=client, client=client,
output_unit=UnitVolume.CM3, output_unit=UnitVolume.CM3,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1318,7 +1309,7 @@ async def test_create_file_volume_async():
result: Optional[Union[FileVolume, Error]] = await create_file_volume.asyncio( result: Optional[Union[FileVolume, Error]] = await create_file_volume.asyncio(
client=client, client=client,
output_unit=UnitVolume.CM3, output_unit=UnitVolume.CM3,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1328,7 +1319,7 @@ async def test_create_file_volume_async():
] = await create_file_volume.asyncio_detailed( ] = await create_file_volume.asyncio_detailed(
client=client, client=client,
output_unit=UnitVolume.CM3, output_unit=UnitVolume.CM3,
src_format=FileImportFormat.GLTF, src_format=FileImportFormat.FBX,
body=bytes("some bytes", "utf-8"), body=bytes("some bytes", "utf-8"),
) )
@ -1372,185 +1363,6 @@ async def test_logout_async():
) )
@pytest.mark.skip
def test_cmd():
# Create our client.
client = ClientFromEnv()
cmd.sync(
client=client,
body=ModelingCmdReq(
cmd=move_path_pen(
path=ModelingCmdId("<uuid>"),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
),
)
# OR if you need more info (e.g. status_code)
cmd.sync_detailed(
client=client,
body=ModelingCmdReq(
cmd=move_path_pen(
path=ModelingCmdId("<uuid>"),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
),
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_cmd_async():
# Create our client.
client = ClientFromEnv()
await cmd.asyncio(
client=client,
body=ModelingCmdReq(
cmd=move_path_pen(
path=ModelingCmdId("<uuid>"),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
),
)
# OR run async with more info
await cmd.asyncio_detailed(
client=client,
body=ModelingCmdReq(
cmd=move_path_pen(
path=ModelingCmdId("<uuid>"),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
),
)
@pytest.mark.skip
def test_cmd_batch():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[ModelingOutcomes, Error]] = cmd_batch.sync(
client=client,
body=ModelingCmdReqBatch(
cmds={
"<string>": ModelingCmdReq(
cmd=move_path_pen(
path=ModelingCmdId("<uuid>"),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
)
},
),
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: ModelingOutcomes = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[
Optional[Union[ModelingOutcomes, Error]]
] = cmd_batch.sync_detailed(
client=client,
body=ModelingCmdReqBatch(
cmds={
"<string>": ModelingCmdReq(
cmd=move_path_pen(
path=ModelingCmdId("<uuid>"),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
)
},
),
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_cmd_batch_async():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[ModelingOutcomes, Error]] = await cmd_batch.asyncio(
client=client,
body=ModelingCmdReqBatch(
cmds={
"<string>": ModelingCmdReq(
cmd=move_path_pen(
path=ModelingCmdId("<uuid>"),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
)
},
),
)
# OR run async with more info
response: Response[
Optional[Union[ModelingOutcomes, Error]]
] = await cmd_batch.asyncio_detailed(
client=client,
body=ModelingCmdReqBatch(
cmds={
"<string>": ModelingCmdReq(
cmd=move_path_pen(
path=ModelingCmdId("<uuid>"),
to=Point3d(
x=3.14,
y=3.14,
z=3.14,
),
),
cmd_id=ModelingCmdId("<uuid>"),
)
},
),
)
@pytest.mark.skip @pytest.mark.skip
def test_get_openai_schema(): def test_get_openai_schema():
# Create our client. # Create our client.
@ -3798,6 +3610,7 @@ def test_modeling_commands_ws():
unlocked_framerate=False, unlocked_framerate=False,
video_res_height=10, video_res_height=10,
video_res_width=10, video_res_width=10,
webrtc=False,
) )
# Send a message. # Send a message.
@ -3822,6 +3635,7 @@ async def test_modeling_commands_ws_async():
unlocked_framerate=False, unlocked_framerate=False,
video_res_height=10, video_res_height=10,
video_res_width=10, video_res_width=10,
webrtc=False,
) )
# Send a message. # Send a message.

View File

@ -7,6 +7,7 @@ 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 .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
from .annotation_options import AnnotationOptions from .annotation_options import AnnotationOptions
@ -19,6 +20,7 @@ from .api_call_query_group_by import ApiCallQueryGroupBy
from .api_call_status import ApiCallStatus from .api_call_status import ApiCallStatus
from .api_call_with_price import ApiCallWithPrice from .api_call_with_price import ApiCallWithPrice
from .api_call_with_price_results_page import ApiCallWithPriceResultsPage from .api_call_with_price_results_page import ApiCallWithPriceResultsPage
from .api_error import ApiError
from .api_token import ApiToken from .api_token import ApiToken
from .api_token_results_page import ApiTokenResultsPage from .api_token_results_page import ApiTokenResultsPage
from .app_client_info import AppClientInfo from .app_client_info import AppClientInfo
@ -28,39 +30,50 @@ from .async_api_call_results_page import AsyncApiCallResultsPage
from .async_api_call_type import AsyncApiCallType from .async_api_call_type import AsyncApiCallType
from .axis import Axis from .axis import Axis
from .axis_direction_pair import AxisDirectionPair from .axis_direction_pair import AxisDirectionPair
from .base64data import Base64Data
from .billing_info import BillingInfo from .billing_info import BillingInfo
from .cache_metadata import CacheMetadata from .cache_metadata import CacheMetadata
from .camera_drag_interaction_type import CameraDragInteractionType from .camera_drag_interaction_type import CameraDragInteractionType
from .card_details import CardDetails from .card_details import CardDetails
from .center_of_mass import CenterOfMass
from .client_metrics import ClientMetrics
from .cluster import Cluster from .cluster import Cluster
from .code_language import CodeLanguage from .code_language import CodeLanguage
from .code_output import CodeOutput from .code_output import CodeOutput
from .color import Color from .color import Color
from .commit import Commit
from .connection import Connection from .connection import Connection
from .country_code import CountryCode from .country_code import CountryCode
from .coupon import Coupon from .coupon import Coupon
from .created_at_sort_mode import CreatedAtSortMode from .created_at_sort_mode import CreatedAtSortMode
from .currency import Currency from .currency import Currency
from .curve_get_control_points import CurveGetControlPoints
from .curve_get_end_points import CurveGetEndPoints
from .curve_get_type import CurveGetType
from .curve_type import CurveType
from .customer import Customer from .customer import Customer
from .customer_balance import CustomerBalance from .customer_balance import CustomerBalance
from .density import Density
from .device_access_token_request_form import DeviceAccessTokenRequestForm from .device_access_token_request_form import DeviceAccessTokenRequestForm
from .device_auth_request_form import DeviceAuthRequestForm from .device_auth_request_form import DeviceAuthRequestForm
from .device_auth_verify_params import DeviceAuthVerifyParams from .device_auth_verify_params import DeviceAuthVerifyParams
from .direction import Direction from .direction import Direction
from .discount import Discount from .discount import Discount
from .docker_system_info import DockerSystemInfo
from .email_authentication_form import EmailAuthenticationForm from .email_authentication_form import EmailAuthenticationForm
from .engine_metadata import EngineMetadata from .empty import Empty
from .entity_get_all_child_uuids import EntityGetAllChildUuids
from .entity_get_child_uuid import EntityGetChildUuid
from .entity_get_num_children import EntityGetNumChildren
from .entity_get_parent_id import EntityGetParentId
from .entity_type import EntityType from .entity_type import EntityType
from .environment import Environment from .environment import Environment
from .error import Error from .error import Error
from .error_code import ErrorCode from .error_code import ErrorCode
from .error_response import ErrorResponse from .export import Export
from .executor_metadata import ExecutorMetadata
from .export_file import ExportFile from .export_file import ExportFile
from .extended_user import ExtendedUser from .extended_user import ExtendedUser
from .extended_user_results_page import ExtendedUserResultsPage from .extended_user_results_page import ExtendedUserResultsPage
from .failure_web_socket_response import FailureWebSocketResponse
from .fbx_storage import FbxStorage
from .file_center_of_mass import FileCenterOfMass from .file_center_of_mass import FileCenterOfMass
from .file_conversion import FileConversion from .file_conversion import FileConversion
from .file_density import FileDensity from .file_density import FileDensity
@ -71,9 +84,15 @@ from .file_surface_area import FileSurfaceArea
from .file_system_metadata import FileSystemMetadata 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 .gltf_presentation import GltfPresentation
from .gltf_storage import GltfStorage
from .highlight_set_entity import HighlightSetEntity
from .ice_server import IceServer from .ice_server import IceServer
from .image_format import ImageFormat
from .image_type import ImageType from .image_type import ImageType
from .index_info import IndexInfo from .import_file import ImportFile
from .import_files import ImportFiles
from .input_format import InputFormat from .input_format import InputFormat
from .invoice import Invoice from .invoice import Invoice
from .invoice_line_item import InvoiceLineItem from .invoice_line_item import InvoiceLineItem
@ -83,52 +102,56 @@ from .jetstream_api_stats import JetstreamApiStats
from .jetstream_config import JetstreamConfig 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 .mesh import Mesh 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 .modeling_cmd_req_batch import ModelingCmdReqBatch
from .modeling_error import ModelingError
from .modeling_outcome import ModelingOutcome
from .modeling_outcomes import ModelingOutcomes
from .new_address import NewAddress from .new_address import NewAddress
from .o_auth2_client_info import OAuth2ClientInfo from .o_auth2_client_info import OAuth2ClientInfo
from .o_auth2_grant_type import OAuth2GrantType from .o_auth2_grant_type import OAuth2GrantType
from .ok_modeling_cmd_response import OkModelingCmdResponse from .ok_modeling_cmd_response import OkModelingCmdResponse
from .ok_web_socket_response_data import OkWebSocketResponseData
from .onboarding import Onboarding 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_get_curve_uuids_for_vertices import PathGetCurveUuidsForVertices
from .path_get_info import PathGetInfo
from .path_segment import PathSegment from .path_segment import PathSegment
from .path_segment_info import PathSegmentInfo
from .payment_intent import PaymentIntent from .payment_intent import PaymentIntent
from .payment_method import PaymentMethod from .payment_method import PaymentMethod
from .payment_method_card_checks import PaymentMethodCardChecks from .payment_method_card_checks import PaymentMethodCardChecks
from .payment_method_type import PaymentMethodType from .payment_method_type import PaymentMethodType
from .plugins_info import PluginsInfo from .plane_intersect_and_project import PlaneIntersectAndProject
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 .point_e_metadata import PointEMetadata
from .pong import Pong from .pong import Pong
from .raw_file import RawFile from .raw_file import RawFile
from .registry_service_config import RegistryServiceConfig
from .rtc_ice_candidate import RtcIceCandidate
from .rtc_ice_candidate_init import RtcIceCandidateInit from .rtc_ice_candidate_init import RtcIceCandidateInit
from .rtc_ice_candidate_type import RtcIceCandidateType
from .rtc_ice_protocol import RtcIceProtocol
from .rtc_sdp_type import RtcSdpType from .rtc_sdp_type import RtcSdpType
from .rtc_session_description import RtcSessionDescription from .rtc_session_description import RtcSessionDescription
from .runtime import Runtime
from .scene_selection_type import SceneSelectionType from .scene_selection_type import SceneSelectionType
from .scene_tool_type import SceneToolType
from .select_get import SelectGet
from .select_with_point import SelectWithPoint
from .session import Session from .session import Session
from .snake_case_result import SnakeCaseResult from .solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces
from .storage import Storage from .solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges
from .solid3d_get_next_adjacent_edge import Solid3dGetNextAdjacentEdge
from .solid3d_get_opposite_edge import Solid3dGetOppositeEdge
from .solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge
from .stl_storage import StlStorage
from .success_web_socket_response import SuccessWebSocketResponse
from .surface_area import SurfaceArea
from .system import System from .system import System
from .system_info_cgroup_driver_enum import SystemInfoCgroupDriverEnum from .take_snapshot import TakeSnapshot
from .system_info_cgroup_version_enum import SystemInfoCgroupVersionEnum
from .system_info_default_address_pools import SystemInfoDefaultAddressPools
from .system_info_isolation_enum import SystemInfoIsolationEnum
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
@ -161,5 +184,6 @@ 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 .verification_token import VerificationToken from .verification_token import VerificationToken
from .web_socket_messages import WebSocketMessages from .volume import Volume
from .web_socket_responses import WebSocketResponses from .web_socket_request import WebSocketRequest
from .web_socket_response import WebSocketResponse

View File

@ -3,11 +3,10 @@ from enum import Enum
class AccountProvider(str, Enum): class AccountProvider(str, Enum):
""" An account provider. """ # noqa: E501 """ An account provider. """ # noqa: E501
"""# 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

@ -7,11 +7,9 @@ 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
@ -28,11 +26,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
@ -50,6 +48,7 @@ class AiPluginApi:
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,9 +3,8 @@ 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,11 +8,9 @@ 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
@ -28,9 +26,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
@ -51,6 +49,7 @@ class AiPluginAuth:
else: else:
type = _type # type: ignore[arg-type] type = _type # type: ignore[arg-type]
ai_plugin_auth = cls( ai_plugin_auth = cls(
authorization_type= authorization_type, authorization_type= authorization_type,
type= type, type= type,

View File

@ -3,15 +3,14 @@ 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,11 +3,10 @@ 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

@ -8,14 +8,11 @@ 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). 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
""" # 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
@ -47,25 +44,25 @@ class AiPluginManifest:
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 field_dict['api'] = api
if auth is not UNSET: if auth is not UNSET:
field_dict["auth"] = auth field_dict['auth'] = auth
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
@ -102,6 +99,7 @@ class AiPluginManifest:
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,

68
kittycad/models/angle.py Normal file
View File

@ -0,0 +1,68 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.unit_angle import UnitAngle
from ..types import UNSET, Unset
GO = TypeVar("GO", bound="Angle")
@attr.s(auto_attribs=True)
class Angle:
""" An angle, with a specific unit. """ # noqa: E501
unit: Union[Unset, UnitAngle] = UNSET
value: Union[Unset, float] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
if not isinstance(self.unit, Unset):
unit = self.unit
value = self.value
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if unit is not UNSET:
field_dict['unit'] = unit
if value is not UNSET:
field_dict['value'] = value
return field_dict
@classmethod
def from_dict(cls: Type[GO], src_dict: Dict[str, Any]) -> GO:
d = src_dict.copy()
_unit = d.pop("unit", UNSET)
unit: Union[Unset, UnitAngle]
if isinstance(_unit, Unset):
unit = UNSET
else:
unit = _unit # type: ignore[arg-type]
value = d.pop("value", UNSET)
angle = cls(
unit= unit,
value= value,
)
angle.additional_properties = d
return angle
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -3,9 +3,8 @@ 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'
NONE = "none" ARROW = 'arrow'
ARROW = "arrow"
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -5,13 +5,11 @@ 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
GO = TypeVar("GO", bound="AnnotationLineEndOptions") PI = TypeVar("PI", 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
@ -27,14 +25,14 @@ 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[GO], src_dict: Dict[str, Any]) -> GO: def from_dict(cls: Type[PI], src_dict: Dict[str, Any]) -> PI:
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]
@ -50,6 +48,7 @@ class AnnotationLineEndOptions:
else: else:
start = _start # type: ignore[arg-type] start = _start # type: ignore[arg-type]
annotation_line_end_options = cls( annotation_line_end_options = cls(
end= end, end= end,
start= start, start= start,

View File

@ -8,13 +8,11 @@ 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
PI = TypeVar("PI", bound="AnnotationOptions") UZ = TypeVar("UZ", 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
@ -38,20 +36,20 @@ 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 field_dict['color'] = color
if line_ends is not UNSET: if line_ends is not UNSET:
field_dict["line_ends"] = line_ends field_dict['line_ends'] = line_ends
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 field_dict['position'] = position
if text is not UNSET: if text is not UNSET:
field_dict["text"] = text field_dict['text'] = text
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[UZ], src_dict: Dict[str, Any]) -> UZ:
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]
@ -83,6 +81,7 @@ class AnnotationOptions:
else: else:
text = _text # type: ignore[arg-type] text = _text # type: ignore[arg-type]
annotation_options = cls( annotation_options = cls(
color= color, color= color,
line_ends= line_ends, line_ends= line_ends,

View File

@ -3,10 +3,9 @@ from enum import Enum
class AnnotationTextAlignmentX(str, Enum): class AnnotationTextAlignmentX(str, Enum):
""" Horizontal Text aligment """ # noqa: E501 """ Horizontal Text aligment """ # noqa: E501
LEFT = 'left'
LEFT = "left" CENTER = 'center'
CENTER = "center" RIGHT = 'right'
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