/* * 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 AssignProductImage = { /** * Unique identifier for a product or product option image resource. */ imageID: string; }; /** @internal */ export const AssignProductImage$inboundSchema: z.ZodType< AssignProductImage, z.ZodTypeDef, unknown > = z.object({ imageID: z.string(), }); /** @internal */ export type AssignProductImage$Outbound = { imageID: string; }; /** @internal */ export const AssignProductImage$outboundSchema: z.ZodType< AssignProductImage$Outbound, z.ZodTypeDef, AssignProductImage > = z.object({ imageID: z.string(), }); export function assignProductImageToJSON( assignProductImage: AssignProductImage, ): string { return JSON.stringify( AssignProductImage$outboundSchema.parse(assignProductImage), ); } export function assignProductImageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssignProductImage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssignProductImage' from JSON`, ); }