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