/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { assetsDownloadAsset } from "../../funcs/assetsDownloadAsset.js";
import * as components from "../../models/components/index.js";
import * as operations from "../../models/operations/index.js";
import { formatResult } from "../tools.js";
const args = {
    resourceType: components.ResourceTypeParameter$inboundSchema,
    publicId: z.string(),
    apiKey: z.string(),
    signature: z.string(),
    timestamp: z.number().int(),
    format: z.string().optional(),
    type: operations.DownloadAssetType$inboundSchema.default("upload"),
    expiresAt: z.number().int().optional(),
    attachment: z.boolean().default(false),
    targetFilename: z.string().optional(),
    transformation: z.string().optional(),
};
export const tool$assetsDownloadAsset = {
    name: "download-asset",
    description: `Generates a download link for a specific asset (image)`,
    scopes: ["admin"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await assetsDownloadAsset(client, args.resourceType, args.publicId, args.apiKey, args.signature, args.timestamp, args.format, args.type, args.expiresAt, args.attachment, args.targetFilename, args.transformation, { 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=assetsDownloadAsset.js.map