/* 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 { luoghiControllerFindLuogoByAutocomplete } from '../fn/luoghi/luoghi-controller-find-luogo-by-autocomplete';
import { LuoghiControllerFindLuogoByAutocomplete$Params } from '../fn/luoghi/luoghi-controller-find-luogo-by-autocomplete';
import { luoghiControllerFindLuogoEsteso } from '../fn/luoghi/luoghi-controller-find-luogo-esteso';
import { LuoghiControllerFindLuogoEsteso$Params } from '../fn/luoghi/luoghi-controller-find-luogo-esteso';
import { LuogoRes } from '../models/luogo-res';

@Injectable({ providedIn: 'root' })
export class LuoghiApiClient extends BaseService {
  constructor(config: ApiConfiguration, http: HttpClient) {
    super(config, http);
  }

  /** Path part for operation `luoghiControllerFindLuogoByAutocomplete()` */
  static readonly LuoghiControllerFindLuogoByAutocompletePath =
    '/public/luoghi/cerca';

  /**
   * Cerca luoghi con autocomplete.
   *
   *
   *
   * This method provides access to the full `HttpResponse`, allowing access to response headers.
   * To access only the response body, use `luoghiControllerFindLuogoByAutocomplete()` instead.
   *
   * This method doesn't expect any request body.
   */
  luoghiControllerFindLuogoByAutocomplete$Response(
    params: LuoghiControllerFindLuogoByAutocomplete$Params,
    context?: HttpContext,
  ): Observable<StrictHttpResponse<Array<LuogoRes>>> {
    return luoghiControllerFindLuogoByAutocomplete(
      this.http,
      this.rootUrl,
      params,
      context,
    );
  }

  /**
   * Cerca luoghi con autocomplete.
   *
   *
   *
   * This method provides access only to the response body.
   * To access the full response (for headers, for example), `luoghiControllerFindLuogoByAutocomplete$Response()` instead.
   *
   * This method doesn't expect any request body.
   */
  luoghiControllerFindLuogoByAutocomplete(
    params: LuoghiControllerFindLuogoByAutocomplete$Params,
    context?: HttpContext,
  ): Observable<Array<LuogoRes>> {
    return this.luoghiControllerFindLuogoByAutocomplete$Response(
      params,
      context,
    ).pipe(
      map((r: StrictHttpResponse<Array<LuogoRes>>): Array<LuogoRes> => r.body),
    );
  }

  /** Path part for operation `luoghiControllerFindLuogoEsteso()` */
  static readonly LuoghiControllerFindLuogoEstesoPath =
    '/public/luoghi/cerca-esteso';

  /**
   * Cerca luoghi, province e regioni con autocomplete.
   *
   *
   *
   * This method provides access to the full `HttpResponse`, allowing access to response headers.
   * To access only the response body, use `luoghiControllerFindLuogoEsteso()` instead.
   *
   * This method doesn't expect any request body.
   */
  luoghiControllerFindLuogoEsteso$Response(
    params: LuoghiControllerFindLuogoEsteso$Params,
    context?: HttpContext,
  ): Observable<StrictHttpResponse<Array<LuogoRes>>> {
    return luoghiControllerFindLuogoEsteso(
      this.http,
      this.rootUrl,
      params,
      context,
    );
  }

  /**
   * Cerca luoghi, province e regioni con autocomplete.
   *
   *
   *
   * This method provides access only to the response body.
   * To access the full response (for headers, for example), `luoghiControllerFindLuogoEsteso$Response()` instead.
   *
   * This method doesn't expect any request body.
   */
  luoghiControllerFindLuogoEsteso(
    params: LuoghiControllerFindLuogoEsteso$Params,
    context?: HttpContext,
  ): Observable<Array<LuogoRes>> {
    return this.luoghiControllerFindLuogoEsteso$Response(params, context).pipe(
      map((r: StrictHttpResponse<Array<LuogoRes>>): Array<LuogoRes> => r.body),
    );
  }
}
