Update api spec (#299)

* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
zoo-github-actions-auth[bot]
2024-10-09 12:24:27 -07:00
committed by GitHub
parent 75827098b2
commit 3799b7eefe
10 changed files with 976 additions and 951 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6,11 +6,12 @@ from ...client import Client
from ...models.api_call_with_price_results_page import ApiCallWithPriceResultsPage
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...models.error import Error
from ...models.user_identifier import UserIdentifier
from ...types import Response
def _get_kwargs(
id: str,
id: UserIdentifier,
sort_by: CreatedAtSortMode,
*,
client: Client,
@ -78,7 +79,7 @@ def _build_response(
def sync_detailed(
id: str,
id: UserIdentifier,
sort_by: CreatedAtSortMode,
*,
client: Client,
@ -102,7 +103,7 @@ def sync_detailed(
def sync(
id: str,
id: UserIdentifier,
sort_by: CreatedAtSortMode,
*,
client: Client,
@ -127,7 +128,7 @@ def sync(
async def asyncio_detailed(
id: str,
id: UserIdentifier,
sort_by: CreatedAtSortMode,
*,
client: Client,
@ -149,7 +150,7 @@ async def asyncio_detailed(
async def asyncio(
id: str,
id: UserIdentifier,
sort_by: CreatedAtSortMode,
*,
client: Client,

View File

@ -5,12 +5,12 @@ import httpx
from ...client import Client
from ...models.customer_balance import CustomerBalance
from ...models.error import Error
from ...models.uuid import Uuid
from ...models.user_identifier import UserIdentifier
from ...types import Response
def _get_kwargs(
id: Uuid,
id: UserIdentifier,
*,
client: Client,
) -> Dict[str, Any]:
@ -57,7 +57,7 @@ def _build_response(
def sync_detailed(
id: Uuid,
id: UserIdentifier,
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
@ -75,7 +75,7 @@ def sync_detailed(
def sync(
id: Uuid,
id: UserIdentifier,
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:
@ -88,7 +88,7 @@ def sync(
async def asyncio_detailed(
id: Uuid,
id: UserIdentifier,
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
@ -104,7 +104,7 @@ async def asyncio_detailed(
async def asyncio(
id: Uuid,
id: UserIdentifier,
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:

View File

@ -6,12 +6,12 @@ from ...client import Client
from ...models.customer_balance import CustomerBalance
from ...models.error import Error
from ...models.update_payment_balance import UpdatePaymentBalance
from ...models.uuid import Uuid
from ...models.user_identifier import UserIdentifier
from ...types import Response
def _get_kwargs(
id: Uuid,
id: UserIdentifier,
body: UpdatePaymentBalance,
*,
client: Client,
@ -60,7 +60,7 @@ def _build_response(
def sync_detailed(
id: Uuid,
id: UserIdentifier,
body: UpdatePaymentBalance,
*,
client: Client,
@ -80,7 +80,7 @@ def sync_detailed(
def sync(
id: Uuid,
id: UserIdentifier,
body: UpdatePaymentBalance,
*,
client: Client,
@ -95,7 +95,7 @@ def sync(
async def asyncio_detailed(
id: Uuid,
id: UserIdentifier,
body: UpdatePaymentBalance,
*,
client: Client,
@ -113,7 +113,7 @@ async def asyncio_detailed(
async def asyncio(
id: Uuid,
id: UserIdentifier,
body: UpdatePaymentBalance,
*,
client: Client,

View File

@ -5,11 +5,12 @@ import httpx
from ...client import Client
from ...models.error import Error
from ...models.user import User
from ...models.user_identifier import UserIdentifier
from ...types import Response
def _get_kwargs(
id: str,
id: UserIdentifier,
*,
client: Client,
) -> Dict[str, Any]:
@ -54,7 +55,7 @@ def _build_response(
def sync_detailed(
id: str,
id: UserIdentifier,
*,
client: Client,
) -> Response[Optional[Union[User, Error]]]:
@ -72,7 +73,7 @@ def sync_detailed(
def sync(
id: str,
id: UserIdentifier,
*,
client: Client,
) -> Optional[Union[User, Error]]:
@ -89,7 +90,7 @@ def sync(
async def asyncio_detailed(
id: str,
id: UserIdentifier,
*,
client: Client,
) -> Response[Optional[Union[User, Error]]]:
@ -105,7 +106,7 @@ async def asyncio_detailed(
async def asyncio(
id: str,
id: UserIdentifier,
*,
client: Client,
) -> Optional[Union[User, Error]]:

View File

@ -5,11 +5,12 @@ import httpx
from ...client import Client
from ...models.error import Error
from ...models.extended_user import ExtendedUser
from ...models.user_identifier import UserIdentifier
from ...types import Response
def _get_kwargs(
id: str,
id: UserIdentifier,
*,
client: Client,
) -> Dict[str, Any]:
@ -56,7 +57,7 @@ def _build_response(
def sync_detailed(
id: str,
id: UserIdentifier,
*,
client: Client,
) -> Response[Optional[Union[ExtendedUser, Error]]]:
@ -74,7 +75,7 @@ def sync_detailed(
def sync(
id: str,
id: UserIdentifier,
*,
client: Client,
) -> Optional[Union[ExtendedUser, Error]]:
@ -91,7 +92,7 @@ def sync(
async def asyncio_detailed(
id: str,
id: UserIdentifier,
*,
client: Client,
) -> Response[Optional[Union[ExtendedUser, Error]]]:
@ -107,7 +108,7 @@ async def asyncio_detailed(
async def asyncio(
id: str,
id: UserIdentifier,
*,
client: Client,
) -> Optional[Union[ExtendedUser, Error]]:

View File

@ -286,6 +286,7 @@ from kittycad.models.update_member_to_org_body import UpdateMemberToOrgBody
from kittycad.models.update_payment_balance import UpdatePaymentBalance
from kittycad.models.update_shortlink_request import UpdateShortlinkRequest
from kittycad.models.update_user import UpdateUser
from kittycad.models.user_identifier import UserIdentifier
from kittycad.models.user_org_role import UserOrgRole
from kittycad.models.uuid import Uuid
from kittycad.models.web_socket_request import OptionSdpOffer
@ -7012,7 +7013,7 @@ def test_get_user_extended():
result: Optional[Union[ExtendedUser, Error]] = get_user_extended.sync(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
)
if isinstance(result, Error) or result is None:
@ -7026,7 +7027,7 @@ def test_get_user_extended():
response: Response[Optional[Union[ExtendedUser, Error]]] = (
get_user_extended.sync_detailed(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
)
)
@ -7040,7 +7041,7 @@ async def test_get_user_extended_async():
result: Optional[Union[ExtendedUser, Error]] = await get_user_extended.asyncio(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
)
# OR run async with more info
@ -7048,7 +7049,7 @@ async def test_get_user_extended_async():
Optional[Union[ExtendedUser, Error]]
] = await get_user_extended.asyncio_detailed(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
)
@ -7059,7 +7060,7 @@ def test_get_user():
result: Optional[Union[User, Error]] = get_user.sync(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
)
if isinstance(result, Error) or result is None:
@ -7072,7 +7073,7 @@ def test_get_user():
# OR if you need more info (e.g. status_code)
response: Response[Optional[Union[User, Error]]] = get_user.sync_detailed(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
)
@ -7085,13 +7086,13 @@ async def test_get_user_async():
result: Optional[Union[User, Error]] = await get_user.asyncio(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
)
# OR run async with more info
response: Response[Optional[Union[User, Error]]] = await get_user.asyncio_detailed(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
)
@ -7103,7 +7104,7 @@ def test_list_api_calls_for_user():
result: Optional[Union[ApiCallWithPriceResultsPage, Error]] = (
list_api_calls_for_user.sync(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
limit=None, # Optional[int]
page_token=None, # Optional[str]
@ -7121,7 +7122,7 @@ def test_list_api_calls_for_user():
response: Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]] = (
list_api_calls_for_user.sync_detailed(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
limit=None, # Optional[int]
page_token=None, # Optional[str]
@ -7140,7 +7141,7 @@ async def test_list_api_calls_for_user_async():
Union[ApiCallWithPriceResultsPage, Error]
] = await list_api_calls_for_user.asyncio(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
limit=None, # Optional[int]
page_token=None, # Optional[str]
@ -7151,7 +7152,7 @@ async def test_list_api_calls_for_user_async():
Optional[Union[ApiCallWithPriceResultsPage, Error]]
] = await list_api_calls_for_user.asyncio_detailed(
client=client,
id="<string>",
id=UserIdentifier("<string>"),
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
limit=None, # Optional[int]
page_token=None, # Optional[str]
@ -7166,7 +7167,7 @@ def test_get_payment_balance_for_any_user():
result: Optional[Union[CustomerBalance, Error]] = (
get_payment_balance_for_any_user.sync(
client=client,
id=Uuid("<string>"),
id=UserIdentifier("<string>"),
)
)
@ -7181,7 +7182,7 @@ def test_get_payment_balance_for_any_user():
response: Response[Optional[Union[CustomerBalance, Error]]] = (
get_payment_balance_for_any_user.sync_detailed(
client=client,
id=Uuid("<string>"),
id=UserIdentifier("<string>"),
)
)
@ -7197,7 +7198,7 @@ async def test_get_payment_balance_for_any_user_async():
Union[CustomerBalance, Error]
] = await get_payment_balance_for_any_user.asyncio(
client=client,
id=Uuid("<string>"),
id=UserIdentifier("<string>"),
)
# OR run async with more info
@ -7205,7 +7206,7 @@ async def test_get_payment_balance_for_any_user_async():
Optional[Union[CustomerBalance, Error]]
] = await get_payment_balance_for_any_user.asyncio_detailed(
client=client,
id=Uuid("<string>"),
id=UserIdentifier("<string>"),
)
@ -7217,7 +7218,7 @@ def test_update_payment_balance_for_any_user():
result: Optional[Union[CustomerBalance, Error]] = (
update_payment_balance_for_any_user.sync(
client=client,
id=Uuid("<string>"),
id=UserIdentifier("<string>"),
body=UpdatePaymentBalance(),
)
)
@ -7233,7 +7234,7 @@ def test_update_payment_balance_for_any_user():
response: Response[Optional[Union[CustomerBalance, Error]]] = (
update_payment_balance_for_any_user.sync_detailed(
client=client,
id=Uuid("<string>"),
id=UserIdentifier("<string>"),
body=UpdatePaymentBalance(),
)
)
@ -7250,7 +7251,7 @@ async def test_update_payment_balance_for_any_user_async():
Union[CustomerBalance, Error]
] = await update_payment_balance_for_any_user.asyncio(
client=client,
id=Uuid("<string>"),
id=UserIdentifier("<string>"),
body=UpdatePaymentBalance(),
)
@ -7259,7 +7260,7 @@ async def test_update_payment_balance_for_any_user_async():
Optional[Union[CustomerBalance, Error]]
] = await update_payment_balance_for_any_user.asyncio_detailed(
client=client,
id=Uuid("<string>"),
id=UserIdentifier("<string>"),
body=UpdatePaymentBalance(),
)

View File

@ -332,6 +332,7 @@ from .update_payment_balance import UpdatePaymentBalance
from .update_shortlink_request import UpdateShortlinkRequest
from .update_user import UpdateUser
from .user import User
from .user_identifier import UserIdentifier
from .user_org_info import UserOrgInfo
from .user_org_role import UserOrgRole
from .user_results_page import UserResultsPage

View File

@ -0,0 +1,17 @@
from typing import Any
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
class UserIdentifier(str):
""""""
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))

View File

@ -14007,10 +14007,10 @@
{
"in": "path",
"name": "id",
"description": "The user ID.",
"description": "The user's identifier (uuid or email).",
"required": true,
"schema": {
"type": "string"
"$ref": "#/components/schemas/UserIdentifier"
}
}
],
@ -14089,10 +14089,10 @@
{
"in": "path",
"name": "id",
"description": "The user ID.",
"description": "The user's identifier (uuid or email).",
"required": true,
"schema": {
"type": "string"
"$ref": "#/components/schemas/UserIdentifier"
}
}
],
@ -14171,10 +14171,10 @@
{
"in": "path",
"name": "id",
"description": "The user ID.",
"description": "The user's identifier (uuid or email).",
"required": true,
"schema": {
"type": "string"
"$ref": "#/components/schemas/UserIdentifier"
}
},
{
@ -14283,10 +14283,10 @@
{
"in": "path",
"name": "id",
"description": "The user ID.",
"description": "The user's identifier (uuid or email).",
"required": true,
"schema": {
"$ref": "#/components/schemas/Uuid"
"$ref": "#/components/schemas/UserIdentifier"
}
}
],
@ -14363,10 +14363,10 @@
{
"in": "path",
"name": "id",
"description": "The user ID.",
"description": "The user's identifier (uuid or email).",
"required": true,
"schema": {
"$ref": "#/components/schemas/Uuid"
"$ref": "#/components/schemas/UserIdentifier"
}
}
],
@ -14452,10 +14452,10 @@
{
"in": "path",
"name": "id",
"description": "The user ID.",
"description": "The user's identifier (uuid or email).",
"required": true,
"schema": {
"$ref": "#/components/schemas/Uuid"
"$ref": "#/components/schemas/UserIdentifier"
}
}
],
@ -31792,6 +31792,9 @@
"updated_at"
]
},
"UserIdentifier": {
"type": "string"
},
"UserOrgInfo": {
"description": "A user's information about an org, including their role.",
"type": "object",