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