/** @packageDocumentation * @module iModelHubClient */ import { GuidString } from "@bentley/bentleyjs-core"; import { AuthorizedClientRequestContext, WsgInstance, WsgQuery } from "@bentley/itwin-client"; import { IModelBaseHandler } from "./BaseHandler"; /** Information about the user, allowing to identify them based on their id. * @public */ export declare class HubUserInfo extends WsgInstance { /** Id of the user. */ id?: string; /** First name of the user. */ firstName?: string; /** Last name of the user. */ lastName?: string; /** Email address of the user. */ email?: string; } /** Statistics of user created and owned instances on the iModel. * @public */ export declare class UserStatistics extends HubUserInfo { /** Number of [[Briefcase]]s the user currently owns. */ briefcasesCount?: number; /** Number of [[Lock]]s the user currently owns. */ ownedLocksCount?: number; /** Number of [[ChangeSet]]s the user has pushed. */ pushedChangeSetsCount?: number; /** Date of the last [[ChangeSet]] the user has pushed to this iModel. */ lastChangeSetPushDate?: string; } /** * Query object for getting User Statistics. You can use this to modify the [[UserStatisticsHandler.get]] results. * @public */ export declare class UserStatisticsQuery extends WsgQuery { /** @internal */ protected _byId?: string; private _statisticsPrefix; private _queriedByIds; /** * Constructor for UserStatisticsQuery. */ constructor(); /** * Query single instance by its id. * @param id Id of the instance to query. * @returns This query. * @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) if id is undefined or empty. */ byId(id: string): this; /** * Used by iModelHub handlers to get the id that is queried. * @internal */ getId(): string | undefined; /** * Query User Statistics by ids. * @param ids Ids of the users. * @returns This query. * @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) or [IModelHubStatus.InvalidArgumentError]($bentley) if ids array is undefined or empty, or it contains undefined or empty values. */ byIds(ids: string[]): this; /** Select all statistics. */ selectAll(): this; /** Select currently owned [[Briefcase]]s count. */ selectBriefcasesCount(): this; /** Select total pushed [[ChangeSet]]s count. */ selectPushedChangeSetsCount(): this; /** Select currently owned [[Lock]]s count. */ selectOwnedLocksCount(): this; /** Select the last [[ChangeSet]] push date. */ selectLastChangeSetPushDate(): this; /** * Returns whether was object queried by ids or no * @internal */ get isQueriedByIds(): boolean; } /** * Handler for querying [[UserStatistics]]. Use [[UserInfoHandler.Statistics]] to get an instance of this class. * @public */ export declare class UserStatisticsHandler { private _handler; /** * Constructor for UserStatistics. Should use @see IModelClient instead of directly constructing this. * @param handler Handler for WSG requests. * @internal */ constructor(handler: IModelBaseHandler); /** Get relative url for UserStatistics requests. * @param iModelId Id of the iModel. See [[HubIModel]]. * @param userId Id of the user. */ private getRelativeUrl; /** Get [[UserStatistics]]. * @param requestContext The client request context. * @param iModelId Id of the iModel. See [[HubIModel]]. * @param query Optional query object to filter the queried [[UserStatistics]] or select different data from them. * @returns Array of [[UserStatistics]] for users matching the query. * @throws [Common iModelHub errors]($docs/learning/iModelHub/CommonErrors) */ get(requestContext: AuthorizedClientRequestContext, iModelId: GuidString, query?: UserStatisticsQuery): Promise; } /** Query object for getting [[HubUserInfo]]. You can use this to modify the [[UserInfoHandler.get]] results. * @public */ export declare class UserInfoQuery extends WsgQuery { private _queriedByIds; /** @internal */ protected _byId?: string; /** Query UserInfo by user ids. * @param ids Ids of the users. * @returns This query. * @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) or [IModelHubStatus.InvalidArgumentError]($bentley) if ids array is undefined or empty, or it contains undefined or empty values. */ byIds(ids: string[]): this; /** @internal */ get isQueriedByIds(): boolean; /** Query single instance by its id. * @param id Id of the instance to query. * @returns This query. * @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) if id is undefined or empty. */ byId(id: string): this; /** Used by iModelHub handlers to get the id that is queried. * @internal */ getId(): string | undefined; } /** Handler for querying [[HubUserInfo]]. Use [[IModelClient.Users]] to get an instance of this class. * @public */ export declare class UserInfoHandler { private _handler; /** Constructor for UserInfoHandler. * @param handler Handler for WSG requests. * @internal */ constructor(handler: IModelBaseHandler); /** Get the handler for querying [[UserStatistics]]. */ get statistics(): UserStatisticsHandler; /** Get relative url for UserInfo requests. * @param iModelId Id of the iModel. See [[HubIModel]]. * @param userId Id of the user. */ private getRelativeUrl; /** Get the information on users who have accessed the iModel. * @param requestContext The client request context. * @param iModelId Id of the iModel. See [[HubIModel]]. * @param query Optional query object to filter the queried users or select different data from them. * @throws [Common iModelHub errors]($docs/learning/iModelHub/CommonErrors) */ get(requestContext: AuthorizedClientRequestContext, iModelId: GuidString, query?: UserInfoQuery): Promise; } //# sourceMappingURL=Users.d.ts.map