-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathalc_health.piqi_pb.js
584 lines (544 loc) · 23.9 KB
/
alc_health.piqi_pb.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";
var $protobuf = require("protobufjs/minimal");
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
$root.alc_health = (function() {
/**
* Namespace alc_health.
* @exports alc_health
* @namespace
*/
var alc_health = {};
alc_health.status_update = (function() {
/**
* Properties of a status_update.
* @memberof alc_health
* @interface Istatus_update
* @property {alc_health.status} status status_update status
* @property {number|Long} timestamp status_update timestamp
* @property {Array.<alc_health.Istatus_update_item>|null} [item] status_update item
*/
/**
* Constructs a new status_update.
* @memberof alc_health
* @classdesc Represents a status_update.
* @implements Istatus_update
* @constructor
* @param {alc_health.Istatus_update=} [properties] Properties to set
*/
function status_update(properties) {
this.item = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* status_update status.
* @member {alc_health.status} status
* @memberof alc_health.status_update
* @instance
*/
status_update.prototype.status = 0;
/**
* status_update timestamp.
* @member {number|Long} timestamp
* @memberof alc_health.status_update
* @instance
*/
status_update.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* status_update item.
* @member {Array.<alc_health.Istatus_update_item>} item
* @memberof alc_health.status_update
* @instance
*/
status_update.prototype.item = $util.emptyArray;
/**
* Creates a new status_update instance using the specified properties.
* @function create
* @memberof alc_health.status_update
* @static
* @param {alc_health.Istatus_update=} [properties] Properties to set
* @returns {alc_health.status_update} status_update instance
*/
status_update.create = function create(properties) {
return new status_update(properties);
};
/**
* Encodes the specified status_update message. Does not implicitly {@link alc_health.status_update.verify|verify} messages.
* @function encode
* @memberof alc_health.status_update
* @static
* @param {alc_health.Istatus_update} message status_update message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
status_update.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status);
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp);
if (message.item != null && message.item.length)
for (var i = 0; i < message.item.length; ++i)
$root.alc_health.status_update_item.encode(message.item[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
return writer;
};
/**
* Encodes the specified status_update message, length delimited. Does not implicitly {@link alc_health.status_update.verify|verify} messages.
* @function encodeDelimited
* @memberof alc_health.status_update
* @static
* @param {alc_health.Istatus_update} message status_update message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
status_update.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a status_update message from the specified reader or buffer.
* @function decode
* @memberof alc_health.status_update
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {alc_health.status_update} status_update
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
status_update.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.alc_health.status_update();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.status = reader.int32();
break;
case 2:
message.timestamp = reader.uint64();
break;
case 3:
if (!(message.item && message.item.length))
message.item = [];
message.item.push($root.alc_health.status_update_item.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("status"))
throw $util.ProtocolError("missing required 'status'", { instance: message });
if (!message.hasOwnProperty("timestamp"))
throw $util.ProtocolError("missing required 'timestamp'", { instance: message });
return message;
};
/**
* Decodes a status_update message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof alc_health.status_update
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {alc_health.status_update} status_update
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
status_update.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a status_update message.
* @function verify
* @memberof alc_health.status_update
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
status_update.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
switch (message.status) {
default:
return "status: enum value expected";
case 0:
case 1:
case 2:
case 3:
case 4:
break;
}
if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
return "timestamp: integer|Long expected";
if (message.item != null && message.hasOwnProperty("item")) {
if (!Array.isArray(message.item))
return "item: array expected";
for (var i = 0; i < message.item.length; ++i) {
var error = $root.alc_health.status_update_item.verify(message.item[i]);
if (error)
return "item." + error;
}
}
return null;
};
/**
* Creates a status_update message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof alc_health.status_update
* @static
* @param {Object.<string,*>} object Plain object
* @returns {alc_health.status_update} status_update
*/
status_update.fromObject = function fromObject(object) {
if (object instanceof $root.alc_health.status_update)
return object;
var message = new $root.alc_health.status_update();
switch (object.status) {
case "STATUS_OK":
case 0:
message.status = 0;
break;
case "STATUS_WARNING":
case 1:
message.status = 1;
break;
case "STATUS_ERROR":
case 2:
message.status = 2;
break;
case "STATUS_OFFLINE":
case 3:
message.status = 3;
break;
case "STATUS_NEW":
case 4:
message.status = 4;
break;
}
if (object.timestamp != null)
if ($util.Long)
(message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
else if (typeof object.timestamp === "string")
message.timestamp = parseInt(object.timestamp, 10);
else if (typeof object.timestamp === "number")
message.timestamp = object.timestamp;
else if (typeof object.timestamp === "object")
message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
if (object.item) {
if (!Array.isArray(object.item))
throw TypeError(".alc_health.status_update.item: array expected");
message.item = [];
for (var i = 0; i < object.item.length; ++i) {
if (typeof object.item[i] !== "object")
throw TypeError(".alc_health.status_update.item: object expected");
message.item[i] = $root.alc_health.status_update_item.fromObject(object.item[i]);
}
}
return message;
};
/**
* Creates a plain object from a status_update message. Also converts values to other types if specified.
* @function toObject
* @memberof alc_health.status_update
* @static
* @param {alc_health.status_update} message status_update
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
status_update.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.item = [];
if (options.defaults) {
object.status = options.enums === String ? "STATUS_OK" : 0;
if ($util.Long) {
var long = new $util.Long(0, 0, true);
object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.timestamp = options.longs === String ? "0" : 0;
}
if (message.status != null && message.hasOwnProperty("status"))
object.status = options.enums === String ? $root.alc_health.status[message.status] : message.status;
if (message.timestamp != null && message.hasOwnProperty("timestamp"))
if (typeof message.timestamp === "number")
object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
else
object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp;
if (message.item && message.item.length) {
object.item = [];
for (var j = 0; j < message.item.length; ++j)
object.item[j] = $root.alc_health.status_update_item.toObject(message.item[j], options);
}
return object;
};
/**
* Converts this status_update to JSON.
* @function toJSON
* @memberof alc_health.status_update
* @instance
* @returns {Object.<string,*>} JSON object
*/
status_update.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return status_update;
})();
/**
* status enum.
* @name alc_health.status
* @enum {string}
* @property {number} STATUS_OK=0 STATUS_OK value
* @property {number} STATUS_WARNING=1 STATUS_WARNING value
* @property {number} STATUS_ERROR=2 STATUS_ERROR value
* @property {number} STATUS_OFFLINE=3 STATUS_OFFLINE value
* @property {number} STATUS_NEW=4 STATUS_NEW value
*/
alc_health.status = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "STATUS_OK"] = 0;
values[valuesById[1] = "STATUS_WARNING"] = 1;
values[valuesById[2] = "STATUS_ERROR"] = 2;
values[valuesById[3] = "STATUS_OFFLINE"] = 3;
values[valuesById[4] = "STATUS_NEW"] = 4;
return values;
})();
alc_health.status_update_item = (function() {
/**
* Properties of a status_update_item.
* @memberof alc_health
* @interface Istatus_update_item
* @property {alc_health.status_update_item_type} type status_update_item type
* @property {string} details status_update_item details
*/
/**
* Constructs a new status_update_item.
* @memberof alc_health
* @classdesc Represents a status_update_item.
* @implements Istatus_update_item
* @constructor
* @param {alc_health.Istatus_update_item=} [properties] Properties to set
*/
function status_update_item(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* status_update_item type.
* @member {alc_health.status_update_item_type} type
* @memberof alc_health.status_update_item
* @instance
*/
status_update_item.prototype.type = 1;
/**
* status_update_item details.
* @member {string} details
* @memberof alc_health.status_update_item
* @instance
*/
status_update_item.prototype.details = "";
/**
* Creates a new status_update_item instance using the specified properties.
* @function create
* @memberof alc_health.status_update_item
* @static
* @param {alc_health.Istatus_update_item=} [properties] Properties to set
* @returns {alc_health.status_update_item} status_update_item instance
*/
status_update_item.create = function create(properties) {
return new status_update_item(properties);
};
/**
* Encodes the specified status_update_item message. Does not implicitly {@link alc_health.status_update_item.verify|verify} messages.
* @function encode
* @memberof alc_health.status_update_item
* @static
* @param {alc_health.Istatus_update_item} message status_update_item message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
status_update_item.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);
writer.uint32(/* id 2, wireType 2 =*/18).string(message.details);
return writer;
};
/**
* Encodes the specified status_update_item message, length delimited. Does not implicitly {@link alc_health.status_update_item.verify|verify} messages.
* @function encodeDelimited
* @memberof alc_health.status_update_item
* @static
* @param {alc_health.Istatus_update_item} message status_update_item message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
status_update_item.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a status_update_item message from the specified reader or buffer.
* @function decode
* @memberof alc_health.status_update_item
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {alc_health.status_update_item} status_update_item
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
status_update_item.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.alc_health.status_update_item();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.type = reader.int32();
break;
case 2:
message.details = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("type"))
throw $util.ProtocolError("missing required 'type'", { instance: message });
if (!message.hasOwnProperty("details"))
throw $util.ProtocolError("missing required 'details'", { instance: message });
return message;
};
/**
* Decodes a status_update_item message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof alc_health.status_update_item
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {alc_health.status_update_item} status_update_item
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
status_update_item.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a status_update_item message.
* @function verify
* @memberof alc_health.status_update_item
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
status_update_item.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
switch (message.type) {
default:
return "type: enum value expected";
case 1:
case 2:
case 3:
break;
}
if (!$util.isString(message.details))
return "details: string expected";
return null;
};
/**
* Creates a status_update_item message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof alc_health.status_update_item
* @static
* @param {Object.<string,*>} object Plain object
* @returns {alc_health.status_update_item} status_update_item
*/
status_update_item.fromObject = function fromObject(object) {
if (object instanceof $root.alc_health.status_update_item)
return object;
var message = new $root.alc_health.status_update_item();
switch (object.type) {
case "ERROR_UPDATE":
case 1:
message.type = 1;
break;
case "WARNING_UPDATE":
case 2:
message.type = 2;
break;
case "INFO_UPDATE":
case 3:
message.type = 3;
break;
}
if (object.details != null)
message.details = String(object.details);
return message;
};
/**
* Creates a plain object from a status_update_item message. Also converts values to other types if specified.
* @function toObject
* @memberof alc_health.status_update_item
* @static
* @param {alc_health.status_update_item} message status_update_item
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
status_update_item.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.type = options.enums === String ? "ERROR_UPDATE" : 1;
object.details = "";
}
if (message.type != null && message.hasOwnProperty("type"))
object.type = options.enums === String ? $root.alc_health.status_update_item_type[message.type] : message.type;
if (message.details != null && message.hasOwnProperty("details"))
object.details = message.details;
return object;
};
/**
* Converts this status_update_item to JSON.
* @function toJSON
* @memberof alc_health.status_update_item
* @instance
* @returns {Object.<string,*>} JSON object
*/
status_update_item.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return status_update_item;
})();
/**
* status_update_item_type enum.
* @name alc_health.status_update_item_type
* @enum {string}
* @property {number} ERROR_UPDATE=1 ERROR_UPDATE value
* @property {number} WARNING_UPDATE=2 WARNING_UPDATE value
* @property {number} INFO_UPDATE=3 INFO_UPDATE value
*/
alc_health.status_update_item_type = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "ERROR_UPDATE"] = 1;
values[valuesById[2] = "WARNING_UPDATE"] = 2;
values[valuesById[3] = "INFO_UPDATE"] = 3;
return values;
})();
return alc_health;
})();
module.exports = $root;