files.com 1.0.473 → 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
@@ -201,7 +201,7 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
201
201
  return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
202
202
  case 16:
203
203
  response = _context2.sent;
204
- return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
204
+ return _context2.abrupt("return");
205
205
  case 18:
206
206
  case "end":
207
207
  return _context2.stop();
@@ -212,19 +212,38 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
212
212
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
213
213
  return _this.delete(params);
214
214
  });
215
- (0, _defineProperty2.default)(this, "save", function () {
216
- if (_this.attributes['id']) {
217
- return _this.update(_this.attributes);
218
- } else {
219
- var newObject = Group.create(_this.attributes, _this.options);
220
- _this.attributes = _objectSpread({}, newObject.attributes);
221
- return true;
222
- }
223
- });
224
- Object.entries(attributes).forEach(function (_ref3) {
225
- var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
226
- key = _ref4[0],
227
- value = _ref4[1];
215
+ (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
216
+ var newObject, _newObject;
217
+ return _regenerator.default.wrap(function _callee3$(_context3) {
218
+ while (1) switch (_context3.prev = _context3.next) {
219
+ case 0:
220
+ if (!_this.attributes['id']) {
221
+ _context3.next = 8;
222
+ break;
223
+ }
224
+ _context3.next = 3;
225
+ return _this.update(_this.attributes);
226
+ case 3:
227
+ newObject = _context3.sent;
228
+ _this.attributes = _objectSpread({}, newObject.attributes);
229
+ return _context3.abrupt("return", true);
230
+ case 8:
231
+ _context3.next = 10;
232
+ return Group.create(_this.attributes, _this.options);
233
+ case 10:
234
+ _newObject = _context3.sent;
235
+ _this.attributes = _objectSpread({}, _newObject.attributes);
236
+ return _context3.abrupt("return", true);
237
+ case 13:
238
+ case "end":
239
+ return _context3.stop();
240
+ }
241
+ }, _callee3);
242
+ })));
243
+ Object.entries(attributes).forEach(function (_ref4) {
244
+ var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
245
+ key = _ref5[0],
246
+ value = _ref5[1];
228
247
  var normalizedKey = key.replace('?', '');
229
248
  _this.attributes[normalizedKey] = value;
230
249
  Object.defineProperty(_this, normalizedKey, {
@@ -242,47 +261,47 @@ _class = Group;
242
261
  // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `name`.
243
262
  // filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`.
244
263
  // ids - string - Comma-separated list of group ids to include in results.
245
- (0, _defineProperty2.default)(Group, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
264
+ (0, _defineProperty2.default)(Group, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
246
265
  var _response$data;
247
266
  var params,
248
267
  options,
249
268
  response,
250
- _args3 = arguments;
251
- return _regenerator.default.wrap(function _callee3$(_context3) {
252
- while (1) switch (_context3.prev = _context3.next) {
269
+ _args4 = arguments;
270
+ return _regenerator.default.wrap(function _callee4$(_context4) {
271
+ while (1) switch (_context4.prev = _context4.next) {
253
272
  case 0:
254
- params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
255
- options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
273
+ params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
274
+ options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
256
275
  if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
257
- _context3.next = 4;
276
+ _context4.next = 4;
258
277
  break;
259
278
  }
260
279
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
261
280
  case 4:
262
281
  if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
263
- _context3.next = 6;
282
+ _context4.next = 6;
264
283
  break;
265
284
  }
266
285
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
267
286
  case 6:
268
287
  if (!(params['ids'] && !(0, _utils.isString)(params['ids']))) {
269
- _context3.next = 8;
288
+ _context4.next = 8;
270
289
  break;
271
290
  }
272
291
  throw new errors.InvalidParameterError("Bad parameter: ids must be of type String, received ".concat((0, _utils.getType)(params['ids'])));
273
292
  case 8:
274
- _context3.next = 10;
293
+ _context4.next = 10;
275
294
  return _Api.default.sendRequest("/groups", 'GET', params, options);
276
295
  case 10:
277
- response = _context3.sent;
278
- 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) {
296
+ response = _context4.sent;
297
+ 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) {
279
298
  return new _class(obj, options);
280
299
  })) || []);
281
300
  case 12:
282
301
  case "end":
283
- return _context3.stop();
302
+ return _context4.stop();
284
303
  }
285
- }, _callee3);
304
+ }, _callee4);
286
305
  })));
