/* * 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 { VantaTestFileType, VantaTestFileType$inboundSchema, } from "./vantatestfiletype.js"; import { VantaTestRunStatus, VantaTestRunStatus$inboundSchema, } from "./vantatestrunstatus.js"; /** * The evidence file for this test run. */ export type VantaTestEvidenceFile = { /** * The MIME type of the evidence file. * * @remarks * Common types: "application/pdf" for workpapers, "text/csv" for raw data */ mimeType: string; /** * A presigned URL for downloading the evidence file. * * @remarks * This URL is temporary and expires after a limited time. * Request a new evidence list to get a fresh URL if expired. */ url: string; }; /** * Evidence in the form of a Vanta automated test run. * * @remarks * Vanta Tests are automated compliance tests with metadata like test status, * execution time, and file type. Tests generate evidence files that can be * workpapers, raw data, or API request logs. * Each file in a snapshot is returned as a separate evidence item. These * items share `testId` and `snapshotId` and differ by `fileType`. */ export type VantaTestEvidence = { /** * The title of the test run as displayed in Vanta. */ title: string; /** * The unique identifier for the test in Vanta's system. */ testId: string; /** * The unique identifier for the point-in-time capture of this test run's evidence. * * @remarks * A snapshot is an immutable record of all files (workpapers, raw data, etc.) * generated during a single test execution. */ snapshotId: string; testRunStatus: VantaTestRunStatus; /** * The date and time when the test was executed. * * @remarks * Format: ISO 8601 UTC timestamp. */ executedAt: Date; fileType: VantaTestFileType; /** * The evidence file for this test run. */ file: VantaTestEvidenceFile; }; /** @internal */ export const VantaTestEvidenceFile$inboundSchema: z.ZodType< VantaTestEvidenceFile, z.ZodTypeDef, unknown > = z.object({ mimeType: z.string(), url: z.string(), }); export function vantaTestEvidenceFileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VantaTestEvidenceFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VantaTestEvidenceFile' from JSON`, ); } /** @internal */ export const VantaTestEvidence$inboundSchema: z.ZodType< VantaTestEvidence, z.ZodTypeDef, unknown > = z.object({ title: z.string(), testId: z.string(), snapshotId: z.string(), testRunStatus: VantaTestRunStatus$inboundSchema, executedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)), fileType: VantaTestFileType$inboundSchema, file: z.lazy(() => VantaTestEvidenceFile$inboundSchema), }); export function vantaTestEvidenceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VantaTestEvidence$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VantaTestEvidence' from JSON`, ); }