"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.CreateTranslationResponseBody$inboundSchema = exports.CreateTranslationResponseBody1$inboundSchema = exports.CreateTranslationResponseBody2$inboundSchema = exports.ResponseBodySegments$inboundSchema = exports.ResponseBodyWords$inboundSchema = exports.CreateTranslationRequestBody$outboundSchema = exports.CreateTranslationFile$outboundSchema = exports.CreateTranslationOrq$outboundSchema = exports.CreateTranslationRouterAudioTranslationsTimeout$outboundSchema = exports.CreateTranslationRouterAudioTranslationsLoadBalancer$outboundSchema = exports.CreateTranslationLoadBalancerRouterAudioTranslations1$outboundSchema = exports.CreateTranslationLoadBalancerRouterAudioTranslationsModels$outboundSchema = exports.CreateTranslationLoadBalancerRouterAudioTranslationsType$outboundSchema = exports.CreateTranslationRouterAudioTranslationsRetry$outboundSchema = exports.CreateTranslationRouterAudioTranslationsFallbacks$outboundSchema = exports.CreateTranslationTimeout$outboundSchema = exports.CreateTranslationLoadBalancer$outboundSchema = exports.CreateTranslationLoadBalancer1$outboundSchema = exports.CreateTranslationLoadBalancerModels$outboundSchema = exports.CreateTranslationLoadBalancerType$outboundSchema = exports.CreateTranslationRetry$outboundSchema = exports.CreateTranslationFallbacks$outboundSchema = exports.CreateTranslationTimestampsGranularity$outboundSchema = exports.CreateTranslationResponseFormat$outboundSchema = exports.CreateTranslationLoadBalancerRouterAudioTranslationsType = exports.CreateTranslationLoadBalancerType = exports.CreateTranslationTimestampsGranularity = exports.CreateTranslationResponseFormat = void 0;
exports.createTranslationFallbacksToJSON = createTranslationFallbacksToJSON;
exports.createTranslationRetryToJSON = createTranslationRetryToJSON;
exports.createTranslationLoadBalancerModelsToJSON = createTranslationLoadBalancerModelsToJSON;
exports.createTranslationLoadBalancer1ToJSON = createTranslationLoadBalancer1ToJSON;
exports.createTranslationLoadBalancerToJSON = createTranslationLoadBalancerToJSON;
exports.createTranslationTimeoutToJSON = createTranslationTimeoutToJSON;
exports.createTranslationRouterAudioTranslationsFallbacksToJSON = createTranslationRouterAudioTranslationsFallbacksToJSON;
exports.createTranslationRouterAudioTranslationsRetryToJSON = createTranslationRouterAudioTranslationsRetryToJSON;
exports.createTranslationLoadBalancerRouterAudioTranslationsModelsToJSON = createTranslationLoadBalancerRouterAudioTranslationsModelsToJSON;
exports.createTranslationLoadBalancerRouterAudioTranslations1ToJSON = createTranslationLoadBalancerRouterAudioTranslations1ToJSON;
exports.createTranslationRouterAudioTranslationsLoadBalancerToJSON = createTranslationRouterAudioTranslationsLoadBalancerToJSON;
exports.createTranslationRouterAudioTranslationsTimeoutToJSON = createTranslationRouterAudioTranslationsTimeoutToJSON;
exports.createTranslationOrqToJSON = createTranslationOrqToJSON;
exports.createTranslationFileToJSON = createTranslationFileToJSON;
exports.createTranslationRequestBodyToJSON = createTranslationRequestBodyToJSON;
exports.responseBodyWordsFromJSON = responseBodyWordsFromJSON;
exports.responseBodySegmentsFromJSON = responseBodySegmentsFromJSON;
exports.createTranslationResponseBody2FromJSON = createTranslationResponseBody2FromJSON;
exports.createTranslationResponseBody1FromJSON = createTranslationResponseBody1FromJSON;
exports.createTranslationResponseBodyFromJSON = createTranslationResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const blobs_js_1 = require("../../types/blobs.js");
const components = __importStar(require("../components/index.js"));
/**
 * The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
 */
exports.CreateTranslationResponseFormat = {
    Json: "json",
    Text: "text",
    Srt: "srt",
    VerboseJson: "verbose_json",
    Vtt: "vtt",
};
/**
 * The granularity of the timestamps in the transcription. Word provides word-level timestamps and character provides character-level timestamps per word.
 */
