import ApiCall from "./ApiCall"; import NLSearchModels from "./NLSearchModels"; import type { NLSearchModelBase, NLSearchModelSchema } from "./NLSearchModels"; type NLSearchModelUpdateSchema = NLSearchModelBase; export interface NLSearchModelDeleteSchema { id: string; } export default class NLSearchModel { constructor( private id: string, private apiCall: ApiCall, ) {} async retrieve(): Promise { return this.apiCall.get(this.endpointPath()); } async update( schema: NLSearchModelUpdateSchema, ): Promise { return this.apiCall.put(this.endpointPath(), schema); } async delete(): Promise { return this.apiCall.delete(this.endpointPath()); } private endpointPath(): string { return `${NLSearchModels.RESOURCEPATH}/${encodeURIComponent(this.id)}`; } }