"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.tool$metadataFieldsDeleteMetadataFieldDatasource = void 0;
const z = __importStar(require("zod"));
const metadataFieldsDeleteMetadataFieldDatasource_js_1 = require("../../funcs/metadataFieldsDeleteMetadataFieldDatasource.js");
const operations = __importStar(require("../../models/operations/index.js"));
const tools_js_1 = require("../tools.js");
const args = {
    externalId: z.string(),
    requestBody: operations.DeleteMetadataFieldDatasourceRequestBody$inboundSchema,
};
exports.tool$metadataFieldsDeleteMetadataFieldDatasource = {
    name: "delete-metadata-datasource-values",
    description: `Purpose: Permanently removes specific predefined values from enum and set metadata fields using their external IDs, effectively removing these options from the available choices for asset metadata assignment.
Usage: Use this to clean up unused enum values, remove deprecated options, or streamline selection lists by eliminating outdated choices. Essential for maintaining clean, relevant option lists in categorical metadata fields.
Example request: {"external_ids": ["old_category_1", "deprecated_option", "unused_value"]}
Parameters: external_id(field identifier from URL path), external_ids array(list of value identifiers to remove)
Warning: This permanently removes values and may affect assets that currently use these values. Consider setting values to "inactive" state instead for safer option management.
When Not to Use: Don't delete values that are actively used in production assets. Avoid deletion if you might need to restore the values later - use inactive state instead.
Output: Returns updated datasource configuration: values array with remaining active values and their properties
Example output: {"values":[{"external_id":"electronics","value":"Electronics","position":1,"state":"active"},{"external_id":"clothing","value":"Clothing","position":2,"state":"active"}]}
`,
    scopes: ["builder"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await (0, metadataFieldsDeleteMetadataFieldDatasource_js_1.metadataFieldsDeleteMetadataFieldDatasource)(client, args.externalId, args.requestBody, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        const value = result.value;
        return (0, tools_js_1.formatResult)(value, apiCall);
    },
};
//# sourceMappingURL=metadataFieldsDeleteMetadataFieldDatasource.js.map