@lazycatcloud/sdk 0.1.481 → 0.1.485

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 (76) hide show
  1. package/dist/common/box.d.ts +600 -640
  2. package/dist/common/box.d.ts.map +1 -1
  3. package/dist/common/file_handler.d.ts +960 -1024
  4. package/dist/common/file_handler.d.ts.map +1 -1
  5. package/dist/common/filetrans.d.ts +2520 -2688
  6. package/dist/common/filetrans.d.ts.map +1 -1
  7. package/dist/common/iscsi.d.ts +180 -192
  8. package/dist/common/iscsi.d.ts.map +1 -1
  9. package/dist/common/media_meta.d.ts +60 -64
  10. package/dist/common/media_meta.d.ts.map +1 -1
  11. package/dist/common/message.d.ts +420 -448
  12. package/dist/common/message.d.ts.map +1 -1
  13. package/dist/common/peripheral_device.d.ts +360 -384
  14. package/dist/common/peripheral_device.d.ts.map +1 -1
  15. package/dist/extentions/app_common.d.ts +5 -0
  16. package/dist/extentions/app_common.d.ts.map +1 -1
  17. package/dist/extentions/app_common.js +20 -0
  18. package/dist/extentions/app_common.js.map +1 -1
  19. package/dist/google/protobuf/descriptor.d.ts.map +1 -1
  20. package/dist/google/protobuf/timestamp.d.ts +60 -64
  21. package/dist/google/protobuf/timestamp.d.ts.map +1 -1
  22. package/dist/localdevice/client.d.ts +60 -64
  23. package/dist/localdevice/client.d.ts.map +1 -1
  24. package/dist/localdevice/clipboard.d.ts +137 -0
  25. package/dist/localdevice/clipboard.d.ts.map +1 -0
  26. package/dist/localdevice/clipboard.js +433 -0
  27. package/dist/localdevice/clipboard.js.map +1 -0
  28. package/dist/localdevice/contacts.d.ts +60 -64
  29. package/dist/localdevice/contacts.d.ts.map +1 -1
  30. package/dist/localdevice/photo.d.ts +374 -192
  31. package/dist/localdevice/photo.d.ts.map +1 -1
  32. package/dist/localdevice/photo.js +157 -1
  33. package/dist/localdevice/photo.js.map +1 -1
  34. package/dist/package.json +1 -1
  35. package/dist/sys/OS_snapshot.d.ts +585 -0
  36. package/dist/sys/OS_snapshot.d.ts.map +1 -0
  37. package/dist/sys/OS_snapshot.js +1543 -0
  38. package/dist/sys/OS_snapshot.js.map +1 -0
  39. package/dist/sys/OS_upgrader.d.ts +202 -0
  40. package/dist/sys/OS_upgrader.d.ts.map +1 -0
  41. package/dist/sys/OS_upgrader.js +639 -0
  42. package/dist/sys/OS_upgrader.js.map +1 -0
  43. package/dist/sys/btrfs.d.ts +180 -192
  44. package/dist/sys/btrfs.d.ts.map +1 -1
  45. package/dist/sys/hal.d.ts +120 -128
  46. package/dist/sys/hal.d.ts.map +1 -1
  47. package/dist/sys/hc-core/hc-core.d.ts +691 -0
  48. package/dist/sys/hc-core/hc-core.d.ts.map +1 -0
  49. package/dist/sys/hc-core/hc-core.js +1484 -0
  50. package/dist/sys/hc-core/hc-core.js.map +1 -0
  51. package/dist/sys/ingress.d.ts +60 -64
  52. package/dist/sys/ingress.d.ts.map +1 -1
  53. package/dist/sys/installer.d.ts +277 -0
  54. package/dist/sys/installer.d.ts.map +1 -0
  55. package/dist/sys/installer.js +796 -0
  56. package/dist/sys/installer.js.map +1 -0
  57. package/dist/sys/network_manager.d.ts +180 -192
  58. package/dist/sys/network_manager.d.ts.map +1 -1
  59. package/dist/sys/osupgrader.d.ts +256 -0
  60. package/dist/sys/osupgrader.d.ts.map +1 -0
  61. package/dist/sys/osupgrader.js +536 -0
  62. package/dist/sys/osupgrader.js.map +1 -0
  63. package/dist/sys/package_manager.d.ts +8700 -9280
  64. package/dist/sys/package_manager.d.ts.map +1 -1
  65. package/dist/sys/portal-server/portal-server.d.ts +947 -0
  66. package/dist/sys/portal-server/portal-server.d.ts.map +1 -0
  67. package/dist/sys/portal-server/portal-server.js +2756 -0
  68. package/dist/sys/portal-server/portal-server.js.map +1 -0
  69. package/dist/sys/snapd.d.ts +343 -0
  70. package/dist/sys/snapd.d.ts.map +1 -0
  71. package/dist/sys/snapd.js +798 -0
  72. package/dist/sys/snapd.js.map +1 -0
  73. package/dist/sys/stats/cgroup_metrics.d.ts +8220 -8768
  74. package/dist/sys/stats/cgroup_metrics.d.ts.map +1 -1
  75. package/dist/tsconfig.tsbuildinfo +1 -1
  76. package/package.json +1 -1
