/* * 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 CreateWalletGlobals = { /** * 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 CreateWalletRequest = { /** * The Moov account ID the wallet belongs to. */ accountID: string; createWallet: components.CreateWallet; }; export type CreateWalletResponse = { headers: { [k: string]: Array }; result: components.Wallet; }; /** @internal */ export const CreateWalletGlobals$inboundSchema: z.ZodType< CreateWalletGlobals, z.ZodTypeDef, unknown > = z.object({ "X-Moov-Version": z.string().optional(), }).transform((v) => { return remap$(v, { "X-Moov-Version": "xMoovVersion", }); }); /** @internal */ export type CreateWalletGlobals$Outbound = { "X-Moov-Version"?: string | undefined; }; /** @internal */ export const CreateWalletGlobals$outboundSchema: z.ZodType< CreateWalletGlobals$Outbound, z.ZodTypeDef, CreateWalletGlobals > = z.object({ xMoovVersion: z.string().optional(), }).transform((v) => { return remap$(v, { xMoovVersion: "X-Moov-Version", }); }); export function createWalletGlobalsToJSON( createWalletGlobals: CreateWalletGlobals, ): string { return JSON.stringify( CreateWalletGlobals$outboundSchema.parse(createWalletGlobals), ); } export function createWalletGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateWalletGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateWalletGlobals' from JSON`, ); } /** @internal */ export const CreateWalletRequest$inboundSchema: z.ZodType< CreateWalletRequest, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), CreateWallet: components.CreateWallet$inboundSchema, }).transform((v) => { return remap$(v, { "CreateWallet": "createWallet", }); }); /** @internal */ export type CreateWalletRequest$Outbound = { accountID: string; CreateWallet: components.CreateWallet$Outbound; }; /** @internal */ export const CreateWalletRequest$outboundSchema: z.ZodType< CreateWalletRequest$Outbound, z.ZodTypeDef, CreateWalletRequest > = z.object({ accountID: z.string(), createWallet: components.CreateWallet$outboundSchema, }).transform((v) => { return remap$(v, { createWallet: "CreateWallet", }); }); export function createWalletRequestToJSON( createWalletRequest: CreateWalletRequest, ): string { return JSON.stringify( CreateWalletRequest$outboundSchema.parse(createWalletRequest), ); } export function createWalletRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateWalletRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateWalletRequest' from JSON`, ); } /** @internal */ export const CreateWalletResponse$inboundSchema: z.ZodType< CreateWalletResponse, 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 CreateWalletResponse$Outbound = { Headers: { [k: string]: Array }; Result: components.Wallet$Outbound; }; /** @internal */ export const CreateWalletResponse$outboundSchema: z.ZodType< CreateWalletResponse$Outbound, z.ZodTypeDef, CreateWalletResponse > = z.object({ headers: z.record(z.array(z.string())), result: components.Wallet$outboundSchema, }).transform((v) => { return remap$(v, { headers: "Headers", result: "Result", }); }); export function createWalletResponseToJSON( createWalletResponse: CreateWalletResponse, ): string { return JSON.stringify( CreateWalletResponse$outboundSchema.parse(createWalletResponse), ); } export function createWalletResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateWalletResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateWalletResponse' from JSON`, ); }