"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.CreateImageResponseBody$inboundSchema = exports.CreateImageUsage$inboundSchema = exports.InputTokensDetails$inboundSchema = exports.CreateImageData$inboundSchema = exports.CreateImageRequestBody$outboundSchema = exports.CreateImageOrq$outboundSchema = exports.CreateImageRouterImagesGenerationsTimeout$outboundSchema = exports.CreateImageRouterImagesGenerationsLoadBalancer$outboundSchema = exports.CreateImageLoadBalancerRouterImagesGenerations1$outboundSchema = exports.CreateImageLoadBalancerRouterImagesGenerationsModels$outboundSchema = exports.CreateImageLoadBalancerRouterImagesGenerationsType$outboundSchema = exports.CreateImageRouterImagesGenerationsCache$outboundSchema = exports.CreateImageRouterImagesGenerationsType$outboundSchema = exports.CreateImageRouterImagesGenerationsFallbacks$outboundSchema = exports.CreateImageRouterImagesGenerationsRetry$outboundSchema = exports.CreateImageTimeout$outboundSchema = exports.CreateImageLoadBalancer$outboundSchema = exports.CreateImageLoadBalancer1$outboundSchema = exports.CreateImageLoadBalancerModels$outboundSchema = exports.CreateImageLoadBalancerType$outboundSchema = exports.CreateImageCache$outboundSchema = exports.CreateImageType$outboundSchema = exports.CreateImageRetry$outboundSchema = exports.CreateImageFallbacks$outboundSchema = exports.Style$outboundSchema = exports.CreateImageResponseFormat$outboundSchema = exports.Quality$outboundSchema = exports.OutputFormat$outboundSchema = exports.Moderation$outboundSchema = exports.Background$outboundSchema = exports.CreateImageLoadBalancerRouterImagesGenerationsType = exports.CreateImageRouterImagesGenerationsType = exports.CreateImageLoadBalancerType = exports.CreateImageType = exports.Style = exports.CreateImageResponseFormat = exports.Quality = exports.OutputFormat = exports.Moderation = exports.Background = void 0;
exports.createImageFallbacksToJSON = createImageFallbacksToJSON;
exports.createImageRetryToJSON = createImageRetryToJSON;
exports.createImageCacheToJSON = createImageCacheToJSON;
exports.createImageLoadBalancerModelsToJSON = createImageLoadBalancerModelsToJSON;
exports.createImageLoadBalancer1ToJSON = createImageLoadBalancer1ToJSON;
exports.createImageLoadBalancerToJSON = createImageLoadBalancerToJSON;
exports.createImageTimeoutToJSON = createImageTimeoutToJSON;
exports.createImageRouterImagesGenerationsRetryToJSON = createImageRouterImagesGenerationsRetryToJSON;
exports.createImageRouterImagesGenerationsFallbacksToJSON = createImageRouterImagesGenerationsFallbacksToJSON;
exports.createImageRouterImagesGenerationsCacheToJSON = createImageRouterImagesGenerationsCacheToJSON;
exports.createImageLoadBalancerRouterImagesGenerationsModelsToJSON = createImageLoadBalancerRouterImagesGenerationsModelsToJSON;
exports.createImageLoadBalancerRouterImagesGenerations1ToJSON = createImageLoadBalancerRouterImagesGenerations1ToJSON;
exports.createImageRouterImagesGenerationsLoadBalancerToJSON = createImageRouterImagesGenerationsLoadBalancerToJSON;
exports.createImageRouterImagesGenerationsTimeoutToJSON = createImageRouterImagesGenerationsTimeoutToJSON;
exports.createImageOrqToJSON = createImageOrqToJSON;
exports.createImageRequestBodyToJSON = createImageRequestBodyToJSON;
exports.createImageDataFromJSON = createImageDataFromJSON;
exports.inputTokensDetailsFromJSON = inputTokensDetailsFromJSON;
exports.createImageUsageFromJSON = createImageUsageFromJSON;
exports.createImageResponseBodyFromJSON = createImageResponseBodyFromJSON;
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"));
/**
 * Allows to set transparency for the background of the generated image(s). This parameter is only supported for `openai/gpt-image-1`.
 */
