-
Notifications
You must be signed in to change notification settings - Fork 0
/
gdr.js
2962 lines (2823 loc) · 111 KB
/
gdr.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
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*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.GDRs = (function() {
/**
* Properties of a GDRs.
* @exports IGDRs
* @interface IGDRs
* @property {Object.<string,IGDR>|null} [GDRs] GDRs GDRs
* @property {string|null} [configUuid] GDRs configUuid
*/
/**
* Constructs a new GDRs.
* @exports GDRs
* @classdesc Represents a GDRs.
* @implements IGDRs
* @constructor
* @param {IGDRs=} [properties] Properties to set
*/
function GDRs(properties) {
this.GDRs = {};
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]];
}
/**
* GDRs GDRs.
* @member {Object.<string,IGDR>} GDRs
* @memberof GDRs
* @instance
*/
GDRs.prototype.GDRs = $util.emptyObject;
/**
* GDRs configUuid.
* @member {string} configUuid
* @memberof GDRs
* @instance
*/
GDRs.prototype.configUuid = "";
/**
* Creates a new GDRs instance using the specified properties.
* @function create
* @memberof GDRs
* @static
* @param {IGDRs=} [properties] Properties to set
* @returns {GDRs} GDRs instance
*/
GDRs.create = function create(properties) {
return new GDRs(properties);
};
/**
* Encodes the specified GDRs message. Does not implicitly {@link GDRs.verify|verify} messages.
* @function encode
* @memberof GDRs
* @static
* @param {IGDRs} message GDRs message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
GDRs.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.GDRs != null && Object.hasOwnProperty.call(message, "GDRs"))
for (var keys = Object.keys(message.GDRs), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
$root.GDR.encode(message.GDRs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
if (message.configUuid != null && Object.hasOwnProperty.call(message, "configUuid"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.configUuid);
return writer;
};
/**
* Encodes the specified GDRs message, length delimited. Does not implicitly {@link GDRs.verify|verify} messages.
* @function encodeDelimited
* @memberof GDRs
* @static
* @param {IGDRs} message GDRs message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
GDRs.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a GDRs message from the specified reader or buffer.
* @function decode
* @memberof GDRs
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {GDRs} GDRs
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
GDRs.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.GDRs(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.GDRs === $util.emptyObject)
message.GDRs = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = $root.GDR.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.GDRs[key] = value;
break;
}
case 2: {
message.configUuid = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a GDRs message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof GDRs
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {GDRs} GDRs
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
GDRs.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a GDRs message.
* @function verify
* @memberof GDRs
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
GDRs.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.GDRs != null && message.hasOwnProperty("GDRs")) {
if (!$util.isObject(message.GDRs))
return "GDRs: object expected";
var key = Object.keys(message.GDRs);
for (var i = 0; i < key.length; ++i) {
var error = $root.GDR.verify(message.GDRs[key[i]]);
if (error)
return "GDRs." + error;
}
}
if (message.configUuid != null && message.hasOwnProperty("configUuid"))
if (!$util.isString(message.configUuid))
return "configUuid: string expected";
return null;
};
/**
* Creates a GDRs message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof GDRs
* @static
* @param {Object.<string,*>} object Plain object
* @returns {GDRs} GDRs
*/
GDRs.fromObject = function fromObject(object) {
if (object instanceof $root.GDRs)
return object;
var message = new $root.GDRs();
if (object.GDRs) {
if (typeof object.GDRs !== "object")
throw TypeError(".GDRs.GDRs: object expected");
message.GDRs = {};
for (var keys = Object.keys(object.GDRs), i = 0; i < keys.length; ++i) {
if (typeof object.GDRs[keys[i]] !== "object")
throw TypeError(".GDRs.GDRs: object expected");
message.GDRs[keys[i]] = $root.GDR.fromObject(object.GDRs[keys[i]]);
}
}
if (object.configUuid != null)
message.configUuid = String(object.configUuid);
return message;
};
/**
* Creates a plain object from a GDRs message. Also converts values to other types if specified.
* @function toObject
* @memberof GDRs
* @static
* @param {GDRs} message GDRs
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
GDRs.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.GDRs = {};
if (options.defaults)
object.configUuid = "";
var keys2;
if (message.GDRs && (keys2 = Object.keys(message.GDRs)).length) {
object.GDRs = {};
for (var j = 0; j < keys2.length; ++j)
object.GDRs[keys2[j]] = $root.GDR.toObject(message.GDRs[keys2[j]], options);
}
if (message.configUuid != null && message.hasOwnProperty("configUuid"))
object.configUuid = message.configUuid;
return object;
};
/**
* Converts this GDRs to JSON.
* @function toJSON
* @memberof GDRs
* @instance
* @returns {Object.<string,*>} JSON object
*/
GDRs.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for GDRs
* @function getTypeUrl
* @memberof GDRs
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
GDRs.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/GDRs";
};
return GDRs;
})();
$root.GCRs = (function() {
/**
* Properties of a GCRs.
* @exports IGCRs
* @interface IGCRs
* @property {Object.<string,IGCR>|null} [GCRs] GCRs GCRs
* @property {string|null} [configUuid] GCRs configUuid
*/
/**
* Constructs a new GCRs.
* @exports GCRs
* @classdesc Represents a GCRs.
* @implements IGCRs
* @constructor
* @param {IGCRs=} [properties] Properties to set
*/
function GCRs(properties) {
this.GCRs = {};
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]];
}
/**
* GCRs GCRs.
* @member {Object.<string,IGCR>} GCRs
* @memberof GCRs
* @instance
*/
GCRs.prototype.GCRs = $util.emptyObject;
/**
* GCRs configUuid.
* @member {string} configUuid
* @memberof GCRs
* @instance
*/
GCRs.prototype.configUuid = "";
/**
* Creates a new GCRs instance using the specified properties.
* @function create
* @memberof GCRs
* @static
* @param {IGCRs=} [properties] Properties to set
* @returns {GCRs} GCRs instance
*/
GCRs.create = function create(properties) {
return new GCRs(properties);
};
/**
* Encodes the specified GCRs message. Does not implicitly {@link GCRs.verify|verify} messages.
* @function encode
* @memberof GCRs
* @static
* @param {IGCRs} message GCRs message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
GCRs.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.GCRs != null && Object.hasOwnProperty.call(message, "GCRs"))
for (var keys = Object.keys(message.GCRs), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
$root.GCR.encode(message.GCRs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
if (message.configUuid != null && Object.hasOwnProperty.call(message, "configUuid"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.configUuid);
return writer;
};
/**
* Encodes the specified GCRs message, length delimited. Does not implicitly {@link GCRs.verify|verify} messages.
* @function encodeDelimited
* @memberof GCRs
* @static
* @param {IGCRs} message GCRs message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
GCRs.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a GCRs message from the specified reader or buffer.
* @function decode
* @memberof GCRs
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {GCRs} GCRs
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
GCRs.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.GCRs(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.GCRs === $util.emptyObject)
message.GCRs = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = $root.GCR.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.GCRs[key] = value;
break;
}
case 2: {
message.configUuid = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a GCRs message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof GCRs
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {GCRs} GCRs
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
GCRs.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a GCRs message.
* @function verify
* @memberof GCRs
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
GCRs.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.GCRs != null && message.hasOwnProperty("GCRs")) {
if (!$util.isObject(message.GCRs))
return "GCRs: object expected";
var key = Object.keys(message.GCRs);
for (var i = 0; i < key.length; ++i) {
var error = $root.GCR.verify(message.GCRs[key[i]]);
if (error)
return "GCRs." + error;
}
}
if (message.configUuid != null && message.hasOwnProperty("configUuid"))
if (!$util.isString(message.configUuid))
return "configUuid: string expected";
return null;
};
/**
* Creates a GCRs message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof GCRs
* @static
* @param {Object.<string,*>} object Plain object
* @returns {GCRs} GCRs
*/
GCRs.fromObject = function fromObject(object) {
if (object instanceof $root.GCRs)
return object;
var message = new $root.GCRs();
if (object.GCRs) {
if (typeof object.GCRs !== "object")
throw TypeError(".GCRs.GCRs: object expected");
message.GCRs = {};
for (var keys = Object.keys(object.GCRs), i = 0; i < keys.length; ++i) {
if (typeof object.GCRs[keys[i]] !== "object")
throw TypeError(".GCRs.GCRs: object expected");
message.GCRs[keys[i]] = $root.GCR.fromObject(object.GCRs[keys[i]]);
}
}
if (object.configUuid != null)
message.configUuid = String(object.configUuid);
return message;
};
/**
* Creates a plain object from a GCRs message. Also converts values to other types if specified.
* @function toObject
* @memberof GCRs
* @static
* @param {GCRs} message GCRs
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
GCRs.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.GCRs = {};
if (options.defaults)
object.configUuid = "";
var keys2;
if (message.GCRs && (keys2 = Object.keys(message.GCRs)).length) {
object.GCRs = {};
for (var j = 0; j < keys2.length; ++j)
object.GCRs[keys2[j]] = $root.GCR.toObject(message.GCRs[keys2[j]], options);
}
if (message.configUuid != null && message.hasOwnProperty("configUuid"))
object.configUuid = message.configUuid;
return object;
};
/**
* Converts this GCRs to JSON.
* @function toJSON
* @memberof GCRs
* @instance
* @returns {Object.<string,*>} JSON object
*/
GCRs.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for GCRs
* @function getTypeUrl
* @memberof GCRs
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
GCRs.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/GCRs";
};
return GCRs;
})();
$root.GDR = (function() {
/**
* Properties of a GDR.
* @exports IGDR
* @interface IGDR
* @property {string|null} [id] GDR id
* @property {Status|null} [status] GDR status
* @property {google.protobuf.ITimestamp|null} [timestamp] GDR timestamp
* @property {Object.<string,number>|null} [values] GDR values
* @property {Object.<string,IFlexValue>|null} [flexValues] GDR flexValues
*/
/**
* Constructs a new GDR.
* @exports GDR
* @classdesc Represents a GDR.
* @implements IGDR
* @constructor
* @param {IGDR=} [properties] Properties to set
*/
function GDR(properties) {
this.values = {};
this.flexValues = {};
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]];
}
/**
* GDR id.
* @member {string} id
* @memberof GDR
* @instance
*/
GDR.prototype.id = "";
/**
* GDR status.
* @member {Status} status
* @memberof GDR
* @instance
*/
GDR.prototype.status = 0;
/**
* GDR timestamp.
* @member {google.protobuf.ITimestamp|null|undefined} timestamp
* @memberof GDR
* @instance
*/
GDR.prototype.timestamp = null;
/**
* GDR values.
* @member {Object.<string,number>} values
* @memberof GDR
* @instance
*/
GDR.prototype.values = $util.emptyObject;
/**
* GDR flexValues.
* @member {Object.<string,IFlexValue>} flexValues
* @memberof GDR
* @instance
*/
GDR.prototype.flexValues = $util.emptyObject;
/**
* Creates a new GDR instance using the specified properties.
* @function create
* @memberof GDR
* @static
* @param {IGDR=} [properties] Properties to set
* @returns {GDR} GDR instance
*/
GDR.create = function create(properties) {
return new GDR(properties);
};
/**
* Encodes the specified GDR message. Does not implicitly {@link GDR.verify|verify} messages.
* @function encode
* @memberof GDR
* @static
* @param {IGDR} message GDR message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
GDR.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);
if (message.status != null && Object.hasOwnProperty.call(message, "status"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status);
if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
$root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.values != null && Object.hasOwnProperty.call(message, "values"))
for (var keys = Object.keys(message.values), i = 0; i < keys.length; ++i)
writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 0 =*/16).uint64(message.values[keys[i]]).ldelim();
if (message.flexValues != null && Object.hasOwnProperty.call(message, "flexValues"))
for (var keys = Object.keys(message.flexValues), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
$root.FlexValue.encode(message.flexValues[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
return writer;
};
/**
* Encodes the specified GDR message, length delimited. Does not implicitly {@link GDR.verify|verify} messages.
* @function encodeDelimited
* @memberof GDR
* @static
* @param {IGDR} message GDR message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
GDR.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a GDR message from the specified reader or buffer.
* @function decode
* @memberof GDR
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {GDR} GDR
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
GDR.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.GDR(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.id = reader.string();
break;
}
case 2: {
message.status = reader.int32();
break;
}
case 3: {
message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
break;
}
case 4: {
if (message.values === $util.emptyObject)
message.values = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.uint64();
break;
case 2:
value = reader.uint64();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.values[typeof key === "object" ? $util.longToHash(key) : key] = value;
break;
}
case 5: {
if (message.flexValues === $util.emptyObject)
message.flexValues = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = null;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = $root.FlexValue.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.flexValues[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a GDR message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof GDR
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {GDR} GDR
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
GDR.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a GDR message.
* @function verify
* @memberof GDR
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
GDR.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.id != null && message.hasOwnProperty("id"))
if (!$util.isString(message.id))
return "id: string expected";
if (message.status != null && message.hasOwnProperty("status"))
switch (message.status) {
default:
return "status: enum value expected";
case 0:
case 1:
case 2:
case 3:
break;
}
if (message.timestamp != null && message.hasOwnProperty("timestamp")) {
var error = $root.google.protobuf.Timestamp.verify(message.timestamp);
if (error)
return "timestamp." + error;
}
if (message.values != null && message.hasOwnProperty("values")) {
if (!$util.isObject(message.values))
return "values: object expected";
var key = Object.keys(message.values);
for (var i = 0; i < key.length; ++i) {
if (!$util.key64Re.test(key[i]))
return "values: integer|Long key{k:uint64} expected";
if (!$util.isInteger(message.values[key[i]]) && !(message.values[key[i]] && $util.isInteger(message.values[key[i]].low) && $util.isInteger(message.values[key[i]].high)))
return "values: integer|Long{k:uint64} expected";
}
}
if (message.flexValues != null && message.hasOwnProperty("flexValues")) {
if (!$util.isObject(message.flexValues))
return "flexValues: object expected";
var key = Object.keys(message.flexValues);
for (var i = 0; i < key.length; ++i) {
var error = $root.FlexValue.verify(message.flexValues[key[i]]);
if (error)
return "flexValues." + error;
}
}
return null;
};
/**
* Creates a GDR message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof GDR
* @static
* @param {Object.<string,*>} object Plain object
* @returns {GDR} GDR
*/
GDR.fromObject = function fromObject(object) {
if (object instanceof $root.GDR)
return object;
var message = new $root.GDR();
if (object.id != null)
message.id = String(object.id);
switch (object.status) {
default:
if (typeof object.status === "number") {
message.status = object.status;
break;
}
break;
case "STATUS_UNKNOWN":
case 0:
message.status = 0;
break;
case "STATUS_OK":
case 1:
message.status = 1;
break;
case "STATUS_WARNING":
case 2:
message.status = 2;
break;
case "STATUS_ERROR":
case 3:
message.status = 3;
break;
}
if (object.timestamp != null) {
if (typeof object.timestamp !== "object")
throw TypeError(".GDR.timestamp: object expected");
message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp);
}
if (object.values) {
if (typeof object.values !== "object")
throw TypeError(".GDR.values: object expected");
message.values = {};
for (var keys = Object.keys(object.values), i = 0; i < keys.length; ++i)
if ($util.Long)
(message.values[keys[i]] = $util.Long.fromValue(object.values[keys[i]])).unsigned = true;
else if (typeof object.values[keys[i]] === "string")
message.values[keys[i]] = parseInt(object.values[keys[i]], 10);
else if (typeof object.values[keys[i]] === "number")
message.values[keys[i]] = object.values[keys[i]];
else if (typeof object.values[keys[i]] === "object")
message.values[keys[i]] = new $util.LongBits(object.values[keys[i]].low >>> 0, object.values[keys[i]].high >>> 0).toNumber(true);
}
if (object.flexValues) {
if (typeof object.flexValues !== "object")
throw TypeError(".GDR.flexValues: object expected");
message.flexValues = {};
for (var keys = Object.keys(object.flexValues), i = 0; i < keys.length; ++i) {
if (typeof object.flexValues[keys[i]] !== "object")
throw TypeError(".GDR.flexValues: object expected");
message.flexValues[keys[i]] = $root.FlexValue.fromObject(object.flexValues[keys[i]]);
}
}
return message;
};
/**
* Creates a plain object from a GDR message. Also converts values to other types if specified.
* @function toObject
* @memberof GDR
* @static
* @param {GDR} message GDR
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
GDR.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults) {
object.values = {};
object.flexValues = {};
}
if (options.defaults) {
object.id = "";
object.status = options.enums === String ? "STATUS_UNKNOWN" : 0;
object.timestamp = null;
}
if (message.id != null && message.hasOwnProperty("id"))
object.id = message.id;
if (message.status != null && message.hasOwnProperty("status"))
object.status = options.enums === String ? $root.Status[message.status] === undefined ? message.status : $root.Status[message.status] : message.status;
if (message.timestamp != null && message.hasOwnProperty("timestamp"))
object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options);
var keys2;
if (message.values && (keys2 = Object.keys(message.values)).length) {
object.values = {};
for (var j = 0; j < keys2.length; ++j)
if (typeof message.values[keys2[j]] === "number")
object.values[keys2[j]] = options.longs === String ? String(message.values[keys2[j]]) : message.values[keys2[j]];
else
object.values[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.values[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.values[keys2[j]].low >>> 0, message.values[keys2[j]].high >>> 0).toNumber(true) : message.values[keys2[j]];
}
if (message.flexValues && (keys2 = Object.keys(message.flexValues)).length) {
object.flexValues = {};
for (var j = 0; j < keys2.length; ++j)
object.flexValues[keys2[j]] = $root.FlexValue.toObject(message.flexValues[keys2[j]], options);
}
return object;
};
/**
* Converts this GDR to JSON.
* @function toJSON
* @memberof GDR
* @instance
* @returns {Object.<string,*>} JSON object
*/
GDR.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for GDR
* @function getTypeUrl
* @memberof GDR
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
GDR.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/GDR";
};
return GDR;
})();
$root.GCR = (function() {
/**
* Properties of a GCR.
* @exports IGCR
* @interface IGCR
* @property {string|null} [id] GCR id
* @property {string|null} [label] GCR label
* @property {Class|null} ["class"] GCR class
* @property {Array.<string>|null} [sources] GCR sources
* @property {Array.<number>|null} [codes] GCR codes
* @property {DeviceType|null} [devicetype] GCR devicetype
* @property {Object.<string,string>|null} [meta] GCR meta
* @property {google.protobuf.ITimestamp|null} [timestamp] GCR timestamp
* @property {Object.<string,IFlexDefinition>|null} [flexDefinitions] GCR flexDefinitions
*/
/**
* Constructs a new GCR.
* @exports GCR
* @classdesc Represents a GCR.
* @implements IGCR
* @constructor
* @param {IGCR=} [properties] Properties to set
*/
function GCR(properties) {
this.sources = [];
this.codes = [];
this.meta = {};
this.flexDefinitions = {};