import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';

import { RPCService } from '@loafer/ng-rpc/service';
import { SensorItemDependency } from '@overflow/commons-typescript/model/sensor-item';
import { MetaSensorItemKey } from '@overflow/commons-typescript/model/meta';
import { MetaSensorDisplayItem } from '@overflow/commons-typescript/model/meta';



@Injectable()
export class SensorItemDependencyService {

  public constructor(
    private rpcService: RPCService,
  ) {

  }

  public regist(dependency: SensorItemDependency): Observable<SensorItemDependency> {
    return this.rpcService.call('SensorItemDependencyService.regist', dependency);
  }

  public readAllByDisplayItem(displayItem: MetaSensorDisplayItem): Observable<MetaSensorItemKey[]> {
    return this.rpcService.call('SensorItemDependencyService.readAllByDisplayItem', displayItem);
  }


}
