files.com 1.0.474 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. package/_VERSION +1 -1
  2. package/lib/Files.js +1 -1
  3. package/lib/models/ActionNotificationExport.js +63 -49
  4. package/lib/models/ActionWebhookFailure.js +1 -1
  5. package/lib/models/ApiKey.js +113 -94
  6. package/lib/models/As2Partner.js +81 -62
  7. package/lib/models/As2Station.js +79 -60
  8. package/lib/models/Automation.js +90 -71
  9. package/lib/models/Behavior.js +114 -95
  10. package/lib/models/Bundle.js +90 -71
  11. package/lib/models/BundleNotification.js +75 -56
  12. package/lib/models/BundleRecipient.js +61 -47
  13. package/lib/models/Clickwrap.js +77 -58
  14. package/lib/models/ExternalEvent.js +71 -57
  15. package/lib/models/File.js +166 -154
  16. package/lib/models/FileComment.js +65 -46
  17. package/lib/models/FileCommentReaction.js +44 -30
  18. package/lib/models/Folder.js +58 -46
  19. package/lib/models/FormFieldSet.js +76 -57
  20. package/lib/models/GpgKey.js +79 -60
  21. package/lib/models/Group.js +78 -59
  22. package/lib/models/GroupUser.js +63 -44
  23. package/lib/models/HistoryExport.js +76 -62
  24. package/lib/models/InboxRecipient.js +61 -47
  25. package/lib/models/Lock.js +56 -44
  26. package/lib/models/Message.js +82 -63
  27. package/lib/models/MessageComment.js +78 -59
  28. package/lib/models/MessageCommentReaction.js +73 -59
  29. package/lib/models/MessageReaction.js +73 -59
  30. package/lib/models/Notification.js +84 -65
  31. package/lib/models/Permission.js +60 -46
  32. package/lib/models/Project.js +74 -55
  33. package/lib/models/PublicKey.js +78 -59
  34. package/lib/models/RemoteServer.js +147 -128
  35. package/lib/models/Request.js +76 -62
  36. package/lib/models/Session.js +53 -39
  37. package/lib/models/SftpHostKey.js +74 -55
  38. package/lib/models/ShareGroup.js +79 -60
  39. package/lib/models/Snapshot.js +75 -56
  40. package/lib/models/SsoStrategy.js +1 -1
  41. package/lib/models/Style.js +37 -23
  42. package/lib/models/User.js +104 -85
  43. package/lib/models/UserRequest.js +73 -59
  44. package/lib/models/WebhookTest.js +46 -32
  45. package/package.json +1 -1
  46. package/src/Files.js +1 -1
  47. package/src/models/ActionNotificationExport.js +2 -2
  48. package/src/models/ActionWebhookFailure.js +1 -1
  49. package/src/models/ApiKey.js +7 -5
  50. package/src/models/As2Partner.js +6 -4
  51. package/src/models/As2Station.js +6 -4
  52. package/src/models/Automation.js +7 -5
  53. package/src/models/Behavior.js +7 -5
  54. package/src/models/Bundle.js +7 -5
  55. package/src/models/BundleNotification.js +6 -4
  56. package/src/models/BundleRecipient.js +2 -2
  57. package/src/models/Clickwrap.js +6 -4
  58. package/src/models/ExternalEvent.js +2 -2
  59. package/src/models/File.js +3 -3
  60. package/src/models/FileComment.js +6 -4
  61. package/src/models/FileCommentReaction.js +3 -3
  62. package/src/models/Folder.js +2 -2
  63. package/src/models/FormFieldSet.js +6 -4
  64. package/src/models/GpgKey.js +6 -4
  65. package/src/models/Group.js +6 -4
  66. package/src/models/GroupUser.js +6 -4
  67. package/src/models/HistoryExport.js +2 -2
  68. package/src/models/InboxRecipient.js +2 -2
  69. package/src/models/Lock.js +3 -3
  70. package/src/models/Message.js +6 -4
  71. package/src/models/MessageComment.js +6 -4
  72. package/src/models/MessageCommentReaction.js +3 -3
  73. package/src/models/MessageReaction.js +3 -3
  74. package/src/models/Notification.js +6 -4
  75. package/src/models/Permission.js +3 -3
  76. package/src/models/Project.js +6 -4
  77. package/src/models/PublicKey.js +6 -4
  78. package/src/models/RemoteServer.js +6 -4
  79. package/src/models/Request.js +3 -3
  80. package/src/models/Session.js +3 -3
  81. package/src/models/SftpHostKey.js +6 -4
  82. package/src/models/ShareGroup.js +6 -4
  83. package/src/models/Snapshot.js +6 -4
  84. package/src/models/SsoStrategy.js +1 -1
  85. package/src/models/Style.js +6 -3
  86. package/src/models/User.js +9 -7
  87. package/src/models/UserRequest.js +3 -3
  88. package/src/models/WebhookTest.js +2 -2
