/* * 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 GetWalletGlobals = { /** * 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 GetWalletRequest = { accountID: string; walletID: string; }; export type GetWalletResponse = { headers: { [k: string]: Array }; result: components.Wallet; }; /** @internal */ export const GetWalletGlobals$inboundSchema: z.ZodType< GetWalletGlobals, z.ZodTypeDef, unknown > = z.object({ "X-Moov-Version": z.string().optional(), }).transform((v) => { return remap$(v, { "X-Moov-Version": "xMoovVersion", }); }); /** @internal */ export type GetWalletGlobals$Outbound = { "X-Moov-Version"?: string | undefined; }; /** @internal */ export const GetWalletGlobals$outboundSchema: z.ZodType< GetWalletGlobals$Outbound, z.ZodTypeDef, GetWalletGlobals > = z.object({ xMoovVersion: z.string().optional(), }).transform((v) => { return remap$(v, { xMoovVersion: "X-Moov-Version", }); }); export function getWalletGlobalsToJSON( getWalletGlobals: GetWalletGlobals, ): string { return JSON.stringify( GetWalletGlobals$outboundSchema.parse(getWalletGlobals), ); } export function getWalletGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetWalletGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetWalletGlobals' from JSON`, ); } /** @internal */ export const GetWalletRequest$inboundSchema: z.ZodType< GetWalletRequest, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), walletID: z.string(), }); /** @internal */ export type GetWalletRequest$Outbound = { accountID: string; walletID: string; }; /** @internal */ export const GetWalletRequest$outboundSchema: z.ZodType< GetWalletRequest$Outbound, z.ZodTypeDef, GetWalletRequest > = z.object({ accountID: z.string(), walletID: z.string(), }); export function getWalletRequestToJSON( getWalletRequest: GetWalletRequest, ): string { return JSON.stringify( GetWalletRequest$outboundSchema.parse(getWalletRequest), ); } export function getWalletRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetWalletRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetWalletRequest' from JSON`, ); } /** @internal */ export const GetWalletResponse$inboundSchema: z.ZodType< GetWalletResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.Wallet$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); /** @internal */ export type GetWalletResponse$Outbound = { Headers: { [k: string]: Array }; Result: components.Wallet$Outbound; }; /** @internal */ export const GetWalletResponse$outboundSchema: z.ZodType< GetWalletResponse$Outbound, z.ZodTypeDef, GetWalletResponse > = z.object({ headers: z.record(z.array(z.string())), result: components.Wallet$outboundSchema, }).transform((v) => { return remap$(v, { headers: "Headers", result: "Result", }); }); export function getWalletResponseToJSON( getWalletResponse: GetWalletResponse, ): string { return JSON.stringify( GetWalletResponse$outboundSchema.parse(getWalletResponse), ); } export function getWalletResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetWalletResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetWalletResponse' from JSON`, ); }