* bump

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

* some fixes

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

* YOYO NEW API SPEC!

* reformat

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

* updates

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

* updates

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

* fixups

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

* for now force true

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

* run the tests on generations

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

* add tests

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

* update

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

* update

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

* update

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

* updates

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

* update

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

* fix some types

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

* float to top

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

* fix mypy

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

* more noqa

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

* fixups

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

* ruff pass

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

* add docs

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

* fix

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

* fix

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

* fix

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

* fixes

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

* even less mypy errors

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

* updates

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

* updates

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

* updates

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

* updates

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

* add test

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

* fixes

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

* updates

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

* fixes

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

* updates

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

* fixups

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

* fixes

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

* cleanup

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

* updates

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

* fix

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

* updates

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

* fix

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

* new path

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

* fixes for mypy

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

* skip tests

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>
This commit is contained in:
Jess Frazelle
2023-05-04 00:58:06 -07:00
committed by GitHub
parent 8877a3c146
commit fcd317aae4
3187 changed files with 349073 additions and 84754 deletions

View File

@ -1 +1 @@
""" Contains methods for accessing the ai API paths: AI uses machine learning to generate 3D meshes. """
""" Contains methods for accessing the ai API paths: AI uses machine learning to generate 3D meshes. """ # noqa: E501

View File

@ -1,130 +1,133 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.mesh import Mesh
from ...models.error import Error
from ...models.image_type import ImageType
from ...models.file_export_format import FileExportFormat
from ...models.image_type import ImageType
from ...models.mesh import Mesh
from ...types import Response
def _get_kwargs(
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/ai/image-to-3d/{input_format}/{output_format}".format(client.base_url, input_format=input_format, output_format=output_format)
url = "{}/ai/image-to-3d/{input_format}/{output_format}".format(
client.base_url, input_format=input_format, output_format=output_format
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Mesh, Error]]:
if response.status_code == 200:
response_200 = Mesh.from_dict(response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
if response.status_code == 200:
response_200 = Mesh.from_dict(response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Mesh, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, Mesh, Error]]:
kwargs = _get_kwargs(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, 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. """
"""This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501
return sync_detailed(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
).parsed
return sync_detailed(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, Mesh, Error]]:
kwargs = _get_kwargs(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
input_format: ImageType,
output_format: FileExportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, 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. """
"""This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501
return (
await asyncio_detailed(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
input_format=input_format,
output_format=output_format,
body=body,
client=client,
)
).parsed

View File

@ -1,119 +1,127 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.mesh import Mesh
from ...models.error import Error
from ...models.file_export_format import FileExportFormat
from ...models.mesh import Mesh
from ...types import Response
def _get_kwargs(
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/ai/text-to-3d/{output_format}?prompt={prompt}".format(client.base_url, output_format=output_format, prompt=prompt)
url = "{}/ai/text-to-3d/{output_format}".format(
client.base_url, output_format=output_format
) # noqa: E501
if prompt is not None:
if "?" in url:
url = url + "&prompt=" + str(prompt)
else:
url = url + "?prompt=" + str(prompt)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Mesh, Error]]:
if response.status_code == 200:
response_200 = Mesh.from_dict(response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
if response.status_code == 200:
response_200 = Mesh.from_dict(response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Mesh, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
) -> Response[Union[Any, Mesh, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
prompt=prompt,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
prompt=prompt,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
) -> Optional[Union[Any, 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. """
"""This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501
return sync_detailed(
output_format=output_format,
prompt=prompt,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
prompt=prompt,
client=client,
).parsed
async def asyncio_detailed(
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
) -> Response[Union[Any, Mesh, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
prompt=prompt,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
prompt=prompt,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
output_format: FileExportFormat,
prompt: str,
*,
client: Client,
) -> Optional[Union[Any, 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. """
"""This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
prompt=prompt,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
prompt=prompt,
client=client,
)
).parsed

View File

@ -1 +1 @@
""" Contains methods for accessing the api_calls API paths: API calls that have been performed by users can be queried by the API. This is helpful for debugging as well as billing. """
""" Contains methods for accessing the api_calls API paths: API calls that have been performed by users can be queried by the API. This is helpful for debugging as well as billing. """ # noqa: E501

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -7,107 +7,112 @@ from ...models.api_call_with_price import ApiCallWithPrice
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/api-calls/{id}".format(client.base_url, id=id)
url = "{}/api-calls/{id}".format(client.base_url, id=id) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPrice.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPrice.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiCallWithPrice, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, ApiCallWithPrice, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Response[Union[Any, ApiCallWithPrice, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.
If the user is not authenticated to view the specified API call, then it is not returned.
Only KittyCAD employees can view API calls for other users. """
"""This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.
If the user is not authenticated to view the specified API call, then it is not returned.
Only KittyCAD employees can view API calls for other users.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Response[Union[Any, ApiCallWithPrice, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.
If the user is not authenticated to view the specified API call, then it is not returned.
Only KittyCAD employees can view API calls for other users. """
"""This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.
If the user is not authenticated to view the specified API call, then it is not returned.
Only KittyCAD employees can view API calls for other users.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -7,103 +7,108 @@ from ...models.api_call_with_price import ApiCallWithPrice
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/api-calls/{id}".format(client.base_url, id=id)
url = "{}/user/api-calls/{id}".format(client.base_url, id=id) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPrice.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPrice.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiCallWithPrice, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, ApiCallWithPrice, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Response[Union[Any, ApiCallWithPrice, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Optional[Union[Any, 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.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Response[Union[Any, ApiCallWithPrice, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Optional[Union[Any, 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.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -1,113 +1,120 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union
import httpx
from ...client import Client
from ...models.api_call_query_group import ApiCallQueryGroup
from ...models.error import Error
from ...models.api_call_query_group_by import ApiCallQueryGroupBy
from ...models.error import Error
from ...types import Response
def _get_kwargs(
group_by: ApiCallQueryGroupBy,
*,
client: Client,
group_by: ApiCallQueryGroupBy,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/api-call-metrics?group_by={group_by}".format(client.base_url, group_by=group_by)
url = "{}/api-call-metrics".format(client.base_url) # noqa: E501
if group_by is not None:
if "?" in url:
url = url + "&group_by=" + str(group_by)
else:
url = url + "?group_by=" + str(group_by)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, [ApiCallQueryGroup], Error]]:
if response.status_code == 200:
response_200 = [
ApiCallQueryGroup.from_dict(item)
for item in 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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, List[ApiCallQueryGroup], Error]]:
if response.status_code == 200:
response_200 = [ApiCallQueryGroup.from_dict(item) for item in 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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, [ApiCallQueryGroup], Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, List[ApiCallQueryGroup], Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
group_by: ApiCallQueryGroupBy,
*,
client: Client,
) -> Response[Union[Any, [ApiCallQueryGroup], Error]]:
kwargs = _get_kwargs(
group_by=group_by,
client=client,
)
group_by: ApiCallQueryGroupBy,
*,
client: Client,
) -> Response[Union[Any, List[ApiCallQueryGroup], Error]]:
kwargs = _get_kwargs(
group_by=group_by,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
group_by: ApiCallQueryGroupBy,
*,
client: Client,
) -> Optional[Union[Any, [ApiCallQueryGroup], Error]]:
""" This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed. """
group_by: ApiCallQueryGroupBy,
*,
client: Client,
) -> Optional[Union[Any, List[ApiCallQueryGroup], Error]]:
"""This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.""" # noqa: E501
return sync_detailed(
group_by=group_by,
client=client,
).parsed
return sync_detailed(
group_by=group_by,
client=client,
).parsed
async def asyncio_detailed(
group_by: ApiCallQueryGroupBy,
*,
client: Client,
) -> Response[Union[Any, [ApiCallQueryGroup], Error]]:
kwargs = _get_kwargs(
group_by=group_by,
client=client,
)
group_by: ApiCallQueryGroupBy,
*,
client: Client,
) -> Response[Union[Any, List[ApiCallQueryGroup], Error]]:
kwargs = _get_kwargs(
group_by=group_by,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
group_by: ApiCallQueryGroupBy,
*,
client: Client,
) -> Optional[Union[Any, [ApiCallQueryGroup], Error]]:
""" This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed. """
group_by: ApiCallQueryGroupBy,
*,
client: Client,
) -> Optional[Union[Any, List[ApiCallQueryGroup], Error]]:
"""This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.""" # noqa: E501
return (
await asyncio_detailed(
group_by=group_by,
client=client,
)
).parsed
return (
await asyncio_detailed(
group_by=group_by,
client=client,
)
).parsed

View File

@ -1,161 +1,244 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_conversion import FileConversion
from ...models.file_center_of_mass import FileCenterOfMass
from ...models.file_mass import FileMass
from ...models.file_volume import FileVolume
from ...models.file_density import FileDensity
from ...models.file_surface_area import FileSurfaceArea
from ...models.error import Error
from ...models.file_center_of_mass import FileCenterOfMass
from ...models.file_conversion import FileConversion
from ...models.file_density import FileDensity
from ...models.file_mass import FileMass
from ...models.file_surface_area import FileSurfaceArea
from ...models.file_volume import FileVolume
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/async/operations/{id}".format(client.base_url, id=id)
url = "{}/async/operations/{id}".format(client.base_url, id=id) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
if response.status_code == 200:
data = response.json()
try:
if not isinstance(data, dict):
raise TypeError()
option = FileConversion.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileCenterOfMass.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileMass.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileVolume.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileDensity.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileSurfaceArea.from_dict(data)
return option
except:
raise
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
Error,
]
]:
if response.status_code == 200:
data = response.json()
try:
if not isinstance(data, dict):
raise TypeError()
option_file_conversion = FileConversion.from_dict(data)
return option_file_conversion
except ValueError:
pass
except TypeError:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option_file_center_of_mass = FileCenterOfMass.from_dict(data)
return option_file_center_of_mass
except ValueError:
pass
except TypeError:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option_file_mass = FileMass.from_dict(data)
return option_file_mass
except ValueError:
pass
except TypeError:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option_file_volume = FileVolume.from_dict(data)
return option_file_volume
except ValueError:
pass
except TypeError:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option_file_density = FileDensity.from_dict(data)
return option_file_density
except ValueError:
pass
except TypeError:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option_file_surface_area = FileSurfaceArea.from_dict(data)
return option_file_surface_area
except ValueError:
raise
except TypeError:
raise
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
Error,
]
]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
id: str,
*,
client: Client,
) -> Response[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
Error,
]
]:
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" 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.
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. """
id: str,
*,
client: Client,
) -> Optional[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
Error,
]
]:
"""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.
If the user is not authenticated to view the specified async operation, then it is not returned.
Only KittyCAD employees with the proper access can view async operations for other users.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
id: str,
*,
client: Client,
) -> Response[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
Error,
]
]:
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" 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.
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. """
id: str,
*,
client: Client,
) -> Optional[
Union[
Any,
FileConversion,
FileCenterOfMass,
FileMass,
FileVolume,
FileDensity,
FileSurfaceArea,
Error,
]
]:
"""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.
If the user is not authenticated to view the specified async operation, then it is not returned.
Only KittyCAD employees with the proper access can view async operations for other users.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -1,128 +1,148 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.api_call_with_price_results_page import ApiCallWithPriceResultsPage
from ...models.error import Error
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...models.error import Error
from ...types import Response
def _get_kwargs(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/api-calls?limit={limit}&page_token={page_token}&sort_by={sort_by}".format(client.base_url, limit=limit, page_token=page_token, sort_by=sort_by)
url = "{}/api-calls".format(client.base_url) # noqa: E501
if limit is not None:
if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)
if page_token is not None:
if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)
if sort_by is not None:
if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[Any, 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. """
"""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(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
).parsed
return sync_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
).parsed
async def asyncio_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[Any, 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. """
"""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 (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -1,143 +1,163 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.api_call_with_price_results_page import ApiCallWithPriceResultsPage
from ...models.error import Error
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
id: str,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/users/{id}/api-calls?limit={limit}&page_token={page_token}&sort_by={sort_by}".format(client.base_url, id=id, limit=limit, page_token=page_token, sort_by=sort_by)
url = "{}/users/{id}/api-calls".format(client.base_url, id=id) # noqa: E501
if limit is not None:
if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)
if page_token is not None:
if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)
if sort_by is not None:
if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
id: str,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
kwargs = _get_kwargs(
id=id,
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
kwargs = _get_kwargs(
id=id,
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
id: str,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
id: str,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if "me" is passed as the user id.
Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.
If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.
The API calls are returned in order of creation, with the most recently created API calls first. """
"""This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if "me" is passed as the user id.
Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.
If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.
The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501
return sync_detailed(
id=id,
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
).parsed
return sync_detailed(
id=id,
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
).parsed
async def asyncio_detailed(
id: str,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
id: str,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
kwargs = _get_kwargs(
id=id,
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
kwargs = _get_kwargs(
id=id,
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
id: str,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
id: str,
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[Any, ApiCallWithPriceResultsPage, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if "me" is passed as the user id.
Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.
If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.
The API calls are returned in order of creation, with the most recently created API calls first. """
"""This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if "me" is passed as the user id.
Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.
If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.
The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed
return (
await asyncio_detailed(
id=id,
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -1,140 +1,165 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.async_api_call_results_page import AsyncApiCallResultsPage
from ...models.error import Error
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...models.api_call_status import ApiCallStatus
from ...models.async_api_call_results_page import AsyncApiCallResultsPage
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...models.error import Error
from ...types import Response
def _get_kwargs(
sort_by: CreatedAtSortMode,
status: ApiCallStatus,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
sort_by: CreatedAtSortMode,
status: ApiCallStatus,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/async/operations?limit={limit}&page_token={page_token}&sort_by={sort_by}&status={status}".format(client.base_url, limit=limit, page_token=page_token, sort_by=sort_by, status=status)
url = "{}/async/operations".format(client.base_url) # noqa: E501
if limit is not None:
if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)
if page_token is not None:
if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)
if sort_by is not None:
if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
url = url + "?sort_by=" + str(sort_by)
if status is not None:
if "?" in url:
url = url + "&status=" + str(status)
else:
url = url + "?status=" + str(status)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, AsyncApiCallResultsPage, Error]]:
if response.status_code == 200:
response_200 = AsyncApiCallResultsPage.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, AsyncApiCallResultsPage, Error]]:
if response.status_code == 200:
response_200 = AsyncApiCallResultsPage.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, AsyncApiCallResultsPage, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, AsyncApiCallResultsPage, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
sort_by: CreatedAtSortMode,
status: ApiCallStatus,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
sort_by: CreatedAtSortMode,
status: ApiCallStatus,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Union[Any, AsyncApiCallResultsPage, Error]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
status=status,
client=client,
)
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
status=status,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
sort_by: CreatedAtSortMode,
status: ApiCallStatus,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
sort_by: CreatedAtSortMode,
status: ApiCallStatus,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[Any, AsyncApiCallResultsPage, Error]]:
""" For async file conversion operations, this endpoint does not return the contents of converted files (`output`). To get the contents use the `/async/operations/{id}` endpoint.
This endpoint requires authentication by a KittyCAD employee. """
"""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
return sync_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
status=status,
client=client,
).parsed
return sync_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
status=status,
client=client,
).parsed
async def asyncio_detailed(
sort_by: CreatedAtSortMode,
status: ApiCallStatus,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
sort_by: CreatedAtSortMode,
status: ApiCallStatus,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Union[Any, AsyncApiCallResultsPage, Error]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
status=status,
client=client,
)
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
status=status,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
sort_by: CreatedAtSortMode,
status: ApiCallStatus,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
sort_by: CreatedAtSortMode,
status: ApiCallStatus,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[Any, AsyncApiCallResultsPage, Error]]:
""" For async file conversion operations, this endpoint does not return the contents of converted files (`output`). To get the contents use the `/async/operations/{id}` endpoint.
This endpoint requires authentication by a KittyCAD employee. """
"""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
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
status=status,
client=client,
)
).parsed
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
status=status,
client=client,
)
).parsed