@@ -184,7 +184,7 @@ var Lock = /*#__PURE__*/(0, _createClass2.default)(function Lock() {
184
184
  return _Api.default.sendRequest("/locks/".concat(encodeURIComponent(params['path'])), 'DELETE', params, _this.options);
185
185
  case 24:
186
186
  response = _context.sent;
187
- return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
187
+ return _context.abrupt("return");
188
188
  case 26:
189
189
  case "end":
190
190
  return _context.stop();
@@ -195,15 +195,27 @@ var Lock = /*#__PURE__*/(0, _createClass2.default)(function Lock() {
195
195
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
196
196
  return _this.delete(params);
197
197
  });
198
- (0, _defineProperty2.default)(this, "save", function () {
199
- var newObject = Lock.create(_this.attributes.path, _this.attributes, _this.options);
200
- _this.attributes = _objectSpread({}, newObject.attributes);
201
- return true;
202
- });
203
- Object.entries(attributes).forEach(function (_ref2) {
204
- var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
205
- key = _ref3[0],
206
- value = _ref3[1];
198
+ (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
199
+ var newObject;
200
+ return _regenerator.default.wrap(function _callee2$(_context2) {
201
+ while (1) switch (_context2.prev = _context2.next) {
202
+ case 0:
203
+ _context2.next = 2;
204
+ return Lock.create(_this.attributes.path, _this.attributes, _this.options);
205
+ case 2:
206
+ newObject = _context2.sent;
207
+ _this.attributes = _objectSpread({}, newObject.attributes);
208
+ return _context2.abrupt("return", true);
209
+ case 5:
210
+ case "end":
211
+ return _context2.stop();
212
+ }
213
+ }, _callee2);
214
+ })));
215
+ Object.entries(attributes).forEach(function (_ref3) {
216
+ var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
217
+ key = _ref4[0],
218
+ value = _ref4[1];
207
219
  var normalizedKey = key.replace('?', '');
208
220
  _this.attributes[normalizedKey] = value;
209
221
  Object.defineProperty(_this, normalizedKey, {
@@ -220,63 +232,63 @@ _class = Lock;
220
232
  // path (required) - string - Path to operate on.
221
233
  // include_children - boolean - Include locks from children objects?
222
234
  (0, _defineProperty2.default)(Lock, "listFor", /*#__PURE__*/function () {
223
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(path) {
235
+ var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(path) {
224
236
  var _response$data;
225
237
  var params,
226
238
  options,
227
239
  response,
228
- _args2 = arguments;
229
- return _regenerator.default.wrap(function _callee2$(_context2) {
230
- while (1) switch (_context2.prev = _context2.next) {
240
+ _args3 = arguments;
241
+ return _regenerator.default.wrap(function _callee3$(_context3) {
242
+ while (1) switch (_context3.prev = _context3.next) {
231
243
  case 0:
232
- params = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
233
- options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
244
+ params = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
245
+ options = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {};
234
246
  if ((0, _utils.isObject)(params)) {
235
- _context2.next = 4;
247
+ _context3.next = 4;
236
248
  break;
237
249
  }
238
250
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
239
251
  case 4:
240
252
  params['path'] = path;
241
253
  if (params['path']) {
242
- _context2.next = 7;
254
+ _context3.next = 7;
243
255
  break;
244
256
  }
245
257
  throw new errors.MissingParameterError('Parameter missing: path');
246
258
  case 7:
247
259
  if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
248
- _context2.next = 9;
260
+ _context3.next = 9;
249
261
  break;
250
262
  }
251
263
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
252
264
  case 9:
253
265
  if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
254
- _context2.next = 11;
266
+ _context3.next = 11;
255
267
  break;
256
268
  }
257
269
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
258
270
  case 11:
259
271
  if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
260
- _context2.next = 13;
272
+ _context3.next = 13;
261
273
  break;
262
274
  }
263
275
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
264
276
  case 13:
265
- _context2.next = 15;
277
+ _context3.next = 15;
266
278
  return _Api.default.sendRequest("/locks/".concat(encodeURIComponent(params['path'])), 'GET', params, options);
267
279
  case 15:
268
- response = _context2.sent;
269
- return _context2.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
280
+ response = _context3.sent;
281
+ return _context3.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
270
282
  return new _class(obj, options);
271
283
  })) || []);
272
284
  case 17:
273
285
  case "end":
274
- return _context2.stop();
286
+ return _context3.stop();
275
287
  }
276
- }, _callee2);
288
+ }, _callee3);
277
289
  }));
