/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 20da8e33491e
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { JsonSchema$inboundSchema, JsonSchema$outboundSchema, } from "./jsonschema.js";
import { ResponseFormats$inboundSchema, ResponseFormats$outboundSchema, } from "./responseformats.js";
/** @internal */
export const ResponseFormat$inboundSchema = z.object({
    type: ResponseFormats$inboundSchema.optional(),
    json_schema: z.nullable(JsonSchema$inboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        "json_schema": "jsonSchema",
    });
});
/** @internal */
export const ResponseFormat$outboundSchema = z.object({
    type: ResponseFormats$outboundSchema.optional(),
    jsonSchema: z.nullable(JsonSchema$outboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        jsonSchema: "json_schema",
    });
});
export function responseFormatToJSON(responseFormat) {
    return JSON.stringify(ResponseFormat$outboundSchema.parse(responseFormat));
}
export function responseFormatFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ResponseFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseFormat' from JSON`);
}
//# sourceMappingURL=responseformat.js.map