/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 981b9b97b9d4 */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { LabeledCountInfo, LabeledCountInfo$inboundSchema, } from "./labeledcountinfo.js"; import { PerUserAssistantInsight, PerUserAssistantInsight$inboundSchema, } from "./peruserassistantinsight.js"; export type AssistantInsightsResponse = { /** * Number of current Monthly Active Users, in the specified departments. */ monthlyActiveUsers?: number | undefined; /** * Number of current Weekly Active Users, in the specified departments. */ weeklyActiveUsers?: number | undefined; /** * Unix timestamp of the last update for the insights data in the response. */ lastUpdatedTs?: number | undefined; monthlyActiveUserTimeseries?: LabeledCountInfo | undefined; weeklyActiveUserTimeseries?: LabeledCountInfo | undefined; dailyActiveUserTimeseries?: LabeledCountInfo | undefined; /** * Number of current signed up employees in the specified departments, according to the Org Chart. */ totalSignups?: number | undefined; chatMessagesTimeseries?: LabeledCountInfo | undefined; summarizationsTimeseries?: LabeledCountInfo | undefined; aiAnswersTimeseries?: LabeledCountInfo | undefined; gleanbotInteractionsTimeseries?: LabeledCountInfo | undefined; perUserInsights?: Array | undefined; upvotesTimeseries?: LabeledCountInfo | undefined; downvotesTimeseries?: LabeledCountInfo | undefined; }; /** @internal */ export const AssistantInsightsResponse$inboundSchema: z.ZodType< AssistantInsightsResponse, z.ZodTypeDef, unknown > = z.object({ monthlyActiveUsers: z.number().int().optional(), weeklyActiveUsers: z.number().int().optional(), lastUpdatedTs: z.number().int().optional(), monthlyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), weeklyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), dailyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), totalSignups: z.number().int().optional(), chatMessagesTimeseries: LabeledCountInfo$inboundSchema.optional(), summarizationsTimeseries: LabeledCountInfo$inboundSchema.optional(), aiAnswersTimeseries: LabeledCountInfo$inboundSchema.optional(), gleanbotInteractionsTimeseries: LabeledCountInfo$inboundSchema.optional(), perUserInsights: z.array(PerUserAssistantInsight$inboundSchema).optional(), upvotesTimeseries: LabeledCountInfo$inboundSchema.optional(), downvotesTimeseries: LabeledCountInfo$inboundSchema.optional(), }); export function assistantInsightsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssistantInsightsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssistantInsightsResponse' from JSON`, ); }