/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { uploadMappingsUpdateUploadMapping } from "../../funcs/uploadMappingsUpdateUploadMapping.js";
import * as operations from "../../models/operations/index.js";
import { formatResult } from "../tools.js";
const args = {
    request: operations.UpdateUploadMappingRequest$inboundSchema,
};
export const tool$uploadMappingsUpdateUploadMapping = {
    name: "update-upload-mapping",
    description: `Updates an existing upload mapping by changing its remote URL template for a given

Updates the URL template for an existing folder mapping`,
    scopes: ["builder"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await uploadMappingsUpdateUploadMapping(client, args.request, { 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=uploadMappingsUpdateUploadMapping.js.map