/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 94d90ce484f6 */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { FeedEntry, FeedEntry$inboundSchema } from "./feedentry.js"; /** * Category of the result, one of the requested categories in incoming request. */ export const FeedResultCategory = { DocumentSuggestion: "DOCUMENT_SUGGESTION", DocumentSuggestionScenario: "DOCUMENT_SUGGESTION_SCENARIO", TrendingDocument: "TRENDING_DOCUMENT", UseCase: "USE_CASE", VerificationReminder: "VERIFICATION_REMINDER", Event: "EVENT", Announcement: "ANNOUNCEMENT", Mention: "MENTION", DatasourceAffinity: "DATASOURCE_AFFINITY", Recent: "RECENT", CompanyResource: "COMPANY_RESOURCE", Experimental: "EXPERIMENTAL", PeopleCelebrations: "PEOPLE_CELEBRATIONS", SocialLink: "SOCIAL_LINK", ExternalTasks: "EXTERNAL_TASKS", DisplayableList: "DISPLAYABLE_LIST", ZeroStateChatSuggestion: "ZERO_STATE_CHAT_SUGGESTION", ZeroStateChatToolSuggestion: "ZERO_STATE_CHAT_TOOL_SUGGESTION", ZeroStateWorkflowCreatedByMe: "ZERO_STATE_WORKFLOW_CREATED_BY_ME", ZeroStateWorkflowFavorites: "ZERO_STATE_WORKFLOW_FAVORITES", ZeroStateWorkflowPopular: "ZERO_STATE_WORKFLOW_POPULAR", ZeroStateWorkflowRecent: "ZERO_STATE_WORKFLOW_RECENT", ZeroStateWorkflowSuggestion: "ZERO_STATE_WORKFLOW_SUGGESTION", PersonalizedChatSuggestion: "PERSONALIZED_CHAT_SUGGESTION", DailyDigest: "DAILY_DIGEST", Task: "TASK", PlanMyDay: "PLAN_MY_DAY", EndMyDay: "END_MY_DAY", StarterKit: "STARTER_KIT", MidDayCatchUp: "MID_DAY_CATCH_UP", QuerySuggestion: "QUERY_SUGGESTION", WeeklyMeetings: "WEEKLY_MEETINGS", FollowUp: "FOLLOW_UP", MilestoneTimelineCheck: "MILESTONE_TIMELINE_CHECK", ProjectDiscussionDigest: "PROJECT_DISCUSSION_DIGEST", ProjectNextStep: "PROJECT_NEXT_STEP", } as const; /** * Category of the result, one of the requested categories in incoming request. */ export type FeedResultCategory = OpenEnum; export type FeedResult = { /** * Category of the result, one of the requested categories in incoming request. */ category: FeedResultCategory; primaryEntry: FeedEntry; /** * Secondary entries for the result e.g. suggested docs for the calendar, carousel. */ secondaryEntries?: Array | undefined; /** * Rank of the result. Rank is suggested by server. Client side rank may differ. */ rank?: number | undefined; }; /** @internal */ export const FeedResultCategory$inboundSchema: z.ZodType< FeedResultCategory, z.ZodTypeDef, unknown > = openEnums.inboundSchema(FeedResultCategory); /** @internal */ export const FeedResult$inboundSchema: z.ZodType< FeedResult, z.ZodTypeDef, unknown > = z.object({ category: FeedResultCategory$inboundSchema, primaryEntry: FeedEntry$inboundSchema, secondaryEntries: z.array(FeedEntry$inboundSchema).optional(), rank: z.number().int().optional(), }); export function feedResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FeedResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FeedResult' from JSON`, ); }