import { ApiClientFactory } from '../core/api.client.factory'; import { AIOdeviceModel, AIOParamsModel } from '../model/AIOdevice.model'; export class AIOdeviceService { constructor(private factory: ApiClientFactory) {} async saveDevice(projectId: string, params: AIOParamsModel) { return await this.factory.surveillance.post( `/config/aio/projects/${projectId}/devices/save`, params ); } async deleteDevice(projectId: string, deviceId: string) { return await this.factory.surveillance.delete(`/config/aio/projects/${projectId}/devices/${deviceId}`); } async fetchDeviceList(projectId: string, params?: object) { return await this.factory.surveillance.get( `/config/aio/projects/${projectId}/devices/list`, params ); } async fetchDeviceInfo(projectId: string, deviceId: string) { return await this.factory.surveillance.get(`/config/aio/projects/${projectId}/devices/${deviceId}`); } async setConfig(projectId: string, deviceId: string) { return await this.factory.surveillance.put(`config/aio/projects/${projectId}/devices/config/${deviceId}`); } }