/* * 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"; /** * One row of raw test data attached to a snapshot. * * @remarks * * For structured snapshots, every row carries the resource refs and the raw * JSON for that resource. For unstructured snapshots, a single row is returned * with `resourceId` and `resourceType` set to `null` and `rawJson` containing * the entire test-run JSON blob. */ export type VantaTestSnapshotRawTestDataRow = { /** * Identifier of the underlying resource the row was captured from. Null for * * @remarks * unstructured snapshots, which do not partition by resource. */ resourceId: string | null; /** * Specific resource kind for the row (e.g. `AwsIamUser`). Null for * * @remarks * unstructured snapshots. */ resourceType: string | null; /** * Raw JSON payload as emitted by the test runner. Shape varies by * * @remarks * `resourceType` for structured snapshots and matches the full test-run * blob for unstructured snapshots. */ rawJson?: any | undefined; }; /** @internal */ export const VantaTestSnapshotRawTestDataRow$inboundSchema: z.ZodType< VantaTestSnapshotRawTestDataRow, z.ZodTypeDef, unknown > = z.object({ resourceId: z.nullable(z.string()), resourceType: z.nullable(z.string()), rawJson: z.any().optional(), }); export function vantaTestSnapshotRawTestDataRowFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VantaTestSnapshotRawTestDataRow$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VantaTestSnapshotRawTestDataRow' from JSON`, ); }