/** @packageDocumentation * @module iModelHubClient */ import { GuidString } from "@bentley/bentleyjs-core"; import { AuthorizedClientRequestContext, WsgInstance } from "@bentley/itwin-client"; import { IModelBaseHandler } from "./BaseHandler"; import { InstanceIdQuery } from "./HubQuery"; import { ThumbnailSize } from "./Thumbnails"; /** * Named Version is a specific [[ChangeSet]] given a name to differentiate it from others. It can be used to represent some significant milestone for the iModel (e.g. a review version). * @public */ export declare class Version extends WsgInstance { id?: GuidString; /** Description of the named Version. */ description?: string; /** Name of the named Version. Must be unique per iModel. */ name?: string; /** Id of the user that created the named Version. */ userCreated?: string; /** Date when the named Version was created. */ createdDate?: string; /** Id of the [[ChangeSet]] that the named Version was created for. */ changeSetId?: string; /** Set to true, if named Version is hidden. */ hidden?: boolean; /** * Id of the [[SmallThumbnail]] of the named Version. * @internal @deprecated */ smallThumbnailId?: GuidString; /** * Id of the [[LargeThumbnail]] of the named Version. * @internal @deprecated */ largeThumbnailId?: GuidString; /** Id of the application that created this named Version. */ applicationId?: string; /** Name of the application that created this named Version. */ applicationName?: string; } /** * Query object for getting [[Version]]s. You can use this to modify the [[VersionHandler.get]] results. * @public */ export declare class VersionQuery extends InstanceIdQuery { /** * Query [[Version]] by its name. * @param name Name of the Version. * @returns This query. * @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) if name is undefined or empty. */ byName(name: string): this; /** * Query version by its [[ChangeSet]] id. * @param changesetId Id of the ChangeSet. Empty ChangeSet id can be provided to query iModel's baseline version. * @returns This query. * @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) or [IModelHubStatus.InvalidArgumentError]($bentley) if changeSetId is undefined or not a valid [[ChangeSet.id]] format. */ byChangeSet(changeSetId: string): this; /** * Query will additionally select ids of [[Thumbnail]]s for given [[ThumbnailSize]]s. * @returns This query. * @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) or [IModelHubStatus.InvalidArgumentError]($bentley) if sizes array is undefined or empty. * @internal @deprecated */ selectThumbnailId(...sizes: ThumbnailSize[]): this; /** * Query will additionally select data about application that created this [[Version]]. * @returns This query. */ selectApplicationData(): this; /** * Query only not hidden versions. * @returns This query. */ notHidden(): this; } /** * Handler for managing [[Version]]s. Use [[IModelClient.Versions]] to get an instance of this class. * @public */ export declare class VersionHandler { private _handler; /** * Constructor for VersionHandler. * @param handler Handler for WSG requests. * @internal */ constructor(handler: IModelBaseHandler); /** Get relative url for Version requests. * @param iModelId Id of the iModel. See [[HubIModel]]. * @param versionId Id of the version. */ private getRelativeUrl; /** Get the named [[Version]]s of an iModel. Returned Versions are ordered from the latest [[ChangeSet]] to the oldest. * @param requestContext The client request context. * @param iModelId Id of the iModel. See [[HubIModel]]. * @param query Optional query object to filter the queried Versions or select different data from them. * @returns Versions that match the query. * @throws [WsgError]($itwin-client) with [WSStatus.InstanceNotFound]($bentley) if [[InstanceIdQuery.byId]] is used and a [[Version]] with the specified id could not be found. * @throws [Common iModelHub errors]($docs/learning/iModelHub/CommonErrors) */ get(requestContext: AuthorizedClientRequestContext, iModelId: GuidString, query?: VersionQuery): Promise; /** Create a named [[Version]] of an iModel. * @param requestContext The client request context. * @param iModelId Id of the iModel. See [[HubIModel]]. * @param changeSetId Id of the [[ChangeSet]] to create a named Version for. Empty ChangeSet id can be provided to create iModel's baseline version. * @param name Name of the new named Version. * @param description Description of the new named Version. * @returns Created Version instance. * @throws [[IModelHubError]] with [IModelHubStatus.UserDoesNotHavePermission]($bentley) if the user does not have ManageVersions permission. * @throws [[IModelHubError]] with [IModelHubStatus.ChangeSetDoesNotExist]($bentley) if the [[ChangeSet]] with specified changeSetId does not exist. * @throws [[IModelHubError]] with [IModelHubStatus.VersionAlreadyExists]($bentley) if a named [[Version]] already exists with the specified name. * @throws [[IModelHubError]] with [IModelHubStatus.ChangeSetAlreadyHasVersion]($bentley) if the [[ChangeSet]] with specified changeSetId already has a named [[Version]] associated with it. * @throws [Common iModelHub errors]($docs/learning/iModelHub/CommonErrors) */ create(requestContext: AuthorizedClientRequestContext, iModelId: GuidString, changeSetId: string, name: string, description?: string): Promise; /** Update the named [[Version]] of an iModel. Only the description can be changed when updating the named Version. * @param requestContext The client request context. * @param iModelId Id of the iModel. See [[HubIModel]]. * @param version Named version to update. * @returns Updated Version instance from iModelHub. * @throws [[IModelHubError]] with [IModelHubStatus.UserDoesNotHavePermission]($bentley) if the user does not have ManageVersions permission. * @throws [[IModelHubError]] with [IModelHubStatus.VersionAlreadyExists]($bentley) if a named [[Version]] already exists with the specified name. * @throws [Common iModelHub errors]($docs/learning/iModelHub/CommonErrors) */ update(requestContext: AuthorizedClientRequestContext, iModelId: GuidString, version: Version): Promise; } //# sourceMappingURL=Versions.d.ts.map