Skip to content

Commit 884085a

Browse files
Update api spec (#219)
* 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 ee10d0b commit 884085a

File tree

5 files changed

+273
-0
lines changed

5 files changed

+273
-0
lines changed

examples_test.go

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

kittycad.go.patch.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@
159159
"op": "add",
160160
"path": "/paths/~1file~1center-of-mass/post/x-go"
161161
},
162+
{
163+
"value": {
164+
"example": "// CreateConversionOptions: Convert CAD file from one format to another.\n// \n// This takes a HTTP multipart body with these fields in this order: 1. The input format, with options (as JSON) 2. The output format, with options (as JSON) 3. The main file, in raw binary (in whatever format you specified in field (1) i.e. input format) 4. Any additional files\n// \n// This starts a conversion job and returns the `id` of the operation. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\n// \n// \n// Parameters\n// \n// \t- `body`: Describes the file to convert (src) and what it should be converted into (output).\n// \n// CreateConversionOptions: Convert CAD file from one format to another.\n// This takes a HTTP multipart body with these fields in this order: 1. The input format, with options (as JSON) 2. The output format, with options (as JSON) 3. The main file, in raw binary (in whatever format you specified in field (1) i.e. input format) 4. Any additional files\n//\n// This starts a conversion job and returns the `id` of the operation. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\n//\n// Parameters\n//\n// - `body`: Describes the file to convert (src) and what it should be converted into (output).\nfunc ExampleFileService_CreateConversionOptions() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tbuf := new(bytes.Buffer)\n\n\tresult, err := client.File.CreateConversionOptions(buf)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
165+
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateConversionOptions"
166+
},
167+
"op": "add",
168+
"path": "/paths/~1file~1conversion/post/x-go"
169+
},
162170
{
163171
"value": {
164172
"example": "// CreateConversion: Convert CAD file with defaults.\n// \n// If you wish to specify the conversion options, use the `/file/conversion` endpoint instead.\n// \n// Convert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously.\n// \n// If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\n// \n// If the 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// \n// \n// Parameters\n// \n// \t- `outputFormat`: The valid types of output file formats.\n// \t- `srcFormat`: The valid types of source file formats.\n// \t- `body`\n// \n// CreateConversion: Convert CAD file with defaults.\n// If you wish to specify the conversion options, use the `/file/conversion` endpoint instead.\n//\n// Convert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously.\n//\n// If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\n//\n// If the 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//\n// Parameters\n//\n// - `outputFormat`: The valid types of output file formats.\n// - `srcFormat`: The valid types of source file formats.\n// - `body`\nfunc ExampleFileService_CreateConversion() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.File.CreateConversion(\"\", \"\", []byte(\"some-binary\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",

paths.go

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

spec.json

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,6 +2270,164 @@
22702270
}
22712271
}
22722272
},
2273+
"/file/conversion": {
2274+
"post": {
2275+
"tags": [
2276+
"file"
2277+
],
2278+
"summary": "Convert CAD file from one format to another.",
2279+
"description": "This takes a HTTP multipart body with these fields in this order: 1. The input format, with options (as JSON) 2. The output format, with options (as JSON) 3. The main file, in raw binary (in whatever format you specified in field (1) i.e. input format) 4. Any additional files\n\nThis starts a conversion job and returns the `id` of the operation. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.",
2280+
"operationId": "create_file_conversion_options",
2281+
"requestBody": {
2282+
"description": "Convert files to other formats",
2283+
"content": {
2284+
"multipart/form-data": {
2285+
"schema": {
2286+
"$ref": "#/components/schemas/ConversionParams"
2287+
}
2288+
}
2289+
},
2290+
"required": true
2291+
},
2292+
"responses": {
2293+
"201": {
2294+
"description": "successful creation",
2295+
"headers": {
2296+
"Access-Control-Allow-Credentials": {
2297+
"description": "Access-Control-Allow-Credentials header.",
2298+
"style": "simple",
2299+
"schema": {
2300+
"nullable": true,
2301+
"type": "string"
2302+
}
2303+
},
2304+
"Access-Control-Allow-Headers": {
2305+
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
2306+
"style": "simple",
2307+
"schema": {
2308+
"nullable": true,
2309+
"type": "string"
2310+
}
2311+
},
2312+
"Access-Control-Allow-Methods": {
2313+
"description": "Access-Control-Allow-Methods header.",
2314+
"style": "simple",
2315+
"schema": {
2316+
"nullable": true,
2317+
"type": "string"
2318+
}
2319+
},
2320+
"Access-Control-Allow-Origin": {
2321+
"description": "Access-Control-Allow-Origin header.",
2322+
"style": "simple",
2323+
"schema": {
2324+
"nullable": true,
2325+
"type": "string"
2326+
}
2327+
},
2328+
"Set-Cookie": {
2329+
"description": "Set-Cookie header.",
2330+
"style": "simple",
2331+
"schema": {
2332+
"nullable": true,
2333+
"type": "string"
2334+
}
2335+
},
2336+
"X-Api-Call-Id": {
2337+
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
2338+
"style": "simple",
2339+
"required": true,
2340+
"schema": {
2341+
"type": "string"
2342+
}
2343+
}
2344+
},
2345+
"content": {
2346+
"application/json": {
2347+
"schema": {
2348+
"$ref": "#/components/schemas/FileConversion"
2349+
}
2350+
}
2351+
}
2352+
},
2353+
"4XX": {
2354+
"$ref": "#/components/responses/Error"
2355+
},
2356+
"5XX": {
2357+
"$ref": "#/components/responses/Error"
2358+
}
2359+
}
2360+
},
2361+
"options": {
2362+
"tags": [
2363+
"hidden"
2364+
],
2365+
"summary": "OPTIONS endpoint.",
2366+
"description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.",
2367+
"operationId": "options_file_conversion_options",
2368+
"responses": {
2369+
"204": {
2370+
"description": "resource updated",
2371+
"headers": {
2372+
"Access-Control-Allow-Credentials": {
2373+
"description": "Access-Control-Allow-Credentials header.",
2374+
"style": "simple",
2375+
"schema": {
2376+
"nullable": true,
2377+
"type": "string"
2378+
}
2379+
},
2380+
"Access-Control-Allow-Headers": {
2381+
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
2382+
"style": "simple",
2383+
"schema": {
2384+
"nullable": true,
2385+
"type": "string"
2386+
}
2387+
},
2388+
"Access-Control-Allow-Methods": {
2389+
"description": "Access-Control-Allow-Methods header.",
2390+
"style": "simple",
2391+
"schema": {
2392+
"nullable": true,
2393+
"type": "string"
2394+
}
2395+
},
2396+
"Access-Control-Allow-Origin": {
2397+
"description": "Access-Control-Allow-Origin header.",
2398+
"style": "simple",
2399+
"schema": {
2400+
"nullable": true,
2401+
"type": "string"
2402+
}
2403+
},
2404+
"Set-Cookie": {
2405+
"description": "Set-Cookie header.",
2406+
"style": "simple",
2407+
"schema": {
2408+
"nullable": true,
2409+
"type": "string"
2410+
}
2411+
},
2412+
"X-Api-Call-Id": {
2413+
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
2414+
"style": "simple",
2415+
"required": true,
2416+
"schema": {
2417+
"type": "string"
2418+
}
2419+
}
2420+
}
2421+
},
2422+
"4XX": {
2423+
"$ref": "#/components/responses/Error"
2424+
},
2425+
"5XX": {
2426+
"$ref": "#/components/responses/Error"
2427+
}
2428+
}
2429+
}
2430+
},
22732431
"/file/conversion/{src_format}/{output_format}": {
22742432
"post": {
22752433
"tags": [
@@ -20025,6 +20183,32 @@
2002520183
}
2002620184
}
2002720185
},
20186+
"ConversionParams": {
20187+
"description": "Describes the file to convert (src) and what it should be converted into (output).",
20188+
"type": "object",
20189+
"properties": {
20190+
"output_format": {
20191+
"description": "Describes the output file(s).",
20192+
"allOf": [
20193+
{
20194+
"$ref": "#/components/schemas/OutputFormat3d"
20195+
}
20196+
]
20197+
},
20198+
"src_format": {
20199+
"description": "Describes the input file(s).",
20200+
"allOf": [
20201+
{
20202+
"$ref": "#/components/schemas/InputFormat3d"
20203+
}
20204+
]
20205+
}
20206+
},
20207+
"required": [
20208+
"output_format",
20209+
"src_format"
20210+
]
20211+
},
2002820212
"CountryCode": {
2002920213
"description": "An ISO-3166 alpha-2 country code. Always uppercase.",
2003020214
"type": "string"

types.go

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

0 commit comments

Comments
 (0)