/* * 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 FulfillmentError = { method?: string | undefined; timeframe?: string | undefined; }; /** @internal */ export const FulfillmentError$inboundSchema: z.ZodType< FulfillmentError, z.ZodTypeDef, unknown > = z.object({ method: z.string().optional(), timeframe: z.string().optional(), }); /** @internal */ export type FulfillmentError$Outbound = { method?: string | undefined; timeframe?: string | undefined; }; /** @internal */ export const FulfillmentError$outboundSchema: z.ZodType< FulfillmentError$Outbound, z.ZodTypeDef, FulfillmentError > = z.object({ method: z.string().optional(), timeframe: z.string().optional(), }); export function fulfillmentErrorToJSON( fulfillmentError: FulfillmentError, ): string { return JSON.stringify( FulfillmentError$outboundSchema.parse(fulfillmentError), ); } export function fulfillmentErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FulfillmentError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FulfillmentError' from JSON`, ); }