files.com 1.2.249 → 1.2.251

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.
Files changed (90) hide show
  1. package/_VERSION +1 -1
  2. package/docs/models/User.md +4 -1
  3. package/lib/Api.js +72 -71
  4. package/lib/Files.js +1 -1
  5. package/lib/isomorphic/File.node.js +5 -5
  6. package/lib/models/ActionNotificationExport.js +38 -38
  7. package/lib/models/ActionNotificationExportResult.js +14 -14
  8. package/lib/models/ApiKey.js +100 -100
  9. package/lib/models/ApiRequestLog.js +8 -8
  10. package/lib/models/App.js +8 -8
  11. package/lib/models/As2IncomingMessage.js +10 -10
  12. package/lib/models/As2OutgoingMessage.js +10 -10
  13. package/lib/models/As2Partner.js +101 -101
  14. package/lib/models/As2Station.js +81 -81
  15. package/lib/models/Automation.js +167 -167
  16. package/lib/models/AutomationLog.js +8 -8
  17. package/lib/models/AutomationRun.js +24 -24
  18. package/lib/models/BandwidthSnapshot.js +8 -8
  19. package/lib/models/Behavior.js +106 -106
  20. package/lib/models/Bundle.js +143 -143
  21. package/lib/models/BundleAction.js +10 -10
  22. package/lib/models/BundleDownload.js +12 -12
  23. package/lib/models/BundleNotification.js +69 -69
  24. package/lib/models/BundleRecipient.js +40 -40
  25. package/lib/models/BundleRegistration.js +12 -12
  26. package/lib/models/Clickwrap.js +79 -79
  27. package/lib/models/DnsRecord.js +8 -8
  28. package/lib/models/EmailIncomingMessage.js +8 -8
  29. package/lib/models/EmailLog.js +8 -8
  30. package/lib/models/ExavaultApiRequestLog.js +8 -8
  31. package/lib/models/ExternalEvent.js +36 -36
  32. package/lib/models/File.js +269 -269
  33. package/lib/models/FileComment.js +70 -70
  34. package/lib/models/FileCommentReaction.js +34 -34
  35. package/lib/models/FileMigration.js +10 -10
  36. package/lib/models/FileMigrationLog.js +8 -8
  37. package/lib/models/Folder.js +36 -36
  38. package/lib/models/FormFieldSet.js +71 -71
  39. package/lib/models/FtpActionLog.js +8 -8
  40. package/lib/models/GpgKey.js +81 -81
  41. package/lib/models/Group.js +83 -83
  42. package/lib/models/GroupUser.js +89 -89
  43. package/lib/models/History.js +88 -88
  44. package/lib/models/HistoryExport.js +64 -64
  45. package/lib/models/HistoryExportResult.js +14 -14
  46. package/lib/models/InboxRecipient.js +36 -36
  47. package/lib/models/InboxRegistration.js +10 -10
  48. package/lib/models/InboxUpload.js +8 -8
  49. package/lib/models/Invoice.js +18 -18
  50. package/lib/models/IpAddress.js +32 -32
  51. package/lib/models/Lock.js +51 -51
  52. package/lib/models/Message.js +100 -100
  53. package/lib/models/MessageComment.js +78 -78
  54. package/lib/models/MessageCommentReaction.js +54 -54
  55. package/lib/models/MessageReaction.js +54 -54
  56. package/lib/models/Notification.js +91 -91
  57. package/lib/models/OutboundConnectionLog.js +8 -8
  58. package/lib/models/Payment.js +18 -18
  59. package/lib/models/Permission.js +54 -54
  60. package/lib/models/Priority.js +14 -14
  61. package/lib/models/Project.js +70 -70
  62. package/lib/models/PublicHostingRequestLog.js +8 -8
  63. package/lib/models/PublicKey.js +78 -78
  64. package/lib/models/RemoteBandwidthSnapshot.js +8 -8
  65. package/lib/models/RemoteServer.js +362 -362
  66. package/lib/models/Request.js +60 -60
  67. package/lib/models/Restore.js +24 -24
  68. package/lib/models/Session.js +21 -21
  69. package/lib/models/SettingsChange.js +8 -8
  70. package/lib/models/SftpActionLog.js +8 -8
  71. package/lib/models/SftpHostKey.js +67 -67
  72. package/lib/models/ShareGroup.js +79 -79
  73. package/lib/models/SiemHttpDestination.js +158 -158
  74. package/lib/models/Site.js +150 -150
  75. package/lib/models/Snapshot.js +85 -85
  76. package/lib/models/SsoStrategy.js +32 -32
  77. package/lib/models/Style.js +48 -48
  78. package/lib/models/SyncLog.js +8 -8
  79. package/lib/models/UsageDailySnapshot.js +8 -8
  80. package/lib/models/UsageSnapshot.js +8 -8
  81. package/lib/models/User.js +223 -215
  82. package/lib/models/UserCipherUse.js +10 -10
  83. package/lib/models/UserLifecycleRule.js +92 -92
  84. package/lib/models/UserRequest.js +56 -56
  85. package/lib/models/UserSftpClientUse.js +10 -10
  86. package/lib/models/WebDavActionLog.js +8 -8
  87. package/lib/models/WebhookTest.js +24 -24
  88. package/package.json +1 -1
  89. package/src/Files.js +1 -1
  90. package/src/models/User.js +6 -0
