"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.TextContentPartSchema$outboundSchema = exports.TextContentPartSchema$inboundSchema = exports.CacheControl$outboundSchema = exports.CacheControl$inboundSchema = exports.Ttl$outboundSchema = exports.Ttl$inboundSchema = exports.TextContentPartSchemaType$outboundSchema = exports.TextContentPartSchemaType$inboundSchema = exports.Type$outboundSchema = exports.Type$inboundSchema = exports.Ttl = exports.TextContentPartSchemaType = exports.Type = void 0;
exports.cacheControlToJSON = cacheControlToJSON;
exports.cacheControlFromJSON = cacheControlFromJSON;
exports.textContentPartSchemaToJSON = textContentPartSchemaToJSON;
exports.textContentPartSchemaFromJSON = textContentPartSchemaFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * The type of the content part.
 */
exports.Type = {
    Text: "text",
};
/**
 * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
 */
exports.TextContentPartSchemaType = {
    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.Ttl = {
    Fivem: "5m",
    Oneh: "1h",
};
/** @internal */
exports.Type$inboundSchema = z.nativeEnum(exports.Type);
/** @internal */
exports.Type$outboundSchema = exports.Type$inboundSchema;
/** @internal */
exports.TextContentPartSchemaType$inboundSchema = z.nativeEnum(exports.TextContentPartSchemaType);
/** @internal */
exports.TextContentPartSchemaType$outboundSchema = exports.TextContentPartSchemaType$inboundSchema;
/** @internal */
exports.Ttl$inboundSchema = z.nativeEnum(exports.Ttl);
/** @internal */
exports.Ttl$outboundSchema = exports.Ttl$inboundSchema;
/** @internal */
exports.CacheControl$inboundSchema = z.object({
    type: exports.TextContentPartSchemaType$inboundSchema,
    ttl: exports.Ttl$inboundSchema.default("5m"),
});
/** @internal */
exports.CacheControl$outboundSchema = z.object({
    type: exports.TextContentPartSchemaType$outboundSchema,
    ttl: exports.Ttl$outboundSchema.default("5m"),
});
function cacheControlToJSON(cacheControl) {
    return JSON.stringify(exports.CacheControl$outboundSchema.parse(cacheControl));
}
function cacheControlFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CacheControl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CacheControl' from JSON`);
}
/** @internal */
exports.TextContentPartSchema$inboundSchema = z.object({
    type: exports.Type$inboundSchema,
    text: z.string(),
    cache_control: z.lazy(() => exports.CacheControl$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "cache_control": "cacheControl",
    });
});
/** @internal */
exports.TextContentPartSchema$outboundSchema = z.object({
    type: exports.Type$outboundSchema,
    text: z.string(),
    cacheControl: z.lazy(() => exports.CacheControl$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        cacheControl: "cache_control",
    });
});
function textContentPartSchemaToJSON(textContentPartSchema) {
    return JSON.stringify(exports.TextContentPartSchema$outboundSchema.parse(textContentPartSchema));
}
function textContentPartSchemaFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TextContentPartSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextContentPartSchema' from JSON`);
}
//# sourceMappingURL=textcontentpartschema.js.map