/* * 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"; /** * A risk assessment snapshot available for an audit. * * @remarks * * Risk snapshots capture the state of an organization's risk register at a * point in time. Use the snapshot `id` with the `/audits/{auditId}/risks/{snapshotId}` * endpoint to retrieve the risk scenarios within a snapshot. */ export type RiskSnapshot = { /** * Unique identifier for the risk snapshot. */ id: string; /** * The date and time when this risk snapshot was created. */ createdAt: Date; }; /** @internal */ export const RiskSnapshot$inboundSchema: z.ZodType< RiskSnapshot, z.ZodTypeDef, unknown > = z.object({ id: z.string(), createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)), }); export function riskSnapshotFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RiskSnapshot$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RiskSnapshot' from JSON`, ); }