@@ -0,0 +1,1543 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.GrpcWebError = exports.GrpcWebImpl = exports.OSSnapshotServiceStopTransferDesc = exports.OSSnapshotServiceGetStatusDesc = exports.OSSnapshotServiceSnapshotBackupRestoreDesc = exports.OSSnapshotServiceSnapshotBackupListDesc = exports.OSSnapshotServiceSnapshotBackupDelDesc = exports.OSSnapshotServiceSnapshotBackupAddDesc = exports.OSSnapshotServiceSnapshotRestoreDesc = exports.OSSnapshotServiceSnapshotListDesc = exports.OSSnapshotServiceSnapshotDelDesc = exports.OSSnapshotServiceSnapshotAddDesc = exports.OSSnapshotServiceDatasetBackupListDesc = exports.OSSnapshotServiceDatasetBackupDelDesc = exports.OSSnapshotServiceDatasetListDesc = exports.OSSnapshotServiceDatasetDelDesc = exports.OSSnapshotServiceDatasetAddDesc = exports.OSSnapshotServiceBackupPoolListDesc = exports.OSSnapshotServiceBackupPoolDelDesc = exports.OSSnapshotServiceBackupPoolAddDesc = exports.OSSnapshotServiceDesc = exports.OSSnapshotServiceClientImpl = exports.SnapshotStatusResponse = exports.SnapshotBackupListRequest = exports.SnapshotBackupTransferResponse = exports.SnapshotBackupTransferRequest = exports.SnapshotBackupRequest = exports.SnapshotListResponse = exports.SnapshotDesc = exports.SnapshotRequest = exports.SnapshotDatasetListResponse = exports.SnapshotDatasetDesc = exports.SnapshotDatasetBackupRequest = exports.SnapshotDatasetRequest = exports.SnapshotBackupPoolListResponse = exports.SnapshotBackupPoolRequest = exports.snapshotTransferModeToJSON = exports.snapshotTransferModeFromJSON = exports.SnapshotTransferMode = exports.snapshotManagerStatusToJSON = exports.snapshotManagerStatusFromJSON = exports.SnapshotManagerStatus = void 0;
7
+ /* eslint-disable */
8
+ const grpc_web_1 = require("@improbable-eng/grpc-web");
9
+ const browser_headers_1 = require("browser-headers");
10
+ const long_1 = __importDefault(require("long"));
11
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
12
+ const empty_1 = require("../google/protobuf/empty");
13
+ var SnapshotManagerStatus;
14
+ (function (SnapshotManagerStatus) {
15
+ SnapshotManagerStatus[SnapshotManagerStatus["Stopped"] = 0] = "Stopped";
16
+ SnapshotManagerStatus[SnapshotManagerStatus["Running"] = 1] = "Running";
17
+ SnapshotManagerStatus[SnapshotManagerStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
18
+ })(SnapshotManagerStatus = exports.SnapshotManagerStatus || (exports.SnapshotManagerStatus = {}));
19
+ function snapshotManagerStatusFromJSON(object) {
20
+ switch (object) {
21
+ case 0:
22
+ case "Stopped":
23
+ return SnapshotManagerStatus.Stopped;
24
+ case 1:
25
+ case "Running":
26
+ return SnapshotManagerStatus.Running;
27
+ case -1:
28
+ case "UNRECOGNIZED":
29
+ default:
30
+ return SnapshotManagerStatus.UNRECOGNIZED;
31
+ }
32
+ }
33
+ exports.snapshotManagerStatusFromJSON = snapshotManagerStatusFromJSON;
34
+ function snapshotManagerStatusToJSON(object) {
35
+ switch (object) {
36
+ case SnapshotManagerStatus.Stopped:
37
+ return "Stopped";
38
+ case SnapshotManagerStatus.Running:
39
+ return "Running";
40
+ case SnapshotManagerStatus.UNRECOGNIZED:
41
+ default:
42
+ return "UNRECOGNIZED";
43
+ }
44
+ }
45
+ exports.snapshotManagerStatusToJSON = snapshotManagerStatusToJSON;
46
+ var SnapshotTransferMode;
47
+ (function (SnapshotTransferMode) {
48
+ SnapshotTransferMode[SnapshotTransferMode["Normal"] = 0] = "Normal";
49
+ /** NoResume - 若存在可恢复的传输任务,是否不尝试恢复,重新传输 */
50
+ SnapshotTransferMode[SnapshotTransferMode["NoResume"] = 1] = "NoResume";
51
+ /** DryRun - 不进行传输,只预估传输的数据量 */
52
+ SnapshotTransferMode[SnapshotTransferMode["DryRun"] = 2] = "DryRun";
53
+ SnapshotTransferMode[SnapshotTransferMode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
54
+ })(SnapshotTransferMode = exports.SnapshotTransferMode || (exports.SnapshotTransferMode = {}));
55
+ function snapshotTransferModeFromJSON(object) {
56
+ switch (object) {
57
+ case 0:
58
+ case "Normal":
59
+ return SnapshotTransferMode.Normal;
60
+ case 1:
61
+ case "NoResume":
62
+ return SnapshotTransferMode.NoResume;
63
+ case 2:
64
+ case "DryRun":
65
+ return SnapshotTransferMode.DryRun;
66
+ case -1:
67
+ case "UNRECOGNIZED":
68
+ default:
69
+ return SnapshotTransferMode.UNRECOGNIZED;
70
+ }
71
+ }
72
+ exports.snapshotTransferModeFromJSON = snapshotTransferModeFromJSON;
73
+ function snapshotTransferModeToJSON(object) {
74
+ switch (object) {
75
+ case SnapshotTransferMode.Normal:
76
+ return "Normal";
77
+ case SnapshotTransferMode.NoResume:
78
+ return "NoResume";
79
+ case SnapshotTransferMode.DryRun:
80
+ return "DryRun";
81
+ case SnapshotTransferMode.UNRECOGNIZED:
82
+ default:
83
+ return "UNRECOGNIZED";
84
+ }
85
+ }
86
+ exports.snapshotTransferModeToJSON = snapshotTransferModeToJSON;
87
+ function createBaseSnapshotBackupPoolRequest() {
88
+ return { PoolName: "" };
89
+ }
90
+ exports.SnapshotBackupPoolRequest = {
91
+ encode(message, writer = minimal_1.default.Writer.create()) {
92
+ if (message.PoolName !== "") {
93
+ writer.uint32(10).string(message.PoolName);
94
+ }
95
+ return writer;
96
+ },
97
+ decode(input, length) {
98
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
99
+ let end = length === undefined ? reader.len : reader.pos + length;
100
+ const message = createBaseSnapshotBackupPoolRequest();
101
+ while (reader.pos < end) {
102
+ const tag = reader.uint32();
103
+ switch (tag >>> 3) {
104
+ case 1:
105
+ if (tag !== 10) {
106
+ break;
107
+ }
108
+ message.PoolName = reader.string();
109
+ continue;
110
+ }
111
+ if ((tag & 7) === 4 || tag === 0) {
112
+ break;
113
+ }
114
+ reader.skipType(tag & 7);
115
+ }
116
+ return message;
117
+ },
118
+ fromJSON(object) {
119
+ return { PoolName: isSet(object.PoolName) ? String(object.PoolName) : "" };
120
+ },
121
+ toJSON(message) {
122
+ const obj = {};
123
+ if (message.PoolName !== "") {
124
+ obj.PoolName = message.PoolName;
125
+ }
126
+ return obj;
127
+ },
128
+ create(base) {
129
+ return exports.SnapshotBackupPoolRequest.fromPartial(base !== null && base !== void 0 ? base : {});
130
+ },
131
+ fromPartial(object) {
132
+ var _a;
133
+ const message = createBaseSnapshotBackupPoolRequest();
134
+ message.PoolName = (_a = object.PoolName) !== null && _a !== void 0 ? _a : "";
135
+ return message;
136
+ },
137
+ };
138
+ function createBaseSnapshotBackupPoolListResponse() {
139
+ return { PoolNameList: [] };
140
+ }
141
+ exports.SnapshotBackupPoolListResponse = {
142
+ encode(message, writer = minimal_1.default.Writer.create()) {
143
+ for (const v of message.PoolNameList) {
144
+ writer.uint32(10).string(v);
145
+ }
146
+ return writer;
147
+ },
148
+ decode(input, length) {
149
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
150
+ let end = length === undefined ? reader.len : reader.pos + length;
151
+ const message = createBaseSnapshotBackupPoolListResponse();
152
+ while (reader.pos < end) {
153
+ const tag = reader.uint32();
154
+ switch (tag >>> 3) {
155
+ case 1:
156
+ if (tag !== 10) {
157
+ break;
158
+ }
159
+ message.PoolNameList.push(reader.string());
160
+ continue;
161
+ }
162
+ if ((tag & 7) === 4 || tag === 0) {
163
+ break;
164
+ }
165
+ reader.skipType(tag & 7);
166
+ }
167
+ return message;
168
+ },
169
+ fromJSON(object) {
170
+ return { PoolNameList: Array.isArray(object === null || object === void 0 ? void 0 : object.PoolNameList) ? object.PoolNameList.map((e) => String(e)) : [] };
171
+ },
172
+ toJSON(message) {
173
+ var _a;
174
+ const obj = {};
175
+ if ((_a = message.PoolNameList) === null || _a === void 0 ? void 0 : _a.length) {
176
+ obj.PoolNameList = message.PoolNameList;
177
+ }
178
+ return obj;
179
+ },
180
+ create(base) {
181
+ return exports.SnapshotBackupPoolListResponse.fromPartial(base !== null && base !== void 0 ? base : {});
182
+ },
183
+ fromPartial(object) {
184
+ var _a;
185
+ const message = createBaseSnapshotBackupPoolListResponse();
186
+ message.PoolNameList = ((_a = object.PoolNameList) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
187
+ return message;
188
+ },
189
+ };
190
+ function createBaseSnapshotDatasetRequest() {
191
+ return { DatasetPath: "" };
192
+ }
193
+ exports.SnapshotDatasetRequest = {
194
+ encode(message, writer = minimal_1.default.Writer.create()) {
195
+ if (message.DatasetPath !== "") {
196
+ writer.uint32(10).string(message.DatasetPath);
197
+ }
198
+ return writer;
199
+ },
200
+ decode(input, length) {
201
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
202
+ let end = length === undefined ? reader.len : reader.pos + length;
203
+ const message = createBaseSnapshotDatasetRequest();
204
+ while (reader.pos < end) {
205
+ const tag = reader.uint32();
206
+ switch (tag >>> 3) {
207
+ case 1:
208
+ if (tag !== 10) {
209
+ break;
210
+ }
211
+ message.DatasetPath = reader.string();
212
+ continue;
213
+ }
214
+ if ((tag & 7) === 4 || tag === 0) {
215
+ break;
216
+ }
217
+ reader.skipType(tag & 7);
218
+ }
219
+ return message;
220
+ },
221
+ fromJSON(object) {
222
+ return { DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "" };
223
+ },
224
+ toJSON(message) {
225
+ const obj = {};
226
+ if (message.DatasetPath !== "") {
227
+ obj.DatasetPath = message.DatasetPath;
228
+ }
229
+ return obj;
230
+ },
231
+ create(base) {
232
+ return exports.SnapshotDatasetRequest.fromPartial(base !== null && base !== void 0 ? base : {});
233
+ },
234
+ fromPartial(object) {
235
+ var _a;
236
+ const message = createBaseSnapshotDatasetRequest();
237
+ message.DatasetPath = (_a = object.DatasetPath) !== null && _a !== void 0 ? _a : "";
238
+ return message;
239
+ },
240
+ };
241
+ function createBaseSnapshotDatasetBackupRequest() {
242
+ return { PoolName: "", DatasetPath: "" };
243
+ }
244
+ exports.SnapshotDatasetBackupRequest = {
245
+ encode(message, writer = minimal_1.default.Writer.create()) {
246
+ if (message.PoolName !== "") {
247
+ writer.uint32(10).string(message.PoolName);
248
+ }
249
+ if (message.DatasetPath !== "") {
250
+ writer.uint32(18).string(message.DatasetPath);
251
+ }
252
+ return writer;
253
+ },
254
+ decode(input, length) {
255
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
256
+ let end = length === undefined ? reader.len : reader.pos + length;
257
+ const message = createBaseSnapshotDatasetBackupRequest();
258
+ while (reader.pos < end) {
259
+ const tag = reader.uint32();
260
+ switch (tag >>> 3) {
261
+ case 1:
262
+ if (tag !== 10) {
263
+ break;
264
+ }
265
+ message.PoolName = reader.string();
266
+ continue;
267
+ case 2:
268
+ if (tag !== 18) {
269
+ break;
270
+ }
271
+ message.DatasetPath = reader.string();
272
+ continue;
273
+ }
274
+ if ((tag & 7) === 4 || tag === 0) {
275
+ break;
276
+ }
277
+ reader.skipType(tag & 7);
278
+ }
279
+ return message;
280
+ },
281
+ fromJSON(object) {
282
+ return {
283
+ PoolName: isSet(object.PoolName) ? String(object.PoolName) : "",
284
+ DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "",
285
+ };
286
+ },
287
+ toJSON(message) {
288
+ const obj = {};
289
+ if (message.PoolName !== "") {
290
+ obj.PoolName = message.PoolName;
291
+ }
292
+ if (message.DatasetPath !== "") {
293
+ obj.DatasetPath = message.DatasetPath;
294
+ }
295
+ return obj;
296
+ },
297
+ create(base) {
298
+ return exports.SnapshotDatasetBackupRequest.fromPartial(base !== null && base !== void 0 ? base : {});
299
+ },
300
+ fromPartial(object) {
301
+ var _a, _b;
302
+ const message = createBaseSnapshotDatasetBackupRequest();
303
+ message.PoolName = (_a = object.PoolName) !== null && _a !== void 0 ? _a : "";
304
+ message.DatasetPath = (_b = object.DatasetPath) !== null && _b !== void 0 ? _b : "";
305
+ return message;
306
+ },
307
+ };
308
+ function createBaseSnapshotDatasetDesc() {
309
+ return { Path: "", BytesUsed: 0, SnapshotBytesUsed: 0, CreatedAt: 0 };
310
+ }
311
+ exports.SnapshotDatasetDesc = {
312
+ encode(message, writer = minimal_1.default.Writer.create()) {
313
+ if (message.Path !== "") {
314
+ writer.uint32(10).string(message.Path);
315
+ }
316
+ if (message.BytesUsed !== 0) {
317
+ writer.uint32(16).uint64(message.BytesUsed);
318
+ }
319
+ if (message.SnapshotBytesUsed !== 0) {
320
+ writer.uint32(24).uint64(message.SnapshotBytesUsed);
321
+ }
322
+ if (message.CreatedAt !== 0) {
323
+ writer.uint32(32).uint64(message.CreatedAt);
324
+ }
325
+ return writer;
326
+ },
327
+ decode(input, length) {
328
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
329
+ let end = length === undefined ? reader.len : reader.pos + length;
330
+ const message = createBaseSnapshotDatasetDesc();
331
+ while (reader.pos < end) {
332
+ const tag = reader.uint32();
333
+ switch (tag >>> 3) {
334
+ case 1:
335
+ if (tag !== 10) {
336
+ break;
337
+ }
338
+ message.Path = reader.string();
339
+ continue;
340
+ case 2:
341
+ if (tag !== 16) {
342
+ break;
343
+ }
344
+ message.BytesUsed = longToNumber(reader.uint64());
345
+ continue;
346
+ case 3:
347
+ if (tag !== 24) {
348
+ break;
349
+ }
350
+ message.SnapshotBytesUsed = longToNumber(reader.uint64());
351
+ continue;
352
+ case 4:
353
+ if (tag !== 32) {
354
+ break;
355
+ }
356
+ message.CreatedAt = longToNumber(reader.uint64());
357
+ continue;
358
+ }
359
+ if ((tag & 7) === 4 || tag === 0) {
360
+ break;
361
+ }
362
+ reader.skipType(tag & 7);
363
+ }
364
+ return message;
365
+ },
366
+ fromJSON(object) {
367
+ return {
368
+ Path: isSet(object.Path) ? String(object.Path) : "",
369
+ BytesUsed: isSet(object.BytesUsed) ? Number(object.BytesUsed) : 0,
370
+ SnapshotBytesUsed: isSet(object.SnapshotBytesUsed) ? Number(object.SnapshotBytesUsed) : 0,
371
+ CreatedAt: isSet(object.CreatedAt) ? Number(object.CreatedAt) : 0,
372
+ };
373
+ },
374
+ toJSON(message) {
375
+ const obj = {};
376
+ if (message.Path !== "") {
377
+ obj.Path = message.Path;
378
+ }
379
+ if (message.BytesUsed !== 0) {
380
+ obj.BytesUsed = Math.round(message.BytesUsed);
381
+ }
382
+ if (message.SnapshotBytesUsed !== 0) {
383
+ obj.SnapshotBytesUsed = Math.round(message.SnapshotBytesUsed);
384
+ }
385
+ if (message.CreatedAt !== 0) {
386
+ obj.CreatedAt = Math.round(message.CreatedAt);
387
+ }
388
+ return obj;
389
+ },
390
+ create(base) {
391
+ return exports.SnapshotDatasetDesc.fromPartial(base !== null && base !== void 0 ? base : {});
392
+ },
393
+ fromPartial(object) {
394
+ var _a, _b, _c, _d;
395
+ const message = createBaseSnapshotDatasetDesc();
396
+ message.Path = (_a = object.Path) !== null && _a !== void 0 ? _a : "";
397
+ message.BytesUsed = (_b = object.BytesUsed) !== null && _b !== void 0 ? _b : 0;
398
+ message.SnapshotBytesUsed = (_c = object.SnapshotBytesUsed) !== null && _c !== void 0 ? _c : 0;
399
+ message.CreatedAt = (_d = object.CreatedAt) !== null && _d !== void 0 ? _d : 0;
400
+ return message;
401
+ },
402
+ };
403
+ function createBaseSnapshotDatasetListResponse() {
404
+ return { DatasetList: [] };
405
+ }
406
+ exports.SnapshotDatasetListResponse = {
407
+ encode(message, writer = minimal_1.default.Writer.create()) {
408
+ for (const v of message.DatasetList) {
409
+ exports.SnapshotDatasetDesc.encode(v, writer.uint32(10).fork()).ldelim();
410
+ }
411
+ return writer;
412
+ },
413
+ decode(input, length) {
414
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
415
+ let end = length === undefined ? reader.len : reader.pos + length;
416
+ const message = createBaseSnapshotDatasetListResponse();
417
+ while (reader.pos < end) {
418
+ const tag = reader.uint32();
419
+ switch (tag >>> 3) {
420
+ case 1:
421
+ if (tag !== 10) {
422
+ break;
423
+ }
424
+ message.DatasetList.push(exports.SnapshotDatasetDesc.decode(reader, reader.uint32()));
425
+ continue;
426
+ }
427
+ if ((tag & 7) === 4 || tag === 0) {
428
+ break;
429
+ }
430
+ reader.skipType(tag & 7);
431
+ }
432
+ return message;
433
+ },
434
+ fromJSON(object) {
435
+ return {
436
+ DatasetList: Array.isArray(object === null || object === void 0 ? void 0 : object.DatasetList)
437
+ ? object.DatasetList.map((e) => exports.SnapshotDatasetDesc.fromJSON(e))
438
+ : [],
439
+ };
440
+ },
441
+ toJSON(message) {
442
+ var _a;
443
+ const obj = {};
444
+ if ((_a = message.DatasetList) === null || _a === void 0 ? void 0 : _a.length) {
445
+ obj.DatasetList = message.DatasetList.map((e) => exports.SnapshotDatasetDesc.toJSON(e));
446
+ }
447
+ return obj;
448
+ },
449
+ create(base) {
450
+ return exports.SnapshotDatasetListResponse.fromPartial(base !== null && base !== void 0 ? base : {});
451
+ },
452
+ fromPartial(object) {
453
+ var _a;
454
+ const message = createBaseSnapshotDatasetListResponse();
455
+ message.DatasetList = ((_a = object.DatasetList) === null || _a === void 0 ? void 0 : _a.map((e) => exports.SnapshotDatasetDesc.fromPartial(e))) || [];
456
+ return message;
457
+ },
458
+ };
459
+ function createBaseSnapshotRequest() {
460
+ return { DatasetPath: "", SnapshotName: "" };
461
+ }
462
+ exports.SnapshotRequest = {
463
+ encode(message, writer = minimal_1.default.Writer.create()) {
464
+ if (message.DatasetPath !== "") {
465
+ writer.uint32(10).string(message.DatasetPath);
466
+ }
467
+ if (message.SnapshotName !== "") {
468
+ writer.uint32(18).string(message.SnapshotName);
469
+ }
470
+ return writer;
471
+ },
472
+ decode(input, length) {
473
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
474
+ let end = length === undefined ? reader.len : reader.pos + length;
475
+ const message = createBaseSnapshotRequest();
476
+ while (reader.pos < end) {
477
+ const tag = reader.uint32();
478
+ switch (tag >>> 3) {
479
+ case 1:
480
+ if (tag !== 10) {
481
+ break;
482
+ }
483
+ message.DatasetPath = reader.string();
484
+ continue;
485
+ case 2:
486
+ if (tag !== 18) {
487
+ break;
488
+ }
489
+ message.SnapshotName = reader.string();
490
+ continue;
491
+ }
492
+ if ((tag & 7) === 4 || tag === 0) {
493
+ break;
494
+ }
495
+ reader.skipType(tag & 7);
496
+ }
497
+ return message;
498
+ },
499
+ fromJSON(object) {
500
+ return {
501
+ DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "",
502
+ SnapshotName: isSet(object.SnapshotName) ? String(object.SnapshotName) : "",
503
+ };
504
+ },
505
+ toJSON(message) {
506
+ const obj = {};
507
+ if (message.DatasetPath !== "") {
508
+ obj.DatasetPath = message.DatasetPath;
509
+ }
510
+ if (message.SnapshotName !== "") {
511
+ obj.SnapshotName = message.SnapshotName;
512
+ }
513
+ return obj;
514
+ },
515
+ create(base) {
516
+ return exports.SnapshotRequest.fromPartial(base !== null && base !== void 0 ? base : {});
517
+ },
518
+ fromPartial(object) {
519
+ var _a, _b;
520
+ const message = createBaseSnapshotRequest();
521
+ message.DatasetPath = (_a = object.DatasetPath) !== null && _a !== void 0 ? _a : "";
522
+ message.SnapshotName = (_b = object.SnapshotName) !== null && _b !== void 0 ? _b : "";
523
+ return message;
524
+ },
525
+ };
526
+ function createBaseSnapshotDesc() {
527
+ return { Name: "", BytesUsed: 0, CreatedAt: 0 };
528
+ }
529
+ exports.SnapshotDesc = {
530
+ encode(message, writer = minimal_1.default.Writer.create()) {
531
+ if (message.Name !== "") {
532
+ writer.uint32(10).string(message.Name);
533
+ }
534
+ if (message.BytesUsed !== 0) {
535
+ writer.uint32(16).uint64(message.BytesUsed);
536
+ }
537
+ if (message.CreatedAt !== 0) {
538
+ writer.uint32(24).uint64(message.CreatedAt);
539
+ }
540
+ return writer;
541
+ },
542
+ decode(input, length) {
543
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
544
+ let end = length === undefined ? reader.len : reader.pos + length;
545
+ const message = createBaseSnapshotDesc();
546
+ while (reader.pos < end) {
547
+ const tag = reader.uint32();
548
+ switch (tag >>> 3) {
549
+ case 1:
550
+ if (tag !== 10) {
551
+ break;
552
+ }
553
+ message.Name = reader.string();
554
+ continue;
555
+ case 2:
556
+ if (tag !== 16) {
557
+ break;
558
+ }
559
+ message.BytesUsed = longToNumber(reader.uint64());
560
+ continue;
561
+ case 3:
562
+ if (tag !== 24) {
563
+ break;
564
+ }
565
+ message.CreatedAt = longToNumber(reader.uint64());
566
+ continue;
567
+ }
568
+ if ((tag & 7) === 4 || tag === 0) {
569
+ break;
570
+ }
571
+ reader.skipType(tag & 7);
572
+ }
573
+ return message;
574
+ },
575
+ fromJSON(object) {
576
+ return {
577
+ Name: isSet(object.Name) ? String(object.Name) : "",
578
+ BytesUsed: isSet(object.BytesUsed) ? Number(object.BytesUsed) : 0,
579
+ CreatedAt: isSet(object.CreatedAt) ? Number(object.CreatedAt) : 0,
580
+ };
581
+ },
582
+ toJSON(message) {
583
+ const obj = {};
584
+ if (message.Name !== "") {
585
+ obj.Name = message.Name;
586
+ }
587
+ if (message.BytesUsed !== 0) {
588
+ obj.BytesUsed = Math.round(message.BytesUsed);
589
+ }
590
+ if (message.CreatedAt !== 0) {
591
+ obj.CreatedAt = Math.round(message.CreatedAt);
592
+ }
593
+ return obj;
594
+ },
595
+ create(base) {
596
+ return exports.SnapshotDesc.fromPartial(base !== null && base !== void 0 ? base : {});
597
+ },
598
+ fromPartial(object) {
599
+ var _a, _b, _c;
600
+ const message = createBaseSnapshotDesc();
601
+ message.Name = (_a = object.Name) !== null && _a !== void 0 ? _a : "";
602
+ message.BytesUsed = (_b = object.BytesUsed) !== null && _b !== void 0 ? _b : 0;
603
+ message.CreatedAt = (_c = object.CreatedAt) !== null && _c !== void 0 ? _c : 0;
604
+ return message;
605
+ },
606
+ };
607
+ function createBaseSnapshotListResponse() {
608
+ return { SnapshotList: [] };
609
+ }
610
+ exports.SnapshotListResponse = {
611
+ encode(message, writer = minimal_1.default.Writer.create()) {
612
+ for (const v of message.SnapshotList) {
613
+ exports.SnapshotDesc.encode(v, writer.uint32(10).fork()).ldelim();
614
+ }
615
+ return writer;
616
+ },
617
+ decode(input, length) {
618
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
619
+ let end = length === undefined ? reader.len : reader.pos + length;
620
+ const message = createBaseSnapshotListResponse();
621
+ while (reader.pos < end) {
622
+ const tag = reader.uint32();
623
+ switch (tag >>> 3) {
624
+ case 1:
625
+ if (tag !== 10) {
626
+ break;
627
+ }
628
+ message.SnapshotList.push(exports.SnapshotDesc.decode(reader, reader.uint32()));
629
+ continue;
630
+ }
631
+ if ((tag & 7) === 4 || tag === 0) {
632
+ break;
633
+ }
634
+ reader.skipType(tag & 7);
635
+ }
636
+ return message;
637
+ },
638
+ fromJSON(object) {
639
+ return {
640
+ SnapshotList: Array.isArray(object === null || object === void 0 ? void 0 : object.SnapshotList)
641
+ ? object.SnapshotList.map((e) => exports.SnapshotDesc.fromJSON(e))
642
+ : [],
643
+ };
644
+ },
645
+ toJSON(message) {
646
+ var _a;
647
+ const obj = {};
648
+ if ((_a = message.SnapshotList) === null || _a === void 0 ? void 0 : _a.length) {
649
+ obj.SnapshotList = message.SnapshotList.map((e) => exports.SnapshotDesc.toJSON(e));
650
+ }
651
+ return obj;
652
+ },
653
+ create(base) {
654
+ return exports.SnapshotListResponse.fromPartial(base !== null && base !== void 0 ? base : {});
655
+ },
656
+ fromPartial(object) {
657
+ var _a;
658
+ const message = createBaseSnapshotListResponse();
659
+ message.SnapshotList = ((_a = object.SnapshotList) === null || _a === void 0 ? void 0 : _a.map((e) => exports.SnapshotDesc.fromPartial(e))) || [];
660
+ return message;
661
+ },
662
+ };
663
+ function createBaseSnapshotBackupRequest() {
664
+ return { PoolName: "", DatasetPath: "", SnapshotName: "" };
665
+ }
666
+ exports.SnapshotBackupRequest = {
667
+ encode(message, writer = minimal_1.default.Writer.create()) {
668
+ if (message.PoolName !== "") {
669
+ writer.uint32(10).string(message.PoolName);
670
+ }
671
+ if (message.DatasetPath !== "") {
672
+ writer.uint32(18).string(message.DatasetPath);
673
+ }
674
+ if (message.SnapshotName !== "") {
675
+ writer.uint32(26).string(message.SnapshotName);
676
+ }
677
+ return writer;
678
+ },
679
+ decode(input, length) {
680
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
681
+ let end = length === undefined ? reader.len : reader.pos + length;
682
+ const message = createBaseSnapshotBackupRequest();
683
+ while (reader.pos < end) {
684
+ const tag = reader.uint32();
685
+ switch (tag >>> 3) {
686
+ case 1:
687
+ if (tag !== 10) {
688
+ break;
689
+ }
690
+ message.PoolName = reader.string();
691
+ continue;
692
+ case 2:
693
+ if (tag !== 18) {
694
+ break;
695
+ }
696
+ message.DatasetPath = reader.string();
697
+ continue;
698
+ case 3:
699
+ if (tag !== 26) {
700
+ break;
701
+ }
702
+ message.SnapshotName = reader.string();
703
+ continue;
704
+ }
705
+ if ((tag & 7) === 4 || tag === 0) {
706
+ break;
707
+ }
708
+ reader.skipType(tag & 7);
709
+ }
710
+ return message;
711
+ },
712
+ fromJSON(object) {
713
+ return {
714
+ PoolName: isSet(object.PoolName) ? String(object.PoolName) : "",
715
+ DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "",
716
+ SnapshotName: isSet(object.SnapshotName) ? String(object.SnapshotName) : "",
717
+ };
718
+ },
719
+ toJSON(message) {
720
+ const obj = {};
721
+ if (message.PoolName !== "") {
722
+ obj.PoolName = message.PoolName;
723
+ }
724
+ if (message.DatasetPath !== "") {
725
+ obj.DatasetPath = message.DatasetPath;
726
+ }
727
+ if (message.SnapshotName !== "") {
728
+ obj.SnapshotName = message.SnapshotName;
729
+ }
730
+ return obj;
731
+ },
732
+ create(base) {
733
+ return exports.SnapshotBackupRequest.fromPartial(base !== null && base !== void 0 ? base : {});
734
+ },
735
+ fromPartial(object) {
736
+ var _a, _b, _c;
737
+ const message = createBaseSnapshotBackupRequest();
738
+ message.PoolName = (_a = object.PoolName) !== null && _a !== void 0 ? _a : "";
739
+ message.DatasetPath = (_b = object.DatasetPath) !== null && _b !== void 0 ? _b : "";
740
+ message.SnapshotName = (_c = object.SnapshotName) !== null && _c !== void 0 ? _c : "";
741
+ return message;
742
+ },
743
+ };
744
+ function createBaseSnapshotBackupTransferRequest() {
745
+ return { PoolName: "", DatasetPath: "", SnapshotName: "", TransferMode: 0 };
746
+ }
747
+ exports.SnapshotBackupTransferRequest = {
748
+ encode(message, writer = minimal_1.default.Writer.create()) {
749
+ if (message.PoolName !== "") {
750
+ writer.uint32(10).string(message.PoolName);
751
+ }
752
+ if (message.DatasetPath !== "") {
753
+ writer.uint32(18).string(message.DatasetPath);
754
+ }
755
+ if (message.SnapshotName !== "") {
756
+ writer.uint32(26).string(message.SnapshotName);
757
+ }
758
+ if (message.TransferMode !== 0) {
759
+ writer.uint32(32).int32(message.TransferMode);
760
+ }
761
+ return writer;
762
+ },
763
+ decode(input, length) {
764
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
765
+ let end = length === undefined ? reader.len : reader.pos + length;
766
+ const message = createBaseSnapshotBackupTransferRequest();
767
+ while (reader.pos < end) {
768
+ const tag = reader.uint32();
769
+ switch (tag >>> 3) {
770
+ case 1:
771
+ if (tag !== 10) {
772
+ break;
773
+ }
774
+ message.PoolName = reader.string();
775
+ continue;
776
+ case 2:
777
+ if (tag !== 18) {
778
+ break;
779
+ }
780
+ message.DatasetPath = reader.string();
781
+ continue;
782
+ case 3:
783
+ if (tag !== 26) {
784
+ break;
785
+ }
786
+ message.SnapshotName = reader.string();
787
+ continue;
788
+ case 4:
789
+ if (tag !== 32) {
790
+ break;
791
+ }
792
+ message.TransferMode = reader.int32();
793
+ continue;
794
+ }
795
+ if ((tag & 7) === 4 || tag === 0) {
796
+ break;
797
+ }
798
+ reader.skipType(tag & 7);
799
+ }
800
+ return message;
801
+ },
802
+ fromJSON(object) {
803
+ return {
804
+ PoolName: isSet(object.PoolName) ? String(object.PoolName) : "",
805
+ DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "",
806
+ SnapshotName: isSet(object.SnapshotName) ? String(object.SnapshotName) : "",
807
+ TransferMode: isSet(object.TransferMode) ? snapshotTransferModeFromJSON(object.TransferMode) : 0,
808
+ };
809
+ },
810
+ toJSON(message) {
811
+ const obj = {};
812
+ if (message.PoolName !== "") {
813
+ obj.PoolName = message.PoolName;
814
+ }
815
+ if (message.DatasetPath !== "") {
816
+ obj.DatasetPath = message.DatasetPath;
817
+ }
818
+ if (message.SnapshotName !== "") {
819
+ obj.SnapshotName = message.SnapshotName;
820
+ }
821
+ if (message.TransferMode !== 0) {
822
+ obj.TransferMode = snapshotTransferModeToJSON(message.TransferMode);
823
+ }
824
+ return obj;
825
+ },
826
+ create(base) {
827
+ return exports.SnapshotBackupTransferRequest.fromPartial(base !== null && base !== void 0 ? base : {});
828
+ },
829
+ fromPartial(object) {
830
+ var _a, _b, _c, _d;
831
+ const message = createBaseSnapshotBackupTransferRequest();
832
+ message.PoolName = (_a = object.PoolName) !== null && _a !== void 0 ? _a : "";
833
+ message.DatasetPath = (_b = object.DatasetPath) !== null && _b !== void 0 ? _b : "";
834
+ message.SnapshotName = (_c = object.SnapshotName) !== null && _c !== void 0 ? _c : "";
835
+ message.TransferMode = (_d = object.TransferMode) !== null && _d !== void 0 ? _d : 0;
836
+ return message;
837
+ },
838
+ };
839
+ function createBaseSnapshotBackupTransferResponse() {
840
+ return { BytesSent: 0, BytesTotal: 0 };
841
+ }
842
+ exports.SnapshotBackupTransferResponse = {
843
+ encode(message, writer = minimal_1.default.Writer.create()) {
844
+ if (message.BytesSent !== 0) {
845
+ writer.uint32(8).uint64(message.BytesSent);
846
+ }
847
+ if (message.BytesTotal !== 0) {
848
+ writer.uint32(16).uint64(message.BytesTotal);
849
+ }
850
+ return writer;
851
+ },
852
+ decode(input, length) {
853
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
854
+ let end = length === undefined ? reader.len : reader.pos + length;
855
+ const message = createBaseSnapshotBackupTransferResponse();
856
+ while (reader.pos < end) {
857
+ const tag = reader.uint32();
858
+ switch (tag >>> 3) {
859
+ case 1:
860
+ if (tag !== 8) {
861
+ break;
862
+ }
863
+ message.BytesSent = longToNumber(reader.uint64());
864
+ continue;
865
+ case 2:
866
+ if (tag !== 16) {
867
+ break;
868
+ }
869
+ message.BytesTotal = longToNumber(reader.uint64());
870
+ continue;
871
+ }
872
+ if ((tag & 7) === 4 || tag === 0) {
873
+ break;
874
+ }
875
+ reader.skipType(tag & 7);
876
+ }
877
+ return message;
878
+ },
879
+ fromJSON(object) {
880
+ return {
881
+ BytesSent: isSet(object.BytesSent) ? Number(object.BytesSent) : 0,
882
+ BytesTotal: isSet(object.BytesTotal) ? Number(object.BytesTotal) : 0,
883
+ };
884
+ },
885
+ toJSON(message) {
886
+ const obj = {};
887
+ if (message.BytesSent !== 0) {
888
+ obj.BytesSent = Math.round(message.BytesSent);
889
+ }
890
+ if (message.BytesTotal !== 0) {
891
+ obj.BytesTotal = Math.round(message.BytesTotal);
892
+ }
893
+ return obj;
894
+ },
895
+ create(base) {
896
+ return exports.SnapshotBackupTransferResponse.fromPartial(base !== null && base !== void 0 ? base : {});
897
+ },
898
+ fromPartial(object) {
899
+ var _a, _b;
900
+ const message = createBaseSnapshotBackupTransferResponse();
901
+ message.BytesSent = (_a = object.BytesSent) !== null && _a !== void 0 ? _a : 0;
902
+ message.BytesTotal = (_b = object.BytesTotal) !== null && _b !== void 0 ? _b : 0;
903
+ return message;
904
+ },
905
+ };
906
+ function createBaseSnapshotBackupListRequest() {
907
+ return { PoolName: "", DatasetPath: "" };
908
+ }
909
+ exports.SnapshotBackupListRequest = {
910
+ encode(message, writer = minimal_1.default.Writer.create()) {
911
+ if (message.PoolName !== "") {
912
+ writer.uint32(10).string(message.PoolName);
913
+ }
914
+ if (message.DatasetPath !== "") {
915
+ writer.uint32(18).string(message.DatasetPath);
916
+ }
917
+ return writer;
918
+ },
919
+ decode(input, length) {
920
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
921
+ let end = length === undefined ? reader.len : reader.pos + length;
922
+ const message = createBaseSnapshotBackupListRequest();
923
+ while (reader.pos < end) {
924
+ const tag = reader.uint32();
925
+ switch (tag >>> 3) {
926
+ case 1:
927
+ if (tag !== 10) {
928
+ break;
929
+ }
930
+ message.PoolName = reader.string();
931
+ continue;
932
+ case 2:
933
+ if (tag !== 18) {
934
+ break;
935
+ }
936
+ message.DatasetPath = reader.string();
937
+ continue;
938
+ }
939
+ if ((tag & 7) === 4 || tag === 0) {
940
+ break;
941
+ }
942
+ reader.skipType(tag & 7);
943
+ }
944
+ return message;
945
+ },
946
+ fromJSON(object) {
947
+ return {
948
+ PoolName: isSet(object.PoolName) ? String(object.PoolName) : "",
949
+ DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "",
950
+ };
951
+ },
952
+ toJSON(message) {
953
+ const obj = {};
954
+ if (message.PoolName !== "") {
955
+ obj.PoolName = message.PoolName;
956
+ }
957
+ if (message.DatasetPath !== "") {
958
+ obj.DatasetPath = message.DatasetPath;
959
+ }
960
+ return obj;
961
+ },
962
+ create(base) {
963
+ return exports.SnapshotBackupListRequest.fromPartial(base !== null && base !== void 0 ? base : {});
964
+ },
965
+ fromPartial(object) {
966
+ var _a, _b;
967
+ const message = createBaseSnapshotBackupListRequest();
968
+ message.PoolName = (_a = object.PoolName) !== null && _a !== void 0 ? _a : "";
969
+ message.DatasetPath = (_b = object.DatasetPath) !== null && _b !== void 0 ? _b : "";
970
+ return message;
971
+ },
972
+ };
973
+ function createBaseSnapshotStatusResponse() {
974
+ return { Status: 0, BytesSent: 0, BytesTotal: 0 };
975
+ }
976
+ exports.SnapshotStatusResponse = {
977
+ encode(message, writer = minimal_1.default.Writer.create()) {
978
+ if (message.Status !== 0) {
979
+ writer.uint32(8).int32(message.Status);
980
+ }
981
+ if (message.BytesSent !== 0) {
982
+ writer.uint32(16).uint64(message.BytesSent);
983
+ }
984
+ if (message.BytesTotal !== 0) {
985
+ writer.uint32(24).uint64(message.BytesTotal);
986
+ }
987
+ return writer;
988
+ },
989
+ decode(input, length) {
990
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
991
+ let end = length === undefined ? reader.len : reader.pos + length;
992
+ const message = createBaseSnapshotStatusResponse();
993
+ while (reader.pos < end) {
994
+ const tag = reader.uint32();
995
+ switch (tag >>> 3) {
996
+ case 1:
997
+ if (tag !== 8) {
998
+ break;
999
+ }
1000
+ message.Status = reader.int32();
1001
+ continue;
1002
+ case 2:
1003
+ if (tag !== 16) {
1004
+ break;
1005
+ }
1006
+ message.BytesSent = longToNumber(reader.uint64());
1007
+ continue;
1008
+ case 3:
1009
+ if (tag !== 24) {
1010
+ break;
1011
+ }
1012
+ message.BytesTotal = longToNumber(reader.uint64());
1013
+ continue;
1014
+ }
1015
+ if ((tag & 7) === 4 || tag === 0) {
1016
+ break;
1017
+ }
1018
+ reader.skipType(tag & 7);
1019
+ }
1020
+ return message;
1021
+ },
1022
+ fromJSON(object) {
1023
+ return {
1024
+ Status: isSet(object.Status) ? snapshotManagerStatusFromJSON(object.Status) : 0,
1025
+ BytesSent: isSet(object.BytesSent) ? Number(object.BytesSent) : 0,
1026
+ BytesTotal: isSet(object.BytesTotal) ? Number(object.BytesTotal) : 0,
1027
+ };
1028
+ },
1029
+ toJSON(message) {
1030
+ const obj = {};
1031
+ if (message.Status !== 0) {
1032
+ obj.Status = snapshotManagerStatusToJSON(message.Status);
1033
+ }
1034
+ if (message.BytesSent !== 0) {
1035
+ obj.BytesSent = Math.round(message.BytesSent);
1036
+ }
1037
+ if (message.BytesTotal !== 0) {
1038
+ obj.BytesTotal = Math.round(message.BytesTotal);
1039
+ }
1040
+ return obj;
1041
+ },
1042
+ create(base) {
1043
+ return exports.SnapshotStatusResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1044
+ },
1045
+ fromPartial(object) {
1046
+ var _a, _b, _c;
1047
+ const message = createBaseSnapshotStatusResponse();
1048
+ message.Status = (_a = object.Status) !== null && _a !== void 0 ? _a : 0;
1049
+ message.BytesSent = (_b = object.BytesSent) !== null && _b !== void 0 ? _b : 0;
1050
+ message.BytesTotal = (_c = object.BytesTotal) !== null && _c !== void 0 ? _c : 0;
1051
+ return message;
1052
+ },
1053
+ };
1054
+ class OSSnapshotServiceClientImpl {
1055
+ constructor(rpc) {
1056
+ this.rpc = rpc;
1057
+ this.BackupPoolAdd = this.BackupPoolAdd.bind(this);
1058
+ this.BackupPoolDel = this.BackupPoolDel.bind(this);
1059
+ this.BackupPoolList = this.BackupPoolList.bind(this);
1060
+ this.DatasetAdd = this.DatasetAdd.bind(this);
1061
+ this.DatasetDel = this.DatasetDel.bind(this);
1062
+ this.DatasetList = this.DatasetList.bind(this);
1063
+ this.DatasetBackupDel = this.DatasetBackupDel.bind(this);
1064
+ this.DatasetBackupList = this.DatasetBackupList.bind(this);
1065
+ this.SnapshotAdd = this.SnapshotAdd.bind(this);
1066
+ this.SnapshotDel = this.SnapshotDel.bind(this);
1067
+ this.SnapshotList = this.SnapshotList.bind(this);
1068
+ this.SnapshotRestore = this.SnapshotRestore.bind(this);
1069
+ this.SnapshotBackupAdd = this.SnapshotBackupAdd.bind(this);
1070
+ this.SnapshotBackupDel = this.SnapshotBackupDel.bind(this);
1071
+ this.SnapshotBackupList = this.SnapshotBackupList.bind(this);
1072
+ this.SnapshotBackupRestore = this.SnapshotBackupRestore.bind(this);
1073
+ this.GetStatus = this.GetStatus.bind(this);
1074
+ this.StopTransfer = this.StopTransfer.bind(this);
1075
+ }
1076
+ BackupPoolAdd(request, metadata, abortSignal) {
1077
+ return this.rpc.unary(exports.OSSnapshotServiceBackupPoolAddDesc, exports.SnapshotBackupPoolRequest.fromPartial(request), metadata, abortSignal);
1078
+ }
1079
+ BackupPoolDel(request, metadata, abortSignal) {
1080
+ return this.rpc.unary(exports.OSSnapshotServiceBackupPoolDelDesc, exports.SnapshotBackupPoolRequest.fromPartial(request), metadata, abortSignal);
1081
+ }
1082
+ BackupPoolList(request, metadata, abortSignal) {
1083
+ return this.rpc.unary(exports.OSSnapshotServiceBackupPoolListDesc, empty_1.Empty.fromPartial(request), metadata, abortSignal);
1084
+ }
1085
+ DatasetAdd(request, metadata, abortSignal) {
1086
+ return this.rpc.unary(exports.OSSnapshotServiceDatasetAddDesc, exports.SnapshotDatasetRequest.fromPartial(request), metadata, abortSignal);
1087
+ }
1088
+ DatasetDel(request, metadata, abortSignal) {
1089
+ return this.rpc.unary(exports.OSSnapshotServiceDatasetDelDesc, exports.SnapshotDatasetRequest.fromPartial(request), metadata, abortSignal);
1090
+ }
1091
+ DatasetList(request, metadata, abortSignal) {
1092
+ return this.rpc.unary(exports.OSSnapshotServiceDatasetListDesc, empty_1.Empty.fromPartial(request), metadata, abortSignal);
1093
+ }
1094
+ DatasetBackupDel(request, metadata, abortSignal) {
1095
+ return this.rpc.unary(exports.OSSnapshotServiceDatasetBackupDelDesc, exports.SnapshotDatasetBackupRequest.fromPartial(request), metadata, abortSignal);
1096
+ }
1097
+ DatasetBackupList(request, metadata, abortSignal) {
1098
+ return this.rpc.unary(exports.OSSnapshotServiceDatasetBackupListDesc, exports.SnapshotBackupPoolRequest.fromPartial(request), metadata, abortSignal);
1099
+ }
1100
+ SnapshotAdd(request, metadata, abortSignal) {
1101
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotAddDesc, exports.SnapshotRequest.fromPartial(request), metadata, abortSignal);
1102
+ }
1103
+ SnapshotDel(request, metadata, abortSignal) {
1104
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotDelDesc, exports.SnapshotRequest.fromPartial(request), metadata, abortSignal);
1105
+ }
1106
+ SnapshotList(request, metadata, abortSignal) {
1107
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotListDesc, exports.SnapshotDatasetRequest.fromPartial(request), metadata, abortSignal);
1108
+ }
1109
+ SnapshotRestore(request, metadata, abortSignal) {
1110
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotRestoreDesc, exports.SnapshotRequest.fromPartial(request), metadata, abortSignal);
1111
+ }
1112
+ SnapshotBackupAdd(request, metadata, abortSignal) {
1113
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotBackupAddDesc, exports.SnapshotBackupTransferRequest.fromPartial(request), metadata, abortSignal);
1114
+ }
1115
+ SnapshotBackupDel(request, metadata, abortSignal) {
1116
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotBackupDelDesc, exports.SnapshotBackupRequest.fromPartial(request), metadata, abortSignal);
1117
+ }
1118
+ SnapshotBackupList(request, metadata, abortSignal) {
1119
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotBackupListDesc, exports.SnapshotBackupListRequest.fromPartial(request), metadata, abortSignal);
1120
+ }
1121
+ SnapshotBackupRestore(request, metadata, abortSignal) {
1122
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotBackupRestoreDesc, exports.SnapshotBackupTransferRequest.fromPartial(request), metadata, abortSignal);
1123
+ }
1124
+ GetStatus(request, metadata, abortSignal) {
1125
+ return this.rpc.unary(exports.OSSnapshotServiceGetStatusDesc, empty_1.Empty.fromPartial(request), metadata, abortSignal);
1126
+ }
1127
+ StopTransfer(request, metadata, abortSignal) {
1128
+ return this.rpc.unary(exports.OSSnapshotServiceStopTransferDesc, empty_1.Empty.fromPartial(request), metadata, abortSignal);
1129
+ }
1130
+ }
1131
+ exports.OSSnapshotServiceClientImpl = OSSnapshotServiceClientImpl;
1132
+ exports.OSSnapshotServiceDesc = { serviceName: "cloud.lazycat.apis.sys.OSSnapshotService" };
1133
+ exports.OSSnapshotServiceBackupPoolAddDesc = {
1134
+ methodName: "BackupPoolAdd",
1135
+ service: exports.OSSnapshotServiceDesc,
1136
+ requestStream: false,
1137
+ responseStream: false,
1138
+ requestType: {
1139
+ serializeBinary() {
1140
+ return exports.SnapshotBackupPoolRequest.encode(this).finish();
1141
+ },
1142
+ },
1143
+ responseType: {
1144
+ deserializeBinary(data) {
1145
+ const value = empty_1.Empty.decode(data);
1146
+ return Object.assign(Object.assign({}, value), { toObject() {
1147
+ return value;
1148
+ } });
1149
+ },
1150
+ },
1151
+ };
1152
+ exports.OSSnapshotServiceBackupPoolDelDesc = {
1153
+ methodName: "BackupPoolDel",
1154
+ service: exports.OSSnapshotServiceDesc,
1155
+ requestStream: false,
1156
+ responseStream: false,
1157
+ requestType: {
1158
+ serializeBinary() {
1159
+ return exports.SnapshotBackupPoolRequest.encode(this).finish();
1160
+ },
1161
+ },
1162
+ responseType: {
1163
+ deserializeBinary(data) {
1164
+ const value = empty_1.Empty.decode(data);
1165
+ return Object.assign(Object.assign({}, value), { toObject() {
1166
+ return value;
1167
+ } });
1168
+ },
1169
+ },
1170
+ };
1171
+ exports.OSSnapshotServiceBackupPoolListDesc = {
1172
+ methodName: "BackupPoolList",
1173
+ service: exports.OSSnapshotServiceDesc,
1174
+ requestStream: false,
1175
+ responseStream: false,
1176
+ requestType: {
1177
+ serializeBinary() {
1178
+ return empty_1.Empty.encode(this).finish();
1179
+ },
1180
+ },
1181
+ responseType: {
1182
+ deserializeBinary(data) {
1183
+ const value = exports.SnapshotBackupPoolListResponse.decode(data);
1184
+ return Object.assign(Object.assign({}, value), { toObject() {
1185
+ return value;
1186
+ } });
1187
+ },
1188
+ },
1189
+ };
1190
+ exports.OSSnapshotServiceDatasetAddDesc = {
1191
+ methodName: "DatasetAdd",
1192
+ service: exports.OSSnapshotServiceDesc,
1193
+ requestStream: false,
1194
+ responseStream: false,
1195
+ requestType: {
1196
+ serializeBinary() {
1197
+ return exports.SnapshotDatasetRequest.encode(this).finish();
1198
+ },
1199
+ },
1200
+ responseType: {
1201
+ deserializeBinary(data) {
1202
+ const value = empty_1.Empty.decode(data);
1203
+ return Object.assign(Object.assign({}, value), { toObject() {
1204
+ return value;
1205
+ } });
1206
+ },
1207
+ },
1208
+ };
1209
+ exports.OSSnapshotServiceDatasetDelDesc = {
1210
+ methodName: "DatasetDel",
1211
+ service: exports.OSSnapshotServiceDesc,
1212
+ requestStream: false,
1213
+ responseStream: false,
1214
+ requestType: {
1215
+ serializeBinary() {
1216
+ return exports.SnapshotDatasetRequest.encode(this).finish();
1217
+ },
1218
+ },
1219
+ responseType: {
1220
+ deserializeBinary(data) {
1221
+ const value = empty_1.Empty.decode(data);
1222
+ return Object.assign(Object.assign({}, value), { toObject() {
1223
+ return value;
1224
+ } });
1225
+ },
1226
+ },
1227
+ };
1228
+ exports.OSSnapshotServiceDatasetListDesc = {
1229
+ methodName: "DatasetList",
1230
+ service: exports.OSSnapshotServiceDesc,
1231
+ requestStream: false,
1232
+ responseStream: false,
1233
+ requestType: {
1234
+ serializeBinary() {
1235
+ return empty_1.Empty.encode(this).finish();
1236
+ },
1237
+ },
1238
+ responseType: {
1239
+ deserializeBinary(data) {
1240
+ const value = exports.SnapshotDatasetListResponse.decode(data);
1241
+ return Object.assign(Object.assign({}, value), { toObject() {
1242
+ return value;
1243
+ } });
1244
+ },
1245
+ },
1246
+ };
1247
+ exports.OSSnapshotServiceDatasetBackupDelDesc = {
1248
+ methodName: "DatasetBackupDel",
1249
+ service: exports.OSSnapshotServiceDesc,
1250
+ requestStream: false,
1251
+ responseStream: false,
1252
+ requestType: {
1253
+ serializeBinary() {
1254
+ return exports.SnapshotDatasetBackupRequest.encode(this).finish();
1255
+ },
1256
+ },
1257
+ responseType: {
1258
+ deserializeBinary(data) {
1259
+ const value = empty_1.Empty.decode(data);
1260
+ return Object.assign(Object.assign({}, value), { toObject() {
1261
+ return value;
1262
+ } });
1263
+ },
1264
+ },
1265
+ };
1266
+ exports.OSSnapshotServiceDatasetBackupListDesc = {
1267
+ methodName: "DatasetBackupList",
1268
+ service: exports.OSSnapshotServiceDesc,
1269
+ requestStream: false,
1270
+ responseStream: false,
1271
+ requestType: {
1272
+ serializeBinary() {
1273
+ return exports.SnapshotBackupPoolRequest.encode(this).finish();
1274
+ },
1275
+ },
1276
+ responseType: {
1277
+ deserializeBinary(data) {
1278
+ const value = exports.SnapshotDatasetListResponse.decode(data);
1279
+ return Object.assign(Object.assign({}, value), { toObject() {
1280
+ return value;
1281
+ } });
1282
+ },
1283
+ },
1284
+ };
1285
+ exports.OSSnapshotServiceSnapshotAddDesc = {
1286
+ methodName: "SnapshotAdd",
1287
+ service: exports.OSSnapshotServiceDesc,
1288
+ requestStream: false,
1289
+ responseStream: false,
1290
+ requestType: {
1291
+ serializeBinary() {
1292
+ return exports.SnapshotRequest.encode(this).finish();
1293
+ },
1294
+ },
1295
+ responseType: {
1296
+ deserializeBinary(data) {
1297
+ const value = empty_1.Empty.decode(data);
1298
+ return Object.assign(Object.assign({}, value), { toObject() {
1299
+ return value;
1300
+ } });
1301
+ },
1302
+ },
1303
+ };
1304
+ exports.OSSnapshotServiceSnapshotDelDesc = {
1305
+ methodName: "SnapshotDel",
1306
+ service: exports.OSSnapshotServiceDesc,
1307
+ requestStream: false,
1308
+ responseStream: false,
1309
+ requestType: {
1310
+ serializeBinary() {
1311
+ return exports.SnapshotRequest.encode(this).finish();
1312
+ },
1313
+ },
1314
+ responseType: {
1315
+ deserializeBinary(data) {
1316
+ const value = empty_1.Empty.decode(data);
1317
+ return Object.assign(Object.assign({}, value), { toObject() {
1318
+ return value;
1319
+ } });
1320
+ },
1321
+ },
1322
+ };
1323
+ exports.OSSnapshotServiceSnapshotListDesc = {
1324
+ methodName: "SnapshotList",
1325
+ service: exports.OSSnapshotServiceDesc,
1326
+ requestStream: false,
1327
+ responseStream: false,
1328
+ requestType: {
1329
+ serializeBinary() {
1330
+ return exports.SnapshotDatasetRequest.encode(this).finish();
1331
+ },
1332
+ },
1333
+ responseType: {
1334
+ deserializeBinary(data) {
1335
+ const value = exports.SnapshotListResponse.decode(data);
1336
+ return Object.assign(Object.assign({}, value), { toObject() {
1337
+ return value;
1338
+ } });
1339
+ },
1340
+ },
1341
+ };
1342
+ exports.OSSnapshotServiceSnapshotRestoreDesc = {
1343
+ methodName: "SnapshotRestore",
1344
+ service: exports.OSSnapshotServiceDesc,
1345
+ requestStream: false,
1346
+ responseStream: false,
1347
+ requestType: {
1348
+ serializeBinary() {
1349
+ return exports.SnapshotRequest.encode(this).finish();
1350
+ },
1351
+ },
1352
+ responseType: {
1353
+ deserializeBinary(data) {
1354
+ const value = empty_1.Empty.decode(data);
1355
+ return Object.assign(Object.assign({}, value), { toObject() {
1356
+ return value;
1357
+ } });
1358
+ },
1359
+ },
1360
+ };
1361
+ exports.OSSnapshotServiceSnapshotBackupAddDesc = {
1362
+ methodName: "SnapshotBackupAdd",
1363
+ service: exports.OSSnapshotServiceDesc,
1364
+ requestStream: false,
1365
+ responseStream: false,
1366
+ requestType: {
1367
+ serializeBinary() {
1368
+ return exports.SnapshotBackupTransferRequest.encode(this).finish();
1369
+ },
1370
+ },
1371
+ responseType: {
1372
+ deserializeBinary(data) {
1373
+ const value = exports.SnapshotBackupTransferResponse.decode(data);
1374
+ return Object.assign(Object.assign({}, value), { toObject() {
1375
+ return value;
1376
+ } });
1377
+ },
1378
+ },
1379
+ };
1380
+ exports.OSSnapshotServiceSnapshotBackupDelDesc = {
1381
+ methodName: "SnapshotBackupDel",
1382
+ service: exports.OSSnapshotServiceDesc,
1383
+ requestStream: false,
1384
+ responseStream: false,
1385
+ requestType: {
1386
+ serializeBinary() {
1387
+ return exports.SnapshotBackupRequest.encode(this).finish();
1388
+ },
1389
+ },
1390
+ responseType: {
1391
+ deserializeBinary(data) {
1392
+ const value = empty_1.Empty.decode(data);
1393
+ return Object.assign(Object.assign({}, value), { toObject() {
1394
+ return value;
1395
+ } });
1396
+ },
1397
+ },
1398
+ };
1399
+ exports.OSSnapshotServiceSnapshotBackupListDesc = {
1400
+ methodName: "SnapshotBackupList",
1401
+ service: exports.OSSnapshotServiceDesc,
1402
+ requestStream: false,
1403
+ responseStream: false,
1404
+ requestType: {
1405
+ serializeBinary() {
1406
+ return exports.SnapshotBackupListRequest.encode(this).finish();
1407
+ },
1408
+ },
1409
+ responseType: {
1410
+ deserializeBinary(data) {
1411
+ const value = exports.SnapshotListResponse.decode(data);
1412
+ return Object.assign(Object.assign({}, value), { toObject() {
1413
+ return value;
1414
+ } });
1415
+ },
1416
+ },
1417
+ };
1418
+ exports.OSSnapshotServiceSnapshotBackupRestoreDesc = {
1419
+ methodName: "SnapshotBackupRestore",
1420
+ service: exports.OSSnapshotServiceDesc,
1421
+ requestStream: false,
1422
+ responseStream: false,
1423
+ requestType: {
1424
+ serializeBinary() {
1425
+ return exports.SnapshotBackupTransferRequest.encode(this).finish();
1426
+ },
1427
+ },
1428
+ responseType: {
1429
+ deserializeBinary(data) {
1430
+ const value = exports.SnapshotBackupTransferResponse.decode(data);
1431
+ return Object.assign(Object.assign({}, value), { toObject() {
1432
+ return value;
1433
+ } });
1434
+ },
1435
+ },
1436
+ };
1437
+ exports.OSSnapshotServiceGetStatusDesc = {
1438
+ methodName: "GetStatus",
1439
+ service: exports.OSSnapshotServiceDesc,
1440
+ requestStream: false,
1441
+ responseStream: false,
1442
+ requestType: {
1443
+ serializeBinary() {
1444
+ return empty_1.Empty.encode(this).finish();
1445
+ },
1446
+ },
1447
+ responseType: {
1448
+ deserializeBinary(data) {
1449
+ const value = exports.SnapshotStatusResponse.decode(data);
1450
+ return Object.assign(Object.assign({}, value), { toObject() {
1451
+ return value;
1452
+ } });
1453
+ },
1454
+ },
1455
+ };
1456
+ exports.OSSnapshotServiceStopTransferDesc = {
1457
+ methodName: "StopTransfer",
1458
+ service: exports.OSSnapshotServiceDesc,
1459
+ requestStream: false,
1460
+ responseStream: false,
1461
+ requestType: {
1462
+ serializeBinary() {
1463
+ return empty_1.Empty.encode(this).finish();
1464
+ },
1465
+ },
1466
+ responseType: {
1467
+ deserializeBinary(data) {
1468
+ const value = empty_1.Empty.decode(data);
1469
+ return Object.assign(Object.assign({}, value), { toObject() {
1470
+ return value;
1471
+ } });
1472
+ },
1473
+ },
1474
+ };
1475
+ class GrpcWebImpl {
1476
+ constructor(host, options) {
1477
+ this.host = host;
1478
+ this.options = options;
1479
+ }
1480
+ unary(methodDesc, _request, metadata, abortSignal) {
1481
+ var _a;
1482
+ const request = Object.assign(Object.assign({}, _request), methodDesc.requestType);
1483
+ const maybeCombinedMetadata = metadata && this.options.metadata
1484
+ ? new browser_headers_1.BrowserHeaders(Object.assign(Object.assign({}, (_a = this.options) === null || _a === void 0 ? void 0 : _a.metadata.headersMap), metadata === null || metadata === void 0 ? void 0 : metadata.headersMap))
1485
+ : metadata !== null && metadata !== void 0 ? metadata : this.options.metadata;
1486
+ return new Promise((resolve, reject) => {
1487
+ var _a;
1488
+ const client = grpc_web_1.grpc.unary(methodDesc, Object.assign(Object.assign({ request, host: this.host, metadata: maybeCombinedMetadata !== null && maybeCombinedMetadata !== void 0 ? maybeCombinedMetadata : {} }, (this.options.transport !== undefined ? { transport: this.options.transport } : {})), { debug: (_a = this.options.debug) !== null && _a !== void 0 ? _a : false, onEnd: function (response) {
1489
+ if (response.status === grpc_web_1.grpc.Code.OK) {
1490
+ resolve(response.message.toObject());
1491
+ }
1492
+ else {
1493
+ const err = new GrpcWebError(response.statusMessage, response.status, response.trailers);
1494
+ reject(err);
1495
+ }
1496
+ } }));
1497
+ if (abortSignal) {
1498
+ abortSignal.addEventListener("abort", () => {
1499
+ client.close();
1500
+ reject(abortSignal.reason);
1501
+ });
1502
+ }
1503
+ });
1504
+ }
1505
+ }
1506
+ exports.GrpcWebImpl = GrpcWebImpl;
1507
+ const tsProtoGlobalThis = (() => {
1508
+ if (typeof globalThis !== "undefined") {
1509
+ return globalThis;
1510
+ }
1511
+ if (typeof self !== "undefined") {
1512
+ return self;
1513
+ }
1514
+ if (typeof window !== "undefined") {
1515
+ return window;
1516
+ }
1517
+ if (typeof global !== "undefined") {
1518
+ return global;
1519
+ }
1520
+ throw "Unable to locate global object";
1521
+ })();
1522
+ function longToNumber(long) {
1523
+ if (long.gt(Number.MAX_SAFE_INTEGER)) {
1524
+ throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1525
+ }
1526
+ return long.toNumber();
1527
+ }
1528
+ if (minimal_1.default.util.Long !== long_1.default) {
1529
+ minimal_1.default.util.Long = long_1.default;
1530
+ minimal_1.default.configure();
1531
+ }
1532
+ function isSet(value) {
1533
+ return value !== null && value !== undefined;
1534
+ }
1535
+ class GrpcWebError extends tsProtoGlobalThis.Error {
1536
+ constructor(message, code, metadata) {
1537
+ super(message);
1538
+ this.code = code;
1539
+ this.metadata = metadata;
1540
+ }
1541
+ }
1542
+ exports.GrpcWebError = GrpcWebError;
1543
+ //# sourceMappingURL=OS_snapshot.js.map