@lazycatcloud/sdk 0.1.14 → 0.1.15

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