278
290
  return function (_x) {
279
- return _ref4.apply(this, arguments);
291
+ return _ref5.apply(this, arguments);
280
292
  };
281
293
  }());
282
294
  // Parameters:
@@ -286,60 +298,60 @@ _class = Lock;
286
298
  // recursive - string - Does lock apply to subfolders?
287
299
  // timeout - int64 - Lock timeout length
288
300
  (0, _defineProperty2.default)(Lock, "create", /*#__PURE__*/function () {
289
- var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(path) {
301
+ var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(path) {
290
302
  var params,
291
303
  options,
292
304
  response,
293
- _args3 = arguments;
294
- return _regenerator.default.wrap(function _callee3$(_context3) {
295
- while (1) switch (_context3.prev = _context3.next) {
305
+ _args4 = arguments;
306
+ return _regenerator.default.wrap(function _callee4$(_context4) {
307
+ while (1) switch (_context4.prev = _context4.next) {
296
308
  case 0:
297
- params = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
298
- options = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {};
309
+ params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
310
+ options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
299
311
  if ((0, _utils.isObject)(params)) {
300
- _context3.next = 4;
312
+ _context4.next = 4;
301
313
  break;
302
314
  }
303
315
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
304
316
  case 4:
305
317
  params['path'] = path;
306
318
  if (params['path']) {
307
- _context3.next = 7;
319
+ _context4.next = 7;
308
320
  break;
309
321
  }
310
322
  throw new errors.MissingParameterError('Parameter missing: path');
311
323
  case 7:
312
324
  if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
313
- _context3.next = 9;
325
+ _context4.next = 9;
314
326
  break;
315
327
  }
316
328
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
317
329
  case 9:
318
330
  if (!(params['recursive'] && !(0, _utils.isString)(params['recursive']))) {
319
- _context3.next = 11;
331
+ _context4.next = 11;
320
332
  break;
321
333
  }
322
334
  throw new errors.InvalidParameterError("Bad parameter: recursive must be of type String, received ".concat((0, _utils.getType)(params['recursive'])));
323
335
  case 11:
324
336
  if (!(params['timeout'] && !(0, _utils.isInt)(params['timeout']))) {
325
- _context3.next = 13;
337
+ _context4.next = 13;
326
338
  break;
327
339
  }
328
340
  throw new errors.InvalidParameterError("Bad parameter: timeout must be of type Int, received ".concat((0, _utils.getType)(params['timeout'])));
329
341
  case 13:
330
- _context3.next = 15;
342
+ _context4.next = 15;
331
343
  return _Api.default.sendRequest("/locks/".concat(encodeURIComponent(params['path'])), 'POST', params, options);
332
344
  case 15:
333
- response = _context3.sent;
334
- return _context3.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
345
+ response = _context4.sent;
346
+ return _context4.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
335
347
  case 17:
336
348
  case "end":
337
- return _context3.stop();
349
+ return _context4.stop();
338
350
  }
339
- }, _callee3);
351
+ }, _callee4);
340
352
  }));
341
353
  return function (_x2) {
342
- return _ref5.apply(this, arguments);
354
+ return _ref6.apply(this, arguments);
343
355
  };
344
356
  }());
