/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { SweepConfigStatus, SweepConfigStatus$inboundSchema, SweepConfigStatus$outboundSchema, } from "./sweepconfigstatus.js"; export type CreateSweepConfig = { walletID: string; status: SweepConfigStatus; /** * ID of the payment method. */ pushPaymentMethodID: string; /** * ID of the payment method. */ pullPaymentMethodID: string; /** * The text that appears on the banking statement. The default descriptor is a 10 character ID if an override is not set in the sweep configs statementDescriptor. */ statementDescriptor?: string | undefined; minimumBalance?: string | undefined; }; /** @internal */ export const CreateSweepConfig$inboundSchema: z.ZodType< CreateSweepConfig, z.ZodTypeDef, unknown > = z.object({ walletID: z.string(), status: SweepConfigStatus$inboundSchema, pushPaymentMethodID: z.string(), pullPaymentMethodID: z.string(), statementDescriptor: z.string().optional(), minimumBalance: z.string().optional(), }); /** @internal */ export type CreateSweepConfig$Outbound = { walletID: string; status: string; pushPaymentMethodID: string; pullPaymentMethodID: string; statementDescriptor?: string | undefined; minimumBalance?: string | undefined; }; /** @internal */ export const CreateSweepConfig$outboundSchema: z.ZodType< CreateSweepConfig$Outbound, z.ZodTypeDef, CreateSweepConfig > = z.object({ walletID: z.string(), status: SweepConfigStatus$outboundSchema, pushPaymentMethodID: z.string(), pullPaymentMethodID: z.string(), statementDescriptor: z.string().optional(), minimumBalance: z.string().optional(), }); export function createSweepConfigToJSON( createSweepConfig: CreateSweepConfig, ): string { return JSON.stringify( CreateSweepConfig$outboundSchema.parse(createSweepConfig), ); } export function createSweepConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateSweepConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSweepConfig' from JSON`, ); }