files.com 1.2.270 → 1.2.272
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_VERSION +1 -1
- package/docs/models/Automation.md +5 -2
- package/docs/models/HolidayRegion.md +27 -0
- package/docs/models/RemoteMountBackend.md +4 -1
- package/docs/models/Sync.md +5 -2
- package/lib/Files.js +1 -1
- package/lib/models/Automation.js +7 -0
- package/lib/models/HolidayRegion.js +98 -0
- package/lib/models/RemoteMountBackend.js +8 -7
- package/lib/models/Sync.js +7 -0
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/Automation.js +7 -0
- package/src/models/HolidayRegion.js +58 -0
- package/src/models/RemoteMountBackend.js +8 -7
- package/src/models/Sync.js +7 -0
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.272
|
|
@@ -86,7 +86,8 @@
|
|
|
86
86
|
"value": {
|
|
87
87
|
"limit": "1"
|
|
88
88
|
},
|
|
89
|
-
"webhook_url": "https://app.files.com/api/webhooks/abc123"
|
|
89
|
+
"webhook_url": "https://app.files.com/api/webhooks/abc123",
|
|
90
|
+
"holiday_region": "us_dc"
|
|
90
91
|
}
|
|
91
92
|
```
|
|
92
93
|
|
|
@@ -128,6 +129,7 @@
|
|
|
128
129
|
* `user_ids` (array(int64)): IDs of Users for the Automation (i.e. who to Request File from)
|
|
129
130
|
* `value` (object): A Hash of attributes specific to the automation type.
|
|
130
131
|
* `webhook_url` (string): If trigger is `webhook`, this is the URL of the webhook to trigger the Automation.
|
|
132
|
+
* `holiday_region` (string): If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
|
|
131
133
|
|
|
132
134
|
---
|
|
133
135
|
|
|
@@ -415,7 +417,8 @@ await automation.update({
|
|
|
415
417
|
"value": {
|
|
416
418
|
"limit": "1"
|
|
417
419
|
},
|
|
418
|
-
"webhook_url": "https://app.files.com/api/webhooks/abc123"
|
|
420
|
+
"webhook_url": "https://app.files.com/api/webhooks/abc123",
|
|
421
|
+
"holiday_region": "us_dc"
|
|
419
422
|
}
|
|
420
423
|
```
|
|
421
424
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# HolidayRegion
|
|
2
|
+
|
|
3
|
+
## Example HolidayRegion Object
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
{
|
|
7
|
+
"code": "us_dc",
|
|
8
|
+
"name": "United States - District of Columbia"
|
|
9
|
+
}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* `code` (string): The code representing a region
|
|
13
|
+
* `name` (string): The name of the region
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## List all possible holiday regions
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
await HolidayRegion.getSupported
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Parameters
|
|
25
|
+
|
|
26
|
+
* `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.
|
|
27
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"fall": 1,
|
|
10
10
|
"health_check_enabled": true,
|
|
11
11
|
"health_check_type": "active",
|
|
12
|
+
"id": 1,
|
|
12
13
|
"interval": 60,
|
|
13
14
|
"min_free_cpu": 1.0,
|
|
14
15
|
"min_free_mem": 1.0,
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
* `fall` (int64): Number of consecutive failures before considering the backend unhealthy.
|
|
28
29
|
* `health_check_enabled` (boolean): True if health checks are enabled for this backend.
|
|
29
30
|
* `health_check_type` (string): Type of health check to perform.
|
|
31
|
+
* `id` (int64): Unique identifier for this backend.
|
|
30
32
|
* `interval` (int64): Interval in seconds between health checks.
|
|
31
33
|
* `min_free_cpu` (double): Minimum free CPU percentage required for this backend to be considered healthy.
|
|
32
34
|
* `min_free_mem` (double): Minimum free memory percentage required for this backend to be considered healthy.
|
|
@@ -37,7 +39,6 @@
|
|
|
37
39
|
* `rise` (int64): Number of consecutive successes before considering the backend healthy.
|
|
38
40
|
* `status` (string): Status of this backend.
|
|
39
41
|
* `undergoing_maintenance` (boolean): True if this backend is undergoing maintenance.
|
|
40
|
-
* `id` (int64): Remote Mount Backend ID.
|
|
41
42
|
|
|
42
43
|
---
|
|
43
44
|
|
|
@@ -52,6 +53,7 @@ await RemoteMountBackend.list
|
|
|
52
53
|
|
|
53
54
|
* `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.
|
|
54
55
|
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
56
|
+
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `remote_server_mount_id`.
|
|
55
57
|
|
|
56
58
|
---
|
|
57
59
|
|
|
@@ -170,6 +172,7 @@ await remote_mount_backend.update({
|
|
|
170
172
|
"fall": 1,
|
|
171
173
|
"health_check_enabled": true,
|
|
172
174
|
"health_check_type": "active",
|
|
175
|
+
"id": 1,
|
|
173
176
|
"interval": 60,
|
|
174
177
|
"min_free_cpu": 1.0,
|
|
175
178
|
"min_free_mem": 1.0,
|
package/docs/models/Sync.md
CHANGED
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"06:30",
|
|
40
40
|
"14:30"
|
|
41
41
|
],
|
|
42
|
-
"schedule_time_zone": "Eastern Time (US & Canada)"
|
|
42
|
+
"schedule_time_zone": "Eastern Time (US & Canada)",
|
|
43
|
+
"holiday_region": "us_dc"
|
|
43
44
|
}
|
|
44
45
|
```
|
|
45
46
|
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
* `schedule_days_of_week` (array(int64)): If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
|
|
69
70
|
* `schedule_times_of_day` (array(string)): If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
|
|
70
71
|
* `schedule_time_zone` (string): If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
|
|
72
|
+
* `holiday_region` (string): If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
|
|
71
73
|
|
|
72
74
|
---
|
|
73
75
|
|
|
@@ -255,7 +257,8 @@ await sync.update({
|
|
|
255
257
|
"06:30",
|
|
256
258
|
"14:30"
|
|
257
259
|
],
|
|
258
|
-
"schedule_time_zone": "Eastern Time (US & Canada)"
|
|
260
|
+
"schedule_time_zone": "Eastern Time (US & Canada)",
|
|
261
|
+
"holiday_region": "us_dc"
|
|
259
262
|
}
|
|
260
263
|
```
|
|
261
264
|
|
package/lib/Files.js
CHANGED
|
@@ -12,7 +12,7 @@ var apiKey;
|
|
|
12
12
|
var baseUrl = 'https://app.files.com';
|
|
13
13
|
var sessionId = null;
|
|
14
14
|
var language = null;
|
|
15
|
-
var version = '1.2.
|
|
15
|
+
var version = '1.2.272';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
package/lib/models/Automation.js
CHANGED
|
@@ -298,6 +298,13 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
|
298
298
|
(0, _defineProperty2.default)(this, "setWebhookUrl", function (value) {
|
|
299
299
|
_this.attributes.webhook_url = value;
|
|
300
300
|
});
|
|
301
|
+
// string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
|
|
302
|
+
(0, _defineProperty2.default)(this, "getHolidayRegion", function () {
|
|
303
|
+
return _this.attributes.holiday_region;
|
|
304
|
+
});
|
|
305
|
+
(0, _defineProperty2.default)(this, "setHolidayRegion", function (value) {
|
|
306
|
+
_this.attributes.holiday_region = value;
|
|
307
|
+
});
|
|
301
308
|
// Manually Run Automation
|
|
302
309
|
(0, _defineProperty2.default)(this, "manualRun", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
303
310
|
var params,
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
var _Api = _interopRequireDefault(require("../Api"));
|
|
14
|
+
var errors = _interopRequireWildcard(require("../Errors"));
|
|
15
|
+
var _utils = require("../utils");
|
|
16
|
+
var _HolidayRegion;
|
|
17
|
+
/* eslint-disable no-unused-vars */
|
|
18
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
+
/* eslint-enable no-unused-vars */
|
|
22
|
+
/**
|
|
23
|
+
* Class HolidayRegion
|
|
24
|
+
*/
|
|
25
|
+
var HolidayRegion = /*#__PURE__*/(0, _createClass2.default)(function HolidayRegion() {
|
|
26
|
+
var _this = this;
|
|
27
|
+
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
28
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
29
|
+
(0, _classCallCheck2.default)(this, HolidayRegion);
|
|
30
|
+
(0, _defineProperty2.default)(this, "attributes", {});
|
|
31
|
+
(0, _defineProperty2.default)(this, "options", {});
|
|
32
|
+
(0, _defineProperty2.default)(this, "isLoaded", function () {
|
|
33
|
+
return !!_this.attributes.id;
|
|
34
|
+
});
|
|
35
|
+
// string # The code representing a region
|
|
36
|
+
(0, _defineProperty2.default)(this, "getCode", function () {
|
|
37
|
+
return _this.attributes.code;
|
|
38
|
+
});
|
|
39
|
+
// string # The name of the region
|
|
40
|
+
(0, _defineProperty2.default)(this, "getName", function () {
|
|
41
|
+
return _this.attributes.name;
|
|
42
|
+
});
|
|
43
|
+
Object.entries(attributes).forEach(function (_ref) {
|
|
44
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
45
|
+
key = _ref2[0],
|
|
46
|
+
value = _ref2[1];
|
|
47
|
+
var normalizedKey = key.replace('?', '');
|
|
48
|
+
_this.attributes[normalizedKey] = value;
|
|
49
|
+
Object.defineProperty(_this, normalizedKey, {
|
|
50
|
+
value: value,
|
|
51
|
+
writable: false
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
this.options = _objectSpread({}, options);
|
|
55
|
+
});
|
|
56
|
+
_HolidayRegion = HolidayRegion;
|
|
57
|
+
// Parameters:
|
|
58
|
+
// 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.
|
|
59
|
+
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
60
|
+
(0, _defineProperty2.default)(HolidayRegion, "getSupported", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
61
|
+
var _response$data;
|
|
62
|
+
var params,
|
|
63
|
+
options,
|
|
64
|
+
response,
|
|
65
|
+
_args = arguments;
|
|
66
|
+
return _regenerator.default.wrap(function (_context) {
|
|
67
|
+
while (1) switch (_context.prev = _context.next) {
|
|
68
|
+
case 0:
|
|
69
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
70
|
+
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
71
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
72
|
+
_context.next = 1;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
76
|
+
case 1:
|
|
77
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
78
|
+
_context.next = 2;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
82
|
+
case 2:
|
|
83
|
+
_context.next = 3;
|
|
84
|
+
return _Api.default.sendRequest('/holiday_regions/supported', 'GET', params, options);
|
|
85
|
+
case 3:
|
|
86
|
+
response = _context.sent;
|
|
87
|
+
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) {
|
|
88
|
+
return new _HolidayRegion(obj, options);
|
|
89
|
+
})) || []);
|
|
90
|
+
case 4:
|
|
91
|
+
case "end":
|
|
92
|
+
return _context.stop();
|
|
93
|
+
}
|
|
94
|
+
}, _callee);
|
|
95
|
+
})));
|
|
96
|
+
var _default = exports.default = HolidayRegion;
|
|
97
|
+
module.exports = HolidayRegion;
|
|
98
|
+
module.exports.default = HolidayRegion;
|
|
@@ -67,6 +67,13 @@ var RemoteMountBackend = /*#__PURE__*/(0, _createClass2.default)(function Remote
|
|
|
67
67
|
(0, _defineProperty2.default)(this, "setHealthCheckType", function (value) {
|
|
68
68
|
_this.attributes.health_check_type = value;
|
|
69
69
|
});
|
|
70
|
+
// int64 # Unique identifier for this backend.
|
|
71
|
+
(0, _defineProperty2.default)(this, "getId", function () {
|
|
72
|
+
return _this.attributes.id;
|
|
73
|
+
});
|
|
74
|
+
(0, _defineProperty2.default)(this, "setId", function (value) {
|
|
75
|
+
_this.attributes.id = value;
|
|
76
|
+
});
|
|
70
77
|
// int64 # Interval in seconds between health checks.
|
|
71
78
|
(0, _defineProperty2.default)(this, "getInterval", function () {
|
|
72
79
|
return _this.attributes.interval;
|
|
@@ -137,13 +144,6 @@ var RemoteMountBackend = /*#__PURE__*/(0, _createClass2.default)(function Remote
|
|
|
137
144
|
(0, _defineProperty2.default)(this, "setUndergoingMaintenance", function (value) {
|
|
138
145
|
_this.attributes.undergoing_maintenance = value;
|
|
139
146
|
});
|
|
140
|
-
// int64 # Remote Mount Backend ID.
|
|
141
|
-
(0, _defineProperty2.default)(this, "getId", function () {
|
|
142
|
-
return _this.attributes.id;
|
|
143
|
-
});
|
|
144
|
-
(0, _defineProperty2.default)(this, "setId", function (value) {
|
|
145
|
-
_this.attributes.id = value;
|
|
146
|
-
});
|
|
147
147
|
// Reset backend status to healthy
|
|
148
148
|
(0, _defineProperty2.default)(this, "resetStatus", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
149
149
|
var params,
|
|
@@ -452,6 +452,7 @@ _RemoteMountBackend = RemoteMountBackend;
|
|
|
452
452
|
// Parameters:
|
|
453
453
|
// 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.
|
|
454
454
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
455
|
+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `remote_server_mount_id`.
|
|
455
456
|
(0, _defineProperty2.default)(RemoteMountBackend, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
456
457
|
var _response$data;
|
|
457
458
|
var params,
|
package/lib/models/Sync.js
CHANGED
|
@@ -201,6 +201,13 @@ var Sync = /*#__PURE__*/(0, _createClass2.default)(function Sync() {
|
|
|
201
201
|
(0, _defineProperty2.default)(this, "setScheduleTimeZone", function (value) {
|
|
202
202
|
_this.attributes.schedule_time_zone = value;
|
|
203
203
|
});
|
|
204
|
+
// string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
|
|
205
|
+
(0, _defineProperty2.default)(this, "getHolidayRegion", function () {
|
|
206
|
+
return _this.attributes.holiday_region;
|
|
207
|
+
});
|
|
208
|
+
(0, _defineProperty2.default)(this, "setHolidayRegion", function (value) {
|
|
209
|
+
_this.attributes.holiday_region = value;
|
|
210
|
+
});
|
|
204
211
|
// Manually Run Sync
|
|
205
212
|
(0, _defineProperty2.default)(this, "manualRun", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
206
213
|
var params,
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
package/src/models/Automation.js
CHANGED
|
@@ -294,6 +294,13 @@ class Automation {
|
|
|
294
294
|
this.attributes.webhook_url = value
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
+
// string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
|
|
298
|
+
getHolidayRegion = () => this.attributes.holiday_region
|
|
299
|
+
|
|
300
|
+
setHolidayRegion = value => {
|
|
301
|
+
this.attributes.holiday_region = value
|
|
302
|
+
}
|
|
303
|
+
|
|
297
304
|
// Manually Run Automation
|
|
298
305
|
manualRun = async (params = {}) => {
|
|
299
306
|
if (!this.attributes.id) {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
import Api from '../Api'
|
|
3
|
+
import * as errors from '../Errors'
|
|
4
|
+
import {
|
|
5
|
+
getType, isArray, isInt, isObject, isString,
|
|
6
|
+
} from '../utils'
|
|
7
|
+
/* eslint-enable no-unused-vars */
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Class HolidayRegion
|
|
11
|
+
*/
|
|
12
|
+
class HolidayRegion {
|
|
13
|
+
attributes = {}
|
|
14
|
+
|
|
15
|
+
options = {}
|
|
16
|
+
|
|
17
|
+
constructor(attributes = {}, options = {}) {
|
|
18
|
+
Object.entries(attributes).forEach(([key, value]) => {
|
|
19
|
+
const normalizedKey = key.replace('?', '')
|
|
20
|
+
|
|
21
|
+
this.attributes[normalizedKey] = value
|
|
22
|
+
|
|
23
|
+
Object.defineProperty(this, normalizedKey, { value, writable: false })
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
this.options = { ...options }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
isLoaded = () => !!this.attributes.id
|
|
30
|
+
|
|
31
|
+
// string # The code representing a region
|
|
32
|
+
getCode = () => this.attributes.code
|
|
33
|
+
|
|
34
|
+
// string # The name of the region
|
|
35
|
+
getName = () => this.attributes.name
|
|
36
|
+
|
|
37
|
+
// Parameters:
|
|
38
|
+
// 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.
|
|
39
|
+
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
40
|
+
static getSupported = async (params = {}, options = {}) => {
|
|
41
|
+
if (params.cursor && !isString(params.cursor)) {
|
|
42
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (params.per_page && !isInt(params.per_page)) {
|
|
46
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const response = await Api.sendRequest('/holiday_regions/supported', 'GET', params, options)
|
|
50
|
+
|
|
51
|
+
return response?.data?.map(obj => new HolidayRegion(obj, options)) || []
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default HolidayRegion
|
|
56
|
+
|
|
57
|
+
module.exports = HolidayRegion
|
|
58
|
+
module.exports.default = HolidayRegion
|
|
@@ -63,6 +63,13 @@ class RemoteMountBackend {
|
|
|
63
63
|
this.attributes.health_check_type = value
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
// int64 # Unique identifier for this backend.
|
|
67
|
+
getId = () => this.attributes.id
|
|
68
|
+
|
|
69
|
+
setId = value => {
|
|
70
|
+
this.attributes.id = value
|
|
71
|
+
}
|
|
72
|
+
|
|
66
73
|
// int64 # Interval in seconds between health checks.
|
|
67
74
|
getInterval = () => this.attributes.interval
|
|
68
75
|
|
|
@@ -133,13 +140,6 @@ class RemoteMountBackend {
|
|
|
133
140
|
this.attributes.undergoing_maintenance = value
|
|
134
141
|
}
|
|
135
142
|
|
|
136
|
-
// int64 # Remote Mount Backend ID.
|
|
137
|
-
getId = () => this.attributes.id
|
|
138
|
-
|
|
139
|
-
setId = value => {
|
|
140
|
-
this.attributes.id = value
|
|
141
|
-
}
|
|
142
|
-
|
|
143
143
|
// Reset backend status to healthy
|
|
144
144
|
resetStatus = async (params = {}) => {
|
|
145
145
|
if (!this.attributes.id) {
|
|
@@ -310,6 +310,7 @@ class RemoteMountBackend {
|
|
|
310
310
|
// Parameters:
|
|
311
311
|
// 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.
|
|
312
312
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
313
|
+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `remote_server_mount_id`.
|
|
313
314
|
static list = async (params = {}, options = {}) => {
|
|
314
315
|
if (params.cursor && !isString(params.cursor)) {
|
|
315
316
|
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
package/src/models/Sync.js
CHANGED
|
@@ -195,6 +195,13 @@ class Sync {
|
|
|
195
195
|
this.attributes.schedule_time_zone = value
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
// string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
|
|
199
|
+
getHolidayRegion = () => this.attributes.holiday_region
|
|
200
|
+
|
|
201
|
+
setHolidayRegion = value => {
|
|
202
|
+
this.attributes.holiday_region = value
|
|
203
|
+
}
|
|
204
|
+
|
|
198
205
|
// Manually Run Sync
|
|
199
206
|
manualRun = async (params = {}) => {
|
|
200
207
|
if (!this.attributes.id) {
|