/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 9a0f9844c013 */ 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 { UserActivityInsight, UserActivityInsight$inboundSchema, } from "./useractivityinsight.js"; export type GleanAssistInsightsResponse = { /** * Unix timestamp of the last activity processed to make the response (in seconds since epoch UTC). */ lastLogTimestamp?: number | undefined; /** * Insights for all active users with respect to set of actions. */ activityInsights?: Array | undefined; /** * Total number of active users in the requested period. */ totalActiveUsers?: number | undefined; /** * List of datasource instances for which glean assist is enabled. */ datasourceInstances?: Array | undefined; /** * List of departments applicable for users tab. */ departments?: Array | undefined; }; /** @internal */ export const GleanAssistInsightsResponse$inboundSchema: z.ZodType< GleanAssistInsightsResponse, z.ZodTypeDef, unknown > = z.object({ lastLogTimestamp: z.number().int().optional(), activityInsights: z.array(UserActivityInsight$inboundSchema).optional(), totalActiveUsers: z.number().int().optional(), datasourceInstances: z.array(z.string()).optional(), departments: z.array(z.string()).optional(), }); export function gleanAssistInsightsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GleanAssistInsightsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GleanAssistInsightsResponse' from JSON`, ); }