"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.CreateImageEditResponseBody$inboundSchema = exports.CreateImageEditUsage$inboundSchema = exports.CreateImageEditInputTokensDetails$inboundSchema = exports.CreateImageEditData$inboundSchema = exports.CreateImageEditRequestBody$outboundSchema = exports.CreateImageEditOrq$outboundSchema = exports.CreateImageEditRouterImagesEditsTimeout$outboundSchema = exports.CreateImageEditRouterImagesEditsLoadBalancer$outboundSchema = exports.CreateImageEditLoadBalancerRouterImagesEdits1$outboundSchema = exports.CreateImageEditLoadBalancerRouterImagesEditsModels$outboundSchema = exports.CreateImageEditLoadBalancerRouterImagesEditsType$outboundSchema = exports.CreateImageEditRouterImagesEditsCache$outboundSchema = exports.CreateImageEditRouterImagesEditsType$outboundSchema = exports.CreateImageEditPrompt$outboundSchema = exports.CreateImageEditVersion$outboundSchema = exports.CreateImageEditRouterImagesEditsFallbacks$outboundSchema = exports.CreateImageEditRouterImagesEditsRetry$outboundSchema = exports.CreateImageEditTimeout$outboundSchema = exports.CreateImageEditLoadBalancer$outboundSchema = exports.CreateImageEditLoadBalancer1$outboundSchema = exports.CreateImageEditLoadBalancerModels$outboundSchema = exports.CreateImageEditLoadBalancerType$outboundSchema = exports.CreateImageEditCache$outboundSchema = exports.CreateImageEditType$outboundSchema = exports.CreateImageEditRetry$outboundSchema = exports.CreateImageEditFallbacks$outboundSchema = exports.CreateImageEditResponseFormat$outboundSchema = exports.CreateImageEditQuality$outboundSchema = exports.CreateImageEditLoadBalancerRouterImagesEditsType = exports.CreateImageEditRouterImagesEditsType = exports.CreateImageEditVersion = exports.CreateImageEditLoadBalancerType = exports.CreateImageEditType = exports.CreateImageEditResponseFormat = exports.CreateImageEditQuality = void 0;
exports.createImageEditFallbacksToJSON = createImageEditFallbacksToJSON;
exports.createImageEditRetryToJSON = createImageEditRetryToJSON;
exports.createImageEditCacheToJSON = createImageEditCacheToJSON;
exports.createImageEditLoadBalancerModelsToJSON = createImageEditLoadBalancerModelsToJSON;
exports.createImageEditLoadBalancer1ToJSON = createImageEditLoadBalancer1ToJSON;
exports.createImageEditLoadBalancerToJSON = createImageEditLoadBalancerToJSON;
exports.createImageEditTimeoutToJSON = createImageEditTimeoutToJSON;
exports.createImageEditRouterImagesEditsRetryToJSON = createImageEditRouterImagesEditsRetryToJSON;
exports.createImageEditRouterImagesEditsFallbacksToJSON = createImageEditRouterImagesEditsFallbacksToJSON;
exports.createImageEditPromptToJSON = createImageEditPromptToJSON;
exports.createImageEditRouterImagesEditsCacheToJSON = createImageEditRouterImagesEditsCacheToJSON;
exports.createImageEditLoadBalancerRouterImagesEditsModelsToJSON = createImageEditLoadBalancerRouterImagesEditsModelsToJSON;
exports.createImageEditLoadBalancerRouterImagesEdits1ToJSON = createImageEditLoadBalancerRouterImagesEdits1ToJSON;
exports.createImageEditRouterImagesEditsLoadBalancerToJSON = createImageEditRouterImagesEditsLoadBalancerToJSON;
exports.createImageEditRouterImagesEditsTimeoutToJSON = createImageEditRouterImagesEditsTimeoutToJSON;
exports.createImageEditOrqToJSON = createImageEditOrqToJSON;
exports.createImageEditRequestBodyToJSON = createImageEditRequestBodyToJSON;
exports.createImageEditDataFromJSON = createImageEditDataFromJSON;
exports.createImageEditInputTokensDetailsFromJSON = createImageEditInputTokensDetailsFromJSON;
exports.createImageEditUsageFromJSON = createImageEditUsageFromJSON;
exports.createImageEditResponseBodyFromJSON = createImageEditResponseBodyFromJSON;
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 quality of the image that will be generated. Auto will automatically select the best quality for the given model.
 */