287
306
  (0, _defineProperty2.default)(Group, "all", function () {
288
307
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -292,48 +311,48 @@ _class = Group;
292
311
  // Parameters:
293
312
  // id (required) - int64 - Group ID.
294
313
  (0, _defineProperty2.default)(Group, "find", /*#__PURE__*/function () {
295
- var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(id) {
314
+ var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id) {
296
315
  var params,
297
316
  options,
298
317
  response,
299
- _args4 = arguments;
300
- return _regenerator.default.wrap(function _callee4$(_context4) {
301
- while (1) switch (_context4.prev = _context4.next) {
318
+ _args5 = arguments;
319
+ return _regenerator.default.wrap(function _callee5$(_context5) {
320
+ while (1) switch (_context5.prev = _context5.next) {
302
321
  case 0:
303
- params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
304
- options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
322
+ params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
323
+ options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
305
324
  if ((0, _utils.isObject)(params)) {
306
- _context4.next = 4;
325
+ _context5.next = 4;
307
326
  break;
308
327
  }
309
328
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
310
329
  case 4:
311
330
  params['id'] = id;
312
331
  if (params['id']) {
313
- _context4.next = 7;
332
+ _context5.next = 7;
314
333
  break;
315
334
  }
316
335
  throw new errors.MissingParameterError('Parameter missing: id');
317
336
  case 7:
318
337
  if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
319
- _context4.next = 9;
338
+ _context5.next = 9;
320
339
  break;
321
340
  }
322
341
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
323
342
  case 9:
324
- _context4.next = 11;
343
+ _context5.next = 11;
325
344
  return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
326
345
  case 11:
327
- response = _context4.sent;
328
- return _context4.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
346
+ response = _context5.sent;
347
+ return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
329
348
  case 13:
330
349
  case "end":
331
- return _context4.stop();
350
+ return _context5.stop();
332
351
  }
333
- }, _callee4);
352
+ }, _callee5);
334
353
  }));
335
354
  return function (_x) {
336
- return _ref6.apply(this, arguments);
355
+ return _ref7.apply(this, arguments);
337
356
  };
338
357
  }());
339
358
  (0, _defineProperty2.default)(Group, "get", function (id) {
@@ -346,56 +365,56 @@ _class = Group;
346
365
  // user_ids - string - A list of user ids. If sent as a string, should be comma-delimited.
347
366
  // admin_ids - string - A list of group admin user ids. If sent as a string, should be comma-delimited.
348
367
  // name (required) - string - Group name.
349
- (0, _defineProperty2.default)(Group, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
368
+ (0, _defineProperty2.default)(Group, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
350
369
  var params,
351
370
  options,
352
371
  response,
353
- _args5 = arguments;
354
- return _regenerator.default.wrap(function _callee5$(_context5) {
355
- while (1) switch (_context5.prev = _context5.next) {
372
+ _args6 = arguments;
373
+ return _regenerator.default.wrap(function _callee6$(_context6) {
374
+ while (1) switch (_context6.prev = _context6.next) {
356
375
  case 0:
357
- params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
358
- options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
376
+ params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
377
+ options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
359
378
  if (params['name']) {
360
- _context5.next = 4;
379
+ _context6.next = 4;
361
380
  break;
362
381
  }
363
382
  throw new errors.MissingParameterError('Parameter missing: name');
364
383
  case 4:
365
384
  if (!(params['notes'] && !(0, _utils.isString)(params['notes']))) {
366
- _context5.next = 6;
385
+ _context6.next = 6;
367
386
  break;
368
387
  }
369
388
  throw new errors.InvalidParameterError("Bad parameter: notes must be of type String, received ".concat((0, _utils.getType)(params['notes'])));
370
389
  case 6:
371
390
  if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
372
- _context5.next = 8;
391
+ _context6.next = 8;
373
392
  break;
374
393
  }
375
394
  throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params['user_ids'])));
376
395
  case 8:
377
396
  if (!(params['admin_ids'] && !(0, _utils.isString)(params['admin_ids']))) {
378
- _context5.next = 10;
397
+ _context6.next = 10;
379
398
  break;
380
399
  }
381
400
  throw new errors.InvalidParameterError("Bad parameter: admin_ids must be of type String, received ".concat((0, _utils.getType)(params['admin_ids'])));
382
401
  case 10:
383
402
  if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
384
- _context5.next = 12;
403
+ _context6.next = 12;
385
404
  break;
386
405
  }
387
406
  throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
388
407
  case 12:
389
- _context5.next = 14;
408
+ _context6.next = 14;
390
409
  return _Api.default.sendRequest("/groups", 'POST', params, options);
391
410
  case 14:
392
- response = _context5.sent;
393
- return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
411
+ response = _context6.sent;
412
+ return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
394
413
  case 16:
395
414
  case "end":
396
- return _context5.stop();
415
+ return _context6.stop();
397
416
  }
398
- }, _callee5);
417
+ }, _callee6);
399
418
  })));
