UNPKG

@itwin/imodels-client-authoring

Version:

iModels API client wrapper for applications that author iModels.

35 lines 1.86 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { BriefcaseOperations as ManagementBriefcaseOperations, } from "@itwin/imodels-client-management"; export class BriefcaseOperations extends ManagementBriefcaseOperations { /** * Acquires a new Briefcase with specified properties. Wraps the * {@link https://developer.bentley.com/apis/imodels-v2/operations/acquire-imodel-briefcase/ Acquire iModel Briefcase} * operation from iModels API. * @param {AcquireBriefcaseParams} params parameters for this operation. See {@link AcquireBriefcaseParams}. * @returns {Promise<Briefcase>} newly acquired Briefcase. See {@link Briefcase}. */ async acquire(params) { const acquireBriefcaseBody = this.getAcquireBriefcaseRequestBody(params.briefcaseProperties); const acquireBriefcaseResponse = await this.sendPostRequest({ authorization: params.authorization, url: this._options.urlFormatter.getBriefcaseListUrl({ iModelId: params.iModelId, }), body: acquireBriefcaseBody, headers: params.headers, }); const result = this.appendRelatedEntityCallbacks(params.authorization, acquireBriefcaseResponse.body.briefcase, params.headers); return result; } getAcquireBriefcaseRequestBody(briefcaseProperties) { if (!briefcaseProperties) return undefined; return { deviceName: briefcaseProperties.deviceName, }; } } //# sourceMappingURL=BriefcaseOperations.js.map