/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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 data that can be provided as either a URL or base64 encoded data, but not both */ export type IndexMultimodalRequestImage = { /** * HTTP(S) URL to an image */ url?: string | undefined; /** * Base64-encoded image bytes. Data-URL prefix allowed. */ base64?: string | undefined; /** * Optional MIME type hint (e.g. image/png) */ mimeType?: string | undefined; }; /** @internal */ export const IndexMultimodalRequestImage$inboundSchema: z.ZodType< IndexMultimodalRequestImage, z.ZodTypeDef, unknown > = z.object({ url: z.string().optional(), base64: z.string().optional(), mime_type: z.string().optional(), }).transform((v) => { return remap$(v, { "mime_type": "mimeType", }); }); /** @internal */ export type IndexMultimodalRequestImage$Outbound = { url?: string | undefined; base64?: string | undefined; mime_type?: string | undefined; }; /** @internal */ export const IndexMultimodalRequestImage$outboundSchema: z.ZodType< IndexMultimodalRequestImage$Outbound, z.ZodTypeDef, IndexMultimodalRequestImage > = z.object({ url: z.string().optional(), base64: z.string().optional(), mimeType: z.string().optional(), }).transform((v) => { return remap$(v, { mimeType: "mime_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IndexMultimodalRequestImage$ { /** @deprecated use `IndexMultimodalRequestImage$inboundSchema` instead. */ export const inboundSchema = IndexMultimodalRequestImage$inboundSchema; /** @deprecated use `IndexMultimodalRequestImage$outboundSchema` instead. */ export const outboundSchema = IndexMultimodalRequestImage$outboundSchema; /** @deprecated use `IndexMultimodalRequestImage$Outbound` instead. */ export type Outbound = IndexMultimodalRequestImage$Outbound; } export function indexMultimodalRequestImageToJSON( indexMultimodalRequestImage: IndexMultimodalRequestImage, ): string { return JSON.stringify( IndexMultimodalRequestImage$outboundSchema.parse( indexMultimodalRequestImage, ), ); } export function indexMultimodalRequestImageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IndexMultimodalRequestImage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IndexMultimodalRequestImage' from JSON`, ); }