/* * 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"; import { CPELifeCycle, CPELifeCycle$inboundSchema } from "./cpelifecycle.js"; export type Cpe = { cpe?: string | undefined; edition?: string | undefined; lifeCycle?: CPELifeCycle | undefined; part?: string | undefined; product?: string | undefined; update?: string | undefined; vendor?: string | undefined; version?: string | undefined; }; /** @internal */ export const Cpe$inboundSchema: z.ZodType = z .object({ cpe: z.string().optional(), edition: z.string().optional(), life_cycle: CPELifeCycle$inboundSchema.optional(), part: z.string().optional(), product: z.string().optional(), update: z.string().optional(), vendor: z.string().optional(), version: z.string().optional(), }).transform((v) => { return remap$(v, { "life_cycle": "lifeCycle", }); }); export function cpeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Cpe$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Cpe' from JSON`, ); }