/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: c9beefa1092d */ import * as z from "zod/v4"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ImageDetail, ImageDetail$inboundSchema, ImageDetail$outboundSchema, } from "./imagedetail.js"; export type ImageURL = { url: string; detail?: ImageDetail | null | undefined; }; /** @internal */ export const ImageURL$inboundSchema: z.ZodType = z.object({ url: z.string(), detail: z.nullable(ImageDetail$inboundSchema).optional(), }); /** @internal */ export type ImageURL$Outbound = { url: string; detail?: string | null | undefined; }; /** @internal */ export const ImageURL$outboundSchema: z.ZodType = z .object({ url: z.string(), detail: z.nullable(ImageDetail$outboundSchema).optional(), }); export function imageURLToJSON(imageURL: ImageURL): string { return JSON.stringify(ImageURL$outboundSchema.parse(imageURL)); } export function imageURLFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ImageURL$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageURL' from JSON`, ); }