/* * 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"; /** * Request body for creating or updating image metadata. */ export type ImageMetadataRequest = { /** * Alternative text for the image. */ altText?: string | undefined; }; /** @internal */ export const ImageMetadataRequest$inboundSchema: z.ZodType< ImageMetadataRequest, z.ZodTypeDef, unknown > = z.object({ altText: z.string().optional(), }); /** @internal */ export type ImageMetadataRequest$Outbound = { altText?: string | undefined; }; /** @internal */ export const ImageMetadataRequest$outboundSchema: z.ZodType< ImageMetadataRequest$Outbound, z.ZodTypeDef, ImageMetadataRequest > = z.object({ altText: z.string().optional(), }); export function imageMetadataRequestToJSON( imageMetadataRequest: ImageMetadataRequest, ): string { return JSON.stringify( ImageMetadataRequest$outboundSchema.parse(imageMetadataRequest), ); } export function imageMetadataRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ImageMetadataRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageMetadataRequest' from JSON`, ); }