/* * 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 GetSweepGlobals = { /** * 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 GetSweepRequest = { accountID: string; walletID: string; sweepID: string; }; export type GetSweepResponse = { headers: { [k: string]: Array }; result: components.Sweep; }; /** @internal */ export const GetSweepGlobals$inboundSchema: z.ZodType< GetSweepGlobals, z.ZodTypeDef, unknown > = z.object({ "X-Moov-Version": z.string().optional(), }).transform((v) => { return remap$(v, { "X-Moov-Version": "xMoovVersion", }); }); /** @internal */ export type GetSweepGlobals$Outbound = { "X-Moov-Version"?: string | undefined; }; /** @internal */ export const GetSweepGlobals$outboundSchema: z.ZodType< GetSweepGlobals$Outbound, z.ZodTypeDef, GetSweepGlobals > = z.object({ xMoovVersion: z.string().optional(), }).transform((v) => { return remap$(v, { xMoovVersion: "X-Moov-Version", }); }); export function getSweepGlobalsToJSON( getSweepGlobals: GetSweepGlobals, ): string { return JSON.stringify(GetSweepGlobals$outboundSchema.parse(getSweepGlobals)); } export function getSweepGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetSweepGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetSweepGlobals' from JSON`, ); } /** @internal */ export const GetSweepRequest$inboundSchema: z.ZodType< GetSweepRequest, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), walletID: z.string(), sweepID: z.string(), }); /** @internal */ export type GetSweepRequest$Outbound = { accountID: string; walletID: string; sweepID: string; }; /** @internal */ export const GetSweepRequest$outboundSchema: z.ZodType< GetSweepRequest$Outbound, z.ZodTypeDef, GetSweepRequest > = z.object({ accountID: z.string(), walletID: z.string(), sweepID: z.string(), }); export function getSweepRequestToJSON( getSweepRequest: GetSweepRequest, ): string { return JSON.stringify(GetSweepRequest$outboundSchema.parse(getSweepRequest)); } export function getSweepRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetSweepRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetSweepRequest' from JSON`, ); } /** @internal */ export const GetSweepResponse$inboundSchema: z.ZodType< GetSweepResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.Sweep$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); /** @internal */ export type GetSweepResponse$Outbound = { Headers: { [k: string]: Array }; Result: components.Sweep$Outbound; }; /** @internal */ export const GetSweepResponse$outboundSchema: z.ZodType< GetSweepResponse$Outbound, z.ZodTypeDef, GetSweepResponse > = z.object({ headers: z.record(z.array(z.string())), result: components.Sweep$outboundSchema, }).transform((v) => { return remap$(v, { headers: "Headers", result: "Result", }); }); export function getSweepResponseToJSON( getSweepResponse: GetSweepResponse, ): string { return JSON.stringify( GetSweepResponse$outboundSchema.parse(getSweepResponse), ); } export function getSweepResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetSweepResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetSweepResponse' from JSON`, ); }