/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type JSONObjectResponseFormat = { type: "json_object"; }; /** @internal */ export const JSONObjectResponseFormat$inboundSchema: z.ZodType< JSONObjectResponseFormat, z.ZodTypeDef, unknown > = z.object({ type: z.literal("json_object"), }); /** @internal */ export type JSONObjectResponseFormat$Outbound = { type: "json_object"; }; /** @internal */ export const JSONObjectResponseFormat$outboundSchema: z.ZodType< JSONObjectResponseFormat$Outbound, z.ZodTypeDef, JSONObjectResponseFormat > = z.object({ type: z.literal("json_object"), }); export function jsonObjectResponseFormatToJSON( jsonObjectResponseFormat: JSONObjectResponseFormat, ): string { return JSON.stringify( JSONObjectResponseFormat$outboundSchema.parse(jsonObjectResponseFormat), ); } export function jsonObjectResponseFormatFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => JSONObjectResponseFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JSONObjectResponseFormat' from JSON`, ); }