"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.ImageContentPartSchema$outboundSchema = exports.ImageContentPartSchema$inboundSchema = exports.ImageContentPartSchemaCacheControl$outboundSchema = exports.ImageContentPartSchemaCacheControl$inboundSchema = exports.ImageContentPartSchemaTtl$outboundSchema = exports.ImageContentPartSchemaTtl$inboundSchema = exports.ImageContentPartSchemaCacheControlType$outboundSchema = exports.ImageContentPartSchemaCacheControlType$inboundSchema = exports.ImageUrl$outboundSchema = exports.ImageUrl$inboundSchema = exports.Detail$outboundSchema = exports.Detail$inboundSchema = exports.ImageContentPartSchemaTtl = exports.ImageContentPartSchemaCacheControlType = exports.Detail = void 0;
exports.imageUrlToJSON = imageUrlToJSON;
exports.imageUrlFromJSON = imageUrlFromJSON;
exports.imageContentPartSchemaCacheControlToJSON = imageContentPartSchemaCacheControlToJSON;
exports.imageContentPartSchemaCacheControlFromJSON = imageContentPartSchemaCacheControlFromJSON;
exports.imageContentPartSchemaToJSON = imageContentPartSchemaToJSON;
exports.imageContentPartSchemaFromJSON = imageContentPartSchemaFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * Specifies the detail level of the image.
 */
exports.Detail = {
    Low: "low",
    High: "high",
    Auto: "auto",
};
/**
 * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
 */
exports.ImageContentPartSchemaCacheControlType = {
    Ephemeral: "ephemeral",
};
/**
 * The time-to-live for the cache control breakpoint. This may be one of the following values:
 *
 * @remarks
 *
 * - `5m`: 5 minutes
 * - `1h`: 1 hour
 *
 * Defaults to `5m`. Only supported by `Anthropic` Claude models.
 */
exports.ImageContentPartSchemaTtl = {
    Fivem: "5m",
    Oneh: "1h",
};
/** @internal */
exports.Detail$inboundSchema = z
    .nativeEnum(exports.Detail);
/** @internal */
exports.Detail$outboundSchema = exports.Detail$inboundSchema;
/** @internal */
exports.ImageUrl$inboundSchema = z.object({
    url: z.string(),
    detail: exports.Detail$inboundSchema.optional(),
});
/** @internal */
exports.ImageUrl$outboundSchema = z.object({
    url: z.string(),
    detail: exports.Detail$outboundSchema.optional(),
});
function imageUrlToJSON(imageUrl) {
    return JSON.stringify(exports.ImageUrl$outboundSchema.parse(imageUrl));
}
function imageUrlFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ImageUrl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageUrl' from JSON`);
}
/** @internal */
exports.ImageContentPartSchemaCacheControlType$inboundSchema = z.nativeEnum(exports.ImageContentPartSchemaCacheControlType);
/** @internal */
exports.ImageContentPartSchemaCacheControlType$outboundSchema = exports.ImageContentPartSchemaCacheControlType$inboundSchema;
/** @internal */
exports.ImageContentPartSchemaTtl$inboundSchema = z.nativeEnum(exports.ImageContentPartSchemaTtl);
/** @internal */
exports.ImageContentPartSchemaTtl$outboundSchema = exports.ImageContentPartSchemaTtl$inboundSchema;
/** @internal */
exports.ImageContentPartSchemaCacheControl$inboundSchema = z.object({
    type: exports.ImageContentPartSchemaCacheControlType$inboundSchema,
    ttl: exports.ImageContentPartSchemaTtl$inboundSchema.default("5m"),
});
/** @internal */
exports.ImageContentPartSchemaCacheControl$outboundSchema = z.object({
    type: exports.ImageContentPartSchemaCacheControlType$outboundSchema,
    ttl: exports.ImageContentPartSchemaTtl$outboundSchema.default("5m"),
});
function imageContentPartSchemaCacheControlToJSON(imageContentPartSchemaCacheControl) {
    return JSON.stringify(exports.ImageContentPartSchemaCacheControl$outboundSchema.parse(imageContentPartSchemaCacheControl));
}
function imageContentPartSchemaCacheControlFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ImageContentPartSchemaCacheControl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageContentPartSchemaCacheControl' from JSON`);
}
/** @internal */
exports.ImageContentPartSchema$inboundSchema = z.object({
    type: z.literal("image_url"),
    image_url: z.lazy(() => exports.ImageUrl$inboundSchema),
    cache_control: z.lazy(() => exports.ImageContentPartSchemaCacheControl$inboundSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "image_url": "imageUrl",
        "cache_control": "cacheControl",
    });
});
/** @internal */
exports.ImageContentPartSchema$outboundSchema = z.object({
    type: z.literal("image_url"),
    imageUrl: z.lazy(() => exports.ImageUrl$outboundSchema),
    cacheControl: z.lazy(() => exports.ImageContentPartSchemaCacheControl$outboundSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        imageUrl: "image_url",
        cacheControl: "cache_control",
    });
});
function imageContentPartSchemaToJSON(imageContentPartSchema) {
    return JSON.stringify(exports.ImageContentPartSchema$outboundSchema.parse(imageContentPartSchema));
}
function imageContentPartSchemaFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ImageContentPartSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageContentPartSchema' from JSON`);
}
//# sourceMappingURL=imagecontentpartschema.js.map