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