View File

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

View File

@ -1 +1 @@
""" Contains methods for accessing the api_tokens API paths: API tokens allow users to call the API outside of their session token that is used as a cookie in the user interface. Users can create, delete, and list their API tokens. But, of course, you need an API token to do this, so first be sure to generate one in the account UI. """
""" Contains methods for accessing the api_tokens API paths: API tokens allow users to call the API outside of their session token that is used as a cookie in the user interface. Users can create, delete, and list their API tokens. But, of course, you need an API token to do this, so first be sure to generate one in the account UI. """ # noqa: E501

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -7,94 +7,99 @@ from ...models.api_token import ApiToken
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/api-tokens".format(client.base_url)
url = "{}/user/api-tokens".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, ApiToken, Error]]:
if response.status_code == 201:
response_201 = ApiToken.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, ApiToken, Error]]:
if response.status_code == 201:
response_201 = ApiToken.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiToken, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, ApiToken, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, ApiToken, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, ApiToken, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user. """
"""This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, ApiToken, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, ApiToken, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user. """
"""This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -6,105 +6,108 @@ from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
token: str,
*,
client: Client,
token: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/api-tokens/{token}".format(client.base_url, token=token)
url = "{}/user/api-tokens/{token}".format(
client.base_url, token=token
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
token: str,
*,
client: Client,
token: str,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
kwargs = _get_kwargs(
token=token,
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
token: str,
*,
client: Client,
token: str,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.
This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes. """
"""This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.
This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.""" # noqa: E501
return sync_detailed(
token=token,
client=client,
).parsed
return sync_detailed(
token=token,
client=client,
).parsed
async def asyncio_detailed(
token: str,
*,
client: Client,
token: str,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
kwargs = _get_kwargs(
token=token,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
token: str,
*,
client: Client,
token: str,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.
This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes. """
"""This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.
This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.""" # noqa: E501
return (
await asyncio_detailed(
token=token,
client=client,
)
).parsed
return (
await asyncio_detailed(
token=token,
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -7,103 +7,110 @@ from ...models.api_token import ApiToken
from ...models.error import Error
from ...types import Response
def _get_kwargs(
token: str,
*,
client: Client,
token: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/api-tokens/{token}".format(client.base_url, token=token)
url = "{}/user/api-tokens/{token}".format(
client.base_url, token=token
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, ApiToken, Error]]:
if response.status_code == 200:
response_200 = ApiToken.from_dict(response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, ApiToken, Error]]:
if response.status_code == 200:
response_200 = ApiToken.from_dict(response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiToken, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, ApiToken, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
token: str,
*,
client: Client,
token: str,
*,
client: Client,
) -> Response[Union[Any, ApiToken, Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
kwargs = _get_kwargs(
token=token,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
token: str,
*,
client: Client,
token: str,
*,
client: Client,
) -> Optional[Union[Any, ApiToken, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user. """
"""This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501
return sync_detailed(
token=token,
client=client,
).parsed
return sync_detailed(
token=token,
client=client,
).parsed
async def asyncio_detailed(
token: str,
*,
client: Client,
token: str,
*,
client: Client,
) -> Response[Union[Any, ApiToken, Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
kwargs = _get_kwargs(
token=token,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
token: str,
*,
client: Client,
token: str,
*,
client: Client,
) -> Optional[Union[Any, ApiToken, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user. """
"""This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501
return (
await asyncio_detailed(
token=token,
client=client,
)
).parsed
return (
await asyncio_detailed(
token=token,
client=client,
)
).parsed

View File

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

View File

@ -1 +1 @@
""" Contains methods for accessing the apps API paths: Endpoints for third party app grant flows. """
""" Contains methods for accessing the apps API paths: Endpoints for third party app grant flows. """ # noqa: E501

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -6,96 +6,97 @@ from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/apps/github/callback".format(client.base_url)
url = "{}/apps/github/callback".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos.
The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos. """
"""This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos.
The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos.
The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos. """
"""This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos.
The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -7,96 +7,101 @@ from ...models.app_client_info import AppClientInfo
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/apps/github/consent".format(client.base_url)
url = "{}/apps/github/consent".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, AppClientInfo, Error]]:
if response.status_code == 200:
response_200 = AppClientInfo.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, AppClientInfo, Error]]:
if response.status_code == 200:
response_200 = AppClientInfo.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, AppClientInfo, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, AppClientInfo, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, AppClientInfo, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, AppClientInfo, Error]]:
""" This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos.
The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos. """
"""This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos.
The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, AppClientInfo, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, AppClientInfo, Error]]:
""" This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos.
The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos. """
"""This is different than OAuth 2.0 authentication for users. This endpoint grants access for KittyCAD to access user's repos.
The user doesn't need KittyCAD OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -6,104 +6,105 @@ from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
body: bytes,
*,
client: Client,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/apps/github/webhook".format(client.base_url)
url = "{}/apps/github/webhook".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: bytes,
*,
client: Client,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
body: bytes,
*,
client: Client,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" These come from the GitHub app. """
"""These come from the GitHub app.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: bytes,
*,
client: Client,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
body: bytes,
*,
client: Client,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" These come from the GitHub app. """
"""These come from the GitHub app.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -1 +1 @@
""" Contains methods for accessing the beta API paths: Beta API endpoints. We will not charge for these endpoints while they are in beta. """
""" Contains methods for accessing the beta API paths: Beta API endpoints. We will not charge for these endpoints while they are in beta. """ # noqa: E501

View File

@ -1 +1 @@
""" Contains methods for accessing the constant API paths: Constants. These are helpful as helpers. """
""" Contains methods for accessing the constant API paths: Constants. These are helpful as helpers. """ # noqa: E501

View File

@ -1,108 +1,115 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.physics_constant import PhysicsConstant
from ...models.error import Error
from ...models.physics_constant import PhysicsConstant
from ...models.physics_constant_name import PhysicsConstantName
from ...types import Response
def _get_kwargs(
constant: PhysicsConstantName,
*,
client: Client,
constant: PhysicsConstantName,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/constant/physics/{constant}".format(client.base_url, constant=constant)
url = "{}/constant/physics/{constant}".format(
client.base_url, constant=constant
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, PhysicsConstant, Error]]:
if response.status_code == 200:
response_200 = PhysicsConstant.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, PhysicsConstant, Error]]:
if response.status_code == 200:
response_200 = PhysicsConstant.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, PhysicsConstant, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, PhysicsConstant, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
constant: PhysicsConstantName,
*,
client: Client,
constant: PhysicsConstantName,
*,
client: Client,
) -> Response[Union[Any, PhysicsConstant, Error]]:
kwargs = _get_kwargs(
constant=constant,
client=client,
)
kwargs = _get_kwargs(
constant=constant,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
constant: PhysicsConstantName,
*,
client: Client,
constant: PhysicsConstantName,
*,
client: Client,
) -> Optional[Union[Any, PhysicsConstant, Error]]:
return sync_detailed(
constant=constant,
client=client,
).parsed
return sync_detailed(
constant=constant,
client=client,
).parsed
async def asyncio_detailed(
constant: PhysicsConstantName,
*,
client: Client,
constant: PhysicsConstantName,
*,
client: Client,
) -> Response[Union[Any, PhysicsConstant, Error]]:
kwargs = _get_kwargs(
constant=constant,
client=client,
)
kwargs = _get_kwargs(
constant=constant,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
constant: PhysicsConstantName,
*,
client: Client,
constant: PhysicsConstantName,
*,
client: Client,
) -> Optional[Union[Any, PhysicsConstant, Error]]:
return (
await asyncio_detailed(
constant=constant,
client=client,
)
).parsed
return (
await asyncio_detailed(
constant=constant,
client=client,
)
).parsed

View File

@ -1 +1 @@
""" Contains methods for accessing the drawing API paths: Drawing API for updating your 3D files using the KittyCAD engine. """
""" Contains methods for accessing the drawing API paths: Drawing API for updating your 3D files using the KittyCAD engine. """ # noqa: E501

View File

@ -1,111 +1,111 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.dict import dict
from ...models.error import Error
from ...models.drawing_cmd_req import DrawingCmdReq
from ...models.error import Error
from ...types import Response
def _get_kwargs(
body: DrawingCmdReq,
*,
client: Client,
body: DrawingCmdReq,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/drawing/cmd".format(client.base_url)
url = "{}/drawing/cmd".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, 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 None
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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, dict, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: DrawingCmdReq,
*,
client: Client,
body: DrawingCmdReq,
*,
client: Client,
) -> Response[Union[Any, dict, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
body: DrawingCmdReq,
*,
client: Client,
body: DrawingCmdReq,
*,
client: Client,
) -> Optional[Union[Any, dict, Error]]:
""" Response depends on which command was submitted, so unfortunately the OpenAPI schema can't generate the right response type. """
"""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
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: DrawingCmdReq,
*,
client: Client,
body: DrawingCmdReq,
*,
client: Client,
) -> Response[Union[Any, dict, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
body: DrawingCmdReq,
*,
client: Client,
body: DrawingCmdReq,
*,
client: Client,
) -> Optional[Union[Any, dict, Error]]:
""" Response depends on which command was submitted, so unfortunately the OpenAPI schema can't generate the right response type. """
"""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
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -1,109 +1,114 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.drawing_cmd_req_batch import DrawingCmdReqBatch
from ...models.drawing_outcomes import DrawingOutcomes
from ...models.error import Error
from ...models.drawing_cmd_req_batch import DrawingCmdReqBatch
from ...types import Response
def _get_kwargs(
body: DrawingCmdReqBatch,
*,
client: Client,
body: DrawingCmdReqBatch,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/drawing/cmd_batch".format(client.base_url)
url = "{}/drawing/cmd_batch".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, DrawingOutcomes, Error]]:
if response.status_code == 200:
response_200 = DrawingOutcomes.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, DrawingOutcomes, Error]]:
if response.status_code == 200:
response_200 = DrawingOutcomes.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, DrawingOutcomes, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, DrawingOutcomes, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: DrawingCmdReqBatch,
*,
client: Client,
body: DrawingCmdReqBatch,
*,
client: Client,
) -> Response[Union[Any, DrawingOutcomes, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
body: DrawingCmdReqBatch,
*,
client: Client,
body: DrawingCmdReqBatch,
*,
client: Client,
) -> Optional[Union[Any, DrawingOutcomes, Error]]:
return sync_detailed(
body=body,
client=client,
).parsed
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: DrawingCmdReqBatch,
*,
client: Client,
body: DrawingCmdReqBatch,
*,
client: Client,
) -> Response[Union[Any, DrawingOutcomes, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
body: DrawingCmdReqBatch,
*,
client: Client,
body: DrawingCmdReqBatch,
*,
client: Client,
) -> Optional[Union[Any, DrawingOutcomes, Error]]:
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1 @@
""" Contains methods for accessing the executor API paths: Endpoints that allow for code execution or creation of code execution environments. """ # noqa: E501

View File

@ -0,0 +1,95 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/ws/executor/term".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(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any,]]:
return None
return None
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any,]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Union[Any,]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Any,]]:
"""Attach to a docker container to create an interactive terminal.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Union[Any,]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[Any,]]:
"""Attach to a docker container to create an interactive terminal.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,137 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.code_language import CodeLanguage
from ...models.code_output import CodeOutput
from ...models.error import Error
from ...types import Response
def _get_kwargs(
lang: CodeLanguage,
body: bytes,
*,
client: Client,
output: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/file/execute/{lang}".format(client.base_url, lang=lang) # noqa: E501
if output is not None:
if "?" in url:
url = url + "&output=" + str(output)
else:
url = url + "?output=" + str(output)
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[Any, CodeOutput, Error]]:
if response.status_code == 200:
response_200 = CodeOutput.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 None
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, CodeOutput, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
lang: CodeLanguage,
body: bytes,
*,
client: Client,
output: Optional[str] = None,
) -> Response[Union[Any, CodeOutput, Error]]:
kwargs = _get_kwargs(
lang=lang,
output=output,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
lang: CodeLanguage,
body: bytes,
*,
client: Client,
output: Optional[str] = None,
) -> Optional[Union[Any, CodeOutput, Error]]:
return sync_detailed(
lang=lang,
output=output,
body=body,
client=client,
).parsed
async def asyncio_detailed(
lang: CodeLanguage,
body: bytes,
*,
client: Client,
output: Optional[str] = None,
) -> Response[Union[Any, CodeOutput, Error]]:
kwargs = _get_kwargs(
lang=lang,
output=output,
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(
lang: CodeLanguage,
body: bytes,
*,
client: Client,
output: Optional[str] = None,
) -> Optional[Union[Any, CodeOutput, Error]]:
return (
await asyncio_detailed(
lang=lang,
output=output,
body=body,
client=client,
)
).parsed

View File

@ -1 +1 @@
""" Contains methods for accessing the file API paths: CAD file operations. Create, get, and list CAD file conversions. More endpoints will be added here in the future as we build out transforms, etc on CAD models. """
""" Contains methods for accessing the file API paths: CAD file operations. Create, get, and list CAD file conversions. More endpoints will be added here in the future as we build out transforms, etc on CAD models. """ # noqa: E501

View File

@ -1,122 +1,132 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_center_of_mass import FileCenterOfMass
from ...models.error import Error
from ...models.file_center_of_mass import FileCenterOfMass
from ...models.file_import_format import FileImportFormat
from ...types import Response
def _get_kwargs(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/center-of-mass?src_format={src_format}".format(client.base_url, src_format=src_format)
url = "{}/file/center-of-mass".format(client.base_url) # noqa: E501
if src_format is not None:
if "?" in url:
url = url + "&src_format=" + str(src_format)
else:
url = url + "?src_format=" + str(src_format)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileCenterOfMass, Error]]:
if response.status_code == 201:
response_201 = FileCenterOfMass.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, FileCenterOfMass, Error]]:
if response.status_code == 201:
response_201 = FileCenterOfMass.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileCenterOfMass, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, FileCenterOfMass, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileCenterOfMass, Error]]:
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileCenterOfMass, Error]]:
""" Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return sync_detailed(
src_format=src_format,
body=body,
client=client,
).parsed
return sync_detailed(
src_format=src_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileCenterOfMass, Error]]:
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileCenterOfMass, Error]]:
""" Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return (
await asyncio_detailed(
src_format=src_format,
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
src_format=src_format,
body=body,
client=client,
)
).parsed

View File

@ -1,134 +1,141 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_conversion import FileConversion
from ...models.error import Error
from ...models.file_conversion import FileConversion
from ...models.file_export_format import FileExportFormat
from ...models.file_import_format import FileImportFormat
from ...types import Response
def _get_kwargs(
output_format: FileExportFormat,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
output_format: FileExportFormat,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/conversion/{src_format}/{output_format}".format(client.base_url, output_format=output_format, src_format=src_format)
url = "{}/file/conversion/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, Error]]:
if response.status_code == 201:
response_201 = FileConversion.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, FileConversion, Error]]:
if response.status_code == 201:
response_201 = FileConversion.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, FileConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: FileExportFormat,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
output_format: FileExportFormat,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: FileExportFormat,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
output_format: FileExportFormat,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, Error]]:
""" Convert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously.
If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Convert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously.
If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
output_format: FileExportFormat,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
output_format: FileExportFormat,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: FileExportFormat,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
output_format: FileExportFormat,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, Error]]:
""" Convert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously.
If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Convert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously.
If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
)
).parsed

View File

@ -1,15 +1,10 @@
from typing import Any, Dict, Optional, Union
import base64
import httpx
from typing import Any, Optional, Union
from ...api.file.create_file_conversion import asyncio as fc_asyncio, sync as fc_sync
from ...client import Client
from ...models import Error
from ...models import FileConversion
from ...models import FileImportFormat
from ...models import FileExportFormat
from ...types import Response
from ...api.file.create_file_conversion import sync as fc_sync, asyncio as fc_asyncio
from ...models import Error, FileConversion, FileExportFormat, FileImportFormat
def sync(
src_format: FileImportFormat,
@ -30,7 +25,10 @@ def sync(
)
if isinstance(fc, FileConversion) and fc.output != "":
fc.output = base64.b64decode(fc.output)
if isinstance(fc.output, str):
b = base64.b64decode(fc.output)
# decode the bytes to a string
fc.output = b.decode("utf-8")
return fc
@ -47,13 +45,16 @@ async def asyncio(
encoded = base64.b64encode(body)
fc = await fc_asyncio(
src_format=src_format,
output_format=output_format,
body=encoded,
client=client,
)
src_format=src_format,
output_format=output_format,
body=encoded,
client=client,
)
if isinstance(fc, FileConversion) and fc.output != "":
fc.output = base64.b64decode(fc.output)
if isinstance(fc.output, str):
b = base64.b64decode(fc.output)
# decode the bytes to a string
fc.output = b.decode("utf-8")
return fc

View File

@ -1,131 +1,146 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_density import FileDensity
from ...models.error import Error
from ...models.file_density import FileDensity
from ...models.file_import_format import FileImportFormat
from ...types import Response
def _get_kwargs(
material_mass: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
material_mass: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/density?material_mass={material_mass}&src_format={src_format}".format(client.base_url, material_mass=material_mass, src_format=src_format)
url = "{}/file/density".format(client.base_url) # noqa: E501
if material_mass is not None:
if "?" in url:
url = url + "&material_mass=" + str(material_mass)
else:
url = url + "?material_mass=" + str(material_mass)
if src_format is not None:
if "?" in url:
url = url + "&src_format=" + str(src_format)
else:
url = url + "?src_format=" + str(src_format)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileDensity, Error]]:
if response.status_code == 201:
response_201 = FileDensity.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, FileDensity, Error]]:
if response.status_code == 201:
response_201 = FileDensity.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileDensity, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, FileDensity, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
material_mass: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
material_mass: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileDensity, Error]]:
kwargs = _get_kwargs(
material_mass=material_mass,
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
material_mass=material_mass,
src_format=src_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
material_mass: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
material_mass: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileDensity, Error]]:
""" Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return sync_detailed(
material_mass=material_mass,
src_format=src_format,
body=body,
client=client,
).parsed
return sync_detailed(
material_mass=material_mass,
src_format=src_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
material_mass: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
material_mass: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileDensity, Error]]:
kwargs = _get_kwargs(
material_mass=material_mass,
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
material_mass=material_mass,
src_format=src_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
material_mass: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
material_mass: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileDensity, Error]]:
""" Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return (
await asyncio_detailed(
material_mass=material_mass,
src_format=src_format,
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
material_mass=material_mass,
src_format=src_format,
body=body,
client=client,
)
).parsed

View File

@ -1,127 +0,0 @@
from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.code_output import CodeOutput
from ...models.error import Error
from ...models.code_language import CodeLanguage
from ...types import Response
def _get_kwargs(
lang: CodeLanguage,
body: bytes,
*,
client: Client,
output: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/file/execute/{lang}?output={output}".format(client.base_url, lang=lang, output=output)
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[Any, CodeOutput, Error]]:
if response.status_code == 200:
response_200 = CodeOutput.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, CodeOutput, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
lang: CodeLanguage,
body: bytes,
*,
client: Client,
output: Optional[str] = None,
) -> Response[Union[Any, CodeOutput, Error]]:
kwargs = _get_kwargs(
lang=lang,
output=output,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
lang: CodeLanguage,
body: bytes,
*,
client: Client,
output: Optional[str] = None,
) -> Optional[Union[Any, CodeOutput, Error]]:
return sync_detailed(
lang=lang,
output=output,
body=body,
client=client,
).parsed
async def asyncio_detailed(
lang: CodeLanguage,
body: bytes,
*,
client: Client,
output: Optional[str] = None,
) -> Response[Union[Any, CodeOutput, Error]]:
kwargs = _get_kwargs(
lang=lang,
output=output,
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(
lang: CodeLanguage,
body: bytes,
*,
client: Client,
output: Optional[str] = None,
) -> Optional[Union[Any, CodeOutput, Error]]:
return (
await asyncio_detailed(
lang=lang,
output=output,
body=body,
client=client,
)
).parsed

View File

@ -1,131 +1,146 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_mass import FileMass
from ...models.error import Error
from ...models.file_import_format import FileImportFormat
from ...models.file_mass import FileMass
from ...types import Response
def _get_kwargs(
material_density: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
material_density: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/mass?material_density={material_density}&src_format={src_format}".format(client.base_url, material_density=material_density, src_format=src_format)
url = "{}/file/mass".format(client.base_url) # noqa: E501
if material_density is not None:
if "?" in url:
url = url + "&material_density=" + str(material_density)
else:
url = url + "?material_density=" + str(material_density)
if src_format is not None:
if "?" in url:
url = url + "&src_format=" + str(src_format)
else:
url = url + "?src_format=" + str(src_format)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileMass, Error]]:
if response.status_code == 201:
response_201 = FileMass.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, FileMass, Error]]:
if response.status_code == 201:
response_201 = FileMass.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileMass, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, FileMass, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
material_density: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
material_density: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileMass, Error]]:
kwargs = _get_kwargs(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
material_density: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
material_density: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileMass, Error]]:
""" Get the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Get the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return sync_detailed(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
).parsed
return sync_detailed(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
material_density: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
material_density: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileMass, Error]]:
kwargs = _get_kwargs(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
material_density: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
material_density: float,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileMass, Error]]:
""" Get the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Get the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return (
await asyncio_detailed(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
material_density=material_density,
src_format=src_format,
body=body,
client=client,
)
).parsed

View File

@ -1,122 +1,132 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_surface_area import FileSurfaceArea
from ...models.error import Error
from ...models.file_import_format import FileImportFormat
from ...models.file_surface_area import FileSurfaceArea
from ...types import Response
def _get_kwargs(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/surface-area?src_format={src_format}".format(client.base_url, src_format=src_format)
url = "{}/file/surface-area".format(client.base_url) # noqa: E501
if src_format is not None:
if "?" in url:
url = url + "&src_format=" + str(src_format)
else:
url = url + "?src_format=" + str(src_format)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileSurfaceArea, Error]]:
if response.status_code == 201:
response_201 = FileSurfaceArea.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, FileSurfaceArea, Error]]:
if response.status_code == 201:
response_201 = FileSurfaceArea.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileSurfaceArea, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, FileSurfaceArea, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileSurfaceArea, Error]]:
""" Get the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Get the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return sync_detailed(
src_format=src_format,
body=body,
client=client,
).parsed
return sync_detailed(
src_format=src_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileSurfaceArea, Error]]:
""" Get the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Get the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return (
await asyncio_detailed(
src_format=src_format,
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
src_format=src_format,
body=body,
client=client,
)
).parsed

View File

@ -1,122 +1,132 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_volume import FileVolume
from ...models.error import Error
from ...models.file_import_format import FileImportFormat
from ...models.file_volume import FileVolume
from ...types import Response
def _get_kwargs(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/volume?src_format={src_format}".format(client.base_url, src_format=src_format)
url = "{}/file/volume".format(client.base_url) # noqa: E501
if src_format is not None:
if "?" in url:
url = url + "&src_format=" + str(src_format)
else:
url = url + "?src_format=" + str(src_format)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileVolume, Error]]:
if response.status_code == 201:
response_201 = FileVolume.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, FileVolume, Error]]:
if response.status_code == 201:
response_201 = FileVolume.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileVolume, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, FileVolume, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileVolume, Error]]:
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileVolume, Error]]:
""" Get the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Get the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return sync_detailed(
src_format=src_format,
body=body,
client=client,
).parsed
return sync_detailed(
src_format=src_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileVolume, Error]]:
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
src_format: FileImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileVolume, Error]]:
""" Get the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
"""Get the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return (
await asyncio_detailed(
src_format=src_format,
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
src_format=src_format,
body=body,
client=client,
)
).parsed

