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
@@ -108,32 +108,32 @@ _Invoice = Invoice;
108
108
  response,
109
109
  AccountLineItem,
110
110
  _args = arguments;
111
- return _regenerator.default.wrap(function _callee$(_context) {
111
+ return _regenerator.default.wrap(function (_context) {
112
112
  while (1) switch (_context.prev = _context.next) {
113
113
  case 0:
114
114
  params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
115
115
  options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
116
116
  if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
117
- _context.next = 4;
117
+ _context.next = 1;
118
118
  break;
119
119
  }
120
120
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
121
- case 4:
121
+ case 1:
122
122
  if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
123
- _context.next = 6;
123
+ _context.next = 2;
124
124
  break;
125
125
  }
126
126
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
127
- case 6:
128
- _context.next = 8;
127
+ case 2:
128
+ _context.next = 3;
129
129
  return _Api.default.sendRequest('/invoices', 'GET', params, options);
130
- case 8:
130
+ case 3:
131
131
  response = _context.sent;
132
132
  AccountLineItem = require('./AccountLineItem.js').default;
133
133
  return _context.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
134
134
  return new AccountLineItem(obj, options);
135
135
  })) || []);
136
- case 11:
136
+ case 4:
137
137
  case "end":
138
138
  return _context.stop();
139
139
  }
@@ -153,37 +153,37 @@ _Invoice = Invoice;
153
153
  response,
154
154
  AccountLineItem,
155
155
  _args2 = arguments;
