Update api spec (#293)
* 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:
committed by
GitHub
parent
cde3af8385
commit
d5448c9e2f
File diff suppressed because it is too large
Load Diff
153
kittycad/api/orgs/get_org_shortlinks.py
Normal file
153
kittycad/api/orgs/get_org_shortlinks.py
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...models.shortlink_results_page import ShortlinkResultsPage
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
sort_by: CreatedAtSortMode,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
limit: Optional[int] = None,
|
||||||
|
page_token: Optional[str] = None,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/org/shortlinks".format(
|
||||||
|
client.base_url,
|
||||||
|
) # noqa: E501
|
||||||
|
|
||||||
|
if limit is not None:
|
||||||
|
if "?" in url:
|
||||||
|
url = url + "&limit=" + str(limit)
|
||||||
|
else:
|
||||||
|
url = url + "?limit=" + str(limit)
|
||||||
|
|
||||||
|
if page_token is not None:
|
||||||
|
if "?" in url:
|
||||||
|
url = url + "&page_token=" + str(page_token)
|
||||||
|
else:
|
||||||
|
url = url + "?page_token=" + str(page_token)
|
||||||
|
|
||||||
|
if sort_by is not None:
|
||||||
|
if "?" in url:
|
||||||
|
url = url + "&sort_by=" + str(sort_by)
|
||||||
|
else:
|
||||||
|
url = url + "?sort_by=" + str(sort_by)
|
||||||
|
|
||||||
|
headers: Dict[str, Any] = client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = client.get_cookies()
|
||||||
|
|
||||||
|
return {
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(
|
||||||
|
*, response: httpx.Response
|
||||||
|
) -> Optional[Union[ShortlinkResultsPage, Error]]:
|
||||||
|
if response.status_code == 200:
|
||||||
|
response_200 = ShortlinkResultsPage(**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[ShortlinkResultsPage, Error]]]:
|
||||||
|
return Response(
|
||||||
|
status_code=response.status_code,
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
sort_by: CreatedAtSortMode,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
limit: Optional[int] = None,
|
||||||
|
page_token: Optional[str] = None,
|
||||||
|
) -> Response[Optional[Union[ShortlinkResultsPage, Error]]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
limit=limit,
|
||||||
|
page_token=page_token,
|
||||||
|
sort_by=sort_by,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.get(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
sort_by: CreatedAtSortMode,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
limit: Optional[int] = None,
|
||||||
|
page_token: Optional[str] = None,
|
||||||
|
) -> Optional[Union[ShortlinkResultsPage, Error]]:
|
||||||
|
"""This endpoint requires authentication by an org admin. It gets the shortlinks for the authenticated user's org.""" # noqa: E501
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
limit=limit,
|
||||||
|
page_token=page_token,
|
||||||
|
sort_by=sort_by,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
sort_by: CreatedAtSortMode,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
limit: Optional[int] = None,
|
||||||
|
page_token: Optional[str] = None,
|
||||||
|
) -> Response[Optional[Union[ShortlinkResultsPage, Error]]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
limit=limit,
|
||||||
|
page_token=page_token,
|
||||||
|
sort_by=sort_by,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||||
|
response = await _client.get(**kwargs)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
sort_by: CreatedAtSortMode,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
limit: Optional[int] = None,
|
||||||
|
page_token: Optional[str] = None,
|
||||||
|
) -> Optional[Union[ShortlinkResultsPage, Error]]:
|
||||||
|
"""This endpoint requires authentication by an org admin. It gets the shortlinks for the authenticated user's org.""" # noqa: E501
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
limit=limit,
|
||||||
|
page_token=page_token,
|
||||||
|
sort_by=sort_by,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
1
kittycad/api/shortlinks/__init__.py
Normal file
1
kittycad/api/shortlinks/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
"""Contains methods for accessing the shortlinks API paths: Shortlinks are a way to create a short URL that redirects to a longer URL. This is useful for sharing links that are long and unwieldy.""" # noqa: E501
|
118
kittycad/api/users/create_user_shortlink.py
Normal file
118
kittycad/api/users/create_user_shortlink.py
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.create_shortlink_request import CreateShortlinkRequest
|
||||||
|
from ...models.create_shortlink_response import CreateShortlinkResponse
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
body: CreateShortlinkRequest,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user/shortlinks".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(),
|
||||||
|
"content": body.model_dump_json(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(
|
||||||
|
*, response: httpx.Response
|
||||||
|
) -> Optional[Union[CreateShortlinkResponse, Error]]:
|
||||||
|
if response.status_code == 201:
|
||||||
|
response_201 = CreateShortlinkResponse(**response.json())
|
||||||
|
return response_201
|
||||||
|
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[CreateShortlinkResponse, Error]]]:
|
||||||
|
return Response(
|
||||||
|
status_code=response.status_code,
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
body: CreateShortlinkRequest,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Optional[Union[CreateShortlinkResponse, Error]]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.post(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
body: CreateShortlinkRequest,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[CreateShortlinkResponse, Error]]:
|
||||||
|
"""This endpoint requires authentication by any Zoo user. It creates a shortlink for the user.""" # noqa: E501
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
body: CreateShortlinkRequest,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Optional[Union[CreateShortlinkResponse, Error]]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||||
|
response = await _client.post(**kwargs)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
body: CreateShortlinkRequest,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[CreateShortlinkResponse, Error]]:
|
||||||
|
"""This endpoint requires authentication by any Zoo user. It creates a shortlink for the user.""" # noqa: E501
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
110
kittycad/api/users/delete_user_shortlink.py
Normal file
110
kittycad/api/users/delete_user_shortlink.py
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
key: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user/shortlinks/{key}".format(
|
||||||
|
client.base_url,
|
||||||
|
key=key,
|
||||||
|
) # 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[Error]:
|
||||||
|
return None
|
||||||
|
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[Error]]:
|
||||||
|
return Response(
|
||||||
|
status_code=response.status_code,
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
key: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Optional[Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
key=key,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.delete(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
key: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Error]:
|
||||||
|
"""This endpoint requires authentication by any Zoo user. It deletes a shortlink for the user.""" # noqa: E501
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
key=key,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
key: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Optional[Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
key=key,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||||
|
response = await _client.delete(**kwargs)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
key: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Error]:
|
||||||
|
"""This endpoint requires authentication by any Zoo user. It deletes a shortlink for the user.""" # noqa: E501
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
key=key,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
153
kittycad/api/users/get_user_shortlinks.py
Normal file
153
kittycad/api/users/get_user_shortlinks.py
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...models.shortlink_results_page import ShortlinkResultsPage
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
sort_by: CreatedAtSortMode,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
limit: Optional[int] = None,
|
||||||
|
page_token: Optional[str] = None,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user/shortlinks".format(
|
||||||
|
client.base_url,
|
||||||
|
) # noqa: E501
|
||||||
|
|
||||||
|
if limit is not None:
|
||||||
|
if "?" in url:
|
||||||
|
url = url + "&limit=" + str(limit)
|
||||||
|
else:
|
||||||
|
url = url + "?limit=" + str(limit)
|
||||||
|
|
||||||
|
if page_token is not None:
|
||||||
|
if "?" in url:
|
||||||
|
url = url + "&page_token=" + str(page_token)
|
||||||
|
else:
|
||||||
|
url = url + "?page_token=" + str(page_token)
|
||||||
|
|
||||||
|
if sort_by is not None:
|
||||||
|
if "?" in url:
|
||||||
|
url = url + "&sort_by=" + str(sort_by)
|
||||||
|
else:
|
||||||
|
url = url + "?sort_by=" + str(sort_by)
|
||||||
|
|
||||||
|
headers: Dict[str, Any] = client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = client.get_cookies()
|
||||||
|
|
||||||
|
return {
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(
|
||||||
|
*, response: httpx.Response
|
||||||
|
) -> Optional[Union[ShortlinkResultsPage, Error]]:
|
||||||
|
if response.status_code == 200:
|
||||||
|
response_200 = ShortlinkResultsPage(**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[ShortlinkResultsPage, Error]]]:
|
||||||
|
return Response(
|
||||||
|
status_code=response.status_code,
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
sort_by: CreatedAtSortMode,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
limit: Optional[int] = None,
|
||||||
|
page_token: Optional[str] = None,
|
||||||
|
) -> Response[Optional[Union[ShortlinkResultsPage, Error]]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
limit=limit,
|
||||||
|
page_token=page_token,
|
||||||
|
sort_by=sort_by,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.get(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
sort_by: CreatedAtSortMode,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
limit: Optional[int] = None,
|
||||||
|
page_token: Optional[str] = None,
|
||||||
|
) -> Optional[Union[ShortlinkResultsPage, Error]]:
|
||||||
|
"""This endpoint requires authentication by any Zoo user. It gets the shortlinks for the user.""" # noqa: E501
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
limit=limit,
|
||||||
|
page_token=page_token,
|
||||||
|
sort_by=sort_by,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
sort_by: CreatedAtSortMode,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
limit: Optional[int] = None,
|
||||||
|
page_token: Optional[str] = None,
|
||||||
|
) -> Response[Optional[Union[ShortlinkResultsPage, Error]]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
limit=limit,
|
||||||
|
page_token=page_token,
|
||||||
|
sort_by=sort_by,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||||
|
response = await _client.get(**kwargs)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
sort_by: CreatedAtSortMode,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
limit: Optional[int] = None,
|
||||||
|
page_token: Optional[str] = None,
|
||||||
|
) -> Optional[Union[ShortlinkResultsPage, Error]]:
|
||||||
|
"""This endpoint requires authentication by any Zoo user. It gets the shortlinks for the user.""" # noqa: E501
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
limit=limit,
|
||||||
|
page_token=page_token,
|
||||||
|
sort_by=sort_by,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
110
kittycad/api/users/redirect_user_shortlink.py
Normal file
110
kittycad/api/users/redirect_user_shortlink.py
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
key: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user/shortlinks/{key}".format(
|
||||||
|
client.base_url,
|
||||||
|
key=key,
|
||||||
|
) # 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[Error]:
|
||||||
|
return None
|
||||||
|
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[Error]]:
|
||||||
|
return Response(
|
||||||
|
status_code=response.status_code,
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
key: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Optional[Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
key=key,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.get(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
key: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Error]:
|
||||||
|
"""This endpoint might require authentication by a Zoo user. It gets the shortlink for the user and redirects them to the URL. If the shortlink is owned by an org, the user must be a member of the org.""" # noqa: E501
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
key=key,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
key: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Optional[Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
key=key,
|
||||||
|
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(
|
||||||
|
key: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Error]:
|
||||||
|
"""This endpoint might require authentication by a Zoo user. It gets the shortlink for the user and redirects them to the URL. If the shortlink is owned by an org, the user must be a member of the org.""" # noqa: E501
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
key=key,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
125
kittycad/api/users/update_user_shortlink.py
Normal file
125
kittycad/api/users/update_user_shortlink.py
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...models.update_shortlink_request import UpdateShortlinkRequest
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
key: str,
|
||||||
|
body: UpdateShortlinkRequest,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user/shortlinks/{key}".format(
|
||||||
|
client.base_url,
|
||||||
|
key=key,
|
||||||
|
) # 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(),
|
||||||
|
"content": body.model_dump_json(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
|
||||||
|
return None
|
||||||
|
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[Error]]:
|
||||||
|
return Response(
|
||||||
|
status_code=response.status_code,
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
key: str,
|
||||||
|
body: UpdateShortlinkRequest,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Optional[Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
key=key,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.put(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
key: str,
|
||||||
|
body: UpdateShortlinkRequest,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Error]:
|
||||||
|
"""This endpoint requires authentication by any Zoo user. It updates a shortlink for the user.
|
||||||
|
|
||||||
|
This endpoint really only allows you to change the `restrict_to_org` setting of a shortlink. Thus it is only useful for folks who are part of an org. If you are not part of an org, you will not be able to change the `restrict_to_org` status.""" # noqa: E501
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
key=key,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
key: str,
|
||||||
|
body: UpdateShortlinkRequest,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Optional[Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
key=key,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||||
|
response = await _client.put(**kwargs)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
key: str,
|
||||||
|
body: UpdateShortlinkRequest,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Error]:
|
||||||
|
"""This endpoint requires authentication by any Zoo user. It updates a shortlink for the user.
|
||||||
|
|
||||||
|
This endpoint really only allows you to change the `restrict_to_org` setting of a shortlink. Thus it is only useful for folks who are part of an org. If you are not part of an org, you will not be able to change the `restrict_to_org` status.""" # noqa: E501
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
key=key,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
@ -75,6 +75,7 @@ from kittycad.api.orgs import (
|
|||||||
get_org_member,
|
get_org_member,
|
||||||
get_org_privacy_settings,
|
get_org_privacy_settings,
|
||||||
get_org_saml_idp,
|
get_org_saml_idp,
|
||||||
|
get_org_shortlinks,
|
||||||
get_user_org,
|
get_user_org,
|
||||||
list_org_members,
|
list_org_members,
|
||||||
list_orgs,
|
list_orgs,
|
||||||
@ -139,7 +140,9 @@ from kittycad.api.unit import (
|
|||||||
get_volume_unit_conversion,
|
get_volume_unit_conversion,
|
||||||
)
|
)
|
||||||
from kittycad.api.users import (
|
from kittycad.api.users import (
|
||||||
|
create_user_shortlink,
|
||||||
delete_user_self,
|
delete_user_self,
|
||||||
|
delete_user_shortlink,
|
||||||
get_oauth2_providers_for_user,
|
get_oauth2_providers_for_user,
|
||||||
get_session_for_user,
|
get_session_for_user,
|
||||||
get_user,
|
get_user,
|
||||||
@ -148,10 +151,13 @@ from kittycad.api.users import (
|
|||||||
get_user_privacy_settings,
|
get_user_privacy_settings,
|
||||||
get_user_self,
|
get_user_self,
|
||||||
get_user_self_extended,
|
get_user_self_extended,
|
||||||
|
get_user_shortlinks,
|
||||||
list_users,
|
list_users,
|
||||||
list_users_extended,
|
list_users_extended,
|
||||||
|
redirect_user_shortlink,
|
||||||
update_user_privacy_settings,
|
update_user_privacy_settings,
|
||||||
update_user_self,
|
update_user_self,
|
||||||
|
update_user_shortlink,
|
||||||
)
|
)
|
||||||
from kittycad.client import ClientFromEnv
|
from kittycad.client import ClientFromEnv
|
||||||
from kittycad.models import (
|
from kittycad.models import (
|
||||||
@ -164,6 +170,7 @@ from kittycad.models import (
|
|||||||
AppClientInfo,
|
AppClientInfo,
|
||||||
AsyncApiCallResultsPage,
|
AsyncApiCallResultsPage,
|
||||||
CodeOutput,
|
CodeOutput,
|
||||||
|
CreateShortlinkResponse,
|
||||||
Customer,
|
Customer,
|
||||||
CustomerBalance,
|
CustomerBalance,
|
||||||
DiscountCode,
|
DiscountCode,
|
||||||
@ -194,6 +201,7 @@ from kittycad.models import (
|
|||||||
ServiceAccount,
|
ServiceAccount,
|
||||||
ServiceAccountResultsPage,
|
ServiceAccountResultsPage,
|
||||||
Session,
|
Session,
|
||||||
|
ShortlinkResultsPage,
|
||||||
TextToCad,
|
TextToCad,
|
||||||
TextToCadIteration,
|
TextToCadIteration,
|
||||||
TextToCadResultsPage,
|
TextToCadResultsPage,
|
||||||
@ -224,6 +232,7 @@ from kittycad.models.api_token_uuid import ApiTokenUuid
|
|||||||
from kittycad.models.base64data import Base64Data
|
from kittycad.models.base64data import Base64Data
|
||||||
from kittycad.models.billing_info import BillingInfo
|
from kittycad.models.billing_info import BillingInfo
|
||||||
from kittycad.models.code_language import CodeLanguage
|
from kittycad.models.code_language import CodeLanguage
|
||||||
|
from kittycad.models.create_shortlink_request import CreateShortlinkRequest
|
||||||
from kittycad.models.created_at_sort_mode import CreatedAtSortMode
|
from kittycad.models.created_at_sort_mode import CreatedAtSortMode
|
||||||
from kittycad.models.email_authentication_form import EmailAuthenticationForm
|
from kittycad.models.email_authentication_form import EmailAuthenticationForm
|
||||||
from kittycad.models.event import Event, OptionModelingAppEvent
|
from kittycad.models.event import Event, OptionModelingAppEvent
|
||||||
@ -275,6 +284,7 @@ from kittycad.models.unit_torque import UnitTorque
|
|||||||
from kittycad.models.unit_volume import UnitVolume
|
from kittycad.models.unit_volume import UnitVolume
|
||||||
from kittycad.models.update_member_to_org_body import UpdateMemberToOrgBody
|
from kittycad.models.update_member_to_org_body import UpdateMemberToOrgBody
|
||||||
from kittycad.models.update_payment_balance import UpdatePaymentBalance
|
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.update_user import UpdateUser
|
||||||
from kittycad.models.user_org_role import UserOrgRole
|
from kittycad.models.user_org_role import UserOrgRole
|
||||||
from kittycad.models.uuid import Uuid
|
from kittycad.models.uuid import Uuid
|
||||||
@ -3799,6 +3809,63 @@ async def test_delete_service_account_for_org_async():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skip
|
||||||
|
def test_get_org_shortlinks():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[Union[ShortlinkResultsPage, Error]] = get_org_shortlinks.sync(
|
||||||
|
client=client,
|
||||||
|
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||||
|
limit=None, # Optional[int]
|
||||||
|
page_token=None, # Optional[str]
|
||||||
|
)
|
||||||
|
|
||||||
|
if isinstance(result, Error) or result is None:
|
||||||
|
print(result)
|
||||||
|
raise Exception("Error in response")
|
||||||
|
|
||||||
|
body: ShortlinkResultsPage = result
|
||||||
|
print(body)
|
||||||
|
|
||||||
|
# OR if you need more info (e.g. status_code)
|
||||||
|
response: Response[Optional[Union[ShortlinkResultsPage, Error]]] = (
|
||||||
|
get_org_shortlinks.sync_detailed(
|
||||||
|
client=client,
|
||||||
|
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||||
|
limit=None, # Optional[int]
|
||||||
|
page_token=None, # Optional[str]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# OR run async
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
@pytest.mark.skip
|
||||||
|
async def test_get_org_shortlinks_async():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[
|
||||||
|
Union[ShortlinkResultsPage, Error]
|
||||||
|
] = await get_org_shortlinks.asyncio(
|
||||||
|
client=client,
|
||||||
|
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||||
|
limit=None, # Optional[int]
|
||||||
|
page_token=None, # Optional[str]
|
||||||
|
)
|
||||||
|
|
||||||
|
# OR run async with more info
|
||||||
|
response: Response[
|
||||||
|
Optional[Union[ShortlinkResultsPage, Error]]
|
||||||
|
] = await get_org_shortlinks.asyncio_detailed(
|
||||||
|
client=client,
|
||||||
|
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||||
|
limit=None, # Optional[int]
|
||||||
|
page_token=None, # Optional[str]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip
|
@pytest.mark.skip
|
||||||
def test_list_orgs():
|
def test_list_orgs():
|
||||||
# Create our client.
|
# Create our client.
|
||||||
@ -6400,6 +6467,269 @@ async def test_get_session_for_user_async():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skip
|
||||||
|
def test_get_user_shortlinks():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[Union[ShortlinkResultsPage, Error]] = get_user_shortlinks.sync(
|
||||||
|
client=client,
|
||||||
|
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||||
|
limit=None, # Optional[int]
|
||||||
|
page_token=None, # Optional[str]
|
||||||
|
)
|
||||||
|
|
||||||
|
if isinstance(result, Error) or result is None:
|
||||||
|
print(result)
|
||||||
|
raise Exception("Error in response")
|
||||||
|
|
||||||
|
body: ShortlinkResultsPage = result
|
||||||
|
print(body)
|
||||||
|
|
||||||
|
# OR if you need more info (e.g. status_code)
|
||||||
|
response: Response[Optional[Union[ShortlinkResultsPage, Error]]] = (
|
||||||
|
get_user_shortlinks.sync_detailed(
|
||||||
|
client=client,
|
||||||
|
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||||
|
limit=None, # Optional[int]
|
||||||
|
page_token=None, # Optional[str]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# OR run async
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
@pytest.mark.skip
|
||||||
|
async def test_get_user_shortlinks_async():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[
|
||||||
|
Union[ShortlinkResultsPage, Error]
|
||||||
|
] = await get_user_shortlinks.asyncio(
|
||||||
|
client=client,
|
||||||
|
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||||
|
limit=None, # Optional[int]
|
||||||
|
page_token=None, # Optional[str]
|
||||||
|
)
|
||||||
|
|
||||||
|
# OR run async with more info
|
||||||
|
response: Response[
|
||||||
|
Optional[Union[ShortlinkResultsPage, Error]]
|
||||||
|
] = await get_user_shortlinks.asyncio_detailed(
|
||||||
|
client=client,
|
||||||
|
sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,
|
||||||
|
limit=None, # Optional[int]
|
||||||
|
page_token=None, # Optional[str]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skip
|
||||||
|
def test_create_user_shortlink():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[Union[CreateShortlinkResponse, Error]] = (
|
||||||
|
create_user_shortlink.sync(
|
||||||
|
client=client,
|
||||||
|
body=CreateShortlinkRequest(
|
||||||
|
restrict_to_org=False,
|
||||||
|
url="<string>",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if isinstance(result, Error) or result is None:
|
||||||
|
print(result)
|
||||||
|
raise Exception("Error in response")
|
||||||
|
|
||||||
|
body: CreateShortlinkResponse = result
|
||||||
|
print(body)
|
||||||
|
|
||||||
|
# OR if you need more info (e.g. status_code)
|
||||||
|
response: Response[Optional[Union[CreateShortlinkResponse, Error]]] = (
|
||||||
|
create_user_shortlink.sync_detailed(
|
||||||
|
client=client,
|
||||||
|
body=CreateShortlinkRequest(
|
||||||
|
restrict_to_org=False,
|
||||||
|
url="<string>",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# OR run async
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
@pytest.mark.skip
|
||||||
|
async def test_create_user_shortlink_async():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[
|
||||||
|
Union[CreateShortlinkResponse, Error]
|
||||||
|
] = await create_user_shortlink.asyncio(
|
||||||
|
client=client,
|
||||||
|
body=CreateShortlinkRequest(
|
||||||
|
restrict_to_org=False,
|
||||||
|
url="<string>",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
# OR run async with more info
|
||||||
|
response: Response[
|
||||||
|
Optional[Union[CreateShortlinkResponse, Error]]
|
||||||
|
] = await create_user_shortlink.asyncio_detailed(
|
||||||
|
client=client,
|
||||||
|
body=CreateShortlinkRequest(
|
||||||
|
restrict_to_org=False,
|
||||||
|
url="<string>",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skip
|
||||||
|
def test_redirect_user_shortlink():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[Error] = redirect_user_shortlink.sync(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
)
|
||||||
|
|
||||||
|
if isinstance(result, Error) or result is None:
|
||||||
|
print(result)
|
||||||
|
raise Exception("Error in response")
|
||||||
|
|
||||||
|
body: Error = result
|
||||||
|
print(body)
|
||||||
|
|
||||||
|
# OR if you need more info (e.g. status_code)
|
||||||
|
response: Response[Optional[Error]] = redirect_user_shortlink.sync_detailed(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# OR run async
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
@pytest.mark.skip
|
||||||
|
async def test_redirect_user_shortlink_async():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[Error] = await redirect_user_shortlink.asyncio(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
)
|
||||||
|
|
||||||
|
# OR run async with more info
|
||||||
|
response: Response[
|
||||||
|
Optional[Error]
|
||||||
|
] = await redirect_user_shortlink.asyncio_detailed(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skip
|
||||||
|
def test_update_user_shortlink():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[Error] = update_user_shortlink.sync(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
body=UpdateShortlinkRequest(
|
||||||
|
restrict_to_org=False,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
if isinstance(result, Error) or result is None:
|
||||||
|
print(result)
|
||||||
|
raise Exception("Error in response")
|
||||||
|
|
||||||
|
body: Error = result
|
||||||
|
print(body)
|
||||||
|
|
||||||
|
# OR if you need more info (e.g. status_code)
|
||||||
|
response: Response[Optional[Error]] = update_user_shortlink.sync_detailed(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
body=UpdateShortlinkRequest(
|
||||||
|
restrict_to_org=False,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# OR run async
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
@pytest.mark.skip
|
||||||
|
async def test_update_user_shortlink_async():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[Error] = await update_user_shortlink.asyncio(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
body=UpdateShortlinkRequest(
|
||||||
|
restrict_to_org=False,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
# OR run async with more info
|
||||||
|
response: Response[Optional[Error]] = await update_user_shortlink.asyncio_detailed(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
body=UpdateShortlinkRequest(
|
||||||
|
restrict_to_org=False,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skip
|
||||||
|
def test_delete_user_shortlink():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[Error] = delete_user_shortlink.sync(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
)
|
||||||
|
|
||||||
|
if isinstance(result, Error) or result is None:
|
||||||
|
print(result)
|
||||||
|
raise Exception("Error in response")
|
||||||
|
|
||||||
|
body: Error = result
|
||||||
|
print(body)
|
||||||
|
|
||||||
|
# OR if you need more info (e.g. status_code)
|
||||||
|
response: Response[Optional[Error]] = delete_user_shortlink.sync_detailed(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# OR run async
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
@pytest.mark.skip
|
||||||
|
async def test_delete_user_shortlink_async():
|
||||||
|
# Create our client.
|
||||||
|
client = ClientFromEnv()
|
||||||
|
|
||||||
|
result: Optional[Error] = await delete_user_shortlink.asyncio(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
)
|
||||||
|
|
||||||
|
# OR run async with more info
|
||||||
|
response: Response[Optional[Error]] = await delete_user_shortlink.asyncio_detailed(
|
||||||
|
client=client,
|
||||||
|
key="<string>",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip
|
@pytest.mark.skip
|
||||||
def test_list_text_to_cad_models_for_user():
|
def test_list_text_to_cad_models_for_user():
|
||||||
# Create our client.
|
# Create our client.
|
||||||
|
@ -48,6 +48,8 @@ from .color import Color
|
|||||||
from .connection import Connection
|
from .connection import Connection
|
||||||
from .country_code import CountryCode
|
from .country_code import CountryCode
|
||||||
from .coupon import Coupon
|
from .coupon import Coupon
|
||||||
|
from .create_shortlink_request import CreateShortlinkRequest
|
||||||
|
from .create_shortlink_response import CreateShortlinkResponse
|
||||||
from .created_at_sort_mode import CreatedAtSortMode
|
from .created_at_sort_mode import CreatedAtSortMode
|
||||||
from .currency import Currency
|
from .currency import Currency
|
||||||
from .curve_get_control_points import CurveGetControlPoints
|
from .curve_get_control_points import CurveGetControlPoints
|
||||||
@ -261,6 +263,8 @@ from .set_scene_units import SetSceneUnits
|
|||||||
from .set_selection_filter import SetSelectionFilter
|
from .set_selection_filter import SetSelectionFilter
|
||||||
from .set_selection_type import SetSelectionType
|
from .set_selection_type import SetSelectionType
|
||||||
from .set_tool import SetTool
|
from .set_tool import SetTool
|
||||||
|
from .shortlink import Shortlink
|
||||||
|
from .shortlink_results_page import ShortlinkResultsPage
|
||||||
from .sketch_mode_disable import SketchModeDisable
|
from .sketch_mode_disable import SketchModeDisable
|
||||||
from .solid2d_add_hole import Solid2dAddHole
|
from .solid2d_add_hole import Solid2dAddHole
|
||||||
from .solid3d_fillet_edge import Solid3dFilletEdge
|
from .solid3d_fillet_edge import Solid3dFilletEdge
|
||||||
@ -324,6 +328,7 @@ from .unit_volume_conversion import UnitVolumeConversion
|
|||||||
from .update_annotation import UpdateAnnotation
|
from .update_annotation import UpdateAnnotation
|
||||||
from .update_member_to_org_body import UpdateMemberToOrgBody
|
from .update_member_to_org_body import UpdateMemberToOrgBody
|
||||||
from .update_payment_balance import UpdatePaymentBalance
|
from .update_payment_balance import UpdatePaymentBalance
|
||||||
|
from .update_shortlink_request import UpdateShortlinkRequest
|
||||||
from .update_user import UpdateUser
|
from .update_user import UpdateUser
|
||||||
from .user import User
|
from .user import User
|
||||||
from .user_org_info import UserOrgInfo
|
from .user_org_info import UserOrgInfo
|
||||||
|
11
kittycad/models/create_shortlink_request.py
Normal file
11
kittycad/models/create_shortlink_request.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
|
||||||
|
|
||||||
|
class CreateShortlinkRequest(BaseModel):
|
||||||
|
"""Request to create a shortlink."""
|
||||||
|
|
||||||
|
restrict_to_org: bool
|
||||||
|
|
||||||
|
url: str
|
||||||
|
|
||||||
|
model_config = ConfigDict(protected_namespaces=())
|
11
kittycad/models/create_shortlink_response.py
Normal file
11
kittycad/models/create_shortlink_response.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
|
||||||
|
|
||||||
|
class CreateShortlinkResponse(BaseModel):
|
||||||
|
"""Response from creating a shortlink."""
|
||||||
|
|
||||||
|
key: str
|
||||||
|
|
||||||
|
url: str
|
||||||
|
|
||||||
|
model_config = ConfigDict(protected_namespaces=())
|
30
kittycad/models/shortlink.py
Normal file
30
kittycad/models/shortlink.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import datetime
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
|
||||||
|
from ..models.uuid import Uuid
|
||||||
|
|
||||||
|
|
||||||
|
class Shortlink(BaseModel):
|
||||||
|
"""A short url."""
|
||||||
|
|
||||||
|
created_at: datetime.datetime
|
||||||
|
|
||||||
|
id: Uuid
|
||||||
|
|
||||||
|
key: str
|
||||||
|
|
||||||
|
org_id: Optional[Uuid] = None
|
||||||
|
|
||||||
|
password_hash: Optional[str] = None
|
||||||
|
|
||||||
|
restrict_to_org: bool = False
|
||||||
|
|
||||||
|
updated_at: datetime.datetime
|
||||||
|
|
||||||
|
user_id: Uuid
|
||||||
|
|
||||||
|
value: str
|
||||||
|
|
||||||
|
model_config = ConfigDict(protected_namespaces=())
|
15
kittycad/models/shortlink_results_page.py
Normal file
15
kittycad/models/shortlink_results_page.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
from typing import List, Optional
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
|
||||||
|
from ..models.shortlink import Shortlink
|
||||||
|
|
||||||
|
|
||||||
|
class ShortlinkResultsPage(BaseModel):
|
||||||
|
"""A single page of results"""
|
||||||
|
|
||||||
|
items: List[Shortlink]
|
||||||
|
|
||||||
|
next_page: Optional[str] = None
|
||||||
|
|
||||||
|
model_config = ConfigDict(protected_namespaces=())
|
9
kittycad/models/update_shortlink_request.py
Normal file
9
kittycad/models/update_shortlink_request.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
|
||||||
|
|
||||||
|
class UpdateShortlinkRequest(BaseModel):
|
||||||
|
"""Request to update a shortlink."""
|
||||||
|
|
||||||
|
restrict_to_org: bool
|
||||||
|
|
||||||
|
model_config = ConfigDict(protected_namespaces=())
|
799
spec.json
799
spec.json
@ -7915,6 +7915,109 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/org/shortlinks": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"orgs",
|
||||||
|
"shortlinks"
|
||||||
|
],
|
||||||
|
"summary": "Get the shortlinks for an org.",
|
||||||
|
"description": "This endpoint requires authentication by an org admin. It gets the shortlinks for the authenticated user's org.",
|
||||||
|
"operationId": "get_org_shortlinks",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "limit",
|
||||||
|
"description": "Maximum number of items returned by a single call",
|
||||||
|
"schema": {
|
||||||
|
"nullable": true,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "uint32",
|
||||||
|
"minimum": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "page_token",
|
||||||
|
"description": "Token returned by previous call to retrieve the subsequent page",
|
||||||
|
"schema": {
|
||||||
|
"nullable": true,
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "sort_by",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/CreatedAtSortMode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "successful operation",
|
||||||
|
"headers": {
|
||||||
|
"Access-Control-Allow-Credentials": {
|
||||||
|
"description": "Access-Control-Allow-Credentials header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Headers": {
|
||||||
|
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Methods": {
|
||||||
|
"description": "Access-Control-Allow-Methods header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Origin": {
|
||||||
|
"description": "Access-Control-Allow-Origin header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"X-Api-Call-Id": {
|
||||||
|
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/ShortlinkResultsPage"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"4XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
},
|
||||||
|
"5XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-dropshot-pagination": {
|
||||||
|
"required": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/orgs": {
|
"/orgs": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
@ -12790,6 +12893,552 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/user/shortlinks": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"users",
|
||||||
|
"shortlinks"
|
||||||
|
],
|
||||||
|
"summary": "Get the shortlinks for a user.",
|
||||||
|
"description": "This endpoint requires authentication by any Zoo user. It gets the shortlinks for the user.",
|
||||||
|
"operationId": "get_user_shortlinks",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "limit",
|
||||||
|
"description": "Maximum number of items returned by a single call",
|
||||||
|
"schema": {
|
||||||
|
"nullable": true,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "uint32",
|
||||||
|
"minimum": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "page_token",
|
||||||
|
"description": "Token returned by previous call to retrieve the subsequent page",
|
||||||
|
"schema": {
|
||||||
|
"nullable": true,
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "sort_by",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/CreatedAtSortMode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "successful operation",
|
||||||
|
"headers": {
|
||||||
|
"Access-Control-Allow-Credentials": {
|
||||||
|
"description": "Access-Control-Allow-Credentials header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Headers": {
|
||||||
|
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Methods": {
|
||||||
|
"description": "Access-Control-Allow-Methods header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Origin": {
|
||||||
|
"description": "Access-Control-Allow-Origin header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"X-Api-Call-Id": {
|
||||||
|
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/ShortlinkResultsPage"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"4XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
},
|
||||||
|
"5XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-dropshot-pagination": {
|
||||||
|
"required": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"post": {
|
||||||
|
"tags": [
|
||||||
|
"users",
|
||||||
|
"shortlinks"
|
||||||
|
],
|
||||||
|
"summary": "Create a shortlink for a user.",
|
||||||
|
"description": "This endpoint requires authentication by any Zoo user. It creates a shortlink for the user.",
|
||||||
|
"operationId": "create_user_shortlink",
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/CreateShortlinkRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"201": {
|
||||||
|
"description": "successful creation",
|
||||||
|
"headers": {
|
||||||
|
"Access-Control-Allow-Credentials": {
|
||||||
|
"description": "Access-Control-Allow-Credentials header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Headers": {
|
||||||
|
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Methods": {
|
||||||
|
"description": "Access-Control-Allow-Methods header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Origin": {
|
||||||
|
"description": "Access-Control-Allow-Origin header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"X-Api-Call-Id": {
|
||||||
|
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/CreateShortlinkResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"4XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
},
|
||||||
|
"5XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"tags": [
|
||||||
|
"hidden"
|
||||||
|
],
|
||||||
|
"summary": "OPTIONS endpoint.",
|
||||||
|
"description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.",
|
||||||
|
"operationId": "options_user_shortlinks",
|
||||||
|
"responses": {
|
||||||
|
"204": {
|
||||||
|
"description": "resource updated",
|
||||||
|
"headers": {
|
||||||
|
"Access-Control-Allow-Credentials": {
|
||||||
|
"description": "Access-Control-Allow-Credentials header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Headers": {
|
||||||
|
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Methods": {
|
||||||
|
"description": "Access-Control-Allow-Methods header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Origin": {
|
||||||
|
"description": "Access-Control-Allow-Origin header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"X-Api-Call-Id": {
|
||||||
|
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"4XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
},
|
||||||
|
"5XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/user/shortlinks/{key}": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"users",
|
||||||
|
"shortlinks"
|
||||||
|
],
|
||||||
|
"summary": "Redirect the user to the URL for the shortlink.",
|
||||||
|
"description": "This endpoint might require authentication by a Zoo user. It gets the shortlink for the user and redirects them to the URL. If the shortlink is owned by an org, the user must be a member of the org.",
|
||||||
|
"operationId": "redirect_user_shortlink",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "path",
|
||||||
|
"name": "key",
|
||||||
|
"description": "The key of the shortlink.",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"302": {
|
||||||
|
"description": "Temporary Redirect",
|
||||||
|
"headers": {
|
||||||
|
"Access-Control-Allow-Credentials": {
|
||||||
|
"description": "Access-Control-Allow-Credentials header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Headers": {
|
||||||
|
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Methods": {
|
||||||
|
"description": "Access-Control-Allow-Methods header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Origin": {
|
||||||
|
"description": "Access-Control-Allow-Origin header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"X-Api-Call-Id": {
|
||||||
|
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"4XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
},
|
||||||
|
"5XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"put": {
|
||||||
|
"tags": [
|
||||||
|
"users",
|
||||||
|
"shortlinks"
|
||||||
|
],
|
||||||
|
"summary": "Update a shortlink for a user.",
|
||||||
|
"description": "This endpoint requires authentication by any Zoo user. It updates a shortlink for the user.\n\nThis endpoint really only allows you to change the `restrict_to_org` setting of a shortlink. Thus it is only useful for folks who are part of an org. If you are not part of an org, you will not be able to change the `restrict_to_org` status.",
|
||||||
|
"operationId": "update_user_shortlink",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "path",
|
||||||
|
"name": "key",
|
||||||
|
"description": "The key of the shortlink.",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/UpdateShortlinkRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"204": {
|
||||||
|
"description": "resource updated",
|
||||||
|
"headers": {
|
||||||
|
"Access-Control-Allow-Credentials": {
|
||||||
|
"description": "Access-Control-Allow-Credentials header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Headers": {
|
||||||
|
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Methods": {
|
||||||
|
"description": "Access-Control-Allow-Methods header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Origin": {
|
||||||
|
"description": "Access-Control-Allow-Origin header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"X-Api-Call-Id": {
|
||||||
|
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"4XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
},
|
||||||
|
"5XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delete": {
|
||||||
|
"tags": [
|
||||||
|
"users",
|
||||||
|
"shortlinks"
|
||||||
|
],
|
||||||
|
"summary": "Delete a shortlink for a user.",
|
||||||
|
"description": "This endpoint requires authentication by any Zoo user. It deletes a shortlink for the user.",
|
||||||
|
"operationId": "delete_user_shortlink",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "path",
|
||||||
|
"name": "key",
|
||||||
|
"description": "The key of the shortlink.",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"204": {
|
||||||
|
"description": "resource updated",
|
||||||
|
"headers": {
|
||||||
|
"Access-Control-Allow-Credentials": {
|
||||||
|
"description": "Access-Control-Allow-Credentials header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Headers": {
|
||||||
|
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Methods": {
|
||||||
|
"description": "Access-Control-Allow-Methods header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Origin": {
|
||||||
|
"description": "Access-Control-Allow-Origin header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"X-Api-Call-Id": {
|
||||||
|
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"4XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
},
|
||||||
|
"5XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"tags": [
|
||||||
|
"hidden"
|
||||||
|
],
|
||||||
|
"summary": "OPTIONS endpoint.",
|
||||||
|
"description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.",
|
||||||
|
"operationId": "options_delete_user_shortlinks",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "path",
|
||||||
|
"name": "key",
|
||||||
|
"description": "The key of the shortlink.",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"204": {
|
||||||
|
"description": "successful operation, no content",
|
||||||
|
"headers": {
|
||||||
|
"Access-Control-Allow-Credentials": {
|
||||||
|
"description": "Access-Control-Allow-Credentials header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Headers": {
|
||||||
|
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Methods": {
|
||||||
|
"description": "Access-Control-Allow-Methods header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Origin": {
|
||||||
|
"description": "Access-Control-Allow-Origin header.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"X-Api-Call-Id": {
|
||||||
|
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
|
||||||
|
"style": "simple",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"4XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
},
|
||||||
|
"5XX": {
|
||||||
|
"$ref": "#/components/responses/Error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/user/text-to-cad": {
|
"/user/text-to-cad": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
@ -16707,6 +17356,44 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"CreateShortlinkRequest": {
|
||||||
|
"description": "Request to create a shortlink.",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"restrict_to_org": {
|
||||||
|
"description": "If the shortlink should be restricted to the user's organization to view. This only applies to org shortlinks. If you are creating a user shortlink and you are not a member of a team or enterprise and you try to set this to true, it will fail.",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"description": "The URL to redirect back to.",
|
||||||
|
"type": "string",
|
||||||
|
"format": "uri"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"restrict_to_org",
|
||||||
|
"url"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"CreateShortlinkResponse": {
|
||||||
|
"description": "Response from creating a shortlink.",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"key": {
|
||||||
|
"description": "The key for this url. This is what you use to update or delete the specific shortlink.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"description": "The shortened url.",
|
||||||
|
"type": "string",
|
||||||
|
"format": "uri"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"key",
|
||||||
|
"url"
|
||||||
|
]
|
||||||
|
},
|
||||||
"CreatedAtSortMode": {
|
"CreatedAtSortMode": {
|
||||||
"description": "Supported set of sort modes for scanning by created_at only.\n\nCurrently, we only support scanning in ascending order.",
|
"description": "Supported set of sort modes for scanning by created_at only.\n\nCurrently, we only support scanning in ascending order.",
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
@ -27972,6 +28659,98 @@
|
|||||||
"description": "The response from the `SetTool` endpoint.",
|
"description": "The response from the `SetTool` endpoint.",
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
"Shortlink": {
|
||||||
|
"description": "A short url.",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"created_at": {
|
||||||
|
"title": "DateTime",
|
||||||
|
"description": "The date and time the shortlink was created.",
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"description": "The unique identifier for the shortlink.",
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/Uuid"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key": {
|
||||||
|
"description": "The key of the shortlink. This is the short part of the URL.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"org_id": {
|
||||||
|
"nullable": true,
|
||||||
|
"description": "The organization ID of the shortlink.",
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/Uuid"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"password_hash": {
|
||||||
|
"nullable": true,
|
||||||
|
"description": "The hash of the password for the shortlink.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"restrict_to_org": {
|
||||||
|
"description": "If the shortlink should be restricted to the organization. This only applies to org shortlinks. If you are creating a user shortlink and you are not a member of a team or enterprise and you try to set this to true, it will fail.",
|
||||||
|
"default": false,
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"updated_at": {
|
||||||
|
"title": "DateTime",
|
||||||
|
"description": "The date and time the shortlink was last updated.",
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"user_id": {
|
||||||
|
"description": "The ID of the user that made the shortlink.",
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/Uuid"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"title": "String",
|
||||||
|
"description": "The URL the shortlink redirects to.",
|
||||||
|
"type": "string",
|
||||||
|
"format": "uri"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"created_at",
|
||||||
|
"id",
|
||||||
|
"key",
|
||||||
|
"updated_at",
|
||||||
|
"user_id",
|
||||||
|
"value"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ShortlinkResultsPage": {
|
||||||
|
"description": "A single page of results",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"items": {
|
||||||
|
"description": "list of items on this page of results",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/Shortlink"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"next_page": {
|
||||||
|
"nullable": true,
|
||||||
|
"description": "token used to fetch the next page of results (if any)",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"items"
|
||||||
|
]
|
||||||
|
},
|
||||||
"SketchModeDisable": {
|
"SketchModeDisable": {
|
||||||
"description": "The response from the `SketchModeDisable` endpoint.",
|
"description": "The response from the `SketchModeDisable` endpoint.",
|
||||||
"type": "object"
|
"type": "object"
|
||||||
@ -30795,6 +31574,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"UpdateShortlinkRequest": {
|
||||||
|
"description": "Request to update a shortlink.",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"restrict_to_org": {
|
||||||
|
"description": "If the shortlink should be restricted to the user's organization to view. This only applies to org shortlinks. If you are creating a user shortlink and you are not a member of a team or enterprise and you try to set this to true, it will fail.",
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"restrict_to_org"
|
||||||
|
]
|
||||||
|
},
|
||||||
"UpdateUser": {
|
"UpdateUser": {
|
||||||
"description": "The user-modifiable parts of a User.",
|
"description": "The user-modifiable parts of a User.",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@ -31668,6 +32460,13 @@
|
|||||||
"url": "https://zoo.dev/docs/api/service-accounts"
|
"url": "https://zoo.dev/docs/api/service-accounts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "shortlinks",
|
||||||
|
"description": "Shortlinks are a way to create a short URL that redirects to a longer URL. This is useful for sharing links that are long and unwieldy.",
|
||||||
|
"externalDocs": {
|
||||||
|
"url": "https://zoo.dev/docs/api/shortlinks"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "store",
|
"name": "store",
|
||||||
"description": "Operations involving our swag store.",
|
"description": "Operations involving our swag store.",
|
||||||
|
Reference in New Issue
Block a user