/** @packageDocumentation * @module iModelHubClient */ import { GuidString } from "@bentley/bentleyjs-core"; import { AuthorizedClientRequestContext, WsgInstance, WsgQuery } from "@bentley/itwin-client"; import { IModelBaseHandler } from "./BaseHandler"; /** [[CheckpointV2]] creation state. * @internal */ export declare enum CheckpointV2State { /** CheckpointV2 creation is in progress. */ InProgress = 0, /** CheckpointV2 creation was successful. */ Successful = 1, /** CheckpointV2 creation failed. */ Failed = 2, /** CheckpointV2 is not generated. It was never created or was deleted. This state is set by the server. It is possible to recreate CheckpointV2. */ NotGenerated = 3 } /** [[CheckpointV2]] generation error id. * @internal */ export declare enum CheckpointV2ErrorId { UnknownError = 0, FileDownloadError = 1, FileUploadError = 2, FileOpenError = 3, ApplyChangeSetError = 4, TimeOut = 5 } /** * Checkpoint is a copy of the master file, that is intended to be read-only and reduces amount of merging required to get an iModel to a specific previous state. * [[CheckpointV2]] is stored as a set of binary blocks, while [[Checkpoint]] is a single binary file. * @internal */ export declare class CheckpointV2 extends WsgInstance { /** Id of the last [[ChangeSet]] that was applied into this checkpoint file. */ changeSetId?: string; /** State of checkpoint generation. */ state?: CheckpointV2State; /** Container AccessKey account name of the storage that can be used to download the checkpoint blocks from iModelHub. See [[CheckpointV2Query.selectContainerAccessKey]]. */ containerAccessKeyAccount?: string; /** Container AccessKey container name of the storage that can be used to download the checkpoint blocks from iModelHub. See [[CheckpointV2Query.selectContainerAccessKey]]. */ containerAccessKeyContainer?: string; /** Container AccessKey SAS token of the storage that can be used to download the checkpoint blocks from iModelHub. See [[CheckpointV2Query.selectContainerAccessKey]]. */ containerAccessKeySAS?: string; /** Container AccessKey database name of the storage that can be used to download the checkpoint blocks from iModelHub. See [[CheckpointV2Query.selectContainerAccessKey]]. */ containerAccessKeyDbName?: string; /** Error type that occurred while generating [[CheckpointV2]]. See [[CheckpointV2Query.selectCheckpointV2FailureInfo]] to query failure info. */ failureInfoErrorId?: CheckpointV2ErrorId; /** Id of the [[ChangeSet]] which failed to apply when [[CheckpointV2]] was generated. See [[CheckpointV2Query.selectCheckpointV2FailureInfo]] to query failure info. */ failureInfoFailedChangeSetId?: string; /** [[CheckpointV2]] generation job start date. This property can not be set by the user. See [[CheckpointV2Query.selectCheckpointV2FailureInfo]] to query failure info. */ failureInfoStartDate?: string; /** [[CheckpointV2]] generation job failure date. This property can not be set by the user. See [[CheckpointV2Query.selectCheckpointV2FailureInfo]] to query failure info. */ failureInfoFailureDate?: string; /** [[CheckpointV2]] generation job id. It should be unique for every job. See [[CheckpointV2Query.selectCheckpointV2FailureInfo]] to query failure info. */ failureInfoJobId?: string; /** [[CheckpointV2]] generation job duration in milliseconds. See [[CheckpointV2Query.selectCheckpointV2FailureInfo]] to query failure info. */ failureInfoJobRunDurationMS?: string; } /** * Query object for getting [[CheckpointV2]]s. You can use this to modify the [[CheckpointV2Handler.get]] results. * @internal */ export declare class CheckpointV2Query extends WsgQuery { /** Query will return [[CheckpointV2]] with specified [[ChangeSet]] id. * @returns This query. */ byChangeSetId(changeSetId: string): this; /** Query will return closest [[CheckpointV2]] to target [[ChangeSet]] that does not exceed the specified ChangeSet. * This query returns a closest CheckpointV2 that will reach target ChangeSet by only merging forward. This resets all previously set filters. * @returns This query. */ precedingCheckpointV2(targetChangeSetId: string): this; /** Query will return [[CheckpointV2]] with specified state. * @returns This query. */ byState(state: CheckpointV2State): this; /** Query will additionally select [[CheckpointV2]] container access key to download [[CheckpointV2]] blocks. * @returns This query. */ selectContainerAccessKey(): this; /** Query will additionally select failure info for failed [[CheckpointV2]]. * @returns This query. */ selectFailureInfo(): this; } /** * Handler for managing [[CheckpointV2]]s. Use [[IModelClient.checkpointsV2]] to get an instance of this class. * In most cases, you should use [BriefcaseDb]($backend) methods instead. * @internal */ export declare class CheckpointV2Handler { private _handler; /** Constructor for CheckpointV2Handler. Use [[IModelClient]] instead of directly constructing this. * @param handler Handler for WSG requests. * @internal */ constructor(handler: IModelBaseHandler); /** Get relative url for [[CheckpointV2]] requests. * @param iModelId Id of the iModel. See [[HubIModel]]. * @param briefcaseId Id of the checkpoint. * @internal */ private getRelativeUrl; /** Get the [[CheckpointV2]]s. * @param requestContext The client request context * @param iModelId Id of the iModel. See [[HubIModel]]. * @param query Optional query object to filter the queried [[CheckpointV2]]s or select different data from them. * @returns Checkpoints that match the query. * @throws [Common iModelHub errors]($docs/learning/iModelHub/CommonErrors) */ get(requestContext: AuthorizedClientRequestContext, iModelId: GuidString, query?: CheckpointV2Query): Promise; /** Create a [[CheckpointV2]] for the specified iModel. * @param requestContext The client request context * @param iModelId Id of the iModel. See [[HubIModel]]. * @param checkpoint [[CheckpointV2]] instance to create. Requires changeSetId to be set. [[CheckpointV2]] is always created with state 'InProgress'. * @returns The created [[CheckpointV2]] instance from iModelHub. Container AccessKey is always returned. * @throws [[IModelHubError]] with [IModelHubStatus.CheckpointAlreadyExists]($bentley) if [[CheckpointV2]] for a given [[ChangeSet]] was already created. * @throws [Common iModelHub errors]($docs/learning/iModelHub/CommonErrors) * @internal */ create(requestContext: AuthorizedClientRequestContext, iModelId: GuidString, checkpoint: CheckpointV2): Promise; /** Update the [[CheckpointV2]] of an iModel. * @param requestContext The client request context. * @param iModelId Id of the iModel. See [[HubIModel]]. * @param checkpoint [[CheckpointV2]] to update. Requires wsgId set to existing [[CheckpointV2]] instance. * @returns Updated [[CheckpointV2]] instance from iModelHub. Container AccessKey is returned if [[CheckpointV2]] state is 'InProgress'. * @throws [[IModelHubError]] with [IModelHubStatus.CheckpointDoesNotExist]($bentley) if [[CheckpointV2]] with a given wsgId does not exist. * @throws [Common iModelHub errors]($docs/learning/iModelHub/CommonErrors) * @internal */ update(requestContext: AuthorizedClientRequestContext, iModelId: GuidString, checkpoint: CheckpointV2): Promise; } //# sourceMappingURL=CheckpointsV2.d.ts.map