Update api spec (#263)
* YOYO NEW API SPEC! * new files Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Greg Sweeney <greg@kittycad.io> Co-authored-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
committed by
GitHub
parent
98c6a70e3b
commit
64fc99943e
File diff suppressed because it is too large
Load Diff
@ -3,12 +3,13 @@ from typing import Any, Dict, Optional
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.api_token_uuid import ApiTokenUuid
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
token: str,
|
||||
token: ApiTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
@ -49,7 +50,7 @@ def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
token: str,
|
||||
token: ApiTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
@ -67,7 +68,7 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
token: str,
|
||||
token: ApiTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
@ -82,7 +83,7 @@ def sync(
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
token: str,
|
||||
token: ApiTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
@ -98,7 +99,7 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
token: str,
|
||||
token: ApiTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
|
@ -4,12 +4,13 @@ import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.api_token import ApiToken
|
||||
from ...models.api_token_uuid import ApiTokenUuid
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
token: str,
|
||||
token: ApiTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
@ -54,7 +55,7 @@ def _build_response(
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
token: str,
|
||||
token: ApiTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ApiToken, Error]]]:
|
||||
@ -72,7 +73,7 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
token: str,
|
||||
token: ApiTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ApiToken, Error]]:
|
||||
@ -85,7 +86,7 @@ def sync(
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
token: str,
|
||||
token: ApiTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ApiToken, Error]]]:
|
||||
@ -101,7 +102,7 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
token: str,
|
||||
token: ApiTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ApiToken, Error]]:
|
||||
|
@ -4,11 +4,12 @@ import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.service_account_token_uuid import ServiceAccountTokenUuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
token: str,
|
||||
token: ServiceAccountTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
@ -49,7 +50,7 @@ def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
token: str,
|
||||
token: ServiceAccountTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
@ -67,7 +68,7 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
token: str,
|
||||
token: ServiceAccountTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
@ -82,7 +83,7 @@ def sync(
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
token: str,
|
||||
token: ServiceAccountTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
@ -98,7 +99,7 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
token: str,
|
||||
token: ServiceAccountTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
|
@ -5,11 +5,12 @@ import httpx
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.service_account import ServiceAccount
|
||||
from ...models.service_account_token_uuid import ServiceAccountTokenUuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
token: str,
|
||||
token: ServiceAccountTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
@ -56,7 +57,7 @@ def _build_response(
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
token: str,
|
||||
token: ServiceAccountTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ServiceAccount, Error]]]:
|
||||
@ -74,7 +75,7 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
token: str,
|
||||
token: ServiceAccountTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ServiceAccount, Error]]:
|
||||
@ -87,7 +88,7 @@ def sync(
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
token: str,
|
||||
token: ServiceAccountTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ServiceAccount, Error]]]:
|
||||
@ -103,7 +104,7 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
token: str,
|
||||
token: ServiceAccountTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ServiceAccount, Error]]:
|
||||
|
@ -5,11 +5,12 @@ import httpx
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.session import Session
|
||||
from ...models.session_token_uuid import SessionTokenUuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
token: str,
|
||||
token: SessionTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
@ -54,7 +55,7 @@ def _build_response(
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
token: str,
|
||||
token: SessionTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Session, Error]]]:
|
||||
@ -72,7 +73,7 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
token: str,
|
||||
token: SessionTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Session, Error]]:
|
||||
@ -85,7 +86,7 @@ def sync(
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
token: str,
|
||||
token: SessionTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Session, Error]]]:
|
||||
@ -101,7 +102,7 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
token: str,
|
||||
token: SessionTokenUuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Session, Error]]:
|
||||
|
@ -219,6 +219,7 @@ from kittycad.models import (
|
||||
from kittycad.models.add_org_member import AddOrgMember
|
||||
from kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy
|
||||
from kittycad.models.api_call_status import ApiCallStatus
|
||||
from kittycad.models.api_token_uuid import ApiTokenUuid
|
||||
from kittycad.models.billing_info import BillingInfo
|
||||
from kittycad.models.code_language import CodeLanguage
|
||||
from kittycad.models.created_at_sort_mode import CreatedAtSortMode
|
||||
@ -244,6 +245,8 @@ from kittycad.models.privacy_settings import PrivacySettings
|
||||
from kittycad.models.rtc_sdp_type import RtcSdpType
|
||||
from kittycad.models.rtc_session_description import RtcSessionDescription
|
||||
from kittycad.models.saml_identity_provider_create import SamlIdentityProviderCreate
|
||||
from kittycad.models.service_account_token_uuid import ServiceAccountTokenUuid
|
||||
from kittycad.models.session_token_uuid import SessionTokenUuid
|
||||
from kittycad.models.source_position import SourcePosition
|
||||
from kittycad.models.source_range import SourceRange
|
||||
from kittycad.models.source_range_prompt import SourceRangePrompt
|
||||
@ -3680,7 +3683,7 @@ def test_get_service_account_for_org():
|
||||
|
||||
result: Optional[Union[ServiceAccount, Error]] = get_service_account_for_org.sync(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ServiceAccountTokenUuid("<string>"),
|
||||
)
|
||||
|
||||
if isinstance(result, Error) or result is None:
|
||||
@ -3694,7 +3697,7 @@ def test_get_service_account_for_org():
|
||||
response: Response[Optional[Union[ServiceAccount, Error]]] = (
|
||||
get_service_account_for_org.sync_detailed(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ServiceAccountTokenUuid("<string>"),
|
||||
)
|
||||
)
|
||||
|
||||
@ -3709,7 +3712,7 @@ async def test_get_service_account_for_org_async():
|
||||
result: Optional[Union[ServiceAccount, Error]] = (
|
||||
await get_service_account_for_org.asyncio(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ServiceAccountTokenUuid("<string>"),
|
||||
)
|
||||
)
|
||||
|
||||
@ -3717,7 +3720,7 @@ async def test_get_service_account_for_org_async():
|
||||
response: Response[Optional[Union[ServiceAccount, Error]]] = (
|
||||
await get_service_account_for_org.asyncio_detailed(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ServiceAccountTokenUuid("<string>"),
|
||||
)
|
||||
)
|
||||
|
||||
@ -3729,7 +3732,7 @@ def test_delete_service_account_for_org():
|
||||
|
||||
result: Optional[Error] = delete_service_account_for_org.sync(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ServiceAccountTokenUuid("<string>"),
|
||||
)
|
||||
|
||||
if isinstance(result, Error) or result is None:
|
||||
@ -3742,7 +3745,7 @@ def test_delete_service_account_for_org():
|
||||
# OR if you need more info (e.g. status_code)
|
||||
response: Response[Optional[Error]] = delete_service_account_for_org.sync_detailed(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ServiceAccountTokenUuid("<string>"),
|
||||
)
|
||||
|
||||
|
||||
@ -3755,14 +3758,14 @@ async def test_delete_service_account_for_org_async():
|
||||
|
||||
result: Optional[Error] = await delete_service_account_for_org.asyncio(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ServiceAccountTokenUuid("<string>"),
|
||||
)
|
||||
|
||||
# OR run async with more info
|
||||
response: Response[Optional[Error]] = (
|
||||
await delete_service_account_for_org.asyncio_detailed(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ServiceAccountTokenUuid("<string>"),
|
||||
)
|
||||
)
|
||||
|
||||
@ -5305,7 +5308,7 @@ def test_get_api_token_for_user():
|
||||
|
||||
result: Optional[Union[ApiToken, Error]] = get_api_token_for_user.sync(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ApiTokenUuid("<string>"),
|
||||
)
|
||||
|
||||
if isinstance(result, Error) or result is None:
|
||||
@ -5319,7 +5322,7 @@ def test_get_api_token_for_user():
|
||||
response: Response[Optional[Union[ApiToken, Error]]] = (
|
||||
get_api_token_for_user.sync_detailed(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ApiTokenUuid("<string>"),
|
||||
)
|
||||
)
|
||||
|
||||
@ -5333,14 +5336,14 @@ async def test_get_api_token_for_user_async():
|
||||
|
||||
result: Optional[Union[ApiToken, Error]] = await get_api_token_for_user.asyncio(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ApiTokenUuid("<string>"),
|
||||
)
|
||||
|
||||
# OR run async with more info
|
||||
response: Response[Optional[Union[ApiToken, Error]]] = (
|
||||
await get_api_token_for_user.asyncio_detailed(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ApiTokenUuid("<string>"),
|
||||
)
|
||||
)
|
||||
|
||||
@ -5352,7 +5355,7 @@ def test_delete_api_token_for_user():
|
||||
|
||||
result: Optional[Error] = delete_api_token_for_user.sync(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ApiTokenUuid("<string>"),
|
||||
)
|
||||
|
||||
if isinstance(result, Error) or result is None:
|
||||
@ -5365,7 +5368,7 @@ def test_delete_api_token_for_user():
|
||||
# OR if you need more info (e.g. status_code)
|
||||
response: Response[Optional[Error]] = delete_api_token_for_user.sync_detailed(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ApiTokenUuid("<string>"),
|
||||
)
|
||||
|
||||
|
||||
@ -5378,14 +5381,14 @@ async def test_delete_api_token_for_user_async():
|
||||
|
||||
result: Optional[Error] = await delete_api_token_for_user.asyncio(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ApiTokenUuid("<string>"),
|
||||
)
|
||||
|
||||
# OR run async with more info
|
||||
response: Response[Optional[Error]] = (
|
||||
await delete_api_token_for_user.asyncio_detailed(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=ApiTokenUuid("<string>"),
|
||||
)
|
||||
)
|
||||
|
||||
@ -6320,7 +6323,7 @@ def test_get_session_for_user():
|
||||
|
||||
result: Optional[Union[Session, Error]] = get_session_for_user.sync(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=SessionTokenUuid("<string>"),
|
||||
)
|
||||
|
||||
if isinstance(result, Error) or result is None:
|
||||
@ -6334,7 +6337,7 @@ def test_get_session_for_user():
|
||||
response: Response[Optional[Union[Session, Error]]] = (
|
||||
get_session_for_user.sync_detailed(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=SessionTokenUuid("<string>"),
|
||||
)
|
||||
)
|
||||
|
||||
@ -6348,14 +6351,14 @@ async def test_get_session_for_user_async():
|
||||
|
||||
result: Optional[Union[Session, Error]] = await get_session_for_user.asyncio(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=SessionTokenUuid("<string>"),
|
||||
)
|
||||
|
||||
# OR run async with more info
|
||||
response: Response[Optional[Union[Session, Error]]] = (
|
||||
await get_session_for_user.asyncio_detailed(
|
||||
client=client,
|
||||
token="<uuid>",
|
||||
token=SessionTokenUuid("<string>"),
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -19,6 +19,7 @@ from .api_call_with_price_results_page import ApiCallWithPriceResultsPage
|
||||
from .api_error import ApiError
|
||||
from .api_token import ApiToken
|
||||
from .api_token_results_page import ApiTokenResultsPage
|
||||
from .api_token_uuid import ApiTokenUuid
|
||||
from .app_client_info import AppClientInfo
|
||||
from .async_api_call import AsyncApiCall
|
||||
from .async_api_call_output import AsyncApiCallOutput
|
||||
@ -61,6 +62,7 @@ from .default_camera_zoom import DefaultCameraZoom
|
||||
from .density import Density
|
||||
from .der_encoded_key_pair import DerEncodedKeyPair
|
||||
from .device_access_token_request_form import DeviceAccessTokenRequestForm
|
||||
from .device_access_token_uuid import DeviceAccessTokenUuid
|
||||
from .device_auth_request_form import DeviceAuthRequestForm
|
||||
from .device_auth_verify_params import DeviceAuthVerifyParams
|
||||
from .direction import Direction
|
||||
@ -132,7 +134,6 @@ from .kcl_code_completion_request import KclCodeCompletionRequest
|
||||
from .kcl_code_completion_response import KclCodeCompletionResponse
|
||||
from .leaf_node import LeafNode
|
||||
from .length_unit import LengthUnit
|
||||
from .linear_transform import LinearTransform
|
||||
from .loft import Loft
|
||||
from .mass import Mass
|
||||
from .meta_cluster_info import MetaClusterInfo
|
||||
@ -168,6 +169,7 @@ from .org_member import OrgMember
|
||||
from .org_member_results_page import OrgMemberResultsPage
|
||||
from .org_results_page import OrgResultsPage
|
||||
from .org_role import OrgRole
|
||||
from .origin_type import OriginType
|
||||
from .output_file import OutputFile
|
||||
from .output_format import OutputFormat
|
||||
from .path_command import PathCommand
|
||||
@ -195,6 +197,7 @@ from .pong import Pong
|
||||
from .post_effect_type import PostEffectType
|
||||
from .privacy_settings import PrivacySettings
|
||||
from .raw_file import RawFile
|
||||
from .rotation import Rotation
|
||||
from .rtc_ice_candidate_init import RtcIceCandidateInit
|
||||
from .rtc_sdp_type import RtcSdpType
|
||||
from .rtc_session_description import RtcSessionDescription
|
||||
@ -207,6 +210,7 @@ from .select_with_point import SelectWithPoint
|
||||
from .selection import Selection
|
||||
from .service_account import ServiceAccount
|
||||
from .service_account_results_page import ServiceAccountResultsPage
|
||||
from .service_account_token_uuid import ServiceAccountTokenUuid
|
||||
from .session import Session
|
||||
from .session_token_uuid import SessionTokenUuid
|
||||
from .solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces
|
||||
@ -220,7 +224,6 @@ from .source_range import SourceRange
|
||||
from .source_range_prompt import SourceRangePrompt
|
||||
from .stl_storage import StlStorage
|
||||
from .store_coupon_params import StoreCouponParams
|
||||
from .string_uuid import StringUuid
|
||||
from .subscription_tier_feature import SubscriptionTierFeature
|
||||
from .subscription_tier_price import SubscriptionTierPrice
|
||||
from .subscription_tier_type import SubscriptionTierType
|
||||
@ -237,6 +240,7 @@ from .text_to_cad_iteration_body import TextToCadIterationBody
|
||||
from .text_to_cad_model import TextToCadModel
|
||||
from .text_to_cad_results_page import TextToCadResultsPage
|
||||
from .token_revoke_request_form import TokenRevokeRequestForm
|
||||
from .transform import Transform
|
||||
from .unit_angle import UnitAngle
|
||||
from .unit_angle_conversion import UnitAngleConversion
|
||||
from .unit_area import UnitArea
|
||||
|
@ -3,7 +3,7 @@ from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.string_uuid import StringUuid
|
||||
from ..models.api_token_uuid import ApiTokenUuid
|
||||
from ..models.uuid import Uuid
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ class ApiToken(BaseModel):
|
||||
|
||||
label: Optional[str] = None
|
||||
|
||||
token: StringUuid
|
||||
token: ApiTokenUuid
|
||||
|
||||
updated_at: datetime.datetime
|
||||
|
||||
|
@ -4,8 +4,8 @@ from pydantic import GetCoreSchemaHandler
|
||||
from pydantic_core import CoreSchema, core_schema
|
||||
|
||||
|
||||
class StringUuid(str):
|
||||
"""An auth token. A UUIDv4"""
|
||||
class ApiTokenUuid(str):
|
||||
"""An auth token. A uuid with a prefix of api-"""
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self
|
17
kittycad/models/device_access_token_uuid.py
Normal file
17
kittycad/models/device_access_token_uuid.py
Normal file
@ -0,0 +1,17 @@
|
||||
from typing import Any
|
||||
|
||||
from pydantic import GetCoreSchemaHandler
|
||||
from pydantic_core import CoreSchema, core_schema
|
||||
|
||||
|
||||
class DeviceAccessTokenUuid(str):
|
||||
"""An auth token. A uuid with a prefix of dev-"""
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self
|
||||
|
||||
@classmethod
|
||||
def __get_pydantic_core_schema__(
|
||||
cls, source_type: Any, handler: GetCoreSchemaHandler
|
||||
) -> CoreSchema:
|
||||
return core_schema.no_info_after_validator_function(cls, handler(str))
|
@ -15,7 +15,6 @@ from ..models.image_format import ImageFormat
|
||||
from ..models.import_file import ImportFile
|
||||
from ..models.input_format import InputFormat
|
||||
from ..models.length_unit import LengthUnit
|
||||
from ..models.linear_transform import LinearTransform
|
||||
from ..models.modeling_cmd_id import ModelingCmdId
|
||||
from ..models.output_format import OutputFormat
|
||||
from ..models.path_component_constraint_bound import PathComponentConstraintBound
|
||||
@ -26,6 +25,7 @@ from ..models.point2d import Point2d
|
||||
from ..models.point3d import Point3d
|
||||
from ..models.scene_selection_type import SceneSelectionType
|
||||
from ..models.scene_tool_type import SceneToolType
|
||||
from ..models.transform import Transform
|
||||
from ..models.unit_area import UnitArea
|
||||
from ..models.unit_density import UnitDensity
|
||||
from ..models.unit_length import UnitLength
|
||||
@ -42,7 +42,7 @@ class start_path(BaseModel):
|
||||
|
||||
|
||||
class move_path_pen(BaseModel):
|
||||
"""Move the path's \"pen\"."""
|
||||
"""Move the path's \"pen\". If you're in sketch mode, these coordinates are in the local coordinate system, not the world's coordinate system. For example, say you're sketching on the plane {x: (1,0,0), y: (0,1,0), origin: (0, 0, 50)}. In other words, the plane 50 units above the default XY plane. Then, moving the pen to (1, 1, 0) with this command uses local coordinates. So, it would move the pen to (1, 1, 50) in global coordinates."""
|
||||
|
||||
path: ModelingCmdId
|
||||
|
||||
@ -68,8 +68,6 @@ class extend_path(BaseModel):
|
||||
class extrude(BaseModel):
|
||||
"""Command for extruding a solid 2d."""
|
||||
|
||||
cap: bool
|
||||
|
||||
distance: LengthUnit
|
||||
|
||||
target: ModelingCmdId
|
||||
@ -334,11 +332,11 @@ class entity_get_distance(BaseModel):
|
||||
|
||||
|
||||
class entity_linear_pattern_transform(BaseModel):
|
||||
"""Create a pattern using this entity by specifying the transform for each desired repetition."""
|
||||
"""Create a pattern using this entity by specifying the transform for each desired repetition. Transformations are performed in the following order (first applied to last applied): scale, rotate, translate."""
|
||||
|
||||
entity_id: str
|
||||
|
||||
transform: List[LinearTransform]
|
||||
transform: List[Transform]
|
||||
|
||||
type: Literal["entity_linear_pattern_transform"] = "entity_linear_pattern_transform"
|
||||
|
||||
@ -680,6 +678,8 @@ class solid3d_fillet_edge(BaseModel):
|
||||
|
||||
edge_id: str
|
||||
|
||||
face_id: Optional[str] = None
|
||||
|
||||
object_id: str
|
||||
|
||||
radius: LengthUnit
|
||||
|
44
kittycad/models/origin_type.py
Normal file
44
kittycad/models/origin_type.py
Normal file
@ -0,0 +1,44 @@
|
||||
from typing import Literal, Union
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, RootModel
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from ..models.point3d import Point3d
|
||||
|
||||
|
||||
class local(BaseModel):
|
||||
"""Local Origin (center of object bounding box)."""
|
||||
|
||||
type: Literal["local"] = "local"
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class global_(BaseModel):
|
||||
"""Global Origin (0, 0, 0)."""
|
||||
|
||||
type: Literal["global"] = "global"
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
class custom(BaseModel):
|
||||
"""Custom Origin (user specified point)."""
|
||||
|
||||
origin: Point3d
|
||||
|
||||
type: Literal["custom"] = "custom"
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
||||
|
||||
OriginType = RootModel[
|
||||
Annotated[
|
||||
Union[
|
||||
local,
|
||||
global_,
|
||||
custom,
|
||||
],
|
||||
Field(discriminator="type"),
|
||||
]
|
||||
]
|
18
kittycad/models/rotation.py
Normal file
18
kittycad/models/rotation.py
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.angle import Angle
|
||||
from ..models.origin_type import OriginType
|
||||
from ..models.point3d import Point3d
|
||||
|
||||
|
||||
class Rotation(BaseModel):
|
||||
"""A rotation defined by an axis, origin of rotation, and an angle."""
|
||||
|
||||
angle: Angle
|
||||
|
||||
axis: Point3d
|
||||
|
||||
origin: OriginType
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
@ -3,7 +3,7 @@ from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.string_uuid import StringUuid
|
||||
from ..models.service_account_token_uuid import ServiceAccountTokenUuid
|
||||
from ..models.uuid import Uuid
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ class ServiceAccount(BaseModel):
|
||||
|
||||
org_id: Uuid
|
||||
|
||||
token: StringUuid
|
||||
token: ServiceAccountTokenUuid
|
||||
|
||||
updated_at: datetime.datetime
|
||||
|
||||
|
17
kittycad/models/service_account_token_uuid.py
Normal file
17
kittycad/models/service_account_token_uuid.py
Normal file
@ -0,0 +1,17 @@
|
||||
from typing import Any
|
||||
|
||||
from pydantic import GetCoreSchemaHandler
|
||||
from pydantic_core import CoreSchema, core_schema
|
||||
|
||||
|
||||
class ServiceAccountTokenUuid(str):
|
||||
"""An auth token. A uuid with a prefix of svc-"""
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self
|
||||
|
||||
@classmethod
|
||||
def __get_pydantic_core_schema__(
|
||||
cls, source_type: Any, handler: GetCoreSchemaHandler
|
||||
) -> CoreSchema:
|
||||
return core_schema.no_info_after_validator_function(cls, handler(str))
|
@ -2,6 +2,7 @@ from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.device_access_token_uuid import DeviceAccessTokenUuid
|
||||
|
||||
|
||||
class TokenRevokeRequestForm(BaseModel):
|
||||
@ -11,6 +12,6 @@ class TokenRevokeRequestForm(BaseModel):
|
||||
|
||||
client_secret: Optional[str] = None
|
||||
|
||||
token: str
|
||||
token: DeviceAccessTokenUuid
|
||||
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
|
@ -2,13 +2,20 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from ..models.point3d import Point3d
|
||||
from ..models.rotation import Rotation
|
||||
|
||||
|
||||
class LinearTransform(BaseModel):
|
||||
class Transform(BaseModel):
|
||||
"""Ways to transform each solid being replicated in a repeating pattern."""
|
||||
|
||||
replicate: bool = True
|
||||
|
||||
rotation: Rotation = {
|
||||
"angle": {"unit": "degrees", "value": 0.0},
|
||||
"axis": {"x": 0.0, "y": 0.0, "z": 1.0},
|
||||
"origin": {"type": "local"},
|
||||
}
|
||||
|
||||
scale: Point3d = {"x": 1.0, "y": 1.0, "z": 1.0}
|
||||
|
||||
translate: Point3d = {"x": 0.0, "y": 0.0, "z": 0.0}
|
255
spec.json
255
spec.json
@ -7705,8 +7705,7 @@
|
||||
"description": "The service account.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
"$ref": "#/components/schemas/ServiceAccountTokenUuid"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -7785,8 +7784,7 @@
|
||||
"description": "The service account.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
"$ref": "#/components/schemas/ServiceAccountTokenUuid"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -7858,8 +7856,7 @@
|
||||
"description": "The service account.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
"$ref": "#/components/schemas/ServiceAccountTokenUuid"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -10811,8 +10808,7 @@
|
||||
"description": "The API token.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
"$ref": "#/components/schemas/ApiTokenUuid"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -10891,8 +10887,7 @@
|
||||
"description": "The API token.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
"$ref": "#/components/schemas/ApiTokenUuid"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -10964,8 +10959,7 @@
|
||||
"description": "The API token.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
"$ref": "#/components/schemas/ApiTokenUuid"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -12730,8 +12724,7 @@
|
||||
"description": "The API token.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
"$ref": "#/components/schemas/SessionTokenUuid"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -14641,7 +14634,7 @@
|
||||
"description": "The API token itself.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/StringUuid"
|
||||
"$ref": "#/components/schemas/ApiTokenUuid"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -14690,6 +14683,10 @@
|
||||
"items"
|
||||
]
|
||||
},
|
||||
"ApiTokenUuid": {
|
||||
"description": "An auth token. A uuid with a prefix of api-",
|
||||
"type": "string"
|
||||
},
|
||||
"AppClientInfo": {
|
||||
"description": "Information about a third party app client.",
|
||||
"type": "object",
|
||||
@ -17091,6 +17088,10 @@
|
||||
"grant_type"
|
||||
]
|
||||
},
|
||||
"DeviceAccessTokenUuid": {
|
||||
"description": "An auth token. A uuid with a prefix of dev-",
|
||||
"type": "string"
|
||||
},
|
||||
"DeviceAuthRequestForm": {
|
||||
"description": "The request parameters for the OAuth 2.0 Device Authorization Grant flow.",
|
||||
"type": "object",
|
||||
@ -19900,43 +19901,6 @@
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"LinearTransform": {
|
||||
"description": "Ways to transform each solid being replicated in a repeating pattern.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"replicate": {
|
||||
"description": "Whether to replicate the original solid in this instance.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"scale": {
|
||||
"description": "Scale the replica's size along each axis. Defaults to (1, 1, 1) (i.e. the same size as the original).",
|
||||
"default": {
|
||||
"x": 1.0,
|
||||
"y": 1.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Point3d"
|
||||
}
|
||||
]
|
||||
},
|
||||
"translate": {
|
||||
"description": "Translate the replica this far along each dimension. Defaults to zero vector (i.e. same position as the original).",
|
||||
"default": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Point3d"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"Loft": {
|
||||
"description": "The response from the `Loft` command.",
|
||||
"type": "object",
|
||||
@ -20516,7 +20480,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Move the path's \"pen\".",
|
||||
"description": "Move the path's \"pen\". If you're in sketch mode, these coordinates are in the local coordinate system, not the world's coordinate system. For example, say you're sketching on the plane {x: (1,0,0), y: (0,1,0), origin: (0, 0, 50)}. In other words, the plane 50 units above the default XY plane. Then, moving the pen to (1, 1, 0) with this command uses local coordinates. So, it would move the pen to (1, 1, 50) in global coordinates.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
@ -20585,10 +20549,6 @@
|
||||
"description": "Command for extruding a solid 2d.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"cap": {
|
||||
"description": "Whether to cap the extrusion with a face, or not. If true, the resulting solid will be closed on all sides, like a dice. If false, it will be open on one side, like a drinking glass.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"distance": {
|
||||
"description": "How far off the plane to extrude",
|
||||
"allOf": [
|
||||
@ -20613,7 +20573,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cap",
|
||||
"distance",
|
||||
"target",
|
||||
"type"
|
||||
@ -21289,7 +21248,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Create a pattern using this entity by specifying the transform for each desired repetition.",
|
||||
"description": "Create a pattern using this entity by specifying the transform for each desired repetition. Transformations are performed in the following order (first applied to last applied): scale, rotate, translate.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"entity_id": {
|
||||
@ -21301,7 +21260,7 @@
|
||||
"description": "How to transform each repeated solid. The 0th transform will create the first copy of the entity. The total number of (optional) repetitions equals the size of this list.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/LinearTransform"
|
||||
"$ref": "#/components/schemas/Transform"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
@ -22149,6 +22108,12 @@
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"face_id": {
|
||||
"nullable": true,
|
||||
"description": "The ID to use for the newly created fillet face. If not provided, the server will randomly generate one.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"object_id": {
|
||||
"description": "Which object is being filletted.",
|
||||
"type": "string",
|
||||
@ -25373,6 +25338,65 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"OriginType": {
|
||||
"description": "The type of origin",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "Local Origin (center of object bounding box).",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"local"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Global Origin (0, 0, 0).",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"global"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Custom Origin (user specified point).",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"origin": {
|
||||
"description": "Custom origin point.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Point3d"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"custom"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"origin",
|
||||
"type"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"OutputFile": {
|
||||
"description": "Output file contents.\n\n<details><summary>JSON schema</summary>\n\n```json { \"description\": \"Output file contents.\", \"type\": \"object\", \"properties\": { \"contents\": { \"description\": \"The contents of the file. This is base64 encoded so we can ensure it is UTF-8 for JSON.\", \"type\": \"string\" }, \"name\": { \"description\": \"The name of the file.\", \"default\": \"\", \"type\": \"string\" } } } ``` </details>",
|
||||
"type": "object",
|
||||
@ -26271,6 +26295,41 @@
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"Rotation": {
|
||||
"description": "A rotation defined by an axis, origin of rotation, and an angle.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"angle": {
|
||||
"description": "Rotate this far about the rotation axis. Defaults to zero (i.e. no rotation).",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Angle"
|
||||
}
|
||||
]
|
||||
},
|
||||
"axis": {
|
||||
"description": "Rotation axis. Defaults to (0, 0, 1) (i.e. the Z axis).",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Point3d"
|
||||
}
|
||||
]
|
||||
},
|
||||
"origin": {
|
||||
"description": "Origin of the rotation. If one isn't provided, the object will rotate about its own bounding box center.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/OriginType"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"angle",
|
||||
"axis",
|
||||
"origin"
|
||||
]
|
||||
},
|
||||
"RtcIceCandidateInit": {
|
||||
"description": "ICECandidateInit is used to serialize ice candidates",
|
||||
"type": "object",
|
||||
@ -26690,7 +26749,7 @@
|
||||
"description": "The API token itself.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/StringUuid"
|
||||
"$ref": "#/components/schemas/ServiceAccountTokenUuid"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -26731,6 +26790,10 @@
|
||||
"items"
|
||||
]
|
||||
},
|
||||
"ServiceAccountTokenUuid": {
|
||||
"description": "An auth token. A uuid with a prefix of svc-",
|
||||
"type": "string"
|
||||
},
|
||||
"Session": {
|
||||
"description": "An authentication session.",
|
||||
"type": "object",
|
||||
@ -26983,10 +27046,6 @@
|
||||
"percent_off"
|
||||
]
|
||||
},
|
||||
"StringUuid": {
|
||||
"description": "An auth token. A UUIDv4",
|
||||
"type": "string"
|
||||
},
|
||||
"SubscriptionTierFeature": {
|
||||
"description": "A subscription tier feature.",
|
||||
"type": "object",
|
||||
@ -27610,8 +27669,11 @@
|
||||
},
|
||||
"token": {
|
||||
"description": "The token to revoke.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/DeviceAccessTokenUuid"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@ -27619,6 +27681,65 @@
|
||||
"token"
|
||||
]
|
||||
},
|
||||
"Transform": {
|
||||
"description": "Ways to transform each solid being replicated in a repeating pattern.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"replicate": {
|
||||
"description": "Whether to replicate the original solid in this instance.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"rotation": {
|
||||
"description": "Rotate the replica about the specified rotation axis and origin. Defaults to no rotation.",
|
||||
"default": {
|
||||
"angle": {
|
||||
"unit": "degrees",
|
||||
"value": 0.0
|
||||
},
|
||||
"axis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"origin": {
|
||||
"type": "local"
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Rotation"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scale": {
|
||||
"description": "Scale the replica's size along each axis. Defaults to (1, 1, 1) (i.e. the same size as the original).",
|
||||
"default": {
|
||||
"x": 1.0,
|
||||
"y": 1.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Point3d"
|
||||
}
|
||||
]
|
||||
},
|
||||
"translate": {
|
||||
"description": "Translate the replica this far along each dimension. Defaults to zero vector (i.e. same position as the original).",
|
||||
"default": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Point3d"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"UnitAngle": {
|
||||
"description": "The valid types of angle formats.",
|
||||
"oneOf": [
|
||||
|
Reference in New Issue
Block a user