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

@Injectable()
export class MetaIPTypeService {

  public constructor(
    private rpcService: RPCService,
  ) {

  }

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

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