/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Image generation call item: A tool-call record for image generation, including status and result URL. */ export type ImageGenerationCall = { type: "image_generation_call"; id: string; status: string; result: string; background?: string | undefined; outputFormat?: string | undefined; quality?: string | undefined; size?: string | undefined; revisedPrompt?: string | undefined; }; /** @internal */ export const ImageGenerationCall$inboundSchema: z.ZodType< ImageGenerationCall, z.ZodTypeDef, unknown > = z.object({ type: z.literal("image_generation_call"), id: z.string(), status: z.string(), result: z.string(), background: z.string().optional(), output_format: z.string().optional(), quality: z.string().optional(), size: z.string().optional(), revised_prompt: z.string().optional(), }).transform((v) => { return remap$(v, { "output_format": "outputFormat", "revised_prompt": "revisedPrompt", }); }); /** @internal */ export type ImageGenerationCall$Outbound = { type: "image_generation_call"; id: string; status: string; result: string; background?: string | undefined; output_format?: string | undefined; quality?: string | undefined; size?: string | undefined; revised_prompt?: string | undefined; }; /** @internal */ export const ImageGenerationCall$outboundSchema: z.ZodType< ImageGenerationCall$Outbound, z.ZodTypeDef, ImageGenerationCall > = z.object({ type: z.literal("image_generation_call"), id: z.string(), status: z.string(), result: z.string(), background: z.string().optional(), outputFormat: z.string().optional(), quality: z.string().optional(), size: z.string().optional(), revisedPrompt: z.string().optional(), }).transform((v) => { return remap$(v, { outputFormat: "output_format", revisedPrompt: "revised_prompt", }); }); export function imageGenerationCallToJSON( imageGenerationCall: ImageGenerationCall, ): string { return JSON.stringify( ImageGenerationCall$outboundSchema.parse(imageGenerationCall), ); } export function imageGenerationCallFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ImageGenerationCall$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageGenerationCall' from JSON`, ); }