/* * 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 * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdk-validation-error.js"; export type AbortRequest = { paymentIntentId: string; reason?: string | undefined; }; /** * Payment intent abort result. */ export type AbortResponse = { success: boolean; paymentIntentId: string; }; /** @internal */ export type AbortRequest$Outbound = { paymentIntentId: string; reason?: string | undefined; }; /** @internal */ export const AbortRequest$outboundSchema: z.ZodMiniType< AbortRequest$Outbound, AbortRequest > = z.object({ paymentIntentId: z.string(), reason: z.optional(z.string()), }); export function abortRequestToJSON(abortRequest: AbortRequest): string { return JSON.stringify(AbortRequest$outboundSchema.parse(abortRequest)); } /** @internal */ export const AbortResponse$inboundSchema: z.ZodMiniType< AbortResponse, unknown > = z.object({ success: types.boolean(), paymentIntentId: types.string(), }); export function abortResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AbortResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AbortResponse' from JSON`, ); }