"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.CreateSpeechRequestBody$outboundSchema = exports.CreateSpeechOrq$outboundSchema = exports.CreateSpeechRouterAudioSpeechTimeout$outboundSchema = exports.CreateSpeechRouterAudioSpeechLoadBalancer$outboundSchema = exports.CreateSpeechLoadBalancerRouterAudioSpeech1$outboundSchema = exports.CreateSpeechLoadBalancerRouterAudioSpeechModels$outboundSchema = exports.CreateSpeechLoadBalancerRouterAudioSpeechType$outboundSchema = exports.CreateSpeechThread$outboundSchema = exports.CreateSpeechRouterAudioSpeechFallbacks$outboundSchema = exports.CreateSpeechRouterAudioSpeechRetry$outboundSchema = exports.CreateSpeechTimeout$outboundSchema = exports.CreateSpeechLoadBalancer$outboundSchema = exports.CreateSpeechLoadBalancer1$outboundSchema = exports.CreateSpeechLoadBalancerModels$outboundSchema = exports.CreateSpeechLoadBalancerType$outboundSchema = exports.CreateSpeechRetry$outboundSchema = exports.CreateSpeechFallbacks$outboundSchema = exports.CreateSpeechResponseFormat$outboundSchema = exports.CreateSpeechLoadBalancerRouterAudioSpeechType = exports.CreateSpeechLoadBalancerType = exports.CreateSpeechResponseFormat = void 0;
exports.createSpeechFallbacksToJSON = createSpeechFallbacksToJSON;
exports.createSpeechRetryToJSON = createSpeechRetryToJSON;
exports.createSpeechLoadBalancerModelsToJSON = createSpeechLoadBalancerModelsToJSON;
exports.createSpeechLoadBalancer1ToJSON = createSpeechLoadBalancer1ToJSON;
exports.createSpeechLoadBalancerToJSON = createSpeechLoadBalancerToJSON;
exports.createSpeechTimeoutToJSON = createSpeechTimeoutToJSON;
exports.createSpeechRouterAudioSpeechRetryToJSON = createSpeechRouterAudioSpeechRetryToJSON;
exports.createSpeechRouterAudioSpeechFallbacksToJSON = createSpeechRouterAudioSpeechFallbacksToJSON;
exports.createSpeechThreadToJSON = createSpeechThreadToJSON;
exports.createSpeechLoadBalancerRouterAudioSpeechModelsToJSON = createSpeechLoadBalancerRouterAudioSpeechModelsToJSON;
exports.createSpeechLoadBalancerRouterAudioSpeech1ToJSON = createSpeechLoadBalancerRouterAudioSpeech1ToJSON;
exports.createSpeechRouterAudioSpeechLoadBalancerToJSON = createSpeechRouterAudioSpeechLoadBalancerToJSON;
exports.createSpeechRouterAudioSpeechTimeoutToJSON = createSpeechRouterAudioSpeechTimeoutToJSON;
exports.createSpeechOrqToJSON = createSpeechOrqToJSON;
exports.createSpeechRequestBodyToJSON = createSpeechRequestBodyToJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const components = __importStar(require("../components/index.js"));
/**
 * The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. If a format is provided but not supported by the provider, the response will be in the default format. When the provided format is not supported by the provider, the response will be in the default format.
 */
exports.CreateSpeechResponseFormat = {
    Mp3: "mp3",
    Opus: "opus",
    Aac: "aac",
    Flac: "flac",
    Wav: "wav",
    Pcm: "pcm",
};
exports.CreateSpeechLoadBalancerType = {
    WeightBased: "weight_based",
};
exports.CreateSpeechLoadBalancerRouterAudioSpeechType = {
    WeightBased: "weight_based",
};
/** @internal */
exports.CreateSpeechResponseFormat$outboundSchema = z.nativeEnum(exports.CreateSpeechResponseFormat);
/** @internal */
exports.CreateSpeechFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createSpeechFallbacksToJSON(createSpeechFallbacks) {
    return JSON.stringify(exports.CreateSpeechFallbacks$outboundSchema.parse(createSpeechFallbacks));
}
/** @internal */
exports.CreateSpeechRetry$outboundSchema = z.object({
    count: z.number().default(3),
    onCodes: z.array(z.number()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        onCodes: "on_codes",
    });
});
function createSpeechRetryToJSON(createSpeechRetry) {
    return JSON.stringify(exports.CreateSpeechRetry$outboundSchema.parse(createSpeechRetry));
}
/** @internal */
exports.CreateSpeechLoadBalancerType$outboundSchema = z.nativeEnum(exports.CreateSpeechLoadBalancerType);
/** @internal */
exports.CreateSpeechLoadBalancerModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createSpeechLoadBalancerModelsToJSON(createSpeechLoadBalancerModels) {
    return JSON.stringify(exports.CreateSpeechLoadBalancerModels$outboundSchema.parse(createSpeechLoadBalancerModels));
}
/** @internal */
exports.CreateSpeechLoadBalancer1$outboundSchema = z.object({
    type: exports.CreateSpeechLoadBalancerType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateSpeechLoadBalancerModels$outboundSchema)),
});
function createSpeechLoadBalancer1ToJSON(createSpeechLoadBalancer1) {
    return JSON.stringify(exports.CreateSpeechLoadBalancer1$outboundSchema.parse(createSpeechLoadBalancer1));
}
/** @internal */
exports.CreateSpeechLoadBalancer$outboundSchema = z.lazy(() => exports.CreateSpeechLoadBalancer1$outboundSchema);
function createSpeechLoadBalancerToJSON(createSpeechLoadBalancer) {
    return JSON.stringify(exports.CreateSpeechLoadBalancer$outboundSchema.parse(createSpeechLoadBalancer));
}
/** @internal */
exports.CreateSpeechTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createSpeechTimeoutToJSON(createSpeechTimeout) {
    return JSON.stringify(exports.CreateSpeechTimeout$outboundSchema.parse(createSpeechTimeout));
}
/** @internal */
exports.CreateSpeechRouterAudioSpeechRetry$outboundSchema = z.object({
    count: z.number().default(3),
    onCodes: z.array(z.number()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        onCodes: "on_codes",
    });
});
function createSpeechRouterAudioSpeechRetryToJSON(createSpeechRouterAudioSpeechRetry) {
    return JSON.stringify(exports.CreateSpeechRouterAudioSpeechRetry$outboundSchema.parse(createSpeechRouterAudioSpeechRetry));
}
/** @internal */
exports.CreateSpeechRouterAudioSpeechFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createSpeechRouterAudioSpeechFallbacksToJSON(createSpeechRouterAudioSpeechFallbacks) {
    return JSON.stringify(exports.CreateSpeechRouterAudioSpeechFallbacks$outboundSchema.parse(createSpeechRouterAudioSpeechFallbacks));
}
/** @internal */
exports.CreateSpeechThread$outboundSchema = z.object({
    id: z.string(),
    tags: z.array(z.string()).optional(),
});
function createSpeechThreadToJSON(createSpeechThread) {
    return JSON.stringify(exports.CreateSpeechThread$outboundSchema.parse(createSpeechThread));
}
/** @internal */
exports.CreateSpeechLoadBalancerRouterAudioSpeechType$outboundSchema = z
    .nativeEnum(exports.CreateSpeechLoadBalancerRouterAudioSpeechType);
