/* * 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 { VantaTestSnapshotApiRequest, VantaTestSnapshotApiRequest$inboundSchema, } from "./vantatestsnapshotapirequest.js"; import { VantaTestSnapshotIntegration, VantaTestSnapshotIntegration$inboundSchema, } from "./vantatestsnapshotintegration.js"; import { VantaTestSnapshotOutOfScopeResources, VantaTestSnapshotOutOfScopeResources$inboundSchema, } from "./vantatestsnapshotoutofscoperesources.js"; import { VantaTestSnapshotRawTestDataRow, VantaTestSnapshotRawTestDataRow$inboundSchema, } from "./vantatestsnapshotrawtestdatarow.js"; export type Settings = { numericValue: number; unit: string | null; }; /** * SLA remediation policy attached to the test, or null when no SLA is set. */ export type SlaRemediation = { id: string; settings: Settings | null; }; /** * Detail response for a captured automated-test snapshot evidence row. * * @remarks * * Combines the test-level metadata (description, integrations, SLA * remediation) with a uniform raw-data array so external clients see the * same shape regardless of whether the snapshot was structured or * unstructured. */ export type VantaTestSnapshotEvidenceDetail = { /** * The unique identifier for the test in Vanta's system. */ testId: string; /** * The display name of the test. */ testName: string; /** * A short description of what the test checks. */ description: string; /** * Longer-form, formatted description of the test. Null when unset. */ evaluationCriteria: string | null; /** * Integrations whose data feeds the test. */ integrations: Array; /** * SLA remediation policy attached to the test, or null when no SLA is set. */ slaRemediation: SlaRemediation | null; /** * Raw test data captured at snapshot time. */ rawTestData: Array; /** * Resources excluded from the test at snapshot time, grouped by exclusion * * @remarks * reason. `testLevel` contains resources the customer disabled for the * test; `frameworkLevel` contains resources scoped out by the framework's * segment configuration. */ outOfScopeResources?: VantaTestSnapshotOutOfScopeResources | undefined; /** * API requests captured during the test run. Absent when the snapshot * * @remarks * data could not be loaded. Empty array when the test does not perform * API introspection. */ apiRequests?: Array | undefined; }; /** @internal */ export const Settings$inboundSchema: z.ZodType< Settings, z.ZodTypeDef, unknown > = z.object({ numericValue: z.number(), unit: z.nullable(z.string()), }); export function settingsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Settings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Settings' from JSON`, ); } /** @internal */ export const SlaRemediation$inboundSchema: z.ZodType< SlaRemediation, z.ZodTypeDef, unknown > = z.object({ id: z.string(), settings: z.nullable(z.lazy(() => Settings$inboundSchema)), }); export function slaRemediationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SlaRemediation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SlaRemediation' from JSON`, ); } /** @internal */ export const VantaTestSnapshotEvidenceDetail$inboundSchema: z.ZodType< VantaTestSnapshotEvidenceDetail, z.ZodTypeDef, unknown > = z.object({ testId: z.string(), testName: z.string(), description: z.string(), evaluationCriteria: z.nullable(z.string()), integrations: z.array(VantaTestSnapshotIntegration$inboundSchema), slaRemediation: z.nullable(z.lazy(() => SlaRemediation$inboundSchema)), rawTestData: z.array(VantaTestSnapshotRawTestDataRow$inboundSchema), outOfScopeResources: VantaTestSnapshotOutOfScopeResources$inboundSchema .optional(), apiRequests: z.array(VantaTestSnapshotApiRequest$inboundSchema).optional(), }); export function vantaTestSnapshotEvidenceDetailFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VantaTestSnapshotEvidenceDetail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VantaTestSnapshotEvidenceDetail' from JSON`, ); }