/* * 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"; export type Comment = { /** * The unique identifier for the comment */ id: string; /** * The unique identifier for the audit evidence related to the comment. */ auditEvidenceId: string; /** * The comment message */ text: string; /** * When the comment was created */ creationDate: Date; /** * When the comment was updated */ modificationDate: Date | null; /** * When the comment was deleted */ deletionDate: Date | null; /** * The email of the comment author. This acts as a unique identifier to map users between Vanta and external systems. */ email: string | null; /** * Human-readable display name of the comment author. * * @remarks * Null if the author's name is not available (e.g., user was deleted). * This enables correct author attribution in integrations where users cannot * be reliably matched across systems by email alone. */ authorName: string | null; }; /** @internal */ export const Comment$inboundSchema: z.ZodType = z.object({ id: z.string(), auditEvidenceId: z.string(), text: z.string(), creationDate: z.string().datetime({ offset: true }).transform(v => new Date(v) ), modificationDate: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), deletionDate: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), email: z.nullable(z.string()), authorName: z.nullable(z.string()), }); export function commentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Comment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Comment' from JSON`, ); }