Skip to content

Commit ac91ee9

Browse files
Update api spec (#200)
* YOYO NEW API SPEC! * I have generated the latest API! --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 1ab00bc commit ac91ee9

File tree

5 files changed

+84
-25
lines changed

5 files changed

+84
-25
lines changed

examples_test.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kittycad.go.patch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@
11531153
},
11541154
{
11551155
"value": {
1156-
"example": "// CommandsWs: Open a websocket which accepts modeling commands.\n// \n// Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.\n// \n// \n// Parameters\n// \n// \t- `fps`\n// \t- `pool`\n// \t- `postEffect`: Post effect type\n// \t- `replay`\n// \t- `showGrid`\n// \t- `unlockedFramerate`\n// \t- `videoResHeight`\n// \t- `videoResWidth`\n// \t- `webrtc`\n// \t- `body`: The websocket messages the server receives.\n// \n// CommandsWs: Open a websocket which accepts modeling commands.\n// Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.\n//\n// Parameters\n//\n// - `fps`\n// - `pool`\n// - `postEffect`: Post effect type\n// - `replay`\n// - `showGrid`\n// - `unlockedFramerate`\n// - `videoResHeight`\n// - `videoResWidth`\n// - `webrtc`\n// - `body`: The websocket messages the server receives.\nfunc ExampleModelingService_CommandsWs() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Create the websocket connection.\n\tws, err := client.Modeling.CommandsWs(123, \"some-string\", kittycad.PostEffectTypePhosphor, \"some-string\", true, true, 123, 123, true, \"\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer ws.Close()\n\n\tdone := make(chan struct{})\n\n\tgo func() {\n\t\tdefer close(done)\n\t\tfor {\n\t\t\t_, message, err := ws.ReadMessage()\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"read:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlog.Printf(\"recv: %s\", message)\n\t\t}\n\t}()\n\n\tticker := time.NewTicker(time.Second)\n\tdefer ticker.Stop()\n\n\tinterrupt := make(chan os.Signal, 1)\n\tsignal.Notify(interrupt, os.Interrupt)\n\n\tfor {\n\t\tselect {\n\t\tcase \u003c-done:\n\t\t\treturn\n\t\tcase t := \u003c-ticker.C:\n\t\t\terr := ws.WriteMessage(websocket.TextMessage, []byte(t.String()))\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"write:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\tcase \u003c-interrupt:\n\t\t\tlog.Println(\"interrupt\")\n\n\t\t\t// Cleanly close the connection by sending a close message and then\n\t\t\t// waiting (with timeout) for the server to close the connection.\n\t\t\terr := ws.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, \"\"))\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"write close:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tselect {\n\t\t\tcase \u003c-done:\n\t\t\tcase \u003c-time.After(time.Second):\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\n}\n",
1156+
"example": "// CommandsWs: Open a websocket which accepts modeling commands.\n// \n// Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.\n// \n// \n// Parameters\n// \n// \t- `apicallId`\n// \t- `fps`\n// \t- `pool`\n// \t- `postEffect`: Post effect type\n// \t- `replay`\n// \t- `showGrid`\n// \t- `unlockedFramerate`\n// \t- `videoResHeight`\n// \t- `videoResWidth`\n// \t- `webrtc`\n// \t- `body`: The websocket messages the server receives.\n// \n// CommandsWs: Open a websocket which accepts modeling commands.\n// Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.\n//\n// Parameters\n//\n// - `apicallId`\n// - `fps`\n// - `pool`\n// - `postEffect`: Post effect type\n// - `replay`\n// - `showGrid`\n// - `unlockedFramerate`\n// - `videoResHeight`\n// - `videoResWidth`\n// - `webrtc`\n// - `body`: The websocket messages the server receives.\nfunc ExampleModelingService_CommandsWs() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Create the websocket connection.\n\tws, err := client.Modeling.CommandsWs(\"some-string\", 123, \"some-string\", kittycad.PostEffectTypePhosphor, \"some-string\", true, true, 123, 123, true, \"\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer ws.Close()\n\n\tdone := make(chan struct{})\n\n\tgo func() {\n\t\tdefer close(done)\n\t\tfor {\n\t\t\t_, message, err := ws.ReadMessage()\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"read:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlog.Printf(\"recv: %s\", message)\n\t\t}\n\t}()\n\n\tticker := time.NewTicker(time.Second)\n\tdefer ticker.Stop()\n\n\tinterrupt := make(chan os.Signal, 1)\n\tsignal.Notify(interrupt, os.Interrupt)\n\n\tfor {\n\t\tselect {\n\t\tcase \u003c-done:\n\t\t\treturn\n\t\tcase t := \u003c-ticker.C:\n\t\t\terr := ws.WriteMessage(websocket.TextMessage, []byte(t.String()))\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"write:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\tcase \u003c-interrupt:\n\t\t\tlog.Println(\"interrupt\")\n\n\t\t\t// Cleanly close the connection by sending a close message and then\n\t\t\t// waiting (with timeout) for the server to close the connection.\n\t\t\terr := ws.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, \"\"))\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"write close:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tselect {\n\t\t\tcase \u003c-done:\n\t\t\tcase \u003c-time.After(time.Second):\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\n}\n",
11571157
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#ModelingService.CommandsWs"
11581158
},
11591159
"op": "add",

paths.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec.json

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16427,6 +16427,15 @@
1642716427
"description": "Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.",
1642816428
"operationId": "modeling_commands_ws",
1642916429
"parameters": [
16430+
{
16431+
"in": "query",
16432+
"name": "api_call_id",
16433+
"description": "API Call ID for distributed tracing",
16434+
"schema": {
16435+
"nullable": true,
16436+
"type": "string"
16437+
}
16438+
},
1643016439
{
1643116440
"in": "query",
1643216441
"name": "fps",
@@ -18646,10 +18655,7 @@
1864618655
"format": "uuid"
1864718656
}
1864818657
}
18649-
},
18650-
"required": [
18651-
"extra_solid_ids"
18652-
]
18658+
}
1865318659
},
1865418660
"BooleanSubtract": {
1865518661
"description": "The response from the 'BooleanSubtract'.",
@@ -18663,10 +18669,7 @@
1866318669
"format": "uuid"
1866418670
}
1866518671
}
18666-
},
18667-
"required": [
18668-
"extra_solid_ids"
18669-
]
18672+
}
1867018673
},
1867118674
"BooleanUnion": {
1867218675
"description": "The response from the 'BooleanUnion'.",
@@ -18680,10 +18683,7 @@
1868018683
"format": "uuid"
1868118684
}
1868218685
}
18683-
},
18684-
"required": [
18685-
"extra_solid_ids"
18686-
]
18686+
}
1868718687
},
1868818688
"CacheMetadata": {
1868918689
"description": "Metadata about our cache.\n\nThis is mostly used for internal purposes and debugging.",
@@ -19209,7 +19209,7 @@
1920919209
]
1921019210
},
1921119211
"ComponentTransform": {
19212-
"description": "Container that holds a translate, rotate and scale.",
19212+
"description": "Container that holds a translate, rotate and scale. Defaults to no change, everything stays the same (i.e. the identity function).",
1921319213
"type": "object",
1921419214
"properties": {
1921519215
"rotate_angle_axis": {
@@ -30525,6 +30525,34 @@
3052530525
"data",
3052630526
"type"
3052730527
]
30528+
},
30529+
{
30530+
"description": "Information about the connected instance",
30531+
"type": "object",
30532+
"properties": {
30533+
"data": {
30534+
"type": "object",
30535+
"properties": {
30536+
"name": {
30537+
"description": "Instance name. This may or may not mean something.",
30538+
"type": "string"
30539+
}
30540+
},
30541+
"required": [
30542+
"name"
30543+
]
30544+
},
30545+
"type": {
30546+
"type": "string",
30547+
"enum": [
30548+
"debug"
30549+
]
30550+
}
30551+
},
30552+
"required": [
30553+
"data",
30554+
"type"
30555+
]
3052830556
}
3052930557
]
3053030558
},
@@ -36313,6 +36341,21 @@
3631336341
"type"
3631436342
]
3631536343
},
36344+
{
36345+
"description": "Return information about the connected instance",
36346+
"type": "object",
36347+
"properties": {
36348+
"type": {
36349+
"type": "string",
36350+
"enum": [
36351+
"debug"
36352+
]
36353+
}
36354+
},
36355+
"required": [
36356+
"type"
36357+
]
36358+
},
3631636359
{
3631736360
"description": "Authentication header request.",
3631836361
"type": "object",

types.go

Lines changed: 23 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)