UNPKG

@itwin/clash-detection-client

Version:

Clash Detection client for the iTwin platform

29 lines 1.66 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { OperationUtils } from "../OperationUtils"; import { OperationsBase } from "../../base/OperationsBase"; export class ResultOperations extends OperationsBase { constructor(options) { super(options); } /** * Gets a Result identified by id. This method returns a Result in its full representation. * Wraps the {@link https://developer.bentley.com/apis/clash-detection/operations/get-clashdetection-result/ * Get Result} operation from Clash Detection API. * @param {ParamsToGetResult} params parameters for this operation. See {@link ParamsToGetResult}. * @returns {Promise<ResponseFromGetResult>} a Result with specified id. See {@link ResponseFromGetResult}. */ async get(params) { const { accessToken, resultId } = params; OperationUtils.ensureAccessTokenProvided(accessToken, this._options.accessTokenCallback); const response = await this.sendGetRequest({ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : await this._options.accessTokenCallback(), url: this._options.urlFormatter.getResultUrl({ resultId }), }); return response; } } //# sourceMappingURL=ResultOperations.js.map