/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: de19ccbe1432 */ 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 { CountInfo, CountInfo$inboundSchema } from "./countinfo.js"; import { Person, Person$inboundSchema } from "./person.js"; /** * Activity e.g. search, home page visit or all. */ export const ActivityEnum = { All: "ALL", Search: "SEARCH", } as const; /** * Activity e.g. search, home page visit or all. */ export type ActivityEnum = OpenEnum; export type UserActivityInsight = { user: Person; /** * Activity e.g. search, home page visit or all. */ activity: ActivityEnum; /** * Unix timestamp of the last activity (in seconds since epoch UTC). */ lastActivityTimestamp?: number | undefined; activityCount?: CountInfo | undefined; activeDayCount?: CountInfo | undefined; }; /** @internal */ export const ActivityEnum$inboundSchema: z.ZodType< ActivityEnum, z.ZodTypeDef, unknown > = openEnums.inboundSchema(ActivityEnum); /** @internal */ export const UserActivityInsight$inboundSchema: z.ZodType< UserActivityInsight, z.ZodTypeDef, unknown > = z.object({ user: Person$inboundSchema, activity: ActivityEnum$inboundSchema, lastActivityTimestamp: z.number().int().optional(), activityCount: CountInfo$inboundSchema.optional(), activeDayCount: CountInfo$inboundSchema.optional(), }); export function userActivityInsightFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UserActivityInsight$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserActivityInsight' from JSON`, ); }