/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: c509f7933e80 */ 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 { Person, Person$inboundSchema } from "./person.js"; export type PerUserInsight = { person?: Person | undefined; /** * Total number of searches by this user over the specified time period. */ numSearches?: number | undefined; /** * Total number of chats by this user over the specified time period. */ numChats?: number | undefined; /** * Total number of active sessions by this user in a Glean client over the specified time period. */ numActiveSessions?: number | undefined; /** * Total number of Gleanbot responses marked useful by this user over the specified time period. */ numGleanbotUsefulResponses?: number | undefined; /** * Total number of days this user was an Active User over the specified time period. */ numDaysActive?: number | undefined; /** * Total number of summarized items by this user over the specified time period. */ numSummarizations?: number | undefined; /** * Total number of AI Answers interacted with by this user over the specified time period. */ numAiAnswers?: number | undefined; /** * Total number of agent runs for this user over the specified time period. */ numAgentRuns?: number | undefined; }; /** @internal */ export const PerUserInsight$inboundSchema: z.ZodType< PerUserInsight, z.ZodTypeDef, unknown > = z.object({ person: Person$inboundSchema.optional(), numSearches: z.number().int().optional(), numChats: z.number().int().optional(), numActiveSessions: z.number().int().optional(), numGleanbotUsefulResponses: z.number().int().optional(), numDaysActive: z.number().int().optional(), numSummarizations: z.number().int().optional(), numAiAnswers: z.number().int().optional(), numAgentRuns: z.number().int().optional(), }); export function perUserInsightFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PerUserInsight$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PerUserInsight' from JSON`, ); }