I have generated the latest API!
This commit is contained in:
@ -4,6 +4,8 @@ import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.file_conversion import FileConversion
|
||||
from ...models.file2_d_vector_conversion import File2DVectorConversion
|
||||
from ...models.file3_d_conversion import File3DConversion
|
||||
from ...models.file_center_of_mass import FileCenterOfMass
|
||||
from ...models.file_mass import FileMass
|
||||
from ...models.file_volume import FileVolume
|
||||
@ -30,7 +32,7 @@ def _get_kwargs(
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
try:
|
||||
@ -40,6 +42,20 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
|
||||
return option
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
option = File2DVectorConversion.from_dict(data)
|
||||
return option
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
option = File3DConversion.from_dict(data)
|
||||
return option
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
@ -84,7 +100,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
@ -97,7 +113,7 @@ def sync_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
@ -115,7 +131,7 @@ def sync(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, 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.
|
||||
@ -131,7 +147,7 @@ async def asyncio_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
@ -147,7 +163,7 @@ async def asyncio(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, 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.
|
||||
|
@ -5,12 +5,12 @@ import httpx
|
||||
from ...client import Client
|
||||
from ...models.file_center_of_mass import FileCenterOfMass
|
||||
from ...models.error import Error
|
||||
from ...models.file_source_format import FileSourceFormat
|
||||
from ...models.file3_d_import_format import File3DImportFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
material_density: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -53,7 +53,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileCent
|
||||
|
||||
def sync_detailed(
|
||||
material_density: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -75,7 +75,7 @@ def sync_detailed(
|
||||
|
||||
def sync(
|
||||
material_density: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -93,7 +93,7 @@ If the operation is performed asynchronously, the `id` of the operation will be
|
||||
|
||||
async def asyncio_detailed(
|
||||
material_density: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -113,7 +113,7 @@ async def asyncio_detailed(
|
||||
|
||||
async def asyncio(
|
||||
material_density: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
|
@ -5,13 +5,13 @@ import httpx
|
||||
from ...client import Client
|
||||
from ...models.file_conversion import FileConversion
|
||||
from ...models.error import Error
|
||||
from ...models.file_output_format import FileOutputFormat
|
||||
from ...models.file_source_format import FileSourceFormat
|
||||
from ...models.file_export_format import FileExportFormat
|
||||
from ...models.file_import_format import FileImportFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
output_format: FileOutputFormat,
|
||||
src_format: FileSourceFormat,
|
||||
output_format: FileExportFormat,
|
||||
src_format: FileImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -53,8 +53,8 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConv
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
output_format: FileOutputFormat,
|
||||
src_format: FileSourceFormat,
|
||||
output_format: FileExportFormat,
|
||||
src_format: FileImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -75,8 +75,8 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
output_format: FileOutputFormat,
|
||||
src_format: FileSourceFormat,
|
||||
output_format: FileExportFormat,
|
||||
src_format: FileImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -94,8 +94,8 @@ If the operation is performed asynchronously, the `id` of the operation will be
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
output_format: FileOutputFormat,
|
||||
src_format: FileSourceFormat,
|
||||
output_format: FileExportFormat,
|
||||
src_format: FileImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -114,8 +114,8 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
output_format: FileOutputFormat,
|
||||
src_format: FileSourceFormat,
|
||||
output_format: FileExportFormat,
|
||||
src_format: FileImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
|
@ -5,12 +5,12 @@ import httpx
|
||||
from ...client import Client
|
||||
from ...models.file_density import FileDensity
|
||||
from ...models.error import Error
|
||||
from ...models.file_source_format import FileSourceFormat
|
||||
from ...models.file3_d_import_format import File3DImportFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
material_mass: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -53,7 +53,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileDens
|
||||
|
||||
def sync_detailed(
|
||||
material_mass: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -75,7 +75,7 @@ def sync_detailed(
|
||||
|
||||
def sync(
|
||||
material_mass: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -93,7 +93,7 @@ If the operation is performed asynchronously, the `id` of the operation will be
|
||||
|
||||
async def asyncio_detailed(
|
||||
material_mass: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -113,7 +113,7 @@ async def asyncio_detailed(
|
||||
|
||||
async def asyncio(
|
||||
material_mass: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
|
@ -5,12 +5,12 @@ import httpx
|
||||
from ...client import Client
|
||||
from ...models.file_mass import FileMass
|
||||
from ...models.error import Error
|
||||
from ...models.file_source_format import FileSourceFormat
|
||||
from ...models.file3_d_import_format import File3DImportFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
material_density: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -53,7 +53,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileMass
|
||||
|
||||
def sync_detailed(
|
||||
material_density: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -75,7 +75,7 @@ def sync_detailed(
|
||||
|
||||
def sync(
|
||||
material_density: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -93,7 +93,7 @@ If the operation is performed asynchronously, the `id` of the operation will be
|
||||
|
||||
async def asyncio_detailed(
|
||||
material_density: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -113,7 +113,7 @@ async def asyncio_detailed(
|
||||
|
||||
async def asyncio(
|
||||
material_density: float,
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
|
@ -5,11 +5,11 @@ import httpx
|
||||
from ...client import Client
|
||||
from ...models.file_surface_area import FileSurfaceArea
|
||||
from ...models.error import Error
|
||||
from ...models.file_source_format import FileSourceFormat
|
||||
from ...models.file3_d_import_format import File3DImportFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -51,7 +51,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileSurf
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -71,7 +71,7 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -87,7 +87,7 @@ If the operation is performed asynchronously, the `id` of the operation will be
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -105,7 +105,7 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
|
@ -5,11 +5,11 @@ import httpx
|
||||
from ...client import Client
|
||||
from ...models.file_volume import FileVolume
|
||||
from ...models.error import Error
|
||||
from ...models.file_source_format import FileSourceFormat
|
||||
from ...models.file3_d_import_format import File3DImportFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -51,7 +51,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileVolu
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -71,7 +71,7 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -87,7 +87,7 @@ If the operation is performed asynchronously, the `id` of the operation will be
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
@ -105,7 +105,7 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
src_format: FileSourceFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
|
@ -4,6 +4,8 @@ import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.file_conversion import FileConversion
|
||||
from ...models.file2_d_vector_conversion import File2DVectorConversion
|
||||
from ...models.file3_d_conversion import File3DConversion
|
||||
from ...models.file_center_of_mass import FileCenterOfMass
|
||||
from ...models.file_mass import FileMass
|
||||
from ...models.file_volume import FileVolume
|
||||
@ -30,7 +32,7 @@ def _get_kwargs(
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
try:
|
||||
@ -40,6 +42,20 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
|
||||
return option
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
option = File2DVectorConversion.from_dict(data)
|
||||
return option
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
option = File3DConversion.from_dict(data)
|
||||
return option
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
@ -84,7 +100,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
@ -97,7 +113,7 @@ def sync_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
@ -115,7 +131,7 @@ def sync(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
""" Get the status and output of an async file conversion.
|
||||
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
|
||||
If the user is not authenticated to view the specified file conversion, then it is not returned.
|
||||
@ -131,7 +147,7 @@ async def asyncio_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
@ -147,7 +163,7 @@ async def asyncio(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
""" Get the status and output of an async file conversion.
|
||||
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
|
||||
If the user is not authenticated to view the specified file conversion, then it is not returned.
|
||||
|
@ -4,6 +4,8 @@ import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.file_conversion import FileConversion
|
||||
from ...models.file2_d_vector_conversion import File2DVectorConversion
|
||||
from ...models.file3_d_conversion import File3DConversion
|
||||
from ...models.file_center_of_mass import FileCenterOfMass
|
||||
from ...models.file_mass import FileMass
|
||||
from ...models.file_volume import FileVolume
|
||||
@ -30,7 +32,7 @@ def _get_kwargs(
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
try:
|
||||
@ -40,6 +42,20 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
|
||||
return option
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
option = File2DVectorConversion.from_dict(data)
|
||||
return option
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
option = File3DConversion.from_dict(data)
|
||||
return option
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
@ -84,7 +100,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
@ -97,7 +113,7 @@ def sync_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
@ -115,7 +131,7 @@ def sync(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
|
||||
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
|
||||
|
||||
@ -129,7 +145,7 @@ async def asyncio_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
@ -145,7 +161,7 @@ async def asyncio(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, FileConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
|
||||
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
|
||||
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
|
||||
|
||||
|
100
kittycad/api/users/get_user_front_hash_self.py
Normal file
100
kittycad/api/users/get_user_front_hash_self.py
Normal file
@ -0,0 +1,100 @@
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.str import str
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/front-hash".format(client.base_url)
|
||||
|
||||
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, str, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = response.text
|
||||
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, str, 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, str, Error]]:
|
||||
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, str, Error]]:
|
||||
""" This info is sent to front when initialing the front chat, it prevents impersonations using js hacks in the browser """
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, str, Error]]:
|
||||
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, str, Error]]:
|
||||
""" This info is sent to front when initialing the front chat, it prevents impersonations using js hacks in the browser """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
100
kittycad/api/users/get_user_onboarding_self.py
Normal file
100
kittycad/api/users/get_user_onboarding_self.py
Normal file
@ -0,0 +1,100 @@
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.onboarding import Onboarding
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/onboarding".format(client.base_url)
|
||||
|
||||
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, Onboarding, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = Onboarding.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, Onboarding, 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, Onboarding, Error]]:
|
||||
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, Onboarding, Error]]:
|
||||
""" Checks key part of their api usage to determine their onboarding progress """
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, Onboarding, Error]]:
|
||||
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, Onboarding, Error]]:
|
||||
""" Checks key part of their api usage to determine their onboarding progress """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
Reference in New Issue
Block a user