"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.CreateImageVariationResponseBody$inboundSchema = exports.CreateImageVariationUsage$inboundSchema = exports.CreateImageVariationInputTokensDetails$inboundSchema = exports.CreateImageVariationData$inboundSchema = exports.CreateImageVariationRequestBody$outboundSchema = exports.CreateImageVariationOrq$outboundSchema = exports.CreateImageVariationRouterImagesVariationsTimeout$outboundSchema = exports.CreateImageVariationRouterImagesVariationsLoadBalancer$outboundSchema = exports.CreateImageVariationLoadBalancerRouterImagesVariations1$outboundSchema = exports.CreateImageVariationLoadBalancerRouterImagesVariationsModels$outboundSchema = exports.CreateImageVariationLoadBalancerRouterImagesVariationsType$outboundSchema = exports.CreateImageVariationRouterImagesVariationsCache$outboundSchema = exports.CreateImageVariationRouterImagesVariationsType$outboundSchema = exports.CreateImageVariationPrompt$outboundSchema = exports.CreateImageVariationVersion$outboundSchema = exports.CreateImageVariationRouterImagesVariationsFallbacks$outboundSchema = exports.CreateImageVariationRouterImagesVariationsRetry$outboundSchema = exports.CreateImageVariationTimeout$outboundSchema = exports.CreateImageVariationLoadBalancer$outboundSchema = exports.CreateImageVariationLoadBalancer1$outboundSchema = exports.CreateImageVariationLoadBalancerModels$outboundSchema = exports.CreateImageVariationLoadBalancerType$outboundSchema = exports.CreateImageVariationCache$outboundSchema = exports.CreateImageVariationType$outboundSchema = exports.CreateImageVariationRetry$outboundSchema = exports.CreateImageVariationFallbacks$outboundSchema = exports.Size$outboundSchema = exports.CreateImageVariationResponseFormat$outboundSchema = exports.CreateImageVariationLoadBalancerRouterImagesVariationsType = exports.CreateImageVariationRouterImagesVariationsType = exports.CreateImageVariationVersion = exports.CreateImageVariationLoadBalancerType = exports.CreateImageVariationType = exports.Size = exports.CreateImageVariationResponseFormat = void 0;
exports.createImageVariationFallbacksToJSON = createImageVariationFallbacksToJSON;
exports.createImageVariationRetryToJSON = createImageVariationRetryToJSON;
exports.createImageVariationCacheToJSON = createImageVariationCacheToJSON;
exports.createImageVariationLoadBalancerModelsToJSON = createImageVariationLoadBalancerModelsToJSON;
exports.createImageVariationLoadBalancer1ToJSON = createImageVariationLoadBalancer1ToJSON;
exports.createImageVariationLoadBalancerToJSON = createImageVariationLoadBalancerToJSON;
exports.createImageVariationTimeoutToJSON = createImageVariationTimeoutToJSON;
exports.createImageVariationRouterImagesVariationsRetryToJSON = createImageVariationRouterImagesVariationsRetryToJSON;
exports.createImageVariationRouterImagesVariationsFallbacksToJSON = createImageVariationRouterImagesVariationsFallbacksToJSON;
exports.createImageVariationPromptToJSON = createImageVariationPromptToJSON;
exports.createImageVariationRouterImagesVariationsCacheToJSON = createImageVariationRouterImagesVariationsCacheToJSON;
exports.createImageVariationLoadBalancerRouterImagesVariationsModelsToJSON = createImageVariationLoadBalancerRouterImagesVariationsModelsToJSON;
exports.createImageVariationLoadBalancerRouterImagesVariations1ToJSON = createImageVariationLoadBalancerRouterImagesVariations1ToJSON;
exports.createImageVariationRouterImagesVariationsLoadBalancerToJSON = createImageVariationRouterImagesVariationsLoadBalancerToJSON;
exports.createImageVariationRouterImagesVariationsTimeoutToJSON = createImageVariationRouterImagesVariationsTimeoutToJSON;
exports.createImageVariationOrqToJSON = createImageVariationOrqToJSON;
exports.createImageVariationRequestBodyToJSON = createImageVariationRequestBodyToJSON;
exports.createImageVariationDataFromJSON = createImageVariationDataFromJSON;
exports.createImageVariationInputTokensDetailsFromJSON = createImageVariationInputTokensDetailsFromJSON;
exports.createImageVariationUsageFromJSON = createImageVariationUsageFromJSON;
exports.createImageVariationResponseBodyFromJSON = createImageVariationResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const components = __importStar(require("../components/index.js"));
/**
 * The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.
 */
