@itwin/insights-client
Version:
Insights client for the iTwin platform
21 lines • 1.12 kB
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import { CARBON_CALCULATION_BASE_PATH, OperationsBase } from "../../common/OperationsBase";
export class EC3JobsClient extends OperationsBase {
constructor(basePath) {
super(basePath ?? 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;
}
}
//# sourceMappingURL=EC3JobsClient.js.map