Skip to content

Commit

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

* updates

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

---------

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 authored Sep 10, 2024
1 parent d9bbd93 commit d14df02
Show file tree
Hide file tree
Showing 7 changed files with 574 additions and 435 deletions.
22 changes: 11 additions & 11 deletions examples_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/perimeterx/marshmallow v1.1.4 // indirect
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/sys v0.25.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
12 changes: 6 additions & 6 deletions kittycad.go.patch.json
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
},
{
"value": {
"example": "// TokenRevoke: Revoke an OAuth2 token.\n// \n// This endpoint is designed to be accessed from an *unauthenticated* API client.\n// \n// \n// Parameters\n// \n// \t- `body`: The request parameters for the OAuth 2.0 token revocation flow.\n// \n// TokenRevoke: Revoke an OAuth2 token.\n// This endpoint is designed to be accessed from an *unauthenticated* API client.\n//\n// Parameters\n//\n// - `body`: The request parameters for the OAuth 2.0 token revocation flow.\nfunc ExampleOauth2Service_TokenRevoke() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := client.Oauth2.TokenRevoke(kittycad.TokenRevokeRequestForm{ClientID: kittycad.ParseUUID(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"), ClientSecret: \"some-string\", Token: kittycad.ParseUUID(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\")}); err != nil {\n\t\tpanic(err)\n\t}\n\n}\n",
"example": "// TokenRevoke: Revoke an OAuth2 token.\n// \n// This endpoint is designed to be accessed from an *unauthenticated* API client.\n// \n// \n// Parameters\n// \n// \t- `body`: The request parameters for the OAuth 2.0 token revocation flow.\n// \n// TokenRevoke: Revoke an OAuth2 token.\n// This endpoint is designed to be accessed from an *unauthenticated* API client.\n//\n// Parameters\n//\n// - `body`: The request parameters for the OAuth 2.0 token revocation flow.\nfunc ExampleOauth2Service_TokenRevoke() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := client.Oauth2.TokenRevoke(kittycad.TokenRevokeRequestForm{ClientID: kittycad.ParseUUID(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"), ClientSecret: \"some-string\", Token: \"some-string\"}); err != nil {\n\t\tpanic(err)\n\t}\n\n}\n",
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#Oauth2Service.TokenRevoke"
},
"op": "add",
Expand Down Expand Up @@ -577,15 +577,15 @@
},
{
"value": {
"example": "// DeleteForOrg: Delete an service account for your org.\n// \n// This endpoint requires authentication by an org admin. It deletes the requested service account for the organization.\n// This endpoint does not actually delete the service account from the database. It merely marks the token as invalid. We still want to keep the service account in the database for historical purposes.\n// \n// \n// Parameters\n// \n// \t- `token`\n// \n// DeleteForOrg: Delete an service account for your org.\n// This endpoint requires authentication by an org admin. It deletes the requested service account for the organization.\n// This endpoint does not actually delete the service account from the database. It merely marks the token as invalid. We still want to keep the service account in the database for historical purposes.\n//\n// Parameters\n//\n// - `token`\nfunc ExampleServiceAccountService_DeleteForOrg() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := client.ServiceAccount.DeleteForOrg(kittycad.ParseUUID(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\")); err != nil {\n\t\tpanic(err)\n\t}\n\n}\n",
"example": "// DeleteForOrg: Delete an service account for your org.\n// \n// This endpoint requires authentication by an org admin. It deletes the requested service account for the organization.\n// This endpoint does not actually delete the service account from the database. It merely marks the token as invalid. We still want to keep the service account in the database for historical purposes.\n// \n// \n// Parameters\n// \n// \t- `token`: An auth token. A uuid with a prefix of svc-\n// \n// DeleteForOrg: Delete an service account for your org.\n// This endpoint requires authentication by an org admin. It deletes the requested service account for the organization.\n// This endpoint does not actually delete the service account from the database. It merely marks the token as invalid. We still want to keep the service account in the database for historical purposes.\n//\n// Parameters\n//\n// - `token`: An auth token. A uuid with a prefix of svc-\nfunc ExampleServiceAccountService_DeleteForOrg() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := client.ServiceAccount.DeleteForOrg(\"some-string\"); err != nil {\n\t\tpanic(err)\n\t}\n\n}\n",
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#ServiceAccountService.DeleteForOrg"
},
"op": "add",
"path": "/paths/~1org~1service-accounts~1{token}/delete/x-go"
},
{
"value": {
"example": "// GetForOrg: Get an service account for your org.\n// \n// This endpoint requires authentication by an org admin. It returns details of the requested service account for the organization.\n// \n// \n// Parameters\n// \n// \t- `token`\n// \n// GetForOrg: Get an service account for your org.\n// This endpoint requires authentication by an org admin. It returns details of the requested service account for the organization.\n//\n// Parameters\n//\n// - `token`\nfunc ExampleServiceAccountService_GetForOrg() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.ServiceAccount.GetForOrg(kittycad.ParseUUID(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
"example": "// GetForOrg: Get an service account for your org.\n// \n// This endpoint requires authentication by an org admin. It returns details of the requested service account for the organization.\n// \n// \n// Parameters\n// \n// \t- `token`: An auth token. A uuid with a prefix of svc-\n// \n// GetForOrg: Get an service account for your org.\n// This endpoint requires authentication by an org admin. It returns details of the requested service account for the organization.\n//\n// Parameters\n//\n// - `token`: An auth token. A uuid with a prefix of svc-\nfunc ExampleServiceAccountService_GetForOrg() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.ServiceAccount.GetForOrg(\"some-string\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#ServiceAccountService.GetForOrg"
},
"op": "add",
Expand Down Expand Up @@ -817,15 +817,15 @@
},
{
"value": {
"example": "// DeleteForUser: Delete an API token for your user.\n// \n// This endpoint requires authentication by any Zoo user. It deletes the requested API token for the user.\n// This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.\n// \n// \n// Parameters\n// \n// \t- `token`\n// \n// DeleteForUser: Delete an API token for your user.\n// This endpoint requires authentication by any Zoo user. It deletes the requested API token for the user.\n// This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.\n//\n// Parameters\n//\n// - `token`\nfunc ExampleAPITokenService_DeleteForUser() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := client.APIToken.DeleteForUser(kittycad.ParseUUID(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\")); err != nil {\n\t\tpanic(err)\n\t}\n\n}\n",
"example": "// DeleteForUser: Delete an API token for your user.\n// \n// This endpoint requires authentication by any Zoo user. It deletes the requested API token for the user.\n// This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.\n// \n// \n// Parameters\n// \n// \t- `token`: An auth token. A uuid with a prefix of api-\n// \n// DeleteForUser: Delete an API token for your user.\n// This endpoint requires authentication by any Zoo user. It deletes the requested API token for the user.\n// This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.\n//\n// Parameters\n//\n// - `token`: An auth token. A uuid with a prefix of api-\nfunc ExampleAPITokenService_DeleteForUser() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := client.APIToken.DeleteForUser(\"some-string\"); err != nil {\n\t\tpanic(err)\n\t}\n\n}\n",
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.DeleteForUser"
},
"op": "add",
"path": "/paths/~1user~1api-tokens~1{token}/delete/x-go"
},
{
"value": {
"example": "// GetForUser: Get an API token for your user.\n// \n// This endpoint requires authentication by any Zoo user. It returns details of the requested API token for the user.\n// \n// \n// Parameters\n// \n// \t- `token`\n// \n// GetForUser: Get an API token for your user.\n// This endpoint requires authentication by any Zoo user. It returns details of the requested API token for the user.\n//\n// Parameters\n//\n// - `token`\nfunc ExampleAPITokenService_GetForUser() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.APIToken.GetForUser(kittycad.ParseUUID(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
"example": "// GetForUser: Get an API token for your user.\n// \n// This endpoint requires authentication by any Zoo user. It returns details of the requested API token for the user.\n// \n// \n// Parameters\n// \n// \t- `token`: An auth token. A uuid with a prefix of api-\n// \n// GetForUser: Get an API token for your user.\n// This endpoint requires authentication by any Zoo user. It returns details of the requested API token for the user.\n//\n// Parameters\n//\n// - `token`: An auth token. A uuid with a prefix of api-\nfunc ExampleAPITokenService_GetForUser() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.APIToken.GetForUser(\"some-string\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.GetForUser"
},
"op": "add",
Expand Down Expand Up @@ -985,7 +985,7 @@
},
{
"value": {
"example": "// GetSessionFor: Get a session for your user.\n// \n// This endpoint requires authentication by any Zoo user. It returns details of the requested API token for the user.\n// \n// \n// Parameters\n// \n// \t- `token`\n// \n// GetSessionFor: Get a session for your user.\n// This endpoint requires authentication by any Zoo user. It returns details of the requested API token for the user.\n//\n// Parameters\n//\n// - `token`\nfunc ExampleUserService_GetSessionFor() {\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.GetSessionFor(kittycad.ParseUUID(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
"example": "// GetSessionFor: Get a session for your user.\n// \n// This endpoint requires authentication by any Zoo user. It returns details of the requested API token for the user.\n// \n// \n// Parameters\n// \n// \t- `token`: An auth token. A uuid with a prefix of ses-\n// \n// GetSessionFor: Get a session for your user.\n// This endpoint requires authentication by any Zoo user. It returns details of the requested API token for the user.\n//\n// Parameters\n//\n// - `token`: An auth token. A uuid with a prefix of ses-\nfunc ExampleUserService_GetSessionFor() {\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.GetSessionFor(\"some-string\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.GetSessionFor"
},
"op": "add",
Expand Down
Loading

0 comments on commit d14df02

Please sign in to comment.