@@ -74,61 +74,61 @@ var SftpHostKey = /*#__PURE__*/(0, _createClass2.default)(function SftpHostKey()
74
74
  var params,
75
75
  response,
76
76
  _args = arguments;
77
- return _regenerator.default.wrap(function _callee$(_context) {
77
+ return _regenerator.default.wrap(function (_context) {
78
78
  while (1) switch (_context.prev = _context.next) {
79
79
  case 0:
80
80
  params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
81
81
  if (_this.attributes.id) {
82
- _context.next = 3;
82
+ _context.next = 1;
83
83
  break;
84
84
  }
85
85
  throw new errors.EmptyPropertyError('Current object has no id');
86
- case 3:
86
+ case 1:
87
87
  if ((0, _utils.isObject)(params)) {
88
- _context.next = 5;
88
+ _context.next = 2;
89
89
  break;
90
90
  }
91
91
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
92
- case 5:
92
+ case 2:
93
93
  params.id = _this.attributes.id;
94
94
  if (!(params.id && !(0, _utils.isInt)(params.id))) {
95
- _context.next = 8;
95
+ _context.next = 3;
96
96
  break;
97
97
  }
98
98
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
99
- case 8:
99
+ case 3:
100
100
  if (!(params.name && !(0, _utils.isString)(params.name))) {
101
- _context.next = 10;
101
+ _context.next = 4;
102
102
  break;
103
103
  }
104
104
  throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
105
- case 10:
105
+ case 4:
106
106
  if (!(params.private_key && !(0, _utils.isString)(params.private_key))) {
107
- _context.next = 12;
107
+ _context.next = 5;
108
108
  break;
109
109
  }
110
110
  throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params.private_key)));
111
- case 12:
111
+ case 5:
112
112
  if (params.id) {
113
- _context.next = 18;
113
+ _context.next = 7;
114
114
  break;
115
115
  }
116
116
  if (!_this.attributes.id) {
117
- _context.next = 17;
117
+ _context.next = 6;
118
118
  break;
119
119
  }
120
120
  params.id = _this.id;
121
- _context.next = 18;
121
+ _context.next = 7;
122
122
  break;
123
- case 17:
123
+ case 6:
124
124
  throw new errors.MissingParameterError('Parameter missing: id');
125
- case 18:
126
- _context.next = 20;
125
+ case 7:
126
+ _context.next = 8;
127
127
  return _Api.default.sendRequest("/sftp_host_keys/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
128
- case 20:
128
+ case 8:
129
129
  response = _context.sent;
130
130
  return _context.abrupt("return", new SftpHostKey(response === null || response === void 0 ? void 0 : response.data, _this.options));
131
- case 22:
131
+ case 9:
132
132
  case "end":
133
133
  return _context.stop();
134
134
  }
@@ -137,46 +137,46 @@ var SftpHostKey = /*#__PURE__*/(0, _createClass2.default)(function SftpHostKey()
137
137
  (0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
138
138
  var params,
139
139
  _args2 = arguments;
140
- return _regenerator.default.wrap(function _callee2$(_context2) {
140
+ return _regenerator.default.wrap(function (_context2) {
141
141
  while (1) switch (_context2.prev = _context2.next) {
142
142
  case 0:
143
143
  params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
144
144
  if (_this.attributes.id) {
145
- _context2.next = 3;
145
+ _context2.next = 1;
146
146
  break;
147
147
  }
148
148
  throw new errors.EmptyPropertyError('Current object has no id');
149
- case 3:
149
+ case 1:
150
150
  if ((0, _utils.isObject)(params)) {
151
- _context2.next = 5;
151
+ _context2.next = 2;
152
152
  break;
153
153
  }
154
154
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
155
- case 5:
155
+ case 2:
156
156
  params.id = _this.attributes.id;
157
157
  if (!(params.id && !(0, _utils.isInt)(params.id))) {
158
- _context2.next = 8;
158
+ _context2.next = 3;
159
159
  break;
160
160
  }
161
161
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
162
- case 8:
162
+ case 3:
163
163
  if (params.id) {
164
- _context2.next = 14;
164
+ _context2.next = 5;
165
165
  break;
166
166
  }
167
167
  if (!_this.attributes.id) {
168
- _context2.next = 13;
168
+ _context2.next = 4;
169
169
  break;
170
170
  }
171
171
  params.id = _this.id;
172
- _context2.next = 14;
172
+ _context2.next = 5;
173
173
  break;
174
- case 13:
174
+ case 4:
175
175
  throw new errors.MissingParameterError('Parameter missing: id');
176
- case 14:
177
- _context2.next = 16;
176
+ case 5:
177
+ _context2.next = 6;
178
178
  return _Api.default.sendRequest("/sftp_host_keys/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
179
- case 16:
179
+ case 6:
180
180
  case "end":
181
181
  return _context2.stop();
182
182
  }
@@ -188,27 +188,27 @@ var SftpHostKey = /*#__PURE__*/(0, _createClass2.default)(function SftpHostKey()
188
188
  });
189
189
  (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
190
190
  var _newObject, newObject;
191
- return _regenerator.default.wrap(function _callee3$(_context3) {
191
+ return _regenerator.default.wrap(function (_context3) {
192
192
  while (1) switch (_context3.prev = _context3.next) {
193
193
  case 0:
194
194
  if (!_this.attributes.id) {
195
- _context3.next = 6;
195
+ _context3.next = 2;
196
196
  break;
197
197
  }
198
- _context3.next = 3;
198
+ _context3.next = 1;
199
199
  return _this.update(_this.attributes);
200
- case 3:
200
+ case 1:
201
201
  _newObject = _context3.sent;
202
202
  _this.attributes = _objectSpread({}, _newObject.attributes);
203
203
  return _context3.abrupt("return", true);
204
- case 6:
205
- _context3.next = 8;
204
+ case 2:
205
+ _context3.next = 3;
206
206
  return SftpHostKey.create(_this.attributes, _this.options);
207
- case 8:
207
+ case 3:
208
208
  newObject = _context3.sent;
209
209
  _this.attributes = _objectSpread({}, newObject.attributes);
210
210
  return _context3.abrupt("return", true);
211
- case 11:
211
+ case 4:
212
212
  case "end":
213
213
  return _context3.stop();
214
214
  }
@@ -237,31 +237,31 @@ _SftpHostKey = SftpHostKey;
237
237
  options,
238
238
  response,
239
239
  _args4 = arguments;
240
- return _regenerator.default.wrap(function _callee4$(_context4) {
240
+ return _regenerator.default.wrap(function (_context4) {
241
241
  while (1) switch (_context4.prev = _context4.next) {
242
242
  case 0:
243
243
  params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
244
244
  options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
245
245
  if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
246
- _context4.next = 4;
246
+ _context4.next = 1;
247
247
  break;
248
248
  }
249
249
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
250
- case 4:
250
+ case 1:
251
251
  if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
252
- _context4.next = 6;
252
+ _context4.next = 2;
253
253
  break;
254
254
  }
255
255
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
256
- case 6:
257
- _context4.next = 8;
256
+ case 2:
257
+ _context4.next = 3;
258
258
  return _Api.default.sendRequest('/sftp_host_keys', 'GET', params, options);
259
- case 8:
259
+ case 3:
260
260
  response = _context4.sent;
261
261
  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) {
262
262
  return new _SftpHostKey(obj, options);
263
263
  })) || []);
264
- case 10:
264
+ case 4:
265
265
  case "end":
266
266
  return _context4.stop();
267
267
  }
@@ -280,36 +280,36 @@ _SftpHostKey = SftpHostKey;
280
280
  options,
281
281
  response,
282
282
  _args5 = arguments;
283
- return _regenerator.default.wrap(function _callee5$(_context5) {
283
+ return _regenerator.default.wrap(function (_context5) {
284
284
  while (1) switch (_context5.prev = _context5.next) {
285
285
  case 0:
286
286
  params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
287
287
  options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
288
288
  if ((0, _utils.isObject)(params)) {
289
- _context5.next = 4;
289
+ _context5.next = 1;
290
290
  break;
291
291
  }
292
292
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
293
- case 4:
293
+ case 1:
294
294
  params.id = id;
295
295
  if (params.id) {
296
- _context5.next = 7;
296
+ _context5.next = 2;
297
297
  break;
298
298
  }
299
299
  throw new errors.MissingParameterError('Parameter missing: id');
300
- case 7:
300
+ case 2:
301
301
  if (!(params.id && !(0, _utils.isInt)(params.id))) {
302
- _context5.next = 9;
302
+ _context5.next = 3;
303
303
  break;
304
304
  }
305
305
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
306
- case 9:
307
- _context5.next = 11;
306
+ case 3:
307
+ _context5.next = 4;
308
308
  return _Api.default.sendRequest("/sftp_host_keys/".concat(encodeURIComponent(params.id)), 'GET', params, options);
309
- case 11:
309
+ case 4:
310
310
  response = _context5.sent;
311
311
  return _context5.abrupt("return", new _SftpHostKey(response === null || response === void 0 ? void 0 : response.data, options));
312
- case 13:
312
+ case 5:
313
313
  case "end":
314
314
  return _context5.stop();
315
315
  }
@@ -332,29 +332,29 @@ _SftpHostKey = SftpHostKey;
332
332
  options,
333
333
  response,
334
334
  _args6 = arguments;
335
- return _regenerator.default.wrap(function _callee6$(_context6) {
335
+ return _regenerator.default.wrap(function (_context6) {
336
336
  while (1) switch (_context6.prev = _context6.next) {
337
337
  case 0:
338
338
  params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
339
339
  options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
340
340
  if (!(params.name && !(0, _utils.isString)(params.name))) {
341
- _context6.next = 4;
341
+ _context6.next = 1;
342
342
  break;
343
343
  }
344
344
  throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
345
- case 4:
345
+ case 1:
346
346
  if (!(params.private_key && !(0, _utils.isString)(params.private_key))) {
347
- _context6.next = 6;
347
+ _context6.next = 2;
348
348
  break;
349
349
  }
350
350
  throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params.private_key)));
351
- case 6:
352
- _context6.next = 8;
351
+ case 2:
352
+ _context6.next = 3;
353
353
  return _Api.default.sendRequest('/sftp_host_keys', 'POST', params, options);
354
- case 8:
354
+ case 3:
355
355
  response = _context6.sent;
356
356
  return _context6.abrupt("return", new _SftpHostKey(response === null || response === void 0 ? void 0 : response.data, options));
357
- case 10:
357
+ case 4:
358
358
  case "end":
359
359
  return _context6.stop();
360
360
  }
@@ -75,67 +75,67 @@ var ShareGroup = /*#__PURE__*/(0, _createClass2.default)(function ShareGroup() {
75
75
  var params,
76
76
  response,
77
77
  _args = arguments;
78
- return _regenerator.default.wrap(function _callee$(_context) {
78
+ return _regenerator.default.wrap(function (_context) {
79
79
  while (1) switch (_context.prev = _context.next) {
80
80
  case 0:
81
81
  params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
82
82
  if (_this.attributes.id) {
83
- _context.next = 3;
83
+ _context.next = 1;
84
84
  break;
85
85
  }
86
86
  throw new errors.EmptyPropertyError('Current object has no id');
87
- case 3:
87
+ case 1:
88
88
  if ((0, _utils.isObject)(params)) {
89
- _context.next = 5;
89
+ _context.next = 2;
90
90
  break;
91
91
  }
92
92
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
93
- case 5:
93
+ case 2:
94
94
  params.id = _this.attributes.id;
95
95
  if (!(params.id && !(0, _utils.isInt)(params.id))) {
96
- _context.next = 8;
96
+ _context.next = 3;
97
97
  break;
98
98
  }
99
99
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
100
- case 8:
100
+ case 3:
101
101
  if (!(params.notes && !(0, _utils.isString)(params.notes))) {
102
- _context.next = 10;
102
+ _context.next = 4;
103
103
  break;
104
104
  }
105
105
  throw new errors.InvalidParameterError("Bad parameter: notes must be of type String, received ".concat((0, _utils.getType)(params.notes)));
106
- case 10:
106
+ case 4:
107
107
  if (!(params.name && !(0, _utils.isString)(params.name))) {
108
- _context.next = 12;
108
+ _context.next = 5;
109
109
  break;
110
110
  }
111
111
  throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
112
- case 12:
112
+ case 5:
113
113
  if (!(params.members && !(0, _utils.isArray)(params.members))) {
114
- _context.next = 14;
114
+ _context.next = 6;
115
115
  break;
116
116
  }
117
117
  throw new errors.InvalidParameterError("Bad parameter: members must be of type Array, received ".concat((0, _utils.getType)(params.members)));
118
- case 14:
118
+ case 6:
119
119
  if (params.id) {
120
- _context.next = 20;
120
+ _context.next = 8;
121
121
  break;
122
122
  }
123
123
  if (!_this.attributes.id) {
124
- _context.next = 19;
124
+ _context.next = 7;
125
125
  break;
126
126
  }
127
127
  params.id = _this.id;
128
- _context.next = 20;
128
+ _context.next = 8;
129
129
  break;
130
- case 19:
130
+ case 7:
131
131
  throw new errors.MissingParameterError('Parameter missing: id');
132
- case 20:
133
- _context.next = 22;
132
+ case 8:
133
+ _context.next = 9;
134
134
  return _Api.default.sendRequest("/share_groups/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
135
- case 22:
135
+ case 9:
136
136
  response = _context.sent;
137
137
  return _context.abrupt("return", new ShareGroup(response === null || response === void 0 ? void 0 : response.data, _this.options));
138
- case 24:
138
+ case 10:
139
139
  case "end":
140
140
  return _context.stop();
141
141
  }
@@ -144,46 +144,46 @@ var ShareGroup = /*#__PURE__*/(0, _createClass2.default)(function ShareGroup() {
144
144
  (0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
145
145
  var params,
146
146
  _args2 = arguments;
147
- return _regenerator.default.wrap(function _callee2$(_context2) {
147
+ return _regenerator.default.wrap(function (_context2) {
148
148
  while (1) switch (_context2.prev = _context2.next) {
149
149
  case 0:
150
150
  params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
151
151
  if (_this.attributes.id) {
152
- _context2.next = 3;
152
+ _context2.next = 1;
153
153
  break;
154
154
  }
155
155
  throw new errors.EmptyPropertyError('Current object has no id');
156
- case 3:
156
+ case 1:
157
157
  if ((0, _utils.isObject)(params)) {
158
- _context2.next = 5;
158
+ _context2.next = 2;
159
159
  break;
160
160
  }
161
161
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
162
- case 5:
162
+ case 2:
163
163
  params.id = _this.attributes.id;
164
164
  if (!(params.id && !(0, _utils.isInt)(params.id))) {
165
- _context2.next = 8;
165
+ _context2.next = 3;
166
166
  break;
167
167
  }
168
168
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
169
- case 8:
169
+ case 3:
170
170
  if (params.id) {
171
- _context2.next = 14;
171
+ _context2.next = 5;
172
172
  break;
173
173
  }
174
174
  if (!_this.attributes.id) {
175
- _context2.next = 13;
175
+ _context2.next = 4;
176
176
  break;
177
177
  }
178
178
  params.id = _this.id;
179
- _context2.next = 14;
179
+ _context2.next = 5;
180
180
  break;
181
- case 13:
181
+ case 4:
182
182
  throw new errors.MissingParameterError('Parameter missing: id');
183
- case 14:
184
- _context2.next = 16;
183
+ case 5:
184
+ _context2.next = 6;
185
185
  return _Api.default.sendRequest("/share_groups/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
186
- case 16:
186
+ case 6:
187
187
  case "end":
188
188
  return _context2.stop();
189
189
  }
@@ -195,27 +195,27 @@ var ShareGroup = /*#__PURE__*/(0, _createClass2.default)(function ShareGroup() {
195
195
  });
196
196
  (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
197
197
  var _newObject, newObject;
198
- return _regenerator.default.wrap(function _callee3$(_context3) {
198
+ return _regenerator.default.wrap(function (_context3) {
199
199
  while (1) switch (_context3.prev = _context3.next) {
200
200
  case 0:
201
201
  if (!_this.attributes.id) {
202
- _context3.next = 6;
202
+ _context3.next = 2;
203
203
  break;
204
204
  }
205
- _context3.next = 3;
205
+ _context3.next = 1;
206
206
  return _this.update(_this.attributes);
207
- case 3:
207
+ case 1:
208
208
  _newObject = _context3.sent;
209
209
  _this.attributes = _objectSpread({}, _newObject.attributes);
210
210
  return _context3.abrupt("return", true);
211
- case 6:
212
- _context3.next = 8;
211
+ case 2:
212
+ _context3.next = 3;
213
213
  return ShareGroup.create(_this.attributes, _this.options);
214
- case 8:
214
+ case 3:
215
215
  newObject = _context3.sent;
216
216
  _this.attributes = _objectSpread({}, newObject.attributes);
217
217
  return _context3.abrupt("return", true);
218
- case 11:
218
+ case 4:
219
219
  case "end":
220
220
  return _context3.stop();
221
221
  }
@@ -245,37 +245,37 @@ _ShareGroup = ShareGroup;
245
245
  options,
246
246
  response,
247
247
  _args4 = arguments;
248
- return _regenerator.default.wrap(function _callee4$(_context4) {
248
+ return _regenerator.default.wrap(function (_context4) {
249
249
  while (1) switch (_context4.prev = _context4.next) {
250
250
  case 0:
251
251
  params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
252
252
  options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
253
253
  if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
254
- _context4.next = 4;
254
+ _context4.next = 1;
255
255
  break;
256
256
  }
257
257
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
258
- case 4:
258
+ case 1:
259
259
  if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
260
- _context4.next = 6;
260
+ _context4.next = 2;
261
261
  break;
262
262
  }
263
263
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
264
- case 6:
264
+ case 2:
265
265
  if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
266
- _context4.next = 8;
266
+ _context4.next = 3;
267
267
  break;
268
268
  }
269
269
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
270
- case 8:
271
- _context4.next = 10;
270
+ case 3:
271
+ _context4.next = 4;
272
272
  return _Api.default.sendRequest('/share_groups', 'GET', params, options);
273
- case 10:
273
+ case 4:
274
274
  response = _context4.sent;
275
275
  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) {
276
276
  return new _ShareGroup(obj, options);
277
277
  })) || []);
278
- case 12:
278
+ case 5:
279
279
  case "end":
280
280
  return _context4.stop();
281
281
  }
@@ -294,36 +294,36 @@ _ShareGroup = ShareGroup;
294
294
  options,
295
295
  response,
296
296
  _args5 = arguments;
297
- return _regenerator.default.wrap(function _callee5$(_context5) {
297
+ return _regenerator.default.wrap(function (_context5) {
298
298
  while (1) switch (_context5.prev = _context5.next) {
299
299
  case 0:
300
300
  params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
301
301
  options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
302
302
  if ((0, _utils.isObject)(params)) {
303
- _context5.next = 4;
303
+ _context5.next = 1;
304
304
  break;
305
305
  }
306
306
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
307
- case 4:
307
+ case 1:
308
308
  params.id = id;
309
309
  if (params.id) {
310
- _context5.next = 7;
310
+ _context5.next = 2;
311
311
  break;
312
312
  }
313
313
  throw new errors.MissingParameterError('Parameter missing: id');
314
- case 7:
314
+ case 2:
315
315
  if (!(params.id && !(0, _utils.isInt)(params.id))) {
316
- _context5.next = 9;
316
+ _context5.next = 3;
317
317
  break;
318
318
  }
319
319
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
320
- case 9:
321
- _context5.next = 11;
320
+ case 3:
321
+ _context5.next = 4;
322
322
  return _Api.default.sendRequest("/share_groups/".concat(encodeURIComponent(params.id)), 'GET', params, options);
323
- case 11:
323
+ case 4:
324
324
  response = _context5.sent;
325
325
  return _context5.abrupt("return", new _ShareGroup(response === null || response === void 0 ? void 0 : response.data, options));
326
- case 13:
326
+ case 5:
327
327
  case "end":
328
328
  return _context5.stop();
329
329
  }
@@ -348,53 +348,53 @@ _ShareGroup = ShareGroup;
348
348
  options,
349
349
  response,
350
350
  _args6 = arguments;
351
- return _regenerator.default.wrap(function _callee6$(_context6) {
351
+ return _regenerator.default.wrap(function (_context6) {
352
352
  while (1) switch (_context6.prev = _context6.next) {
353
353
  case 0:
354
354
  params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
355
355
  options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
356
356
  if (params.name) {
357
- _context6.next = 4;
357
+ _context6.next = 1;
358
358
  break;
359
359
  }
360
360
  throw new errors.MissingParameterError('Parameter missing: name');
361
- case 4:
361
+ case 1:
362
362
  if (params.members) {
363
- _context6.next = 6;
363
+ _context6.next = 2;
364
364
  break;
365
365
  }
366
366
  throw new errors.MissingParameterError('Parameter missing: members');
367
- case 6:
367
+ case 2:
368
368
  if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
369
- _context6.next = 8;
369
+ _context6.next = 3;
370
370
  break;
371
371
  }
372
372
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
373
- case 8:
373
+ case 3:
374
374
  if (!(params.notes && !(0, _utils.isString)(params.notes))) {
375
- _context6.next = 10;
375
+ _context6.next = 4;
376
376
  break;
377
377
  }
378
378
  throw new errors.InvalidParameterError("Bad parameter: notes must be of type String, received ".concat((0, _utils.getType)(params.notes)));
379
- case 10:
379
+ case 4:
380
380
  if (!(params.name && !(0, _utils.isString)(params.name))) {
381
- _context6.next = 12;
381
+ _context6.next = 5;
382
382
  break;
383
383
  }
384
384
  throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
385
- case 12:
385
+ case 5:
386
386
  if (!(params.members && !(0, _utils.isArray)(params.members))) {
387
- _context6.next = 14;
387
+ _context6.next = 6;
388
388
  break;
389
389
  }
390
390
  throw new errors.InvalidParameterError("Bad parameter: members must be of type Array, received ".concat((0, _utils.getType)(params.members)));
391
- case 14:
392
- _context6.next = 16;
391
+ case 6:
392
+ _context6.next = 7;
393
393
  return _Api.default.sendRequest('/share_groups', 'POST', params, options);
394
- case 16:
394
+ case 7:
395
395
  response = _context6.sent;
396
396
  return _context6.abrupt("return", new _ShareGroup(response === null || response === void 0 ? void 0 : response.data, options));
397
- case 18:
397
+ case 8:
398
398
  case "end":
399
399
  return _context6.stop();
400
400
  }