import { ConfigureAPI } from "../baseWellsClient"; import { WellTopIngestionItems } from "src/model/wellTopIngestionItems"; import { WellTopItems } from "src/model/wellTopItems"; import { rethrowAsHttpError } from "../errorHandlingUtils"; import { WellTopsFilterRequest } from "src/model/wellTopsFilterRequest"; export class WellTopsAPI extends ConfigureAPI { public ingest = async ( ingestionItems: WellTopIngestionItems ): Promise => { const path = this.getPath("/welltops"); return await this.client .asyncPost(path, { data: ingestionItems }) .then((response) => response.data) .catch((err) => { throw rethrowAsHttpError(err); }); }; public list = async ( filter: WellTopsFilterRequest ): Promise => { const path = this.getPath(`/welltops/list`); return await this.client .asyncPost(path, { data: filter }) .then((response) => response.data) .catch((err) => { throw rethrowAsHttpError(err); }); }; }