View File

@ -1,13 +1,10 @@
from typing import Any, Dict, Optional, Union
import base64
import httpx
from typing import Any, Optional, 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
from ...types import Response
from ...api.file.get_file_conversion import sync as fc_sync, asyncio as fc_asyncio
def sync(
@ -23,7 +20,10 @@ def sync(
)
if isinstance(fc, FileConversion) and fc.output != "":
fc.output = base64.b64decode(fc.output)
if isinstance(fc.output, str):
b = base64.b64decode(fc.output)
# decode the bytes to a string
fc.output = b.decode("utf-8")
return fc
@ -36,11 +36,14 @@ async def asyncio(
"""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,
)
id=id,
client=client,
)
if isinstance(fc, FileConversion) and fc.output != "":
fc.output = base64.b64decode(fc.output)
if isinstance(fc.output, str):
b = base64.b64decode(fc.output)
# decode the bytes to a string
fc.output = b.decode("utf-8")
return fc

View File

@ -1 +1 @@
""" Contains methods for accessing the hidden API paths: Hidden API endpoints that should not show up in the docs. """
""" Contains methods for accessing the hidden API paths: Hidden API endpoints that should not show up in the docs. """ # noqa: E501

View File

@ -1,109 +1,114 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.verification_token import VerificationToken
from ...models.error import Error
from ...models.email_authentication_form import EmailAuthenticationForm
from ...models.error import Error
from ...models.verification_token import VerificationToken
from ...types import Response
def _get_kwargs(
body: EmailAuthenticationForm,
*,
client: Client,
body: EmailAuthenticationForm,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/auth/email".format(client.base_url)
url = "{}/auth/email".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, VerificationToken, Error]]:
if response.status_code == 201:
response_201 = VerificationToken.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, VerificationToken, Error]]:
if response.status_code == 201:
response_201 = VerificationToken.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, VerificationToken, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, VerificationToken, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: EmailAuthenticationForm,
*,
client: Client,
body: EmailAuthenticationForm,
*,
client: Client,
) -> Response[Union[Any, VerificationToken, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
body: EmailAuthenticationForm,
*,
client: Client,
body: EmailAuthenticationForm,
*,
client: Client,
) -> Optional[Union[Any, VerificationToken, Error]]:
return sync_detailed(
body=body,
client=client,
).parsed
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: EmailAuthenticationForm,
*,
client: Client,
body: EmailAuthenticationForm,
*,
client: Client,
) -> Response[Union[Any, VerificationToken, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
body: EmailAuthenticationForm,
*,
client: Client,
body: EmailAuthenticationForm,
*,
client: Client,
) -> Optional[Union[Any, VerificationToken, Error]]:
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -6,119 +6,135 @@ from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
email: str,
token: str,
*,
client: Client,
callback_url: Optional[str] = None,
email: str,
token: str,
*,
client: Client,
callback_url: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/auth/email/callback?callback_url={callback_url}&email={email}&token={token}".format(client.base_url, callback_url=callback_url, email=email, token=token)
url = "{}/auth/email/callback".format(client.base_url) # noqa: E501
if callback_url is not None:
if "?" in url:
url = url + "&callback_url=" + str(callback_url)
else:
url = url + "?callback_url=" + str(callback_url)
if email is not None:
if "?" in url:
url = url + "&email=" + str(email)
else:
url = url + "?email=" + str(email)
if token is not None:
if "?" in url:
url = url + "&token=" + str(token)
else:
url = url + "?token=" + str(token)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
if response.status_code == 302:
response_302 = None
return response_302
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
if response.status_code == 302:
response_302 = None
return response_302
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
email: str,
token: str,
*,
client: Client,
callback_url: Optional[str] = None,
email: str,
token: str,
*,
client: Client,
callback_url: Optional[str] = None,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
callback_url=callback_url,
email=email,
token=token,
client=client,
)
kwargs = _get_kwargs(
callback_url=callback_url,
email=email,
token=token,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
email: str,
token: str,
*,
client: Client,
callback_url: Optional[str] = None,
email: str,
token: str,
*,
client: Client,
callback_url: Optional[str] = None,
) -> Optional[Union[Any, Error]]:
return sync_detailed(
callback_url=callback_url,
email=email,
token=token,
client=client,
).parsed
return sync_detailed(
callback_url=callback_url,
email=email,
token=token,
client=client,
).parsed
async def asyncio_detailed(
email: str,
token: str,
*,
client: Client,
callback_url: Optional[str] = None,
email: str,
token: str,
*,
client: Client,
callback_url: Optional[str] = None,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
callback_url=callback_url,
email=email,
token=token,
client=client,
)
kwargs = _get_kwargs(
callback_url=callback_url,
email=email,
token=token,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
email: str,
token: str,
*,
client: Client,
callback_url: Optional[str] = None,
email: str,
token: str,
*,
client: Client,
callback_url: Optional[str] = None,
) -> Optional[Union[Any, Error]]:
return (
await asyncio_detailed(
callback_url=callback_url,
email=email,
token=token,
client=client,
)
).parsed
return (
await asyncio_detailed(
callback_url=callback_url,
email=email,
token=token,
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -6,94 +6,95 @@ from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/logout".format(client.base_url)
url = "{}/logout".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This is used in logout scenarios. """
"""This is used in logout scenarios.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This is used in logout scenarios. """
"""This is used in logout scenarios.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1 +1 @@
""" Contains methods for accessing the meta API paths: Meta information about the API. """
""" Contains methods for accessing the meta API paths: Meta information about the API. """ # noqa: E501

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -7,92 +7,97 @@ from ...models.ai_plugin_manifest import AiPluginManifest
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/.well-known/ai-plugin.json".format(client.base_url)
url = "{}/.well-known/ai-plugin.json".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, AiPluginManifest, Error]]:
if response.status_code == 200:
response_200 = AiPluginManifest.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, AiPluginManifest, Error]]:
if response.status_code == 200:
response_200 = AiPluginManifest.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, AiPluginManifest, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, AiPluginManifest, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, AiPluginManifest, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, AiPluginManifest, Error]]:
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, AiPluginManifest, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, AiPluginManifest, Error]]:
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,102 +1,107 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.metadata import Metadata
from ...models.error import Error
from ...models.metadata import Metadata
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/_meta/info".format(client.base_url)
url = "{}/_meta/info".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Metadata, Error]]:
if response.status_code == 200:
response_200 = Metadata.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, Metadata, Error]]:
if response.status_code == 200:
response_200 = Metadata.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Metadata, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, Metadata, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Metadata, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Metadata, Error]]:
""" This includes information on any of our other distributed systems it is connected to.
You must be a KittyCAD employee to perform this request. """
"""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
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Metadata, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Metadata, Error]]:
""" This includes information on any of our other distributed systems it is connected to.
You must be a KittyCAD employee to perform this request. """
"""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
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,95 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/_meta/metrics".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(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any,]]:
return None
return None
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any,]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Union[Any,]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Any,]]:
"""You must be a KittyCAD employee to perform this request.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Union[Any,]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[Any,]]:
"""You must be a KittyCAD employee to perform this request.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,100 +1,100 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.dict import dict
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/openai/openapi.json".format(client.base_url)
url = "{}/openai/openapi.json".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, 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 None
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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, dict, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, dict, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, 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. """
"""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(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, dict, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, 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. """
"""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 (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,98 +1,98 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.dict import dict
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/".format(client.base_url)
url = "{}/".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, 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 None
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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, dict, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, dict, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, dict, Error]]:
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, dict, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, dict, Error]]:
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,98 +1,99 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.pong import Pong
from ...models.error import Error
from ...models.pong import Pong
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/ping".format(client.base_url)
url = "{}/ping".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Pong, Error]]:
if response.status_code == 200:
response_200 = Pong.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 None
if response.status_code == 200:
response_200 = Pong.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Pong, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Pong, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Pong, Error]]:
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Pong, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Pong, Error]]:
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1 +1 @@
""" Contains methods for accessing the oauth2 API paths: Endpoints that implement OAuth 2.0 grant flows. """
""" Contains methods for accessing the oauth2 API paths: Endpoints that implement OAuth 2.0 grant flows. """ # noqa: E501

View File

@ -1 +1 @@
""" Contains methods for accessing the payments API paths: Operations around payments and billing. """
""" Contains methods for accessing the payments API paths: Operations around payments and billing. """ # noqa: E501

View File

@ -1,113 +1,118 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.billing_info import BillingInfo
from ...models.customer import Customer
from ...models.error import Error
from ...models.billing_info import BillingInfo
from ...types import Response
def _get_kwargs(
body: BillingInfo,
*,
client: Client,
body: BillingInfo,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment".format(client.base_url)
url = "{}/user/payment".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Customer, Error]]:
if response.status_code == 201:
response_201 = Customer.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, Customer, Error]]:
if response.status_code == 201:
response_201 = Customer.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Customer, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, Customer, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: BillingInfo,
*,
client: Client,
body: BillingInfo,
*,
client: Client,
) -> Response[Union[Any, Customer, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
body: BillingInfo,
*,
client: Client,
body: BillingInfo,
*,
client: Client,
) -> Optional[Union[Any, Customer, Error]]:
""" This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user. """
"""This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: BillingInfo,
*,
client: Client,
body: BillingInfo,
*,
client: Client,
) -> Response[Union[Any, Customer, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
body: BillingInfo,
*,
client: Client,
body: BillingInfo,
*,
client: Client,
) -> Optional[Union[Any, Customer, Error]]:
""" This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user. """
"""This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -1,100 +1,105 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.payment_intent import PaymentIntent
from ...models.error import Error
from ...models.payment_intent import PaymentIntent
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment/intent".format(client.base_url)
url = "{}/user/payment/intent".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, PaymentIntent, Error]]:
if response.status_code == 201:
response_201 = PaymentIntent.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, PaymentIntent, Error]]:
if response.status_code == 201:
response_201 = PaymentIntent.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, PaymentIntent, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, PaymentIntent, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, PaymentIntent, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, PaymentIntent, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user. """
"""This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, PaymentIntent, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, PaymentIntent, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user. """
"""This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -6,96 +6,97 @@ from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment".format(client.base_url)
url = "{}/user/payment".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user. """
"""This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user. """
"""This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -6,103 +6,104 @@ from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment/methods/{id}".format(client.base_url, id=id)
url = "{}/user/payment/methods/{id}".format(client.base_url, id=id) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user. """
"""This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user. """
"""This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -7,94 +7,99 @@ from ...models.customer_balance import CustomerBalance
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment/balance".format(client.base_url)
url = "{}/user/payment/balance".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, CustomerBalance, Error]]:
if response.status_code == 200:
response_200 = CustomerBalance.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, CustomerBalance, Error]]:
if response.status_code == 200:
response_200 = CustomerBalance.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, CustomerBalance, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, CustomerBalance, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, CustomerBalance, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, CustomerBalance, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It gets the balance information for the authenticated user. """
"""This endpoint requires authentication by any KittyCAD user. It gets the balance information for the authenticated user.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, CustomerBalance, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, CustomerBalance, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It gets the balance information for the authenticated user. """
"""This endpoint requires authentication by any KittyCAD user. It gets the balance information for the authenticated user.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -7,96 +7,101 @@ from ...models.customer import Customer
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment".format(client.base_url)
url = "{}/user/payment".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Customer, Error]]:
if response.status_code == 200:
response_200 = Customer.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, Customer, Error]]:
if response.status_code == 200:
response_200 = Customer.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Customer, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, Customer, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Customer, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Customer, Error]]:
""" This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user. """
"""This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Customer, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Customer, Error]]:
""" This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user. """
"""This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,103 +1,105 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union
import httpx
from ...client import Client
from ...models.invoice import Invoice
from ...models.error import Error
from ...models.invoice import Invoice
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment/invoices".format(client.base_url)
url = "{}/user/payment/invoices".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, [Invoice], Error]]:
if response.status_code == 200:
response_200 = [
Invoice.from_dict(item)
for item in 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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, List[Invoice], Error]]:
if response.status_code == 200:
response_200 = [Invoice.from_dict(item) for item in 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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, [Invoice], Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, List[Invoice], Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Union[Any, [Invoice], Error]]:
kwargs = _get_kwargs(
client=client,
)
*,
client: Client,
) -> Response[Union[Any, List[Invoice], Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Any, [Invoice], Error]]:
""" This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user. """
*,
client: Client,
) -> Optional[Union[Any, List[Invoice], Error]]:
"""This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Union[Any, [Invoice], Error]]:
kwargs = _get_kwargs(
client=client,
)
*,
client: Client,
) -> Response[Union[Any, List[Invoice], Error]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[Any, [Invoice], Error]]:
""" This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user. """
*,
client: Client,
) -> Optional[Union[Any, List[Invoice], Error]]:
"""This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,103 +1,105 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union
import httpx
from ...client import Client
from ...models.payment_method import PaymentMethod
from ...models.error import Error
from ...models.payment_method import PaymentMethod
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment/methods".format(client.base_url)
url = "{}/user/payment/methods".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, [PaymentMethod], Error]]:
if response.status_code == 200:
response_200 = [
PaymentMethod.from_dict(item)
for item in 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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, List[PaymentMethod], Error]]:
if response.status_code == 200:
response_200 = [PaymentMethod.from_dict(item) for item in 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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, [PaymentMethod], Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, List[PaymentMethod], Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Union[Any, [PaymentMethod], Error]]:
kwargs = _get_kwargs(
client=client,
)
*,
client: Client,
) -> Response[Union[Any, List[PaymentMethod], Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Any, [PaymentMethod], Error]]:
""" This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user. """
*,
client: Client,
) -> Optional[Union[Any, List[PaymentMethod], Error]]:
"""This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Union[Any, [PaymentMethod], Error]]:
kwargs = _get_kwargs(
client=client,
)
*,
client: Client,
) -> Response[Union[Any, List[PaymentMethod], Error]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[Any, [PaymentMethod], Error]]:
""" This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user. """
*,
client: Client,
) -> Optional[Union[Any, List[PaymentMethod], Error]]:
"""This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1,113 +1,118 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.billing_info import BillingInfo
from ...models.customer import Customer
from ...models.error import Error
from ...models.billing_info import BillingInfo
from ...types import Response
def _get_kwargs(
body: BillingInfo,
*,
client: Client,
body: BillingInfo,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment".format(client.base_url)
url = "{}/user/payment".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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,
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Customer, Error]]:
if response.status_code == 200:
response_200 = Customer.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, Customer, Error]]:
if response.status_code == 200:
response_200 = Customer.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Customer, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, Customer, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: BillingInfo,
*,
client: Client,
body: BillingInfo,
*,
client: Client,
) -> Response[Union[Any, Customer, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
body: BillingInfo,
*,
client: Client,
body: BillingInfo,
*,
client: Client,
) -> Optional[Union[Any, Customer, Error]]:
""" This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user. """
"""This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: BillingInfo,
*,
client: Client,
body: BillingInfo,
*,
client: Client,
) -> Response[Union[Any, Customer, Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
body: BillingInfo,
*,
client: Client,
body: BillingInfo,
*,
client: Client,
) -> Optional[Union[Any, Customer, Error]]:
""" This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user. """
"""This includes billing address, phone, and name.
This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -6,94 +6,95 @@ from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment/tax".format(client.base_url)
url = "{}/user/payment/tax".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, 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. """
"""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(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, 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. """
"""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 (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -1 +0,0 @@
""" Contains methods for accessing the sessions API paths: Sessions allow users to call the API from their session cookie in the browser. """

View File

@ -1,109 +0,0 @@
from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.session import Session
from ...models.error import Error
from ...types import Response
def _get_kwargs(
token: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/session/{token}".format(client.base_url, token=token)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Session, Error]]:
if response.status_code == 200:
response_200 = Session.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Session, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
token: str,
*,
client: Client,
) -> Response[Union[Any, Session, Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
token: str,
*,
client: Client,
) -> Optional[Union[Any, Session, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user. """
return sync_detailed(
token=token,
client=client,
).parsed
async def asyncio_detailed(
token: str,
*,
client: Client,
) -> Response[Union[Any, Session, Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
token: str,
*,
client: Client,
) -> Optional[Union[Any, Session, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user. """
return (
await asyncio_detailed(
token=token,
client=client,
)
).parsed

View File

@ -1 +1 @@
""" Contains methods for accessing the unit API paths: Unit conversion operations. """
""" Contains methods for accessing the unit API paths: Unit conversion operations. """ # noqa: E501

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_acceleration_conversion import UnitAccelerationConversion
from ...models.error import Error
from ...models.unit_acceleration_format import UnitAccelerationFormat
from ...models.unit_acceleration_conversion import UnitAccelerationConversion
from ...models.unit_acceleration_format import UnitAccelerationFormat
from ...types import Response
def _get_kwargs(
output_format: UnitAccelerationFormat,
src_format: UnitAccelerationFormat,
value: float,
*,
client: Client,
output_format: UnitAccelerationFormat,
src_format: UnitAccelerationFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/acceleration/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/acceleration/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitAccelerationConversion, Error]]:
if response.status_code == 200:
response_200 = UnitAccelerationConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitAccelerationConversion, Error]]:
if response.status_code == 200:
response_200 = UnitAccelerationConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitAccelerationConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitAccelerationConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitAccelerationFormat,
src_format: UnitAccelerationFormat,
value: float,
*,
client: Client,
output_format: UnitAccelerationFormat,
src_format: UnitAccelerationFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitAccelerationConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitAccelerationFormat,
src_format: UnitAccelerationFormat,
value: float,
*,
client: Client,
output_format: UnitAccelerationFormat,
src_format: UnitAccelerationFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitAccelerationConversion, Error]]:
""" Convert an acceleration unit value to another acceleration unit value. This is a nice endpoint to use for helper functions. """
"""Convert an acceleration unit value to another acceleration unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitAccelerationFormat,
src_format: UnitAccelerationFormat,
value: float,
*,
client: Client,
output_format: UnitAccelerationFormat,
src_format: UnitAccelerationFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitAccelerationConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitAccelerationFormat,
src_format: UnitAccelerationFormat,
value: float,
*,
client: Client,
output_format: UnitAccelerationFormat,
src_format: UnitAccelerationFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitAccelerationConversion, Error]]:
""" Convert an acceleration unit value to another acceleration unit value. This is a nice endpoint to use for helper functions. """
"""Convert an acceleration unit value to another acceleration unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_angle_conversion import UnitAngleConversion
from ...models.error import Error
from ...models.unit_angle_format import UnitAngleFormat
from ...models.unit_angle_conversion import UnitAngleConversion
from ...models.unit_angle_format import UnitAngleFormat
from ...types import Response
def _get_kwargs(
output_format: UnitAngleFormat,
src_format: UnitAngleFormat,
value: float,
*,
client: Client,
output_format: UnitAngleFormat,
src_format: UnitAngleFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/angle/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/angle/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitAngleConversion, Error]]:
if response.status_code == 200:
response_200 = UnitAngleConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitAngleConversion, Error]]:
if response.status_code == 200:
response_200 = UnitAngleConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitAngleConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitAngleConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitAngleFormat,
src_format: UnitAngleFormat,
value: float,
*,
client: Client,
output_format: UnitAngleFormat,
src_format: UnitAngleFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitAngleConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitAngleFormat,
src_format: UnitAngleFormat,
value: float,
*,
client: Client,
output_format: UnitAngleFormat,
src_format: UnitAngleFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitAngleConversion, Error]]:
""" Convert an angle unit value to another angle unit value. This is a nice endpoint to use for helper functions. """
"""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(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitAngleFormat,
src_format: UnitAngleFormat,
value: float,
*,
client: Client,
output_format: UnitAngleFormat,
src_format: UnitAngleFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitAngleConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitAngleFormat,
src_format: UnitAngleFormat,
value: float,
*,
client: Client,
output_format: UnitAngleFormat,
src_format: UnitAngleFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitAngleConversion, Error]]:
""" Convert an angle unit value to another angle unit value. This is a nice endpoint to use for helper functions. """
"""Convert an angle unit value to another angle unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_angular_velocity_conversion import UnitAngularVelocityConversion
from ...models.error import Error
from ...models.unit_angular_velocity_format import UnitAngularVelocityFormat
from ...models.unit_angular_velocity_conversion import UnitAngularVelocityConversion
from ...models.unit_angular_velocity_format import UnitAngularVelocityFormat
from ...types import Response
def _get_kwargs(
output_format: UnitAngularVelocityFormat,
src_format: UnitAngularVelocityFormat,
value: float,
*,
client: Client,
output_format: UnitAngularVelocityFormat,
src_format: UnitAngularVelocityFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/angular-velocity/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/angular-velocity/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitAngularVelocityConversion, Error]]:
if response.status_code == 200:
response_200 = UnitAngularVelocityConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitAngularVelocityConversion, Error]]:
if response.status_code == 200:
response_200 = UnitAngularVelocityConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitAngularVelocityConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitAngularVelocityConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitAngularVelocityFormat,
src_format: UnitAngularVelocityFormat,
value: float,
*,
client: Client,
output_format: UnitAngularVelocityFormat,
src_format: UnitAngularVelocityFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitAngularVelocityConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitAngularVelocityFormat,
src_format: UnitAngularVelocityFormat,
value: float,
*,
client: Client,
output_format: UnitAngularVelocityFormat,
src_format: UnitAngularVelocityFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitAngularVelocityConversion, Error]]:
""" Convert an angular velocity unit value to another angular velocity unit value. This is a nice endpoint to use for helper functions. """
"""Convert an angular velocity unit value to another angular velocity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitAngularVelocityFormat,
src_format: UnitAngularVelocityFormat,
value: float,
*,
client: Client,
output_format: UnitAngularVelocityFormat,
src_format: UnitAngularVelocityFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitAngularVelocityConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitAngularVelocityFormat,
src_format: UnitAngularVelocityFormat,
value: float,
*,
client: Client,
output_format: UnitAngularVelocityFormat,
src_format: UnitAngularVelocityFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitAngularVelocityConversion, Error]]:
""" Convert an angular velocity unit value to another angular velocity unit value. This is a nice endpoint to use for helper functions. """
"""Convert an angular velocity unit value to another angular velocity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_area_conversion import UnitAreaConversion
from ...models.error import Error
from ...models.unit_area_format import UnitAreaFormat
from ...models.unit_area_conversion import UnitAreaConversion
from ...models.unit_area_format import UnitAreaFormat
from ...types import Response
def _get_kwargs(
output_format: UnitAreaFormat,
src_format: UnitAreaFormat,
value: float,
*,
client: Client,
output_format: UnitAreaFormat,
src_format: UnitAreaFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/area/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/area/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitAreaConversion, Error]]:
if response.status_code == 200:
response_200 = UnitAreaConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitAreaConversion, Error]]:
if response.status_code == 200:
response_200 = UnitAreaConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitAreaConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitAreaConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitAreaFormat,
src_format: UnitAreaFormat,
value: float,
*,
client: Client,
output_format: UnitAreaFormat,
src_format: UnitAreaFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitAreaConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitAreaFormat,
src_format: UnitAreaFormat,
value: float,
*,
client: Client,
output_format: UnitAreaFormat,
src_format: UnitAreaFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitAreaConversion, Error]]:
""" Convert an area unit value to another area unit value. This is a nice endpoint to use for helper functions. """
"""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(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitAreaFormat,
src_format: UnitAreaFormat,
value: float,
*,
client: Client,
output_format: UnitAreaFormat,
src_format: UnitAreaFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitAreaConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitAreaFormat,
src_format: UnitAreaFormat,
value: float,
*,
client: Client,
output_format: UnitAreaFormat,
src_format: UnitAreaFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitAreaConversion, Error]]:
""" Convert an area unit value to another area unit value. This is a nice endpoint to use for helper functions. """
"""Convert an area unit value to another area unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_charge_conversion import UnitChargeConversion
from ...models.error import Error
from ...models.unit_charge_format import UnitChargeFormat
from ...models.unit_charge_conversion import UnitChargeConversion
from ...models.unit_charge_format import UnitChargeFormat
from ...types import Response
def _get_kwargs(
output_format: UnitChargeFormat,
src_format: UnitChargeFormat,
value: float,
*,
client: Client,
output_format: UnitChargeFormat,
src_format: UnitChargeFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/charge/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/charge/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitChargeConversion, Error]]:
if response.status_code == 200:
response_200 = UnitChargeConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitChargeConversion, Error]]:
if response.status_code == 200:
response_200 = UnitChargeConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitChargeConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitChargeConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitChargeFormat,
src_format: UnitChargeFormat,
value: float,
*,
client: Client,
output_format: UnitChargeFormat,
src_format: UnitChargeFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitChargeConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitChargeFormat,
src_format: UnitChargeFormat,
value: float,
*,
client: Client,
output_format: UnitChargeFormat,
src_format: UnitChargeFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitChargeConversion, Error]]:
""" Convert a charge unit value to another charge unit value. This is a nice endpoint to use for helper functions. """
"""Convert a charge unit value to another charge unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitChargeFormat,
src_format: UnitChargeFormat,
value: float,
*,
client: Client,
output_format: UnitChargeFormat,
src_format: UnitChargeFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitChargeConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitChargeFormat,
src_format: UnitChargeFormat,
value: float,
*,
client: Client,
output_format: UnitChargeFormat,
src_format: UnitChargeFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitChargeConversion, Error]]:
""" Convert a charge unit value to another charge unit value. This is a nice endpoint to use for helper functions. """
"""Convert a charge unit value to another charge unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_concentration_conversion import UnitConcentrationConversion
from ...models.error import Error
from ...models.unit_concentration_format import UnitConcentrationFormat
from ...models.unit_concentration_conversion import UnitConcentrationConversion
from ...models.unit_concentration_format import UnitConcentrationFormat
from ...types import Response
def _get_kwargs(
output_format: UnitConcentrationFormat,
src_format: UnitConcentrationFormat,
value: float,
*,
client: Client,
output_format: UnitConcentrationFormat,
src_format: UnitConcentrationFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/concentration/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/concentration/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitConcentrationConversion, Error]]:
if response.status_code == 200:
response_200 = UnitConcentrationConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitConcentrationConversion, Error]]:
if response.status_code == 200:
response_200 = UnitConcentrationConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitConcentrationConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitConcentrationConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitConcentrationFormat,
src_format: UnitConcentrationFormat,
value: float,
*,
client: Client,
output_format: UnitConcentrationFormat,
src_format: UnitConcentrationFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitConcentrationConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitConcentrationFormat,
src_format: UnitConcentrationFormat,
value: float,
*,
client: Client,
output_format: UnitConcentrationFormat,
src_format: UnitConcentrationFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitConcentrationConversion, Error]]:
""" Convert a concentration unit value to another concentration unit value. This is a nice endpoint to use for helper functions. """
"""Convert a concentration unit value to another concentration unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitConcentrationFormat,
src_format: UnitConcentrationFormat,
value: float,
*,
client: Client,
output_format: UnitConcentrationFormat,
src_format: UnitConcentrationFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitConcentrationConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitConcentrationFormat,
src_format: UnitConcentrationFormat,
value: float,
*,
client: Client,
output_format: UnitConcentrationFormat,
src_format: UnitConcentrationFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitConcentrationConversion, Error]]:
""" Convert a concentration unit value to another concentration unit value. This is a nice endpoint to use for helper functions. """
"""Convert a concentration unit value to another concentration unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_data_transfer_rate_conversion import UnitDataTransferRateConversion
from ...models.error import Error
from ...models.unit_data_transfer_rate_format import UnitDataTransferRateFormat
from ...models.unit_data_transfer_rate_conversion import UnitDataTransferRateConversion
from ...models.unit_data_transfer_rate_format import UnitDataTransferRateFormat
from ...types import Response
def _get_kwargs(
output_format: UnitDataTransferRateFormat,
src_format: UnitDataTransferRateFormat,
value: float,
*,
client: Client,
output_format: UnitDataTransferRateFormat,
src_format: UnitDataTransferRateFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/data-transfer-rate/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/data-transfer-rate/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitDataTransferRateConversion, Error]]:
if response.status_code == 200:
response_200 = UnitDataTransferRateConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitDataTransferRateConversion, Error]]:
if response.status_code == 200:
response_200 = UnitDataTransferRateConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitDataTransferRateConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitDataTransferRateConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitDataTransferRateFormat,
src_format: UnitDataTransferRateFormat,
value: float,
*,
client: Client,
output_format: UnitDataTransferRateFormat,
src_format: UnitDataTransferRateFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitDataTransferRateConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitDataTransferRateFormat,
src_format: UnitDataTransferRateFormat,
value: float,
*,
client: Client,
output_format: UnitDataTransferRateFormat,
src_format: UnitDataTransferRateFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitDataTransferRateConversion, Error]]:
""" Convert a data transfer rate unit value to another data transfer rate unit value. This is a nice endpoint to use for helper functions. """
"""Convert a data transfer rate unit value to another data transfer rate unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitDataTransferRateFormat,
src_format: UnitDataTransferRateFormat,
value: float,
*,
client: Client,
output_format: UnitDataTransferRateFormat,
src_format: UnitDataTransferRateFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitDataTransferRateConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitDataTransferRateFormat,
src_format: UnitDataTransferRateFormat,
value: float,
*,
client: Client,
output_format: UnitDataTransferRateFormat,
src_format: UnitDataTransferRateFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitDataTransferRateConversion, Error]]:
""" Convert a data transfer rate unit value to another data transfer rate unit value. This is a nice endpoint to use for helper functions. """
"""Convert a data transfer rate unit value to another data transfer rate unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_data_conversion import UnitDataConversion
from ...models.error import Error
from ...models.unit_data_format import UnitDataFormat
from ...models.unit_data_conversion import UnitDataConversion
from ...models.unit_data_format import UnitDataFormat
from ...types import Response
def _get_kwargs(
output_format: UnitDataFormat,
src_format: UnitDataFormat,
value: float,
*,
client: Client,
output_format: UnitDataFormat,
src_format: UnitDataFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/data/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/data/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitDataConversion, Error]]:
if response.status_code == 200:
response_200 = UnitDataConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitDataConversion, Error]]:
if response.status_code == 200:
response_200 = UnitDataConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitDataConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitDataConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitDataFormat,
src_format: UnitDataFormat,
value: float,
*,
client: Client,
output_format: UnitDataFormat,
src_format: UnitDataFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitDataConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitDataFormat,
src_format: UnitDataFormat,
value: float,
*,
client: Client,
output_format: UnitDataFormat,
src_format: UnitDataFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitDataConversion, Error]]:
""" Convert a data unit value to another data unit value. This is a nice endpoint to use for helper functions. """
"""Convert a data unit value to another data unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitDataFormat,
src_format: UnitDataFormat,
value: float,
*,
client: Client,
output_format: UnitDataFormat,
src_format: UnitDataFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitDataConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitDataFormat,
src_format: UnitDataFormat,
value: float,
*,
client: Client,
output_format: UnitDataFormat,
src_format: UnitDataFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitDataConversion, Error]]:
""" Convert a data unit value to another data unit value. This is a nice endpoint to use for helper functions. """
"""Convert a data unit value to another data unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_density_conversion import UnitDensityConversion
from ...models.error import Error
from ...models.unit_density_format import UnitDensityFormat
from ...models.unit_density_conversion import UnitDensityConversion
from ...models.unit_density_format import UnitDensityFormat
from ...types import Response
def _get_kwargs(
output_format: UnitDensityFormat,
src_format: UnitDensityFormat,
value: float,
*,
client: Client,
output_format: UnitDensityFormat,
src_format: UnitDensityFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/density/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/density/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitDensityConversion, Error]]:
if response.status_code == 200:
response_200 = UnitDensityConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitDensityConversion, Error]]:
if response.status_code == 200:
response_200 = UnitDensityConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitDensityConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitDensityConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitDensityFormat,
src_format: UnitDensityFormat,
value: float,
*,
client: Client,
output_format: UnitDensityFormat,
src_format: UnitDensityFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitDensityConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitDensityFormat,
src_format: UnitDensityFormat,
value: float,
*,
client: Client,
output_format: UnitDensityFormat,
src_format: UnitDensityFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitDensityConversion, Error]]:
""" Convert a density unit value to another density unit value. This is a nice endpoint to use for helper functions. """
"""Convert a density unit value to another density unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitDensityFormat,
src_format: UnitDensityFormat,
value: float,
*,
client: Client,
output_format: UnitDensityFormat,
src_format: UnitDensityFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitDensityConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitDensityFormat,
src_format: UnitDensityFormat,
value: float,
*,
client: Client,
output_format: UnitDensityFormat,
src_format: UnitDensityFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitDensityConversion, Error]]:
""" Convert a density unit value to another density unit value. This is a nice endpoint to use for helper functions. """
"""Convert a density unit value to another density unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_energy_conversion import UnitEnergyConversion
from ...models.error import Error
from ...models.unit_energy_format import UnitEnergyFormat
from ...models.unit_energy_conversion import UnitEnergyConversion
from ...models.unit_energy_format import UnitEnergyFormat
from ...types import Response
def _get_kwargs(
output_format: UnitEnergyFormat,
src_format: UnitEnergyFormat,
value: float,
*,
client: Client,
output_format: UnitEnergyFormat,
src_format: UnitEnergyFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/energy/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/energy/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitEnergyConversion, Error]]:
if response.status_code == 200:
response_200 = UnitEnergyConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitEnergyConversion, Error]]:
if response.status_code == 200:
response_200 = UnitEnergyConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitEnergyConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitEnergyConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitEnergyFormat,
src_format: UnitEnergyFormat,
value: float,
*,
client: Client,
output_format: UnitEnergyFormat,
src_format: UnitEnergyFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitEnergyConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitEnergyFormat,
src_format: UnitEnergyFormat,
value: float,
*,
client: Client,
output_format: UnitEnergyFormat,
src_format: UnitEnergyFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitEnergyConversion, Error]]:
""" Convert a energy unit value to another energy unit value. This is a nice endpoint to use for helper functions. """
"""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(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitEnergyFormat,
src_format: UnitEnergyFormat,
value: float,
*,
client: Client,
output_format: UnitEnergyFormat,
src_format: UnitEnergyFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitEnergyConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitEnergyFormat,
src_format: UnitEnergyFormat,
value: float,
*,
client: Client,
output_format: UnitEnergyFormat,
src_format: UnitEnergyFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitEnergyConversion, Error]]:
""" Convert a energy unit value to another energy unit value. This is a nice endpoint to use for helper functions. """
"""Convert a energy unit value to another energy unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_force_conversion import UnitForceConversion
from ...models.error import Error
from ...models.unit_force_format import UnitForceFormat
from ...models.unit_force_conversion import UnitForceConversion
from ...models.unit_force_format import UnitForceFormat
from ...types import Response
def _get_kwargs(
output_format: UnitForceFormat,
src_format: UnitForceFormat,
value: float,
*,
client: Client,
output_format: UnitForceFormat,
src_format: UnitForceFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/force/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/force/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitForceConversion, Error]]:
if response.status_code == 200:
response_200 = UnitForceConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitForceConversion, Error]]:
if response.status_code == 200:
response_200 = UnitForceConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitForceConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitForceConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitForceFormat,
src_format: UnitForceFormat,
value: float,
*,
client: Client,
output_format: UnitForceFormat,
src_format: UnitForceFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitForceConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitForceFormat,
src_format: UnitForceFormat,
value: float,
*,
client: Client,
output_format: UnitForceFormat,
src_format: UnitForceFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitForceConversion, Error]]:
""" Convert a force unit value to another force unit value. This is a nice endpoint to use for helper functions. """
"""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(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitForceFormat,
src_format: UnitForceFormat,
value: float,
*,
client: Client,
output_format: UnitForceFormat,
src_format: UnitForceFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitForceConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitForceFormat,
src_format: UnitForceFormat,
value: float,
*,
client: Client,
output_format: UnitForceFormat,
src_format: UnitForceFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitForceConversion, Error]]:
""" Convert a force unit value to another force unit value. This is a nice endpoint to use for helper functions. """
"""Convert a force unit value to another force unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_illuminance_conversion import UnitIlluminanceConversion
from ...models.error import Error
from ...models.unit_illuminance_format import UnitIlluminanceFormat
from ...models.unit_illuminance_conversion import UnitIlluminanceConversion
from ...models.unit_illuminance_format import UnitIlluminanceFormat
from ...types import Response
def _get_kwargs(
output_format: UnitIlluminanceFormat,
src_format: UnitIlluminanceFormat,
value: float,
*,
client: Client,
output_format: UnitIlluminanceFormat,
src_format: UnitIlluminanceFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/illuminance/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/illuminance/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitIlluminanceConversion, Error]]:
if response.status_code == 200:
response_200 = UnitIlluminanceConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitIlluminanceConversion, Error]]:
if response.status_code == 200:
response_200 = UnitIlluminanceConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitIlluminanceConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitIlluminanceConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitIlluminanceFormat,
src_format: UnitIlluminanceFormat,
value: float,
*,
client: Client,
output_format: UnitIlluminanceFormat,
src_format: UnitIlluminanceFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitIlluminanceConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitIlluminanceFormat,
src_format: UnitIlluminanceFormat,
value: float,
*,
client: Client,
output_format: UnitIlluminanceFormat,
src_format: UnitIlluminanceFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitIlluminanceConversion, Error]]:
""" Convert a illuminance unit value to another illuminance unit value. This is a nice endpoint to use for helper functions. """
"""Convert a illuminance unit value to another illuminance unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitIlluminanceFormat,
src_format: UnitIlluminanceFormat,
value: float,
*,
client: Client,
output_format: UnitIlluminanceFormat,
src_format: UnitIlluminanceFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitIlluminanceConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitIlluminanceFormat,
src_format: UnitIlluminanceFormat,
value: float,
*,
client: Client,
output_format: UnitIlluminanceFormat,
src_format: UnitIlluminanceFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitIlluminanceConversion, Error]]:
""" Convert a illuminance unit value to another illuminance unit value. This is a nice endpoint to use for helper functions. """
"""Convert a illuminance unit value to another illuminance unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_length_conversion import UnitLengthConversion
from ...models.error import Error
from ...models.unit_length_format import UnitLengthFormat
from ...models.unit_length_conversion import UnitLengthConversion
from ...models.unit_length_format import UnitLengthFormat
from ...types import Response
def _get_kwargs(
output_format: UnitLengthFormat,
src_format: UnitLengthFormat,
value: float,
*,
client: Client,
output_format: UnitLengthFormat,
src_format: UnitLengthFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/length/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/length/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitLengthConversion, Error]]:
if response.status_code == 200:
response_200 = UnitLengthConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitLengthConversion, Error]]:
if response.status_code == 200:
response_200 = UnitLengthConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitLengthConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitLengthConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitLengthFormat,
src_format: UnitLengthFormat,
value: float,
*,
client: Client,
output_format: UnitLengthFormat,
src_format: UnitLengthFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitLengthConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitLengthFormat,
src_format: UnitLengthFormat,
value: float,
*,
client: Client,
output_format: UnitLengthFormat,
src_format: UnitLengthFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitLengthConversion, Error]]:
""" Convert a length unit value to another length unit value. This is a nice endpoint to use for helper functions. """
"""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(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitLengthFormat,
src_format: UnitLengthFormat,
value: float,
*,
client: Client,
output_format: UnitLengthFormat,
src_format: UnitLengthFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitLengthConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitLengthFormat,
src_format: UnitLengthFormat,
value: float,
*,
client: Client,
output_format: UnitLengthFormat,
src_format: UnitLengthFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitLengthConversion, Error]]:
""" Convert a length unit value to another length unit value. This is a nice endpoint to use for helper functions. """
"""Convert a length unit value to another length unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,144 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_magnetic_field_strength_conversion import UnitMagneticFieldStrengthConversion
from ...models.error import Error
from ...models.unit_magnetic_field_strength_format import UnitMagneticFieldStrengthFormat
from ...models.unit_magnetic_field_strength_format import UnitMagneticFieldStrengthFormat
from ...models.unit_magnetic_field_strength_conversion import (
UnitMagneticFieldStrengthConversion,
)
from ...models.unit_magnetic_field_strength_format import (
UnitMagneticFieldStrengthFormat,
)
from ...types import Response
def _get_kwargs(
output_format: UnitMagneticFieldStrengthFormat,
src_format: UnitMagneticFieldStrengthFormat,
value: float,
*,
client: Client,
output_format: UnitMagneticFieldStrengthFormat,
src_format: UnitMagneticFieldStrengthFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/magnetic-field-strength/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/magnetic-field-strength/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitMagneticFieldStrengthConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMagneticFieldStrengthConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitMagneticFieldStrengthConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMagneticFieldStrengthConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitMagneticFieldStrengthConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitMagneticFieldStrengthConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitMagneticFieldStrengthFormat,
src_format: UnitMagneticFieldStrengthFormat,
value: float,
*,
client: Client,
output_format: UnitMagneticFieldStrengthFormat,
src_format: UnitMagneticFieldStrengthFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMagneticFieldStrengthConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitMagneticFieldStrengthFormat,
src_format: UnitMagneticFieldStrengthFormat,
value: float,
*,
client: Client,
output_format: UnitMagneticFieldStrengthFormat,
src_format: UnitMagneticFieldStrengthFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMagneticFieldStrengthConversion, Error]]:
""" Convert a magnetic field strength unit value to another magnetic field strength unit value. This is a nice endpoint to use for helper functions. """
"""Convert a magnetic field strength unit value to another magnetic field strength unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitMagneticFieldStrengthFormat,
src_format: UnitMagneticFieldStrengthFormat,
value: float,
*,
client: Client,
output_format: UnitMagneticFieldStrengthFormat,
src_format: UnitMagneticFieldStrengthFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMagneticFieldStrengthConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitMagneticFieldStrengthFormat,
src_format: UnitMagneticFieldStrengthFormat,
value: float,
*,
client: Client,
output_format: UnitMagneticFieldStrengthFormat,
src_format: UnitMagneticFieldStrengthFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMagneticFieldStrengthConversion, Error]]:
""" Convert a magnetic field strength unit value to another magnetic field strength unit value. This is a nice endpoint to use for helper functions. """
"""Convert a magnetic field strength unit value to another magnetic field strength unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_magnetic_flux_conversion import UnitMagneticFluxConversion
from ...models.error import Error
from ...models.unit_magnetic_flux_format import UnitMagneticFluxFormat
from ...models.unit_magnetic_flux_conversion import UnitMagneticFluxConversion
from ...models.unit_magnetic_flux_format import UnitMagneticFluxFormat
from ...types import Response
def _get_kwargs(
output_format: UnitMagneticFluxFormat,
src_format: UnitMagneticFluxFormat,
value: float,
*,
client: Client,
output_format: UnitMagneticFluxFormat,
src_format: UnitMagneticFluxFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/magnetic-flux/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/magnetic-flux/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitMagneticFluxConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMagneticFluxConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitMagneticFluxConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMagneticFluxConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitMagneticFluxConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitMagneticFluxConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitMagneticFluxFormat,
src_format: UnitMagneticFluxFormat,
value: float,
*,
client: Client,
output_format: UnitMagneticFluxFormat,
src_format: UnitMagneticFluxFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMagneticFluxConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitMagneticFluxFormat,
src_format: UnitMagneticFluxFormat,
value: float,
*,
client: Client,
output_format: UnitMagneticFluxFormat,
src_format: UnitMagneticFluxFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMagneticFluxConversion, Error]]:
""" Convert a magnetic flux unit value to another magnetic flux unit value. This is a nice endpoint to use for helper functions. """
"""Convert a magnetic flux unit value to another magnetic flux unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitMagneticFluxFormat,
src_format: UnitMagneticFluxFormat,
value: float,
*,
client: Client,
output_format: UnitMagneticFluxFormat,
src_format: UnitMagneticFluxFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMagneticFluxConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitMagneticFluxFormat,
src_format: UnitMagneticFluxFormat,
value: float,
*,
client: Client,
output_format: UnitMagneticFluxFormat,
src_format: UnitMagneticFluxFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMagneticFluxConversion, Error]]:
""" Convert a magnetic flux unit value to another magnetic flux unit value. This is a nice endpoint to use for helper functions. """
"""Convert a magnetic flux unit value to another magnetic flux unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_mass_conversion import UnitMassConversion
from ...models.error import Error
from ...models.unit_mass_format import UnitMassFormat
from ...models.unit_mass_conversion import UnitMassConversion
from ...models.unit_mass_format import UnitMassFormat
from ...types import Response
def _get_kwargs(
output_format: UnitMassFormat,
src_format: UnitMassFormat,
value: float,
*,
client: Client,
output_format: UnitMassFormat,
src_format: UnitMassFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/mass/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/mass/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitMassConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMassConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitMassConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMassConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitMassConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitMassConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitMassFormat,
src_format: UnitMassFormat,
value: float,
*,
client: Client,
output_format: UnitMassFormat,
src_format: UnitMassFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMassConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitMassFormat,
src_format: UnitMassFormat,
value: float,
*,
client: Client,
output_format: UnitMassFormat,
src_format: UnitMassFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMassConversion, Error]]:
""" Convert a mass unit value to another mass unit value. This is a nice endpoint to use for helper functions. """
"""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(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitMassFormat,
src_format: UnitMassFormat,
value: float,
*,
client: Client,
output_format: UnitMassFormat,
src_format: UnitMassFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMassConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitMassFormat,
src_format: UnitMassFormat,
value: float,
*,
client: Client,
output_format: UnitMassFormat,
src_format: UnitMassFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMassConversion, Error]]:
""" Convert a mass unit value to another mass unit value. This is a nice endpoint to use for helper functions. """
"""Convert a mass unit value to another mass unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_metric_power_cubed_conversion import UnitMetricPowerCubedConversion
from ...models.error import Error
from ...models.unit_metric_power import UnitMetricPower
from ...models.unit_metric_power import UnitMetricPower
from ...models.unit_metric_power_cubed_conversion import UnitMetricPowerCubedConversion
from ...types import Response
def _get_kwargs(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/metric/cubed/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/metric/cubed/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitMetricPowerCubedConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMetricPowerCubedConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitMetricPowerCubedConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMetricPowerCubedConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitMetricPowerCubedConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitMetricPowerCubedConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMetricPowerCubedConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMetricPowerCubedConversion, Error]]:
""" Convert a metric cubed unit value to another metric cubed unit value. This is a nice endpoint to use for helper functions. """
"""Convert a metric cubed unit value to another metric cubed unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMetricPowerCubedConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMetricPowerCubedConversion, Error]]:
""" Convert a metric cubed unit value to another metric cubed unit value. This is a nice endpoint to use for helper functions. """
"""Convert a metric cubed unit value to another metric cubed unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,142 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_metric_power_squared_conversion import UnitMetricPowerSquaredConversion
from ...models.error import Error
from ...models.unit_metric_power import UnitMetricPower
from ...models.unit_metric_power import UnitMetricPower
from ...models.unit_metric_power_squared_conversion import (
UnitMetricPowerSquaredConversion,
)
from ...types import Response
def _get_kwargs(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/metric/squared/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/metric/squared/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMetricPowerSquaredConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMetricPowerSquaredConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
""" Convert a metric squared unit value to another metric squared unit value. This is a nice endpoint to use for helper functions. """
"""Convert a metric squared unit value to another metric squared unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMetricPowerSquaredConversion, Error]]:
""" Convert a metric squared unit value to another metric squared unit value. This is a nice endpoint to use for helper functions. """
"""Convert a metric squared unit value to another metric squared unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_metric_power_conversion import UnitMetricPowerConversion
from ...models.error import Error
from ...models.unit_metric_power import UnitMetricPower
from ...models.unit_metric_power import UnitMetricPower
from ...models.unit_metric_power_conversion import UnitMetricPowerConversion
from ...types import Response
def _get_kwargs(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/metric/power/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/metric/power/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitMetricPowerConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMetricPowerConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitMetricPowerConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMetricPowerConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitMetricPowerConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitMetricPowerConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMetricPowerConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMetricPowerConversion, Error]]:
""" Convert a metric unit value to another metric unit value. This is a nice endpoint to use for helper functions. """
"""Convert a metric unit value to another metric unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitMetricPowerConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
output_format: UnitMetricPower,
src_format: UnitMetricPower,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitMetricPowerConversion, Error]]:
""" Convert a metric unit value to another metric unit value. This is a nice endpoint to use for helper functions. """
"""Convert a metric unit value to another metric unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_power_conversion import UnitPowerConversion
from ...models.error import Error
from ...models.unit_power_format import UnitPowerFormat
from ...models.unit_power_conversion import UnitPowerConversion
from ...models.unit_power_format import UnitPowerFormat
from ...types import Response
def _get_kwargs(
output_format: UnitPowerFormat,
src_format: UnitPowerFormat,
value: float,
*,
client: Client,
output_format: UnitPowerFormat,
src_format: UnitPowerFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/power/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/power/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitPowerConversion, Error]]:
if response.status_code == 200:
response_200 = UnitPowerConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitPowerConversion, Error]]:
if response.status_code == 200:
response_200 = UnitPowerConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitPowerConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitPowerConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitPowerFormat,
src_format: UnitPowerFormat,
value: float,
*,
client: Client,
output_format: UnitPowerFormat,
src_format: UnitPowerFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitPowerConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitPowerFormat,
src_format: UnitPowerFormat,
value: float,
*,
client: Client,
output_format: UnitPowerFormat,
src_format: UnitPowerFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitPowerConversion, Error]]:
""" Convert a power unit value to another power unit value. This is a nice endpoint to use for helper functions. """
"""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(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitPowerFormat,
src_format: UnitPowerFormat,
value: float,
*,
client: Client,
output_format: UnitPowerFormat,
src_format: UnitPowerFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitPowerConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitPowerFormat,
src_format: UnitPowerFormat,
value: float,
*,
client: Client,
output_format: UnitPowerFormat,
src_format: UnitPowerFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitPowerConversion, Error]]:
""" Convert a power unit value to another power unit value. This is a nice endpoint to use for helper functions. """
"""Convert a power unit value to another power unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_pressure_conversion import UnitPressureConversion
from ...models.error import Error
from ...models.unit_pressure_format import UnitPressureFormat
from ...models.unit_pressure_conversion import UnitPressureConversion
from ...models.unit_pressure_format import UnitPressureFormat
from ...types import Response
def _get_kwargs(
output_format: UnitPressureFormat,
src_format: UnitPressureFormat,
value: float,
*,
client: Client,
output_format: UnitPressureFormat,
src_format: UnitPressureFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/pressure/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/pressure/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitPressureConversion, Error]]:
if response.status_code == 200:
response_200 = UnitPressureConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitPressureConversion, Error]]:
if response.status_code == 200:
response_200 = UnitPressureConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitPressureConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitPressureConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitPressureFormat,
src_format: UnitPressureFormat,
value: float,
*,
client: Client,
output_format: UnitPressureFormat,
src_format: UnitPressureFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitPressureConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitPressureFormat,
src_format: UnitPressureFormat,
value: float,
*,
client: Client,
output_format: UnitPressureFormat,
src_format: UnitPressureFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitPressureConversion, Error]]:
""" Convert a pressure unit value to another pressure unit value. This is a nice endpoint to use for helper functions. """
"""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(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitPressureFormat,
src_format: UnitPressureFormat,
value: float,
*,
client: Client,
output_format: UnitPressureFormat,
src_format: UnitPressureFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitPressureConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitPressureFormat,
src_format: UnitPressureFormat,
value: float,
*,
client: Client,
output_format: UnitPressureFormat,
src_format: UnitPressureFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitPressureConversion, Error]]:
""" Convert a pressure unit value to another pressure unit value. This is a nice endpoint to use for helper functions. """
"""Convert a pressure unit value to another pressure unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_radiation_conversion import UnitRadiationConversion
from ...models.error import Error
from ...models.unit_radiation_format import UnitRadiationFormat
from ...models.unit_radiation_conversion import UnitRadiationConversion
from ...models.unit_radiation_format import UnitRadiationFormat
from ...types import Response
def _get_kwargs(
output_format: UnitRadiationFormat,
src_format: UnitRadiationFormat,
value: float,
*,
client: Client,
output_format: UnitRadiationFormat,
src_format: UnitRadiationFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/radiation/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/radiation/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitRadiationConversion, Error]]:
if response.status_code == 200:
response_200 = UnitRadiationConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitRadiationConversion, Error]]:
if response.status_code == 200:
response_200 = UnitRadiationConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitRadiationConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitRadiationConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitRadiationFormat,
src_format: UnitRadiationFormat,
value: float,
*,
client: Client,
output_format: UnitRadiationFormat,
src_format: UnitRadiationFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitRadiationConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitRadiationFormat,
src_format: UnitRadiationFormat,
value: float,
*,
client: Client,
output_format: UnitRadiationFormat,
src_format: UnitRadiationFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitRadiationConversion, Error]]:
""" Convert a radiation unit value to another radiation unit value. This is a nice endpoint to use for helper functions. """
"""Convert a radiation unit value to another radiation unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitRadiationFormat,
src_format: UnitRadiationFormat,
value: float,
*,
client: Client,
output_format: UnitRadiationFormat,
src_format: UnitRadiationFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitRadiationConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitRadiationFormat,
src_format: UnitRadiationFormat,
value: float,
*,
client: Client,
output_format: UnitRadiationFormat,
src_format: UnitRadiationFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitRadiationConversion, Error]]:
""" Convert a radiation unit value to another radiation unit value. This is a nice endpoint to use for helper functions. """
"""Convert a radiation unit value to another radiation unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_radioactivity_conversion import UnitRadioactivityConversion
from ...models.error import Error
from ...models.unit_radioactivity_format import UnitRadioactivityFormat
from ...models.unit_radioactivity_conversion import UnitRadioactivityConversion
from ...models.unit_radioactivity_format import UnitRadioactivityFormat
from ...types import Response
def _get_kwargs(
output_format: UnitRadioactivityFormat,
src_format: UnitRadioactivityFormat,
value: float,
*,
client: Client,
output_format: UnitRadioactivityFormat,
src_format: UnitRadioactivityFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/radioactivity/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/radioactivity/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitRadioactivityConversion, Error]]:
if response.status_code == 200:
response_200 = UnitRadioactivityConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitRadioactivityConversion, Error]]:
if response.status_code == 200:
response_200 = UnitRadioactivityConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitRadioactivityConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitRadioactivityConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitRadioactivityFormat,
src_format: UnitRadioactivityFormat,
value: float,
*,
client: Client,
output_format: UnitRadioactivityFormat,
src_format: UnitRadioactivityFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitRadioactivityConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitRadioactivityFormat,
src_format: UnitRadioactivityFormat,
value: float,
*,
client: Client,
output_format: UnitRadioactivityFormat,
src_format: UnitRadioactivityFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitRadioactivityConversion, Error]]:
""" Convert a radioactivity unit value to another radioactivity unit value. This is a nice endpoint to use for helper functions. """
"""Convert a radioactivity unit value to another radioactivity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitRadioactivityFormat,
src_format: UnitRadioactivityFormat,
value: float,
*,
client: Client,
output_format: UnitRadioactivityFormat,
src_format: UnitRadioactivityFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitRadioactivityConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitRadioactivityFormat,
src_format: UnitRadioactivityFormat,
value: float,
*,
client: Client,
output_format: UnitRadioactivityFormat,
src_format: UnitRadioactivityFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitRadioactivityConversion, Error]]:
""" Convert a radioactivity unit value to another radioactivity unit value. This is a nice endpoint to use for helper functions. """
"""Convert a radioactivity unit value to another radioactivity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_solid_angle_conversion import UnitSolidAngleConversion
from ...models.error import Error
from ...models.unit_solid_angle_format import UnitSolidAngleFormat
from ...models.unit_solid_angle_conversion import UnitSolidAngleConversion
from ...models.unit_solid_angle_format import UnitSolidAngleFormat
from ...types import Response
def _get_kwargs(
output_format: UnitSolidAngleFormat,
src_format: UnitSolidAngleFormat,
value: float,
*,
client: Client,
output_format: UnitSolidAngleFormat,
src_format: UnitSolidAngleFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/solid-angle/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/solid-angle/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitSolidAngleConversion, Error]]:
if response.status_code == 200:
response_200 = UnitSolidAngleConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitSolidAngleConversion, Error]]:
if response.status_code == 200:
response_200 = UnitSolidAngleConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitSolidAngleConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitSolidAngleConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitSolidAngleFormat,
src_format: UnitSolidAngleFormat,
value: float,
*,
client: Client,
output_format: UnitSolidAngleFormat,
src_format: UnitSolidAngleFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitSolidAngleConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitSolidAngleFormat,
src_format: UnitSolidAngleFormat,
value: float,
*,
client: Client,
output_format: UnitSolidAngleFormat,
src_format: UnitSolidAngleFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitSolidAngleConversion, Error]]:
""" Convert a solid angle unit value to another solid angle unit value. This is a nice endpoint to use for helper functions. """
"""Convert a solid angle unit value to another solid angle unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitSolidAngleFormat,
src_format: UnitSolidAngleFormat,
value: float,
*,
client: Client,
output_format: UnitSolidAngleFormat,
src_format: UnitSolidAngleFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitSolidAngleConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitSolidAngleFormat,
src_format: UnitSolidAngleFormat,
value: float,
*,
client: Client,
output_format: UnitSolidAngleFormat,
src_format: UnitSolidAngleFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitSolidAngleConversion, Error]]:
""" Convert a solid angle unit value to another solid angle unit value. This is a nice endpoint to use for helper functions. """
"""Convert a solid angle unit value to another solid angle unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_temperature_conversion import UnitTemperatureConversion
from ...models.error import Error
from ...models.unit_temperature_format import UnitTemperatureFormat
from ...models.unit_temperature_conversion import UnitTemperatureConversion
from ...models.unit_temperature_format import UnitTemperatureFormat
from ...types import Response
def _get_kwargs(
output_format: UnitTemperatureFormat,
src_format: UnitTemperatureFormat,
value: float,
*,
client: Client,
output_format: UnitTemperatureFormat,
src_format: UnitTemperatureFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/temperature/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/temperature/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitTemperatureConversion, Error]]:
if response.status_code == 200:
response_200 = UnitTemperatureConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitTemperatureConversion, Error]]:
if response.status_code == 200:
response_200 = UnitTemperatureConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitTemperatureConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitTemperatureConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitTemperatureFormat,
src_format: UnitTemperatureFormat,
value: float,
*,
client: Client,
output_format: UnitTemperatureFormat,
src_format: UnitTemperatureFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitTemperatureConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitTemperatureFormat,
src_format: UnitTemperatureFormat,
value: float,
*,
client: Client,
output_format: UnitTemperatureFormat,
src_format: UnitTemperatureFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitTemperatureConversion, Error]]:
""" Convert a temperature unit value to another temperature unit value. This is a nice endpoint to use for helper functions. """
"""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(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitTemperatureFormat,
src_format: UnitTemperatureFormat,
value: float,
*,
client: Client,
output_format: UnitTemperatureFormat,
src_format: UnitTemperatureFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitTemperatureConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitTemperatureFormat,
src_format: UnitTemperatureFormat,
value: float,
*,
client: Client,
output_format: UnitTemperatureFormat,
src_format: UnitTemperatureFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitTemperatureConversion, Error]]:
""" Convert a temperature unit value to another temperature unit value. This is a nice endpoint to use for helper functions. """
"""Convert a temperature unit value to another temperature unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_time_conversion import UnitTimeConversion
from ...models.error import Error
from ...models.unit_time_format import UnitTimeFormat
from ...models.unit_time_conversion import UnitTimeConversion
from ...models.unit_time_format import UnitTimeFormat
from ...types import Response
def _get_kwargs(
output_format: UnitTimeFormat,
src_format: UnitTimeFormat,
value: float,
*,
client: Client,
output_format: UnitTimeFormat,
src_format: UnitTimeFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/time/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/time/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitTimeConversion, Error]]:
if response.status_code == 200:
response_200 = UnitTimeConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitTimeConversion, Error]]:
if response.status_code == 200:
response_200 = UnitTimeConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitTimeConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitTimeConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitTimeFormat,
src_format: UnitTimeFormat,
value: float,
*,
client: Client,
output_format: UnitTimeFormat,
src_format: UnitTimeFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitTimeConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitTimeFormat,
src_format: UnitTimeFormat,
value: float,
*,
client: Client,
output_format: UnitTimeFormat,
src_format: UnitTimeFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitTimeConversion, Error]]:
""" Convert a time unit value to another time unit value. This is a nice endpoint to use for helper functions. """
"""Convert a time unit value to another time unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitTimeFormat,
src_format: UnitTimeFormat,
value: float,
*,
client: Client,
output_format: UnitTimeFormat,
src_format: UnitTimeFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitTimeConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitTimeFormat,
src_format: UnitTimeFormat,
value: float,
*,
client: Client,
output_format: UnitTimeFormat,
src_format: UnitTimeFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitTimeConversion, Error]]:
""" Convert a time unit value to another time unit value. This is a nice endpoint to use for helper functions. """
"""Convert a time unit value to another time unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_velocity_conversion import UnitVelocityConversion
from ...models.error import Error
from ...models.unit_velocity_format import UnitVelocityFormat
from ...models.unit_velocity_conversion import UnitVelocityConversion
from ...models.unit_velocity_format import UnitVelocityFormat
from ...types import Response
def _get_kwargs(
output_format: UnitVelocityFormat,
src_format: UnitVelocityFormat,
value: float,
*,
client: Client,
output_format: UnitVelocityFormat,
src_format: UnitVelocityFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/velocity/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/velocity/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitVelocityConversion, Error]]:
if response.status_code == 200:
response_200 = UnitVelocityConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitVelocityConversion, Error]]:
if response.status_code == 200:
response_200 = UnitVelocityConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitVelocityConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitVelocityConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitVelocityFormat,
src_format: UnitVelocityFormat,
value: float,
*,
client: Client,
output_format: UnitVelocityFormat,
src_format: UnitVelocityFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitVelocityConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitVelocityFormat,
src_format: UnitVelocityFormat,
value: float,
*,
client: Client,
output_format: UnitVelocityFormat,
src_format: UnitVelocityFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitVelocityConversion, Error]]:
""" Convert a velocity unit value to another velocity unit value. This is a nice endpoint to use for helper functions. """
"""Convert a velocity unit value to another velocity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitVelocityFormat,
src_format: UnitVelocityFormat,
value: float,
*,
client: Client,
output_format: UnitVelocityFormat,
src_format: UnitVelocityFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitVelocityConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitVelocityFormat,
src_format: UnitVelocityFormat,
value: float,
*,
client: Client,
output_format: UnitVelocityFormat,
src_format: UnitVelocityFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitVelocityConversion, Error]]:
""" Convert a velocity unit value to another velocity unit value. This is a nice endpoint to use for helper functions. """
"""Convert a velocity unit value to another velocity unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_voltage_conversion import UnitVoltageConversion
from ...models.error import Error
from ...models.unit_voltage_format import UnitVoltageFormat
from ...models.unit_voltage_conversion import UnitVoltageConversion
from ...models.unit_voltage_format import UnitVoltageFormat
from ...types import Response
def _get_kwargs(
output_format: UnitVoltageFormat,
src_format: UnitVoltageFormat,
value: float,
*,
client: Client,
output_format: UnitVoltageFormat,
src_format: UnitVoltageFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/voltage/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/voltage/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitVoltageConversion, Error]]:
if response.status_code == 200:
response_200 = UnitVoltageConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitVoltageConversion, Error]]:
if response.status_code == 200:
response_200 = UnitVoltageConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitVoltageConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitVoltageConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitVoltageFormat,
src_format: UnitVoltageFormat,
value: float,
*,
client: Client,
output_format: UnitVoltageFormat,
src_format: UnitVoltageFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitVoltageConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitVoltageFormat,
src_format: UnitVoltageFormat,
value: float,
*,
client: Client,
output_format: UnitVoltageFormat,
src_format: UnitVoltageFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitVoltageConversion, Error]]:
""" Convert a voltage unit value to another voltage unit value. This is a nice endpoint to use for helper functions. """
"""Convert a voltage unit value to another voltage unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitVoltageFormat,
src_format: UnitVoltageFormat,
value: float,
*,
client: Client,
output_format: UnitVoltageFormat,
src_format: UnitVoltageFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitVoltageConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitVoltageFormat,
src_format: UnitVoltageFormat,
value: float,
*,
client: Client,
output_format: UnitVoltageFormat,
src_format: UnitVoltageFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitVoltageConversion, Error]]:
""" Convert a voltage unit value to another voltage unit value. This is a nice endpoint to use for helper functions. """
"""Convert a voltage unit value to another voltage unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1,129 +1,140 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.unit_volume_conversion import UnitVolumeConversion
from ...models.error import Error
from ...models.unit_volume_format import UnitVolumeFormat
from ...models.unit_volume_conversion import UnitVolumeConversion
from ...models.unit_volume_format import UnitVolumeFormat
from ...types import Response
def _get_kwargs(
output_format: UnitVolumeFormat,
src_format: UnitVolumeFormat,
value: float,
*,
client: Client,
output_format: UnitVolumeFormat,
src_format: UnitVolumeFormat,
value: float,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/unit/conversion/volume/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
url = "{}/unit/conversion/volume/{src_format}/{output_format}".format(
client.base_url, output_format=output_format, src_format=src_format
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:
url = url + "?value=" + str(value)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, UnitVolumeConversion, Error]]:
if response.status_code == 200:
response_200 = UnitVolumeConversion.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, UnitVolumeConversion, Error]]:
if response.status_code == 200:
response_200 = UnitVolumeConversion.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitVolumeConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, UnitVolumeConversion, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: UnitVolumeFormat,
src_format: UnitVolumeFormat,
value: float,
*,
client: Client,
output_format: UnitVolumeFormat,
src_format: UnitVolumeFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitVolumeConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
output_format: UnitVolumeFormat,
src_format: UnitVolumeFormat,
value: float,
*,
client: Client,
output_format: UnitVolumeFormat,
src_format: UnitVolumeFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitVolumeConversion, Error]]:
""" Convert a volume unit value to another volume unit value. This is a nice endpoint to use for helper functions. """
"""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(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
return sync_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
).parsed
async def asyncio_detailed(
output_format: UnitVolumeFormat,
src_format: UnitVolumeFormat,
value: float,
*,
client: Client,
output_format: UnitVolumeFormat,
src_format: UnitVolumeFormat,
value: float,
*,
client: Client,
) -> Response[Union[Any, UnitVolumeConversion, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
output_format: UnitVolumeFormat,
src_format: UnitVolumeFormat,
value: float,
*,
client: Client,
output_format: UnitVolumeFormat,
src_format: UnitVolumeFormat,
value: float,
*,
client: Client,
) -> Optional[Union[Any, UnitVolumeConversion, Error]]:
""" Convert a volume unit value to another volume unit value. This is a nice endpoint to use for helper functions. """
"""Convert a volume unit value to another volume unit value. This is a nice endpoint to use for helper functions.""" # noqa: E501
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
value=value,
client=client,
)
).parsed

