/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: c84aba3f9647 */ 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 EditAnswerRequestSourceType = { Document: "DOCUMENT", Assistant: "ASSISTANT", } as const; export type EditAnswerRequestSourceType = ClosedEnum< typeof EditAnswerRequestSourceType >; export type EditAnswerRequest = { /** * The opaque ID of the Answer. */ id: number; /** * Glean Document ID of the Answer. The Glean Document ID is supported for cases where the Answer ID isn't available. If both are available, using the Answer ID is preferred. */ docId?: string | undefined; 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?: EditAnswerRequestSourceType | undefined; /** * IDs of Collections to which a document is added. */ addedCollections?: Array | undefined; /** * IDs of Collections from which a document is removed. */ removedCollections?: Array | undefined; combinedAnswerText?: StructuredTextMutableProperties | undefined; }; /** @internal */ export const EditAnswerRequestSourceType$outboundSchema: z.ZodNativeEnum< typeof EditAnswerRequestSourceType > = z.nativeEnum(EditAnswerRequestSourceType); /** @internal */ export type EditAnswerRequest$Outbound = { id: number; docId?: string | undefined; 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; removedCollections?: Array | undefined; combinedAnswerText?: StructuredTextMutableProperties$Outbound | undefined; }; /** @internal */ export const EditAnswerRequest$outboundSchema: z.ZodType< EditAnswerRequest$Outbound, z.ZodTypeDef, EditAnswerRequest > = z.object({ id: z.number().int(), docId: z.string().optional(), 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: EditAnswerRequestSourceType$outboundSchema.optional(), addedCollections: z.array(z.number().int()).optional(), removedCollections: z.array(z.number().int()).optional(), combinedAnswerText: StructuredTextMutableProperties$outboundSchema.optional(), }); export function editAnswerRequestToJSON( editAnswerRequest: EditAnswerRequest, ): string { return JSON.stringify( EditAnswerRequest$outboundSchema.parse(editAnswerRequest), ); }