File: /var/www/fintechfuel/node_modules/pipedrive/dist/api/LeadSourcesApi.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 _GetLeadSourcesResponse = _interopRequireDefault(require("../model/GetLeadSourcesResponse200"));
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; }
/**
* LeadSources service.
* @module api/LeadSourcesApi
* @version 1.0.0
*/
var LeadSourcesApi = /*#__PURE__*/function () {
/**
* Constructs a new LeadSourcesApi.
* @alias module:api/LeadSourcesApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
function LeadSourcesApi(apiClient) {
(0, _classCallCheck2["default"])(this, LeadSourcesApi);
this.apiClient = apiClient;
}
/**
* Get all lead sources
* Returns all lead sources. Please note that the list of lead sources is fixed, it cannot be modified. All leads created through the Pipedrive API will have a lead source `API` assigned.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetLeadSourcesResponse200} and HTTP response
*/
(0, _createClass2["default"])(LeadSourcesApi, [{
key: "getLeadSourcesWithHttpInfo",
value: function getLeadSourcesWithHttpInfo() {
var opts = {};
var postBody = null;
var pathParams = {};
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 = _GetLeadSourcesResponse["default"];
return this.apiClient.callApi('/leadSources', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Get all lead sources
* Returns all lead sources. Please note that the list of lead sources is fixed, it cannot be modified. All leads created through the Pipedrive API will have a lead source `API` assigned.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetLeadSourcesResponse200}
*/
}, {
key: "getLeadSources",
value: function getLeadSources() {
return this.getLeadSourcesWithHttpInfo().then(function (response_and_data) {
return response_and_data;
});
}
}]);
return LeadSourcesApi;
}();
exports["default"] = LeadSourcesApi;