/* * 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 { AuditEvidenceState, AuditEvidenceState$inboundSchema, } from "./auditevidencestate.js"; import { AuditEvidenceType, AuditEvidenceType$inboundSchema, } from "./auditevidencetype.js"; import { EvidenceControl, EvidenceControl$inboundSchema, } from "./evidencecontrol.js"; export type Evidence = { /** * Vanta internal reference to evidence */ id: string; /** * This is a static UUID to map Audit Firm controls to Vanta controls */ externalId: string; status: AuditEvidenceState; /** * Mutable name for evidence. Not guaranteed to be unique. */ name: string; /** * The date this Audit Evidence was deleted */ deletionDate: Date | null; /** * The date this Audit Evidence was created */ creationDate: Date; /** * Point in time that status was last updated */ statusUpdatedDate: Date; /** * The outcome of the automated test run, for Test-type evidence */ testStatus: string | null; evidenceType: AuditEvidenceType; /** * Unique identifier for evidence */ evidenceId: string; /** * The controls associated to this evidence */ relatedControls: Array; /** * The description for the evidence. It will be set to null if the evidence is deleted */ description: string | null; }; /** @internal */ export const Evidence$inboundSchema: z.ZodType< Evidence, z.ZodTypeDef, unknown > = z.object({ id: z.string(), externalId: z.string(), status: AuditEvidenceState$inboundSchema, name: z.string(), deletionDate: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), creationDate: z.string().datetime({ offset: true }).transform(v => new Date(v) ), statusUpdatedDate: z.string().datetime({ offset: true }).transform(v => new Date(v) ), testStatus: z.nullable(z.string()), evidenceType: AuditEvidenceType$inboundSchema, evidenceId: z.string(), relatedControls: z.array(EvidenceControl$inboundSchema), description: z.nullable(z.string()), }); export function evidenceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Evidence$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Evidence' from JSON`, ); }