/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type NodeInfoV0 = { features?: Array | null | undefined; isHealthy?: boolean | undefined; latestMilestone?: number | undefined; latestUncommittedMilestone?: number | undefined; name?: string | undefined; neighbors?: number | undefined; tips?: number | undefined; version?: string | undefined; }; /** @internal */ export const NodeInfoV0$inboundSchema: z.ZodType< NodeInfoV0, z.ZodTypeDef, unknown > = z.object({ features: z.nullable(z.array(z.string())).optional(), is_healthy: z.boolean().optional(), latest_milestone: z.number().int().optional(), latest_uncommitted_milestone: z.number().int().optional(), name: z.string().optional(), neighbors: z.number().int().optional(), tips: z.number().int().optional(), version: z.string().optional(), }).transform((v) => { return remap$(v, { "is_healthy": "isHealthy", "latest_milestone": "latestMilestone", "latest_uncommitted_milestone": "latestUncommittedMilestone", }); }); export function nodeInfoV0FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NodeInfoV0$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NodeInfoV0' from JSON`, ); }