@lazycatcloud/sdk 0.1.1

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 +142 -0
  2. package/dist/common/box.d.ts.map +1 -0
  3. package/dist/common/box.js +440 -0
  4. package/dist/common/box.js.map +1 -0
  5. package/dist/common/browseronly.d.ts +126 -0
  6. package/dist/common/browseronly.d.ts.map +1 -0
  7. package/dist/common/browseronly.js +402 -0
  8. package/dist/common/browseronly.js.map +1 -0
  9. package/dist/common/end_device.d.ts +179 -0
  10. package/dist/common/end_device.d.ts.map +1 -0
  11. package/dist/common/end_device.js +418 -0
  12. package/dist/common/end_device.js.map +1 -0
  13. package/dist/common/gateway.d.ts +198 -0
  14. package/dist/common/gateway.d.ts.map +1 -0
  15. package/dist/common/gateway.js +535 -0
  16. package/dist/common/gateway.js.map +1 -0
  17. package/dist/common/peripheral_device.d.ts +179 -0
  18. package/dist/common/peripheral_device.d.ts.map +1 -0
  19. package/dist/common/peripheral_device.js +387 -0
  20. package/dist/common/peripheral_device.js.map +1 -0
  21. package/dist/common/permissions.d.ts +135 -0
  22. package/dist/common/permissions.d.ts.map +1 -0
  23. package/dist/common/permissions.js +446 -0
  24. package/dist/common/permissions.js.map +1 -0
  25. package/dist/common/security_context.d.ts +197 -0
  26. package/dist/common/security_context.d.ts.map +1 -0
  27. package/dist/common/security_context.js +614 -0
  28. package/dist/common/security_context.js.map +1 -0
  29. package/dist/common/users.d.ts +248 -0
  30. package/dist/common/users.d.ts.map +1 -0
  31. package/dist/common/users.js +817 -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 +3117 -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 +42 -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 +88 -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 +34 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +102 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/localdevice/clipboard.d.ts +104 -0
  54. package/dist/localdevice/clipboard.d.ts.map +1 -0
  55. package/dist/localdevice/clipboard.js +372 -0
  56. package/dist/localdevice/clipboard.js.map +1 -0
  57. package/dist/localdevice/dialog.d.ts +131 -0
  58. package/dist/localdevice/dialog.d.ts.map +1 -0
  59. package/dist/localdevice/dialog.js +392 -0
  60. package/dist/localdevice/dialog.js.map +1 -0
  61. package/dist/localdevice/network.d.ts +71 -0
  62. package/dist/localdevice/network.d.ts.map +1 -0
  63. package/dist/localdevice/network.js +209 -0
  64. package/dist/localdevice/network.js.map +1 -0
  65. package/dist/localdevice/photo.d.ts +520 -0
  66. package/dist/localdevice/photo.d.ts.map +1 -0
  67. package/dist/localdevice/photo.js +1408 -0
  68. package/dist/localdevice/photo.js.map +1 -0
  69. package/dist/package.json +24 -0
  70. package/dist/security_context.d.ts +135 -0
  71. package/dist/security_context.d.ts.map +1 -0
  72. package/dist/security_context.js +446 -0
  73. package/dist/security_context.js.map +1 -0
  74. package/dist/sys/OS_snapshot.d.ts +302 -0
  75. package/dist/sys/OS_snapshot.d.ts.map +1 -0
  76. package/dist/sys/OS_snapshot.js +1088 -0
  77. package/dist/sys/OS_snapshot.js.map +1 -0
  78. package/dist/sys/OS_upgrader.d.ts +178 -0
  79. package/dist/sys/OS_upgrader.d.ts.map +1 -0
  80. package/dist/sys/OS_upgrader.js +617 -0
  81. package/dist/sys/OS_upgrader.js.map +1 -0
  82. package/dist/sys/hc-core/hc-core.d.ts +472 -0
  83. package/dist/sys/hc-core/hc-core.d.ts.map +1 -0
  84. package/dist/sys/hc-core/hc-core.js +1315 -0
  85. package/dist/sys/hc-core/hc-core.js.map +1 -0
  86. package/dist/sys/ingress.d.ts +183 -0
  87. package/dist/sys/ingress.d.ts.map +1 -0
  88. package/dist/sys/ingress.js +619 -0
  89. package/dist/sys/ingress.js.map +1 -0
  90. package/dist/sys/package_manager.d.ts +298 -0
  91. package/dist/sys/package_manager.d.ts.map +1 -0
  92. package/dist/sys/package_manager.js +800 -0
  93. package/dist/sys/package_manager.js.map +1 -0
  94. package/dist/sys/portal-server/portal-server.d.ts +445 -0
  95. package/dist/sys/portal-server/portal-server.d.ts.map +1 -0
  96. package/dist/sys/portal-server/portal-server.js +1333 -0
  97. package/dist/sys/portal-server/portal-server.js.map +1 -0
  98. package/package.json +24 -0
