/* * 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"; import { VulnerableAssetScanner, VulnerableAssetScanner$inboundSchema, } from "./vulnerableassetscanner.js"; import { VulnerableAssetType, VulnerableAssetType$inboundSchema, } from "./vulnerableassettype.js"; export type VulnerableAsset = { /** * Unique identifier for the vulnerable asset. */ id: string; /** * Display name of the vulnerable asset. */ name: string; /** * VulnerableAssetType describes the types of assets a vulnerability is on. */ assetType: VulnerableAssetType; /** * Whether the vulnerable asset has been scanned. */ hasBeenScanned: boolean; /** * Only relevant for container repositories. This field sets the container image tag that vulnerabilities will be retrieved for. If null, the latest image will be retrieved. */ imageScanTag: string | null; /** * The integrations that are scanning this vulnerable asset. */ scanners: Array; }; /** @internal */ export const VulnerableAsset$inboundSchema: z.ZodType< VulnerableAsset, z.ZodTypeDef, unknown > = z.object({ id: z.string(), name: z.string(), assetType: VulnerableAssetType$inboundSchema, hasBeenScanned: z.boolean(), imageScanTag: z.nullable(z.string()), scanners: z.array(VulnerableAssetScanner$inboundSchema), }); export function vulnerableAssetFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VulnerableAsset$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VulnerableAsset' from JSON`, ); }