Skip to content

Commit 1b983d7

Browse files
Update api spec (#108)
* 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 2c2a044 commit 1b983d7

File tree

7 files changed

+16757
-15990
lines changed

7 files changed

+16757
-15990
lines changed

examples_test.go

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

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ require (
2323
github.com/perimeterx/marshmallow v1.1.4 // indirect
2424
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
2525
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 // indirect
26-
golang.org/x/sys v0.12.0 // indirect
26+
golang.org/x/sys v0.13.0 // indirect
2727
gopkg.in/yaml.v2 v2.4.0 // indirect
2828
gopkg.in/yaml.v3 v3.0.1 // indirect
2929
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
7575
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7676
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7777
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
78-
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
79-
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
78+
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
79+
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8080
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
8181
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
8282
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

kittycad.go.patch.json

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,11 @@
3333
},
3434
{
3535
"value": {
36-
"example": "// CreateImageTo3D: Generate a 3D model from an image.\n// \n// This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.\n// \n// \n// Parameters\n// \n// \t- `inputFormat`: An enumeration.\n// \t- `outputFormat`: The valid types of output file formats.\n// \t- `body`\n// \n// CreateImageTo3D: Generate a 3D model from an image.\n// This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.\n//\n// Parameters\n//\n// - `inputFormat`: An enumeration.\n// - `outputFormat`: The valid types of output file formats.\n// - `body`\nfunc ExampleAiService_CreateImageTo3D() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.Ai.CreateImageTo3D(kittycad.ImageTypePng, \"\", []byte(\"some-binary\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
37-
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#AiService.CreateImageTo3D"
36+
"example": "// CreateTextToCad: Generate a CAD model from text.\n// \n// This operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\n// This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.\n// \n// \n// Parameters\n// \n// \t- `outputFormat`: The valid types of output file formats.\n// \t- `body`: Body for generating models from text.\n// \n// CreateTextToCad: Generate a CAD model from text.\n// This operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\n// This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.\n//\n// Parameters\n//\n// - `outputFormat`: The valid types of output file formats.\n// - `body`: Body for generating models from text.\nfunc ExampleAiService_CreateTextToCad() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.Ai.CreateTextToCad(\"\", kittycad.TextToCadCreateBody{Prompt: \"some-string\"})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
37+
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#AiService.CreateTextToCad"
3838
},
3939
"op": "add",
40-
"path": "/paths/~1ai~1image-to-3d~1{input_format}~1{output_format}/post/x-go"
41-
},
42-
{
43-
"value": {
44-
"example": "// CreateTextTo3D: Generate a 3D model from text.\n// \n// This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.\n// \n// \n// Parameters\n// \n// \t- `outputFormat`: The valid types of output file formats.\n// \t- `prompt`\n// \n// CreateTextTo3D: Generate a 3D model from text.\n// This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.\n//\n// Parameters\n//\n// - `outputFormat`: The valid types of output file formats.\n// - `prompt`\nfunc ExampleAiService_CreateTextTo3D() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.Ai.CreateTextTo3D(\"\", \"some-string\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
45-
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#AiService.CreateTextTo3D"
46-
},
47-
"op": "add",
48-
"path": "/paths/~1ai~1text-to-3d~1{output_format}/post/x-go"
40+
"path": "/paths/~1ai~1text-to-cad~1{output_format}/post/x-go"
4941
},
5042
{
5143
"value": {
@@ -543,6 +535,22 @@
543535
"op": "add",
544536
"path": "/paths/~1user~1session~1{token}/get/x-go"
545537
},
538+
{
539+
"value": {
540+
"example": "// ListTextToCadModelsForUser: List text-to-CAD models you've generated.\n// \n// This endpoint requires authentication by any KittyCAD user. It returns the text-to-CAD models for the authenticated user.\n// The text-to-CAD models are returned in order of creation, with the most recently created text-to-CAD models first.\n// \n// \n// Parameters\n// \n// \t- `limit`\n// \t- `pageToken`\n// \t- `sortBy`: Supported set of sort modes for scanning by created_at only.\n// \t\t\n// \t\tCurrently, we only support scanning in ascending order.\n// \n// ListTextToCadModelsForUser: List text-to-CAD models you've generated.\n// This endpoint requires authentication by any KittyCAD user. It returns the text-to-CAD models for the authenticated user.\n// The text-to-CAD models are returned in order of creation, with the most recently created text-to-CAD models first.\n//\n// Parameters\n//\n// - `limit`\n//\n// - `pageToken`\n//\n// - `sortBy`: Supported set of sort modes for scanning by created_at only.\n//\n// Currently, we only support scanning in ascending order.\nfunc ExampleAiService_ListTextToCadModelsForUser() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.Ai.ListTextToCadModelsForUser(123, \"some-string\", \"\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
541+
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#AiService.ListTextToCadModelsForUser"
542+
},
543+
"op": "add",
544+
"path": "/paths/~1user~1text-to-cad/get/x-go"
545+
},
546+
{
547+
"value": {
548+
"example": "// CreateTextToCadModelFeedback: Give feedback to a specific text-to-CAD response.\n// \n// This endpoint requires authentication by any KittyCAD user. The user must be the owner of the text-to-CAD model, in order to give feedback.\n// \n// \n// Parameters\n// \n// \t- `id`\n// \t- `feedback`: Human feedback on an AI response.\n// \n// CreateTextToCadModelFeedback: Give feedback to a specific text-to-CAD response.\n// This endpoint requires authentication by any KittyCAD user. The user must be the owner of the text-to-CAD model, in order to give feedback.\n//\n// Parameters\n//\n// - `id`\n// - `feedback`: Human feedback on an AI response.\nfunc ExampleAiService_CreateTextToCadModelFeedback() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := client.Ai.CreateTextToCadModelFeedback(kittycad.ParseUUID(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"), \"\"); err != nil {\n\t\tpanic(err)\n\t}\n\n}\n",
549+
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#AiService.CreateTextToCadModelFeedback"
550+
},
551+
"op": "add",
552+
"path": "/paths/~1user~1text-to-cad~1{id}/post/x-go"
553+
},
546554
{
547555
"value": {
548556
"example": "// List: List users.\n// \n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n// \n// \n// Parameters\n// \n// \t- `limit`\n// \t- `pageToken`\n// \t- `sortBy`: Supported set of sort modes for scanning by created_at only.\n// \t\t\n// \t\tCurrently, we only support scanning in ascending order.\n// \n// List: List users.\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// Parameters\n//\n// - `limit`\n//\n// - `pageToken`\n//\n// - `sortBy`: Supported set of sort modes for scanning by created_at only.\n//\n// Currently, we only support scanning in ascending order.\nfunc ExampleUserService_List() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.User.List(123, \"some-string\", \"\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
@@ -593,7 +601,7 @@
593601
},
594602
{
595603
"value": {
596-
"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- `unlockedFramerate`\n// \t- `videoResHeight`\n// \t- `videoResWidth`\n// \t- `webrtc`\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// - `unlockedFramerate`\n// - `videoResHeight`\n// - `videoResWidth`\n// - `webrtc`\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, 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",
604+
"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- `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// - `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, 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",
597605
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#ModelingService.CommandsWs"
598606
},
599607
"op": "add",

0 commit comments

Comments
 (0)