/* * 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 comment on an information request enables communication between auditors * * @remarks * and customers regarding evidence requirements and submissions. * * These threaded discussions help clarify requests, explain or resolve questions about evidence, * and are always visible to both parties once created. */ export type InformationRequestComment = { /** * The unique identifier for the comment within Vanta's system. * * @remarks * Format: ObjectId as a string (e.g., "6890e473dce1da5d8406f5e7"). */ id: string; /** * The comment message content. * * @remarks * Can include explanations, questions, or clarifications about the information request. */ text: string; /** * Timestamp when the comment was created. * * @remarks * Format: ISO 8601 UTC timestamp. */ creationDate: Date; /** * Timestamp when the comment was last edited. * * @remarks * Null if the comment has never been modified. * Format: ISO 8601 UTC timestamp. */ modificationDate: Date | null; /** * Timestamp when the comment was soft-deleted. * * @remarks * Null if the comment has not been deleted. * Soft deletes retain the comment for audit history while hiding it from normal operations. * Format: ISO 8601 UTC timestamp. */ deletionDate: Date | null; /** * Email address of the comment author. * * @remarks * This email uniquely identifies users between Vanta and external audit systems. * Null when the comment author can't be matched to a Vanta user. */ 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 InformationRequestComment$inboundSchema: z.ZodType< InformationRequestComment, z.ZodTypeDef, unknown > = z.object({ id: 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 informationRequestCommentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InformationRequestComment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InformationRequestComment' from JSON`, ); }