/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 44260ee91039 */ import * as z from "zod/v3"; export type ActivityEventParams = { /** * The HTML content of the page body. */ bodyContent?: string | undefined; /** * The full datasource instance name inferred from the URL of the event */ datasourceInstance?: string | undefined; /** * The datasource without the instance inferred from the URL of the event */ datasource?: string | undefined; /** * The instance only name of the datasource instance, e.g. 1 for jira_1, inferred from the URL of the event */ instanceOnlyName?: string | undefined; /** * Length in seconds of the activity. For VIEWS, this represents the amount the page was visible in the foreground. */ duration?: number | undefined; /** * The user's search query associated with a SEARCH. */ query?: string | undefined; /** * The referring URL of the VIEW or SEARCH. */ referrer?: string | undefined; /** * The page title associated with the URL of the event */ title?: string | undefined; /** * Indicates that the parameters are incomplete and more parameters may be sent with the same action+timestamp+URL in the future. This is used for sending the duration when a `VIEW` is finished. */ truncated?: boolean | undefined; }; /** @internal */ export type ActivityEventParams$Outbound = { bodyContent?: string | undefined; datasourceInstance?: string | undefined; datasource?: string | undefined; instanceOnlyName?: string | undefined; duration?: number | undefined; query?: string | undefined; referrer?: string | undefined; title?: string | undefined; truncated?: boolean | undefined; }; /** @internal */ export const ActivityEventParams$outboundSchema: z.ZodType< ActivityEventParams$Outbound, z.ZodTypeDef, ActivityEventParams > = z.object({ bodyContent: z.string().optional(), datasourceInstance: z.string().optional(), datasource: z.string().optional(), instanceOnlyName: z.string().optional(), duration: z.number().int().optional(), query: z.string().optional(), referrer: z.string().optional(), title: z.string().optional(), truncated: z.boolean().optional(), }); export function activityEventParamsToJSON( activityEventParams: ActivityEventParams, ): string { return JSON.stringify( ActivityEventParams$outboundSchema.parse(activityEventParams), ); }