Skip to content

Commit

Permalink
Update api spec (#233)
Browse files Browse the repository at this point in the history
* YOYO NEW API SPEC!

* fix

Signed-off-by: Jess Frazelle <[email protected]>

* I have generated the latest API!

---------

Signed-off-by: Jess Frazelle <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <[email protected]>
  • Loading branch information
3 people committed Jul 4, 2024
1 parent a008a9d commit 24171ee
Show file tree
Hide file tree
Showing 6 changed files with 403 additions and 377 deletions.
752 changes: 376 additions & 376 deletions kittycad.py.patch.json

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions kittycad/api/modeling/modeling_commands_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
def _get_kwargs(
fps: int,
post_effect: PostEffectType,
show_grid: bool,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
Expand Down Expand Up @@ -45,6 +46,13 @@ def _get_kwargs(
else:
url = url + "?post_effect=" + str(post_effect)

if show_grid is not None:

if "?" in url:
url = url + "&show_grid=" + str(show_grid).lower()
else:
url = url + "?show_grid=" + str(show_grid).lower()

if unlocked_framerate is not None:

if "?" in url:
Expand Down Expand Up @@ -87,6 +95,7 @@ def _get_kwargs(
def sync(
fps: int,
post_effect: PostEffectType,
show_grid: bool,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
Expand All @@ -101,6 +110,7 @@ def sync(
fps=fps,
pool=pool,
post_effect=post_effect,
show_grid=show_grid,
unlocked_framerate=unlocked_framerate,
video_res_height=video_res_height,
video_res_width=video_res_width,
Expand All @@ -114,6 +124,7 @@ def sync(
async def asyncio(
fps: int,
post_effect: PostEffectType,
show_grid: bool,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
Expand All @@ -128,6 +139,7 @@ async def asyncio(
fps=fps,
pool=pool,
post_effect=post_effect,
show_grid=show_grid,
unlocked_framerate=unlocked_framerate,
video_res_height=video_res_height,
video_res_width=video_res_width,
Expand All @@ -152,6 +164,7 @@ def __init__(
self,
fps: int,
post_effect: PostEffectType,
show_grid: bool,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
Expand All @@ -162,6 +175,7 @@ def __init__(
self.ws = sync(
fps,
post_effect,
show_grid,
unlocked_framerate,
video_res_height,
video_res_width,
Expand Down
2 changes: 2 additions & 0 deletions kittycad/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ def test_ws_simple():
with modeling_commands_ws.WebSocket(
client=client,
fps=30,
show_grid=False,
post_effect=PostEffectType.NOEFFECT,
unlocked_framerate=False,
video_res_height=360,
Expand Down Expand Up @@ -386,6 +387,7 @@ def test_ws_import():
client=client,
fps=30,
post_effect=PostEffectType.NOEFFECT,
show_grid=False,
unlocked_framerate=False,
video_res_height=360,
video_res_width=480,
Expand Down
2 changes: 2 additions & 0 deletions kittycad/examples_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6808,6 +6808,7 @@ def test_modeling_commands_ws():
client=client,
fps=10,
post_effect=PostEffectType.PHOSPHOR,
show_grid=False,
unlocked_framerate=False,
video_res_height=10,
video_res_width=10,
Expand Down Expand Up @@ -6844,6 +6845,7 @@ async def test_modeling_commands_ws_async():
client=client,
fps=10,
post_effect=PostEffectType.PHOSPHOR,
show_grid=False,
unlocked_framerate=False,
video_res_height=10,
video_res_width=10,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "kittycad"
version = "0.6.15"
version = "0.6.16"
description = "A client library for accessing KittyCAD"

authors = []
Expand Down
8 changes: 8 additions & 0 deletions spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -12350,6 +12350,14 @@
"$ref": "#/components/schemas/PostEffectType"
}
},
{
"in": "query",
"name": "show_grid",
"description": "If true, will show the grid at the start of the session.",
"schema": {
"type": "boolean"
}
},
{
"in": "query",
"name": "unlocked_framerate",
Expand Down

0 comments on commit 24171ee

Please sign in to comment.