exports.Background = {
    Transparent: "transparent",
    Opaque: "opaque",
    Auto: "auto",
};
/**
 * Control the content-moderation level for images generated by `gpt-image-1`. Must be either `low` or `auto`.
 */
exports.Moderation = {
    Low: "low",
    Auto: "auto",
};
/**
 * The format in which the generated images are returned. This parameter is only supported for `openai/gpt-image-1`.
 */
exports.OutputFormat = {
    Png: "png",
    Jpeg: "jpeg",
    Webp: "webp",
};
/**
 * The quality of the image that will be generated. `auto` will automatically select the best quality for the given model.
 */
exports.Quality = {
    Auto: "auto",
    High: "high",
    Medium: "medium",
    Low: "low",
    Hd: "hd",
    Standard: "standard",
};
/**
 * The format in which generated images are returned. Must be one of `url` or `b64_json`. This parameter isn't supported for `gpt-image-1` which will always return base64-encoded images.
 */
exports.CreateImageResponseFormat = {
    Url: "url",
    B64Json: "b64_json",
};
/**
 * The style of the generated images. This parameter is only supported for `openai/dall-e-3`. Must be one of `vivid` or `natural`.
 */
exports.Style = {
    Vivid: "vivid",
    Natural: "natural",
};
exports.CreateImageType = {
    ExactMatch: "exact_match",
};
exports.CreateImageLoadBalancerType = {
    WeightBased: "weight_based",
};
exports.CreateImageRouterImagesGenerationsType = {
    ExactMatch: "exact_match",
};
exports.CreateImageLoadBalancerRouterImagesGenerationsType = {
    WeightBased: "weight_based",
};
/** @internal */
exports.Background$outboundSchema = z
    .nativeEnum(exports.Background);
/** @internal */
exports.Moderation$outboundSchema = z
    .nativeEnum(exports.Moderation);
/** @internal */
exports.OutputFormat$outboundSchema = z.nativeEnum(exports.OutputFormat);
/** @internal */
exports.Quality$outboundSchema = z
    .nativeEnum(exports.Quality);
