Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
8d476bbec6 | |||
b233f94a24 | |||
6351fb1bbc | |||
0e11945f1d | |||
d3d454a2d7 | |||
b150024bff | |||
0ad6216cde | |||
8925458665 |
2
.github/workflows/black.yml
vendored
2
.github/workflows/black.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
- name: Install dependencies
|
||||
|
2
.github/workflows/build-test.yml
vendored
2
.github/workflows/build-test.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
|
2
.github/workflows/generate-docs.yml
vendored
2
.github/workflows/generate-docs.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.x
|
||||
|
||||
|
2
.github/workflows/make-release.yml
vendored
2
.github/workflows/make-release.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
|
2
.github/workflows/mypy.yml
vendored
2
.github/workflows/mypy.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
- name: Install dependencies
|
||||
|
2
.github/workflows/ruff.yml
vendored
2
.github/workflows/ruff.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
- name: Install dependencies
|
||||
|
11
.github/workflows/update-spec-for-docs.yml
vendored
11
.github/workflows/update-spec-for-docs.yml
vendored
@ -15,6 +15,13 @@ jobs:
|
||||
name: update-spec
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
# required
|
||||
app-id: ${{ secrets.GH_ORG_APP_ID }}
|
||||
private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
- uses: actions/checkout@v4
|
||||
- name: make generate
|
||||
shell: bash
|
||||
@ -38,7 +45,7 @@ jobs:
|
||||
with:
|
||||
repository: 'kittycad/website'
|
||||
path: 'docs'
|
||||
token: ${{secrets.PAT_GITHUB}}
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- name: move spec to docs
|
||||
shell: bash
|
||||
run: |
|
||||
@ -62,6 +69,6 @@ jobs:
|
||||
--head "$NEW_BRANCH" \
|
||||
--base main || true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PAT_GITHUB}}
|
||||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||

