pipedrive 13.3.4 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,11 @@ For public Changelog covering all changes done to Pipedrive’s API, webhooks an
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## 14.0.0
12
+ ### Changed
13
+ - Moved `v1/teams*` endpoints to `v1/legacyTeams*` as they're being deprecated because we are preparing for an upgraded version of the Teams API, which requires migrating the current functionality to a new path URL `v1/legacyTeams*`.
14
+ The functionality and [OAuth scopes](https://pipedrive.readme.io/docs/marketplace-scopes-and-permissions-explanations) of all the Teams API endpoints will remain the same.
15
+
11
16
  ## 13.3.4
12
17
  ### Changed
13
18
  - Updated `PUT /productFields/{id}`: parameter `name` is not
package/README.md CHANGED
@@ -282,6 +282,10 @@ Class | Method | HTTP request | Description
282
282
  *Pipedrive.CallLogsApi* | [**deleteCallLog**](docs/CallLogsApi.md#deleteCallLog) | **DELETE** /callLogs/{id} | Delete a call log
283
283
  *Pipedrive.CallLogsApi* | [**getCallLog**](docs/CallLogsApi.md#getCallLog) | **GET** /callLogs/{id} | Get details of a call log
284
284
  *Pipedrive.CallLogsApi* | [**getUserCallLogs**](docs/CallLogsApi.md#getUserCallLogs) | **GET** /callLogs | Get all call logs assigned to a particular user
285
+ *Pipedrive.ChannelsApi* | [**addChannel**](docs/ChannelsApi.md#addChannel) | **POST** /channels | Add a channel
286
+ *Pipedrive.ChannelsApi* | [**deleteChannel**](docs/ChannelsApi.md#deleteChannel) | **DELETE** /channels/{id} | Delete a channel
287
+ *Pipedrive.ChannelsApi* | [**deleteConversation**](docs/ChannelsApi.md#deleteConversation) | **DELETE** /channels/{channel-id}/conversations/{conversation-id} | Delete a conversation
288
+ *Pipedrive.ChannelsApi* | [**receiveMessage**](docs/ChannelsApi.md#receiveMessage) | **POST** /channels/messages/receive | Receives an incoming message
285
289
  *Pipedrive.CurrenciesApi* | [**getCurrencies**](docs/CurrenciesApi.md#getCurrencies) | **GET** /currencies | Get all supported currencies
286
290
  *Pipedrive.DealFieldsApi* | [**addDealField**](docs/DealFieldsApi.md#addDealField) | **POST** /dealFields | Add a new deal field
287
291
  *Pipedrive.DealFieldsApi* | [**deleteDealField**](docs/DealFieldsApi.md#deleteDealField) | **DELETE** /dealFields/{id} | Delete a deal field
@@ -351,6 +355,14 @@ Class | Method | HTTP request | Description
351
355
  *Pipedrive.LeadsApi* | [**getLeads**](docs/LeadsApi.md#getLeads) | **GET** /leads | Get all leads
352
356
  *Pipedrive.LeadsApi* | [**searchLeads**](docs/LeadsApi.md#searchLeads) | **GET** /leads/search | Search leads
353
357
  *Pipedrive.LeadsApi* | [**updateLead**](docs/LeadsApi.md#updateLead) | **PATCH** /leads/{id} | Update a lead
358
+ *Pipedrive.LegacyTeamsApi* | [**addTeam**](docs/LegacyTeamsApi.md#addTeam) | **POST** /legacyTeams | Add a new team
359
+ *Pipedrive.LegacyTeamsApi* | [**addTeamUser**](docs/LegacyTeamsApi.md#addTeamUser) | **POST** /legacyTeams/{id}/users | Add users to a team
360
+ *Pipedrive.LegacyTeamsApi* | [**deleteTeamUser**](docs/LegacyTeamsApi.md#deleteTeamUser) | **DELETE** /legacyTeams/{id}/users | Delete users from a team
361
+ *Pipedrive.LegacyTeamsApi* | [**getTeam**](docs/LegacyTeamsApi.md#getTeam) | **GET** /legacyTeams/{id} | Get a single team
362
+ *Pipedrive.LegacyTeamsApi* | [**getTeamUsers**](docs/LegacyTeamsApi.md#getTeamUsers) | **GET** /legacyTeams/{id}/users | Get all users in a team
363
+ *Pipedrive.LegacyTeamsApi* | [**getTeams**](docs/LegacyTeamsApi.md#getTeams) | **GET** /legacyTeams | Get all teams
364
+ *Pipedrive.LegacyTeamsApi* | [**getUserTeams**](docs/LegacyTeamsApi.md#getUserTeams) | **GET** /legacyTeams/user/{id} | Get all teams of a user
365
+ *Pipedrive.LegacyTeamsApi* | [**updateTeam**](docs/LegacyTeamsApi.md#updateTeam) | **PUT** /legacyTeams/{id} | Update a team
354
366
  *Pipedrive.MailboxApi* | [**deleteMailThread**](docs/MailboxApi.md#deleteMailThread) | **DELETE** /mailbox/mailThreads/{id} | Delete mail thread
355
367
  *Pipedrive.MailboxApi* | [**getMailMessage**](docs/MailboxApi.md#getMailMessage) | **GET** /mailbox/mailMessages/{id} | Get one mail message
356
368
  *Pipedrive.MailboxApi* | [**getMailThread**](docs/MailboxApi.md#getMailThread) | **GET** /mailbox/mailThreads/{id} | Get one mail thread
@@ -480,14 +492,6 @@ Class | Method | HTTP request | Description
480
492
  *Pipedrive.SubscriptionsApi* | [**getSubscriptionPayments**](docs/SubscriptionsApi.md#getSubscriptionPayments) | **GET** /subscriptions/{id}/payments | Get all payments of a subscription
481
493
  *Pipedrive.SubscriptionsApi* | [**updateRecurringSubscription**](docs/SubscriptionsApi.md#updateRecurringSubscription) | **PUT** /subscriptions/recurring/{id} | Update a recurring subscription
482
494
  *Pipedrive.SubscriptionsApi* | [**updateSubscriptionInstallment**](docs/SubscriptionsApi.md#updateSubscriptionInstallment) | **PUT** /subscriptions/installment/{id} | Update an installment subscription
483
- *Pipedrive.TeamsApi* | [**addTeam**](docs/TeamsApi.md#addTeam) | **POST** /teams | Add a new team
484
- *Pipedrive.TeamsApi* | [**addTeamUser**](docs/TeamsApi.md#addTeamUser) | **POST** /teams/{id}/users | Add users to a team
485
- *Pipedrive.TeamsApi* | [**deleteTeamUser**](docs/TeamsApi.md#deleteTeamUser) | **DELETE** /teams/{id}/users | Delete users from a team
486
- *Pipedrive.TeamsApi* | [**getTeam**](docs/TeamsApi.md#getTeam) | **GET** /teams/{id} | Get a single team
487
- *Pipedrive.TeamsApi* | [**getTeamUsers**](docs/TeamsApi.md#getTeamUsers) | **GET** /teams/{id}/users | Get all users in a team
488
- *Pipedrive.TeamsApi* | [**getTeams**](docs/TeamsApi.md#getTeams) | **GET** /teams | Get all teams
489
- *Pipedrive.TeamsApi* | [**getUserTeams**](docs/TeamsApi.md#getUserTeams) | **GET** /teams/user/{id} | Get all teams of a user
490
- *Pipedrive.TeamsApi* | [**updateTeam**](docs/TeamsApi.md#updateTeam) | **PUT** /teams/{id} | Update a team
491
495
  *Pipedrive.UserConnectionsApi* | [**getUserConnections**](docs/UserConnectionsApi.md#getUserConnections) | **GET** /userConnections | Get all user connections
492
496
  *Pipedrive.UserSettingsApi* | [**getUserSettings**](docs/UserSettingsApi.md#getUserSettings) | **GET** /userSettings | List settings of an authorized user
493
497
  *Pipedrive.UsersApi* | [**addUser**](docs/UsersApi.md#addUser) | **POST** /users | Add a new user
@@ -631,6 +635,9 @@ Class | Method | HTTP request | Description
631
635
  - [Pipedrive.CallLogResponse409](docs/CallLogResponse409.md)
632
636
  - [Pipedrive.CallLogResponse410](docs/CallLogResponse410.md)
633
637
  - [Pipedrive.CallLogResponse500](docs/CallLogResponse500.md)
638
+ - [Pipedrive.ChannelObject](docs/ChannelObject.md)
639
+ - [Pipedrive.ChannelObjectResponse](docs/ChannelObjectResponse.md)
640
+ - [Pipedrive.ChannelObjectResponseData](docs/ChannelObjectResponseData.md)
634
641
  - [Pipedrive.CommentPostPutObject](docs/CommentPostPutObject.md)
635
642
  - [Pipedrive.CommonMailThread](docs/CommonMailThread.md)
636
643
  - [Pipedrive.CreateRemoteFileAndLinkItToItem](docs/CreateRemoteFileAndLinkItToItem.md)
@@ -695,7 +702,9 @@ Class | Method | HTTP request | Description
695
702
  - [Pipedrive.DeleteActivitiesResponse200Data](docs/DeleteActivitiesResponse200Data.md)
696
703
  - [Pipedrive.DeleteActivityResponse200](docs/DeleteActivityResponse200.md)
697
704
  - [Pipedrive.DeleteActivityResponse200Data](docs/DeleteActivityResponse200Data.md)
705
+ - [Pipedrive.DeleteChannelSuccess](docs/DeleteChannelSuccess.md)
698
706
  - [Pipedrive.DeleteComment](docs/DeleteComment.md)
707
+ - [Pipedrive.DeleteConversationSuccess](docs/DeleteConversationSuccess.md)
699
708
  - [Pipedrive.DeleteDeal](docs/DeleteDeal.md)
700
709
  - [Pipedrive.DeleteDealData](docs/DeleteDealData.md)
701
710
  - [Pipedrive.DeleteDealFollower](docs/DeleteDealFollower.md)
@@ -857,6 +866,16 @@ Class | Method | HTTP request | Description
857
866
  - [Pipedrive.GoalType](docs/GoalType.md)
858
867
  - [Pipedrive.GoalsResponseComponent](docs/GoalsResponseComponent.md)
859
868
  - [Pipedrive.IconKey](docs/IconKey.md)
869
+ - [Pipedrive.InlineResponse400](docs/InlineResponse400.md)
870
+ - [Pipedrive.InlineResponse4001](docs/InlineResponse4001.md)
871
+ - [Pipedrive.InlineResponse4001AdditionalData](docs/InlineResponse4001AdditionalData.md)
872
+ - [Pipedrive.InlineResponse400AdditionalData](docs/InlineResponse400AdditionalData.md)
873
+ - [Pipedrive.InlineResponse403](docs/InlineResponse403.md)
874
+ - [Pipedrive.InlineResponse4031](docs/InlineResponse4031.md)
875
+ - [Pipedrive.InlineResponse4031AdditionalData](docs/InlineResponse4031AdditionalData.md)
876
+ - [Pipedrive.InlineResponse403AdditionalData](docs/InlineResponse403AdditionalData.md)
877
+ - [Pipedrive.InlineResponse404](docs/InlineResponse404.md)
878
+ - [Pipedrive.InlineResponse404AdditionalData](docs/InlineResponse404AdditionalData.md)
860
879
  - [Pipedrive.ItemSearchAdditionalData](docs/ItemSearchAdditionalData.md)
861
880
  - [Pipedrive.ItemSearchAdditionalDataPagination](docs/ItemSearchAdditionalDataPagination.md)
862
881
  - [Pipedrive.ItemSearchFieldResponse](docs/ItemSearchFieldResponse.md)
@@ -942,6 +961,8 @@ Class | Method | HTTP request | Description
942
961
  - [Pipedrive.MergePersonsRequest](docs/MergePersonsRequest.md)
943
962
  - [Pipedrive.MergePersonsResponse](docs/MergePersonsResponse.md)
944
963
  - [Pipedrive.MergePersonsResponseAllOf](docs/MergePersonsResponseAllOf.md)
964
+ - [Pipedrive.MessageObject](docs/MessageObject.md)
965
+ - [Pipedrive.MessageObjectAttachments](docs/MessageObjectAttachments.md)
945
966
  - [Pipedrive.NewDeal](docs/NewDeal.md)
946
967
  - [Pipedrive.NewDealAllOf](docs/NewDealAllOf.md)
947
968
  - [Pipedrive.NewDealProduct](docs/NewDealProduct.md)
@@ -1240,7 +1261,7 @@ Class | Method | HTTP request | Description
1240
1261
  - mail:full: Read, update and delete mail threads. Also grants read access to mail messages.
1241
1262
  - products:read: Read products, its fields, files, followers and products connected to a deal.
1242
1263
  - products:full: Create, read, update and delete products and its fields; add products to deals
1243
- - users:read: Read data about users (people with access to a Pipedrive account), their permissions, roles and followers, as well as about teams.
1264
+ - users:read: Read data about users (people with access to a Pipedrive account), their permissions, roles and followers, as well as about legacy teams.
1244
1265
  - base: Read settings of the authorized user and currencies in an account.
1245
1266
  - phone-integration: Create, read and delete call logs and its audio recordings.
1246
1267
 
@@ -0,0 +1,328 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
+
14
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
+
16
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
17
+
18
+ var _ChannelObject = _interopRequireDefault(require("../model/ChannelObject"));
19
+
20
+ var _ChannelObjectResponse = _interopRequireDefault(require("../model/ChannelObjectResponse"));
21
+
22
+ var _DeleteChannelSuccess = _interopRequireDefault(require("../model/DeleteChannelSuccess"));
23
+
24
+ var _DeleteConversationSuccess = _interopRequireDefault(require("../model/DeleteConversationSuccess"));
25
+
26
+ var _InlineResponse = _interopRequireDefault(require("../model/InlineResponse400"));
27
+
28
+ var _InlineResponse2 = _interopRequireDefault(require("../model/InlineResponse4001"));
29
+
30
+ var _InlineResponse3 = _interopRequireDefault(require("../model/InlineResponse403"));
31
+
32
+ var _InlineResponse4 = _interopRequireDefault(require("../model/InlineResponse4031"));
33
+
34
+ var _InlineResponse5 = _interopRequireDefault(require("../model/InlineResponse404"));
35
+
36
+ var _MessageObject = _interopRequireDefault(require("../model/MessageObject"));
37
+
38
+ 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; }
39
+
40
+ 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; }
41
+
42
+ /**
43
+ * Channels service.
44
+ * @module api/ChannelsApi
45
+ * @version 1.0.0
46
+ */
47
+ var ChannelsApi = /*#__PURE__*/function () {
48
+ /**
49
+ * Constructs a new ChannelsApi.
50
+ * @alias module:api/ChannelsApi
51
+ * @class
52
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
53
+ * default to {@link module:ApiClient#instance} if unspecified.
54
+ */
55
+ function ChannelsApi(apiClient) {
56
+ (0, _classCallCheck2["default"])(this, ChannelsApi);
57
+ this.apiClient = apiClient || _ApiClient["default"].instance;
58
+ }
59
+ /**
60
+ * Add a channel
61
+ * Adds a new messaging, only admins are able to register new channels. It will use the getConversations endpoint to fetch conversations, participants and messages afterward. Read more in [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension).
62
+ * @param {Object} opts Optional parameters
63
+ * @param {module:model/ChannelObject} opts.channelObject
64
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ChannelObjectResponse} and HTTP response
65
+ */
66
+
67
+
68
+ (0, _createClass2["default"])(ChannelsApi, [{
69
+ key: "addChannelWithHttpInfo",
70
+ value: function addChannelWithHttpInfo(opts) {
71
+ opts = opts || {};
72
+ var postBody = opts['channelObject'];
73
+
74
+ if (opts['name'] === undefined || opts['name'] === null) {
75
+ throw new Error("Missing the required parameter 'name' when calling addChannel");
76
+ }
77
+
78
+ if (opts['provider_channel_id'] === undefined || opts['provider_channel_id'] === null) {
79
+ throw new Error("Missing the required parameter 'provider_channel_id' when calling addChannel");
80
+ }
81
+
82
+ var pathParams = {};
83
+ var queryParams = {};
84
+ var headerParams = {};
85
+ var formParams = {};
86
+ var formParamArray = [];
87
+ var contentTypes = ['application/json'];
88
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
89
+ var isJSON = contentTypes.includes('application/json');
90
+
91
+ if (isJSON) {
92
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
93
+ } else if (isURLEncoded) {
94
+ for (var key in opts) {
95
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
96
+ formParams[key] = opts[key];
97
+ }
98
+ }
99
+ }
100
+
101
+ var authNames = ['api_key', 'oauth2'];
102
+ var accepts = ['application/json'];
103
+ var returnType = _ChannelObjectResponse["default"];
104
+ return this.apiClient.callApi('/channels', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
105
+ }
106
+ /**
107
+ * Add a channel
108
+ * Adds a new messaging, only admins are able to register new channels. It will use the getConversations endpoint to fetch conversations, participants and messages afterward. Read more in [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension).
109
+ * @param {Object} opts Optional parameters
110
+ * @param {module:model/ChannelObject} opts.channelObject
111
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ChannelObjectResponse}
112
+ */
113
+
114
+ }, {
115
+ key: "addChannel",
116
+ value: function addChannel(opts) {
117
+ return this.addChannelWithHttpInfo(opts).then(function (response_and_data) {
118
+ return response_and_data;
119
+ });
120
+ }
121
+ /**
122
+ * Delete a channel
123
+ * Deletes an existing messengers channel and all related entities (conversations and messages).
124
+ * @param {String} id The ID of the channel provided by the integration
125
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DeleteChannelSuccess} and HTTP response
126
+ */
127
+
128
+ }, {
129
+ key: "deleteChannelWithHttpInfo",
130
+ value: function deleteChannelWithHttpInfo(id) {
131
+ var opts = {};
132
+ var postBody = null; // verify the required parameter 'id' is set
133
+
134
+ if (id === undefined || id === null) {
135
+ throw new Error("Missing the required parameter 'id' when calling deleteChannel");
136
+ }
137
+
138
+ var pathParams = {
139
+ 'id': id
140
+ };
141
+ var queryParams = {};
142
+ var headerParams = {};
143
+ var formParams = {};
144
+ var formParamArray = [];
145
+ var contentTypes = [];
146
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
147
+ var isJSON = contentTypes.includes('application/json');
148
+
149
+ if (isJSON) {
150
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
151
+ } else if (isURLEncoded) {
152
+ for (var key in opts) {
153
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
154
+ formParams[key] = opts[key];
155
+ }
156
+ }
157
+ }
158
+
159
+ var authNames = ['api_key', 'oauth2'];
160
+ var accepts = ['application/json'];
161
+ var returnType = _DeleteChannelSuccess["default"];
162
+ return this.apiClient.callApi('/channels/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
163
+ }
164
+ /**
165
+ * Delete a channel
166
+ * Deletes an existing messengers channel and all related entities (conversations and messages).
167
+ * @param {String} id The ID of the channel provided by the integration
168
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DeleteChannelSuccess}
169
+ */
170
+
171
+ }, {
172
+ key: "deleteChannel",
173
+ value: function deleteChannel(id) {
174
+ return this.deleteChannelWithHttpInfo(id).then(function (response_and_data) {
175
+ return response_and_data;
176
+ });
177
+ }
178
+ /**
179
+ * Delete a conversation
180
+ * Deletes an existing conversation.
181
+ * @param {String} channelId The ID of the channel provided by the integration
182
+ * @param {String} conversationId The ID of the conversation provided by the integration
183
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DeleteConversationSuccess} and HTTP response
184
+ */
185
+
186
+ }, {
187
+ key: "deleteConversationWithHttpInfo",
188
+ value: function deleteConversationWithHttpInfo(channelId, conversationId) {
189
+ var opts = {};
190
+ var postBody = null; // verify the required parameter 'channelId' is set
191
+
192
+ if (channelId === undefined || channelId === null) {
193
+ throw new Error("Missing the required parameter 'channelId' when calling deleteConversation");
194
+ } // verify the required parameter 'conversationId' is set
195
+
196
+
197
+ if (conversationId === undefined || conversationId === null) {
198
+ throw new Error("Missing the required parameter 'conversationId' when calling deleteConversation");
199
+ }
200
+
201
+ var pathParams = {
202
+ 'channel-id': channelId,
203
+ 'conversation-id': conversationId
204
+ };
205
+ var queryParams = {};
206
+ var headerParams = {};
207
+ var formParams = {};
208
+ var formParamArray = [];
209
+ var contentTypes = [];
210
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
211
+ var isJSON = contentTypes.includes('application/json');
212
+
213
+ if (isJSON) {
214
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
215
+ } else if (isURLEncoded) {
216
+ for (var key in opts) {
217
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
218
+ formParams[key] = opts[key];
219
+ }
220
+ }
221
+ }
222
+
223
+ var authNames = ['api_key', 'oauth2'];
224
+ var accepts = ['application/json'];
225
+ var returnType = _DeleteConversationSuccess["default"];
226
+ return this.apiClient.callApi('/channels/{channel-id}/conversations/{conversation-id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
227
+ }
228
+ /**
229
+ * Delete a conversation
230
+ * Deletes an existing conversation.
231
+ * @param {String} channelId The ID of the channel provided by the integration
232
+ * @param {String} conversationId The ID of the conversation provided by the integration
233
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DeleteConversationSuccess}
234
+ */
235
+
236
+ }, {
237
+ key: "deleteConversation",
238
+ value: function deleteConversation(channelId, conversationId) {
239
+ return this.deleteConversationWithHttpInfo(channelId, conversationId).then(function (response_and_data) {
240
+ return response_and_data;
241
+ });
242
+ }
243
+ /**
244
+ * Receives an incoming message
245
+ * Adds a message to a conversation.
246
+ * @param {Object} opts Optional parameters
247
+ * @param {module:model/MessageObject} opts.messageObject
248
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/MessageObject} and HTTP response
249
+ */
250
+
251
+ }, {
252
+ key: "receiveMessageWithHttpInfo",
253
+ value: function receiveMessageWithHttpInfo(opts) {
254
+ opts = opts || {};
255
+ var postBody = opts['messageObject'];
256
+
257
+ if (opts['id'] === undefined || opts['id'] === null) {
258
+ throw new Error("Missing the required parameter 'id' when calling receiveMessage");
259
+ }
260
+
261
+ if (opts['channel_id'] === undefined || opts['channel_id'] === null) {
262
+ throw new Error("Missing the required parameter 'channel_id' when calling receiveMessage");
263
+ }
264
+
265
+ if (opts['sender_id'] === undefined || opts['sender_id'] === null) {
266
+ throw new Error("Missing the required parameter 'sender_id' when calling receiveMessage");
267
+ }
268
+
269
+ if (opts['conversation_id'] === undefined || opts['conversation_id'] === null) {
270
+ throw new Error("Missing the required parameter 'conversation_id' when calling receiveMessage");
271
+ }
272
+
273
+ if (opts['message'] === undefined || opts['message'] === null) {
274
+ throw new Error("Missing the required parameter 'message' when calling receiveMessage");
275
+ }
276
+
277
+ if (opts['status'] === undefined || opts['status'] === null) {
278
+ throw new Error("Missing the required parameter 'status' when calling receiveMessage");
279
+ }
280
+
281
+ if (opts['created_at'] === undefined || opts['created_at'] === null) {
282
+ throw new Error("Missing the required parameter 'created_at' when calling receiveMessage");
283
+ }
284
+
285
+ var pathParams = {};
286
+ var queryParams = {};
287
+ var headerParams = {};
288
+ var formParams = {};
289
+ var formParamArray = [];
290
+ var contentTypes = ['application/json'];
291
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
292
+ var isJSON = contentTypes.includes('application/json');
293
+
294
+ if (isJSON) {
295
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
296
+ } else if (isURLEncoded) {
297
+ for (var key in opts) {
298
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
299
+ formParams[key] = opts[key];
300
+ }
301
+ }
302
+ }
303
+
304
+ var authNames = ['api_key', 'oauth2'];
305
+ var accepts = ['application/json'];
306
+ var returnType = _MessageObject["default"];
307
+ return this.apiClient.callApi('/channels/messages/receive', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
308
+ }
309
+ /**
310
+ * Receives an incoming message
311
+ * Adds a message to a conversation.
312
+ * @param {Object} opts Optional parameters
313
+ * @param {module:model/MessageObject} opts.messageObject
314
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/MessageObject}
315
+ */
316
+
317
+ }, {
318
+ key: "receiveMessage",
319
+ value: function receiveMessage(opts) {
320
+ return this.receiveMessageWithHttpInfo(opts).then(function (response_and_data) {
321
+ return response_and_data;
322
+ });
323
+ }
324
+ }]);
325
+ return ChannelsApi;
326
+ }();
327
+
328
+ exports["default"] = ChannelsApi;