/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const Status = { Enabled: "enabled", Disabled: "disabled", } as const; export type Status = ClosedEnum; export type PatchSweepConfig = { status?: Status | null | undefined; pushPaymentMethodID?: string | null | undefined; pullPaymentMethodID?: string | null | undefined; statementDescriptor?: string | null | undefined; minimumBalance?: string | null | undefined; }; /** @internal */ export const Status$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Status); /** @internal */ export const Status$outboundSchema: z.ZodNativeEnum = Status$inboundSchema; /** @internal */ export const PatchSweepConfig$inboundSchema: z.ZodType< PatchSweepConfig, z.ZodTypeDef, unknown > = z.object({ status: z.nullable(Status$inboundSchema).optional(), pushPaymentMethodID: z.nullable(z.string()).optional(), pullPaymentMethodID: z.nullable(z.string()).optional(), statementDescriptor: z.nullable(z.string()).optional(), minimumBalance: z.nullable(z.string()).optional(), }); /** @internal */ export type PatchSweepConfig$Outbound = { status?: string | null | undefined; pushPaymentMethodID?: string | null | undefined; pullPaymentMethodID?: string | null | undefined; statementDescriptor?: string | null | undefined; minimumBalance?: string | null | undefined; }; /** @internal */ export const PatchSweepConfig$outboundSchema: z.ZodType< PatchSweepConfig$Outbound, z.ZodTypeDef, PatchSweepConfig > = z.object({ status: z.nullable(Status$outboundSchema).optional(), pushPaymentMethodID: z.nullable(z.string()).optional(), pullPaymentMethodID: z.nullable(z.string()).optional(), statementDescriptor: z.nullable(z.string()).optional(), minimumBalance: z.nullable(z.string()).optional(), }); export function patchSweepConfigToJSON( patchSweepConfig: PatchSweepConfig, ): string { return JSON.stringify( PatchSweepConfig$outboundSchema.parse(patchSweepConfig), ); } export function patchSweepConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PatchSweepConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchSweepConfig' from JSON`, ); }