/* * 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 AchWithdrawalsCreateAchWithdrawalRequest = { /** * The account id. */ accountId: string; achWithdrawalCreate: components.AchWithdrawalCreate; }; export type AchWithdrawalsCreateAchWithdrawalResponse = { httpMeta: components.HTTPMetadata; /** * OK */ achWithdrawal?: components.AchWithdrawal | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const AchWithdrawalsCreateAchWithdrawalRequest$inboundSchema: z.ZodType< AchWithdrawalsCreateAchWithdrawalRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), AchWithdrawalCreate: components.AchWithdrawalCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "AchWithdrawalCreate": "achWithdrawalCreate", }); }); /** @internal */ export type AchWithdrawalsCreateAchWithdrawalRequest$Outbound = { account_id: string; AchWithdrawalCreate: components.AchWithdrawalCreate$Outbound; }; /** @internal */ export const AchWithdrawalsCreateAchWithdrawalRequest$outboundSchema: z.ZodType< AchWithdrawalsCreateAchWithdrawalRequest$Outbound, z.ZodTypeDef, AchWithdrawalsCreateAchWithdrawalRequest > = z.object({ accountId: z.string(), achWithdrawalCreate: components.AchWithdrawalCreate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", achWithdrawalCreate: "AchWithdrawalCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalsCreateAchWithdrawalRequest$ { /** @deprecated use `AchWithdrawalsCreateAchWithdrawalRequest$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalsCreateAchWithdrawalRequest$inboundSchema; /** @deprecated use `AchWithdrawalsCreateAchWithdrawalRequest$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalsCreateAchWithdrawalRequest$outboundSchema; /** @deprecated use `AchWithdrawalsCreateAchWithdrawalRequest$Outbound` instead. */ export type Outbound = AchWithdrawalsCreateAchWithdrawalRequest$Outbound; } export function achWithdrawalsCreateAchWithdrawalRequestToJSON( achWithdrawalsCreateAchWithdrawalRequest: AchWithdrawalsCreateAchWithdrawalRequest, ): string { return JSON.stringify( AchWithdrawalsCreateAchWithdrawalRequest$outboundSchema.parse( achWithdrawalsCreateAchWithdrawalRequest, ), ); } export function achWithdrawalsCreateAchWithdrawalRequestFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalsCreateAchWithdrawalRequest, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalsCreateAchWithdrawalRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AchWithdrawalsCreateAchWithdrawalRequest' from JSON`, ); } /** @internal */ export const AchWithdrawalsCreateAchWithdrawalResponse$inboundSchema: z.ZodType< AchWithdrawalsCreateAchWithdrawalResponse, 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 AchWithdrawalsCreateAchWithdrawalResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; AchWithdrawal?: components.AchWithdrawal$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AchWithdrawalsCreateAchWithdrawalResponse$outboundSchema: z.ZodType< AchWithdrawalsCreateAchWithdrawalResponse$Outbound, z.ZodTypeDef, AchWithdrawalsCreateAchWithdrawalResponse > = 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 AchWithdrawalsCreateAchWithdrawalResponse$ { /** @deprecated use `AchWithdrawalsCreateAchWithdrawalResponse$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalsCreateAchWithdrawalResponse$inboundSchema; /** @deprecated use `AchWithdrawalsCreateAchWithdrawalResponse$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalsCreateAchWithdrawalResponse$outboundSchema; /** @deprecated use `AchWithdrawalsCreateAchWithdrawalResponse$Outbound` instead. */ export type Outbound = AchWithdrawalsCreateAchWithdrawalResponse$Outbound; } export function achWithdrawalsCreateAchWithdrawalResponseToJSON( achWithdrawalsCreateAchWithdrawalResponse: AchWithdrawalsCreateAchWithdrawalResponse, ): string { return JSON.stringify( AchWithdrawalsCreateAchWithdrawalResponse$outboundSchema.parse( achWithdrawalsCreateAchWithdrawalResponse, ), ); } export function achWithdrawalsCreateAchWithdrawalResponseFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalsCreateAchWithdrawalResponse, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalsCreateAchWithdrawalResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AchWithdrawalsCreateAchWithdrawalResponse' from JSON`, ); }