@lazycatcloud/sdk 0.1.15 → 0.1.18

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