import ApiCall from "./ApiCall"; import SynonymSets, { SynonymItemSchema } from "./SynonymSets"; export default class SynonymSetItems { constructor( private synonymSetName: string, private apiCall: ApiCall, ) {} async upsert( itemId: string, params: Omit, ): Promise { return this.apiCall.put( this.endpointPath(itemId), params, ); } async retrieve(): Promise { return this.apiCall.get(this.endpointPath()); } private endpointPath(operation?: string): string { return `${SynonymSets.RESOURCEPATH}/${encodeURIComponent(this.synonymSetName)}/items${ operation === undefined ? "" : "/" + encodeURIComponent(operation) }`; } }