View File

@ -1 +1 @@
""" Contains methods for accessing the users API paths: A user is someone who uses the KittyCAD API. Here, we can create, delete, and list users. We can also get information about a user. Operations will only be authorized if the user is requesting information about themselves. """
""" Contains methods for accessing the users API paths: A user is someone who uses the KittyCAD API. Here, we can create, delete, and list users. We can also get information about a user. Operations will only be authorized if the user is requesting information about themselves. """ # noqa: E501

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
@ -6,96 +6,97 @@ from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user".format(client.base_url)
url = "{}/user".format(client.base_url) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
if response.status_code == 204:
response_204 = None
return response_204
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It deletes the authenticated user from KittyCAD's database.
This call will only succeed if all invoices associated with the user have been paid in full and there is no outstanding balance. """
"""This endpoint requires authentication by any KittyCAD user. It deletes the authenticated user from KittyCAD's database.
This call will only succeed if all invoices associated with the user have been paid in full and there is no outstanding balance.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
client=client,
)
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It deletes the authenticated user from KittyCAD's database.
This call will only succeed if all invoices associated with the user have been paid in full and there is no outstanding balance. """
"""This endpoint requires authentication by any KittyCAD user. It deletes the authenticated user from KittyCAD's database.
This call will only succeed if all invoices associated with the user have been paid in full and there is no outstanding balance.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,114 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.session import Session
from ...types import Response
def _get_kwargs(
token: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/session/{token}".format(client.base_url, token=token) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, Session, Error]]:
if response.status_code == 200:
response_200 = Session.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 None
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, Session, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
token: str,
*,
client: Client,
) -> Response[Union[Any, Session, Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
token: str,
*,
client: Client,
) -> Optional[Union[Any, Session, Error]]:
"""This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501
return sync_detailed(
token=token,
client=client,
).parsed
async def asyncio_detailed(
token: str,
*,
client: Client,
) -> Response[Union[Any, Session, Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
token: str,
*,
client: Client,
) -> Optional[Union[Any, Session, Error]]:
"""This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.""" # noqa: E501
return (
await asyncio_detailed(
token=token,
client=client,
)
).parsed

View File

@ -1,113 +1,114 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.user import User
from ...models.error import Error
from ...models.user import User
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/users/{id}".format(client.base_url, id=id)
url = "{}/users/{id}".format(client.base_url, id=id) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, User, Error]]:
if response.status_code == 200:
response_200 = User.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 None
if response.status_code == 200:
response_200 = User.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, User, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Response[Union[Any, User, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Optional[Union[Any, User, Error]]:
""" To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user.
Alternatively, to get information about the authenticated user, use `/user` endpoint.
To get information about any KittyCAD user, you must be a KittyCAD employee. """
"""To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user.
Alternatively, to get information about the authenticated user, use `/user` endpoint.
To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Response[Union[Any, User, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Optional[Union[Any, User, Error]]:
""" To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user.
Alternatively, to get information about the authenticated user, use `/user` endpoint.
To get information about any KittyCAD user, you must be a KittyCAD employee. """
"""To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user.
Alternatively, to get information about the authenticated user, use `/user` endpoint.
To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -1,113 +1,118 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.extended_user import ExtendedUser
from ...models.error import Error
from ...models.extended_user import ExtendedUser
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/users-extended/{id}".format(client.base_url, id=id)
url = "{}/users-extended/{id}".format(client.base_url, id=id) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
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(),
}
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, ExtendedUser, Error]]:
if response.status_code == 200:
response_200 = ExtendedUser.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 None
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, ExtendedUser, Error]]:
if response.status_code == 200:
response_200 = ExtendedUser.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 None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, ExtendedUser, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, ExtendedUser, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Response[Union[Any, ExtendedUser, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Optional[Union[Any, ExtendedUser, Error]]:
""" To get information about yourself, use `/users-extended/me` as the endpoint. By doing so you will get the user information for the authenticated user.
Alternatively, to get information about the authenticated user, use `/user/extended` endpoint.
To get information about any KittyCAD user, you must be a KittyCAD employee. """
"""To get information about yourself, use `/users-extended/me` as the endpoint. By doing so you will get the user information for the authenticated user.
Alternatively, to get information about the authenticated user, use `/user/extended` endpoint.
To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Response[Union[Any, ExtendedUser, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
id: str,
*,
client: Client,
) -> Optional[Union[Any, ExtendedUser, Error]]:
""" To get information about yourself, use `/users-extended/me` as the endpoint. By doing so you will get the user information for the authenticated user.
Alternatively, to get information about the authenticated user, use `/user/extended` endpoint.
To get information about any KittyCAD user, you must be a KittyCAD employee. """
"""To get information about yourself, use `/users-extended/me` as the endpoint. By doing so you will get the user information for the authenticated user.
Alternatively, to get information about the authenticated user, use `/user/extended` endpoint.
To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

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