/** @internal */
exports.CreateImageResponseFormat$outboundSchema = z.nativeEnum(exports.CreateImageResponseFormat);
/** @internal */
exports.Style$outboundSchema = z.nativeEnum(exports.Style);
/** @internal */
exports.CreateImageFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createImageFallbacksToJSON(createImageFallbacks) {
    return JSON.stringify(exports.CreateImageFallbacks$outboundSchema.parse(createImageFallbacks));
}
/** @internal */
exports.CreateImageRetry$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 createImageRetryToJSON(createImageRetry) {
    return JSON.stringify(exports.CreateImageRetry$outboundSchema.parse(createImageRetry));
}
/** @internal */
exports.CreateImageType$outboundSchema = z.nativeEnum(exports.CreateImageType);
/** @internal */
exports.CreateImageCache$outboundSchema = z.object({
    ttl: z.number().default(1800),
    type: exports.CreateImageType$outboundSchema,
});
function createImageCacheToJSON(createImageCache) {
    return JSON.stringify(exports.CreateImageCache$outboundSchema.parse(createImageCache));
}
/** @internal */
exports.CreateImageLoadBalancerType$outboundSchema = z.nativeEnum(exports.CreateImageLoadBalancerType);
/** @internal */
exports.CreateImageLoadBalancerModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createImageLoadBalancerModelsToJSON(createImageLoadBalancerModels) {
    return JSON.stringify(exports.CreateImageLoadBalancerModels$outboundSchema.parse(createImageLoadBalancerModels));
}
/** @internal */
exports.CreateImageLoadBalancer1$outboundSchema = z.object({
    type: exports.CreateImageLoadBalancerType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateImageLoadBalancerModels$outboundSchema)),
});
function createImageLoadBalancer1ToJSON(createImageLoadBalancer1) {
    return JSON.stringify(exports.CreateImageLoadBalancer1$outboundSchema.parse(createImageLoadBalancer1));
}
/** @internal */
exports.CreateImageLoadBalancer$outboundSchema = z.lazy(() => exports.CreateImageLoadBalancer1$outboundSchema);
function createImageLoadBalancerToJSON(createImageLoadBalancer) {
    return JSON.stringify(exports.CreateImageLoadBalancer$outboundSchema.parse(createImageLoadBalancer));
}
/** @internal */
exports.CreateImageTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createImageTimeoutToJSON(createImageTimeout) {
    return JSON.stringify(exports.CreateImageTimeout$outboundSchema.parse(createImageTimeout));
}
/** @internal */
exports.CreateImageRouterImagesGenerationsRetry$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 createImageRouterImagesGenerationsRetryToJSON(createImageRouterImagesGenerationsRetry) {
    return JSON.stringify(exports.CreateImageRouterImagesGenerationsRetry$outboundSchema.parse(createImageRouterImagesGenerationsRetry));
}
/** @internal */
exports.CreateImageRouterImagesGenerationsFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createImageRouterImagesGenerationsFallbacksToJSON(createImageRouterImagesGenerationsFallbacks) {
    return JSON.stringify(exports.CreateImageRouterImagesGenerationsFallbacks$outboundSchema.parse(createImageRouterImagesGenerationsFallbacks));
}
/** @internal */
exports.CreateImageRouterImagesGenerationsType$outboundSchema = z.nativeEnum(exports.CreateImageRouterImagesGenerationsType);
/** @internal */
exports.CreateImageRouterImagesGenerationsCache$outboundSchema = z.object({
    ttl: z.number().default(1800),
    type: exports.CreateImageRouterImagesGenerationsType$outboundSchema,
});
function createImageRouterImagesGenerationsCacheToJSON(createImageRouterImagesGenerationsCache) {
    return JSON.stringify(exports.CreateImageRouterImagesGenerationsCache$outboundSchema.parse(createImageRouterImagesGenerationsCache));
}
/** @internal */
exports.CreateImageLoadBalancerRouterImagesGenerationsType$outboundSchema = z
    .nativeEnum(exports.CreateImageLoadBalancerRouterImagesGenerationsType);
