File: /var/www/fintechfuel/node_modules/pipedrive/dist/api/ActivitiesApi.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 _ActivityPostObject = _interopRequireDefault(require("../model/ActivityPostObject"));
var _ActivityPutObject = _interopRequireDefault(require("../model/ActivityPutObject"));
var _AddActivityResponse = _interopRequireDefault(require("../model/AddActivityResponse200"));
var _DeleteActivitiesResponse = _interopRequireDefault(require("../model/DeleteActivitiesResponse200"));
var _DeleteActivityResponse = _interopRequireDefault(require("../model/DeleteActivityResponse200"));
var _FailResponse = _interopRequireDefault(require("../model/FailResponse"));
var _GetActivitiesCollectionResponse = _interopRequireDefault(require("../model/GetActivitiesCollectionResponse200"));
var _GetActivitiesResponse = _interopRequireDefault(require("../model/GetActivitiesResponse200"));
var _GetActivityResponse = _interopRequireDefault(require("../model/GetActivityResponse200"));
var _NumberBoolean = _interopRequireDefault(require("../model/NumberBoolean"));
var _UpdateActivityResponse = _interopRequireDefault(require("../model/UpdateActivityResponse200"));
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; }
/**
* Activities service.
* @module api/ActivitiesApi
* @version 1.0.0
*/
var ActivitiesApi = /*#__PURE__*/function () {
/**
* Constructs a new ActivitiesApi.
* @alias module:api/ActivitiesApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
function ActivitiesApi(apiClient) {
(0, _classCallCheck2["default"])(this, ActivitiesApi);
this.apiClient = apiClient;
}
/**
* Add an activity
* Adds a new activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). For more information, see the tutorial for <a href=\"https://pipedrive.readme.io/docs/adding-an-activity\" target=\"_blank\" rel=\"noopener noreferrer\">adding an activity</a>.
* @param {Object} opts Optional parameters
* @param {module:model/ActivityPostObject} opts.activityPostObject
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AddActivityResponse200} and HTTP response
*/
(0, _createClass2["default"])(ActivitiesApi, [{
key: "addActivityWithHttpInfo",
value: function addActivityWithHttpInfo(opts) {
opts = opts || {};
var postBody = opts['activityPostObject'];
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 = _AddActivityResponse["default"];
return this.apiClient.callApi('/activities', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Add an activity
* Adds a new activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). For more information, see the tutorial for <a href=\"https://pipedrive.readme.io/docs/adding-an-activity\" target=\"_blank\" rel=\"noopener noreferrer\">adding an activity</a>.
* @param {Object} opts Optional parameters
* @param {module:model/ActivityPostObject} opts.activityPostObject
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AddActivityResponse200}
*/
}, {
key: "addActivity",
value: function addActivity(opts) {
return this.addActivityWithHttpInfo(opts).then(function (response_and_data) {
return response_and_data;
});
}
/**
* Delete multiple activities in bulk
* Marks multiple activities as deleted. After 30 days, the activities will be permanently deleted.
* @param {String} ids The comma-separated IDs of activities that will be deleted
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DeleteActivitiesResponse200} and HTTP response
*/
}, {
key: "deleteActivitiesWithHttpInfo",
value: function deleteActivitiesWithHttpInfo(ids) {
var opts = {};
var postBody = null;
// verify the required parameter 'ids' is set
if (ids === undefined || ids === null) {
throw new Error("Missing the required parameter 'ids' when calling deleteActivities");
}
var pathParams = {};
var queryParams = {
'ids': ids
};
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 = _DeleteActivitiesResponse["default"];
return this.apiClient.callApi('/activities', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Delete multiple activities in bulk
* Marks multiple activities as deleted. After 30 days, the activities will be permanently deleted.
* @param {String} ids The comma-separated IDs of activities that will be deleted
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DeleteActivitiesResponse200}
*/
}, {
key: "deleteActivities",
value: function deleteActivities(ids) {
return this.deleteActivitiesWithHttpInfo(ids).then(function (response_and_data) {
return response_and_data;
});
}
/**
* Delete an activity
* Marks an activity as deleted. After 30 days, the activity will be permanently deleted.
* @param {Number} id The ID of the activity
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DeleteActivityResponse200} and HTTP response
*/
}, {
key: "deleteActivityWithHttpInfo",
value: function deleteActivityWithHttpInfo(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 deleteActivity");
}
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 = _DeleteActivityResponse["default"];
return this.apiClient.callApi('/activities/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Delete an activity
* Marks an activity as deleted. After 30 days, the activity will be permanently deleted.
* @param {Number} id The ID of the activity
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DeleteActivityResponse200}
*/
}, {
key: "deleteActivity",
value: function deleteActivity(id) {
return this.deleteActivityWithHttpInfo(id).then(function (response_and_data) {
return response_and_data;
});
}
/**
* Get all activities assigned to a particular user
* Returns all activities assigned to a particular user.
* @param {Object} opts Optional parameters
* @param {Number} opts.userId The ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets.
* @param {Number} opts.filterId The ID of the filter to use (will narrow down results if used together with `user_id` parameter)
* @param {String} opts.type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes.
* @param {Number} opts.limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned.
* @param {Number} opts.start For pagination, the position that represents the first result for the page
* @param {Date} opts.startDate Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format.
* @param {Date} opts.endDate Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format.
* @param {module:model/NumberBoolean} opts.done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both done and not done activities.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetActivitiesResponse200} and HTTP response
*/
}, {
key: "getActivitiesWithHttpInfo",
value: function getActivitiesWithHttpInfo(opts) {
opts = opts || {};
var postBody = null;
var pathParams = {};
var queryParams = {
'user_id': opts['user_id'] === undefined ? opts['userId'] : opts['user_id'],
'filter_id': opts['filter_id'] === undefined ? opts['filterId'] : opts['filter_id'],
'type': opts['type'] === undefined ? opts['type'] : opts['type'],
'limit': opts['limit'] === undefined ? opts['limit'] : opts['limit'],
'start': opts['start'] === undefined ? opts['start'] : opts['start'],
'start_date': opts['start_date'] === undefined ? opts['startDate'] : opts['start_date'],
'end_date': opts['end_date'] === undefined ? opts['endDate'] : opts['end_date'],
'done': opts['done'] === undefined ? opts['done'] : opts['done']
};
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 = _GetActivitiesResponse["default"];
return this.apiClient.callApi('/activities', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Get all activities assigned to a particular user
* Returns all activities assigned to a particular user.
* @param {Object} opts Optional parameters
* @param {Number} opts.userId The ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets.
* @param {Number} opts.filterId The ID of the filter to use (will narrow down results if used together with `user_id` parameter)
* @param {String} opts.type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes.
* @param {Number} opts.limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned.
* @param {Number} opts.start For pagination, the position that represents the first result for the page
* @param {Date} opts.startDate Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format.
* @param {Date} opts.endDate Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format.
* @param {module:model/NumberBoolean} opts.done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both done and not done activities.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetActivitiesResponse200}
*/
}, {
key: "getActivities",
value: function getActivities(opts) {
return this.getActivitiesWithHttpInfo(opts).then(function (response_and_data) {
return response_and_data;
});
}
/**
* Get all activities (BETA)
* Returns all activities. This is a cursor-paginated endpoint that is currently in BETA. For more information, please refer to our documentation on <a href=\"https://pipedrive.readme.io/docs/core-api-concepts-pagination\" target=\"_blank\" rel=\"noopener noreferrer\">pagination</a>. Please note that only global admins (those with global permissions) can access these endpoints. Users with regular permissions will receive a 403 response. Read more about global permissions <a href=\"https://support.pipedrive.com/en/article/global-user-management\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.
* @param {Object} opts Optional parameters
* @param {String} opts.cursor For pagination, the marker (an opaque string value) representing the first item on the next page
* @param {Number} opts.limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
* @param {String} opts.since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field.
* @param {String} opts.until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field.
* @param {Number} opts.userId The ID of the user whose activities will be fetched. If omitted, all activities are returned.
* @param {Boolean} opts.done Whether the activity is done or not. `false` = Not done, `true` = Done. If omitted, returns both done and not done activities.
* @param {String} opts.type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetActivitiesCollectionResponse200} and HTTP response
*/
}, {
key: "getActivitiesCollectionWithHttpInfo",
value: function getActivitiesCollectionWithHttpInfo(opts) {
opts = opts || {};
var postBody = null;
var pathParams = {};
var queryParams = {
'cursor': opts['cursor'] === undefined ? opts['cursor'] : opts['cursor'],
'limit': opts['limit'] === undefined ? opts['limit'] : opts['limit'],
'since': opts['since'] === undefined ? opts['since'] : opts['since'],
'until': opts['until'] === undefined ? opts['until'] : opts['until'],
'user_id': opts['user_id'] === undefined ? opts['userId'] : opts['user_id'],
'done': opts['done'] === undefined ? opts['done'] : opts['done'],
'type': opts['type'] === undefined ? opts['type'] : opts['type']
};
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 = _GetActivitiesCollectionResponse["default"];
return this.apiClient.callApi('/activities/collection', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Get all activities (BETA)
* Returns all activities. This is a cursor-paginated endpoint that is currently in BETA. For more information, please refer to our documentation on <a href=\"https://pipedrive.readme.io/docs/core-api-concepts-pagination\" target=\"_blank\" rel=\"noopener noreferrer\">pagination</a>. Please note that only global admins (those with global permissions) can access these endpoints. Users with regular permissions will receive a 403 response. Read more about global permissions <a href=\"https://support.pipedrive.com/en/article/global-user-management\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.
* @param {Object} opts Optional parameters
* @param {String} opts.cursor For pagination, the marker (an opaque string value) representing the first item on the next page
* @param {Number} opts.limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
* @param {String} opts.since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field.
* @param {String} opts.until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field.
* @param {Number} opts.userId The ID of the user whose activities will be fetched. If omitted, all activities are returned.
* @param {Boolean} opts.done Whether the activity is done or not. `false` = Not done, `true` = Done. If omitted, returns both done and not done activities.
* @param {String} opts.type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetActivitiesCollectionResponse200}
*/
}, {
key: "getActivitiesCollection",
value: function getActivitiesCollection(opts) {
return this.getActivitiesCollectionWithHttpInfo(opts).then(function (response_and_data) {
return response_and_data;
});
}
/**
* Get details of an activity
* Returns the details of a specific activity.
* @param {Number} id The ID of the activity
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetActivityResponse200} and HTTP response
*/
}, {
key: "getActivityWithHttpInfo",
value: function getActivityWithHttpInfo(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 getActivity");
}
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 = _GetActivityResponse["default"];
return this.apiClient.callApi('/activities/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Get details of an activity
* Returns the details of a specific activity.
* @param {Number} id The ID of the activity
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetActivityResponse200}
*/
}, {
key: "getActivity",
value: function getActivity(id) {
return this.getActivityWithHttpInfo(id).then(function (response_and_data) {
return response_and_data;
});
}
/**
* Update an activity
* Updates an activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data).
* @param {Number} id The ID of the activity
* @param {Object} opts Optional parameters
* @param {module:model/ActivityPutObject} opts.activityPutObject
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UpdateActivityResponse200} and HTTP response
*/
}, {
key: "updateActivityWithHttpInfo",
value: function updateActivityWithHttpInfo(id, opts) {
opts = opts || {};
var postBody = opts['activityPutObject'];
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling updateActivity");
}
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 = _UpdateActivityResponse["default"];
return this.apiClient.callApi('/activities/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
}
/**
* Update an activity
* Updates an activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data).
* @param {Number} id The ID of the activity
* @param {Object} opts Optional parameters
* @param {module:model/ActivityPutObject} opts.activityPutObject
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UpdateActivityResponse200}
*/
}, {
key: "updateActivity",
value: function updateActivity(id, opts) {
return this.updateActivityWithHttpInfo(id, opts).then(function (response_and_data) {
return response_and_data;
});
}
}]);
return ActivitiesApi;
}();
exports["default"] = ActivitiesApi;