/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 8aa9174883fb */ 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 { CurrentActiveUsers, CurrentActiveUsers$inboundSchema, } from "./currentactiveusers.js"; import { InsightsChatSummary, InsightsChatSummary$inboundSchema, } from "./insightschatsummary.js"; import { InsightsSearchSummary, InsightsSearchSummary$inboundSchema, } from "./insightssearchsummary.js"; import { LabeledCountInfo, LabeledCountInfo$inboundSchema, } from "./labeledcountinfo.js"; import { PerUserInsight, PerUserInsight$inboundSchema, } from "./peruserinsight.js"; export type InsightsOverviewResponse = { /** * 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; /** * Department name(s). */ departments?: Array | undefined; /** * Number of current employees in the specified departments, according to the Org Chart. */ employeeCount?: number | undefined; /** * Number of current signed up employees in the specified departments, according to the Org Chart. */ totalSignups?: number | undefined; searchSummary?: InsightsSearchSummary | undefined; chatSummary?: InsightsChatSummary | undefined; searchActiveUsers?: CurrentActiveUsers | undefined; assistantActiveUsers?: CurrentActiveUsers | undefined; agentsActiveUsers?: CurrentActiveUsers | undefined; extensionSummary?: CurrentActiveUsers | undefined; ugcSummary?: CurrentActiveUsers | undefined; /** * Unix timestamp of the last update for the insights data in the response. */ lastUpdatedTs?: number | undefined; /** * Search session satisfaction rate, over the specified time period in the specified departments. */ searchSessionSatisfaction?: number | undefined; monthlyActiveUserTimeseries?: LabeledCountInfo | undefined; weeklyActiveUserTimeseries?: LabeledCountInfo | undefined; dailyActiveUserTimeseries?: LabeledCountInfo | undefined; searchMonthlyActiveUserTimeseries?: LabeledCountInfo | undefined; searchWeeklyActiveUserTimeseries?: LabeledCountInfo | undefined; searchDailyActiveUserTimeseries?: LabeledCountInfo | undefined; assistantMonthlyActiveUserTimeseries?: LabeledCountInfo | undefined; assistantWeeklyActiveUserTimeseries?: LabeledCountInfo | undefined; assistantDailyActiveUserTimeseries?: LabeledCountInfo | undefined; agentsMonthlyActiveUserTimeseries?: LabeledCountInfo | undefined; agentsWeeklyActiveUserTimeseries?: LabeledCountInfo | undefined; agentsDailyActiveUserTimeseries?: LabeledCountInfo | undefined; searchesTimeseries?: LabeledCountInfo | undefined; assistantInteractionsTimeseries?: LabeledCountInfo | undefined; agentRunsTimeseries?: LabeledCountInfo | undefined; /** * Counts of search result clicks, by datasource, over the specified time period in the specified departments. */ searchDatasourceCounts?: { [k: string]: number } | undefined; /** * Counts of cited documents in chat, by datasource, over the specified time period in the specified departments. */ chatDatasourceCounts?: { [k: string]: number } | undefined; /** * Per-user insights, over the specified time period in the specified departments. All current users in the organization who have signed into Glean at least once are included. */ perUserInsights?: Array | undefined; }; /** @internal */ export const InsightsOverviewResponse$inboundSchema: z.ZodType< InsightsOverviewResponse, z.ZodTypeDef, unknown > = z.object({ monthlyActiveUsers: z.number().int().optional(), weeklyActiveUsers: z.number().int().optional(), departments: z.array(z.string()).optional(), employeeCount: z.number().int().optional(), totalSignups: z.number().int().optional(), searchSummary: InsightsSearchSummary$inboundSchema.optional(), chatSummary: InsightsChatSummary$inboundSchema.optional(), searchActiveUsers: CurrentActiveUsers$inboundSchema.optional(), assistantActiveUsers: CurrentActiveUsers$inboundSchema.optional(), agentsActiveUsers: CurrentActiveUsers$inboundSchema.optional(), extensionSummary: CurrentActiveUsers$inboundSchema.optional(), ugcSummary: CurrentActiveUsers$inboundSchema.optional(), lastUpdatedTs: z.number().int().optional(), searchSessionSatisfaction: z.number().optional(), monthlyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), weeklyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), dailyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), searchMonthlyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), searchWeeklyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), searchDailyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), assistantMonthlyActiveUserTimeseries: LabeledCountInfo$inboundSchema .optional(), assistantWeeklyActiveUserTimeseries: LabeledCountInfo$inboundSchema .optional(), assistantDailyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), agentsMonthlyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), agentsWeeklyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), agentsDailyActiveUserTimeseries: LabeledCountInfo$inboundSchema.optional(), searchesTimeseries: LabeledCountInfo$inboundSchema.optional(), assistantInteractionsTimeseries: LabeledCountInfo$inboundSchema.optional(), agentRunsTimeseries: LabeledCountInfo$inboundSchema.optional(), searchDatasourceCounts: z.record(z.number().int()).optional(), chatDatasourceCounts: z.record(z.number().int()).optional(), perUserInsights: z.array(PerUserInsight$inboundSchema).optional(), }); export function insightsOverviewResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InsightsOverviewResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InsightsOverviewResponse' from JSON`, ); }