/* 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 { ListResponseArgsOfBranchInfoDTO } from '../models/list-response-args-of-branch-info-dto';
@Injectable({
  providedIn: 'root',
})
class ISAService extends __BaseService {
  static readonly ISABranchesPath = '/isa/branches';

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

  /**
   * @param params The `ISAService.ISABranchesParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   */
  ISABranchesResponse(params: ISAService.ISABranchesParams): __Observable<__StrictHttpResponse<ListResponseArgsOfBranchInfoDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    if (params.take != null) __params = __params.set('take', params.take.toString());
    if (params.skip != null) __params = __params.set('skip', params.skip.toString());
    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/isa/branches`,
      __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<ListResponseArgsOfBranchInfoDTO>;
      })
    );
  }
  /**
   * @param params The `ISAService.ISABranchesParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   */
  ISABranches(params: ISAService.ISABranchesParams): __Observable<ListResponseArgsOfBranchInfoDTO> {
    return this.ISABranchesResponse(params).pipe(
      __map(_r => _r.body as ListResponseArgsOfBranchInfoDTO)
    );
  }
}

module ISAService {

  /**
   * Parameters for ISABranches
   */
  export interface ISABranchesParams {
    take?: null | number;
    skip?: null | number;
  }
}

export { ISAService }