/** @internal */
exports.CreateSpeechLoadBalancerRouterAudioSpeechModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createSpeechLoadBalancerRouterAudioSpeechModelsToJSON(createSpeechLoadBalancerRouterAudioSpeechModels) {
    return JSON.stringify(exports.CreateSpeechLoadBalancerRouterAudioSpeechModels$outboundSchema.parse(createSpeechLoadBalancerRouterAudioSpeechModels));
}
/** @internal */
exports.CreateSpeechLoadBalancerRouterAudioSpeech1$outboundSchema = z.object({
    type: exports.CreateSpeechLoadBalancerRouterAudioSpeechType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateSpeechLoadBalancerRouterAudioSpeechModels$outboundSchema)),
});
function createSpeechLoadBalancerRouterAudioSpeech1ToJSON(createSpeechLoadBalancerRouterAudioSpeech1) {
    return JSON.stringify(exports.CreateSpeechLoadBalancerRouterAudioSpeech1$outboundSchema.parse(createSpeechLoadBalancerRouterAudioSpeech1));
}
/** @internal */
exports.CreateSpeechRouterAudioSpeechLoadBalancer$outboundSchema = z.lazy(() => exports.CreateSpeechLoadBalancerRouterAudioSpeech1$outboundSchema);
function createSpeechRouterAudioSpeechLoadBalancerToJSON(createSpeechRouterAudioSpeechLoadBalancer) {
    return JSON.stringify(exports.CreateSpeechRouterAudioSpeechLoadBalancer$outboundSchema.parse(createSpeechRouterAudioSpeechLoadBalancer));
}
/** @internal */
exports.CreateSpeechRouterAudioSpeechTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createSpeechRouterAudioSpeechTimeoutToJSON(createSpeechRouterAudioSpeechTimeout) {
    return JSON.stringify(exports.CreateSpeechRouterAudioSpeechTimeout$outboundSchema.parse(createSpeechRouterAudioSpeechTimeout));
}
/** @internal */
exports.CreateSpeechOrq$outboundSchema = z.object({
    retry: z.lazy(() => exports.CreateSpeechRouterAudioSpeechRetry$outboundSchema)
        .optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateSpeechRouterAudioSpeechFallbacks$outboundSchema)).optional(),
    name: z.string().optional(),
    identity: components.PublicIdentity$outboundSchema.optional(),
    contact: components.PublicContact$outboundSchema.optional(),
    thread: z.lazy(() => exports.CreateSpeechThread$outboundSchema).optional(),
    loadBalancer: z.lazy(() => exports.CreateSpeechLoadBalancerRouterAudioSpeech1$outboundSchema).optional(),
    timeout: z.lazy(() => exports.CreateSpeechRouterAudioSpeechTimeout$outboundSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        loadBalancer: "load_balancer",
    });
});
function createSpeechOrqToJSON(createSpeechOrq) {
    return JSON.stringify(exports.CreateSpeechOrq$outboundSchema.parse(createSpeechOrq));
}
/** @internal */
exports.CreateSpeechRequestBody$outboundSchema = z.object({
    input: z.string(),
    model: z.string(),
    voice: z.string(),
    responseFormat: exports.CreateSpeechResponseFormat$outboundSchema.default("mp3"),
    speed: z.number().default(1),
    name: z.string().optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateSpeechFallbacks$outboundSchema))
        .optional(),
    retry: z.lazy(() => exports.CreateSpeechRetry$outboundSchema).optional(),
    loadBalancer: z.lazy(() => exports.CreateSpeechLoadBalancer1$outboundSchema)
        .optional(),
    timeout: z.lazy(() => exports.CreateSpeechTimeout$outboundSchema).optional(),
    orq: z.lazy(() => exports.CreateSpeechOrq$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        responseFormat: "response_format",
        loadBalancer: "load_balancer",
    });
});
function createSpeechRequestBodyToJSON(createSpeechRequestBody) {
    return JSON.stringify(exports.CreateSpeechRequestBody$outboundSchema.parse(createSpeechRequestBody));
}
//# sourceMappingURL=createspeech.js.map