400
419
  var _default = exports.default = Group;
401
420
  module.exports = Group;
@@ -259,7 +259,7 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
259
259
  return _Api.default.sendRequest("/group_users/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
260
260
  case 32:
261
261
  response = _context2.sent;
262
- return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
262
+ return _context2.abrupt("return");
263
263
  case 34:
264
264
  case "end":
265
265
  return _context2.stop();
@@ -270,19 +270,38 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
270
270
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
271
271
  return _this.delete(params);
272
272
  });
273
- (0, _defineProperty2.default)(this, "save", function () {
274
- if (_this.attributes['id']) {
275
- return _this.update(_this.attributes);
276
- } else {
277
- var newObject = GroupUser.create(_this.attributes, _this.options);
278
- _this.attributes = _objectSpread({}, newObject.attributes);
279
- return true;
280
- }
281
- });
282
- Object.entries(attributes).forEach(function (_ref3) {
283
- var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
284
- key = _ref4[0],
285
- value = _ref4[1];
273
+ (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
274
+ var newObject, _newObject;
275
+ return _regenerator.default.wrap(function _callee3$(_context3) {
276
+ while (1) switch (_context3.prev = _context3.next) {
277
+ case 0:
278
+ if (!_this.attributes['id']) {
279
+ _context3.next = 8;
280
+ break;
281
+ }
282
+ _context3.next = 3;
283
+ return _this.update(_this.attributes);
284
+ case 3:
285
+ newObject = _context3.sent;
286
+ _this.attributes = _objectSpread({}, newObject.attributes);
287
+ return _context3.abrupt("return", true);
288
+ case 8:
289
+ _context3.next = 10;
290
+ return GroupUser.create(_this.attributes, _this.options);
291
+ case 10:
292
+ _newObject = _context3.sent;
293
+ _this.attributes = _objectSpread({}, _newObject.attributes);
294
+ return _context3.abrupt("return", true);
295
+ case 13:
296
+ case "end":
297
+ return _context3.stop();
298
+ }
299
+ }, _callee3);
300
+ })));
301
+ Object.entries(attributes).forEach(function (_ref4) {
302
+ var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
303
+ key = _ref5[0],
304
+ value = _ref5[1];
286
305
  var normalizedKey = key.replace('?', '');
287
306
  _this.attributes[normalizedKey] = value;
288
307
  Object.defineProperty(_this, normalizedKey, {
@@ -298,53 +317,53 @@ _class = GroupUser;
298
317
  // 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.
299
318
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
300
319
  // group_id - int64 - Group ID. If provided, will return group_users of this group.
301
- (0, _defineProperty2.default)(GroupUser, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
320
+ (0, _defineProperty2.default)(GroupUser, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
302
321
  var _response$data;
303
322
  var params,
304
323
  options,
305
324
  response,
306
- _args3 = arguments;
307
- return _regenerator.default.wrap(function _callee3$(_context3) {
308
- while (1) switch (_context3.prev = _context3.next) {
325
+ _args4 = arguments;
326
+ return _regenerator.default.wrap(function _callee4$(_context4) {
327
+ while (1) switch (_context4.prev = _context4.next) {
309
328
  case 0:
310
- params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
311
- options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
329
+ params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
330
+ options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
312
331
  if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
313
- _context3.next = 4;
332
+ _context4.next = 4;
314
333
  break;
315
334
  }
316
335
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
317
336
  case 4:
318
337
  if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
319
- _context3.next = 6;
338
+ _context4.next = 6;
320
339
  break;
321
340
  }
322
341
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
323
342
  case 6:
324
343
  if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
325
- _context3.next = 8;
344
+ _context4.next = 8;
326
345
  break;
327
346
  }
328
347
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
329
348
  case 8:
330
349
  if (!(params['group_id'] && !(0, _utils.isInt)(params['group_id']))) {
331
- _context3.next = 10;
350
+ _context4.next = 10;
332
351
  break;
333
352
  }
334
353
  throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params['group_id'])));
335
354
  case 10:
336
- _context3.next = 12;
355
+ _context4.next = 12;
337
356
  return _Api.default.sendRequest("/group_users", 'GET', params, options);
338
357
  case 12:
339
- response = _context3.sent;
340
- 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) {
358
+ response = _context4.sent;
359
+ 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) {
341
360
  return new _class(obj, options);
342
361
  })) || []);
343
362
  case 14:
344
363
  case "end":
345
- return _context3.stop();
364
+ return _context4.stop();
346
365
  }
347
- }, _callee3);
366
+ }, _callee4);
348
367
  })));