345
357
  var _default = exports.default = Lock;
@@ -236,7 +236,7 @@ var Message = /*#__PURE__*/(0, _createClass2.default)(function Message() {
236
236
  return _Api.default.sendRequest("/messages/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
237
237
  case 16:
238
238
  response = _context2.sent;
239
- return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
239
+ return _context2.abrupt("return");
240
240
  case 18:
241
241
  case "end":
242
242
  return _context2.stop();
@@ -247,19 +247,38 @@ var Message = /*#__PURE__*/(0, _createClass2.default)(function Message() {
247
247
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
248
248
  return _this.delete(params);
249
249
  });
250
- (0, _defineProperty2.default)(this, "save", function () {
251
- if (_this.attributes['id']) {
252
- return _this.update(_this.attributes);
253
- } else {
254
- var newObject = Message.create(_this.attributes, _this.options);
255
- _this.attributes = _objectSpread({}, newObject.attributes);
256
- return true;
257
- }
258
- });
259
- Object.entries(attributes).forEach(function (_ref3) {
260
- var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
261
- key = _ref4[0],
262
- value = _ref4[1];
250
+ (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
251
+ var newObject, _newObject;
252
+ return _regenerator.default.wrap(function _callee3$(_context3) {
253
+ while (1) switch (_context3.prev = _context3.next) {
254
+ case 0:
255
+ if (!_this.attributes['id']) {
256
+ _context3.next = 8;
257
+ break;
258
+ }
259
+ _context3.next = 3;
260
+ return _this.update(_this.attributes);
261
+ case 3:
262
+ newObject = _context3.sent;
263
+ _this.attributes = _objectSpread({}, newObject.attributes);
264
+ return _context3.abrupt("return", true);
265
+ case 8:
266
+ _context3.next = 10;
267
+ return Message.create(_this.attributes, _this.options);
268
+ case 10:
269
+ _newObject = _context3.sent;
270
+ _this.attributes = _objectSpread({}, _newObject.attributes);
271
+ return _context3.abrupt("return", true);
272
+ case 13:
273
+ case "end":
274
+ return _context3.stop();
275
+ }
276
+ }, _callee3);
277
+ })));
278
+ Object.entries(attributes).forEach(function (_ref4) {
279
+ var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
280
+ key = _ref5[0],
281
+ value = _ref5[1];
263
282
  var normalizedKey = key.replace('?', '');
264
283
  _this.attributes[normalizedKey] = value;
265
284
  Object.defineProperty(_this, normalizedKey, {
@@ -275,59 +294,59 @@ _class = Message;
275
294
  // cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
276
295
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
277
296
  // project_id (required) - int64 - Project for which to return messages.
278
- (0, _defineProperty2.default)(Message, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
297
+ (0, _defineProperty2.default)(Message, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
279
298
  var _response$data;
280
299
  var params,
281
300
  options,
282
301
  response,
283
- _args3 = arguments;
284
- return _regenerator.default.wrap(function _callee3$(_context3) {
285
- while (1) switch (_context3.prev = _context3.next) {
302
+ _args4 = arguments;
303
+ return _regenerator.default.wrap(function _callee4$(_context4) {
304
+ while (1) switch (_context4.prev = _context4.next) {
286
305
  case 0:
287
- params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
288
- options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
306
+ params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
307
+ options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
289
308
  if (params['project_id']) {
290
- _context3.next = 4;
309
+ _context4.next = 4;
291
310
  break;
292
311
  }
293
312
  throw new errors.MissingParameterError('Parameter missing: project_id');
294
313
  case 4:
295
314
  if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
296
- _context3.next = 6;
315
+ _context4.next = 6;
297
316
  break;
298
317
  }
299
318
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
300
319
  case 6:
301
320
  if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
302
- _context3.next = 8;
321
+ _context4.next = 8;
303
322
  break;
304
323
  }
305
324
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
306
325
  case 8:
307
326
  if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
308
- _context3.next = 10;
327
+ _context4.next = 10;
309
328
  break;
310
329
  }
311
330
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
312
331
  case 10:
313
332
  if (!(params['project_id'] && !(0, _utils.isInt)(params['project_id']))) {
314
- _context3.next = 12;
333
+ _context4.next = 12;
315
334
  break;
316
335
  }
317
336
  throw new errors.InvalidParameterError("Bad parameter: project_id must be of type Int, received ".concat((0, _utils.getType)(params['project_id'])));
318
337
  case 12:
319
- _context3.next = 14;
338
+ _context4.next = 14;
320
339
  return _Api.default.sendRequest("/messages", 'GET', params, options);
321
340
  case 14:
322
- response = _context3.sent;
323
- return _context3.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
341
+ response = _context4.sent;
342
+ return _context4.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
324
343
  return new _class(obj, options);
325
344
  })) || []);
326
345
  case 16:
327
346
  case "end":
328
- return _context3.stop();
347
+ return _context4.stop();
329
348
  }
330
- }, _callee3);
349
+ }, _callee4);
331
350
  })));
