/* 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 { getServicesGroupedByState } from '../fn/service-metrics-api/get-services-grouped-by-state';
import { GetServicesGroupedByState$Params } from '../fn/service-metrics-api/get-services-grouped-by-state';
import { getTotalServices } from '../fn/service-metrics-api/get-total-services';
import { GetTotalServices$Params } from '../fn/service-metrics-api/get-total-services';
import { ServicesGroupByState } from '../models/services-group-by-state';
import { TotalServices } from '../models/total-services';


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

  /** Path part for operation `getTotalServices()` */
  static readonly GetTotalServicesPath = '/metrics/totalServices';

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

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

  /** Path part for operation `getServicesGroupedByState()` */
  static readonly GetServicesGroupedByStatePath = '/metrics/servicesGroupByState';

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

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

}
