/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 2c5391b1d6e8 */ import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; import { DocumentSpecUnion, DocumentSpecUnion$Outbound, DocumentSpecUnion$outboundSchema, } from "./documentspecunion.js"; import { FacetFilter, FacetFilter$Outbound, FacetFilter$outboundSchema, } from "./facetfilter.js"; import { StructuredTextMutableProperties, StructuredTextMutableProperties$Outbound, StructuredTextMutableProperties$outboundSchema, } from "./structuredtextmutableproperties.js"; import { UserRoleSpecification, UserRoleSpecification$Outbound, UserRoleSpecification$outboundSchema, } from "./userrolespecification.js"; export const AnswerCreationDataSourceType = { Document: "DOCUMENT", Assistant: "ASSISTANT", } as const; export type AnswerCreationDataSourceType = ClosedEnum< typeof AnswerCreationDataSourceType >; export type AnswerCreationData = { question?: string | undefined; /** * Additional ways of phrasing this question. */ questionVariations?: Array | undefined; /** * The plain text answer to the question. */ bodyText?: string | undefined; /** * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. * * @deprecated field: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Answer Boards no longer supported. */ boardId?: number | undefined; /** * Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. */ audienceFilters?: Array | undefined; /** * A list of user roles for the answer added by the owner. */ addedRoles?: Array | undefined; /** * A list of user roles for the answer removed by the owner. */ removedRoles?: Array | undefined; /** * A list of roles for this answer explicitly granted by an owner, editor, or admin. */ roles?: Array | undefined; sourceDocumentSpec?: DocumentSpecUnion | undefined; sourceType?: AnswerCreationDataSourceType | undefined; /** * IDs of Collections to which a document is added. */ addedCollections?: Array | undefined; combinedAnswerText?: StructuredTextMutableProperties | undefined; }; /** @internal */ export const AnswerCreationDataSourceType$outboundSchema: z.ZodNativeEnum< typeof AnswerCreationDataSourceType > = z.nativeEnum(AnswerCreationDataSourceType); /** @internal */ export type AnswerCreationData$Outbound = { question?: string | undefined; questionVariations?: Array | undefined; bodyText?: string | undefined; boardId?: number | undefined; audienceFilters?: Array | undefined; addedRoles?: Array | undefined; removedRoles?: Array | undefined; roles?: Array | undefined; sourceDocumentSpec?: DocumentSpecUnion$Outbound | undefined; sourceType?: string | undefined; addedCollections?: Array | undefined; combinedAnswerText?: StructuredTextMutableProperties$Outbound | undefined; }; /** @internal */ export const AnswerCreationData$outboundSchema: z.ZodType< AnswerCreationData$Outbound, z.ZodTypeDef, AnswerCreationData > = z.object({ question: z.string().optional(), questionVariations: z.array(z.string()).optional(), bodyText: z.string().optional(), boardId: z.number().int().optional(), audienceFilters: z.array(FacetFilter$outboundSchema).optional(), addedRoles: z.array(UserRoleSpecification$outboundSchema).optional(), removedRoles: z.array(UserRoleSpecification$outboundSchema).optional(), roles: z.array(UserRoleSpecification$outboundSchema).optional(), sourceDocumentSpec: DocumentSpecUnion$outboundSchema.optional(), sourceType: AnswerCreationDataSourceType$outboundSchema.optional(), addedCollections: z.array(z.number().int()).optional(), combinedAnswerText: StructuredTextMutableProperties$outboundSchema.optional(), }); export function answerCreationDataToJSON( answerCreationData: AnswerCreationData, ): string { return JSON.stringify( AnswerCreationData$outboundSchema.parse(answerCreationData), ); }