@@ -0,0 +1,1088 @@
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.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.SnapshotBackupTransferRequest = exports.SnapshotBackupRequest = exports.SnapshotListResponse = exports.SnapshotRequest = exports.SnapshotDatasetListResponse = exports.SnapshotDatasetBackupRequest = exports.SnapshotDatasetRequest = exports.SnapshotBackupPoolListResponse = exports.SnapshotBackupPoolRequest = 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 minimal_1 = __importDefault(require("protobufjs/minimal"));
12
+ var SnapshotManagerStatus;
13
+ (function (SnapshotManagerStatus) {
14
+ SnapshotManagerStatus[SnapshotManagerStatus["Stopped"] = 0] = "Stopped";
15
+ SnapshotManagerStatus[SnapshotManagerStatus["Running"] = 1] = "Running";
16
+ SnapshotManagerStatus[SnapshotManagerStatus["Waiting"] = 2] = "Waiting";
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 2:
28
+ case "Waiting":
29
+ return SnapshotManagerStatus.Waiting;
30
+ case -1:
31
+ case "UNRECOGNIZED":
32
+ default:
33
+ return SnapshotManagerStatus.UNRECOGNIZED;
34
+ }
35
+ }
36
+ exports.snapshotManagerStatusFromJSON = snapshotManagerStatusFromJSON;
37
+ function snapshotManagerStatusToJSON(object) {
38
+ switch (object) {
39
+ case SnapshotManagerStatus.Stopped:
40
+ return "Stopped";
41
+ case SnapshotManagerStatus.Running:
42
+ return "Running";
43
+ case SnapshotManagerStatus.Waiting:
44
+ return "Waiting";
45
+ case SnapshotManagerStatus.UNRECOGNIZED:
46
+ default:
47
+ return "UNRECOGNIZED";
48
+ }
49
+ }
50
+ exports.snapshotManagerStatusToJSON = snapshotManagerStatusToJSON;
51
+ function createBaseSnapshotBackupPoolRequest() {
52
+ return { PoolName: "" };
53
+ }
54
+ exports.SnapshotBackupPoolRequest = {
55
+ encode(message, writer = minimal_1.default.Writer.create()) {
56
+ if (message.PoolName !== "") {
57
+ writer.uint32(10).string(message.PoolName);
58
+ }
59
+ return writer;
60
+ },
61
+ decode(input, length) {
62
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
63
+ let end = length === undefined ? reader.len : reader.pos + length;
64
+ const message = createBaseSnapshotBackupPoolRequest();
65
+ while (reader.pos < end) {
66
+ const tag = reader.uint32();
67
+ switch (tag >>> 3) {
68
+ case 1:
69
+ message.PoolName = reader.string();
70
+ break;
71
+ default:
72
+ reader.skipType(tag & 7);
73
+ break;
74
+ }
75
+ }
76
+ return message;
77
+ },
78
+ fromJSON(object) {
79
+ return {
80
+ PoolName: isSet(object.PoolName) ? String(object.PoolName) : "",
81
+ };
82
+ },
83
+ toJSON(message) {
84
+ const obj = {};
85
+ message.PoolName !== undefined && (obj.PoolName = message.PoolName);
86
+ return obj;
87
+ },
88
+ fromPartial(object) {
89
+ var _a;
90
+ const message = createBaseSnapshotBackupPoolRequest();
91
+ message.PoolName = (_a = object.PoolName) !== null && _a !== void 0 ? _a : "";
92
+ return message;
93
+ },
94
+ };
95
+ function createBaseSnapshotBackupPoolListResponse() {
96
+ return { PoolNameList: [] };
97
+ }
98
+ exports.SnapshotBackupPoolListResponse = {
99
+ encode(message, writer = minimal_1.default.Writer.create()) {
100
+ for (const v of message.PoolNameList) {
101
+ writer.uint32(10).string(v);
102
+ }
103
+ return writer;
104
+ },
105
+ decode(input, length) {
106
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
107
+ let end = length === undefined ? reader.len : reader.pos + length;
108
+ const message = createBaseSnapshotBackupPoolListResponse();
109
+ while (reader.pos < end) {
110
+ const tag = reader.uint32();
111
+ switch (tag >>> 3) {
112
+ case 1:
113
+ message.PoolNameList.push(reader.string());
114
+ break;
115
+ default:
116
+ reader.skipType(tag & 7);
117
+ break;
118
+ }
119
+ }
120
+ return message;
121
+ },
122
+ fromJSON(object) {
123
+ return {
124
+ PoolNameList: Array.isArray(object === null || object === void 0 ? void 0 : object.PoolNameList)
125
+ ? object.PoolNameList.map((e) => String(e))
126
+ : [],
127
+ };
128
+ },
129
+ toJSON(message) {
130
+ const obj = {};
131
+ if (message.PoolNameList) {
132
+ obj.PoolNameList = message.PoolNameList.map((e) => e);
133
+ }
134
+ else {
135
+ obj.PoolNameList = [];
136
+ }
137
+ return obj;
138
+ },
139
+ fromPartial(object) {
140
+ var _a;
141
+ const message = createBaseSnapshotBackupPoolListResponse();
142
+ message.PoolNameList = ((_a = object.PoolNameList) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
143
+ return message;
144
+ },
145
+ };
146
+ function createBaseSnapshotDatasetRequest() {
147
+ return { DatasetPath: "" };
148
+ }
149
+ exports.SnapshotDatasetRequest = {
150
+ encode(message, writer = minimal_1.default.Writer.create()) {
151
+ if (message.DatasetPath !== "") {
152
+ writer.uint32(10).string(message.DatasetPath);
153
+ }
154
+ return writer;
155
+ },
156
+ decode(input, length) {
157
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
158
+ let end = length === undefined ? reader.len : reader.pos + length;
159
+ const message = createBaseSnapshotDatasetRequest();
160
+ while (reader.pos < end) {
161
+ const tag = reader.uint32();
162
+ switch (tag >>> 3) {
163
+ case 1:
164
+ message.DatasetPath = reader.string();
165
+ break;
166
+ default:
167
+ reader.skipType(tag & 7);
168
+ break;
169
+ }
170
+ }
171
+ return message;
172
+ },
173
+ fromJSON(object) {
174
+ return {
175
+ DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "",
176
+ };
177
+ },
178
+ toJSON(message) {
179
+ const obj = {};
180
+ message.DatasetPath !== undefined &&
181
+ (obj.DatasetPath = message.DatasetPath);
182
+ return obj;
183
+ },
184
+ fromPartial(object) {
185
+ var _a;
186
+ const message = createBaseSnapshotDatasetRequest();
187
+ message.DatasetPath = (_a = object.DatasetPath) !== null && _a !== void 0 ? _a : "";
188
+ return message;
189
+ },
190
+ };
191
+ function createBaseSnapshotDatasetBackupRequest() {
192
+ return { PoolName: "", DatasetPath: "" };
193
+ }
194
+ exports.SnapshotDatasetBackupRequest = {
195
+ encode(message, writer = minimal_1.default.Writer.create()) {
196
+ if (message.PoolName !== "") {
197
+ writer.uint32(10).string(message.PoolName);
198
+ }
199
+ if (message.DatasetPath !== "") {
200
+ writer.uint32(18).string(message.DatasetPath);
201
+ }
202
+ return writer;
203
+ },
204
+ decode(input, length) {
205
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
206
+ let end = length === undefined ? reader.len : reader.pos + length;
207
+ const message = createBaseSnapshotDatasetBackupRequest();
208
+ while (reader.pos < end) {
209
+ const tag = reader.uint32();
210
+ switch (tag >>> 3) {
211
+ case 1:
212
+ message.PoolName = reader.string();
213
+ break;
214
+ case 2:
215
+ message.DatasetPath = reader.string();
216
+ break;
217
+ default:
218
+ reader.skipType(tag & 7);
219
+ break;
220
+ }
221
+ }
222
+ return message;
223
+ },
224
+ fromJSON(object) {
225
+ return {
226
+ PoolName: isSet(object.PoolName) ? String(object.PoolName) : "",
227
+ DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "",
228
+ };
229
+ },
230
+ toJSON(message) {
231
+ const obj = {};
232
+ message.PoolName !== undefined && (obj.PoolName = message.PoolName);
233
+ message.DatasetPath !== undefined &&
234
+ (obj.DatasetPath = message.DatasetPath);
235
+ return obj;
236
+ },
237
+ fromPartial(object) {
238
+ var _a, _b;
239
+ const message = createBaseSnapshotDatasetBackupRequest();
240
+ message.PoolName = (_a = object.PoolName) !== null && _a !== void 0 ? _a : "";
241
+ message.DatasetPath = (_b = object.DatasetPath) !== null && _b !== void 0 ? _b : "";
242
+ return message;
243
+ },
244
+ };
245
+ function createBaseSnapshotDatasetListResponse() {
246
+ return { DatasetPathList: [] };
247
+ }
248
+ exports.SnapshotDatasetListResponse = {
249
+ encode(message, writer = minimal_1.default.Writer.create()) {
250
+ for (const v of message.DatasetPathList) {
251
+ writer.uint32(10).string(v);
252
+ }
253
+ return writer;
254
+ },
255
+ decode(input, length) {
256
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
257
+ let end = length === undefined ? reader.len : reader.pos + length;
258
+ const message = createBaseSnapshotDatasetListResponse();
259
+ while (reader.pos < end) {
260
+ const tag = reader.uint32();
261
+ switch (tag >>> 3) {
262
+ case 1:
263
+ message.DatasetPathList.push(reader.string());
264
+ break;
265
+ default:
266
+ reader.skipType(tag & 7);
267
+ break;
268
+ }
269
+ }
270
+ return message;
271
+ },
272
+ fromJSON(object) {
273
+ return {
274
+ DatasetPathList: Array.isArray(object === null || object === void 0 ? void 0 : object.DatasetPathList)
275
+ ? object.DatasetPathList.map((e) => String(e))
276
+ : [],
277
+ };
278
+ },
279
+ toJSON(message) {
280
+ const obj = {};
281
+ if (message.DatasetPathList) {
282
+ obj.DatasetPathList = message.DatasetPathList.map((e) => e);
283
+ }
284
+ else {
285
+ obj.DatasetPathList = [];
286
+ }
287
+ return obj;
288
+ },
289
+ fromPartial(object) {
290
+ var _a;
291
+ const message = createBaseSnapshotDatasetListResponse();
292
+ message.DatasetPathList = ((_a = object.DatasetPathList) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
293
+ return message;
294
+ },
295
+ };
296
+ function createBaseSnapshotRequest() {
297
+ return { DatasetPath: "", SnapshotName: "" };
298
+ }
299
+ exports.SnapshotRequest = {
300
+ encode(message, writer = minimal_1.default.Writer.create()) {
301
+ if (message.DatasetPath !== "") {
302
+ writer.uint32(10).string(message.DatasetPath);
303
+ }
304
+ if (message.SnapshotName !== "") {
305
+ writer.uint32(18).string(message.SnapshotName);
306
+ }
307
+ return writer;
308
+ },
309
+ decode(input, length) {
310
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
311
+ let end = length === undefined ? reader.len : reader.pos + length;
312
+ const message = createBaseSnapshotRequest();
313
+ while (reader.pos < end) {
314
+ const tag = reader.uint32();
315
+ switch (tag >>> 3) {
316
+ case 1:
317
+ message.DatasetPath = reader.string();
318
+ break;
319
+ case 2:
320
+ message.SnapshotName = reader.string();
321
+ break;
322
+ default:
323
+ reader.skipType(tag & 7);
324
+ break;
325
+ }
326
+ }
327
+ return message;
328
+ },
329
+ fromJSON(object) {
330
+ return {
331
+ DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "",
332
+ SnapshotName: isSet(object.SnapshotName)
333
+ ? String(object.SnapshotName)
334
+ : "",
335
+ };
336
+ },
337
+ toJSON(message) {
338
+ const obj = {};
339
+ message.DatasetPath !== undefined &&
340
+ (obj.DatasetPath = message.DatasetPath);
341
+ message.SnapshotName !== undefined &&
342
+ (obj.SnapshotName = message.SnapshotName);
343
+ return obj;
344
+ },
345
+ fromPartial(object) {
346
+ var _a, _b;
347
+ const message = createBaseSnapshotRequest();
348
+ message.DatasetPath = (_a = object.DatasetPath) !== null && _a !== void 0 ? _a : "";
349
+ message.SnapshotName = (_b = object.SnapshotName) !== null && _b !== void 0 ? _b : "";
350
+ return message;
351
+ },
352
+ };
353
+ function createBaseSnapshotListResponse() {
354
+ return { SnapshotNameList: [] };
355
+ }
356
+ exports.SnapshotListResponse = {
357
+ encode(message, writer = minimal_1.default.Writer.create()) {
358
+ for (const v of message.SnapshotNameList) {
359
+ writer.uint32(10).string(v);
360
+ }
361
+ return writer;
362
+ },
363
+ decode(input, length) {
364
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
365
+ let end = length === undefined ? reader.len : reader.pos + length;
366
+ const message = createBaseSnapshotListResponse();
367
+ while (reader.pos < end) {
368
+ const tag = reader.uint32();
369
+ switch (tag >>> 3) {
370
+ case 1:
371
+ message.SnapshotNameList.push(reader.string());
372
+ break;
373
+ default:
374
+ reader.skipType(tag & 7);
375
+ break;
376
+ }
377
+ }
378
+ return message;
379
+ },
380
+ fromJSON(object) {
381
+ return {
382
+ SnapshotNameList: Array.isArray(object === null || object === void 0 ? void 0 : object.SnapshotNameList)
383
+ ? object.SnapshotNameList.map((e) => String(e))
384
+ : [],
385
+ };
386
+ },
387
+ toJSON(message) {
388
+ const obj = {};
389
+ if (message.SnapshotNameList) {
390
+ obj.SnapshotNameList = message.SnapshotNameList.map((e) => e);
391
+ }
392
+ else {
393
+ obj.SnapshotNameList = [];
394
+ }
395
+ return obj;
396
+ },
397
+ fromPartial(object) {
398
+ var _a;
399
+ const message = createBaseSnapshotListResponse();
400
+ message.SnapshotNameList = ((_a = object.SnapshotNameList) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
401
+ return message;
402
+ },
403
+ };
404
+ function createBaseSnapshotBackupRequest() {
405
+ return { PoolName: "", DatasetPath: "", SnapshotName: "" };
406
+ }
407
+ exports.SnapshotBackupRequest = {
408
+ encode(message, writer = minimal_1.default.Writer.create()) {
409
+ if (message.PoolName !== "") {
410
+ writer.uint32(10).string(message.PoolName);
411
+ }
412
+ if (message.DatasetPath !== "") {
413
+ writer.uint32(18).string(message.DatasetPath);
414
+ }
415
+ if (message.SnapshotName !== "") {
416
+ writer.uint32(26).string(message.SnapshotName);
417
+ }
418
+ return writer;
419
+ },
420
+ decode(input, length) {
421
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
422
+ let end = length === undefined ? reader.len : reader.pos + length;
423
+ const message = createBaseSnapshotBackupRequest();
424
+ while (reader.pos < end) {
425
+ const tag = reader.uint32();
426
+ switch (tag >>> 3) {
427
+ case 1:
428
+ message.PoolName = reader.string();
429
+ break;
430
+ case 2:
431
+ message.DatasetPath = reader.string();
432
+ break;
433
+ case 3:
434
+ message.SnapshotName = reader.string();
435
+ break;
436
+ default:
437
+ reader.skipType(tag & 7);
438
+ break;
439
+ }
440
+ }
441
+ return message;
442
+ },
443
+ fromJSON(object) {
444
+ return {
445
+ PoolName: isSet(object.PoolName) ? String(object.PoolName) : "",
446
+ DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "",
447
+ SnapshotName: isSet(object.SnapshotName)
448
+ ? String(object.SnapshotName)
449
+ : "",
450
+ };
451
+ },
452
+ toJSON(message) {
453
+ const obj = {};
454
+ message.PoolName !== undefined && (obj.PoolName = message.PoolName);
455
+ message.DatasetPath !== undefined &&
456
+ (obj.DatasetPath = message.DatasetPath);
457
+ message.SnapshotName !== undefined &&
458
+ (obj.SnapshotName = message.SnapshotName);
459
+ return obj;
460
+ },
461
+ fromPartial(object) {
462
+ var _a, _b, _c;
463
+ const message = createBaseSnapshotBackupRequest();
464
+ message.PoolName = (_a = object.PoolName) !== null && _a !== void 0 ? _a : "";
465
+ message.DatasetPath = (_b = object.DatasetPath) !== null && _b !== void 0 ? _b : "";
466
+ message.SnapshotName = (_c = object.SnapshotName) !== null && _c !== void 0 ? _c : "";
467
+ return message;
468
+ },
469
+ };
470
+ function createBaseSnapshotBackupTransferRequest() {
471
+ return { PoolName: "", DatasetPath: "", SnapshotName: "", NoResume: false };
472
+ }
473
+ exports.SnapshotBackupTransferRequest = {
474
+ encode(message, writer = minimal_1.default.Writer.create()) {
475
+ if (message.PoolName !== "") {
476
+ writer.uint32(10).string(message.PoolName);
477
+ }
478
+ if (message.DatasetPath !== "") {
479
+ writer.uint32(18).string(message.DatasetPath);
480
+ }
481
+ if (message.SnapshotName !== "") {
482
+ writer.uint32(26).string(message.SnapshotName);
483
+ }
484
+ if (message.NoResume === true) {
485
+ writer.uint32(32).bool(message.NoResume);
486
+ }
487
+ return writer;
488
+ },
489
+ decode(input, length) {
490
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
491
+ let end = length === undefined ? reader.len : reader.pos + length;
492
+ const message = createBaseSnapshotBackupTransferRequest();
493
+ while (reader.pos < end) {
494
+ const tag = reader.uint32();
495
+ switch (tag >>> 3) {
496
+ case 1:
497
+ message.PoolName = reader.string();
498
+ break;
499
+ case 2:
500
+ message.DatasetPath = reader.string();
501
+ break;
502
+ case 3:
503
+ message.SnapshotName = reader.string();
504
+ break;
505
+ case 4:
506
+ message.NoResume = reader.bool();
507
+ break;
508
+ default:
509
+ reader.skipType(tag & 7);
510
+ break;
511
+ }
512
+ }
513
+ return message;
514
+ },
515
+ fromJSON(object) {
516
+ return {
517
+ PoolName: isSet(object.PoolName) ? String(object.PoolName) : "",
518
+ DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "",
519
+ SnapshotName: isSet(object.SnapshotName)
520
+ ? String(object.SnapshotName)
521
+ : "",
522
+ NoResume: isSet(object.NoResume) ? Boolean(object.NoResume) : false,
523
+ };
524
+ },
525
+ toJSON(message) {
526
+ const obj = {};
527
+ message.PoolName !== undefined && (obj.PoolName = message.PoolName);
528
+ message.DatasetPath !== undefined &&
529
+ (obj.DatasetPath = message.DatasetPath);
530
+ message.SnapshotName !== undefined &&
531
+ (obj.SnapshotName = message.SnapshotName);
532
+ message.NoResume !== undefined && (obj.NoResume = message.NoResume);
533
+ return obj;
534
+ },
535
+ fromPartial(object) {
536
+ var _a, _b, _c, _d;
537
+ const message = createBaseSnapshotBackupTransferRequest();
538
+ message.PoolName = (_a = object.PoolName) !== null && _a !== void 0 ? _a : "";
539
+ message.DatasetPath = (_b = object.DatasetPath) !== null && _b !== void 0 ? _b : "";
540
+ message.SnapshotName = (_c = object.SnapshotName) !== null && _c !== void 0 ? _c : "";
541
+ message.NoResume = (_d = object.NoResume) !== null && _d !== void 0 ? _d : false;
542
+ return message;
543
+ },
544
+ };
545
+ function createBaseSnapshotBackupListRequest() {
546
+ return { PoolName: "", DatasetPath: "" };
547
+ }
548
+ exports.SnapshotBackupListRequest = {
549
+ encode(message, writer = minimal_1.default.Writer.create()) {
550
+ if (message.PoolName !== "") {
551
+ writer.uint32(10).string(message.PoolName);
552
+ }
553
+ if (message.DatasetPath !== "") {
554
+ writer.uint32(18).string(message.DatasetPath);
555
+ }
556
+ return writer;
557
+ },
558
+ decode(input, length) {
559
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
560
+ let end = length === undefined ? reader.len : reader.pos + length;
561
+ const message = createBaseSnapshotBackupListRequest();
562
+ while (reader.pos < end) {
563
+ const tag = reader.uint32();
564
+ switch (tag >>> 3) {
565
+ case 1:
566
+ message.PoolName = reader.string();
567
+ break;
568
+ case 2:
569
+ message.DatasetPath = reader.string();
570
+ break;
571
+ default:
572
+ reader.skipType(tag & 7);
573
+ break;
574
+ }
575
+ }
576
+ return message;
577
+ },
578
+ fromJSON(object) {
579
+ return {
580
+ PoolName: isSet(object.PoolName) ? String(object.PoolName) : "",
581
+ DatasetPath: isSet(object.DatasetPath) ? String(object.DatasetPath) : "",
582
+ };
583
+ },
584
+ toJSON(message) {
585
+ const obj = {};
586
+ message.PoolName !== undefined && (obj.PoolName = message.PoolName);
587
+ message.DatasetPath !== undefined &&
588
+ (obj.DatasetPath = message.DatasetPath);
589
+ return obj;
590
+ },
591
+ fromPartial(object) {
592
+ var _a, _b;
593
+ const message = createBaseSnapshotBackupListRequest();
594
+ message.PoolName = (_a = object.PoolName) !== null && _a !== void 0 ? _a : "";
595
+ message.DatasetPath = (_b = object.DatasetPath) !== null && _b !== void 0 ? _b : "";
596
+ return message;
597
+ },
598
+ };
599
+ function createBaseSnapshotStatusResponse() {
600
+ return { Status: 0 };
601
+ }
602
+ exports.SnapshotStatusResponse = {
603
+ encode(message, writer = minimal_1.default.Writer.create()) {
604
+ if (message.Status !== 0) {
605
+ writer.uint32(8).int32(message.Status);
606
+ }
607
+ return writer;
608
+ },
609
+ decode(input, length) {
610
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
611
+ let end = length === undefined ? reader.len : reader.pos + length;
612
+ const message = createBaseSnapshotStatusResponse();
613
+ while (reader.pos < end) {
614
+ const tag = reader.uint32();
615
+ switch (tag >>> 3) {
616
+ case 1:
617
+ message.Status = reader.int32();
618
+ break;
619
+ default:
620
+ reader.skipType(tag & 7);
621
+ break;
622
+ }
623
+ }
624
+ return message;
625
+ },
626
+ fromJSON(object) {
627
+ return {
628
+ Status: isSet(object.Status)
629
+ ? snapshotManagerStatusFromJSON(object.Status)
630
+ : 0,
631
+ };
632
+ },
633
+ toJSON(message) {
634
+ const obj = {};
635
+ message.Status !== undefined &&
636
+ (obj.Status = snapshotManagerStatusToJSON(message.Status));
637
+ return obj;
638
+ },
639
+ fromPartial(object) {
640
+ var _a;
641
+ const message = createBaseSnapshotStatusResponse();
642
+ message.Status = (_a = object.Status) !== null && _a !== void 0 ? _a : 0;
643
+ return message;
644
+ },
645
+ };
646
+ class OSSnapshotServiceClientImpl {
647
+ constructor(rpc) {
648
+ this.rpc = rpc;
649
+ this.BackupPoolAdd = this.BackupPoolAdd.bind(this);
650
+ this.BackupPoolDel = this.BackupPoolDel.bind(this);
651
+ this.BackupPoolList = this.BackupPoolList.bind(this);
652
+ this.DatasetAdd = this.DatasetAdd.bind(this);
653
+ this.DatasetDel = this.DatasetDel.bind(this);
654
+ this.DatasetList = this.DatasetList.bind(this);
655
+ this.DatasetBackupDel = this.DatasetBackupDel.bind(this);
656
+ this.DatasetBackupList = this.DatasetBackupList.bind(this);
657
+ this.SnapshotAdd = this.SnapshotAdd.bind(this);
658
+ this.SnapshotDel = this.SnapshotDel.bind(this);
659
+ this.SnapshotList = this.SnapshotList.bind(this);
660
+ this.SnapshotRestore = this.SnapshotRestore.bind(this);
661
+ this.SnapshotBackupAdd = this.SnapshotBackupAdd.bind(this);
662
+ this.SnapshotBackupDel = this.SnapshotBackupDel.bind(this);
663
+ this.SnapshotBackupList = this.SnapshotBackupList.bind(this);
664
+ this.SnapshotBackupRestore = this.SnapshotBackupRestore.bind(this);
665
+ this.GetStatus = this.GetStatus.bind(this);
666
+ this.StopTransfer = this.StopTransfer.bind(this);
667
+ }
668
+ BackupPoolAdd(request, metadata) {
669
+ return this.rpc.unary(exports.OSSnapshotServiceBackupPoolAddDesc, exports.SnapshotBackupPoolRequest.fromPartial(request), metadata);
670
+ }
671
+ BackupPoolDel(request, metadata) {
672
+ return this.rpc.unary(exports.OSSnapshotServiceBackupPoolDelDesc, exports.SnapshotBackupPoolRequest.fromPartial(request), metadata);
673
+ }
674
+ BackupPoolList(request, metadata) {
675
+ return this.rpc.unary(exports.OSSnapshotServiceBackupPoolListDesc, empty_1.Empty.fromPartial(request), metadata);
676
+ }
677
+ DatasetAdd(request, metadata) {
678
+ return this.rpc.unary(exports.OSSnapshotServiceDatasetAddDesc, exports.SnapshotDatasetRequest.fromPartial(request), metadata);
679
+ }
680
+ DatasetDel(request, metadata) {
681
+ return this.rpc.unary(exports.OSSnapshotServiceDatasetDelDesc, exports.SnapshotDatasetRequest.fromPartial(request), metadata);
682
+ }
683
+ DatasetList(request, metadata) {
684
+ return this.rpc.unary(exports.OSSnapshotServiceDatasetListDesc, empty_1.Empty.fromPartial(request), metadata);
685
+ }
686
+ DatasetBackupDel(request, metadata) {
687
+ return this.rpc.unary(exports.OSSnapshotServiceDatasetBackupDelDesc, exports.SnapshotDatasetBackupRequest.fromPartial(request), metadata);
688
+ }
689
+ DatasetBackupList(request, metadata) {
690
+ return this.rpc.unary(exports.OSSnapshotServiceDatasetBackupListDesc, exports.SnapshotBackupPoolRequest.fromPartial(request), metadata);
691
+ }
692
+ SnapshotAdd(request, metadata) {
693
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotAddDesc, exports.SnapshotDatasetRequest.fromPartial(request), metadata);
694
+ }
695
+ SnapshotDel(request, metadata) {
696
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotDelDesc, exports.SnapshotRequest.fromPartial(request), metadata);
697
+ }
698
+ SnapshotList(request, metadata) {
699
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotListDesc, exports.SnapshotDatasetRequest.fromPartial(request), metadata);
700
+ }
701
+ SnapshotRestore(request, metadata) {
702
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotRestoreDesc, exports.SnapshotRequest.fromPartial(request), metadata);
703
+ }
704
+ SnapshotBackupAdd(request, metadata) {
705
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotBackupAddDesc, exports.SnapshotBackupTransferRequest.fromPartial(request), metadata);
706
+ }
707
+ SnapshotBackupDel(request, metadata) {
708
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotBackupDelDesc, exports.SnapshotBackupRequest.fromPartial(request), metadata);
709
+ }
710
+ SnapshotBackupList(request, metadata) {
711
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotBackupListDesc, exports.SnapshotBackupListRequest.fromPartial(request), metadata);
712
+ }
713
+ SnapshotBackupRestore(request, metadata) {
714
+ return this.rpc.unary(exports.OSSnapshotServiceSnapshotBackupRestoreDesc, exports.SnapshotBackupTransferRequest.fromPartial(request), metadata);
715
+ }
716
+ GetStatus(request, metadata) {
717
+ return this.rpc.unary(exports.OSSnapshotServiceGetStatusDesc, empty_1.Empty.fromPartial(request), metadata);
718
+ }
719
+ StopTransfer(request, metadata) {
720
+ return this.rpc.unary(exports.OSSnapshotServiceStopTransferDesc, empty_1.Empty.fromPartial(request), metadata);
721
+ }
722
+ }
723
+ exports.OSSnapshotServiceClientImpl = OSSnapshotServiceClientImpl;
724
+ exports.OSSnapshotServiceDesc = {
725
+ serviceName: "cloud.lazycat.apis.sys.OSSnapshotService",
726
+ };
727
+ exports.OSSnapshotServiceBackupPoolAddDesc = {
728
+ methodName: "BackupPoolAdd",
729
+ service: exports.OSSnapshotServiceDesc,
730
+ requestStream: false,
731
+ responseStream: false,
732
+ requestType: {
733
+ serializeBinary() {
734
+ return exports.SnapshotBackupPoolRequest.encode(this).finish();
735
+ },
736
+ },
737
+ responseType: {
738
+ deserializeBinary(data) {
739
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
740
+ return this;
741
+ } });
742
+ },
743
+ },
744
+ };
745
+ exports.OSSnapshotServiceBackupPoolDelDesc = {
746
+ methodName: "BackupPoolDel",
747
+ service: exports.OSSnapshotServiceDesc,
748
+ requestStream: false,
749
+ responseStream: false,
750
+ requestType: {
751
+ serializeBinary() {
752
+ return exports.SnapshotBackupPoolRequest.encode(this).finish();
753
+ },
754
+ },
755
+ responseType: {
756
+ deserializeBinary(data) {
757
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
758
+ return this;
759
+ } });
760
+ },
761
+ },
762
+ };
763
+ exports.OSSnapshotServiceBackupPoolListDesc = {
764
+ methodName: "BackupPoolList",
765
+ service: exports.OSSnapshotServiceDesc,
766
+ requestStream: false,
767
+ responseStream: false,
768
+ requestType: {
769
+ serializeBinary() {
770
+ return empty_1.Empty.encode(this).finish();
771
+ },
772
+ },
773
+ responseType: {
774
+ deserializeBinary(data) {
775
+ return Object.assign(Object.assign({}, exports.SnapshotBackupPoolListResponse.decode(data)), { toObject() {
776
+ return this;
777
+ } });
778
+ },
779
+ },
780
+ };
781
+ exports.OSSnapshotServiceDatasetAddDesc = {
782
+ methodName: "DatasetAdd",
783
+ service: exports.OSSnapshotServiceDesc,
784
+ requestStream: false,
785
+ responseStream: false,
786
+ requestType: {
787
+ serializeBinary() {
788
+ return exports.SnapshotDatasetRequest.encode(this).finish();
789
+ },
790
+ },
791
+ responseType: {
792
+ deserializeBinary(data) {
793
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
794
+ return this;
795
+ } });
796
+ },
797
+ },
798
+ };
799
+ exports.OSSnapshotServiceDatasetDelDesc = {
800
+ methodName: "DatasetDel",
801
+ service: exports.OSSnapshotServiceDesc,
802
+ requestStream: false,
803
+ responseStream: false,
804
+ requestType: {
805
+ serializeBinary() {
806
+ return exports.SnapshotDatasetRequest.encode(this).finish();
807
+ },
808
+ },
809
+ responseType: {
810
+ deserializeBinary(data) {
811
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
812
+ return this;
813
+ } });
814
+ },
815
+ },
816
+ };
817
+ exports.OSSnapshotServiceDatasetListDesc = {
818
+ methodName: "DatasetList",
819
+ service: exports.OSSnapshotServiceDesc,
820
+ requestStream: false,
821
+ responseStream: false,
822
+ requestType: {
823
+ serializeBinary() {
824
+ return empty_1.Empty.encode(this).finish();
825
+ },
826
+ },
827
+ responseType: {
828
+ deserializeBinary(data) {
829
+ return Object.assign(Object.assign({}, exports.SnapshotDatasetListResponse.decode(data)), { toObject() {
830
+ return this;
831
+ } });
832
+ },
833
+ },
834
+ };
835
+ exports.OSSnapshotServiceDatasetBackupDelDesc = {
836
+ methodName: "DatasetBackupDel",
837
+ service: exports.OSSnapshotServiceDesc,
838
+ requestStream: false,
839
+ responseStream: false,
840
+ requestType: {
841
+ serializeBinary() {
842
+ return exports.SnapshotDatasetBackupRequest.encode(this).finish();
843
+ },
844
+ },
845
+ responseType: {
846
+ deserializeBinary(data) {
847
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
848
+ return this;
849
+ } });
850
+ },
851
+ },
852
+ };
853
+ exports.OSSnapshotServiceDatasetBackupListDesc = {
854
+ methodName: "DatasetBackupList",
855
+ service: exports.OSSnapshotServiceDesc,
856
+ requestStream: false,
857
+ responseStream: false,
858
+ requestType: {
859
+ serializeBinary() {
860
+ return exports.SnapshotBackupPoolRequest.encode(this).finish();
861
+ },
862
+ },
863
+ responseType: {
864
+ deserializeBinary(data) {
865
+ return Object.assign(Object.assign({}, exports.SnapshotDatasetListResponse.decode(data)), { toObject() {
866
+ return this;
867
+ } });
868
+ },
869
+ },
870
+ };
871
+ exports.OSSnapshotServiceSnapshotAddDesc = {
872
+ methodName: "SnapshotAdd",
873
+ service: exports.OSSnapshotServiceDesc,
874
+ requestStream: false,
875
+ responseStream: false,
876
+ requestType: {
877
+ serializeBinary() {
878
+ return exports.SnapshotDatasetRequest.encode(this).finish();
879
+ },
880
+ },
881
+ responseType: {
882
+ deserializeBinary(data) {
883
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
884
+ return this;
885
+ } });
886
+ },
887
+ },
888
+ };
889
+ exports.OSSnapshotServiceSnapshotDelDesc = {
890
+ methodName: "SnapshotDel",
891
+ service: exports.OSSnapshotServiceDesc,
892
+ requestStream: false,
893
+ responseStream: false,
894
+ requestType: {
895
+ serializeBinary() {
896
+ return exports.SnapshotRequest.encode(this).finish();
897
+ },
898
+ },
899
+ responseType: {
900
+ deserializeBinary(data) {
901
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
902
+ return this;
903
+ } });
904
+ },
905
+ },
906
+ };
907
+ exports.OSSnapshotServiceSnapshotListDesc = {
908
+ methodName: "SnapshotList",
909
+ service: exports.OSSnapshotServiceDesc,
910
+ requestStream: false,
911
+ responseStream: false,
912
+ requestType: {
913
+ serializeBinary() {
914
+ return exports.SnapshotDatasetRequest.encode(this).finish();
915
+ },
916
+ },
917
+ responseType: {
918
+ deserializeBinary(data) {
919
+ return Object.assign(Object.assign({}, exports.SnapshotListResponse.decode(data)), { toObject() {
920
+ return this;
921
+ } });
922
+ },
923
+ },
924
+ };
925
+ exports.OSSnapshotServiceSnapshotRestoreDesc = {
926
+ methodName: "SnapshotRestore",
927
+ service: exports.OSSnapshotServiceDesc,
928
+ requestStream: false,
929
+ responseStream: false,
930
+ requestType: {
931
+ serializeBinary() {
932
+ return exports.SnapshotRequest.encode(this).finish();
933
+ },
934
+ },
935
+ responseType: {
936
+ deserializeBinary(data) {
937
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
938
+ return this;
939
+ } });
940
+ },
941
+ },
942
+ };
943
+ exports.OSSnapshotServiceSnapshotBackupAddDesc = {
944
+ methodName: "SnapshotBackupAdd",
945
+ service: exports.OSSnapshotServiceDesc,
946
+ requestStream: false,
947
+ responseStream: false,
948
+ requestType: {
949
+ serializeBinary() {
950
+ return exports.SnapshotBackupTransferRequest.encode(this).finish();
951
+ },
952
+ },
953
+ responseType: {
954
+ deserializeBinary(data) {
955
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
956
+ return this;
957
+ } });
958
+ },
959
+ },
960
+ };
961
+ exports.OSSnapshotServiceSnapshotBackupDelDesc = {
962
+ methodName: "SnapshotBackupDel",
963
+ service: exports.OSSnapshotServiceDesc,
964
+ requestStream: false,
965
+ responseStream: false,
966
+ requestType: {
967
+ serializeBinary() {
968
+ return exports.SnapshotBackupRequest.encode(this).finish();
969
+ },
970
+ },
971
+ responseType: {
972
+ deserializeBinary(data) {
973
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
974
+ return this;
975
+ } });
976
+ },
977
+ },
978
+ };
979
+ exports.OSSnapshotServiceSnapshotBackupListDesc = {
980
+ methodName: "SnapshotBackupList",
981
+ service: exports.OSSnapshotServiceDesc,
982
+ requestStream: false,
983
+ responseStream: false,
984
+ requestType: {
985
+ serializeBinary() {
986
+ return exports.SnapshotBackupListRequest.encode(this).finish();
987
+ },
988
+ },
989
+ responseType: {
990
+ deserializeBinary(data) {
991
+ return Object.assign(Object.assign({}, exports.SnapshotListResponse.decode(data)), { toObject() {
992
+ return this;
993
+ } });
994
+ },
995
+ },
996
+ };
997
+ exports.OSSnapshotServiceSnapshotBackupRestoreDesc = {
998
+ methodName: "SnapshotBackupRestore",
999
+ service: exports.OSSnapshotServiceDesc,
1000
+ requestStream: false,
1001
+ responseStream: false,
1002
+ requestType: {
1003
+ serializeBinary() {
1004
+ return exports.SnapshotBackupTransferRequest.encode(this).finish();
1005
+ },
1006
+ },
1007
+ responseType: {
1008
+ deserializeBinary(data) {
1009
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
1010
+ return this;
1011
+ } });
1012
+ },
1013
+ },
1014
+ };
1015
+ exports.OSSnapshotServiceGetStatusDesc = {
1016
+ methodName: "GetStatus",
1017
+ service: exports.OSSnapshotServiceDesc,
1018
+ requestStream: false,
1019
+ responseStream: false,
1020
+ requestType: {
1021
+ serializeBinary() {
1022
+ return empty_1.Empty.encode(this).finish();
1023
+ },
1024
+ },
1025
+ responseType: {
1026
+ deserializeBinary(data) {
1027
+ return Object.assign(Object.assign({}, exports.SnapshotStatusResponse.decode(data)), { toObject() {
1028
+ return this;
1029
+ } });
1030
+ },
1031
+ },
1032
+ };
1033
+ exports.OSSnapshotServiceStopTransferDesc = {
1034
+ methodName: "StopTransfer",
1035
+ service: exports.OSSnapshotServiceDesc,
1036
+ requestStream: false,
1037
+ responseStream: false,
1038
+ requestType: {
1039
+ serializeBinary() {
1040
+ return empty_1.Empty.encode(this).finish();
1041
+ },
1042
+ },
1043
+ responseType: {
1044
+ deserializeBinary(data) {
1045
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
1046
+ return this;
1047
+ } });
1048
+ },
1049
+ },
1050
+ };
1051
+ class GrpcWebImpl {
1052
+ constructor(host, options) {
1053
+ this.host = host;
1054
+ this.options = options;
1055
+ }
1056
+ unary(methodDesc, _request, metadata) {
1057
+ var _a;
1058
+ const request = Object.assign(Object.assign({}, _request), methodDesc.requestType);
1059
+ const maybeCombinedMetadata = metadata && this.options.metadata
1060
+ ? 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))
1061
+ : metadata || this.options.metadata;
1062
+ return new Promise((resolve, reject) => {
1063
+ grpc_web_1.grpc.unary(methodDesc, {
1064
+ request,
1065
+ host: this.host,
1066
+ metadata: maybeCombinedMetadata,
1067
+ transport: this.options.transport,
1068
+ debug: this.options.debug,
1069
+ onEnd: function (response) {
1070
+ if (response.status === grpc_web_1.grpc.Code.OK) {
1071
+ resolve(response.message);
1072
+ }
1073
+ else {
1074
+ const err = new Error(response.statusMessage);
1075
+ err.code = response.status;
1076
+ err.metadata = response.trailers;
1077
+ reject(err);
1078
+ }
1079
+ },
1080
+ });
1081
+ });
1082
+ }
1083
+ }
1084
+ exports.GrpcWebImpl = GrpcWebImpl;
1085
+ function isSet(value) {
1086
+ return value !== null && value !== undefined;
1087
+ }
1088
+ //# sourceMappingURL=OS_snapshot.js.map