349
368
  (0, _defineProperty2.default)(GroupUser, "all", function () {
350
369
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -355,50 +374,50 @@ _class = GroupUser;
355
374
  // group_id (required) - int64 - Group ID to add user to.
356
375
  // user_id (required) - int64 - User ID to add to group.
357
376
  // admin - boolean - Is the user a group administrator?
358
- (0, _defineProperty2.default)(GroupUser, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
377
+ (0, _defineProperty2.default)(GroupUser, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
359
378
  var params,
360
379
  options,
361
380
  response,
362
- _args4 = arguments;
363
- return _regenerator.default.wrap(function _callee4$(_context4) {
364
- while (1) switch (_context4.prev = _context4.next) {
381
+ _args5 = arguments;
382
+ return _regenerator.default.wrap(function _callee5$(_context5) {
383
+ while (1) switch (_context5.prev = _context5.next) {
365
384
  case 0:
366
- params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
367
- options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
385
+ params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
386
+ options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
368
387
  if (params['group_id']) {
369
- _context4.next = 4;
388
+ _context5.next = 4;
370
389
  break;
371
390
  }
372
391
  throw new errors.MissingParameterError('Parameter missing: group_id');
373
392
  case 4:
374
393
  if (params['user_id']) {
375
- _context4.next = 6;
394
+ _context5.next = 6;
376
395
  break;
377
396
  }
378
397
  throw new errors.MissingParameterError('Parameter missing: user_id');
379
398
  case 6:
380
399
  if (!(params['group_id'] && !(0, _utils.isInt)(params['group_id']))) {
381
- _context4.next = 8;
400
+ _context5.next = 8;
382
401
  break;
383
402
  }
384
403
  throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params['group_id'])));
385
404
  case 8:
386
405
  if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
387
- _context4.next = 10;
406
+ _context5.next = 10;
388
407
  break;
389
408
  }
390
409
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
391
410
  case 10:
392
- _context4.next = 12;
411
+ _context5.next = 12;
393
412
  return _Api.default.sendRequest("/group_users", 'POST', params, options);
394
413
  case 12:
395
- response = _context4.sent;
396
- return _context4.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
414
+ response = _context5.sent;
415
+ return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
397
416
  case 14:
398
417
  case "end":
399
- return _context4.stop();
418
+ return _context5.stop();
400
419
  }
401
- }, _callee4);
420
+ }, _callee5);
402
421
  })));
403
422
  var _default = exports.default = GroupUser;
404
423
  module.exports = GroupUser;