/* * 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"; export type AutoReplenishConfig = { /** * The amount of credits to replenish when auto-replenish is triggered. */ amount?: number | undefined; /** * Whether the organization has auto-replenish enabled. */ enabled: boolean; /** * The threshold at which the organization's credit balance will be auto-replenished. */ threshold?: number | undefined; }; /** @internal */ export const AutoReplenishConfig$inboundSchema: z.ZodType< AutoReplenishConfig, z.ZodTypeDef, unknown > = z.object({ amount: z.number().int().optional(), enabled: z.boolean(), threshold: z.number().int().optional(), }); export function autoReplenishConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AutoReplenishConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AutoReplenishConfig' from JSON`, ); }