/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AchWithdrawalsCancelAchWithdrawalRequest = { /** * The account id. */ accountId: string; /** * The achWithdrawal id. */ achWithdrawalId: string; cancelAchWithdrawalRequestCreate: components.CancelAchWithdrawalRequestCreate; }; export type AchWithdrawalsCancelAchWithdrawalResponse = { httpMeta: components.HTTPMetadata; /** * OK */ achWithdrawal?: components.AchWithdrawal | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const AchWithdrawalsCancelAchWithdrawalRequest$inboundSchema: z.ZodType< AchWithdrawalsCancelAchWithdrawalRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), achWithdrawal_id: z.string(), CancelAchWithdrawalRequestCreate: components.CancelAchWithdrawalRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "achWithdrawal_id": "achWithdrawalId", "CancelAchWithdrawalRequestCreate": "cancelAchWithdrawalRequestCreate", }); }); /** @internal */ export type AchWithdrawalsCancelAchWithdrawalRequest$Outbound = { account_id: string; achWithdrawal_id: string; CancelAchWithdrawalRequestCreate: components.CancelAchWithdrawalRequestCreate$Outbound; }; /** @internal */ export const AchWithdrawalsCancelAchWithdrawalRequest$outboundSchema: z.ZodType< AchWithdrawalsCancelAchWithdrawalRequest$Outbound, z.ZodTypeDef, AchWithdrawalsCancelAchWithdrawalRequest > = z.object({ accountId: z.string(), achWithdrawalId: z.string(), cancelAchWithdrawalRequestCreate: components.CancelAchWithdrawalRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", achWithdrawalId: "achWithdrawal_id", cancelAchWithdrawalRequestCreate: "CancelAchWithdrawalRequestCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalsCancelAchWithdrawalRequest$ { /** @deprecated use `AchWithdrawalsCancelAchWithdrawalRequest$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalsCancelAchWithdrawalRequest$inboundSchema; /** @deprecated use `AchWithdrawalsCancelAchWithdrawalRequest$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalsCancelAchWithdrawalRequest$outboundSchema; /** @deprecated use `AchWithdrawalsCancelAchWithdrawalRequest$Outbound` instead. */ export type Outbound = AchWithdrawalsCancelAchWithdrawalRequest$Outbound; } export function achWithdrawalsCancelAchWithdrawalRequestToJSON( achWithdrawalsCancelAchWithdrawalRequest: AchWithdrawalsCancelAchWithdrawalRequest, ): string { return JSON.stringify( AchWithdrawalsCancelAchWithdrawalRequest$outboundSchema.parse( achWithdrawalsCancelAchWithdrawalRequest, ), ); } export function achWithdrawalsCancelAchWithdrawalRequestFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalsCancelAchWithdrawalRequest, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalsCancelAchWithdrawalRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AchWithdrawalsCancelAchWithdrawalRequest' from JSON`, ); } /** @internal */ export const AchWithdrawalsCancelAchWithdrawalResponse$inboundSchema: z.ZodType< AchWithdrawalsCancelAchWithdrawalResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, AchWithdrawal: components.AchWithdrawal$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "AchWithdrawal": "achWithdrawal", "Status": "status", }); }); /** @internal */ export type AchWithdrawalsCancelAchWithdrawalResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; AchWithdrawal?: components.AchWithdrawal$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AchWithdrawalsCancelAchWithdrawalResponse$outboundSchema: z.ZodType< AchWithdrawalsCancelAchWithdrawalResponse$Outbound, z.ZodTypeDef, AchWithdrawalsCancelAchWithdrawalResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, achWithdrawal: components.AchWithdrawal$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", achWithdrawal: "AchWithdrawal", status: "Status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalsCancelAchWithdrawalResponse$ { /** @deprecated use `AchWithdrawalsCancelAchWithdrawalResponse$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalsCancelAchWithdrawalResponse$inboundSchema; /** @deprecated use `AchWithdrawalsCancelAchWithdrawalResponse$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalsCancelAchWithdrawalResponse$outboundSchema; /** @deprecated use `AchWithdrawalsCancelAchWithdrawalResponse$Outbound` instead. */ export type Outbound = AchWithdrawalsCancelAchWithdrawalResponse$Outbound; } export function achWithdrawalsCancelAchWithdrawalResponseToJSON( achWithdrawalsCancelAchWithdrawalResponse: AchWithdrawalsCancelAchWithdrawalResponse, ): string { return JSON.stringify( AchWithdrawalsCancelAchWithdrawalResponse$outboundSchema.parse( achWithdrawalsCancelAchWithdrawalResponse, ), ); } export function achWithdrawalsCancelAchWithdrawalResponseFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalsCancelAchWithdrawalResponse, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalsCancelAchWithdrawalResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AchWithdrawalsCancelAchWithdrawalResponse' from JSON`, ); }