/* 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 { CreateStruttura } from '../../models/create-struttura';
import { Struttura } from '../../models/struttura';

export interface StruttureControllerCreateStruttura$Params {
  body: CreateStruttura;
}

export function struttureControllerCreateStruttura(
  http: HttpClient,
  rootUrl: string,
  params: StruttureControllerCreateStruttura$Params,
  context?: HttpContext,
): Observable<StrictHttpResponse<Struttura>> {
  const rb = new RequestBuilder(
    rootUrl,
    struttureControllerCreateStruttura.PATH,
    'post',
  );
  if (params) {
    rb.body(params.body, 'application/json');
  }

  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<Struttura>;
      }),
    );
}

struttureControllerCreateStruttura.PATH = '/add';
