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