/* tslint:disable */
import { Injectable } from '@angular/core';
import { HttpClient, HttpRequest, HttpResponse, HttpHeaders } from '@angular/common/http';
import { BaseService as __BaseService } from '../base-service';
import { CatConfiguration as __Configuration } from '../cat-configuration';
import { StrictHttpResponse as __StrictHttpResponse } from '../strict-http-response';
import { Observable as __Observable } from 'rxjs';
import { map as __map, filter as __filter } from 'rxjs/operators';

import { ResponseArgsOfIEnumerableOfStockInfoDTO } from '../models/response-args-of-ienumerable-of-stock-info-dto';
import { StockRequest } from '../models/stock-request';
@Injectable({
  providedIn: 'root',
})
class StockService extends __BaseService {
  static readonly StockInStockPath = '/stock/instock';

  constructor(
    config: __Configuration,
    http: HttpClient
  ) {
    super(config, http);
  }

  /**
   * @param stockRequest undefined
   */
  StockInStockResponse(stockRequest: StockRequest): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    __body = stockRequest;
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/stock/instock`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>;
      })
    );
  }
  /**
   * @param stockRequest undefined
   */
  StockInStock(stockRequest: StockRequest): __Observable<ResponseArgsOfIEnumerableOfStockInfoDTO> {
    return this.StockInStockResponse(stockRequest).pipe(
      __map(_r => _r.body as ResponseArgsOfIEnumerableOfStockInfoDTO)
    );
  }
}

module StockService {
}

export { StockService }
