/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Request to cancel an existing wire withdrawal. The cancel will only succeed if the wire has not made it to the SendingToBank state */ export type CancelWireWithdrawalRequestCreate = { /** * The name of the wire withdrawal to cancel */ name: string; /** * The reason why the wire withdrawal is being canceled */ reason?: string | undefined; }; /** @internal */ export const CancelWireWithdrawalRequestCreate$inboundSchema: z.ZodType< CancelWireWithdrawalRequestCreate, z.ZodTypeDef, unknown > = z.object({ name: z.string(), reason: z.string().optional(), }); /** @internal */ export type CancelWireWithdrawalRequestCreate$Outbound = { name: string; reason?: string | undefined; }; /** @internal */ export const CancelWireWithdrawalRequestCreate$outboundSchema: z.ZodType< CancelWireWithdrawalRequestCreate$Outbound, z.ZodTypeDef, CancelWireWithdrawalRequestCreate > = z.object({ name: z.string(), reason: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelWireWithdrawalRequestCreate$ { /** @deprecated use `CancelWireWithdrawalRequestCreate$inboundSchema` instead. */ export const inboundSchema = CancelWireWithdrawalRequestCreate$inboundSchema; /** @deprecated use `CancelWireWithdrawalRequestCreate$outboundSchema` instead. */ export const outboundSchema = CancelWireWithdrawalRequestCreate$outboundSchema; /** @deprecated use `CancelWireWithdrawalRequestCreate$Outbound` instead. */ export type Outbound = CancelWireWithdrawalRequestCreate$Outbound; } export function cancelWireWithdrawalRequestCreateToJSON( cancelWireWithdrawalRequestCreate: CancelWireWithdrawalRequestCreate, ): string { return JSON.stringify( CancelWireWithdrawalRequestCreate$outboundSchema.parse( cancelWireWithdrawalRequestCreate, ), ); } export function cancelWireWithdrawalRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelWireWithdrawalRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelWireWithdrawalRequestCreate' from JSON`, ); }