HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/fintechfuel/node_modules/pipedrive/dist/api/LegacyTeamsApi.js
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _AddTeamUserRequest = _interopRequireDefault(require("../model/AddTeamUserRequest"));
var _CreateTeam = _interopRequireDefault(require("../model/CreateTeam"));
var _DeleteTeamUserRequest = _interopRequireDefault(require("../model/DeleteTeamUserRequest"));
var _FailResponse = _interopRequireDefault(require("../model/FailResponse"));
var _NumberBooleanDefault = _interopRequireDefault(require("../model/NumberBooleanDefault0"));
var _Team = _interopRequireDefault(require("../model/Team"));
var _Teams = _interopRequireDefault(require("../model/Teams"));
var _UpdateTeam = _interopRequireDefault(require("../model/UpdateTeam"));
var _UserIDs = _interopRequireDefault(require("../model/UserIDs"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
/**
* LegacyTeams service.
* @module api/LegacyTeamsApi
* @version 1.0.0
*/
var LegacyTeamsApi = /*#__PURE__*/function () {
  /**
  * Constructs a new LegacyTeamsApi. 
  * @alias module:api/LegacyTeamsApi
  * @class
  * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
  * default to {@link module:ApiClient#instance} if unspecified.
  */
  function LegacyTeamsApi(apiClient) {
    (0, _classCallCheck2["default"])(this, LegacyTeamsApi);
    this.apiClient = apiClient;
  }

  /**
   * Add a new team
   * Adds a new team to the company and returns the created object.
   * @param {Object} opts Optional parameters
   * @param {module:model/CreateTeam} opts.createTeam 
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Team} and HTTP response
   */
  (0, _createClass2["default"])(LegacyTeamsApi, [{
    key: "addTeamWithHttpInfo",
    value: function addTeamWithHttpInfo(opts) {
      opts = opts || {};
      var postBody = opts['createTeam'];
      var pathParams = {};
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = ['application/json'];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _Team["default"];
      return this.apiClient.callApi('/legacyTeams', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Add a new team
     * Adds a new team to the company and returns the created object.
     * @param {Object} opts Optional parameters
     * @param {module:model/CreateTeam} opts.createTeam 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Team}
     */
  }, {
    key: "addTeam",
    value: function addTeam(opts) {
      return this.addTeamWithHttpInfo(opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Add users to a team
     * Adds users to an existing team.
     * @param {Number} id The ID of the team
     * @param {Object} opts Optional parameters
     * @param {module:model/AddTeamUserRequest} opts.addTeamUserRequest 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserIDs} and HTTP response
     */
  }, {
    key: "addTeamUserWithHttpInfo",
    value: function addTeamUserWithHttpInfo(id, opts) {
      opts = opts || {};
      var postBody = opts['addTeamUserRequest'];

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling addTeamUser");
      }
      if (opts['users'] === undefined || opts['users'] === null) {
        throw new Error("Missing the required parameter 'users' when calling addTeamUser");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = ['application/json'];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _UserIDs["default"];
      return this.apiClient.callApi('/legacyTeams/{id}/users', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Add users to a team
     * Adds users to an existing team.
     * @param {Number} id The ID of the team
     * @param {Object} opts Optional parameters
     * @param {module:model/AddTeamUserRequest} opts.addTeamUserRequest 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserIDs}
     */
  }, {
    key: "addTeamUser",
    value: function addTeamUser(id, opts) {
      return this.addTeamUserWithHttpInfo(id, opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Delete users from a team
     * Deletes users from an existing team.
     * @param {Number} id The ID of the team
     * @param {Object} opts Optional parameters
     * @param {module:model/DeleteTeamUserRequest} opts.deleteTeamUserRequest 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserIDs} and HTTP response
     */
  }, {
    key: "deleteTeamUserWithHttpInfo",
    value: function deleteTeamUserWithHttpInfo(id, opts) {
      opts = opts || {};
      var postBody = opts['deleteTeamUserRequest'];

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling deleteTeamUser");
      }
      if (opts['users'] === undefined || opts['users'] === null) {
        throw new Error("Missing the required parameter 'users' when calling deleteTeamUser");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = ['application/json'];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _UserIDs["default"];
      return this.apiClient.callApi('/legacyTeams/{id}/users', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Delete users from a team
     * Deletes users from an existing team.
     * @param {Number} id The ID of the team
     * @param {Object} opts Optional parameters
     * @param {module:model/DeleteTeamUserRequest} opts.deleteTeamUserRequest 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserIDs}
     */
  }, {
    key: "deleteTeamUser",
    value: function deleteTeamUser(id, opts) {
      return this.deleteTeamUserWithHttpInfo(id, opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Get a single team
     * Returns data about a specific team.
     * @param {Number} id The ID of the team
     * @param {Object} opts Optional parameters
     * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Team} and HTTP response
     */
  }, {
    key: "getTeamWithHttpInfo",
    value: function getTeamWithHttpInfo(id, opts) {
      opts = opts || {};
      var postBody = null;

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling getTeam");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {
        'skip_users': opts['skip_users'] === undefined ? opts['skipUsers'] : opts['skip_users']
      };
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _Team["default"];
      return this.apiClient.callApi('/legacyTeams/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Get a single team
     * Returns data about a specific team.
     * @param {Number} id The ID of the team
     * @param {Object} opts Optional parameters
     * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Team}
     */
  }, {
    key: "getTeam",
    value: function getTeam(id, opts) {
      return this.getTeamWithHttpInfo(id, opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Get all users in a team
     * Returns a list of all user IDs within a team.
     * @param {Number} id The ID of the team
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserIDs} and HTTP response
     */
  }, {
    key: "getTeamUsersWithHttpInfo",
    value: function getTeamUsersWithHttpInfo(id) {
      var opts = {};
      var postBody = null;

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling getTeamUsers");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _UserIDs["default"];
      return this.apiClient.callApi('/legacyTeams/{id}/users', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Get all users in a team
     * Returns a list of all user IDs within a team.
     * @param {Number} id The ID of the team
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserIDs}
     */
  }, {
    key: "getTeamUsers",
    value: function getTeamUsers(id) {
      return this.getTeamUsersWithHttpInfo(id).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Get all teams
     * Returns data about teams within the company.
     * @param {Object} opts Optional parameters
     * @param {module:model/String} opts.orderBy The field name to sort returned teams by (default to 'id')
     * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Teams} and HTTP response
     */
  }, {
    key: "getTeamsWithHttpInfo",
    value: function getTeamsWithHttpInfo(opts) {
      opts = opts || {};
      var postBody = null;
      var pathParams = {};
      var queryParams = {
        'order_by': opts['order_by'] === undefined ? opts['orderBy'] : opts['order_by'],
        'skip_users': opts['skip_users'] === undefined ? opts['skipUsers'] : opts['skip_users']
      };
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _Teams["default"];
      return this.apiClient.callApi('/legacyTeams', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Get all teams
     * Returns data about teams within the company.
     * @param {Object} opts Optional parameters
     * @param {module:model/String} opts.orderBy The field name to sort returned teams by (default to 'id')
     * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Teams}
     */
  }, {
    key: "getTeams",
    value: function getTeams(opts) {
      return this.getTeamsWithHttpInfo(opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Get all teams of a user
     * Returns data about all teams which have the specified user as a member.
     * @param {Number} id The ID of the user
     * @param {Object} opts Optional parameters
     * @param {module:model/String} opts.orderBy The field name to sort returned teams by (default to 'id')
     * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Teams} and HTTP response
     */
  }, {
    key: "getUserTeamsWithHttpInfo",
    value: function getUserTeamsWithHttpInfo(id, opts) {
      opts = opts || {};
      var postBody = null;

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling getUserTeams");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {
        'order_by': opts['order_by'] === undefined ? opts['orderBy'] : opts['order_by'],
        'skip_users': opts['skip_users'] === undefined ? opts['skipUsers'] : opts['skip_users']
      };
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _Teams["default"];
      return this.apiClient.callApi('/legacyTeams/user/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Get all teams of a user
     * Returns data about all teams which have the specified user as a member.
     * @param {Number} id The ID of the user
     * @param {Object} opts Optional parameters
     * @param {module:model/String} opts.orderBy The field name to sort returned teams by (default to 'id')
     * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Teams}
     */
  }, {
    key: "getUserTeams",
    value: function getUserTeams(id, opts) {
      return this.getUserTeamsWithHttpInfo(id, opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Update a team
     * Updates an existing team and returns the updated object.
     * @param {Number} id The ID of the team
     * @param {Object} opts Optional parameters
     * @param {module:model/UpdateTeam} opts.updateTeam 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Team} and HTTP response
     */
  }, {
    key: "updateTeamWithHttpInfo",
    value: function updateTeamWithHttpInfo(id, opts) {
      opts = opts || {};
      var postBody = opts['updateTeam'];

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling updateTeam");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = ['application/json'];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _Team["default"];
      return this.apiClient.callApi('/legacyTeams/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Update a team
     * Updates an existing team and returns the updated object.
     * @param {Number} id The ID of the team
     * @param {Object} opts Optional parameters
     * @param {module:model/UpdateTeam} opts.updateTeam 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Team}
     */
  }, {
    key: "updateTeam",
    value: function updateTeam(id, opts) {
      return this.updateTeamWithHttpInfo(id, opts).then(function (response_and_data) {
        return response_and_data;
      });
    }
  }]);
  return LegacyTeamsApi;
}();
exports["default"] = LegacyTeamsApi;