/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';

import { RegioneRes } from '../../models/regione-res';

export interface StrutturePubblicheControllerFindManyRegioniInStrutture$Params {
  /**
   * Codice Stato
   */
  codiceStato: string;

  /**
   * Filter by active status (0 = inactive, 1 = active)
   */
  flagAttivo?: number;
}

export function strutturePubblicheControllerFindManyRegioniInStrutture(
  http: HttpClient,
  rootUrl: string,
  params: StrutturePubblicheControllerFindManyRegioniInStrutture$Params,
  context?: HttpContext,
): Observable<StrictHttpResponse<Array<RegioneRes>>> {
  const rb = new RequestBuilder(
    rootUrl,
    strutturePubblicheControllerFindManyRegioniInStrutture.PATH,
    'get',
  );
  if (params) {
    rb.query('codiceStato', params.codiceStato, {});
    rb.query('flagAttivo', params.flagAttivo, {});
  }

  return http
    .request(
      rb.build({ responseType: 'json', accept: 'application/json', context }),
    )
    .pipe(
      filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
      map((r: HttpResponse<any>) => {
        return r as StrictHttpResponse<Array<RegioneRes>>;
      }),
    );
}

strutturePubblicheControllerFindManyRegioniInStrutture.PATH =
  '/public/strutture/luoghi/regioni';
