import { Injectable } from '@angular/core';
import { ConfigService } from '@shared/config/config.service';
import { HttpClient } from '@angular/common/http';
import { FleioApiService } from '@fleio-api/fleio-api.service';
import { FleioId } from '@fleio-api/base-model/base-fleio-object.model';
import { Observable } from 'rxjs/internal/Observable';
import { IHeatResourceTypeModel } from '@fleio-api/openstack/orchestration/model/heat-resource-type.model';

@Injectable({
  providedIn: 'root',
})
export class HeatResourceTypesApiService extends FleioApiService<IHeatResourceTypeModel> {
  constructor(protected httpClient: HttpClient, protected config: ConfigService) {
    super();
    this.setEndpoint(config.getPanelApiUrl('openstack/heat-resource-types'));
  }

  details(objectId: FleioId): Observable<IHeatResourceTypeModel> {
    return super.getAction('retrieve', {name: objectId});
  }
}
