/* tslint:disable */
import { Injectable } from '@angular/core';
import { HttpClient, HttpRequest, HttpResponse, HttpHeaders } from '@angular/common/http';
import { BaseService as __BaseService } from '../base-service';
import { IsaConfiguration as __Configuration } from '../isa-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 { LoginResponse } from '../models/login-response';
import { KeyCardValues } from '../models/key-card-values';
@Injectable({
  providedIn: 'root',
})
class AuthService extends __BaseService {
  static readonly AuthLoginPath = '/auth/keycard';

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

  /**
   * @param values KeyCard Daten
   */
  AuthLoginResponse(values: KeyCardValues): __Observable<__StrictHttpResponse<LoginResponse>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    __body = values;
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/auth/keycard`,
      __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<LoginResponse>;
      })
    );
  }
  /**
   * @param values KeyCard Daten
   */
  AuthLogin(values: KeyCardValues): __Observable<LoginResponse> {
    return this.AuthLoginResponse(values).pipe(
      __map(_r => _r.body as LoginResponse)
    );
  }
}

module AuthService {
}

export { AuthService }
