/* * 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 VulnerabilityRemediation = { /** * Unique identifier for the remediation. */ id: string; /** * Unique identifier for the vulnerability that the remediation is for. */ vulnerabilityId: string; /** * Unique identifier for the vulnerable asset that the remediation is for. */ vulnerableAssetId: string; /** * Severity of the vulnerability. */ severity: string; /** * Date when the vulnerability was first detected. */ detectedDate: Date | null; /** * Date when the vulnerability should be remediated by. */ slaDeadlineDate: Date | null; /** * Date when the vulnerability was remediated. */ remediationDate: Date | null; }; /** @internal */ export const VulnerabilityRemediation$inboundSchema: z.ZodType< VulnerabilityRemediation, z.ZodTypeDef, unknown > = z.object({ id: z.string(), vulnerabilityId: z.string(), vulnerableAssetId: z.string(), severity: z.string(), detectedDate: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), slaDeadlineDate: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), remediationDate: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), }); export function vulnerabilityRemediationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VulnerabilityRemediation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VulnerabilityRemediation' from JSON`, ); }