exports.CreateTranslationTimestampsGranularity = {
    None: "none",
    Word: "word",
    Character: "character",
};
exports.CreateTranslationLoadBalancerType = {
    WeightBased: "weight_based",
};
exports.CreateTranslationLoadBalancerRouterAudioTranslationsType = {
    WeightBased: "weight_based",
};
/** @internal */
exports.CreateTranslationResponseFormat$outboundSchema = z.nativeEnum(exports.CreateTranslationResponseFormat);
/** @internal */
exports.CreateTranslationTimestampsGranularity$outboundSchema = z.nativeEnum(exports.CreateTranslationTimestampsGranularity);
/** @internal */
exports.CreateTranslationFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createTranslationFallbacksToJSON(createTranslationFallbacks) {
    return JSON.stringify(exports.CreateTranslationFallbacks$outboundSchema.parse(createTranslationFallbacks));
}
/** @internal */
exports.CreateTranslationRetry$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 createTranslationRetryToJSON(createTranslationRetry) {
    return JSON.stringify(exports.CreateTranslationRetry$outboundSchema.parse(createTranslationRetry));
}
/** @internal */
exports.CreateTranslationLoadBalancerType$outboundSchema = z.nativeEnum(exports.CreateTranslationLoadBalancerType);
/** @internal */
exports.CreateTranslationLoadBalancerModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createTranslationLoadBalancerModelsToJSON(createTranslationLoadBalancerModels) {
    return JSON.stringify(exports.CreateTranslationLoadBalancerModels$outboundSchema.parse(createTranslationLoadBalancerModels));
}
/** @internal */
exports.CreateTranslationLoadBalancer1$outboundSchema = z.object({
    type: exports.CreateTranslationLoadBalancerType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateTranslationLoadBalancerModels$outboundSchema)),
});
function createTranslationLoadBalancer1ToJSON(createTranslationLoadBalancer1) {
    return JSON.stringify(exports.CreateTranslationLoadBalancer1$outboundSchema.parse(createTranslationLoadBalancer1));
}
/** @internal */
exports.CreateTranslationLoadBalancer$outboundSchema = z.lazy(() => exports.CreateTranslationLoadBalancer1$outboundSchema);
function createTranslationLoadBalancerToJSON(createTranslationLoadBalancer) {
    return JSON.stringify(exports.CreateTranslationLoadBalancer$outboundSchema.parse(createTranslationLoadBalancer));
}
/** @internal */
exports.CreateTranslationTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createTranslationTimeoutToJSON(createTranslationTimeout) {
    return JSON.stringify(exports.CreateTranslationTimeout$outboundSchema.parse(createTranslationTimeout));
}
/** @internal */
exports.CreateTranslationRouterAudioTranslationsFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createTranslationRouterAudioTranslationsFallbacksToJSON(createTranslationRouterAudioTranslationsFallbacks) {
    return JSON.stringify(exports.CreateTranslationRouterAudioTranslationsFallbacks$outboundSchema.parse(createTranslationRouterAudioTranslationsFallbacks));
}
/** @internal */
exports.CreateTranslationRouterAudioTranslationsRetry$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 createTranslationRouterAudioTranslationsRetryToJSON(createTranslationRouterAudioTranslationsRetry) {
    return JSON.stringify(exports.CreateTranslationRouterAudioTranslationsRetry$outboundSchema.parse(createTranslationRouterAudioTranslationsRetry));
}
/** @internal */
exports.CreateTranslationLoadBalancerRouterAudioTranslationsType$outboundSchema = z.nativeEnum(exports.CreateTranslationLoadBalancerRouterAudioTranslationsType);
/** @internal */
exports.CreateTranslationLoadBalancerRouterAudioTranslationsModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createTranslationLoadBalancerRouterAudioTranslationsModelsToJSON(createTranslationLoadBalancerRouterAudioTranslationsModels) {
    return JSON.stringify(exports.CreateTranslationLoadBalancerRouterAudioTranslationsModels$outboundSchema
        .parse(createTranslationLoadBalancerRouterAudioTranslationsModels));
}
/** @internal */
exports.CreateTranslationLoadBalancerRouterAudioTranslations1$outboundSchema = z.object({
    type: exports.CreateTranslationLoadBalancerRouterAudioTranslationsType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateTranslationLoadBalancerRouterAudioTranslationsModels$outboundSchema)),
});
function createTranslationLoadBalancerRouterAudioTranslations1ToJSON(createTranslationLoadBalancerRouterAudioTranslations1) {
    return JSON.stringify(exports.CreateTranslationLoadBalancerRouterAudioTranslations1$outboundSchema.parse(createTranslationLoadBalancerRouterAudioTranslations1));
}
/** @internal */
exports.CreateTranslationRouterAudioTranslationsLoadBalancer$outboundSchema = z.lazy(() => exports.CreateTranslationLoadBalancerRouterAudioTranslations1$outboundSchema);
function createTranslationRouterAudioTranslationsLoadBalancerToJSON(createTranslationRouterAudioTranslationsLoadBalancer) {
    return JSON.stringify(exports.CreateTranslationRouterAudioTranslationsLoadBalancer$outboundSchema.parse(createTranslationRouterAudioTranslationsLoadBalancer));
}
/** @internal */
exports.CreateTranslationRouterAudioTranslationsTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createTranslationRouterAudioTranslationsTimeoutToJSON(createTranslationRouterAudioTranslationsTimeout) {
    return JSON.stringify(exports.CreateTranslationRouterAudioTranslationsTimeout$outboundSchema.parse(createTranslationRouterAudioTranslationsTimeout));
}
/** @internal */
exports.CreateTranslationOrq$outboundSchema = z.object({
    name: z.string().optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateTranslationRouterAudioTranslationsFallbacks$outboundSchema)).optional(),
    retry: z.lazy(() => exports.CreateTranslationRouterAudioTranslationsRetry$outboundSchema).optional(),
    identity: components.PublicIdentity$outboundSchema.optional(),
    contact: components.PublicContact$outboundSchema.optional(),
    loadBalancer: z.lazy(() => exports.CreateTranslationLoadBalancerRouterAudioTranslations1$outboundSchema).optional(),
    timeout: z.lazy(() => exports.CreateTranslationRouterAudioTranslationsTimeout$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        loadBalancer: "load_balancer",
    });
});
function createTranslationOrqToJSON(createTranslationOrq) {
    return JSON.stringify(exports.CreateTranslationOrq$outboundSchema.parse(createTranslationOrq));
}
/** @internal */
exports.CreateTranslationFile$outboundSchema = z.object({
    fileName: z.string(),
    content: z.union([
        z.instanceof((ReadableStream)),
        z.instanceof(Blob),
        z.instanceof(ArrayBuffer),
        z.instanceof(Uint8Array),
    ]),
});
function createTranslationFileToJSON(createTranslationFile) {
    return JSON.stringify(exports.CreateTranslationFile$outboundSchema.parse(createTranslationFile));
}
/** @internal */
exports.CreateTranslationRequestBody$outboundSchema = z.object({
    model: z.string(),
    prompt: z.string().optional(),
    enableLogging: z.boolean().default(true),
    diarize: z.boolean().default(false),
    responseFormat: exports.CreateTranslationResponseFormat$outboundSchema.optional(),
    tagAudioEvents: z.boolean().default(true),
    numSpeakers: z.number().optional(),
    timestampsGranularity: exports.CreateTranslationTimestampsGranularity$outboundSchema
        .default("word"),
    temperature: z.number().optional(),
    name: z.string().optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateTranslationFallbacks$outboundSchema))
        .optional(),
    retry: z.lazy(() => exports.CreateTranslationRetry$outboundSchema).optional(),
    loadBalancer: z.lazy(() => exports.CreateTranslationLoadBalancer1$outboundSchema)
        .optional(),
    timeout: z.lazy(() => exports.CreateTranslationTimeout$outboundSchema).optional(),
    orq: z.lazy(() => exports.CreateTranslationOrq$outboundSchema).optional(),
    file: z.lazy(() => exports.CreateTranslationFile$outboundSchema).or(blobs_js_1.blobLikeSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        enableLogging: "enable_logging",
        responseFormat: "response_format",
        tagAudioEvents: "tag_audio_events",
        numSpeakers: "num_speakers",
        timestampsGranularity: "timestamps_granularity",
        loadBalancer: "load_balancer",
    });
});
function createTranslationRequestBodyToJSON(createTranslationRequestBody) {
    return JSON.stringify(exports.CreateTranslationRequestBody$outboundSchema.parse(createTranslationRequestBody));
}
/** @internal */
exports.ResponseBodyWords$inboundSchema = z.object({
    word: z.string().optional(),
    start: z.number().optional(),
    end: z.number().optional(),
});
function responseBodyWordsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ResponseBodyWords$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseBodyWords' from JSON`);
}
/** @internal */
exports.ResponseBodySegments$inboundSchema = z.object({
    id: z.number(),
    seek: z.number(),
    start: z.number(),
    end: z.number(),
    text: z.string(),
    tokens: z.array(z.number()),
    temperature: z.number(),
    avg_logprob: z.number(),
    compression_ratio: z.number(),
    no_speech_prob: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "avg_logprob": "avgLogprob",
        "compression_ratio": "compressionRatio",
        "no_speech_prob": "noSpeechProb",
    });
});
function responseBodySegmentsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ResponseBodySegments$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseBodySegments' from JSON`);
}
/** @internal */
exports.CreateTranslationResponseBody2$inboundSchema = z.object({
    task: z.string().optional(),
    language: z.string().optional(),
    duration: z.number().optional(),
    text: z.string(),
    words: z.array(z.lazy(() => exports.ResponseBodyWords$inboundSchema)).optional(),
    segments: z.array(z.lazy(() => exports.ResponseBodySegments$inboundSchema))
        .optional(),
});
function createTranslationResponseBody2FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateTranslationResponseBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateTranslationResponseBody2' from JSON`);
}
/** @internal */
exports.CreateTranslationResponseBody1$inboundSchema = z.object({
    text: z.string(),
});
function createTranslationResponseBody1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateTranslationResponseBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateTranslationResponseBody1' from JSON`);
}
/** @internal */
exports.CreateTranslationResponseBody$inboundSchema = z.union([
    z.lazy(() => exports.CreateTranslationResponseBody1$inboundSchema),
    z.lazy(() => exports.CreateTranslationResponseBody2$inboundSchema),
    z.string(),
]);
function createTranslationResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateTranslationResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateTranslationResponseBody' from JSON`);
}
//# sourceMappingURL=createtranslation.js.map