/* * 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"; import { Cancellation, Cancellation$inboundSchema, Cancellation$Outbound, Cancellation$outboundSchema, } from "./cancellation.js"; export type ReversedWithCancellation = { cancellation: Cancellation; }; /** @internal */ export const ReversedWithCancellation$inboundSchema: z.ZodType< ReversedWithCancellation, z.ZodTypeDef, unknown > = z.object({ cancellation: Cancellation$inboundSchema, }); /** @internal */ export type ReversedWithCancellation$Outbound = { cancellation: Cancellation$Outbound; }; /** @internal */ export const ReversedWithCancellation$outboundSchema: z.ZodType< ReversedWithCancellation$Outbound, z.ZodTypeDef, ReversedWithCancellation > = z.object({ cancellation: Cancellation$outboundSchema, }); export function reversedWithCancellationToJSON( reversedWithCancellation: ReversedWithCancellation, ): string { return JSON.stringify( ReversedWithCancellation$outboundSchema.parse(reversedWithCancellation), ); } export function reversedWithCancellationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ReversedWithCancellation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReversedWithCancellation' from JSON`, ); }