text: "use strict";
  /**
   * REST API for Flexicore filtered by your access rights
   * Flexicore REST API
   *
   * OpenAPI spec version: V1.1.0
   * Contact: avishaybennatan@gmail.com
   *
   * NOTE: This class is auto generated by the swagger code generator program.
   * https://github.com/swagger-api/swagger-codegen.git
   * Do not edit the class manually.
   */
  /* tslint:disable:no-unused-variable member-ordering */
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
      else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
      return c > 3 && r && Object.defineProperty(target, key, r), r;
  };
  var __param = (this && this.__param) || function (paramIndex, decorator) {
      return function (target, key) { decorator(target, key, paramIndex); }
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  const core_1 = require("@angular/core");
  const http_1 = require("@angular/common/http");
  const variables_1 = require("../variables");
  const configuration_1 = require("../configuration");
  const api_1 = require("./api");
  let UsersService = class UsersService {
      constructor(httpClient, basePath, configuration) {
          this.httpClient = httpClient;
          this.basePath = 'https://192.168.14.71:8180/FlexiCore/rest';
          this.defaultHeaders = new http_1.HttpHeaders();
          this.configuration = new configuration_1.Configuration();
          if (basePath) {
              this.basePath = basePath;
          }
          if (configuration) {
              this.configuration = configuration;
              this.basePath = basePath || configuration.basePath || this.basePath;
          }
      }
      /**
       * @param consumes string[] mime-types
       * @return true: consumes contains 'multipart/form-data', false: otherwise
       */
      canConsumeForm(consumes) {
          const form = 'multipart/form-data';
          for (const consume of consumes) {
              if (form === consume) {
                  return true;
              }
          }
          return false;
      }
      addUserToRole(roleId, userId, authenticationkey, observe = 'body', reportProgress = false) {
          if (roleId === null || roleId === undefined) {
              throw new Error('Required parameter roleId was null or undefined when calling addUserToRole.');
          }
          if (userId === null || userId === undefined) {
              throw new Error('Required parameter userId was null or undefined when calling addUserToRole.');
          }
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [];
          return this.httpClient.put(`${this.basePath}/users/addToRole/${encodeURIComponent(String(roleId))}/${encodeURIComponent(String(userId))}`, null, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          });
      }
      attachTenant(authenticationkey, body, observe = 'body', reportProgress = false) {
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [];
          const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
          if (httpContentTypeSelected != undefined) {
              headers = headers.set('Content-Type', httpContentTypeSelected);
          }
          return this.httpClient.put(`${this.basePath}/users/attachTennat`, body, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          });
      }
      connectToTenant(authenticationkey, body, observe = 'body', reportProgress = false) {
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [];
          const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
          if (httpContentTypeSelected != undefined) {
              headers = headers.set('Content-Type', httpContentTypeSelected);
          }
          return this.httpClient.put(`${this.basePath}/users/connectToTenant`, body, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          });
      }
      createUser(authenticationkey, loginuponsuccess, body, observe = 'body', reportProgress = false) {
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          if (loginuponsuccess !== undefined && loginuponsuccess !== null) {
              headers = headers.set('loginuponsuccess', String(loginuponsuccess));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [
              'application/json'
          ];
          const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
          if (httpContentTypeSelected != undefined) {
              headers = headers.set('Content-Type', httpContentTypeSelected);
          }
          return this.httpClient.post(`${this.basePath}/users/new`, body, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          }).map(o => api_1.FlexiCoreDecycle.retrocycle(o));
      }
      getUserProfile(authenticationkey, body, observe = 'body', reportProgress = false) {
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [
              'application/json'
          ];
          const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
          if (httpContentTypeSelected != undefined) {
              headers = headers.set('Content-Type', httpContentTypeSelected);
          }
          return this.httpClient.post(`${this.basePath}/users/getUserProfile`, body, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          }).map(o => api_1.FlexiCoreDecycle.retrocycle(o));
      }
      impersonate(authenticationkey, body, observe = 'body', reportProgress = false) {
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [
              'application/json'
          ];
          const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
          if (httpContentTypeSelected != undefined) {
              headers = headers.set('Content-Type', httpContentTypeSelected);
          }
          return this.httpClient.post(`${this.basePath}/users/impersonate`, body, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          }).map(o => api_1.FlexiCoreDecycle.retrocycle(o));
      }
      listAllUsers(authenticationkey, pagesize, currentpage, body, observe = 'body', reportProgress = false) {
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          if (pagesize !== undefined && pagesize !== null) {
              headers = headers.set('pagesize', String(pagesize));
          }
          if (currentpage !== undefined && currentpage !== null) {
              headers = headers.set('currentpage', String(currentpage));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [
              'application/json'
          ];
          const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
          if (httpContentTypeSelected != undefined) {
              headers = headers.set('Content-Type', httpContentTypeSelected);
          }
          return this.httpClient.post(`${this.basePath}/users`, body, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          }).map(o => api_1.FlexiCoreDecycle.retrocycle(o));
      }
      getAllUsers(authenticationkey, body, observe = 'body', reportProgress = false) {
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [
              'application/json'
          ];
          const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
          if (httpContentTypeSelected != undefined) {
              headers = headers.set('Content-Type', httpContentTypeSelected);
          }
          return this.httpClient.post(`${this.basePath}/users/getAllUsers`, body, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          }).map(o => api_1.FlexiCoreDecycle.retrocycle(o));
      }
      updateUser(authenticationkey, body, observe = 'body', reportProgress = false) {
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [
              'application/json'
          ];
          const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
          if (httpContentTypeSelected != undefined) {
              headers = headers.set('Content-Type', httpContentTypeSelected);
          }
          return this.httpClient.put(`${this.basePath}/users/updateUser`, body, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          }).map(o => api_1.FlexiCoreDecycle.retrocycle(o));
      }
      createUserNew(authenticationkey, body, observe = 'body', reportProgress = false) {
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [
              'application/json'
          ];
          const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
          if (httpContentTypeSelected != undefined) {
              headers = headers.set('Content-Type', httpContentTypeSelected);
          }
          return this.httpClient.post(`${this.basePath}/users/createUser`, body, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          }).map(o => api_1.FlexiCoreDecycle.retrocycle(o));
      }
      lookupUserByEmail(email, authenticationkey, observe = 'body', reportProgress = false) {
          if (email === null || email === undefined) {
              throw new Error('Required parameter email was null or undefined when calling lookupUserByEmail.');
          }
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [];
          return this.httpClient.get(`${this.basePath}/users/byEmail/${encodeURIComponent(String(email))}`, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          }).map(o => api_1.FlexiCoreDecycle.retrocycle(o));
      }
      lookupUserById(id, authenticationkey, observe = 'body', reportProgress = false) {
          if (id === null || id === undefined) {
              throw new Error('Required parameter id was null or undefined when calling lookupUserById.');
          }
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [];
          return this.httpClient.get(`${this.basePath}/users/byId/${encodeURIComponent(String(id))}`, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          }).map(o => api_1.FlexiCoreDecycle.retrocycle(o));
      }
      multipleCreate(authenticationkey, number, observe = 'body', reportProgress = false) {
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          if (number !== undefined && number !== null) {
              headers = headers.set('number', String(number));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [];
          return this.httpClient.post(`${this.basePath}/users/batchCreate`, null, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          });
      }
      resetUserPassword(authenticationkey, body, observe = 'body', reportProgress = false) {
          let headers = this.defaultHeaders;
          if (authenticationkey !== undefined && authenticationkey !== null) {
              headers = headers.set('authenticationkey', String(authenticationkey));
          }
          // to determine the Accept header
          let httpHeaderAccepts = [
              'application/json'
          ];
          const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
          if (httpHeaderAcceptSelected != undefined) {
              headers = headers.set('Accept', httpHeaderAcceptSelected);
          }
          // to determine the Content-Type header
          const consumes = [
              'application/json'
          ];
          const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
          if (httpContentTypeSelected != undefined) {
              headers = headers.set('Content-Type', httpContentTypeSelected);
          }
          return this.httpClient.post(`${this.basePath}/users/resetUserPassword`, body, {
              withCredentials: this.configuration.withCredentials,
              headers: headers,
              observe: observe,
              reportProgress: reportProgress
          });
      }
  };
  UsersService = __decorate([
      core_1.Injectable(),
      __param(1, core_1.Optional()), __param(1, core_1.Inject(variables_1.BASE_PATH)), __param(2, core_1.Optional())
  ], UsersService);
  exports.UsersService = UsersService;
  //# sourceMappingURL=users.service.js.map