"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$streamingProfilesUpdateStreamingProfile = void 0;
const z = __importStar(require("zod"));
const streamingProfilesUpdateStreamingProfile_js_1 = require("../../funcs/streamingProfilesUpdateStreamingProfile.js");
const components = __importStar(require("../../models/components/index.js"));
const tools_js_1 = require("../tools.js");
const args = {
    name: z.string(),
    streamingProfileUpdate: components.StreamingProfileUpdate$inboundSchema,
};
exports.tool$streamingProfilesUpdateStreamingProfile = {
    name: "update-streaming-profile",
    description: `Purpose: Modifies an existing adaptive streaming profile's configuration. You can update both custom and built-in profiles by providing a new set of video representations (transformations), which will replace the profile's previous representations entirely. This allows you to change the resolutions, bitrates, codecs, or other settings of the streaming profile while keeping the same profile name.
Usage: Use this operation to adjust an established streaming profile when requirements change. For example, you might add a lower-resolution fallback representation to a custom profile or tweak the bitrate of a built-in profile's entries to better suit your audience's bandwidth. To use it, provide the target profile's name and a full updated list of representations that should define the profile. The next time that profile is used for encoding, it will use these new settings.
When Not to Use: Do not call this for a profile name that doesn't exist in your account (it will fail with a 'not found' error — use **create-streaming-profile** first if needed). If a built-in profile already meets your needs as provided, there's no need to update it (unnecessary overrides can be avoided). Also, this operation is not for retrieving profile info (use **get-streaming-profile** for that) and not for removing profiles (use **delete-streaming-profile** if you intend to remove or reset a profile).
Output: Returns the streaming profile's details after the update, reflecting the new configuration. In the response, you will see the profile's name and properties with the updated list of representations, confirming the changes were applied successfully.
`,
    scopes: ["builder"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await (0, streamingProfilesUpdateStreamingProfile_js_1.streamingProfilesUpdateStreamingProfile)(client, args.name, args.streamingProfileUpdate, { 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=streamingProfilesUpdateStreamingProfile.js.map