156
- return _regenerator.default.wrap(function _callee2$(_context2) {
156
+ return _regenerator.default.wrap(function (_context2) {
157
157
  while (1) switch (_context2.prev = _context2.next) {
158
158
  case 0:
159
159
  params = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
160
160
  options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
161
161
  if ((0, _utils.isObject)(params)) {
162
- _context2.next = 4;
162
+ _context2.next = 1;
163
163
  break;
164
164
  }
165
165
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
166
- case 4:
166
+ case 1:
167
167
  params.id = id;
168
168
  if (params.id) {
169
- _context2.next = 7;
169
+ _context2.next = 2;
170
170
  break;
171
171
  }
172
172
  throw new errors.MissingParameterError('Parameter missing: id');
173
- case 7:
173
+ case 2:
174
174
  if (!(params.id && !(0, _utils.isInt)(params.id))) {
175
- _context2.next = 9;
175
+ _context2.next = 3;
176
176
  break;
177
177
  }
178
178
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
179
- case 9:
180
- _context2.next = 11;
179
+ case 3:
180
+ _context2.next = 4;
181
181
  return _Api.default.sendRequest("/invoices/".concat(encodeURIComponent(params.id)), 'GET', params, options);
182
- case 11:
182
+ case 4:
183
183
  response = _context2.sent;
184
184
  AccountLineItem = require('./AccountLineItem.js').default;
185
185
  return _context2.abrupt("return", new AccountLineItem(response === null || response === void 0 ? void 0 : response.data, options));
186
- case 14:
186
+ case 5:
187
187
  case "end":
188
188
  return _context2.stop();
189
189
  }
@@ -71,31 +71,31 @@ _IpAddress = IpAddress;
71
71
  options,
72
72
  response,
73
73
  _args = arguments;
74
- return _regenerator.default.wrap(function _callee$(_context) {
74
+ return _regenerator.default.wrap(function (_context) {
75
75
  while (1) switch (_context.prev = _context.next) {
76
76
  case 0:
77
77
  params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
78
78
  options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
79
79
  if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
80
- _context.next = 4;
80
+ _context.next = 1;
81
81
  break;
82
82
  }
83
83
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
84
- case 4:
84
+ case 1:
85
85
  if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
86
- _context.next = 6;
86
+ _context.next = 2;
87
87
  break;
88
88
  }
89
89
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
90
- case 6:
91
- _context.next = 8;
90
+ case 2:
91
+ _context.next = 3;
92
92
  return _Api.default.sendRequest('/ip_addresses', 'GET', params, options);
93
- case 8:
93
+ case 3:
94
94
  response = _context.sent;
95
95
  return _context.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
96
96
  return new _IpAddress(obj, options);
97
97
  })) || []);
98
- case 10:
98
+ case 4:
99
99
  case "end":
100
100
  return _context.stop();
101
101
  }
@@ -116,32 +116,32 @@ _IpAddress = IpAddress;
116
116
  response,
117
117
  PublicIpAddress,
118
118
  _args2 = arguments;
119
- return _regenerator.default.wrap(function _callee2$(_context2) {
119
+ return _regenerator.default.wrap(function (_context2) {
120
120
  while (1) switch (_context2.prev = _context2.next) {
121
121
  case 0:
122
122
  params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
123
123
  options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
124
124
  if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
125
- _context2.next = 4;
125
+ _context2.next = 1;
126
126
  break;
127
127
  }
128
128
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
129
- case 4:
129
+ case 1:
130
130
  if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
131
- _context2.next = 6;
131
+ _context2.next = 2;
132
132
  break;
133
133
  }
134
134
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
135
- case 6:
136
- _context2.next = 8;
135
+ case 2:
136
+ _context2.next = 3;
137
137
  return _Api.default.sendRequest('/ip_addresses/smartfile-reserved', 'GET', params, options);
138
- case 8:
138
+ case 3:
139
139
  response = _context2.sent;
140
140
  PublicIpAddress = require('./PublicIpAddress.js').default;
141
141
  return _context2.abrupt("return", (response === null || response === void 0 || (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.map(function (obj) {
142
142
  return new PublicIpAddress(obj, options);
143
143
  })) || []);
144
- case 11:
144
+ case 4:
145
145
  case "end":
146
146
  return _context2.stop();
147
147
  }
@@ -157,32 +157,32 @@ _IpAddress = IpAddress;
157
157
  response,
158
158
  PublicIpAddress,
159
159
  _args3 = arguments;
160
- return _regenerator.default.wrap(function _callee3$(_context3) {
160
+ return _regenerator.default.wrap(function (_context3) {
161
161
  while (1) switch (_context3.prev = _context3.next) {
162
162
  case 0:
163
163
  params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
164
164
  options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
165
165
  if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
166
- _context3.next = 4;
166
+ _context3.next = 1;
167
167
  break;
168
168
  }
169
169
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
170
- case 4:
170
+ case 1:
171
171
  if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
172
- _context3.next = 6;
172
+ _context3.next = 2;
173
173
  break;
174
174
  }
175
175
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
176
- case 6:
177
- _context3.next = 8;
176
+ case 2:
177
+ _context3.next = 3;
178
178
  return _Api.default.sendRequest('/ip_addresses/exavault-reserved', 'GET', params, options);
179
- case 8:
179
+ case 3:
180
180
  response = _context3.sent;
181
181
  PublicIpAddress = require('./PublicIpAddress.js').default;
182
182
  return _context3.abrupt("return", (response === null || response === void 0 || (_response$data3 = response.data) === null || _response$data3 === void 0 ? void 0 : _response$data3.map(function (obj) {
183
183
  return new PublicIpAddress(obj, options);
184
184
  })) || []);
185
- case 11:
185
+ case 4:
186
186
  case "end":
187
187
  return _context3.stop();
188
188
  }
@@ -198,32 +198,32 @@ _IpAddress = IpAddress;
198
198
  response,
199
199
  PublicIpAddress,
200
200
  _args4 = arguments;
201
- return _regenerator.default.wrap(function _callee4$(_context4) {
201
+ return _regenerator.default.wrap(function (_context4) {
202
202
  while (1) switch (_context4.prev = _context4.next) {
203
203
  case 0:
204
204
  params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
205
205
  options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
206
206
  if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
207
- _context4.next = 4;
207
+ _context4.next = 1;
208
208
  break;
209
209
  }
210
210
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
211
- case 4:
211
+ case 1:
212
212
  if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
213
- _context4.next = 6;
213
+ _context4.next = 2;
214
214
  break;
215
215
  }
216
216
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
217
- case 6:
218
- _context4.next = 8;
217
+ case 2:
218
+ _context4.next = 3;
219
219
  return _Api.default.sendRequest('/ip_addresses/reserved', 'GET', params, options);
220
- case 8:
220
+ case 3:
221
221
  response = _context4.sent;
222
222
  PublicIpAddress = require('./PublicIpAddress.js').default;
223
223
  return _context4.abrupt("return", (response === null || response === void 0 || (_response$data4 = response.data) === null || _response$data4 === void 0 ? void 0 : _response$data4.map(function (obj) {
224
224
  return new PublicIpAddress(obj, options);
225
225
  })) || []);
226
- case 11:
226
+ case 4:
227
227
  case "end":
228
228
  return _context4.stop();
229
229
  }
@@ -121,66 +121,66 @@ var Lock = /*#__PURE__*/(0, _createClass2.default)(function Lock() {
121
121
  (0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
122
122
  var params,
123
123
  _args = arguments;
124
- return _regenerator.default.wrap(function _callee$(_context) {
124
+ return _regenerator.default.wrap(function (_context) {
125
125
  while (1) switch (_context.prev = _context.next) {
126
126
  case 0:
127
127
  params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
128
128
  if (_this.attributes.path) {
129
- _context.next = 3;
129
+ _context.next = 1;
130
130
  break;
131
131
  }
132
132
  throw new errors.EmptyPropertyError('Current object has no path');
133
- case 3:
133
+ case 1:
134
134
  if ((0, _utils.isObject)(params)) {
135
- _context.next = 5;
135
+ _context.next = 2;
136
136
  break;
137
137
  }
138
138
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
139
- case 5:
139
+ case 2:
140
140
  params.path = _this.attributes.path;
141
141
  if (!(params.path && !(0, _utils.isString)(params.path))) {
142
- _context.next = 8;
142
+ _context.next = 3;
143
143
  break;
144
144
  }
145
145
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
146
- case 8:
146
+ case 3:
147
147
  if (!(params.token && !(0, _utils.isString)(params.token))) {
148
- _context.next = 10;
148
+ _context.next = 4;
149
149
  break;
150
150
  }
151
151
  throw new errors.InvalidParameterError("Bad parameter: token must be of type String, received ".concat((0, _utils.getType)(params.token)));
152
- case 10:
152
+ case 4:
153
153
  if (params.path) {
154
- _context.next = 16;
154
+ _context.next = 6;
155
155
  break;
156
156
  }
157
157
  if (!_this.attributes.path) {
158
- _context.next = 15;
158
+ _context.next = 5;
159
159
  break;
160
160
  }
161
161
  params.path = _this.path;
162
- _context.next = 16;
162
+ _context.next = 6;
163
163
  break;
164
- case 15:
164
+ case 5:
165
165
  throw new errors.MissingParameterError('Parameter missing: path');
166
- case 16:
166
+ case 6:
167
167
  if (params.token) {
168
- _context.next = 22;
168
+ _context.next = 8;
169
169
  break;
170
170
  }
171
171
  if (!_this.attributes.token) {
172
- _context.next = 21;
172
+ _context.next = 7;
173
173
  break;
174
174
  }
175
175
  params.token = _this.token;
176
- _context.next = 22;
176
+ _context.next = 8;
177
177
  break;
178
- case 21:
178
+ case 7:
179
179
  throw new errors.MissingParameterError('Parameter missing: token');
180
- case 22:
181
- _context.next = 24;
180
+ case 8:
181
+ _context.next = 9;
182
182
  return _Api.default.sendRequest("/locks/".concat(encodeURIComponent(params.path)), 'DELETE', params, _this.options);
183
- case 24:
183
+ case 9:
184
184
  case "end":
185
185
  return _context.stop();
186
186
  }
@@ -192,16 +192,16 @@ var Lock = /*#__PURE__*/(0, _createClass2.default)(function Lock() {
192
192
  });
193
193
  (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
194
194
  var newObject;
195
- return _regenerator.default.wrap(function _callee2$(_context2) {
195
+ return _regenerator.default.wrap(function (_context2) {
196
196
  while (1) switch (_context2.prev = _context2.next) {
197
197
  case 0:
198
- _context2.next = 2;
198
+ _context2.next = 1;
199
199
  return Lock.create(_this.attributes.path, _this.attributes, _this.options);
200
- case 2:
200
+ case 1:
201
201
  newObject = _context2.sent;
202
202
  _this.attributes = _objectSpread({}, newObject.attributes);
203
203
  return _context2.abrupt("return", true);
204
- case 5:
204
+ case 2:
205
205
  case "end":
206
206
  return _context2.stop();
207
207
  }
@@ -233,50 +233,50 @@ _Lock = Lock;
233
233
  options,
234
234
  response,
235
235
  _args3 = arguments;
236
- return _regenerator.default.wrap(function _callee3$(_context3) {
236
+ return _regenerator.default.wrap(function (_context3) {
237
237
  while (1) switch (_context3.prev = _context3.next) {
238
238
  case 0:
239
239
  params = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
240
240
  options = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {};
241
241
  if ((0, _utils.isObject)(params)) {
242
- _context3.next = 4;
242
+ _context3.next = 1;
243
243
  break;
244
244
  }
245
245
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
246
- case 4:
246
+ case 1:
247
247
  params.path = path;
248
248
  if (params.path) {
249
- _context3.next = 7;
249
+ _context3.next = 2;
250
250
  break;
251
251
  }
252
252
  throw new errors.MissingParameterError('Parameter missing: path');
253
- case 7:
253
+ case 2:
254
254
  if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
255
- _context3.next = 9;
255
+ _context3.next = 3;
256
256
  break;
257
257
  }
258
258
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
259
- case 9:
259
+ case 3:
260
260
  if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
261
- _context3.next = 11;
261
+ _context3.next = 4;
262
262
  break;
263
263
  }
264
264
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
265
- case 11:
265
+ case 4:
266
266
  if (!(params.path && !(0, _utils.isString)(params.path))) {
267
- _context3.next = 13;
267
+ _context3.next = 5;
268
268
  break;
269
269
  }
270
270
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
271
- case 13:
272
- _context3.next = 15;
271
+ case 5:
272
+ _context3.next = 6;
273
273
  return _Api.default.sendRequest("/locks/".concat(encodeURIComponent(params.path)), 'GET', params, options);
274
- case 15:
274
+ case 6:
275
275
  response = _context3.sent;
276
276
  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) {
277
277
  return new _Lock(obj, options);
278
278
  })) || []);
279
- case 17:
279
+ case 7:
280
280
  case "end":
281
281
  return _context3.stop();
282
282
  }
@@ -298,42 +298,42 @@ _Lock = Lock;
298
298
  options,
299
299
  response,
300
300
  _args4 = arguments;
301
- return _regenerator.default.wrap(function _callee4$(_context4) {
301
+ return _regenerator.default.wrap(function (_context4) {
302
302
  while (1) switch (_context4.prev = _context4.next) {
303
303
  case 0:
304
304
  params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
305
305
  options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
306
306
  if ((0, _utils.isObject)(params)) {
307
- _context4.next = 4;
307
+ _context4.next = 1;
308
308
  break;
309
309
  }
310
310
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
311
- case 4:
311
+ case 1:
312
312
  params.path = path;
313
313
  if (params.path) {
314
- _context4.next = 7;
314
+ _context4.next = 2;
315
315
  break;
316
316
  }
317
317
  throw new errors.MissingParameterError('Parameter missing: path');
318
- case 7:
318
+ case 2:
319
319
  if (!(params.path && !(0, _utils.isString)(params.path))) {
320
- _context4.next = 9;
320
+ _context4.next = 3;
321
321
  break;
322
322
  }
323
323
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
324
- case 9:
324
+ case 3:
325
325
  if (!(params.timeout && !(0, _utils.isInt)(params.timeout))) {
326
- _context4.next = 11;
326
+ _context4.next = 4;
327
327
  break;
328
328
  }
329
329
  throw new errors.InvalidParameterError("Bad parameter: timeout must be of type Int, received ".concat((0, _utils.getType)(params.timeout)));
330
- case 11:
331
- _context4.next = 13;
330
+ case 4:
331
+ _context4.next = 5;
332
332
  return _Api.default.sendRequest("/locks/".concat(encodeURIComponent(params.path)), 'POST', params, options);
333
- case 13:
333
+ case 5:
334
334
  response = _context4.sent;
335
335
  return _context4.abrupt("return", new _Lock(response === null || response === void 0 ? void 0 : response.data, options));
336
- case 15:
336
+ case 6:
337
337
  case "end":
338
338
  return _context4.stop();
339
339
  }