/* * 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 { InformationRequestEvidenceUnion, InformationRequestEvidenceUnion$inboundSchema, } from "./informationrequestevidenceunion.js"; import { InformationRequestSupportedEvidenceType, InformationRequestSupportedEvidenceType$inboundSchema, } from "./informationrequestsupportedevidencetype.js"; export type InformationRequestEvidence = { /** * The unique identifier for the evidence within Vanta's system. * * @remarks * Use it as the key when you sync evidence of any type. * Each evidence item has at most one file. A file attached to two * information requests appears as two evidence items with * different IDs. * Format: ObjectId as a string (e.g., "6890e473dce1da5d8406f5e7"). */ id: string; evidenceType: InformationRequestSupportedEvidenceType; /** * Timestamp when the evidence was made visible to the auditor. * * @remarks * Null if the customer has not yet shared this evidence with the auditor. * Evidence must be shared before the auditor can review it. * Format: ISO 8601 UTC timestamp. */ visibleToAuditorDate?: Date | null | undefined; /** * Timestamp when the evidence was created/uploaded. * * @remarks * Format: ISO 8601 UTC timestamp. */ creationDate: Date; /** * Timestamp when the evidence was last modified. * * @remarks * Format: ISO 8601 UTC timestamp. */ modificationDate: Date; /** * Timestamp when the evidence was soft-deleted. * * @remarks * Null if the evidence has not been deleted. * Soft deletes retain evidence in the system for audit history while hiding * it from normal operations. * Format: ISO 8601 UTC timestamp. */ deletionDate?: Date | null | undefined; /** * IDs of the audit segments this evidence was relevant to when captured. * * @remarks * Empty for uploaded, link and observation evidence, and for evidence captured before attribution was recorded. */ capturedSegmentIds: Array; /** * Union type representing the different forms of evidence content. * * @remarks * The specific type is determined by the `evidenceType` field in InformationRequestEvidence. */ evidence: InformationRequestEvidenceUnion; }; /** @internal */ export const InformationRequestEvidence$inboundSchema: z.ZodType< InformationRequestEvidence, z.ZodTypeDef, unknown > = z.object({ id: z.string(), evidenceType: InformationRequestSupportedEvidenceType$inboundSchema, visibleToAuditorDate: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), creationDate: z.string().datetime({ offset: true }).transform(v => new Date(v) ), modificationDate: z.string().datetime({ offset: true }).transform(v => new Date(v) ), deletionDate: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), capturedSegmentIds: z.array(z.string()), evidence: InformationRequestEvidenceUnion$inboundSchema, }); export function informationRequestEvidenceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InformationRequestEvidence$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InformationRequestEvidence' from JSON`, ); }