/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Evidence, Evidence$inboundSchema } from "./evidence.js"; export const LabelSource = { Unknown: "", Censys: "censys", Recog: "recog", Wappalyzer: "wappalyzer", ThirdParty: "third_party", HtmlMetaExtractor: "html_meta_extractor", } as const; export type LabelSource = OpenEnum; export type Label = { confidence?: number | undefined; evidence?: Array | null | undefined; source?: LabelSource | undefined; value?: string | undefined; }; /** @internal */ export const LabelSource$inboundSchema: z.ZodType< LabelSource, z.ZodTypeDef, unknown > = openEnums.inboundSchema(LabelSource); /** @internal */ export const Label$inboundSchema: z.ZodType = z .object({ confidence: z.number().optional(), evidence: z.nullable(z.array(Evidence$inboundSchema)).optional(), source: LabelSource$inboundSchema.optional(), value: z.string().optional(), }); export function labelFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Label$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Label' from JSON`, ); }