/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: b3990e3d854b */ 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"; /** * The action for the activity */ export const UserActivityAction = { Add: "ADD", AddReminder: "ADD_REMINDER", Click: "CLICK", Comment: "COMMENT", Delete: "DELETE", Dismiss: "DISMISS", Edit: "EDIT", Mention: "MENTION", Move: "MOVE", Other: "OTHER", Restore: "RESTORE", Unknown: "UNKNOWN", Verify: "VERIFY", View: "VIEW", } as const; /** * The action for the activity */ export type UserActivityAction = OpenEnum; export type UserActivity = { actor?: Person | undefined; /** * Unix timestamp of the activity (in seconds since epoch UTC). */ timestamp?: number | undefined; /** * The action for the activity */ action?: UserActivityAction | undefined; aggregateVisitCount?: CountInfo | undefined; }; /** @internal */ export const UserActivityAction$inboundSchema: z.ZodType< UserActivityAction, z.ZodTypeDef, unknown > = openEnums.inboundSchema(UserActivityAction); /** @internal */ export const UserActivity$inboundSchema: z.ZodType< UserActivity, z.ZodTypeDef, unknown > = z.object({ actor: Person$inboundSchema.optional(), timestamp: z.number().int().optional(), action: UserActivityAction$inboundSchema.optional(), aggregateVisitCount: CountInfo$inboundSchema.optional(), }); export function userActivityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UserActivity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserActivity' from JSON`, ); }