/* 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 { ActiveServiceOrders } from '../models/active-service-orders';
import { getServiceOrdersGroupedByDay } from '../fn/service-order-metrics-api/get-service-orders-grouped-by-day';
import { GetServiceOrdersGroupedByDay$Params } from '../fn/service-order-metrics-api/get-service-orders-grouped-by-day';
import { getServiceOrdersGroupedByState } from '../fn/service-order-metrics-api/get-service-orders-grouped-by-state';
import { GetServiceOrdersGroupedByState$Params } from '../fn/service-order-metrics-api/get-service-orders-grouped-by-state';
import { getTotalActiveServiceOrders } from '../fn/service-order-metrics-api/get-total-active-service-orders';
import { GetTotalActiveServiceOrders$Params } from '../fn/service-order-metrics-api/get-total-active-service-orders';
import { getTotalServiceOrders } from '../fn/service-order-metrics-api/get-total-service-orders';
import { GetTotalServiceOrders$Params } from '../fn/service-order-metrics-api/get-total-service-orders';
import { ServiceOrdersGroupByDay } from '../models/service-orders-group-by-day';
import { ServiceOrdersGroupByState } from '../models/service-orders-group-by-state';
import { TotalServiceOrders } from '../models/total-service-orders';


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

  /** Path part for operation `getTotalServiceOrders()` */
  static readonly GetTotalServiceOrdersPath = '/metrics/totalServiceOrders';

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

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

  /** Path part for operation `getServiceOrdersGroupedByState()` */
  static readonly GetServiceOrdersGroupedByStatePath = '/metrics/serviceOrdersGroupByState';

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

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

  /** Path part for operation `getServiceOrdersGroupedByDay()` */
  static readonly GetServiceOrdersGroupedByDayPath = '/metrics/serviceOrdersGroupByDay';

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

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

  /** Path part for operation `getTotalActiveServiceOrders()` */
  static readonly GetTotalActiveServiceOrdersPath = '/metrics/activeServiceOrders';

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

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

}