exports.CreateImageVariationResponseFormat = {
    Url: "url",
    B64Json: "b64_json",
};
/**
 * The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
 */
exports.Size = {
    TwoHundredAndFiftySixx256: "256x256",
    FiveHundredAndTwelvex512: "512x512",
    OneThousandAndTwentyFourx1024: "1024x1024",
};
exports.CreateImageVariationType = {
    ExactMatch: "exact_match",
};
exports.CreateImageVariationLoadBalancerType = {
    WeightBased: "weight_based",
};
/**
 * Version of the prompt to use (currently only "latest" supported)
 */
exports.CreateImageVariationVersion = {
    Latest: "latest",
};
exports.CreateImageVariationRouterImagesVariationsType = {
    ExactMatch: "exact_match",
};
exports.CreateImageVariationLoadBalancerRouterImagesVariationsType = {
    WeightBased: "weight_based",
};
/** @internal */
exports.CreateImageVariationResponseFormat$outboundSchema = z.nativeEnum(exports.CreateImageVariationResponseFormat);
/** @internal */
exports.Size$outboundSchema = z.nativeEnum(exports.Size);
/** @internal */
exports.CreateImageVariationFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createImageVariationFallbacksToJSON(createImageVariationFallbacks) {
    return JSON.stringify(exports.CreateImageVariationFallbacks$outboundSchema.parse(createImageVariationFallbacks));
}
/** @internal */
exports.CreateImageVariationRetry$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 createImageVariationRetryToJSON(createImageVariationRetry) {
    return JSON.stringify(exports.CreateImageVariationRetry$outboundSchema.parse(createImageVariationRetry));
}
/** @internal */
exports.CreateImageVariationType$outboundSchema = z.nativeEnum(exports.CreateImageVariationType);
/** @internal */
exports.CreateImageVariationCache$outboundSchema = z.object({
    ttl: z.number().default(1800),
    type: exports.CreateImageVariationType$outboundSchema,
});
function createImageVariationCacheToJSON(createImageVariationCache) {
    return JSON.stringify(exports.CreateImageVariationCache$outboundSchema.parse(createImageVariationCache));
}
/** @internal */
exports.CreateImageVariationLoadBalancerType$outboundSchema = z.nativeEnum(exports.CreateImageVariationLoadBalancerType);
/** @internal */
exports.CreateImageVariationLoadBalancerModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createImageVariationLoadBalancerModelsToJSON(createImageVariationLoadBalancerModels) {
    return JSON.stringify(exports.CreateImageVariationLoadBalancerModels$outboundSchema.parse(createImageVariationLoadBalancerModels));
}
/** @internal */
exports.CreateImageVariationLoadBalancer1$outboundSchema = z.object({
    type: exports.CreateImageVariationLoadBalancerType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateImageVariationLoadBalancerModels$outboundSchema)),
});
function createImageVariationLoadBalancer1ToJSON(createImageVariationLoadBalancer1) {
    return JSON.stringify(exports.CreateImageVariationLoadBalancer1$outboundSchema.parse(createImageVariationLoadBalancer1));
}
/** @internal */
exports.CreateImageVariationLoadBalancer$outboundSchema = z.lazy(() => exports.CreateImageVariationLoadBalancer1$outboundSchema);
function createImageVariationLoadBalancerToJSON(createImageVariationLoadBalancer) {
    return JSON.stringify(exports.CreateImageVariationLoadBalancer$outboundSchema.parse(createImageVariationLoadBalancer));
}
/** @internal */
exports.CreateImageVariationTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createImageVariationTimeoutToJSON(createImageVariationTimeout) {
    return JSON.stringify(exports.CreateImageVariationTimeout$outboundSchema.parse(createImageVariationTimeout));
}
/** @internal */
exports.CreateImageVariationRouterImagesVariationsRetry$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 createImageVariationRouterImagesVariationsRetryToJSON(createImageVariationRouterImagesVariationsRetry) {
    return JSON.stringify(exports.CreateImageVariationRouterImagesVariationsRetry$outboundSchema.parse(createImageVariationRouterImagesVariationsRetry));
}
/** @internal */
exports.CreateImageVariationRouterImagesVariationsFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createImageVariationRouterImagesVariationsFallbacksToJSON(createImageVariationRouterImagesVariationsFallbacks) {
    return JSON.stringify(exports.CreateImageVariationRouterImagesVariationsFallbacks$outboundSchema.parse(createImageVariationRouterImagesVariationsFallbacks));
}
/** @internal */
exports.CreateImageVariationVersion$outboundSchema = z.nativeEnum(exports.CreateImageVariationVersion);
/** @internal */
exports.CreateImageVariationPrompt$outboundSchema = z.object({
    id: z.string(),
    version: exports.CreateImageVariationVersion$outboundSchema,
});
function createImageVariationPromptToJSON(createImageVariationPrompt) {
    return JSON.stringify(exports.CreateImageVariationPrompt$outboundSchema.parse(createImageVariationPrompt));
}
/** @internal */
exports.CreateImageVariationRouterImagesVariationsType$outboundSchema = z
    .nativeEnum(exports.CreateImageVariationRouterImagesVariationsType);
