/* tslint:disable */
import { Injectable } from '@angular/core';
import { HttpClient, HttpRequest, HttpResponse, HttpHeaders } from '@angular/common/http';
import { BaseService as __BaseService } from '../base-service';
import { PrintConfiguration as __Configuration } from '../print-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 { ResponseArgs } from '../models/response-args';
import { PrintRequestOfLong } from '../models/print-request-of-long';
import { PrintRequestOfIEnumerableOfShoppingCartItemDTO } from '../models/print-request-of-ienumerable-of-shopping-cart-item-dto';
@Injectable({
  providedIn: 'root',
})
class CheckoutPrintService extends __BaseService {
  static readonly CheckoutPrintWarenkorbByIdPath = '/print/cart';
  static readonly CheckoutPrintWarenkorbPath = '/print/cart/data';

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

  /**
   * Druckt die Artikelliste eines Warenkorbs
   * @param data Warenkorb PK
   */
  CheckoutPrintWarenkorbByIdResponse(data: PrintRequestOfLong): __Observable<__StrictHttpResponse<ResponseArgs>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    __body = data;
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/print/cart`,
      __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<ResponseArgs>;
      })
    );
  }
  /**
   * Druckt die Artikelliste eines Warenkorbs
   * @param data Warenkorb PK
   */
  CheckoutPrintWarenkorbById(data: PrintRequestOfLong): __Observable<ResponseArgs> {
    return this.CheckoutPrintWarenkorbByIdResponse(data).pipe(
      __map(_r => _r.body as ResponseArgs)
    );
  }

  /**
   * Druckt eine Artikelliste der übergebeenen Warenkorbpositionen
   * @param data Warenkorbpositionen
   */
  CheckoutPrintWarenkorbResponse(data: PrintRequestOfIEnumerableOfShoppingCartItemDTO): __Observable<__StrictHttpResponse<ResponseArgs>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    __body = data;
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/print/cart/data`,
      __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<ResponseArgs>;
      })
    );
  }
  /**
   * Druckt eine Artikelliste der übergebeenen Warenkorbpositionen
   * @param data Warenkorbpositionen
   */
  CheckoutPrintWarenkorb(data: PrintRequestOfIEnumerableOfShoppingCartItemDTO): __Observable<ResponseArgs> {
    return this.CheckoutPrintWarenkorbResponse(data).pipe(
      __map(_r => _r.body as ResponseArgs)
    );
  }
}

module CheckoutPrintService {
}

export { CheckoutPrintService }