|
||||
|
||||
# kittycad.py
|
||||
|
||||
The Python API client for KittyCAD.
|
||||
|
@ -2,7 +2,7 @@ import datetime
|
||||
from typing import List, Optional, Dict, Union, Any, Literal
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Base64Bytes, AnyUrl
|
||||
from pydantic import BaseModel, Base64Bytes, AnyUrl, ConfigDict
|
||||
from pydantic_extra_types.phone_numbers import PhoneNumber
|
||||
from .base64data import Base64Data
|
||||
|
||||
@ -19,3 +19,7 @@ class {{ name }}(BaseModel):
|
||||
{{ field.name }}: {{ field.type }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
model_config = ConfigDict(
|
||||
protected_namespaces=()
|
||||
)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
||||
""" Contains methods for accessing the ai API paths: AI uses machine learning to generate 3D meshes. """ # noqa: E501
|
||||
""" Contains methods for accessing the ai API paths: AI uses machine learning to generate CAD models. """ # noqa: E501
|
||||
|
@ -15,6 +15,7 @@ def _get_kwargs(
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
no_models: Optional[bool] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/text-to-cad".format(
|
||||
client.base_url,
|
||||
@ -38,6 +39,12 @@ def _get_kwargs(
|
||||
else:
|
||||
url = url + "?sort_by=" + str(sort_by)
|
||||
|
||||
if no_models is not None:
|
||||
if "?" in url:
|
||||
url = url + "&no_models=" + str(no_models)
|
||||
else:
|
||||
url = url + "?no_models=" + str(no_models)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
@ -81,11 +88,13 @@ def sync_detailed(
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
no_models: Optional[bool] = None,
|
||||
) -> Response[Optional[Union[TextToCadResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
no_models=no_models,
|
||||
client=client,
|
||||
)
|
||||
|
||||
@ -103,6 +112,7 @@ def sync(
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
no_models: Optional[bool] = None,
|
||||
) -> Optional[Union[TextToCadResultsPage, Error]]:
|
||||
"""This will always return the STEP file contents as well as the format the user originally requested.
|
||||
This endpoint requires authentication by any Zoo user. It returns the text-to-CAD models for the authenticated user.
|
||||
@ -113,6 +123,7 @@ def sync(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
no_models=no_models,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
@ -123,11 +134,13 @@ async def asyncio_detailed(
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
no_models: Optional[bool] = None,
|
||||
) -> Response[Optional[Union[TextToCadResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
no_models=no_models,
|
||||
client=client,
|
||||
)
|
||||
|
||||
@ -143,6 +156,7 @@ async def asyncio(
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
no_models: Optional[bool] = None,
|
||||
) -> Optional[Union[TextToCadResultsPage, Error]]:
|
||||
"""This will always return the STEP file contents as well as the format the user originally requested.
|
||||
This endpoint requires authentication by any Zoo user. It returns the text-to-CAD models for the authenticated user.
|
||||
@ -154,6 +168,7 @@ async def asyncio(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
no_models=no_models,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
|
@ -1,103 +0,0 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.ai_plugin_manifest import AiPluginManifest
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
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()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[AiPluginManifest, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = AiPluginManifest(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[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,
|
||||
) -> Response[Optional[Union[AiPluginManifest, 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[AiPluginManifest, Error]]:
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[AiPluginManifest, 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[AiPluginManifest, Error]]:
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -1,104 +0,0 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/openai/openapi.json".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[dict, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = response.json()
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[dict, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[dict, 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[dict, Error]]:
|
||||
"""This is the same as the OpenAPI schema, BUT it has some modifications to make it compatible with OpenAI. For example, descriptions must be < 300 chars.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[dict, 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[dict, Error]]:
|
||||
"""This is the same as the OpenAPI schema, BUT it has some modifications to make it compatible with OpenAI. For example, descriptions must be < 300 chars.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -13,7 +13,7 @@ class Client:
|
||||
base_url: str = attr.ib(default="https://api.kittycad.io")
|
||||
cookies: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
|
||||
headers: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
|
||||
timeout: float = attr.ib(50.0, kw_only=True)
|
||||
timeout: float = attr.ib(120.0, kw_only=True)
|
||||
verify_ssl: Union[str, bool, ssl.SSLContext] = attr.ib(True, kw_only=True)
|
||||
|
||||
def get_headers(self) -> Dict[str, str]:
|
||||
|
@ -501,7 +501,7 @@ def test_text_to_cad():
|
||||
|
||||
result: Optional[Union[TextToCad, Error]] = create_text_to_cad.sync(
|
||||
client=client,
|
||||
output_format=FileExportFormat.FBX,
|
||||
output_format=FileExportFormat.STEP,
|
||||
body=TextToCadCreateBody(
|
||||
prompt="a 2x4 lego",
|
||||
),
|
||||
|
@ -42,9 +42,7 @@ from kittycad.api.file import (
|
||||
)
|
||||
from kittycad.api.hidden import auth_email, auth_email_callback, logout
|
||||
from kittycad.api.meta import (
|
||||
get_ai_plugin_manifest,
|
||||
get_metadata,
|
||||
get_openai_schema,
|
||||
get_schema,
|
||||
internal_get_api_token_for_discord_user,
|
||||
ping,
|
||||
@ -91,7 +89,6 @@ from kittycad.api.users import (
|
||||
)
|
||||
from kittycad.client import ClientFromEnv
|
||||
from kittycad.models import (
|
||||
AiPluginManifest,
|
||||
AiPrompt,
|
||||
AiPromptResultsPage,
|
||||
ApiCallQueryGroup,
|
||||
@ -203,51 +200,6 @@ async def test_get_schema_async():
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skip
|
||||
def test_get_ai_plugin_manifest():
|
||||
# Create our client.
|
||||
client = ClientFromEnv()
|
||||
|
||||
result: Optional[Union[AiPluginManifest, Error]] = get_ai_plugin_manifest.sync(
|
||||
client=client,
|
||||
)
|
||||
|
||||
if isinstance(result, Error) or result is None:
|
||||
print(result)
|
||||
raise Exception("Error in response")
|
||||
|
||||
body: AiPluginManifest = result
|
||||
print(body)
|
||||
|
||||
# OR if you need more info (e.g. status_code)
|
||||
response: Response[
|
||||
Optional[Union[AiPluginManifest, Error]]
|
||||
] = get_ai_plugin_manifest.sync_detailed(
|
||||
client=client,
|
||||
)
|
||||
|
||||
|
||||
# OR run async
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.skip
|
||||
async def test_get_ai_plugin_manifest_async():
|
||||
# Create our client.
|
||||
client = ClientFromEnv()
|
||||
|
||||
result: Optional[
|
||||
Union[AiPluginManifest, Error]
|
||||
] = await get_ai_plugin_manifest.asyncio(
|
||||
client=client,
|
||||
)
|
||||
|
||||
# OR run async with more info
|
||||
response: Response[
|
||||
Optional[Union[AiPluginManifest, Error]]
|
||||
] = await get_ai_plugin_manifest.asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skip
|
||||
def test_get_metadata():
|
||||
# Create our client.
|
||||
@ -1491,38 +1443,6 @@ async def test_logout_async():
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skip
|
||||
def test_get_openai_schema():
|
||||
# Create our client.
|
||||
client = ClientFromEnv()
|
||||
|
||||
get_openai_schema.sync(
|
||||
client=client,
|
||||
)
|
||||
|
||||
# OR if you need more info (e.g. status_code)
|
||||
get_openai_schema.sync_detailed(
|
||||
client=client,
|
||||
)
|
||||
|
||||
|
||||
# OR run async
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.skip
|
||||
async def test_get_openai_schema_async():
|
||||
# Create our client.
|
||||
client = ClientFromEnv()
|
||||
|
||||
await get_openai_schema.asyncio(
|
||||
client=client,
|
||||
)
|
||||
|
||||
# OR run async with more info
|
||||
await get_openai_schema.asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skip
|
||||
def test_ping():
|
||||
# Create our client.
|
||||
@ -3403,6 +3323,7 @@ def test_list_text_to_cad_models_for_user():
|
||||
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||
limit=None, # Optional[int]
|
||||
page_token=None, # Optional[str]
|
||||
no_models=None, # Optional[bool]
|
||||
)
|
||||
|
||||
if isinstance(result, Error) or result is None:
|
||||
@ -3420,6 +3341,7 @@ def test_list_text_to_cad_models_for_user():
|
||||
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||
limit=None, # Optional[int]
|
||||
page_token=None, # Optional[str]
|
||||
no_models=None, # Optional[bool]
|
||||
)
|
||||
|
||||
|
||||
@ -3437,6 +3359,7 @@ async def test_list_text_to_cad_models_for_user_async():
|
||||
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||
limit=None, # Optional[int]
|
||||
page_token=None, # Optional[str]
|
||||
no_models=None, # Optional[bool]
|
||||
)
|
||||
|
||||
# OR run async with more info
|
||||
@ -3447,6 +3370,7 @@ async def test_list_text_to_cad_models_for_user_async():
|
||||
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||
limit=None, # Optional[int]
|
||||
page_token=None, # Optional[str]
|
||||
no_models=None, # Optional[bool]
|
||||
)
|
||||
|
||||
|
||||
|
@ -2,12 +2,6 @@
|
||||
|
||||
from .account_provider import AccountProvider
|
||||
from .ai_feedback import AiFeedback
|
||||
from .ai_plugin_api import AiPluginApi
|
||||
from .ai_plugin_api_type import AiPluginApiType
|
||||
from .ai_plugin_auth import AiPluginAuth
|
||||
from .ai_plugin_auth_type import AiPluginAuthType
|
||||
from .ai_plugin_http_auth_type import AiPluginHttpAuthType
|
||||
from .ai_plugin_manifest import AiPluginManifest
|
||||
from .ai_prompt import AiPrompt
|
||||
from .ai_prompt_results_page import AiPromptResultsPage
|
||||
from .ai_prompt_type import AiPromptType
|
||||
@ -35,6 +29,7 @@ from .async_api_call_type import AsyncApiCallType
|
||||
from .axis import Axis
|
||||
from .axis_direction_pair import AxisDirectionPair
|
||||
from .billing_info import BillingInfo
|
||||
from .block_reason import BlockReason
|
||||
from .cache_metadata import CacheMetadata
|
||||
from .camera_drag_interaction_type import CameraDragInteractionType
|
||||
from .card_details import CardDetails
|
||||
@ -137,6 +132,7 @@ from .payment_intent import PaymentIntent
|
||||
from .payment_method import PaymentMethod
|
||||
from .payment_method_card_checks import PaymentMethodCardChecks
|
||||
from .payment_method_type import PaymentMethodType
|
||||
from .perspective_camera_parameters import PerspectiveCameraParameters
|
||||
from .plane_intersect_and_project import PlaneIntersectAndProject
|
||||
from .ply_storage import PlyStorage
|
||||
from .point2d import Point2d
|
||||
|
@ -1,15 +0,0 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from ..models.ai_plugin_api_type import AiPluginApiType
|
||||
|
||||
|
||||
class AiPluginApi(BaseModel):
|
||||
"""AI plugin api information."""
|
||||
|
||||
is_user_authenticated: Optional[bool] = None
|
||||
|
||||
type: Optional[AiPluginApiType] = None
|
||||
|
||||
url: str
|
@ -1,11 +0,0 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class AiPluginApiType(str, Enum):
|
||||
"""AI plugin api type.""" # noqa: E501
|
||||
|
||||
"""# An OpenAPI specification. """ # noqa: E501
|
||||
OPENAPI = "openapi"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
@ -1,14 +0,0 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from ..models.ai_plugin_auth_type import AiPluginAuthType
|
||||
from ..models.ai_plugin_http_auth_type import AiPluginHttpAuthType
|
||||
|
||||
|
||||
class AiPluginAuth(BaseModel):
|
||||
"""AI plugin auth information."""
|
||||
|
||||
authorization_type: Optional[AiPluginHttpAuthType] = None
|
||||
|
||||
type: Optional[AiPluginAuthType] = None
|
@ -1,17 +0,0 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class AiPluginAuthType(str, Enum):
|
||||
"""AI plugin auth type.""" # noqa: E501
|
||||
|
||||
"""# None. """ # noqa: E501
|
||||
NONE = "none"
|
||||
"""# User http. """ # noqa: E501
|
||||
USER_HTTP = "user_http"
|
||||
"""# Service http. """ # noqa: E501
|
||||
SERVICE_HTTP = "service_http"
|
||||
"""# OAuth. """ # noqa: E501
|
||||
OAUTH = "oauth"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
@ -1,13 +0,0 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class AiPluginHttpAuthType(str, Enum):
|
||||
"""AI plugin http auth type.""" # noqa: E501
|
||||
|
||||
"""# Basic. """ # noqa: E501
|
||||
BASIC = "basic"
|
||||
"""# Bearer. """ # noqa: E501
|
||||
BEARER = "bearer"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
@ -1,33 +0,0 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from ..models.ai_plugin_api import AiPluginApi
|
||||
from ..models.ai_plugin_auth import AiPluginAuth
|
||||
|
||||
|
||||
class AiPluginManifest(BaseModel):
|
||||
"""AI plugin manifest.
|
||||
|
||||
This is used for OpenAI's ChatGPT plugins. You can read more about them [here](https://platform.openai.com/docs/plugins/getting-started/plugin-manifest).
|
||||
"""
|
||||
|
||||
api: AiPluginApi
|
||||
|
||||
auth: AiPluginAuth
|
||||
|
||||
contact_email: Optional[str] = None
|
||||
|
||||
description_for_human: Optional[str] = None
|
||||
|
||||
description_for_model: Optional[str] = None
|
||||
|
||||
legal_info_url: str
|
||||
|
||||
logo_url: str
|
||||
|
||||
name_for_human: Optional[str] = None
|
||||
|
||||
name_for_model: Optional[str] = None
|
||||
|
||||
schema_version: Optional[str] = None
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Any, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.ai_feedback import AiFeedback
|
||||
from ..models.ai_prompt_type import AiPromptType
|
||||
@ -39,3 +39,5 @@ class AiPrompt(BaseModel):
|
||||
updated_at: datetime.datetime
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.ai_prompt import AiPrompt
|
||||
|
||||
@ -11,3 +11,5 @@ class AiPromptResultsPage(BaseModel):
|
||||
items: List[AiPrompt]
|
||||
|
||||
next_page: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.unit_angle import UnitAngle
|
||||
|
||||
@ -10,3 +10,5 @@ class Angle(BaseModel):
|
||||
unit: UnitAngle
|
||||
|
||||
value: float
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.annotation_line_end import AnnotationLineEnd
|
||||
|
||||
@ -10,3 +10,5 @@ class AnnotationLineEndOptions(BaseModel):
|
||||
end: AnnotationLineEnd
|
||||
|
||||
start: AnnotationLineEnd
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.annotation_line_end_options import AnnotationLineEndOptions
|
||||
from ..models.annotation_text_options import AnnotationTextOptions
|
||||
@ -20,3 +20,5 @@ class AnnotationOptions(BaseModel):
|
||||
position: Optional[Point3d] = None
|
||||
|
||||
text: Optional[AnnotationTextOptions] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.annotation_text_alignment_x import AnnotationTextAlignmentX
|
||||
from ..models.annotation_text_alignment_y import AnnotationTextAlignmentY
|
||||
@ -15,3 +15,5 @@ class AnnotationTextOptions(BaseModel):
|
||||
x: AnnotationTextAlignmentX
|
||||
|
||||
y: AnnotationTextAlignmentY
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -9,3 +9,5 @@ class ApiCallQueryGroup(BaseModel):
|
||||
count: int
|
||||
|
||||
query: str
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.method import Method
|
||||
from ..models.uuid import Uuid
|
||||
@ -55,3 +55,5 @@ class ApiCallWithPrice(BaseModel):
|
||||
user_agent: str
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.api_call_with_price import ApiCallWithPrice
|
||||
|
||||
@ -11,3 +11,5 @@ class ApiCallWithPriceResultsPage(BaseModel):
|
||||
items: List[ApiCallWithPrice]
|
||||
|
||||
next_page: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.error_code import ErrorCode
|
||||
|
||||
@ -10,3 +10,5 @@ class ApiError(BaseModel):
|
||||
error_code: ErrorCode
|
||||
|
||||
message: str
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.uuid import Uuid
|
||||
|
||||
@ -21,3 +21,5 @@ class ApiToken(BaseModel):
|
||||
updated_at: datetime.datetime
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.api_token import ApiToken
|
||||
|
||||
@ -11,3 +11,5 @@ class ApiTokenResultsPage(BaseModel):
|
||||
items: List[ApiToken]
|
||||
|
||||
next_page: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -8,3 +8,5 @@ class AppClientInfo(BaseModel):
|
||||
"""Information about a third party app client."""
|
||||
|
||||
url: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Any, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..models.async_api_call_type import AsyncApiCallType
|
||||
@ -34,3 +34,5 @@ class AsyncApiCall(BaseModel):
|
||||
user_id: Uuid
|
||||
|
||||
worker: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Dict, Literal, Optional, Union
|
||||
|
||||
from pydantic import BaseModel, Field, RootModel
|
||||
from pydantic import BaseModel, ConfigDict, Field, RootModel
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from ..models.ai_feedback import AiFeedback
|
||||
@ -51,6 +51,8 @@ class file_conversion(BaseModel):
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class file_center_of_mass(BaseModel):
|
||||
"""File center of mass."""
|
||||
@ -79,6 +81,8 @@ class file_center_of_mass(BaseModel):
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class file_mass(BaseModel):
|
||||
"""A file mass."""
|
||||
@ -111,6 +115,8 @@ class file_mass(BaseModel):
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class file_volume(BaseModel):
|
||||
"""A file volume."""
|
||||
@ -139,6 +145,8 @@ class file_volume(BaseModel):
|
||||
|
||||
volume: Optional[float] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class file_density(BaseModel):
|
||||
"""A file density."""
|
||||
@ -171,6 +179,8 @@ class file_density(BaseModel):
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class file_surface_area(BaseModel):
|
||||
"""A file surface area."""
|
||||
@ -199,6 +209,8 @@ class file_surface_area(BaseModel):
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class text_to_cad(BaseModel):
|
||||
"""Text to CAD."""
|
||||
@ -231,6 +243,8 @@ class text_to_cad(BaseModel):
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
AsyncApiCallOutput = RootModel[
|
||||
Annotated[
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.async_api_call import AsyncApiCall
|
||||
|
||||
@ -11,3 +11,5 @@ class AsyncApiCallResultsPage(BaseModel):
|
||||
items: List[AsyncApiCall]
|
||||
|
||||
next_page: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.axis import Axis
|
||||
from ..models.direction import Direction
|
||||
@ -11,3 +11,5 @@ class AxisDirectionPair(BaseModel):
|
||||
axis: Axis
|
||||
|
||||
direction: Direction
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.new_address import NewAddress
|
||||
|
||||
@ -13,3 +13,5 @@ class BillingInfo(BaseModel):
|
||||
name: Optional[str] = None
|
||||
|
||||
phone: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
13
kittycad/models/block_reason.py
Normal file
13
kittycad/models/block_reason.py
Normal file
@ -0,0 +1,13 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class BlockReason(str, Enum):
|
||||
"""The reason for blocking a user.""" # noqa: E501
|
||||
|
||||
"""# The user is missing a payment method and has exceeded their free API call credits for the month. """ # noqa: E501
|
||||
MISSING_PAYMENT_METHOD = "missing_payment_method"
|
||||
"""# The users payment method has failed. """ # noqa: E501
|
||||
PAYMENT_METHOD_FAILED = "payment_method_failed"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -9,3 +9,5 @@ class CacheMetadata(BaseModel):
|
||||
This is mostly used for internal purposes and debugging."""
|
||||
|
||||
ok: bool
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.payment_method_card_checks import PaymentMethodCardChecks
|
||||
|
||||
@ -23,3 +23,5 @@ class CardDetails(BaseModel):
|
||||
funding: Optional[str] = None
|
||||
|
||||
last4: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.point3d import Point3d
|
||||
from ..models.unit_length import UnitLength
|
||||
@ -11,3 +11,5 @@ class CenterOfMass(BaseModel):
|
||||
center_of_mass: Point3d
|
||||
|
||||
output_unit: UnitLength
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -21,3 +21,5 @@ class ClientMetrics(BaseModel):
|
||||
rtc_keyframes_decoded: int
|
||||
|
||||
rtc_total_freezes_duration_sec: float
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -18,3 +18,5 @@ class Cluster(BaseModel):
|
||||
tls_timeout: Optional[int] = None
|
||||
|
||||
urls: Optional[List[str]] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.output_file import OutputFile
|
||||
|
||||
@ -13,3 +13,5 @@ class CodeOutput(BaseModel):
|
||||
stderr: Optional[str] = None
|
||||
|
||||
stdout: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -13,3 +13,5 @@ class Color(BaseModel):
|
||||
g: float
|
||||
|
||||
r: float
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Dict, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.cluster import Cluster
|
||||
from ..models.gateway import Gateway
|
||||
@ -105,3 +105,5 @@ class Connection(BaseModel):
|
||||
version: Optional[str] = None
|
||||
|
||||
write_deadline: Optional[int] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
from typing import Dict, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -13,4 +13,10 @@ class Coupon(BaseModel):
|
||||
|
||||
id: Optional[str] = None
|
||||
|
||||
metadata: Optional[Dict[str, str]] = None
|
||||
|
||||
name: Optional[str] = None
|
||||
|
||||
percent_off: Optional[float] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.point3d import Point3d
|
||||
|
||||
@ -9,3 +9,5 @@ class CurveGetControlPoints(BaseModel):
|
||||
"""The response from the `CurveGetControlPoints` command."""
|
||||
|
||||
control_points: List[Point3d]
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.point3d import Point3d
|
||||
|
||||
@ -10,3 +10,5 @@ class CurveGetEndPoints(BaseModel):
|
||||
end: Point3d
|
||||
|
||||
start: Point3d
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.curve_type import CurveType
|
||||
|
||||
@ -8,3 +8,5 @@ class CurveGetType(BaseModel):
|
||||
"""The response from the `CurveGetType` command."""
|
||||
|
||||
curve_type: CurveType
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Dict, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.currency import Currency
|
||||
from ..models.new_address import NewAddress
|
||||
@ -29,3 +29,5 @@ class Customer(BaseModel):
|
||||
name: Optional[str] = None
|
||||
|
||||
phone: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.uuid import Uuid
|
||||
|
||||
@ -25,3 +25,5 @@ class CustomerBalance(BaseModel):
|
||||
updated_at: datetime.datetime
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.unit_density import UnitDensity
|
||||
|
||||
@ -10,3 +10,5 @@ class Density(BaseModel):
|
||||
density: float
|
||||
|
||||
output_unit: UnitDensity
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.o_auth2_grant_type import OAuth2GrantType
|
||||
|
||||
@ -12,3 +12,5 @@ class DeviceAccessTokenRequestForm(BaseModel):
|
||||
device_code: str
|
||||
|
||||
grant_type: OAuth2GrantType
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -7,3 +7,5 @@ class DeviceAuthRequestForm(BaseModel):
|
||||
"""The request parameters for the OAuth 2.0 Device Authorization Grant flow."""
|
||||
|
||||
client_id: str
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -7,3 +7,5 @@ class DeviceAuthVerifyParams(BaseModel):
|
||||
"""The request parameters to verify the `user_code` for the OAuth 2.0 Device Authorization Grant."""
|
||||
|
||||
user_code: str
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.coupon import Coupon
|
||||
|
||||
@ -8,3 +8,5 @@ class Discount(BaseModel):
|
||||
"""The resource representing a Discount."""
|
||||
|
||||
coupon: Coupon
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Literal, Union
|
||||
|
||||
from pydantic import BaseModel, Field, RootModel
|
||||
from pydantic import BaseModel, ConfigDict, Field, RootModel
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from ..models.global_axis import GlobalAxis
|
||||
@ -11,6 +11,8 @@ class euclidean(BaseModel):
|
||||
|
||||
type: Literal["euclidean"] = "euclidean"
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class on_axis(BaseModel):
|
||||
"""The distance between objects along the specified axis"""
|
||||
@ -19,6 +21,8 @@ class on_axis(BaseModel):
|
||||
|
||||
type: Literal["on_axis"] = "on_axis"
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
DistanceType = RootModel[
|
||||
Annotated[
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -10,3 +10,5 @@ class EmailAuthenticationForm(BaseModel):
|
||||
callback_url: Optional[str] = None
|
||||
|
||||
email: str
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -8,3 +8,5 @@ class EntityGetAllChildUuids(BaseModel):
|
||||
"""The response from the `EntityGetAllChildUuids` command."""
|
||||
|
||||
entity_ids: List[str]
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -7,3 +7,5 @@ class EntityGetChildUuid(BaseModel):
|
||||
"""The response from the `EntityGetChildUuid` command."""
|
||||
|
||||
entity_id: str
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -9,3 +9,5 @@ class EntityGetDistance(BaseModel):
|
||||
max_distance: float
|
||||
|
||||
min_distance: float
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -7,3 +7,5 @@ class EntityGetNumChildren(BaseModel):
|
||||
"""The response from the `EntityGetNumChildren` command."""
|
||||
|
||||
num: int
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -7,3 +7,5 @@ class EntityGetParentId(BaseModel):
|
||||
"""The response from the `EntityGetParentId` command."""
|
||||
|
||||
entity_id: str
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -8,3 +8,5 @@ class EntityLinearPattern(BaseModel):
|
||||
"""The response from the `EntityLinearPattern` command."""
|
||||
|
||||
entity_ids: List[str]
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -13,6 +13,7 @@ class EntityType(str, Enum):
|
||||
EDGE = "edge"
|
||||
FACE = "face"
|
||||
PLANE = "plane"
|
||||
VERTEX = "vertex"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -12,3 +12,5 @@ class Error(BaseModel):
|
||||
message: str
|
||||
|
||||
request_id: str
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.export_file import ExportFile
|
||||
|
||||
@ -9,3 +9,5 @@ class Export(BaseModel):
|
||||
"""The response from the `Export` endpoint."""
|
||||
|
||||
files: List[ExportFile]
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from .base64data import Base64Data
|
||||
|
||||
@ -10,3 +10,5 @@ class ExportFile(BaseModel):
|
||||
contents: Base64Data
|
||||
|
||||
name: str
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,17 +1,20 @@
|
||||
import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.block_reason import BlockReason
|
||||
from ..models.uuid import Uuid
|
||||
|
||||
|
||||
class ExtendedUser(BaseModel):
|
||||
"""Extended user information.
|
||||
|
||||
This is mostly used for internal purposes. It returns a mapping of the user's information, including that of our third party services we use for users: MailChimp, Stripe, and Front
|
||||
This is mostly used for internal purposes. It returns a mapping of the user's information, including that of our third party services we use for users: MailChimp | Stripe
|
||||
"""
|
||||
|
||||
block: Optional[BlockReason] = None
|
||||
|
||||
company: Optional[str] = None
|
||||
|
||||
created_at: datetime.datetime
|
||||
@ -43,3 +46,5 @@ class ExtendedUser(BaseModel):
|
||||
stripe_id: Optional[str] = None
|
||||
|
||||
updated_at: datetime.datetime
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.extended_user import ExtendedUser
|
||||
|
||||
@ -11,3 +11,5 @@ class ExtendedUserResultsPage(BaseModel):
|
||||
items: List[ExtendedUser]
|
||||
|
||||
next_page: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.api_error import ApiError
|
||||
|
||||
@ -13,3 +13,5 @@ class FailureWebSocketResponse(BaseModel):
|
||||
request_id: Optional[str] = None
|
||||
|
||||
success: bool
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..models.file_import_format import FileImportFormat
|
||||
@ -34,3 +34,5 @@ class FileCenterOfMass(BaseModel):
|
||||
updated_at: datetime.datetime
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Dict, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..models.file_export_format import FileExportFormat
|
||||
@ -40,3 +40,5 @@ class FileConversion(BaseModel):
|
||||
updated_at: datetime.datetime
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..models.file_import_format import FileImportFormat
|
||||
@ -38,3 +38,5 @@ class FileDensity(BaseModel):
|
||||
updated_at: datetime.datetime
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..models.file_import_format import FileImportFormat
|
||||
@ -38,3 +38,5 @@ class FileMass(BaseModel):
|
||||
updated_at: datetime.datetime
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..models.file_import_format import FileImportFormat
|
||||
@ -33,3 +33,5 @@ class FileSurfaceArea(BaseModel):
|
||||
updated_at: datetime.datetime
|
||||
|
||||
user_id: Uuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -9,3 +9,5 @@ class FileSystemMetadata(BaseModel):
|
||||
This is mostly used for internal purposes and debugging."""
|
||||
|
||||
ok: bool
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..models.file_import_format import FileImportFormat
|
||||
@ -33,3 +33,5 @@ class FileVolume(BaseModel):
|
||||
user_id: Uuid
|
||||
|
||||
volume: Optional[float] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -16,3 +16,5 @@ class Gateway(BaseModel):
|
||||
port: Optional[int] = None
|
||||
|
||||
tls_timeout: Optional[int] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.entity_type import EntityType
|
||||
|
||||
@ -8,3 +8,5 @@ class GetEntityType(BaseModel):
|
||||
"""The response from the `GetEntityType` command."""
|
||||
|
||||
entity_type: EntityType
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.point3d import Point3d
|
||||
|
||||
@ -12,3 +12,5 @@ class GetSketchModePlane(BaseModel):
|
||||
y_axis: Point3d
|
||||
|
||||
z_axis: Point3d
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -10,3 +10,5 @@ class HighlightSetEntity(BaseModel):
|
||||
entity_id: Optional[str] = None
|
||||
|
||||
sequence: Optional[int] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -12,3 +12,5 @@ class IceServer(BaseModel):
|
||||
urls: List[str]
|
||||
|
||||
username: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -9,3 +9,5 @@ class ImportFile(BaseModel):
|
||||
data: bytes
|
||||
|
||||
path: str
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -7,3 +7,5 @@ class ImportFiles(BaseModel):
|
||||
"""Data from importing the files"""
|
||||
|
||||
object_id: str
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Literal, Union
|
||||
|
||||
from pydantic import BaseModel, Field, RootModel
|
||||
from pydantic import BaseModel, ConfigDict, Field, RootModel
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from ..models.system import System
|
||||
@ -12,12 +12,16 @@ class fbx(BaseModel):
|
||||
|
||||
type: Literal["fbx"] = "fbx"
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class gltf(BaseModel):
|
||||
"""Binary glTF 2.0. We refer to this as glTF since that is how our customers refer to it, but this can also import binary glTF (glb)."""
|
||||
|
||||
type: Literal["gltf"] = "gltf"
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class obj(BaseModel):
|
||||
"""Wavefront OBJ format."""
|
||||
@ -28,6 +32,8 @@ class obj(BaseModel):
|
||||
|
||||
units: UnitLength
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class ply(BaseModel):
|
||||
"""The PLY Polygon File Format."""
|
||||
@ -38,18 +44,24 @@ class ply(BaseModel):
|
||||
|
||||
units: UnitLength
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class sldprt(BaseModel):
|
||||
"""SolidWorks part (SLDPRT) format."""
|
||||
|
||||
type: Literal["sldprt"] = "sldprt"
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class step(BaseModel):
|
||||
"""ISO 10303-21 (STEP) format."""
|
||||
|
||||
type: Literal["step"] = "step"
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class stl(BaseModel):
|
||||
"""*ST**ereo**L**ithography format."""
|
||||
@ -60,6 +72,8 @@ class stl(BaseModel):
|
||||
|
||||
units: UnitLength
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
InputFormat = RootModel[
|
||||
Annotated[
|
||||
|
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.currency import Currency
|
||||
from ..models.discount import Discount
|
||||
@ -61,3 +61,5 @@ class Invoice(BaseModel):
|
||||
total: Optional[float] = None
|
||||
|
||||
url: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Dict, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.currency import Currency
|
||||
|
||||
@ -19,3 +19,5 @@ class InvoiceLineItem(BaseModel):
|
||||
invoice_item: Optional[str] = None
|
||||
|
||||
metadata: Optional[Dict[str, str]] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -4,8 +4,6 @@ from enum import Enum
|
||||
class InvoiceStatus(str, Enum):
|
||||
"""An enum representing the possible values of an `Invoice`'s `status` field.""" # noqa: E501
|
||||
|
||||
"""# Deleted. """ # noqa: E501
|
||||
DELETED = "deleted"
|
||||
"""# Draft. """ # noqa: E501
|
||||
DRAFT = "draft"
|
||||
"""# Open. """ # noqa: E501
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.jetstream_config import JetstreamConfig
|
||||
from ..models.jetstream_stats import JetstreamStats
|
||||
@ -15,3 +15,5 @@ class Jetstream(BaseModel):
|
||||
meta: Optional[MetaClusterInfo] = None
|
||||
|
||||
stats: Optional[JetstreamStats] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -12,3 +12,5 @@ class JetstreamApiStats(BaseModel):
|
||||
inflight: Optional[int] = None
|
||||
|
||||
total: Optional[int] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -14,3 +14,5 @@ class JetstreamConfig(BaseModel):
|
||||
max_storage: Optional[int] = None
|
||||
|
||||
store_dir: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.jetstream_api_stats import JetstreamApiStats
|
||||
|
||||
@ -21,3 +21,5 @@ class JetstreamStats(BaseModel):
|
||||
reserved_store: Optional[int] = None
|
||||
|
||||
store: Optional[int] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
|
||||
@ -14,3 +14,5 @@ class LeafNode(BaseModel):
|
||||
port: Optional[int] = None
|
||||
|
||||
tls_timeout: Optional[int] = None
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user