/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

import { HttpClient, HttpContext } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

import { BaseService } from '../base-service';
import { ApiConfiguration } from '../api-configuration';
import { StrictHttpResponse } from '../strict-http-response';

import { getResourcesGroupedByState } from '../fn/resource-metrics-api/get-resources-grouped-by-state';
import { GetResourcesGroupedByState$Params } from '../fn/resource-metrics-api/get-resources-grouped-by-state';
import { getTotalResources } from '../fn/resource-metrics-api/get-total-resources';
import { GetTotalResources$Params } from '../fn/resource-metrics-api/get-total-resources';
import { ResourcesGroupByState } from '../models/resources-group-by-state';
import { TotalResources } from '../models/total-resources';


/**
 * The Resources' Metrics API
 */
@Injectable({ providedIn: 'root' })
export class ResourceMetricsApiService extends BaseService {
  constructor(config: ApiConfiguration, http: HttpClient) {
    super(config, http);
  }

  /** Path part for operation `getTotalResources()` */
  static readonly GetTotalResourcesPath = '/metrics/totalResources';

  /**
   * Get total number of resources.
   *
   *
   *
   * This method provides access to the full `HttpResponse`, allowing access to response headers.
   * To access only the response body, use `getTotalResources()` instead.
   *
   * This method doesn't expect any request body.
   */
  getTotalResources$Response(params?: GetTotalResources$Params, context?: HttpContext): Observable<StrictHttpResponse<TotalResources>> {
    return getTotalResources(this.http, this.rootUrl, params, context);
  }

  /**
   * Get total number of resources.
   *
   *
   *
   * This method provides access only to the response body.
   * To access the full response (for headers, for example), `getTotalResources$Response()` instead.
   *
   * This method doesn't expect any request body.
   */
  getTotalResources(params?: GetTotalResources$Params, context?: HttpContext): Observable<TotalResources> {
    return this.getTotalResources$Response(params, context).pipe(
      map((r: StrictHttpResponse<TotalResources>): TotalResources => r.body)
    );
  }

  /** Path part for operation `getResourcesGroupedByState()` */
  static readonly GetResourcesGroupedByStatePath = '/metrics/resourcesGroupByState';

  /**
   * Get resources grouped by state.
   *
   *
   *
   * This method provides access to the full `HttpResponse`, allowing access to response headers.
   * To access only the response body, use `getResourcesGroupedByState()` instead.
   *
   * This method doesn't expect any request body.
   */
  getResourcesGroupedByState$Response(params: GetResourcesGroupedByState$Params, context?: HttpContext): Observable<StrictHttpResponse<ResourcesGroupByState>> {
    return getResourcesGroupedByState(this.http, this.rootUrl, params, context);
  }

  /**
   * Get resources grouped by state.
   *
   *
   *
   * This method provides access only to the response body.
   * To access the full response (for headers, for example), `getResourcesGroupedByState$Response()` instead.
   *
   * This method doesn't expect any request body.
   */
  getResourcesGroupedByState(params: GetResourcesGroupedByState$Params, context?: HttpContext): Observable<ResourcesGroupByState> {
    return this.getResourcesGroupedByState$Response(params, context).pipe(
      map((r: StrictHttpResponse<ResourcesGroupByState>): ResourcesGroupByState => r.body)
    );
  }

}
