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/quadcode.com/node_modules/pipedrive/dist/api/CallLogsApi.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 _BaseResponse = _interopRequireDefault(require("../model/BaseResponse"));
var _CallLogObject = _interopRequireDefault(require("../model/CallLogObject"));
var _CallLogResponse = _interopRequireDefault(require("../model/CallLogResponse200"));
var _CallLogResponse2 = _interopRequireDefault(require("../model/CallLogResponse400"));
var _CallLogResponse3 = _interopRequireDefault(require("../model/CallLogResponse403"));
var _CallLogResponse4 = _interopRequireDefault(require("../model/CallLogResponse404"));
var _CallLogResponse5 = _interopRequireDefault(require("../model/CallLogResponse409"));
var _CallLogResponse6 = _interopRequireDefault(require("../model/CallLogResponse410"));
var _CallLogResponse7 = _interopRequireDefault(require("../model/CallLogResponse500"));
var _CallLogsResponse = _interopRequireDefault(require("../model/CallLogsResponse"));
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; } /**
 * Pipedrive API v1
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */
/**
* CallLogs service.
* @module api/CallLogsApi
* @version 1.0.0
*/
var CallLogsApi = /*#__PURE__*/function () {
  /**
  * Constructs a new CallLogsApi. 
  * @alias module:api/CallLogsApi
  * @class
  * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
  * default to {@link module:ApiClient#instance} if unspecified.
  */
  function CallLogsApi(apiClient) {
    (0, _classCallCheck2["default"])(this, CallLogsApi);
    this.apiClient = apiClient;
  }

  /**
   * Add a call log
   * Adds a new call log.
   * @param {Object} opts Optional parameters
   * @param {module:model/CallLogObject} opts.callLogObject 
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CallLogResponse200} and HTTP response
   */
  (0, _createClass2["default"])(CallLogsApi, [{
    key: "addCallLogWithHttpInfo",
    value: function addCallLogWithHttpInfo(opts) {
      opts = opts || {};
      var postBody = opts['callLogObject'];
      if (opts['outcome'] === undefined || opts['outcome'] === null) {
        throw new Error("Missing the required parameter 'outcome' when calling addCallLog");
      }
      if (opts['to_phone_number'] === undefined || opts['to_phone_number'] === null) {
        throw new Error("Missing the required parameter 'to_phone_number' when calling addCallLog");
      }
      if (opts['start_time'] === undefined || opts['start_time'] === null) {
        throw new Error("Missing the required parameter 'start_time' when calling addCallLog");
      }
      if (opts['end_time'] === undefined || opts['end_time'] === null) {
        throw new Error("Missing the required parameter 'end_time' when calling addCallLog");
      }
      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 = _CallLogResponse["default"];
      return this.apiClient.callApi('/callLogs', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Add a call log
     * Adds a new call log.
     * @param {Object} opts Optional parameters
     * @param {module:model/CallLogObject} opts.callLogObject 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CallLogResponse200}
     */
  }, {
    key: "addCallLog",
    value: function addCallLog(opts) {
      return this.addCallLogWithHttpInfo(opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Attach an audio file to the call log
     * Adds an audio recording to the call log. That audio can be played by those who have access to the call log object.
     * @param {String} id The ID received when you create the call log
     * @param {File} file Audio file supported by the HTML5 specification
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BaseResponse} and HTTP response
     */
  }, {
    key: "addCallLogAudioFileWithHttpInfo",
    value: function addCallLogAudioFileWithHttpInfo(id, file) {
      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 addCallLogAudioFile");
      }

      // verify the required parameter 'file' is set
      if (file === undefined || file === null) {
        throw new Error("Missing the required parameter 'file' when calling addCallLogAudioFile");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {
        'file': file
      };
      var formParamArray = ['file'];
      var contentTypes = ['multipart/form-data'];
      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 = _BaseResponse["default"];
      return this.apiClient.callApi('/callLogs/{id}/recordings', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Attach an audio file to the call log
     * Adds an audio recording to the call log. That audio can be played by those who have access to the call log object.
     * @param {String} id The ID received when you create the call log
     * @param {File} file Audio file supported by the HTML5 specification
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BaseResponse}
     */
  }, {
    key: "addCallLogAudioFile",
    value: function addCallLogAudioFile(id, file) {
      return this.addCallLogAudioFileWithHttpInfo(id, file).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Delete a call log
     * Deletes a call log. If there is an audio recording attached to it, it will also be deleted. The related activity will not be removed by this request. If you want to remove the related activities, please use the endpoint which is specific for activities.
     * @param {String} id The ID received when you create the call log
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BaseResponse} and HTTP response
     */
  }, {
    key: "deleteCallLogWithHttpInfo",
    value: function deleteCallLogWithHttpInfo(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 deleteCallLog");
      }
      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 = _BaseResponse["default"];
      return this.apiClient.callApi('/callLogs/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Delete a call log
     * Deletes a call log. If there is an audio recording attached to it, it will also be deleted. The related activity will not be removed by this request. If you want to remove the related activities, please use the endpoint which is specific for activities.
     * @param {String} id The ID received when you create the call log
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BaseResponse}
     */
  }, {
    key: "deleteCallLog",
    value: function deleteCallLog(id) {
      return this.deleteCallLogWithHttpInfo(id).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Get details of a call log
     * Returns details of a specific call log.
     * @param {String} id The ID received when you create the call log
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CallLogResponse200} and HTTP response
     */
  }, {
    key: "getCallLogWithHttpInfo",
    value: function getCallLogWithHttpInfo(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 getCallLog");
      }
      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 = _CallLogResponse["default"];
      return this.apiClient.callApi('/callLogs/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Get details of a call log
     * Returns details of a specific call log.
     * @param {String} id The ID received when you create the call log
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CallLogResponse200}
     */
  }, {
    key: "getCallLog",
    value: function getCallLog(id) {
      return this.getCallLogWithHttpInfo(id).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Get all call logs assigned to a particular user
     * Returns all call logs assigned to a particular user.
     * @param {Object} opts Optional parameters
     * @param {Number} opts.start Pagination start (default to 0)
     * @param {Number} opts.limit For pagination, the limit of entries to be returned. The upper limit is 50.
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CallLogsResponse} and HTTP response
     */
  }, {
    key: "getUserCallLogsWithHttpInfo",
    value: function getUserCallLogsWithHttpInfo(opts) {
      opts = opts || {};
      var postBody = null;
      var pathParams = {};
      var queryParams = {
        'start': opts['start'] === undefined ? opts['start'] : opts['start'],
        'limit': opts['limit'] === undefined ? opts['limit'] : opts['limit']
      };
      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 = _CallLogsResponse["default"];
      return this.apiClient.callApi('/callLogs', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Get all call logs assigned to a particular user
     * Returns all call logs assigned to a particular user.
     * @param {Object} opts Optional parameters
     * @param {Number} opts.start Pagination start (default to 0)
     * @param {Number} opts.limit For pagination, the limit of entries to be returned. The upper limit is 50.
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CallLogsResponse}
     */
  }, {
    key: "getUserCallLogs",
    value: function getUserCallLogs(opts) {
      return this.getUserCallLogsWithHttpInfo(opts).then(function (response_and_data) {
        return response_and_data;
      });
    }
  }]);
  return CallLogsApi;
}();
exports["default"] = CallLogsApi;