/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: e0a7458d69ce */ import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; export const CollectionItemDescriptorItemType = { Document: "DOCUMENT", Text: "TEXT", Url: "URL", } as const; export type CollectionItemDescriptorItemType = ClosedEnum< typeof CollectionItemDescriptorItemType >; export type CollectionItemDescriptor = { /** * The optional name of the Collection item. */ name?: string | undefined; /** * A helpful description of why this CollectionItem is in the Collection that it's in. */ description?: string | undefined; /** * The emoji icon for this CollectionItem. Only used for Text type items. */ icon?: string | undefined; /** * The URL of the item being added. */ url?: string | undefined; /** * The Glean Document ID of the item being added if it's an indexed document. */ documentId?: string | undefined; /** * The (optional) ItemId of the next CollectionItem in sequence. If omitted, will be added to the end of the Collection */ newNextItemId?: string | undefined; itemType?: CollectionItemDescriptorItemType | undefined; }; /** @internal */ export const CollectionItemDescriptorItemType$outboundSchema: z.ZodNativeEnum< typeof CollectionItemDescriptorItemType > = z.nativeEnum(CollectionItemDescriptorItemType); /** @internal */ export type CollectionItemDescriptor$Outbound = { name?: string | undefined; description?: string | undefined; icon?: string | undefined; url?: string | undefined; documentId?: string | undefined; newNextItemId?: string | undefined; itemType?: string | undefined; }; /** @internal */ export const CollectionItemDescriptor$outboundSchema: z.ZodType< CollectionItemDescriptor$Outbound, z.ZodTypeDef, CollectionItemDescriptor > = z.object({ name: z.string().optional(), description: z.string().optional(), icon: z.string().optional(), url: z.string().optional(), documentId: z.string().optional(), newNextItemId: z.string().optional(), itemType: CollectionItemDescriptorItemType$outboundSchema.optional(), }); export function collectionItemDescriptorToJSON( collectionItemDescriptor: CollectionItemDescriptor, ): string { return JSON.stringify( CollectionItemDescriptor$outboundSchema.parse(collectionItemDescriptor), ); }