/** @internal */
exports.CreateImageLoadBalancerRouterImagesGenerationsModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createImageLoadBalancerRouterImagesGenerationsModelsToJSON(createImageLoadBalancerRouterImagesGenerationsModels) {
    return JSON.stringify(exports.CreateImageLoadBalancerRouterImagesGenerationsModels$outboundSchema.parse(createImageLoadBalancerRouterImagesGenerationsModels));
}
/** @internal */
exports.CreateImageLoadBalancerRouterImagesGenerations1$outboundSchema = z.object({
    type: exports.CreateImageLoadBalancerRouterImagesGenerationsType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateImageLoadBalancerRouterImagesGenerationsModels$outboundSchema)),
});
function createImageLoadBalancerRouterImagesGenerations1ToJSON(createImageLoadBalancerRouterImagesGenerations1) {
    return JSON.stringify(exports.CreateImageLoadBalancerRouterImagesGenerations1$outboundSchema.parse(createImageLoadBalancerRouterImagesGenerations1));
}
/** @internal */
exports.CreateImageRouterImagesGenerationsLoadBalancer$outboundSchema = z.lazy(() => exports.CreateImageLoadBalancerRouterImagesGenerations1$outboundSchema);
function createImageRouterImagesGenerationsLoadBalancerToJSON(createImageRouterImagesGenerationsLoadBalancer) {
    return JSON.stringify(exports.CreateImageRouterImagesGenerationsLoadBalancer$outboundSchema.parse(createImageRouterImagesGenerationsLoadBalancer));
}
/** @internal */
exports.CreateImageRouterImagesGenerationsTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createImageRouterImagesGenerationsTimeoutToJSON(createImageRouterImagesGenerationsTimeout) {
    return JSON.stringify(exports.CreateImageRouterImagesGenerationsTimeout$outboundSchema.parse(createImageRouterImagesGenerationsTimeout));
}
/** @internal */
exports.CreateImageOrq$outboundSchema = z.object({
    name: z.string().optional(),
    retry: z.lazy(() => exports.CreateImageRouterImagesGenerationsRetry$outboundSchema)
        .optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateImageRouterImagesGenerationsFallbacks$outboundSchema)).optional(),
    identity: components.PublicIdentity$outboundSchema.optional(),
    contact: components.PublicContact$outboundSchema.optional(),
    cache: z.lazy(() => exports.CreateImageRouterImagesGenerationsCache$outboundSchema)
        .optional(),
    loadBalancer: z.lazy(() => exports.CreateImageLoadBalancerRouterImagesGenerations1$outboundSchema).optional(),
    timeout: z.lazy(() => exports.CreateImageRouterImagesGenerationsTimeout$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        loadBalancer: "load_balancer",
    });
});
function createImageOrqToJSON(createImageOrq) {
    return JSON.stringify(exports.CreateImageOrq$outboundSchema.parse(createImageOrq));
}
/** @internal */
exports.CreateImageRequestBody$outboundSchema = z.object({
    prompt: z.string(),
    background: z.nullable(exports.Background$outboundSchema).optional(),
    model: z.string(),
    moderation: z.nullable(exports.Moderation$outboundSchema).optional(),
    n: z.nullable(z.number().int().default(1)),
    outputCompression: z.nullable(z.number().int()).optional(),
    outputFormat: z.nullable(exports.OutputFormat$outboundSchema).optional(),
    quality: z.nullable(exports.Quality$outboundSchema).optional(),
    responseFormat: z.nullable(exports.CreateImageResponseFormat$outboundSchema)
        .optional(),
    size: z.nullable(z.string()).optional(),
    style: z.nullable(exports.Style$outboundSchema).optional(),
    metadata: z.record(z.string()).optional(),
    name: z.string().optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateImageFallbacks$outboundSchema))
        .optional(),
    retry: z.lazy(() => exports.CreateImageRetry$outboundSchema).optional(),
    cache: z.lazy(() => exports.CreateImageCache$outboundSchema).optional(),
    loadBalancer: z.lazy(() => exports.CreateImageLoadBalancer1$outboundSchema)
        .optional(),
    timeout: z.lazy(() => exports.CreateImageTimeout$outboundSchema).optional(),
    orq: z.lazy(() => exports.CreateImageOrq$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        outputCompression: "output_compression",
        outputFormat: "output_format",
        responseFormat: "response_format",
        loadBalancer: "load_balancer",
    });
});
function createImageRequestBodyToJSON(createImageRequestBody) {
    return JSON.stringify(exports.CreateImageRequestBody$outboundSchema.parse(createImageRequestBody));
}
/** @internal */
exports.CreateImageData$inboundSchema = z.object({
    revised_prompt: z.nullable(z.string()).optional(),
    b64_json: z.string().optional(),
    url: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "revised_prompt": "revisedPrompt",
        "b64_json": "b64Json",
    });
});
function createImageDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateImageData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImageData' from JSON`);
}
/** @internal */
exports.InputTokensDetails$inboundSchema = z.object({
    image_tokens: z.number().optional(),
    text_tokens: z.number().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "image_tokens": "imageTokens",
        "text_tokens": "textTokens",
    });
});
function inputTokensDetailsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InputTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InputTokensDetails' from JSON`);
}
/** @internal */
exports.CreateImageUsage$inboundSchema = z.object({
    input_tokens: z.number().optional(),
    input_tokens_details: z.lazy(() => exports.InputTokensDetails$inboundSchema),
    output_tokens: z.number().optional(),
    total_tokens: z.number().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "input_tokens": "inputTokens",
        "input_tokens_details": "inputTokensDetails",
        "output_tokens": "outputTokens",
        "total_tokens": "totalTokens",
    });
});
function createImageUsageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateImageUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImageUsage' from JSON`);
}
/** @internal */
exports.CreateImageResponseBody$inboundSchema = z.object({
    created: z.number(),
    data: z.array(z.lazy(() => exports.CreateImageData$inboundSchema)),
    usage: z.lazy(() => exports.CreateImageUsage$inboundSchema).optional(),
});
function createImageResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateImageResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImageResponseBody' from JSON`);
}
//# sourceMappingURL=createimage.js.map