import ApiCall from "./ApiCall"; import Collections from "./Collections"; import Synonyms, { SynonymCreateSchema } from "./Synonyms"; export interface SynonymSchema extends SynonymCreateSchema { id: string; } export interface SynonymDeleteSchema { id: string; } export default class Synonym { constructor( private collectionName: string, private synonymId: string, private apiCall: ApiCall ) {} async retrieve(): Promise { return this.apiCall.get(this.endpointPath()); } async delete(): Promise { return this.apiCall.delete(this.endpointPath()); } private endpointPath(): string { return `${Collections.RESOURCEPATH}/${this.collectionName}${Synonyms.RESOURCEPATH}/${this.synonymId}`; } }