import ApiCall from "./ApiCall"; import CurationSets from "./CurationSets"; import type { CurationObjectSchema } from "./CurationSets"; export interface CurationItemDeleteResponseSchema { id: string; } export default class CurationSetItem { constructor( private name: string, private itemId: string, private apiCall: ApiCall, ) {} async retrieve(): Promise { return this.apiCall.get(this.endpointPath()); } async upsert(params: CurationObjectSchema): Promise { return this.apiCall.put(this.endpointPath(), params); } async delete(): Promise { return this.apiCall.delete( this.endpointPath(), ); } private endpointPath(): string { return `${CurationSets.RESOURCEPATH}/${encodeURIComponent( this.name, )}/items/${encodeURIComponent(this.itemId)}`; } }