import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { RPCService } from '@loafer/ng-rpc';
import { MetaPortType } from '@overflow/commons-typescript';

@Injectable()
export class MetaPortTypeService {

  public constructor(
    private rpcService: RPCService,
  ) {

  }

  public readByKey(key: string): Observable<MetaPortType> {
    return this.rpcService.call<MetaPortType>('MetaPortTypeService.readByKey', key);
  }

  public readAll(): Observable<MetaPortType[]> {
    return this.rpcService.call<MetaPortType[]>('MetaPortTypeService.readAll');
  }
}
