/* 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 { ResponseArgsOfIDictionaryOfLongAndNullableInteger } from '../models/response-args-of-idictionary-of-long-and-nullable-integer';
import { LesepunkteRequest } from '../models/lesepunkte-request';
@Injectable({
  providedIn: 'root',
})
class PromotionService extends __BaseService {
  static readonly PromotionLesepunktePath = '/promotion/lesepunkte';

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

  /**
   * @param items undefined
   */
  PromotionLesepunkteResponse(items: Array<LesepunkteRequest>): __Observable<__StrictHttpResponse<ResponseArgsOfIDictionaryOfLongAndNullableInteger>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    __body = items;
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/promotion/lesepunkte`,
      __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<ResponseArgsOfIDictionaryOfLongAndNullableInteger>;
      })
    );
  }
  /**
   * @param items undefined
   */
  PromotionLesepunkte(items: Array<LesepunkteRequest>): __Observable<ResponseArgsOfIDictionaryOfLongAndNullableInteger> {
    return this.PromotionLesepunkteResponse(items).pipe(
      __map(_r => _r.body as ResponseArgsOfIDictionaryOfLongAndNullableInteger)
    );
  }
}

module PromotionService {
}

export { PromotionService }