exports.CreateImageEditQuality = {
    Auto: "auto",
    High: "high",
    Medium: "medium",
    Low: "low",
    Standard: "standard",
};
/**
 * The format in which the generated images are returned. Some of the models only return the image in base64 format.
 */
exports.CreateImageEditResponseFormat = {
    Url: "url",
    B64Json: "b64_json",
};
exports.CreateImageEditType = {
    ExactMatch: "exact_match",
};
exports.CreateImageEditLoadBalancerType = {
    WeightBased: "weight_based",
};
/**
 * Version of the prompt to use (currently only "latest" supported)
 */
exports.CreateImageEditVersion = {
    Latest: "latest",
};
exports.CreateImageEditRouterImagesEditsType = {
    ExactMatch: "exact_match",
};
exports.CreateImageEditLoadBalancerRouterImagesEditsType = {
    WeightBased: "weight_based",
};
/** @internal */
exports.CreateImageEditQuality$outboundSchema = z.nativeEnum(exports.CreateImageEditQuality);
/** @internal */
exports.CreateImageEditResponseFormat$outboundSchema = z.nativeEnum(exports.CreateImageEditResponseFormat);
/** @internal */
exports.CreateImageEditFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createImageEditFallbacksToJSON(createImageEditFallbacks) {
    return JSON.stringify(exports.CreateImageEditFallbacks$outboundSchema.parse(createImageEditFallbacks));
}
/** @internal */
exports.CreateImageEditRetry$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 createImageEditRetryToJSON(createImageEditRetry) {
    return JSON.stringify(exports.CreateImageEditRetry$outboundSchema.parse(createImageEditRetry));
}
/** @internal */
exports.CreateImageEditType$outboundSchema = z.nativeEnum(exports.CreateImageEditType);
/** @internal */
exports.CreateImageEditCache$outboundSchema = z.object({
    ttl: z.number().default(1800),
    type: exports.CreateImageEditType$outboundSchema,
});
function createImageEditCacheToJSON(createImageEditCache) {
    return JSON.stringify(exports.CreateImageEditCache$outboundSchema.parse(createImageEditCache));
}
/** @internal */
exports.CreateImageEditLoadBalancerType$outboundSchema = z.nativeEnum(exports.CreateImageEditLoadBalancerType);
/** @internal */
exports.CreateImageEditLoadBalancerModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createImageEditLoadBalancerModelsToJSON(createImageEditLoadBalancerModels) {
    return JSON.stringify(exports.CreateImageEditLoadBalancerModels$outboundSchema.parse(createImageEditLoadBalancerModels));
}
/** @internal */
exports.CreateImageEditLoadBalancer1$outboundSchema = z.object({
    type: exports.CreateImageEditLoadBalancerType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateImageEditLoadBalancerModels$outboundSchema)),
});
function createImageEditLoadBalancer1ToJSON(createImageEditLoadBalancer1) {
    return JSON.stringify(exports.CreateImageEditLoadBalancer1$outboundSchema.parse(createImageEditLoadBalancer1));
}
/** @internal */
exports.CreateImageEditLoadBalancer$outboundSchema = z.lazy(() => exports.CreateImageEditLoadBalancer1$outboundSchema);
function createImageEditLoadBalancerToJSON(createImageEditLoadBalancer) {
    return JSON.stringify(exports.CreateImageEditLoadBalancer$outboundSchema.parse(createImageEditLoadBalancer));
}
/** @internal */
exports.CreateImageEditTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createImageEditTimeoutToJSON(createImageEditTimeout) {
    return JSON.stringify(exports.CreateImageEditTimeout$outboundSchema.parse(createImageEditTimeout));
}
/** @internal */
exports.CreateImageEditRouterImagesEditsRetry$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 createImageEditRouterImagesEditsRetryToJSON(createImageEditRouterImagesEditsRetry) {
    return JSON.stringify(exports.CreateImageEditRouterImagesEditsRetry$outboundSchema.parse(createImageEditRouterImagesEditsRetry));
}
/** @internal */
exports.CreateImageEditRouterImagesEditsFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createImageEditRouterImagesEditsFallbacksToJSON(createImageEditRouterImagesEditsFallbacks) {
    return JSON.stringify(exports.CreateImageEditRouterImagesEditsFallbacks$outboundSchema.parse(createImageEditRouterImagesEditsFallbacks));
}
/** @internal */
exports.CreateImageEditVersion$outboundSchema = z.nativeEnum(exports.CreateImageEditVersion);
/** @internal */
exports.CreateImageEditPrompt$outboundSchema = z.object({
    id: z.string(),
    version: exports.CreateImageEditVersion$outboundSchema,
});
function createImageEditPromptToJSON(createImageEditPrompt) {
    return JSON.stringify(exports.CreateImageEditPrompt$outboundSchema.parse(createImageEditPrompt));
}
/** @internal */
exports.CreateImageEditRouterImagesEditsType$outboundSchema = z.nativeEnum(exports.CreateImageEditRouterImagesEditsType);
/** @internal */
exports.CreateImageEditRouterImagesEditsCache$outboundSchema = z.object({
    ttl: z.number().default(1800),
    type: exports.CreateImageEditRouterImagesEditsType$outboundSchema,
});
function createImageEditRouterImagesEditsCacheToJSON(createImageEditRouterImagesEditsCache) {
    return JSON.stringify(exports.CreateImageEditRouterImagesEditsCache$outboundSchema.parse(createImageEditRouterImagesEditsCache));
}
/** @internal */
exports.CreateImageEditLoadBalancerRouterImagesEditsType$outboundSchema = z
    .nativeEnum(exports.CreateImageEditLoadBalancerRouterImagesEditsType);
