@itwin/insights-client
Version:
Insights client for the iTwin platform
25 lines • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EC3JobsClient = void 0;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
const OperationsBase_1 = require("../../common/OperationsBase");
class EC3JobsClient extends OperationsBase_1.OperationsBase {
constructor(basePath) {
super(basePath ?? OperationsBase_1.CARBON_CALCULATION_BASE_PATH);
}
async createJob(accessToken, job) {
const url = `${this.basePath}/ec3/jobs`;
const requestOptions = this.createRequest("POST", accessToken, JSON.stringify(job));
return (await this.fetchJSON(url, requestOptions)).job;
}
async getEC3JobStatus(accessToken, jobId) {
const url = `${this.basePath}/ec3/jobs/${jobId}`;
const requestOptions = this.createRequest("GET", accessToken);
return (await this.fetchJSON(url, requestOptions)).job;
}
}
exports.EC3JobsClient = EC3JobsClient;
//# sourceMappingURL=EC3JobsClient.js.map