(threeDModelAssets)
- delete3DModelById - Delete 3D Model by ID
- uploadModelAsset - Upload 3D Model
This endpoint deletes the specific 3D Model
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.threeDModelAssets.delete3DModelById("<id>");
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { LeonardoCore } from "@leonardo-ai/sdk/core.js";
import { threeDModelAssetsDelete3DModelById } from "@leonardo-ai/sdk/funcs/threeDModelAssetsDelete3DModelById.js";
// Use `LeonardoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const leonardo = new LeonardoCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await threeDModelAssetsDelete3DModelById(leonardo, "<id>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | "id" is required (enter it either in parameters or request body) |
requestBody |
operations.Delete3DModelByIdRequestBody | ➖ | Query parameters can also be provided in the request body as a JSON object |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.Delete3DModelByIdResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
This endpoint returns presigned details to upload a 3D model to S3
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.threeDModelAssets.uploadModelAsset();
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { LeonardoCore } from "@leonardo-ai/sdk/core.js";
import { threeDModelAssetsUploadModelAsset } from "@leonardo-ai/sdk/funcs/threeDModelAssetsUploadModelAsset.js";
// Use `LeonardoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const leonardo = new LeonardoCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await threeDModelAssetsUploadModelAsset(leonardo);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.UploadModelAssetRequestBody | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.UploadModelAssetResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |