import { ITGlueClient } from '../client'; import { QueryUtilOptions, QueryParams, BaseListResponse, BaseItemResponse, UserMetricResource } from '../types'; /** * UserMetrics resource module for IT Glue API * * Provides methods to interact with the /user_metrics endpoint. * User metrics represent activity and usage statistics for IT Glue users, * providing insights into user engagement, productivity, and system utilization. * These metrics help administrators monitor user activity, track adoption, * and analyze usage patterns across the organization. * * **Note: This is a read-only resource.** User metrics cannot be created, * updated, or deleted through the API as they are automatically generated * and maintained by IT Glue based on user activity and system interactions. * * ## Related Resources * User metrics are commonly used with: * - {@link Users} - User accounts being measured and analyzed * - {@link Organizations} - Organizations where users are active * - {@link Groups} - User groups and permission levels being tracked * - {@link ContactTypes} - Role classifications for user activity analysis * - {@link Configurations} - IT assets users interact with most frequently * - {@link Documents} - Documents users create, view, and modify * - {@link FlexibleAssets} - Custom assets users work with regularly * - {@link Passwords} - Password-related user activity and access patterns * - {@link Tags} - Categorization used in user activity tracking * - {@link Exports} - Data export activities initiated by users * - {@link Attachments} - File attachments users upload and access * - {@link RelatedItems} - Resource relationships users create and manage * * @see {@link Users#list} for retrieving user account information * @see {@link Organizations#list} for retrieving organizational data * @see {@link Groups#list} for retrieving user group information * @see {@link Documents#list} for retrieving user document activity * * @example * import { ITGlueClient } from '../client'; * import { UserMetrics } from './resources/user-metrics'; * * const client = new ITGlueClient({ apiKey: 'your-api-key' }); * const userMetrics = new UserMetrics(client); * * // List user metrics * const list = await userMetrics.list(); * * // Get a single user metric * const metric = await userMetrics.get('123'); * * @category System & Audit */ export declare class UserMetrics { private client; private basePath; private paginationUtil; /** * Create a UserMetrics resource instance * @param {ITGlueClient} client - ITGlueClient instance */ constructor(client: ITGlueClient); /** * List all user metrics * * Retrieves a list of user activity and usage metrics. This read-only data * provides insights into user engagement, productivity patterns, and system * utilization across your IT Glue organization. Use filtering options to * analyze specific users, time periods, or activity types. * * @param {QueryUtilOptions} [options] - Optional query parameters (filter, sort, page, etc.) * @param {boolean} [allPages=false] - If true, fetches all pages automatically * @returns {Promise>} List of user metrics and pagination metadata * @example * // List all user metrics * await userMetrics.list(); * @example * // List metrics for a specific user * await userMetrics.list({ * filter: { user_id: '123' }, * sort: '-created_at' * }); * @example * // List metrics with time period filtering and pagination * await userMetrics.list({ * filter: { * created_at: '2024-01-01..2024-01-31', * metric_type: 'login_activity' * }, * page: { number: 1, size: 50 }, * include: ['user'] * }); */ list(options?: QueryUtilOptions, allPages?: boolean): Promise>; /** * Get a single user metric by ID * * Retrieves detailed information about a specific user metric entry. * This provides comprehensive activity data for analysis of user behavior, * productivity patterns, and system engagement. Useful for generating * detailed user activity reports and usage analytics. * * @param {string} id - User metric ID (required) * @param {QueryParams} [params] - Optional query parameters * @returns {Promise>} User metric resource * @throws {Error} When metric not found (404) or access denied (403) * @example * // Get a specific user metric * const metric = await userMetrics.get('123'); * @example * // Get metric with user information included * const metric = await userMetrics.get('123', { * include: ['user', 'organization'] * }); * @example * // Error handling for metric retrieval * try { * const metric = await userMetrics.get('invalid-id'); * } catch (error) { * if (error.response?.status === 404) { * console.log('User metric not found'); * } else if (error.response?.status === 403) { * console.log('Access denied to user metrics'); * } * } */ get(id: string, params?: QueryParams): Promise>; }