/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { AlreadyActiveSubscriptionError, AlreadyActiveSubscriptionError$inboundSchema, } from "./alreadyactivesubscriptionerror.js"; import { NotOpenCheckout, NotOpenCheckout$inboundSchema, } from "./notopencheckout.js"; import { PaymentNotReady, PaymentNotReady$inboundSchema, } from "./paymentnotready.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; import { TrialAlreadyRedeemed, TrialAlreadyRedeemed$inboundSchema, } from "./trialalreadyredeemed.js"; export type CheckoutForbiddenError = | AlreadyActiveSubscriptionError | NotOpenCheckout | PaymentNotReady | TrialAlreadyRedeemed; /** @internal */ export const CheckoutForbiddenError$inboundSchema: z.ZodMiniType< CheckoutForbiddenError, unknown > = z.union([ AlreadyActiveSubscriptionError$inboundSchema, NotOpenCheckout$inboundSchema, PaymentNotReady$inboundSchema, TrialAlreadyRedeemed$inboundSchema, ]); export function checkoutForbiddenErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CheckoutForbiddenError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CheckoutForbiddenError' from JSON`, ); }