332
351
  (0, _defineProperty2.default)(Message, "all", function () {
333
352
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -337,48 +356,48 @@ _class = Message;
337
356
  // Parameters:
338
357
  // id (required) - int64 - Message ID.
339
358
  (0, _defineProperty2.default)(Message, "find", /*#__PURE__*/function () {
340
- var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(id) {
359
+ var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id) {
341
360
  var params,
342
361
  options,
343
362
  response,
344
- _args4 = arguments;
345
- return _regenerator.default.wrap(function _callee4$(_context4) {
346
- while (1) switch (_context4.prev = _context4.next) {
363
+ _args5 = arguments;
364
+ return _regenerator.default.wrap(function _callee5$(_context5) {
365
+ while (1) switch (_context5.prev = _context5.next) {
347
366
  case 0:
348
- params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
349
- options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
367
+ params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
368
+ options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
350
369
  if ((0, _utils.isObject)(params)) {
351
- _context4.next = 4;
370
+ _context5.next = 4;
352
371
  break;
353
372
  }
354
373
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
355
374
  case 4:
356
375
  params['id'] = id;
357
376
  if (params['id']) {
358
- _context4.next = 7;
377
+ _context5.next = 7;
359
378
  break;
360
379
  }
361
380
  throw new errors.MissingParameterError('Parameter missing: id');
362
381
  case 7:
363
382
  if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
364
- _context4.next = 9;
383
+ _context5.next = 9;
365
384
  break;
366
385
  }
367
386
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
368
387
  case 9:
369
- _context4.next = 11;
388
+ _context5.next = 11;
370
389
  return _Api.default.sendRequest("/messages/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
371
390
  case 11:
372
- response = _context4.sent;
373
- return _context4.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
391
+ response = _context5.sent;
392
+ return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
374
393
  case 13:
375
394
  case "end":
376
- return _context4.stop();
395
+ return _context5.stop();
377
396
  }
378
- }, _callee4);
397
+ }, _callee5);
379
398
  }));
380
399
  return function (_x) {
381
- return _ref6.apply(this, arguments);
400
+ return _ref7.apply(this, arguments);
382
401
  };
383
402
  }());
384
403
  (0, _defineProperty2.default)(Message, "get", function (id) {
@@ -391,68 +410,68 @@ _class = Message;
391
410
  // project_id (required) - int64 - Project to which the message should be attached.
392
411
  // subject (required) - string - Message subject.
393
412
  // body (required) - string - Message body.
394
- (0, _defineProperty2.default)(Message, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
413
+ (0, _defineProperty2.default)(Message, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
395
414
  var params,
396
415
  options,
397
416
  response,
398
- _args5 = arguments;
399
- return _regenerator.default.wrap(function _callee5$(_context5) {
400
- while (1) switch (_context5.prev = _context5.next) {
417
+ _args6 = arguments;
418
+ return _regenerator.default.wrap(function _callee6$(_context6) {
419
+ while (1) switch (_context6.prev = _context6.next) {
401
420
  case 0:
402
- params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
403
- options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
421
+ params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
422
+ options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
404
423
  if (params['project_id']) {
405
- _context5.next = 4;
424
+ _context6.next = 4;
406
425
  break;
407
426
  }
408
427
  throw new errors.MissingParameterError('Parameter missing: project_id');
409
428
  case 4:
410
429
  if (params['subject']) {
411
- _context5.next = 6;
430
+ _context6.next = 6;
412
431
  break;
413
432
  }
414
433
  throw new errors.MissingParameterError('Parameter missing: subject');
415
434
  case 6:
416
435
  if (params['body']) {
417
- _context5.next = 8;
436
+ _context6.next = 8;
418
437
  break;
419
438
  }
420
439
  throw new errors.MissingParameterError('Parameter missing: body');
421
440
  case 8:
422
441
  if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
423
- _context5.next = 10;
442
+ _context6.next = 10;
424
443
  break;
425
444
  }
426
445
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
427
446
  case 10:
428
447
  if (!(params['project_id'] && !(0, _utils.isInt)(params['project_id']))) {
429
- _context5.next = 12;
448
+ _context6.next = 12;
430
449
  break;
431
450
  }
432
451
  throw new errors.InvalidParameterError("Bad parameter: project_id must be of type Int, received ".concat((0, _utils.getType)(params['project_id'])));
433
452
  case 12:
434
453
  if (!(params['subject'] && !(0, _utils.isString)(params['subject']))) {
435
- _context5.next = 14;
454
+ _context6.next = 14;
436
455
  break;
437
456
  }
438
457
  throw new errors.InvalidParameterError("Bad parameter: subject must be of type String, received ".concat((0, _utils.getType)(params['subject'])));
439
458
  case 14:
440
459
  if (!(params['body'] && !(0, _utils.isString)(params['body']))) {
441
- _context5.next = 16;
460
+ _context6.next = 16;
442
461
  break;
443
462
  }
444
463
  throw new errors.InvalidParameterError("Bad parameter: body must be of type String, received ".concat((0, _utils.getType)(params['body'])));
445
464
  case 16:
446
- _context5.next = 18;
465
+ _context6.next = 18;
447
466
  return _Api.default.sendRequest("/messages", 'POST', params, options);
448
467
  case 18:
449
- response = _context5.sent;
450
- return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
468
+ response = _context6.sent;
469
+ return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
451
470
  case 20:
452
471
  case "end":
453
- return _context5.stop();
472
+ return _context6.stop();
454
473
  }
455
- }, _callee5);
474
+ }, _callee6);
456
475
  })));
457
476
  var _default = exports.default = Message;
458
477
  module.exports = Message;