/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: e7752d13b39a */ import * as z from "zod/v3"; import { ContentDefinition, ContentDefinition$Outbound, ContentDefinition$outboundSchema, } from "./contentdefinition.js"; import { UserReferenceDefinition, UserReferenceDefinition$Outbound, UserReferenceDefinition$outboundSchema, } from "./userreferencedefinition.js"; /** * Describes a comment on a document */ export type CommentDefinition = { /** * The document specific id for the comment. This field is case insensitive and should not be more than 200 characters in length. */ id: string; /** * Describes how a user is referenced in a document. The user can be referenced by email or by a datasource specific id. */ author?: UserReferenceDefinition | undefined; /** * Describes text content or base64 encoded binary content */ content?: ContentDefinition | undefined; /** * The creation time, in epoch seconds. */ createdAt?: number | undefined; /** * The last updated time, in epoch seconds. */ updatedAt?: number | undefined; /** * Describes how a user is referenced in a document. The user can be referenced by email or by a datasource specific id. */ updatedBy?: UserReferenceDefinition | undefined; }; /** @internal */ export type CommentDefinition$Outbound = { id: string; author?: UserReferenceDefinition$Outbound | undefined; content?: ContentDefinition$Outbound | undefined; createdAt?: number | undefined; updatedAt?: number | undefined; updatedBy?: UserReferenceDefinition$Outbound | undefined; }; /** @internal */ export const CommentDefinition$outboundSchema: z.ZodType< CommentDefinition$Outbound, z.ZodTypeDef, CommentDefinition > = z.object({ id: z.string(), author: UserReferenceDefinition$outboundSchema.optional(), content: ContentDefinition$outboundSchema.optional(), createdAt: z.number().int().optional(), updatedAt: z.number().int().optional(), updatedBy: UserReferenceDefinition$outboundSchema.optional(), }); export function commentDefinitionToJSON( commentDefinition: CommentDefinition, ): string { return JSON.stringify( CommentDefinition$outboundSchema.parse(commentDefinition), ); }