/** @internal */
exports.CreateImageVariationRouterImagesVariationsCache$outboundSchema = z.object({
    ttl: z.number().default(1800),
    type: exports.CreateImageVariationRouterImagesVariationsType$outboundSchema,
});
function createImageVariationRouterImagesVariationsCacheToJSON(createImageVariationRouterImagesVariationsCache) {
    return JSON.stringify(exports.CreateImageVariationRouterImagesVariationsCache$outboundSchema.parse(createImageVariationRouterImagesVariationsCache));
}
/** @internal */
exports.CreateImageVariationLoadBalancerRouterImagesVariationsType$outboundSchema = z.nativeEnum(exports.CreateImageVariationLoadBalancerRouterImagesVariationsType);
/** @internal */
exports.CreateImageVariationLoadBalancerRouterImagesVariationsModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createImageVariationLoadBalancerRouterImagesVariationsModelsToJSON(createImageVariationLoadBalancerRouterImagesVariationsModels) {
    return JSON.stringify(exports.CreateImageVariationLoadBalancerRouterImagesVariationsModels$outboundSchema
        .parse(createImageVariationLoadBalancerRouterImagesVariationsModels));
}
/** @internal */
exports.CreateImageVariationLoadBalancerRouterImagesVariations1$outboundSchema = z.object({
    type: exports.CreateImageVariationLoadBalancerRouterImagesVariationsType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateImageVariationLoadBalancerRouterImagesVariationsModels$outboundSchema)),
});
function createImageVariationLoadBalancerRouterImagesVariations1ToJSON(createImageVariationLoadBalancerRouterImagesVariations1) {
    return JSON.stringify(exports.CreateImageVariationLoadBalancerRouterImagesVariations1$outboundSchema
        .parse(createImageVariationLoadBalancerRouterImagesVariations1));
}
/** @internal */
exports.CreateImageVariationRouterImagesVariationsLoadBalancer$outboundSchema = z.lazy(() => exports.CreateImageVariationLoadBalancerRouterImagesVariations1$outboundSchema);
function createImageVariationRouterImagesVariationsLoadBalancerToJSON(createImageVariationRouterImagesVariationsLoadBalancer) {
    return JSON.stringify(exports.CreateImageVariationRouterImagesVariationsLoadBalancer$outboundSchema.parse(createImageVariationRouterImagesVariationsLoadBalancer));
}
/** @internal */
exports.CreateImageVariationRouterImagesVariationsTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createImageVariationRouterImagesVariationsTimeoutToJSON(createImageVariationRouterImagesVariationsTimeout) {
    return JSON.stringify(exports.CreateImageVariationRouterImagesVariationsTimeout$outboundSchema.parse(createImageVariationRouterImagesVariationsTimeout));
}
/** @internal */
exports.CreateImageVariationOrq$outboundSchema = z.object({
    name: z.string().optional(),
    retry: z.lazy(() => exports.CreateImageVariationRouterImagesVariationsRetry$outboundSchema).optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateImageVariationRouterImagesVariationsFallbacks$outboundSchema)).optional(),
    prompt: z.lazy(() => exports.CreateImageVariationPrompt$outboundSchema).optional(),
    identity: components.PublicIdentity$outboundSchema.optional(),
    contact: components.PublicContact$outboundSchema.optional(),
    cache: z.lazy(() => exports.CreateImageVariationRouterImagesVariationsCache$outboundSchema).optional(),
    loadBalancer: z.lazy(() => exports.CreateImageVariationLoadBalancerRouterImagesVariations1$outboundSchema).optional(),
    timeout: z.lazy(() => exports.CreateImageVariationRouterImagesVariationsTimeout$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        loadBalancer: "load_balancer",
    });
});
function createImageVariationOrqToJSON(createImageVariationOrq) {
    return JSON.stringify(exports.CreateImageVariationOrq$outboundSchema.parse(createImageVariationOrq));
}
/** @internal */
exports.CreateImageVariationRequestBody$outboundSchema = z.object({
    image: z.any().optional(),
    model: z.string(),
    n: z.nullable(z.number().default(1)),
    responseFormat: exports.CreateImageVariationResponseFormat$outboundSchema.default("url"),
    size: exports.Size$outboundSchema.default("1024x1024"),
    user: z.string().optional(),
    name: z.string().optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateImageVariationFallbacks$outboundSchema))
        .optional(),
    retry: z.lazy(() => exports.CreateImageVariationRetry$outboundSchema).optional(),
    cache: z.lazy(() => exports.CreateImageVariationCache$outboundSchema).optional(),
    loadBalancer: z.lazy(() => exports.CreateImageVariationLoadBalancer1$outboundSchema)
        .optional(),
    timeout: z.lazy(() => exports.CreateImageVariationTimeout$outboundSchema).optional(),
    orq: z.lazy(() => exports.CreateImageVariationOrq$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        responseFormat: "response_format",
        loadBalancer: "load_balancer",
    });
});
function createImageVariationRequestBodyToJSON(createImageVariationRequestBody) {
    return JSON.stringify(exports.CreateImageVariationRequestBody$outboundSchema.parse(createImageVariationRequestBody));
}
/** @internal */
exports.CreateImageVariationData$inboundSchema = z.object({
    b64_json: z.string().optional(),
    url: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "b64_json": "b64Json",
    });
});
function createImageVariationDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateImageVariationData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImageVariationData' from JSON`);
}
/** @internal */
exports.CreateImageVariationInputTokensDetails$inboundSchema = z.object({
    text_tokens: z.number(),
    image_tokens: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "text_tokens": "textTokens",
        "image_tokens": "imageTokens",
    });
});
function createImageVariationInputTokensDetailsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateImageVariationInputTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImageVariationInputTokensDetails' from JSON`);
}
/** @internal */
exports.CreateImageVariationUsage$inboundSchema = z.object({
    total_tokens: z.number(),
    input_tokens: z.number(),
    output_tokens: z.number(),
    input_tokens_details: z.lazy(() => exports.CreateImageVariationInputTokensDetails$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "total_tokens": "totalTokens",
        "input_tokens": "inputTokens",
        "output_tokens": "outputTokens",
        "input_tokens_details": "inputTokensDetails",
    });
});
function createImageVariationUsageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateImageVariationUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImageVariationUsage' from JSON`);
}
/** @internal */
exports.CreateImageVariationResponseBody$inboundSchema = z.object({
    created: z.number(),
    output_format: z.string().optional(),
    size: z.string().optional(),
    quality: z.string().optional(),
    data: z.array(z.lazy(() => exports.CreateImageVariationData$inboundSchema)),
    usage: z.lazy(() => exports.CreateImageVariationUsage$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "output_format": "outputFormat",
    });
});
function createImageVariationResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateImageVariationResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImageVariationResponseBody' from JSON`);
}
//# sourceMappingURL=createimagevariation.js.map