/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { assetsDownloadBackupAsset } from "../../funcs/assetsDownloadBackupAsset.js";
import { formatResult } from "../tools.js";
const args = {
    assetId: z.string(),
    versionId: z.string(),
    apiKey: z.string(),
    signature: z.string(),
    timestamp: z.number().int(),
};
export const tool$assetsDownloadBackupAsset = {
    name: "download-asset-backup",
    description: `Download a backup copy of an asset`,
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await assetsDownloadBackupAsset(client, args.assetId, args.versionId, args.apiKey, args.signature, args.timestamp, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        const value = result.value;
        return formatResult(value, apiCall);
    },
};
//# sourceMappingURL=assetsDownloadBackupAsset.js.map