/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The outcome status of the test run. */ export const TestRunStatus = { Na: "NA", InProgress: "IN_PROGRESS", Fail: "FAIL", Pass: "PASS", Invalid: "INVALID", Disabled: "DISABLED", } as const; /** * The outcome status of the test run. */ export type TestRunStatus = ClosedEnum; /** * Evidence in the form of a Vanta automated test run snapshot. * * @remarks * * Unlike VantaTestEvidence (which represents a single file within a test run's * evidence packet), a snapshot represents the entire test-run bundle. Use the * dedicated snapshot detail endpoint to retrieve the files associated with a * snapshot. */ export type VantaTestSnapshotEvidence = { /** * 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; /** * The unique identifier for the test in Vanta's system. */ testId: string; /** * The unique identifier for the test run this snapshot was captured from. */ testRunId: string; /** * The title of the test run as displayed in Vanta. */ testRunTitle: string; /** * The outcome status of the test run. */ testRunStatus: TestRunStatus; /** * The date and time when the test was executed. * * @remarks * Format: ISO 8601 UTC timestamp. */ testRunExecutedAt: Date; }; /** @internal */ export const TestRunStatus$inboundSchema: z.ZodNativeEnum< typeof TestRunStatus > = z.nativeEnum(TestRunStatus); /** @internal */ export const VantaTestSnapshotEvidence$inboundSchema: z.ZodType< VantaTestSnapshotEvidence, z.ZodTypeDef, unknown > = z.object({ snapshotId: z.string(), testId: z.string(), testRunId: z.string(), testRunTitle: z.string(), testRunStatus: TestRunStatus$inboundSchema, testRunExecutedAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ), }); export function vantaTestSnapshotEvidenceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VantaTestSnapshotEvidence$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VantaTestSnapshotEvidence' from JSON`, ); }