/** @internal */
exports.CreateImageEditLoadBalancerRouterImagesEditsModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createImageEditLoadBalancerRouterImagesEditsModelsToJSON(createImageEditLoadBalancerRouterImagesEditsModels) {
    return JSON.stringify(exports.CreateImageEditLoadBalancerRouterImagesEditsModels$outboundSchema.parse(createImageEditLoadBalancerRouterImagesEditsModels));
}
/** @internal */
exports.CreateImageEditLoadBalancerRouterImagesEdits1$outboundSchema = z.object({
    type: exports.CreateImageEditLoadBalancerRouterImagesEditsType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateImageEditLoadBalancerRouterImagesEditsModels$outboundSchema)),
});
function createImageEditLoadBalancerRouterImagesEdits1ToJSON(createImageEditLoadBalancerRouterImagesEdits1) {
    return JSON.stringify(exports.CreateImageEditLoadBalancerRouterImagesEdits1$outboundSchema.parse(createImageEditLoadBalancerRouterImagesEdits1));
}
/** @internal */
exports.CreateImageEditRouterImagesEditsLoadBalancer$outboundSchema = z.lazy(() => exports.CreateImageEditLoadBalancerRouterImagesEdits1$outboundSchema);
function createImageEditRouterImagesEditsLoadBalancerToJSON(createImageEditRouterImagesEditsLoadBalancer) {
    return JSON.stringify(exports.CreateImageEditRouterImagesEditsLoadBalancer$outboundSchema.parse(createImageEditRouterImagesEditsLoadBalancer));
}
/** @internal */
exports.CreateImageEditRouterImagesEditsTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createImageEditRouterImagesEditsTimeoutToJSON(createImageEditRouterImagesEditsTimeout) {
    return JSON.stringify(exports.CreateImageEditRouterImagesEditsTimeout$outboundSchema.parse(createImageEditRouterImagesEditsTimeout));
}
/** @internal */
exports.CreateImageEditOrq$outboundSchema = z.object({
    name: z.string().optional(),
    retry: z.lazy(() => exports.CreateImageEditRouterImagesEditsRetry$outboundSchema)
        .optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateImageEditRouterImagesEditsFallbacks$outboundSchema)).optional(),
    prompt: z.lazy(() => exports.CreateImageEditPrompt$outboundSchema).optional(),
    identity: components.PublicIdentity$outboundSchema.optional(),
    contact: components.PublicContact$outboundSchema.optional(),
    cache: z.lazy(() => exports.CreateImageEditRouterImagesEditsCache$outboundSchema)
        .optional(),
    loadBalancer: z.lazy(() => exports.CreateImageEditLoadBalancerRouterImagesEdits1$outboundSchema).optional(),
    timeout: z.lazy(() => exports.CreateImageEditRouterImagesEditsTimeout$outboundSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        loadBalancer: "load_balancer",
    });
});
function createImageEditOrqToJSON(createImageEditOrq) {
    return JSON.stringify(exports.CreateImageEditOrq$outboundSchema.parse(createImageEditOrq));
}
/** @internal */
exports.CreateImageEditRequestBody$outboundSchema = z.object({
    model: z.string(),
    image: z.any().optional(),
    prompt: z.string(),
    n: z.nullable(z.number().default(1)),
    size: z.nullable(z.string()).optional(),
    quality: z.nullable(exports.CreateImageEditQuality$outboundSchema).optional(),
    responseFormat: exports.CreateImageEditResponseFormat$outboundSchema.optional(),
    user: z.string().optional(),
    name: z.string().optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateImageEditFallbacks$outboundSchema))
        .optional(),
    retry: z.lazy(() => exports.CreateImageEditRetry$outboundSchema).optional(),
    cache: z.lazy(() => exports.CreateImageEditCache$outboundSchema).optional(),
    loadBalancer: z.lazy(() => exports.CreateImageEditLoadBalancer1$outboundSchema)
        .optional(),
    timeout: z.lazy(() => exports.CreateImageEditTimeout$outboundSchema).optional(),
    orq: z.lazy(() => exports.CreateImageEditOrq$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        responseFormat: "response_format",
        loadBalancer: "load_balancer",
    });
});
function createImageEditRequestBodyToJSON(createImageEditRequestBody) {
    return JSON.stringify(exports.CreateImageEditRequestBody$outboundSchema.parse(createImageEditRequestBody));
}
/** @internal */
exports.CreateImageEditData$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 createImageEditDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateImageEditData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImageEditData' from JSON`);
}
/** @internal */
exports.CreateImageEditInputTokensDetails$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 createImageEditInputTokensDetailsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateImageEditInputTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImageEditInputTokensDetails' from JSON`);
}
/** @internal */
exports.CreateImageEditUsage$inboundSchema = z.object({
    total_tokens: z.number(),
    input_tokens: z.number(),
    output_tokens: z.number(),
    input_tokens_details: z.lazy(() => exports.CreateImageEditInputTokensDetails$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "total_tokens": "totalTokens",
        "input_tokens": "inputTokens",
        "output_tokens": "outputTokens",
        "input_tokens_details": "inputTokensDetails",
    });
});
function createImageEditUsageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateImageEditUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImageEditUsage' from JSON`);
}
/** @internal */
exports.CreateImageEditResponseBody$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.CreateImageEditData$inboundSchema)),
    usage: z.lazy(() => exports.CreateImageEditUsage$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "output_format": "outputFormat",
    });
});
function createImageEditResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateImageEditResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImageEditResponseBody' from JSON`);
}
//# sourceMappingURL=createimageedit.js.map