File: /var/www/quadcode.com/node_modules/pipedrive/dist/api/RecentsApi.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 _GetRecents = _interopRequireDefault(require("../model/GetRecents"));
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.
*
*/
/**
* Recents service.
* @module api/RecentsApi
* @version 1.0.0
*/
var RecentsApi = /*#__PURE__*/function () {
/**
* Constructs a new RecentsApi.
* @alias module:api/RecentsApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
function RecentsApi(apiClient) {
(0, _classCallCheck2["default"])(this, RecentsApi);
this.apiClient = apiClient;
}
/**
* Get recents
* Returns data about all recent changes occurred after the given timestamp.
* @param {String} sinceTimestamp The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS.
* @param {Object} opts Optional parameters
* @param {module:model/String} opts.items Multiple selection of item types to include in the query (optional)
* @param {Number} opts.start Pagination start (default to 0)
* @param {Number} opts.limit Items shown per page
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetRecents} and HTTP response
*/
(0, _createClass2["default"])(RecentsApi, [{
key: "getRecentsWithHttpInfo",
value: function getRecentsWithHttpInfo(sinceTimestamp, opts) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'sinceTimestamp' is set
if (sinceTimestamp === undefined || sinceTimestamp === null) {
throw new Error("Missing the required parameter 'sinceTimestamp' when calling getRecents");
}
var pathParams = {};
var queryParams = {
'since_timestamp': sinceTimestamp,
'items': opts['items'] === undefined ? opts['items'] : opts['items'],
'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 = _GetRecents["default"];
return this.apiClient.callApi('/recents', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Get recents
* Returns data about all recent changes occurred after the given timestamp.
* @param {String} sinceTimestamp The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS.
* @param {Object} opts Optional parameters
* @param {module:model/String} opts.items Multiple selection of item types to include in the query (optional)
* @param {Number} opts.start Pagination start (default to 0)
* @param {Number} opts.limit Items shown per page
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetRecents}
*/
}, {
key: "getRecents",
value: function getRecents(sinceTimestamp, opts) {
return this.getRecentsWithHttpInfo(sinceTimestamp, opts).then(function (response_and_data) {
return response_and_data;
});
}
}]);
return RecentsApi;
}();
exports["default"] = RecentsApi;