/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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 GetBankAccountGlobals = { /** * Specify an API version. * * @remarks * * API versioning follows the format `vYYYY.QQ.BB`, where * - `YYYY` is the year * - `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10) * - `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter. * - For example, `v2024.01.00` is the initial release of the first quarter of 2024. * * The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release. * When no version is specified, the API defaults to `v2024.01.00`. */ xMoovVersion?: string | undefined; }; export type GetBankAccountRequest = { accountID: string; bankAccountID: string; }; export type GetBankAccountResponse = { headers: { [k: string]: Array }; result: components.BankAccount; }; /** @internal */ export const GetBankAccountGlobals$inboundSchema: z.ZodType< GetBankAccountGlobals, z.ZodTypeDef, unknown > = z.object({ "X-Moov-Version": z.string().optional(), }).transform((v) => { return remap$(v, { "X-Moov-Version": "xMoovVersion", }); }); /** @internal */ export type GetBankAccountGlobals$Outbound = { "X-Moov-Version"?: string | undefined; }; /** @internal */ export const GetBankAccountGlobals$outboundSchema: z.ZodType< GetBankAccountGlobals$Outbound, z.ZodTypeDef, GetBankAccountGlobals > = z.object({ xMoovVersion: z.string().optional(), }).transform((v) => { return remap$(v, { xMoovVersion: "X-Moov-Version", }); }); export function getBankAccountGlobalsToJSON( getBankAccountGlobals: GetBankAccountGlobals, ): string { return JSON.stringify( GetBankAccountGlobals$outboundSchema.parse(getBankAccountGlobals), ); } export function getBankAccountGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetBankAccountGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetBankAccountGlobals' from JSON`, ); } /** @internal */ export const GetBankAccountRequest$inboundSchema: z.ZodType< GetBankAccountRequest, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), bankAccountID: z.string(), }); /** @internal */ export type GetBankAccountRequest$Outbound = { accountID: string; bankAccountID: string; }; /** @internal */ export const GetBankAccountRequest$outboundSchema: z.ZodType< GetBankAccountRequest$Outbound, z.ZodTypeDef, GetBankAccountRequest > = z.object({ accountID: z.string(), bankAccountID: z.string(), }); export function getBankAccountRequestToJSON( getBankAccountRequest: GetBankAccountRequest, ): string { return JSON.stringify( GetBankAccountRequest$outboundSchema.parse(getBankAccountRequest), ); } export function getBankAccountRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetBankAccountRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetBankAccountRequest' from JSON`, ); } /** @internal */ export const GetBankAccountResponse$inboundSchema: z.ZodType< GetBankAccountResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.BankAccount$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); /** @internal */ export type GetBankAccountResponse$Outbound = { Headers: { [k: string]: Array }; Result: components.BankAccount$Outbound; }; /** @internal */ export const GetBankAccountResponse$outboundSchema: z.ZodType< GetBankAccountResponse$Outbound, z.ZodTypeDef, GetBankAccountResponse > = z.object({ headers: z.record(z.array(z.string())), result: components.BankAccount$outboundSchema, }).transform((v) => { return remap$(v, { headers: "Headers", result: "Result", }); }); export function getBankAccountResponseToJSON( getBankAccountResponse: GetBankAccountResponse, ): string { return JSON.stringify( GetBankAccountResponse$outboundSchema.parse(getBankAccountResponse), ); } export function getBankAccountResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetBankAccountResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetBankAccountResponse' from JSON`, ); }