import { HoleSectionFilterRequest } from "src/model/holeSectionFilterRequest"; import { HoleSectionGroupIngestion } from "src/model/holeSectionGroupIngestion"; import { HoleSectionGroupsIngestionItems } from "src/model/holeSectionGroupsIngestionItems"; import { HoleSectionGroupsItems } from "src/model/holeSectionGroupsItems"; import { ConfigureAPI } from "../baseWellsClient"; import { rethrowAsHttpError } from "../errorHandlingUtils"; export class HoleSectionsAPI extends ConfigureAPI { public ingest = async ( ingestionItems: HoleSectionGroupIngestion[] ): Promise => { const path = this.getPath("/holesections"); const items: HoleSectionGroupsIngestionItems = { items: ingestionItems }; return await this.client .asyncPost(path, { data: items }) .then((response) => response.data) .catch((err) => { throw rethrowAsHttpError(err); }); }; public list = async ( filter: HoleSectionFilterRequest ): Promise => { const path = this.getPath(`/holesections/list`); return await this.client .asyncPost(path, { data: filter }) .then((response) => response.data) .catch((err) => { throw rethrowAsHttpError(err); }); }; }