/* * 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 AchDepositsGetAchDepositRequest = { /** * The account id. */ accountId: string; /** * The achDeposit id. */ achDepositId: string; }; export type AchDepositsGetAchDepositResponse = { httpMeta: components.HTTPMetadata; /** * OK */ achDeposit?: components.AchDeposit | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const AchDepositsGetAchDepositRequest$inboundSchema: z.ZodType< AchDepositsGetAchDepositRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), achDeposit_id: z.string(), }).transform((v) => { return remap$(v, { "account_id": "accountId", "achDeposit_id": "achDepositId", }); }); /** @internal */ export type AchDepositsGetAchDepositRequest$Outbound = { account_id: string; achDeposit_id: string; }; /** @internal */ export const AchDepositsGetAchDepositRequest$outboundSchema: z.ZodType< AchDepositsGetAchDepositRequest$Outbound, z.ZodTypeDef, AchDepositsGetAchDepositRequest > = z.object({ accountId: z.string(), achDepositId: z.string(), }).transform((v) => { return remap$(v, { accountId: "account_id", achDepositId: "achDeposit_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchDepositsGetAchDepositRequest$ { /** @deprecated use `AchDepositsGetAchDepositRequest$inboundSchema` instead. */ export const inboundSchema = AchDepositsGetAchDepositRequest$inboundSchema; /** @deprecated use `AchDepositsGetAchDepositRequest$outboundSchema` instead. */ export const outboundSchema = AchDepositsGetAchDepositRequest$outboundSchema; /** @deprecated use `AchDepositsGetAchDepositRequest$Outbound` instead. */ export type Outbound = AchDepositsGetAchDepositRequest$Outbound; } export function achDepositsGetAchDepositRequestToJSON( achDepositsGetAchDepositRequest: AchDepositsGetAchDepositRequest, ): string { return JSON.stringify( AchDepositsGetAchDepositRequest$outboundSchema.parse( achDepositsGetAchDepositRequest, ), ); } export function achDepositsGetAchDepositRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AchDepositsGetAchDepositRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AchDepositsGetAchDepositRequest' from JSON`, ); } /** @internal */ export const AchDepositsGetAchDepositResponse$inboundSchema: z.ZodType< AchDepositsGetAchDepositResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, AchDeposit: components.AchDeposit$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "AchDeposit": "achDeposit", "Status": "status", }); }); /** @internal */ export type AchDepositsGetAchDepositResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; AchDeposit?: components.AchDeposit$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AchDepositsGetAchDepositResponse$outboundSchema: z.ZodType< AchDepositsGetAchDepositResponse$Outbound, z.ZodTypeDef, AchDepositsGetAchDepositResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, achDeposit: components.AchDeposit$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", achDeposit: "AchDeposit", 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 AchDepositsGetAchDepositResponse$ { /** @deprecated use `AchDepositsGetAchDepositResponse$inboundSchema` instead. */ export const inboundSchema = AchDepositsGetAchDepositResponse$inboundSchema; /** @deprecated use `AchDepositsGetAchDepositResponse$outboundSchema` instead. */ export const outboundSchema = AchDepositsGetAchDepositResponse$outboundSchema; /** @deprecated use `AchDepositsGetAchDepositResponse$Outbound` instead. */ export type Outbound = AchDepositsGetAchDepositResponse$Outbound; } export function achDepositsGetAchDepositResponseToJSON( achDepositsGetAchDepositResponse: AchDepositsGetAchDepositResponse, ): string { return JSON.stringify( AchDepositsGetAchDepositResponse$outboundSchema.parse( achDepositsGetAchDepositResponse, ), ); } export function achDepositsGetAchDepositResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AchDepositsGetAchDepositResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AchDepositsGetAchDepositResponse' from JSON`, ); }