UNPKG

377 kBJavaScriptView Raw
1/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
2"use strict";
3
4var $protobuf = require("@apollo/protobufjs/minimal");
5
6// Common aliases
7var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
8
9// Exported root namespace
10var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
11
12$root.Trace = (function() {
13
14 /**
15 * Properties of a Trace.
16 * @exports ITrace
17 * @interface ITrace
18 * @property {google.protobuf.ITimestamp|null} [startTime] Trace startTime
19 * @property {google.protobuf.ITimestamp|null} [endTime] Trace endTime
20 * @property {number|null} [durationNs] Trace durationNs
21 * @property {Trace.INode|null} [root] Trace root
22 * @property {string|null} [signature] Trace signature
23 * @property {Trace.IDetails|null} [details] Trace details
24 * @property {string|null} [clientName] Trace clientName
25 * @property {string|null} [clientVersion] Trace clientVersion
26 * @property {string|null} [clientAddress] Trace clientAddress
27 * @property {string|null} [clientReferenceId] Trace clientReferenceId
28 * @property {Trace.IHTTP|null} [http] Trace http
29 * @property {Trace.ICachePolicy|null} [cachePolicy] Trace cachePolicy
30 * @property {Trace.IQueryPlanNode|null} [queryPlan] Trace queryPlan
31 * @property {boolean|null} [fullQueryCacheHit] Trace fullQueryCacheHit
32 * @property {boolean|null} [persistedQueryHit] Trace persistedQueryHit
33 * @property {boolean|null} [persistedQueryRegister] Trace persistedQueryRegister
34 * @property {boolean|null} [registeredOperation] Trace registeredOperation
35 * @property {boolean|null} [forbiddenOperation] Trace forbiddenOperation
36 * @property {string|null} [legacySignatureNeedsResigning] Trace legacySignatureNeedsResigning
37 */
38
39 /**
40 * Constructs a new Trace.
41 * @exports Trace
42 * @classdesc Represents a Trace.
43 * @implements ITrace
44 * @constructor
45 * @param {ITrace=} [properties] Properties to set
46 */
47 function Trace(properties) {
48 if (properties)
49 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
50 if (properties[keys[i]] != null)
51 this[keys[i]] = properties[keys[i]];
52 }
53
54 /**
55 * Trace startTime.
56 * @member {google.protobuf.ITimestamp|null|undefined} startTime
57 * @memberof Trace
58 * @instance
59 */
60 Trace.prototype.startTime = null;
61
62 /**
63 * Trace endTime.
64 * @member {google.protobuf.ITimestamp|null|undefined} endTime
65 * @memberof Trace
66 * @instance
67 */
68 Trace.prototype.endTime = null;
69
70 /**
71 * Trace durationNs.
72 * @member {number} durationNs
73 * @memberof Trace
74 * @instance
75 */
76 Trace.prototype.durationNs = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
77
78 /**
79 * Trace root.
80 * @member {Trace.INode|null|undefined} root
81 * @memberof Trace
82 * @instance
83 */
84 Trace.prototype.root = null;
85
86 /**
87 * Trace signature.
88 * @member {string} signature
89 * @memberof Trace
90 * @instance
91 */
92 Trace.prototype.signature = "";
93
94 /**
95 * Trace details.
96 * @member {Trace.IDetails|null|undefined} details
97 * @memberof Trace
98 * @instance
99 */
100 Trace.prototype.details = null;
101
102 /**
103 * Trace clientName.
104 * @member {string} clientName
105 * @memberof Trace
106 * @instance
107 */
108 Trace.prototype.clientName = "";
109
110 /**
111 * Trace clientVersion.
112 * @member {string} clientVersion
113 * @memberof Trace
114 * @instance
115 */
116 Trace.prototype.clientVersion = "";
117
118 /**
119 * Trace clientAddress.
120 * @member {string} clientAddress
121 * @memberof Trace
122 * @instance
123 */
124 Trace.prototype.clientAddress = "";
125
126 /**
127 * Trace clientReferenceId.
128 * @member {string} clientReferenceId
129 * @memberof Trace
130 * @instance
131 */
132 Trace.prototype.clientReferenceId = "";
133
134 /**
135 * Trace http.
136 * @member {Trace.IHTTP|null|undefined} http
137 * @memberof Trace
138 * @instance
139 */
140 Trace.prototype.http = null;
141
142 /**
143 * Trace cachePolicy.
144 * @member {Trace.ICachePolicy|null|undefined} cachePolicy
145 * @memberof Trace
146 * @instance
147 */
148 Trace.prototype.cachePolicy = null;
149
150 /**
151 * Trace queryPlan.
152 * @member {Trace.IQueryPlanNode|null|undefined} queryPlan
153 * @memberof Trace
154 * @instance
155 */
156 Trace.prototype.queryPlan = null;
157
158 /**
159 * Trace fullQueryCacheHit.
160 * @member {boolean} fullQueryCacheHit
161 * @memberof Trace
162 * @instance
163 */
164 Trace.prototype.fullQueryCacheHit = false;
165
166 /**
167 * Trace persistedQueryHit.
168 * @member {boolean} persistedQueryHit
169 * @memberof Trace
170 * @instance
171 */
172 Trace.prototype.persistedQueryHit = false;
173
174 /**
175 * Trace persistedQueryRegister.
176 * @member {boolean} persistedQueryRegister
177 * @memberof Trace
178 * @instance
179 */
180 Trace.prototype.persistedQueryRegister = false;
181
182 /**
183 * Trace registeredOperation.
184 * @member {boolean} registeredOperation
185 * @memberof Trace
186 * @instance
187 */
188 Trace.prototype.registeredOperation = false;
189
190 /**
191 * Trace forbiddenOperation.
192 * @member {boolean} forbiddenOperation
193 * @memberof Trace
194 * @instance
195 */
196 Trace.prototype.forbiddenOperation = false;
197
198 /**
199 * Trace legacySignatureNeedsResigning.
200 * @member {string} legacySignatureNeedsResigning
201 * @memberof Trace
202 * @instance
203 */
204 Trace.prototype.legacySignatureNeedsResigning = "";
205
206 /**
207 * Creates a new Trace instance using the specified properties.
208 * @function create
209 * @memberof Trace
210 * @static
211 * @param {ITrace=} [properties] Properties to set
212 * @returns {Trace} Trace instance
213 */
214 Trace.create = function create(properties) {
215 return new Trace(properties);
216 };
217
218 /**
219 * Encodes the specified Trace message. Does not implicitly {@link Trace.verify|verify} messages.
220 * @function encode
221 * @memberof Trace
222 * @static
223 * @param {ITrace} message Trace message or plain object to encode
224 * @param {$protobuf.Writer} [writer] Writer to encode to
225 * @returns {$protobuf.Writer} Writer
226 */
227 Trace.encode = function encode(message, writer) {
228 if (!writer)
229 writer = $Writer.create();
230 if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime"))
231 $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
232 if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
233 $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
234 if (message.legacySignatureNeedsResigning != null && Object.hasOwnProperty.call(message, "legacySignatureNeedsResigning"))
235 writer.uint32(/* id 5, wireType 2 =*/42).string(message.legacySignatureNeedsResigning);
236 if (message.details != null && Object.hasOwnProperty.call(message, "details"))
237 $root.Trace.Details.encode(message.details, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
238 if (message.clientName != null && Object.hasOwnProperty.call(message, "clientName"))
239 writer.uint32(/* id 7, wireType 2 =*/58).string(message.clientName);
240 if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion"))
241 writer.uint32(/* id 8, wireType 2 =*/66).string(message.clientVersion);
242 if (message.clientAddress != null && Object.hasOwnProperty.call(message, "clientAddress"))
243 writer.uint32(/* id 9, wireType 2 =*/74).string(message.clientAddress);
244 if (message.http != null && Object.hasOwnProperty.call(message, "http"))
245 $root.Trace.HTTP.encode(message.http, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
246 if (message.durationNs != null && Object.hasOwnProperty.call(message, "durationNs"))
247 writer.uint32(/* id 11, wireType 0 =*/88).uint64(message.durationNs);
248 if (message.root != null && Object.hasOwnProperty.call(message, "root"))
249 $root.Trace.Node.encode(message.root, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
250 if (message.cachePolicy != null && Object.hasOwnProperty.call(message, "cachePolicy"))
251 $root.Trace.CachePolicy.encode(message.cachePolicy, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim();
252 if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
253 writer.uint32(/* id 19, wireType 2 =*/154).string(message.signature);
254 if (message.fullQueryCacheHit != null && Object.hasOwnProperty.call(message, "fullQueryCacheHit"))
255 writer.uint32(/* id 20, wireType 0 =*/160).bool(message.fullQueryCacheHit);
256 if (message.persistedQueryHit != null && Object.hasOwnProperty.call(message, "persistedQueryHit"))
257 writer.uint32(/* id 21, wireType 0 =*/168).bool(message.persistedQueryHit);
258 if (message.persistedQueryRegister != null && Object.hasOwnProperty.call(message, "persistedQueryRegister"))
259 writer.uint32(/* id 22, wireType 0 =*/176).bool(message.persistedQueryRegister);
260 if (message.clientReferenceId != null && Object.hasOwnProperty.call(message, "clientReferenceId"))
261 writer.uint32(/* id 23, wireType 2 =*/186).string(message.clientReferenceId);
262 if (message.registeredOperation != null && Object.hasOwnProperty.call(message, "registeredOperation"))
263 writer.uint32(/* id 24, wireType 0 =*/192).bool(message.registeredOperation);
264 if (message.forbiddenOperation != null && Object.hasOwnProperty.call(message, "forbiddenOperation"))
265 writer.uint32(/* id 25, wireType 0 =*/200).bool(message.forbiddenOperation);
266 if (message.queryPlan != null && Object.hasOwnProperty.call(message, "queryPlan"))
267 $root.Trace.QueryPlanNode.encode(message.queryPlan, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim();
268 return writer;
269 };
270
271 /**
272 * Encodes the specified Trace message, length delimited. Does not implicitly {@link Trace.verify|verify} messages.
273 * @function encodeDelimited
274 * @memberof Trace
275 * @static
276 * @param {ITrace} message Trace message or plain object to encode
277 * @param {$protobuf.Writer} [writer] Writer to encode to
278 * @returns {$protobuf.Writer} Writer
279 */
280 Trace.encodeDelimited = function encodeDelimited(message, writer) {
281 return this.encode(message, writer).ldelim();
282 };
283
284 /**
285 * Decodes a Trace message from the specified reader or buffer.
286 * @function decode
287 * @memberof Trace
288 * @static
289 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
290 * @param {number} [length] Message length if known beforehand
291 * @returns {Trace} Trace
292 * @throws {Error} If the payload is not a reader or valid buffer
293 * @throws {$protobuf.util.ProtocolError} If required fields are missing
294 */
295 Trace.decode = function decode(reader, length) {
296 if (!(reader instanceof $Reader))
297 reader = $Reader.create(reader);
298 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace();
299 while (reader.pos < end) {
300 var tag = reader.uint32();
301 switch (tag >>> 3) {
302 case 4:
303 message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
304 break;
305 case 3:
306 message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
307 break;
308 case 11:
309 message.durationNs = reader.uint64();
310 break;
311 case 14:
312 message.root = $root.Trace.Node.decode(reader, reader.uint32());
313 break;
314 case 19:
315 message.signature = reader.string();
316 break;
317 case 6:
318 message.details = $root.Trace.Details.decode(reader, reader.uint32());
319 break;
320 case 7:
321 message.clientName = reader.string();
322 break;
323 case 8:
324 message.clientVersion = reader.string();
325 break;
326 case 9:
327 message.clientAddress = reader.string();
328 break;
329 case 23:
330 message.clientReferenceId = reader.string();
331 break;
332 case 10:
333 message.http = $root.Trace.HTTP.decode(reader, reader.uint32());
334 break;
335 case 18:
336 message.cachePolicy = $root.Trace.CachePolicy.decode(reader, reader.uint32());
337 break;
338 case 26:
339 message.queryPlan = $root.Trace.QueryPlanNode.decode(reader, reader.uint32());
340 break;
341 case 20:
342 message.fullQueryCacheHit = reader.bool();
343 break;
344 case 21:
345 message.persistedQueryHit = reader.bool();
346 break;
347 case 22:
348 message.persistedQueryRegister = reader.bool();
349 break;
350 case 24:
351 message.registeredOperation = reader.bool();
352 break;
353 case 25:
354 message.forbiddenOperation = reader.bool();
355 break;
356 case 5:
357 message.legacySignatureNeedsResigning = reader.string();
358 break;
359 default:
360 reader.skipType(tag & 7);
361 break;
362 }
363 }
364 return message;
365 };
366
367 /**
368 * Decodes a Trace message from the specified reader or buffer, length delimited.
369 * @function decodeDelimited
370 * @memberof Trace
371 * @static
372 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
373 * @returns {Trace} Trace
374 * @throws {Error} If the payload is not a reader or valid buffer
375 * @throws {$protobuf.util.ProtocolError} If required fields are missing
376 */
377 Trace.decodeDelimited = function decodeDelimited(reader) {
378 if (!(reader instanceof $Reader))
379 reader = new $Reader(reader);
380 return this.decode(reader, reader.uint32());
381 };
382
383 /**
384 * Verifies a Trace message.
385 * @function verify
386 * @memberof Trace
387 * @static
388 * @param {Object.<string,*>} message Plain object to verify
389 * @returns {string|null} `null` if valid, otherwise the reason why it is not
390 */
391 Trace.verify = function verify(message) {
392 if (typeof message !== "object" || message === null)
393 return "object expected";
394 if (message.startTime != null && message.hasOwnProperty("startTime")) {
395 var error = $root.google.protobuf.Timestamp.verify(message.startTime);
396 if (error)
397 return "startTime." + error;
398 }
399 if (message.endTime != null && message.hasOwnProperty("endTime")) {
400 var error = $root.google.protobuf.Timestamp.verify(message.endTime);
401 if (error)
402 return "endTime." + error;
403 }
404 if (message.durationNs != null && message.hasOwnProperty("durationNs"))
405 if (!$util.isInteger(message.durationNs) && !(message.durationNs && $util.isInteger(message.durationNs.low) && $util.isInteger(message.durationNs.high)))
406 return "durationNs: integer|Long expected";
407 if (message.root != null && message.hasOwnProperty("root")) {
408 var error = $root.Trace.Node.verify(message.root);
409 if (error)
410 return "root." + error;
411 }
412 if (message.signature != null && message.hasOwnProperty("signature"))
413 if (!$util.isString(message.signature))
414 return "signature: string expected";
415 if (message.details != null && message.hasOwnProperty("details")) {
416 var error = $root.Trace.Details.verify(message.details);
417 if (error)
418 return "details." + error;
419 }
420 if (message.clientName != null && message.hasOwnProperty("clientName"))
421 if (!$util.isString(message.clientName))
422 return "clientName: string expected";
423 if (message.clientVersion != null && message.hasOwnProperty("clientVersion"))
424 if (!$util.isString(message.clientVersion))
425 return "clientVersion: string expected";
426 if (message.clientAddress != null && message.hasOwnProperty("clientAddress"))
427 if (!$util.isString(message.clientAddress))
428 return "clientAddress: string expected";
429 if (message.clientReferenceId != null && message.hasOwnProperty("clientReferenceId"))
430 if (!$util.isString(message.clientReferenceId))
431 return "clientReferenceId: string expected";
432 if (message.http != null && message.hasOwnProperty("http")) {
433 var error = $root.Trace.HTTP.verify(message.http);
434 if (error)
435 return "http." + error;
436 }
437 if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy")) {
438 var error = $root.Trace.CachePolicy.verify(message.cachePolicy);
439 if (error)
440 return "cachePolicy." + error;
441 }
442 if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) {
443 var error = $root.Trace.QueryPlanNode.verify(message.queryPlan);
444 if (error)
445 return "queryPlan." + error;
446 }
447 if (message.fullQueryCacheHit != null && message.hasOwnProperty("fullQueryCacheHit"))
448 if (typeof message.fullQueryCacheHit !== "boolean")
449 return "fullQueryCacheHit: boolean expected";
450 if (message.persistedQueryHit != null && message.hasOwnProperty("persistedQueryHit"))
451 if (typeof message.persistedQueryHit !== "boolean")
452 return "persistedQueryHit: boolean expected";
453 if (message.persistedQueryRegister != null && message.hasOwnProperty("persistedQueryRegister"))
454 if (typeof message.persistedQueryRegister !== "boolean")
455 return "persistedQueryRegister: boolean expected";
456 if (message.registeredOperation != null && message.hasOwnProperty("registeredOperation"))
457 if (typeof message.registeredOperation !== "boolean")
458 return "registeredOperation: boolean expected";
459 if (message.forbiddenOperation != null && message.hasOwnProperty("forbiddenOperation"))
460 if (typeof message.forbiddenOperation !== "boolean")
461 return "forbiddenOperation: boolean expected";
462 if (message.legacySignatureNeedsResigning != null && message.hasOwnProperty("legacySignatureNeedsResigning"))
463 if (!$util.isString(message.legacySignatureNeedsResigning))
464 return "legacySignatureNeedsResigning: string expected";
465 return null;
466 };
467
468 /**
469 * Creates a Trace message from a plain object. Also converts values to their respective internal types.
470 * @function fromObject
471 * @memberof Trace
472 * @static
473 * @param {Object.<string,*>} object Plain object
474 * @returns {Trace} Trace
475 */
476 Trace.fromObject = function fromObject(object) {
477 if (object instanceof $root.Trace)
478 return object;
479 var message = new $root.Trace();
480 if (object.startTime != null) {
481 if (typeof object.startTime !== "object")
482 throw TypeError(".Trace.startTime: object expected");
483 message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime);
484 }
485 if (object.endTime != null) {
486 if (typeof object.endTime !== "object")
487 throw TypeError(".Trace.endTime: object expected");
488 message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime);
489 }
490 if (object.durationNs != null)
491 if ($util.Long)
492 (message.durationNs = $util.Long.fromValue(object.durationNs)).unsigned = true;
493 else if (typeof object.durationNs === "string")
494 message.durationNs = parseInt(object.durationNs, 10);
495 else if (typeof object.durationNs === "number")
496 message.durationNs = object.durationNs;
497 else if (typeof object.durationNs === "object")
498 message.durationNs = new $util.LongBits(object.durationNs.low >>> 0, object.durationNs.high >>> 0).toNumber(true);
499 if (object.root != null) {
500 if (typeof object.root !== "object")
501 throw TypeError(".Trace.root: object expected");
502 message.root = $root.Trace.Node.fromObject(object.root);
503 }
504 if (object.signature != null)
505 message.signature = String(object.signature);
506 if (object.details != null) {
507 if (typeof object.details !== "object")
508 throw TypeError(".Trace.details: object expected");
509 message.details = $root.Trace.Details.fromObject(object.details);
510 }
511 if (object.clientName != null)
512 message.clientName = String(object.clientName);
513 if (object.clientVersion != null)
514 message.clientVersion = String(object.clientVersion);
515 if (object.clientAddress != null)
516 message.clientAddress = String(object.clientAddress);
517 if (object.clientReferenceId != null)
518 message.clientReferenceId = String(object.clientReferenceId);
519 if (object.http != null) {
520 if (typeof object.http !== "object")
521 throw TypeError(".Trace.http: object expected");
522 message.http = $root.Trace.HTTP.fromObject(object.http);
523 }
524 if (object.cachePolicy != null) {
525 if (typeof object.cachePolicy !== "object")
526 throw TypeError(".Trace.cachePolicy: object expected");
527 message.cachePolicy = $root.Trace.CachePolicy.fromObject(object.cachePolicy);
528 }
529 if (object.queryPlan != null) {
530 if (typeof object.queryPlan !== "object")
531 throw TypeError(".Trace.queryPlan: object expected");
532 message.queryPlan = $root.Trace.QueryPlanNode.fromObject(object.queryPlan);
533 }
534 if (object.fullQueryCacheHit != null)
535 message.fullQueryCacheHit = Boolean(object.fullQueryCacheHit);
536 if (object.persistedQueryHit != null)
537 message.persistedQueryHit = Boolean(object.persistedQueryHit);
538 if (object.persistedQueryRegister != null)
539 message.persistedQueryRegister = Boolean(object.persistedQueryRegister);
540 if (object.registeredOperation != null)
541 message.registeredOperation = Boolean(object.registeredOperation);
542 if (object.forbiddenOperation != null)
543 message.forbiddenOperation = Boolean(object.forbiddenOperation);
544 if (object.legacySignatureNeedsResigning != null)
545 message.legacySignatureNeedsResigning = String(object.legacySignatureNeedsResigning);
546 return message;
547 };
548
549 /**
550 * Creates a plain object from a Trace message. Also converts values to other types if specified.
551 * @function toObject
552 * @memberof Trace
553 * @static
554 * @param {Trace} message Trace
555 * @param {$protobuf.IConversionOptions} [options] Conversion options
556 * @returns {Object.<string,*>} Plain object
557 */
558 Trace.toObject = function toObject(message, options) {
559 if (!options)
560 options = {};
561 var object = {};
562 if (options.defaults) {
563 object.endTime = null;
564 object.startTime = null;
565 object.legacySignatureNeedsResigning = "";
566 object.details = null;
567 object.clientName = "";
568 object.clientVersion = "";
569 object.clientAddress = "";
570 object.http = null;
571 if ($util.Long) {
572 var long = new $util.Long(0, 0, true);
573 object.durationNs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
574 } else
575 object.durationNs = options.longs === String ? "0" : 0;
576 object.root = null;
577 object.cachePolicy = null;
578 object.signature = "";
579 object.fullQueryCacheHit = false;
580 object.persistedQueryHit = false;
581 object.persistedQueryRegister = false;
582 object.clientReferenceId = "";
583 object.registeredOperation = false;
584 object.forbiddenOperation = false;
585 object.queryPlan = null;
586 }
587 if (message.endTime != null && message.hasOwnProperty("endTime"))
588 object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options);
589 if (message.startTime != null && message.hasOwnProperty("startTime"))
590 object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options);
591 if (message.legacySignatureNeedsResigning != null && message.hasOwnProperty("legacySignatureNeedsResigning"))
592 object.legacySignatureNeedsResigning = message.legacySignatureNeedsResigning;
593 if (message.details != null && message.hasOwnProperty("details"))
594 object.details = $root.Trace.Details.toObject(message.details, options);
595 if (message.clientName != null && message.hasOwnProperty("clientName"))
596 object.clientName = message.clientName;
597 if (message.clientVersion != null && message.hasOwnProperty("clientVersion"))
598 object.clientVersion = message.clientVersion;
599 if (message.clientAddress != null && message.hasOwnProperty("clientAddress"))
600 object.clientAddress = message.clientAddress;
601 if (message.http != null && message.hasOwnProperty("http"))
602 object.http = $root.Trace.HTTP.toObject(message.http, options);
603 if (message.durationNs != null && message.hasOwnProperty("durationNs"))
604 if (typeof message.durationNs === "number")
605 object.durationNs = options.longs === String ? String(message.durationNs) : message.durationNs;
606 else
607 object.durationNs = options.longs === String ? $util.Long.prototype.toString.call(message.durationNs) : options.longs === Number ? new $util.LongBits(message.durationNs.low >>> 0, message.durationNs.high >>> 0).toNumber(true) : message.durationNs;
608 if (message.root != null && message.hasOwnProperty("root"))
609 object.root = $root.Trace.Node.toObject(message.root, options);
610 if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy"))
611 object.cachePolicy = $root.Trace.CachePolicy.toObject(message.cachePolicy, options);
612 if (message.signature != null && message.hasOwnProperty("signature"))
613 object.signature = message.signature;
614 if (message.fullQueryCacheHit != null && message.hasOwnProperty("fullQueryCacheHit"))
615 object.fullQueryCacheHit = message.fullQueryCacheHit;
616 if (message.persistedQueryHit != null && message.hasOwnProperty("persistedQueryHit"))
617 object.persistedQueryHit = message.persistedQueryHit;
618 if (message.persistedQueryRegister != null && message.hasOwnProperty("persistedQueryRegister"))
619 object.persistedQueryRegister = message.persistedQueryRegister;
620 if (message.clientReferenceId != null && message.hasOwnProperty("clientReferenceId"))
621 object.clientReferenceId = message.clientReferenceId;
622 if (message.registeredOperation != null && message.hasOwnProperty("registeredOperation"))
623 object.registeredOperation = message.registeredOperation;
624 if (message.forbiddenOperation != null && message.hasOwnProperty("forbiddenOperation"))
625 object.forbiddenOperation = message.forbiddenOperation;
626 if (message.queryPlan != null && message.hasOwnProperty("queryPlan"))
627 object.queryPlan = $root.Trace.QueryPlanNode.toObject(message.queryPlan, options);
628 return object;
629 };
630
631 /**
632 * Converts this Trace to JSON.
633 * @function toJSON
634 * @memberof Trace
635 * @instance
636 * @returns {Object.<string,*>} JSON object
637 */
638 Trace.prototype.toJSON = function toJSON() {
639 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
640 };
641
642 Trace.CachePolicy = (function() {
643
644 /**
645 * Properties of a CachePolicy.
646 * @memberof Trace
647 * @interface ICachePolicy
648 * @property {Trace.CachePolicy.Scope|null} [scope] CachePolicy scope
649 * @property {number|null} [maxAgeNs] CachePolicy maxAgeNs
650 */
651
652 /**
653 * Constructs a new CachePolicy.
654 * @memberof Trace
655 * @classdesc Represents a CachePolicy.
656 * @implements ICachePolicy
657 * @constructor
658 * @param {Trace.ICachePolicy=} [properties] Properties to set
659 */
660 function CachePolicy(properties) {
661 if (properties)
662 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
663 if (properties[keys[i]] != null)
664 this[keys[i]] = properties[keys[i]];
665 }
666
667 /**
668 * CachePolicy scope.
669 * @member {Trace.CachePolicy.Scope} scope
670 * @memberof Trace.CachePolicy
671 * @instance
672 */
673 CachePolicy.prototype.scope = 0;
674
675 /**
676 * CachePolicy maxAgeNs.
677 * @member {number} maxAgeNs
678 * @memberof Trace.CachePolicy
679 * @instance
680 */
681 CachePolicy.prototype.maxAgeNs = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
682
683 /**
684 * Creates a new CachePolicy instance using the specified properties.
685 * @function create
686 * @memberof Trace.CachePolicy
687 * @static
688 * @param {Trace.ICachePolicy=} [properties] Properties to set
689 * @returns {Trace.CachePolicy} CachePolicy instance
690 */
691 CachePolicy.create = function create(properties) {
692 return new CachePolicy(properties);
693 };
694
695 /**
696 * Encodes the specified CachePolicy message. Does not implicitly {@link Trace.CachePolicy.verify|verify} messages.
697 * @function encode
698 * @memberof Trace.CachePolicy
699 * @static
700 * @param {Trace.ICachePolicy} message CachePolicy message or plain object to encode
701 * @param {$protobuf.Writer} [writer] Writer to encode to
702 * @returns {$protobuf.Writer} Writer
703 */
704 CachePolicy.encode = function encode(message, writer) {
705 if (!writer)
706 writer = $Writer.create();
707 if (message.scope != null && Object.hasOwnProperty.call(message, "scope"))
708 writer.uint32(/* id 1, wireType 0 =*/8).int32(message.scope);
709 if (message.maxAgeNs != null && Object.hasOwnProperty.call(message, "maxAgeNs"))
710 writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxAgeNs);
711 return writer;
712 };
713
714 /**
715 * Encodes the specified CachePolicy message, length delimited. Does not implicitly {@link Trace.CachePolicy.verify|verify} messages.
716 * @function encodeDelimited
717 * @memberof Trace.CachePolicy
718 * @static
719 * @param {Trace.ICachePolicy} message CachePolicy message or plain object to encode
720 * @param {$protobuf.Writer} [writer] Writer to encode to
721 * @returns {$protobuf.Writer} Writer
722 */
723 CachePolicy.encodeDelimited = function encodeDelimited(message, writer) {
724 return this.encode(message, writer).ldelim();
725 };
726
727 /**
728 * Decodes a CachePolicy message from the specified reader or buffer.
729 * @function decode
730 * @memberof Trace.CachePolicy
731 * @static
732 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
733 * @param {number} [length] Message length if known beforehand
734 * @returns {Trace.CachePolicy} CachePolicy
735 * @throws {Error} If the payload is not a reader or valid buffer
736 * @throws {$protobuf.util.ProtocolError} If required fields are missing
737 */
738 CachePolicy.decode = function decode(reader, length) {
739 if (!(reader instanceof $Reader))
740 reader = $Reader.create(reader);
741 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.CachePolicy();
742 while (reader.pos < end) {
743 var tag = reader.uint32();
744 switch (tag >>> 3) {
745 case 1:
746 message.scope = reader.int32();
747 break;
748 case 2:
749 message.maxAgeNs = reader.int64();
750 break;
751 default:
752 reader.skipType(tag & 7);
753 break;
754 }
755 }
756 return message;
757 };
758
759 /**
760 * Decodes a CachePolicy message from the specified reader or buffer, length delimited.
761 * @function decodeDelimited
762 * @memberof Trace.CachePolicy
763 * @static
764 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
765 * @returns {Trace.CachePolicy} CachePolicy
766 * @throws {Error} If the payload is not a reader or valid buffer
767 * @throws {$protobuf.util.ProtocolError} If required fields are missing
768 */
769 CachePolicy.decodeDelimited = function decodeDelimited(reader) {
770 if (!(reader instanceof $Reader))
771 reader = new $Reader(reader);
772 return this.decode(reader, reader.uint32());
773 };
774
775 /**
776 * Verifies a CachePolicy message.
777 * @function verify
778 * @memberof Trace.CachePolicy
779 * @static
780 * @param {Object.<string,*>} message Plain object to verify
781 * @returns {string|null} `null` if valid, otherwise the reason why it is not
782 */
783 CachePolicy.verify = function verify(message) {
784 if (typeof message !== "object" || message === null)
785 return "object expected";
786 if (message.scope != null && message.hasOwnProperty("scope"))
787 switch (message.scope) {
788 default:
789 return "scope: enum value expected";
790 case 0:
791 case 1:
792 case 2:
793 break;
794 }
795 if (message.maxAgeNs != null && message.hasOwnProperty("maxAgeNs"))
796 if (!$util.isInteger(message.maxAgeNs) && !(message.maxAgeNs && $util.isInteger(message.maxAgeNs.low) && $util.isInteger(message.maxAgeNs.high)))
797 return "maxAgeNs: integer|Long expected";
798 return null;
799 };
800
801 /**
802 * Creates a CachePolicy message from a plain object. Also converts values to their respective internal types.
803 * @function fromObject
804 * @memberof Trace.CachePolicy
805 * @static
806 * @param {Object.<string,*>} object Plain object
807 * @returns {Trace.CachePolicy} CachePolicy
808 */
809 CachePolicy.fromObject = function fromObject(object) {
810 if (object instanceof $root.Trace.CachePolicy)
811 return object;
812 var message = new $root.Trace.CachePolicy();
813 switch (object.scope) {
814 case "UNKNOWN":
815 case 0:
816 message.scope = 0;
817 break;
818 case "PUBLIC":
819 case 1:
820 message.scope = 1;
821 break;
822 case "PRIVATE":
823 case 2:
824 message.scope = 2;
825 break;
826 }
827 if (object.maxAgeNs != null)
828 if ($util.Long)
829 (message.maxAgeNs = $util.Long.fromValue(object.maxAgeNs)).unsigned = false;
830 else if (typeof object.maxAgeNs === "string")
831 message.maxAgeNs = parseInt(object.maxAgeNs, 10);
832 else if (typeof object.maxAgeNs === "number")
833 message.maxAgeNs = object.maxAgeNs;
834 else if (typeof object.maxAgeNs === "object")
835 message.maxAgeNs = new $util.LongBits(object.maxAgeNs.low >>> 0, object.maxAgeNs.high >>> 0).toNumber();
836 return message;
837 };
838
839 /**
840 * Creates a plain object from a CachePolicy message. Also converts values to other types if specified.
841 * @function toObject
842 * @memberof Trace.CachePolicy
843 * @static
844 * @param {Trace.CachePolicy} message CachePolicy
845 * @param {$protobuf.IConversionOptions} [options] Conversion options
846 * @returns {Object.<string,*>} Plain object
847 */
848 CachePolicy.toObject = function toObject(message, options) {
849 if (!options)
850 options = {};
851 var object = {};
852 if (options.defaults) {
853 object.scope = options.enums === String ? "UNKNOWN" : 0;
854 if ($util.Long) {
855 var long = new $util.Long(0, 0, false);
856 object.maxAgeNs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
857 } else
858 object.maxAgeNs = options.longs === String ? "0" : 0;
859 }
860 if (message.scope != null && message.hasOwnProperty("scope"))
861 object.scope = options.enums === String ? $root.Trace.CachePolicy.Scope[message.scope] : message.scope;
862 if (message.maxAgeNs != null && message.hasOwnProperty("maxAgeNs"))
863 if (typeof message.maxAgeNs === "number")
864 object.maxAgeNs = options.longs === String ? String(message.maxAgeNs) : message.maxAgeNs;
865 else
866 object.maxAgeNs = options.longs === String ? $util.Long.prototype.toString.call(message.maxAgeNs) : options.longs === Number ? new $util.LongBits(message.maxAgeNs.low >>> 0, message.maxAgeNs.high >>> 0).toNumber() : message.maxAgeNs;
867 return object;
868 };
869
870 /**
871 * Converts this CachePolicy to JSON.
872 * @function toJSON
873 * @memberof Trace.CachePolicy
874 * @instance
875 * @returns {Object.<string,*>} JSON object
876 */
877 CachePolicy.prototype.toJSON = function toJSON() {
878 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
879 };
880
881 /**
882 * Scope enum.
883 * @name Trace.CachePolicy.Scope
884 * @enum {string}
885 * @property {number} UNKNOWN=0 UNKNOWN value
886 * @property {number} PUBLIC=1 PUBLIC value
887 * @property {number} PRIVATE=2 PRIVATE value
888 */
889 CachePolicy.Scope = (function() {
890 var valuesById = {}, values = Object.create(valuesById);
891 values[valuesById[0] = "UNKNOWN"] = 0;
892 values[valuesById[1] = "PUBLIC"] = 1;
893 values[valuesById[2] = "PRIVATE"] = 2;
894 return values;
895 })();
896
897 return CachePolicy;
898 })();
899
900 Trace.Details = (function() {
901
902 /**
903 * Properties of a Details.
904 * @memberof Trace
905 * @interface IDetails
906 * @property {Object.<string,string>|null} [variablesJson] Details variablesJson
907 * @property {Object.<string,Uint8Array>|null} [deprecatedVariables] Details deprecatedVariables
908 * @property {string|null} [operationName] Details operationName
909 */
910
911 /**
912 * Constructs a new Details.
913 * @memberof Trace
914 * @classdesc Represents a Details.
915 * @implements IDetails
916 * @constructor
917 * @param {Trace.IDetails=} [properties] Properties to set
918 */
919 function Details(properties) {
920 this.variablesJson = {};
921 this.deprecatedVariables = {};
922 if (properties)
923 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
924 if (properties[keys[i]] != null)
925 this[keys[i]] = properties[keys[i]];
926 }
927
928 /**
929 * Details variablesJson.
930 * @member {Object.<string,string>} variablesJson
931 * @memberof Trace.Details
932 * @instance
933 */
934 Details.prototype.variablesJson = $util.emptyObject;
935
936 /**
937 * Details deprecatedVariables.
938 * @member {Object.<string,Uint8Array>} deprecatedVariables
939 * @memberof Trace.Details
940 * @instance
941 */
942 Details.prototype.deprecatedVariables = $util.emptyObject;
943
944 /**
945 * Details operationName.
946 * @member {string} operationName
947 * @memberof Trace.Details
948 * @instance
949 */
950 Details.prototype.operationName = "";
951
952 /**
953 * Creates a new Details instance using the specified properties.
954 * @function create
955 * @memberof Trace.Details
956 * @static
957 * @param {Trace.IDetails=} [properties] Properties to set
958 * @returns {Trace.Details} Details instance
959 */
960 Details.create = function create(properties) {
961 return new Details(properties);
962 };
963
964 /**
965 * Encodes the specified Details message. Does not implicitly {@link Trace.Details.verify|verify} messages.
966 * @function encode
967 * @memberof Trace.Details
968 * @static
969 * @param {Trace.IDetails} message Details message or plain object to encode
970 * @param {$protobuf.Writer} [writer] Writer to encode to
971 * @returns {$protobuf.Writer} Writer
972 */
973 Details.encode = function encode(message, writer) {
974 if (!writer)
975 writer = $Writer.create();
976 if (message.deprecatedVariables != null && Object.hasOwnProperty.call(message, "deprecatedVariables"))
977 for (var keys = Object.keys(message.deprecatedVariables), i = 0; i < keys.length; ++i)
978 writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.deprecatedVariables[keys[i]]).ldelim();
979 if (message.operationName != null && Object.hasOwnProperty.call(message, "operationName"))
980 writer.uint32(/* id 3, wireType 2 =*/26).string(message.operationName);
981 if (message.variablesJson != null && Object.hasOwnProperty.call(message, "variablesJson"))
982 for (var keys = Object.keys(message.variablesJson), i = 0; i < keys.length; ++i)
983 writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.variablesJson[keys[i]]).ldelim();
984 return writer;
985 };
986
987 /**
988 * Encodes the specified Details message, length delimited. Does not implicitly {@link Trace.Details.verify|verify} messages.
989 * @function encodeDelimited
990 * @memberof Trace.Details
991 * @static
992 * @param {Trace.IDetails} message Details message or plain object to encode
993 * @param {$protobuf.Writer} [writer] Writer to encode to
994 * @returns {$protobuf.Writer} Writer
995 */
996 Details.encodeDelimited = function encodeDelimited(message, writer) {
997 return this.encode(message, writer).ldelim();
998 };
999
1000 /**
1001 * Decodes a Details message from the specified reader or buffer.
1002 * @function decode
1003 * @memberof Trace.Details
1004 * @static
1005 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1006 * @param {number} [length] Message length if known beforehand
1007 * @returns {Trace.Details} Details
1008 * @throws {Error} If the payload is not a reader or valid buffer
1009 * @throws {$protobuf.util.ProtocolError} If required fields are missing
1010 */
1011 Details.decode = function decode(reader, length) {
1012 if (!(reader instanceof $Reader))
1013 reader = $Reader.create(reader);
1014 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Details(), key;
1015 while (reader.pos < end) {
1016 var tag = reader.uint32();
1017 switch (tag >>> 3) {
1018 case 4:
1019 reader.skip().pos++;
1020 if (message.variablesJson === $util.emptyObject)
1021 message.variablesJson = {};
1022 key = reader.string();
1023 reader.pos++;
1024 message.variablesJson[key] = reader.string();
1025 break;
1026 case 1:
1027 reader.skip().pos++;
1028 if (message.deprecatedVariables === $util.emptyObject)
1029 message.deprecatedVariables = {};
1030 key = reader.string();
1031 reader.pos++;
1032 message.deprecatedVariables[key] = reader.bytes();
1033 break;
1034 case 3:
1035 message.operationName = reader.string();
1036 break;
1037 default:
1038 reader.skipType(tag & 7);
1039 break;
1040 }
1041 }
1042 return message;
1043 };
1044
1045 /**
1046 * Decodes a Details message from the specified reader or buffer, length delimited.
1047 * @function decodeDelimited
1048 * @memberof Trace.Details
1049 * @static
1050 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1051 * @returns {Trace.Details} Details
1052 * @throws {Error} If the payload is not a reader or valid buffer
1053 * @throws {$protobuf.util.ProtocolError} If required fields are missing
1054 */
1055 Details.decodeDelimited = function decodeDelimited(reader) {
1056 if (!(reader instanceof $Reader))
1057 reader = new $Reader(reader);
1058 return this.decode(reader, reader.uint32());
1059 };
1060
1061 /**
1062 * Verifies a Details message.
1063 * @function verify
1064 * @memberof Trace.Details
1065 * @static
1066 * @param {Object.<string,*>} message Plain object to verify
1067 * @returns {string|null} `null` if valid, otherwise the reason why it is not
1068 */
1069 Details.verify = function verify(message) {
1070 if (typeof message !== "object" || message === null)
1071 return "object expected";
1072 if (message.variablesJson != null && message.hasOwnProperty("variablesJson")) {
1073 if (!$util.isObject(message.variablesJson))
1074 return "variablesJson: object expected";
1075 var key = Object.keys(message.variablesJson);
1076 for (var i = 0; i < key.length; ++i)
1077 if (!$util.isString(message.variablesJson[key[i]]))
1078 return "variablesJson: string{k:string} expected";
1079 }
1080 if (message.deprecatedVariables != null && message.hasOwnProperty("deprecatedVariables")) {
1081 if (!$util.isObject(message.deprecatedVariables))
1082 return "deprecatedVariables: object expected";
1083 var key = Object.keys(message.deprecatedVariables);
1084 for (var i = 0; i < key.length; ++i)
1085 if (!(message.deprecatedVariables[key[i]] && typeof message.deprecatedVariables[key[i]].length === "number" || $util.isString(message.deprecatedVariables[key[i]])))
1086 return "deprecatedVariables: buffer{k:string} expected";
1087 }
1088 if (message.operationName != null && message.hasOwnProperty("operationName"))
1089 if (!$util.isString(message.operationName))
1090 return "operationName: string expected";
1091 return null;
1092 };
1093
1094 /**
1095 * Creates a Details message from a plain object. Also converts values to their respective internal types.
1096 * @function fromObject
1097 * @memberof Trace.Details
1098 * @static
1099 * @param {Object.<string,*>} object Plain object
1100 * @returns {Trace.Details} Details
1101 */
1102 Details.fromObject = function fromObject(object) {
1103 if (object instanceof $root.Trace.Details)
1104 return object;
1105 var message = new $root.Trace.Details();
1106 if (object.variablesJson) {
1107 if (typeof object.variablesJson !== "object")
1108 throw TypeError(".Trace.Details.variablesJson: object expected");
1109 message.variablesJson = {};
1110 for (var keys = Object.keys(object.variablesJson), i = 0; i < keys.length; ++i)
1111 message.variablesJson[keys[i]] = String(object.variablesJson[keys[i]]);
1112 }
1113 if (object.deprecatedVariables) {
1114 if (typeof object.deprecatedVariables !== "object")
1115 throw TypeError(".Trace.Details.deprecatedVariables: object expected");
1116 message.deprecatedVariables = {};
1117 for (var keys = Object.keys(object.deprecatedVariables), i = 0; i < keys.length; ++i)
1118 if (typeof object.deprecatedVariables[keys[i]] === "string")
1119 $util.base64.decode(object.deprecatedVariables[keys[i]], message.deprecatedVariables[keys[i]] = $util.newBuffer($util.base64.length(object.deprecatedVariables[keys[i]])), 0);
1120 else if (object.deprecatedVariables[keys[i]].length)
1121 message.deprecatedVariables[keys[i]] = object.deprecatedVariables[keys[i]];
1122 }
1123 if (object.operationName != null)
1124 message.operationName = String(object.operationName);
1125 return message;
1126 };
1127
1128 /**
1129 * Creates a plain object from a Details message. Also converts values to other types if specified.
1130 * @function toObject
1131 * @memberof Trace.Details
1132 * @static
1133 * @param {Trace.Details} message Details
1134 * @param {$protobuf.IConversionOptions} [options] Conversion options
1135 * @returns {Object.<string,*>} Plain object
1136 */
1137 Details.toObject = function toObject(message, options) {
1138 if (!options)
1139 options = {};
1140 var object = {};
1141 if (options.objects || options.defaults) {
1142 object.deprecatedVariables = {};
1143 object.variablesJson = {};
1144 }
1145 if (options.defaults)
1146 object.operationName = "";
1147 var keys2;
1148 if (message.deprecatedVariables && (keys2 = Object.keys(message.deprecatedVariables)).length) {
1149 object.deprecatedVariables = {};
1150 for (var j = 0; j < keys2.length; ++j)
1151 object.deprecatedVariables[keys2[j]] = options.bytes === String ? $util.base64.encode(message.deprecatedVariables[keys2[j]], 0, message.deprecatedVariables[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.deprecatedVariables[keys2[j]]) : message.deprecatedVariables[keys2[j]];
1152 }
1153 if (message.operationName != null && message.hasOwnProperty("operationName"))
1154 object.operationName = message.operationName;
1155 if (message.variablesJson && (keys2 = Object.keys(message.variablesJson)).length) {
1156 object.variablesJson = {};
1157 for (var j = 0; j < keys2.length; ++j)
1158 object.variablesJson[keys2[j]] = message.variablesJson[keys2[j]];
1159 }
1160 return object;
1161 };
1162
1163 /**
1164 * Converts this Details to JSON.
1165 * @function toJSON
1166 * @memberof Trace.Details
1167 * @instance
1168 * @returns {Object.<string,*>} JSON object
1169 */
1170 Details.prototype.toJSON = function toJSON() {
1171 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1172 };
1173
1174 return Details;
1175 })();
1176
1177 Trace.Error = (function() {
1178
1179 /**
1180 * Properties of an Error.
1181 * @memberof Trace
1182 * @interface IError
1183 * @property {string|null} [message] Error message
1184 * @property {Array.<Trace.ILocation>|null} [location] Error location
1185 * @property {number|null} [timeNs] Error timeNs
1186 * @property {string|null} [json] Error json
1187 */
1188
1189 /**
1190 * Constructs a new Error.
1191 * @memberof Trace
1192 * @classdesc Represents an Error.
1193 * @implements IError
1194 * @constructor
1195 * @param {Trace.IError=} [properties] Properties to set
1196 */
1197 function Error(properties) {
1198 this.location = [];
1199 if (properties)
1200 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1201 if (properties[keys[i]] != null)
1202 this[keys[i]] = properties[keys[i]];
1203 }
1204
1205 /**
1206 * Error message.
1207 * @member {string} message
1208 * @memberof Trace.Error
1209 * @instance
1210 */
1211 Error.prototype.message = "";
1212
1213 /**
1214 * Error location.
1215 * @member {Array.<Trace.ILocation>} location
1216 * @memberof Trace.Error
1217 * @instance
1218 */
1219 Error.prototype.location = $util.emptyArray;
1220
1221 /**
1222 * Error timeNs.
1223 * @member {number} timeNs
1224 * @memberof Trace.Error
1225 * @instance
1226 */
1227 Error.prototype.timeNs = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
1228
1229 /**
1230 * Error json.
1231 * @member {string} json
1232 * @memberof Trace.Error
1233 * @instance
1234 */
1235 Error.prototype.json = "";
1236
1237 /**
1238 * Creates a new Error instance using the specified properties.
1239 * @function create
1240 * @memberof Trace.Error
1241 * @static
1242 * @param {Trace.IError=} [properties] Properties to set
1243 * @returns {Trace.Error} Error instance
1244 */
1245 Error.create = function create(properties) {
1246 return new Error(properties);
1247 };
1248
1249 /**
1250 * Encodes the specified Error message. Does not implicitly {@link Trace.Error.verify|verify} messages.
1251 * @function encode
1252 * @memberof Trace.Error
1253 * @static
1254 * @param {Trace.IError} message Error message or plain object to encode
1255 * @param {$protobuf.Writer} [writer] Writer to encode to
1256 * @returns {$protobuf.Writer} Writer
1257 */
1258 Error.encode = function encode(message, writer) {
1259 if (!writer)
1260 writer = $Writer.create();
1261 if (message.message != null && Object.hasOwnProperty.call(message, "message"))
1262 writer.uint32(/* id 1, wireType 2 =*/10).string(message.message);
1263 if (message.location != null && message.location.length)
1264 for (var i = 0; i < message.location.length; ++i)
1265 $root.Trace.Location.encode(message.location[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
1266 if (message.timeNs != null && Object.hasOwnProperty.call(message, "timeNs"))
1267 writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timeNs);
1268 if (message.json != null && Object.hasOwnProperty.call(message, "json"))
1269 writer.uint32(/* id 4, wireType 2 =*/34).string(message.json);
1270 return writer;
1271 };
1272
1273 /**
1274 * Encodes the specified Error message, length delimited. Does not implicitly {@link Trace.Error.verify|verify} messages.
1275 * @function encodeDelimited
1276 * @memberof Trace.Error
1277 * @static
1278 * @param {Trace.IError} message Error message or plain object to encode
1279 * @param {$protobuf.Writer} [writer] Writer to encode to
1280 * @returns {$protobuf.Writer} Writer
1281 */
1282 Error.encodeDelimited = function encodeDelimited(message, writer) {
1283 return this.encode(message, writer).ldelim();
1284 };
1285
1286 /**
1287 * Decodes an Error message from the specified reader or buffer.
1288 * @function decode
1289 * @memberof Trace.Error
1290 * @static
1291 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1292 * @param {number} [length] Message length if known beforehand
1293 * @returns {Trace.Error} Error
1294 * @throws {Error} If the payload is not a reader or valid buffer
1295 * @throws {$protobuf.util.ProtocolError} If required fields are missing
1296 */
1297 Error.decode = function decode(reader, length) {
1298 if (!(reader instanceof $Reader))
1299 reader = $Reader.create(reader);
1300 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Error();
1301 while (reader.pos < end) {
1302 var tag = reader.uint32();
1303 switch (tag >>> 3) {
1304 case 1:
1305 message.message = reader.string();
1306 break;
1307 case 2:
1308 if (!(message.location && message.location.length))
1309 message.location = [];
1310 message.location.push($root.Trace.Location.decode(reader, reader.uint32()));
1311 break;
1312 case 3:
1313 message.timeNs = reader.uint64();
1314 break;
1315 case 4:
1316 message.json = reader.string();
1317 break;
1318 default:
1319 reader.skipType(tag & 7);
1320 break;
1321 }
1322 }
1323 return message;
1324 };
1325
1326 /**
1327 * Decodes an Error message from the specified reader or buffer, length delimited.
1328 * @function decodeDelimited
1329 * @memberof Trace.Error
1330 * @static
1331 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1332 * @returns {Trace.Error} Error
1333 * @throws {Error} If the payload is not a reader or valid buffer
1334 * @throws {$protobuf.util.ProtocolError} If required fields are missing
1335 */
1336 Error.decodeDelimited = function decodeDelimited(reader) {
1337 if (!(reader instanceof $Reader))
1338 reader = new $Reader(reader);
1339 return this.decode(reader, reader.uint32());
1340 };
1341
1342 /**
1343 * Verifies an Error message.
1344 * @function verify
1345 * @memberof Trace.Error
1346 * @static
1347 * @param {Object.<string,*>} message Plain object to verify
1348 * @returns {string|null} `null` if valid, otherwise the reason why it is not
1349 */
1350 Error.verify = function verify(message) {
1351 if (typeof message !== "object" || message === null)
1352 return "object expected";
1353 if (message.message != null && message.hasOwnProperty("message"))
1354 if (!$util.isString(message.message))
1355 return "message: string expected";
1356 if (message.location != null && message.hasOwnProperty("location")) {
1357 if (!Array.isArray(message.location))
1358 return "location: array expected";
1359 for (var i = 0; i < message.location.length; ++i) {
1360 var error = $root.Trace.Location.verify(message.location[i]);
1361 if (error)
1362 return "location." + error;
1363 }
1364 }
1365 if (message.timeNs != null && message.hasOwnProperty("timeNs"))
1366 if (!$util.isInteger(message.timeNs) && !(message.timeNs && $util.isInteger(message.timeNs.low) && $util.isInteger(message.timeNs.high)))
1367 return "timeNs: integer|Long expected";
1368 if (message.json != null && message.hasOwnProperty("json"))
1369 if (!$util.isString(message.json))
1370 return "json: string expected";
1371 return null;
1372 };
1373
1374 /**
1375 * Creates an Error message from a plain object. Also converts values to their respective internal types.
1376 * @function fromObject
1377 * @memberof Trace.Error
1378 * @static
1379 * @param {Object.<string,*>} object Plain object
1380 * @returns {Trace.Error} Error
1381 */
1382 Error.fromObject = function fromObject(object) {
1383 if (object instanceof $root.Trace.Error)
1384 return object;
1385 var message = new $root.Trace.Error();
1386 if (object.message != null)
1387 message.message = String(object.message);
1388 if (object.location) {
1389 if (!Array.isArray(object.location))
1390 throw TypeError(".Trace.Error.location: array expected");
1391 message.location = [];
1392 for (var i = 0; i < object.location.length; ++i) {
1393 if (typeof object.location[i] !== "object")
1394 throw TypeError(".Trace.Error.location: object expected");
1395 message.location[i] = $root.Trace.Location.fromObject(object.location[i]);
1396 }
1397 }
1398 if (object.timeNs != null)
1399 if ($util.Long)
1400 (message.timeNs = $util.Long.fromValue(object.timeNs)).unsigned = true;
1401 else if (typeof object.timeNs === "string")
1402 message.timeNs = parseInt(object.timeNs, 10);
1403 else if (typeof object.timeNs === "number")
1404 message.timeNs = object.timeNs;
1405 else if (typeof object.timeNs === "object")
1406 message.timeNs = new $util.LongBits(object.timeNs.low >>> 0, object.timeNs.high >>> 0).toNumber(true);
1407 if (object.json != null)
1408 message.json = String(object.json);
1409 return message;
1410 };
1411
1412 /**
1413 * Creates a plain object from an Error message. Also converts values to other types if specified.
1414 * @function toObject
1415 * @memberof Trace.Error
1416 * @static
1417 * @param {Trace.Error} message Error
1418 * @param {$protobuf.IConversionOptions} [options] Conversion options
1419 * @returns {Object.<string,*>} Plain object
1420 */
1421 Error.toObject = function toObject(message, options) {
1422 if (!options)
1423 options = {};
1424 var object = {};
1425 if (options.arrays || options.defaults)
1426 object.location = [];
1427 if (options.defaults) {
1428 object.message = "";
1429 if ($util.Long) {
1430 var long = new $util.Long(0, 0, true);
1431 object.timeNs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1432 } else
1433 object.timeNs = options.longs === String ? "0" : 0;
1434 object.json = "";
1435 }
1436 if (message.message != null && message.hasOwnProperty("message"))
1437 object.message = message.message;
1438 if (message.location && message.location.length) {
1439 object.location = [];
1440 for (var j = 0; j < message.location.length; ++j)
1441 object.location[j] = $root.Trace.Location.toObject(message.location[j], options);
1442 }
1443 if (message.timeNs != null && message.hasOwnProperty("timeNs"))
1444 if (typeof message.timeNs === "number")
1445 object.timeNs = options.longs === String ? String(message.timeNs) : message.timeNs;
1446 else
1447 object.timeNs = options.longs === String ? $util.Long.prototype.toString.call(message.timeNs) : options.longs === Number ? new $util.LongBits(message.timeNs.low >>> 0, message.timeNs.high >>> 0).toNumber(true) : message.timeNs;
1448 if (message.json != null && message.hasOwnProperty("json"))
1449 object.json = message.json;
1450 return object;
1451 };
1452
1453 /**
1454 * Converts this Error to JSON.
1455 * @function toJSON
1456 * @memberof Trace.Error
1457 * @instance
1458 * @returns {Object.<string,*>} JSON object
1459 */
1460 Error.prototype.toJSON = function toJSON() {
1461 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1462 };
1463
1464 return Error;
1465 })();
1466
1467 Trace.HTTP = (function() {
1468
1469 /**
1470 * Properties of a HTTP.
1471 * @memberof Trace
1472 * @interface IHTTP
1473 * @property {Trace.HTTP.Method|null} [method] HTTP method
1474 * @property {string|null} [host] HTTP host
1475 * @property {string|null} [path] HTTP path
1476 * @property {Object.<string,Trace.HTTP.IValues>|null} [requestHeaders] HTTP requestHeaders
1477 * @property {Object.<string,Trace.HTTP.IValues>|null} [responseHeaders] HTTP responseHeaders
1478 * @property {number|null} [statusCode] HTTP statusCode
1479 * @property {boolean|null} [secure] HTTP secure
1480 * @property {string|null} [protocol] HTTP protocol
1481 */
1482
1483 /**
1484 * Constructs a new HTTP.
1485 * @memberof Trace
1486 * @classdesc Represents a HTTP.
1487 * @implements IHTTP
1488 * @constructor
1489 * @param {Trace.IHTTP=} [properties] Properties to set
1490 */
1491 function HTTP(properties) {
1492 this.requestHeaders = {};
1493 this.responseHeaders = {};
1494 if (properties)
1495 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1496 if (properties[keys[i]] != null)
1497 this[keys[i]] = properties[keys[i]];
1498 }
1499
1500 /**
1501 * HTTP method.
1502 * @member {Trace.HTTP.Method} method
1503 * @memberof Trace.HTTP
1504 * @instance
1505 */
1506 HTTP.prototype.method = 0;
1507
1508 /**
1509 * HTTP host.
1510 * @member {string} host
1511 * @memberof Trace.HTTP
1512 * @instance
1513 */
1514 HTTP.prototype.host = "";
1515
1516 /**
1517 * HTTP path.
1518 * @member {string} path
1519 * @memberof Trace.HTTP
1520 * @instance
1521 */
1522 HTTP.prototype.path = "";
1523
1524 /**
1525 * HTTP requestHeaders.
1526 * @member {Object.<string,Trace.HTTP.IValues>} requestHeaders
1527 * @memberof Trace.HTTP
1528 * @instance
1529 */
1530 HTTP.prototype.requestHeaders = $util.emptyObject;
1531
1532 /**
1533 * HTTP responseHeaders.
1534 * @member {Object.<string,Trace.HTTP.IValues>} responseHeaders
1535 * @memberof Trace.HTTP
1536 * @instance
1537 */
1538 HTTP.prototype.responseHeaders = $util.emptyObject;
1539
1540 /**
1541 * HTTP statusCode.
1542 * @member {number} statusCode
1543 * @memberof Trace.HTTP
1544 * @instance
1545 */
1546 HTTP.prototype.statusCode = 0;
1547
1548 /**
1549 * HTTP secure.
1550 * @member {boolean} secure
1551 * @memberof Trace.HTTP
1552 * @instance
1553 */
1554 HTTP.prototype.secure = false;
1555
1556 /**
1557 * HTTP protocol.
1558 * @member {string} protocol
1559 * @memberof Trace.HTTP
1560 * @instance
1561 */
1562 HTTP.prototype.protocol = "";
1563
1564 /**
1565 * Creates a new HTTP instance using the specified properties.
1566 * @function create
1567 * @memberof Trace.HTTP
1568 * @static
1569 * @param {Trace.IHTTP=} [properties] Properties to set
1570 * @returns {Trace.HTTP} HTTP instance
1571 */
1572 HTTP.create = function create(properties) {
1573 return new HTTP(properties);
1574 };
1575
1576 /**
1577 * Encodes the specified HTTP message. Does not implicitly {@link Trace.HTTP.verify|verify} messages.
1578 * @function encode
1579 * @memberof Trace.HTTP
1580 * @static
1581 * @param {Trace.IHTTP} message HTTP message or plain object to encode
1582 * @param {$protobuf.Writer} [writer] Writer to encode to
1583 * @returns {$protobuf.Writer} Writer
1584 */
1585 HTTP.encode = function encode(message, writer) {
1586 if (!writer)
1587 writer = $Writer.create();
1588 if (message.method != null && Object.hasOwnProperty.call(message, "method"))
1589 writer.uint32(/* id 1, wireType 0 =*/8).int32(message.method);
1590 if (message.host != null && Object.hasOwnProperty.call(message, "host"))
1591 writer.uint32(/* id 2, wireType 2 =*/18).string(message.host);
1592 if (message.path != null && Object.hasOwnProperty.call(message, "path"))
1593 writer.uint32(/* id 3, wireType 2 =*/26).string(message.path);
1594 if (message.requestHeaders != null && Object.hasOwnProperty.call(message, "requestHeaders"))
1595 for (var keys = Object.keys(message.requestHeaders), i = 0; i < keys.length; ++i) {
1596 writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
1597 $root.Trace.HTTP.Values.encode(message.requestHeaders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
1598 }
1599 if (message.responseHeaders != null && Object.hasOwnProperty.call(message, "responseHeaders"))
1600 for (var keys = Object.keys(message.responseHeaders), i = 0; i < keys.length; ++i) {
1601 writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
1602 $root.Trace.HTTP.Values.encode(message.responseHeaders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
1603 }
1604 if (message.statusCode != null && Object.hasOwnProperty.call(message, "statusCode"))
1605 writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.statusCode);
1606 if (message.secure != null && Object.hasOwnProperty.call(message, "secure"))
1607 writer.uint32(/* id 8, wireType 0 =*/64).bool(message.secure);
1608 if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol"))
1609 writer.uint32(/* id 9, wireType 2 =*/74).string(message.protocol);
1610 return writer;
1611 };
1612
1613 /**
1614 * Encodes the specified HTTP message, length delimited. Does not implicitly {@link Trace.HTTP.verify|verify} messages.
1615 * @function encodeDelimited
1616 * @memberof Trace.HTTP
1617 * @static
1618 * @param {Trace.IHTTP} message HTTP message or plain object to encode
1619 * @param {$protobuf.Writer} [writer] Writer to encode to
1620 * @returns {$protobuf.Writer} Writer
1621 */
1622 HTTP.encodeDelimited = function encodeDelimited(message, writer) {
1623 return this.encode(message, writer).ldelim();
1624 };
1625
1626 /**
1627 * Decodes a HTTP message from the specified reader or buffer.
1628 * @function decode
1629 * @memberof Trace.HTTP
1630 * @static
1631 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1632 * @param {number} [length] Message length if known beforehand
1633 * @returns {Trace.HTTP} HTTP
1634 * @throws {Error} If the payload is not a reader or valid buffer
1635 * @throws {$protobuf.util.ProtocolError} If required fields are missing
1636 */
1637 HTTP.decode = function decode(reader, length) {
1638 if (!(reader instanceof $Reader))
1639 reader = $Reader.create(reader);
1640 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.HTTP(), key;
1641 while (reader.pos < end) {
1642 var tag = reader.uint32();
1643 switch (tag >>> 3) {
1644 case 1:
1645 message.method = reader.int32();
1646 break;
1647 case 2:
1648 message.host = reader.string();
1649 break;
1650 case 3:
1651 message.path = reader.string();
1652 break;
1653 case 4:
1654 reader.skip().pos++;
1655 if (message.requestHeaders === $util.emptyObject)
1656 message.requestHeaders = {};
1657 key = reader.string();
1658 reader.pos++;
1659 message.requestHeaders[key] = $root.Trace.HTTP.Values.decode(reader, reader.uint32());
1660 break;
1661 case 5:
1662 reader.skip().pos++;
1663 if (message.responseHeaders === $util.emptyObject)
1664 message.responseHeaders = {};
1665 key = reader.string();
1666 reader.pos++;
1667 message.responseHeaders[key] = $root.Trace.HTTP.Values.decode(reader, reader.uint32());
1668 break;
1669 case 6:
1670 message.statusCode = reader.uint32();
1671 break;
1672 case 8:
1673 message.secure = reader.bool();
1674 break;
1675 case 9:
1676 message.protocol = reader.string();
1677 break;
1678 default:
1679 reader.skipType(tag & 7);
1680 break;
1681 }
1682 }
1683 return message;
1684 };
1685
1686 /**
1687 * Decodes a HTTP message from the specified reader or buffer, length delimited.
1688 * @function decodeDelimited
1689 * @memberof Trace.HTTP
1690 * @static
1691 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1692 * @returns {Trace.HTTP} HTTP
1693 * @throws {Error} If the payload is not a reader or valid buffer
1694 * @throws {$protobuf.util.ProtocolError} If required fields are missing
1695 */
1696 HTTP.decodeDelimited = function decodeDelimited(reader) {
1697 if (!(reader instanceof $Reader))
1698 reader = new $Reader(reader);
1699 return this.decode(reader, reader.uint32());
1700 };
1701
1702 /**
1703 * Verifies a HTTP message.
1704 * @function verify
1705 * @memberof Trace.HTTP
1706 * @static
1707 * @param {Object.<string,*>} message Plain object to verify
1708 * @returns {string|null} `null` if valid, otherwise the reason why it is not
1709 */
1710 HTTP.verify = function verify(message) {
1711 if (typeof message !== "object" || message === null)
1712 return "object expected";
1713 if (message.method != null && message.hasOwnProperty("method"))
1714 switch (message.method) {
1715 default:
1716 return "method: enum value expected";
1717 case 0:
1718 case 1:
1719 case 2:
1720 case 3:
1721 case 4:
1722 case 5:
1723 case 6:
1724 case 7:
1725 case 8:
1726 case 9:
1727 break;
1728 }
1729 if (message.host != null && message.hasOwnProperty("host"))
1730 if (!$util.isString(message.host))
1731 return "host: string expected";
1732 if (message.path != null && message.hasOwnProperty("path"))
1733 if (!$util.isString(message.path))
1734 return "path: string expected";
1735 if (message.requestHeaders != null && message.hasOwnProperty("requestHeaders")) {
1736 if (!$util.isObject(message.requestHeaders))
1737 return "requestHeaders: object expected";
1738 var key = Object.keys(message.requestHeaders);
1739 for (var i = 0; i < key.length; ++i) {
1740 var error = $root.Trace.HTTP.Values.verify(message.requestHeaders[key[i]]);
1741 if (error)
1742 return "requestHeaders." + error;
1743 }
1744 }
1745 if (message.responseHeaders != null && message.hasOwnProperty("responseHeaders")) {
1746 if (!$util.isObject(message.responseHeaders))
1747 return "responseHeaders: object expected";
1748 var key = Object.keys(message.responseHeaders);
1749 for (var i = 0; i < key.length; ++i) {
1750 var error = $root.Trace.HTTP.Values.verify(message.responseHeaders[key[i]]);
1751 if (error)
1752 return "responseHeaders." + error;
1753 }
1754 }
1755 if (message.statusCode != null && message.hasOwnProperty("statusCode"))
1756 if (!$util.isInteger(message.statusCode))
1757 return "statusCode: integer expected";
1758 if (message.secure != null && message.hasOwnProperty("secure"))
1759 if (typeof message.secure !== "boolean")
1760 return "secure: boolean expected";
1761 if (message.protocol != null && message.hasOwnProperty("protocol"))
1762 if (!$util.isString(message.protocol))
1763 return "protocol: string expected";
1764 return null;
1765 };
1766
1767 /**
1768 * Creates a HTTP message from a plain object. Also converts values to their respective internal types.
1769 * @function fromObject
1770 * @memberof Trace.HTTP
1771 * @static
1772 * @param {Object.<string,*>} object Plain object
1773 * @returns {Trace.HTTP} HTTP
1774 */
1775 HTTP.fromObject = function fromObject(object) {
1776 if (object instanceof $root.Trace.HTTP)
1777 return object;
1778 var message = new $root.Trace.HTTP();
1779 switch (object.method) {
1780 case "UNKNOWN":
1781 case 0:
1782 message.method = 0;
1783 break;
1784 case "OPTIONS":
1785 case 1:
1786 message.method = 1;
1787 break;
1788 case "GET":
1789 case 2:
1790 message.method = 2;
1791 break;
1792 case "HEAD":
1793 case 3:
1794 message.method = 3;
1795 break;
1796 case "POST":
1797 case 4:
1798 message.method = 4;
1799 break;
1800 case "PUT":
1801 case 5:
1802 message.method = 5;
1803 break;
1804 case "DELETE":
1805 case 6:
1806 message.method = 6;
1807 break;
1808 case "TRACE":
1809 case 7:
1810 message.method = 7;
1811 break;
1812 case "CONNECT":
1813 case 8:
1814 message.method = 8;
1815 break;
1816 case "PATCH":
1817 case 9:
1818 message.method = 9;
1819 break;
1820 }
1821 if (object.host != null)
1822 message.host = String(object.host);
1823 if (object.path != null)
1824 message.path = String(object.path);
1825 if (object.requestHeaders) {
1826 if (typeof object.requestHeaders !== "object")
1827 throw TypeError(".Trace.HTTP.requestHeaders: object expected");
1828 message.requestHeaders = {};
1829 for (var keys = Object.keys(object.requestHeaders), i = 0; i < keys.length; ++i) {
1830 if (typeof object.requestHeaders[keys[i]] !== "object")
1831 throw TypeError(".Trace.HTTP.requestHeaders: object expected");
1832 message.requestHeaders[keys[i]] = $root.Trace.HTTP.Values.fromObject(object.requestHeaders[keys[i]]);
1833 }
1834 }
1835 if (object.responseHeaders) {
1836 if (typeof object.responseHeaders !== "object")
1837 throw TypeError(".Trace.HTTP.responseHeaders: object expected");
1838 message.responseHeaders = {};
1839 for (var keys = Object.keys(object.responseHeaders), i = 0; i < keys.length; ++i) {
1840 if (typeof object.responseHeaders[keys[i]] !== "object")
1841 throw TypeError(".Trace.HTTP.responseHeaders: object expected");
1842 message.responseHeaders[keys[i]] = $root.Trace.HTTP.Values.fromObject(object.responseHeaders[keys[i]]);
1843 }
1844 }
1845 if (object.statusCode != null)
1846 message.statusCode = object.statusCode >>> 0;
1847 if (object.secure != null)
1848 message.secure = Boolean(object.secure);
1849 if (object.protocol != null)
1850 message.protocol = String(object.protocol);
1851 return message;
1852 };
1853
1854 /**
1855 * Creates a plain object from a HTTP message. Also converts values to other types if specified.
1856 * @function toObject
1857 * @memberof Trace.HTTP
1858 * @static
1859 * @param {Trace.HTTP} message HTTP
1860 * @param {$protobuf.IConversionOptions} [options] Conversion options
1861 * @returns {Object.<string,*>} Plain object
1862 */
1863 HTTP.toObject = function toObject(message, options) {
1864 if (!options)
1865 options = {};
1866 var object = {};
1867 if (options.objects || options.defaults) {
1868 object.requestHeaders = {};
1869 object.responseHeaders = {};
1870 }
1871 if (options.defaults) {
1872 object.method = options.enums === String ? "UNKNOWN" : 0;
1873 object.host = "";
1874 object.path = "";
1875 object.statusCode = 0;
1876 object.secure = false;
1877 object.protocol = "";
1878 }
1879 if (message.method != null && message.hasOwnProperty("method"))
1880 object.method = options.enums === String ? $root.Trace.HTTP.Method[message.method] : message.method;
1881 if (message.host != null && message.hasOwnProperty("host"))
1882 object.host = message.host;
1883 if (message.path != null && message.hasOwnProperty("path"))
1884 object.path = message.path;
1885 var keys2;
1886 if (message.requestHeaders && (keys2 = Object.keys(message.requestHeaders)).length) {
1887 object.requestHeaders = {};
1888 for (var j = 0; j < keys2.length; ++j)
1889 object.requestHeaders[keys2[j]] = $root.Trace.HTTP.Values.toObject(message.requestHeaders[keys2[j]], options);
1890 }
1891 if (message.responseHeaders && (keys2 = Object.keys(message.responseHeaders)).length) {
1892 object.responseHeaders = {};
1893 for (var j = 0; j < keys2.length; ++j)
1894 object.responseHeaders[keys2[j]] = $root.Trace.HTTP.Values.toObject(message.responseHeaders[keys2[j]], options);
1895 }
1896 if (message.statusCode != null && message.hasOwnProperty("statusCode"))
1897 object.statusCode = message.statusCode;
1898 if (message.secure != null && message.hasOwnProperty("secure"))
1899 object.secure = message.secure;
1900 if (message.protocol != null && message.hasOwnProperty("protocol"))
1901 object.protocol = message.protocol;
1902 return object;
1903 };
1904
1905 /**
1906 * Converts this HTTP to JSON.
1907 * @function toJSON
1908 * @memberof Trace.HTTP
1909 * @instance
1910 * @returns {Object.<string,*>} JSON object
1911 */
1912 HTTP.prototype.toJSON = function toJSON() {
1913 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1914 };
1915
1916 HTTP.Values = (function() {
1917
1918 /**
1919 * Properties of a Values.
1920 * @memberof Trace.HTTP
1921 * @interface IValues
1922 * @property {Array.<string>|null} [value] Values value
1923 */
1924
1925 /**
1926 * Constructs a new Values.
1927 * @memberof Trace.HTTP
1928 * @classdesc Represents a Values.
1929 * @implements IValues
1930 * @constructor
1931 * @param {Trace.HTTP.IValues=} [properties] Properties to set
1932 */
1933 function Values(properties) {
1934 this.value = [];
1935 if (properties)
1936 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1937 if (properties[keys[i]] != null)
1938 this[keys[i]] = properties[keys[i]];
1939 }
1940
1941 /**
1942 * Values value.
1943 * @member {Array.<string>} value
1944 * @memberof Trace.HTTP.Values
1945 * @instance
1946 */
1947 Values.prototype.value = $util.emptyArray;
1948
1949 /**
1950 * Creates a new Values instance using the specified properties.
1951 * @function create
1952 * @memberof Trace.HTTP.Values
1953 * @static
1954 * @param {Trace.HTTP.IValues=} [properties] Properties to set
1955 * @returns {Trace.HTTP.Values} Values instance
1956 */
1957 Values.create = function create(properties) {
1958 return new Values(properties);
1959 };
1960
1961 /**
1962 * Encodes the specified Values message. Does not implicitly {@link Trace.HTTP.Values.verify|verify} messages.
1963 * @function encode
1964 * @memberof Trace.HTTP.Values
1965 * @static
1966 * @param {Trace.HTTP.IValues} message Values message or plain object to encode
1967 * @param {$protobuf.Writer} [writer] Writer to encode to
1968 * @returns {$protobuf.Writer} Writer
1969 */
1970 Values.encode = function encode(message, writer) {
1971 if (!writer)
1972 writer = $Writer.create();
1973 if (message.value != null && message.value.length)
1974 for (var i = 0; i < message.value.length; ++i)
1975 writer.uint32(/* id 1, wireType 2 =*/10).string(message.value[i]);
1976 return writer;
1977 };
1978
1979 /**
1980 * Encodes the specified Values message, length delimited. Does not implicitly {@link Trace.HTTP.Values.verify|verify} messages.
1981 * @function encodeDelimited
1982 * @memberof Trace.HTTP.Values
1983 * @static
1984 * @param {Trace.HTTP.IValues} message Values message or plain object to encode
1985 * @param {$protobuf.Writer} [writer] Writer to encode to
1986 * @returns {$protobuf.Writer} Writer
1987 */
1988 Values.encodeDelimited = function encodeDelimited(message, writer) {
1989 return this.encode(message, writer).ldelim();
1990 };
1991
1992 /**
1993 * Decodes a Values message from the specified reader or buffer.
1994 * @function decode
1995 * @memberof Trace.HTTP.Values
1996 * @static
1997 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1998 * @param {number} [length] Message length if known beforehand
1999 * @returns {Trace.HTTP.Values} Values
2000 * @throws {Error} If the payload is not a reader or valid buffer
2001 * @throws {$protobuf.util.ProtocolError} If required fields are missing
2002 */
2003 Values.decode = function decode(reader, length) {
2004 if (!(reader instanceof $Reader))
2005 reader = $Reader.create(reader);
2006 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.HTTP.Values();
2007 while (reader.pos < end) {
2008 var tag = reader.uint32();
2009 switch (tag >>> 3) {
2010 case 1:
2011 if (!(message.value && message.value.length))
2012 message.value = [];
2013 message.value.push(reader.string());
2014 break;
2015 default:
2016 reader.skipType(tag & 7);
2017 break;
2018 }
2019 }
2020 return message;
2021 };
2022
2023 /**
2024 * Decodes a Values message from the specified reader or buffer, length delimited.
2025 * @function decodeDelimited
2026 * @memberof Trace.HTTP.Values
2027 * @static
2028 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2029 * @returns {Trace.HTTP.Values} Values
2030 * @throws {Error} If the payload is not a reader or valid buffer
2031 * @throws {$protobuf.util.ProtocolError} If required fields are missing
2032 */
2033 Values.decodeDelimited = function decodeDelimited(reader) {
2034 if (!(reader instanceof $Reader))
2035 reader = new $Reader(reader);
2036 return this.decode(reader, reader.uint32());
2037 };
2038
2039 /**
2040 * Verifies a Values message.
2041 * @function verify
2042 * @memberof Trace.HTTP.Values
2043 * @static
2044 * @param {Object.<string,*>} message Plain object to verify
2045 * @returns {string|null} `null` if valid, otherwise the reason why it is not
2046 */
2047 Values.verify = function verify(message) {
2048 if (typeof message !== "object" || message === null)
2049 return "object expected";
2050 if (message.value != null && message.hasOwnProperty("value")) {
2051 if (!Array.isArray(message.value))
2052 return "value: array expected";
2053 for (var i = 0; i < message.value.length; ++i)
2054 if (!$util.isString(message.value[i]))
2055 return "value: string[] expected";
2056 }
2057 return null;
2058 };
2059
2060 /**
2061 * Creates a Values message from a plain object. Also converts values to their respective internal types.
2062 * @function fromObject
2063 * @memberof Trace.HTTP.Values
2064 * @static
2065 * @param {Object.<string,*>} object Plain object
2066 * @returns {Trace.HTTP.Values} Values
2067 */
2068 Values.fromObject = function fromObject(object) {
2069 if (object instanceof $root.Trace.HTTP.Values)
2070 return object;
2071 var message = new $root.Trace.HTTP.Values();
2072 if (object.value) {
2073 if (!Array.isArray(object.value))
2074 throw TypeError(".Trace.HTTP.Values.value: array expected");
2075 message.value = [];
2076 for (var i = 0; i < object.value.length; ++i)
2077 message.value[i] = String(object.value[i]);
2078 }
2079 return message;
2080 };
2081
2082 /**
2083 * Creates a plain object from a Values message. Also converts values to other types if specified.
2084 * @function toObject
2085 * @memberof Trace.HTTP.Values
2086 * @static
2087 * @param {Trace.HTTP.Values} message Values
2088 * @param {$protobuf.IConversionOptions} [options] Conversion options
2089 * @returns {Object.<string,*>} Plain object
2090 */
2091 Values.toObject = function toObject(message, options) {
2092 if (!options)
2093 options = {};
2094 var object = {};
2095 if (options.arrays || options.defaults)
2096 object.value = [];
2097 if (message.value && message.value.length) {
2098 object.value = [];
2099 for (var j = 0; j < message.value.length; ++j)
2100 object.value[j] = message.value[j];
2101 }
2102 return object;
2103 };
2104
2105 /**
2106 * Converts this Values to JSON.
2107 * @function toJSON
2108 * @memberof Trace.HTTP.Values
2109 * @instance
2110 * @returns {Object.<string,*>} JSON object
2111 */
2112 Values.prototype.toJSON = function toJSON() {
2113 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2114 };
2115
2116 return Values;
2117 })();
2118
2119 /**
2120 * Method enum.
2121 * @name Trace.HTTP.Method
2122 * @enum {string}
2123 * @property {number} UNKNOWN=0 UNKNOWN value
2124 * @property {number} OPTIONS=1 OPTIONS value
2125 * @property {number} GET=2 GET value
2126 * @property {number} HEAD=3 HEAD value
2127 * @property {number} POST=4 POST value
2128 * @property {number} PUT=5 PUT value
2129 * @property {number} DELETE=6 DELETE value
2130 * @property {number} TRACE=7 TRACE value
2131 * @property {number} CONNECT=8 CONNECT value
2132 * @property {number} PATCH=9 PATCH value
2133 */
2134 HTTP.Method = (function() {
2135 var valuesById = {}, values = Object.create(valuesById);
2136 values[valuesById[0] = "UNKNOWN"] = 0;
2137 values[valuesById[1] = "OPTIONS"] = 1;
2138 values[valuesById[2] = "GET"] = 2;
2139 values[valuesById[3] = "HEAD"] = 3;
2140 values[valuesById[4] = "POST"] = 4;
2141 values[valuesById[5] = "PUT"] = 5;
2142 values[valuesById[6] = "DELETE"] = 6;
2143 values[valuesById[7] = "TRACE"] = 7;
2144 values[valuesById[8] = "CONNECT"] = 8;
2145 values[valuesById[9] = "PATCH"] = 9;
2146 return values;
2147 })();
2148
2149 return HTTP;
2150 })();
2151
2152 Trace.Location = (function() {
2153
2154 /**
2155 * Properties of a Location.
2156 * @memberof Trace
2157 * @interface ILocation
2158 * @property {number|null} [line] Location line
2159 * @property {number|null} [column] Location column
2160 */
2161
2162 /**
2163 * Constructs a new Location.
2164 * @memberof Trace
2165 * @classdesc Represents a Location.
2166 * @implements ILocation
2167 * @constructor
2168 * @param {Trace.ILocation=} [properties] Properties to set
2169 */
2170 function Location(properties) {
2171 if (properties)
2172 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2173 if (properties[keys[i]] != null)
2174 this[keys[i]] = properties[keys[i]];
2175 }
2176
2177 /**
2178 * Location line.
2179 * @member {number} line
2180 * @memberof Trace.Location
2181 * @instance
2182 */
2183 Location.prototype.line = 0;
2184
2185 /**
2186 * Location column.
2187 * @member {number} column
2188 * @memberof Trace.Location
2189 * @instance
2190 */
2191 Location.prototype.column = 0;
2192
2193 /**
2194 * Creates a new Location instance using the specified properties.
2195 * @function create
2196 * @memberof Trace.Location
2197 * @static
2198 * @param {Trace.ILocation=} [properties] Properties to set
2199 * @returns {Trace.Location} Location instance
2200 */
2201 Location.create = function create(properties) {
2202 return new Location(properties);
2203 };
2204
2205 /**
2206 * Encodes the specified Location message. Does not implicitly {@link Trace.Location.verify|verify} messages.
2207 * @function encode
2208 * @memberof Trace.Location
2209 * @static
2210 * @param {Trace.ILocation} message Location message or plain object to encode
2211 * @param {$protobuf.Writer} [writer] Writer to encode to
2212 * @returns {$protobuf.Writer} Writer
2213 */
2214 Location.encode = function encode(message, writer) {
2215 if (!writer)
2216 writer = $Writer.create();
2217 if (message.line != null && Object.hasOwnProperty.call(message, "line"))
2218 writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.line);
2219 if (message.column != null && Object.hasOwnProperty.call(message, "column"))
2220 writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.column);
2221 return writer;
2222 };
2223
2224 /**
2225 * Encodes the specified Location message, length delimited. Does not implicitly {@link Trace.Location.verify|verify} messages.
2226 * @function encodeDelimited
2227 * @memberof Trace.Location
2228 * @static
2229 * @param {Trace.ILocation} message Location message or plain object to encode
2230 * @param {$protobuf.Writer} [writer] Writer to encode to
2231 * @returns {$protobuf.Writer} Writer
2232 */
2233 Location.encodeDelimited = function encodeDelimited(message, writer) {
2234 return this.encode(message, writer).ldelim();
2235 };
2236
2237 /**
2238 * Decodes a Location message from the specified reader or buffer.
2239 * @function decode
2240 * @memberof Trace.Location
2241 * @static
2242 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2243 * @param {number} [length] Message length if known beforehand
2244 * @returns {Trace.Location} Location
2245 * @throws {Error} If the payload is not a reader or valid buffer
2246 * @throws {$protobuf.util.ProtocolError} If required fields are missing
2247 */
2248 Location.decode = function decode(reader, length) {
2249 if (!(reader instanceof $Reader))
2250 reader = $Reader.create(reader);
2251 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Location();
2252 while (reader.pos < end) {
2253 var tag = reader.uint32();
2254 switch (tag >>> 3) {
2255 case 1:
2256 message.line = reader.uint32();
2257 break;
2258 case 2:
2259 message.column = reader.uint32();
2260 break;
2261 default:
2262 reader.skipType(tag & 7);
2263 break;
2264 }
2265 }
2266 return message;
2267 };
2268
2269 /**
2270 * Decodes a Location message from the specified reader or buffer, length delimited.
2271 * @function decodeDelimited
2272 * @memberof Trace.Location
2273 * @static
2274 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2275 * @returns {Trace.Location} Location
2276 * @throws {Error} If the payload is not a reader or valid buffer
2277 * @throws {$protobuf.util.ProtocolError} If required fields are missing
2278 */
2279 Location.decodeDelimited = function decodeDelimited(reader) {
2280 if (!(reader instanceof $Reader))
2281 reader = new $Reader(reader);
2282 return this.decode(reader, reader.uint32());
2283 };
2284
2285 /**
2286 * Verifies a Location message.
2287 * @function verify
2288 * @memberof Trace.Location
2289 * @static
2290 * @param {Object.<string,*>} message Plain object to verify
2291 * @returns {string|null} `null` if valid, otherwise the reason why it is not
2292 */
2293 Location.verify = function verify(message) {
2294 if (typeof message !== "object" || message === null)
2295 return "object expected";
2296 if (message.line != null && message.hasOwnProperty("line"))
2297 if (!$util.isInteger(message.line))
2298 return "line: integer expected";
2299 if (message.column != null && message.hasOwnProperty("column"))
2300 if (!$util.isInteger(message.column))
2301 return "column: integer expected";
2302 return null;
2303 };
2304
2305 /**
2306 * Creates a Location message from a plain object. Also converts values to their respective internal types.
2307 * @function fromObject
2308 * @memberof Trace.Location
2309 * @static
2310 * @param {Object.<string,*>} object Plain object
2311 * @returns {Trace.Location} Location
2312 */
2313 Location.fromObject = function fromObject(object) {
2314 if (object instanceof $root.Trace.Location)
2315 return object;
2316 var message = new $root.Trace.Location();
2317 if (object.line != null)
2318 message.line = object.line >>> 0;
2319 if (object.column != null)
2320 message.column = object.column >>> 0;
2321 return message;
2322 };
2323
2324 /**
2325 * Creates a plain object from a Location message. Also converts values to other types if specified.
2326 * @function toObject
2327 * @memberof Trace.Location
2328 * @static
2329 * @param {Trace.Location} message Location
2330 * @param {$protobuf.IConversionOptions} [options] Conversion options
2331 * @returns {Object.<string,*>} Plain object
2332 */
2333 Location.toObject = function toObject(message, options) {
2334 if (!options)
2335 options = {};
2336 var object = {};
2337 if (options.defaults) {
2338 object.line = 0;
2339 object.column = 0;
2340 }
2341 if (message.line != null && message.hasOwnProperty("line"))
2342 object.line = message.line;
2343 if (message.column != null && message.hasOwnProperty("column"))
2344 object.column = message.column;
2345 return object;
2346 };
2347
2348 /**
2349 * Converts this Location to JSON.
2350 * @function toJSON
2351 * @memberof Trace.Location
2352 * @instance
2353 * @returns {Object.<string,*>} JSON object
2354 */
2355 Location.prototype.toJSON = function toJSON() {
2356 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2357 };
2358
2359 return Location;
2360 })();
2361
2362 Trace.Node = (function() {
2363
2364 /**
2365 * Properties of a Node.
2366 * @memberof Trace
2367 * @interface INode
2368 * @property {string|null} [responseName] Node responseName
2369 * @property {number|null} [index] Node index
2370 * @property {string|null} [originalFieldName] Node originalFieldName
2371 * @property {string|null} [type] Node type
2372 * @property {string|null} [parentType] Node parentType
2373 * @property {Trace.ICachePolicy|null} [cachePolicy] Node cachePolicy
2374 * @property {number|null} [startTime] Node startTime
2375 * @property {number|null} [endTime] Node endTime
2376 * @property {Array.<Trace.IError>|null} [error] Node error
2377 * @property {Array.<Trace.INode>|null} [child] Node child
2378 */
2379
2380 /**
2381 * Constructs a new Node.
2382 * @memberof Trace
2383 * @classdesc Represents a Node.
2384 * @implements INode
2385 * @constructor
2386 * @param {Trace.INode=} [properties] Properties to set
2387 */
2388 function Node(properties) {
2389 this.error = [];
2390 this.child = [];
2391 if (properties)
2392 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2393 if (properties[keys[i]] != null)
2394 this[keys[i]] = properties[keys[i]];
2395 }
2396
2397 /**
2398 * Node responseName.
2399 * @member {string} responseName
2400 * @memberof Trace.Node
2401 * @instance
2402 */
2403 Node.prototype.responseName = "";
2404
2405 /**
2406 * Node index.
2407 * @member {number} index
2408 * @memberof Trace.Node
2409 * @instance
2410 */
2411 Node.prototype.index = 0;
2412
2413 /**
2414 * Node originalFieldName.
2415 * @member {string} originalFieldName
2416 * @memberof Trace.Node
2417 * @instance
2418 */
2419 Node.prototype.originalFieldName = "";
2420
2421 /**
2422 * Node type.
2423 * @member {string} type
2424 * @memberof Trace.Node
2425 * @instance
2426 */
2427 Node.prototype.type = "";
2428
2429 /**
2430 * Node parentType.
2431 * @member {string} parentType
2432 * @memberof Trace.Node
2433 * @instance
2434 */
2435 Node.prototype.parentType = "";
2436
2437 /**
2438 * Node cachePolicy.
2439 * @member {Trace.ICachePolicy|null|undefined} cachePolicy
2440 * @memberof Trace.Node
2441 * @instance
2442 */
2443 Node.prototype.cachePolicy = null;
2444
2445 /**
2446 * Node startTime.
2447 * @member {number} startTime
2448 * @memberof Trace.Node
2449 * @instance
2450 */
2451 Node.prototype.startTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
2452
2453 /**
2454 * Node endTime.
2455 * @member {number} endTime
2456 * @memberof Trace.Node
2457 * @instance
2458 */
2459 Node.prototype.endTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
2460
2461 /**
2462 * Node error.
2463 * @member {Array.<Trace.IError>} error
2464 * @memberof Trace.Node
2465 * @instance
2466 */
2467 Node.prototype.error = $util.emptyArray;
2468
2469 /**
2470 * Node child.
2471 * @member {Array.<Trace.INode>} child
2472 * @memberof Trace.Node
2473 * @instance
2474 */
2475 Node.prototype.child = $util.emptyArray;
2476
2477 // OneOf field names bound to virtual getters and setters
2478 var $oneOfFields;
2479
2480 /**
2481 * Node id.
2482 * @member {"responseName"|"index"|undefined} id
2483 * @memberof Trace.Node
2484 * @instance
2485 */
2486 Object.defineProperty(Node.prototype, "id", {
2487 get: $util.oneOfGetter($oneOfFields = ["responseName", "index"]),
2488 set: $util.oneOfSetter($oneOfFields)
2489 });
2490
2491 /**
2492 * Creates a new Node instance using the specified properties.
2493 * @function create
2494 * @memberof Trace.Node
2495 * @static
2496 * @param {Trace.INode=} [properties] Properties to set
2497 * @returns {Trace.Node} Node instance
2498 */
2499 Node.create = function create(properties) {
2500 return new Node(properties);
2501 };
2502
2503 /**
2504 * Encodes the specified Node message. Does not implicitly {@link Trace.Node.verify|verify} messages.
2505 * @function encode
2506 * @memberof Trace.Node
2507 * @static
2508 * @param {Trace.INode} message Node message or plain object to encode
2509 * @param {$protobuf.Writer} [writer] Writer to encode to
2510 * @returns {$protobuf.Writer} Writer
2511 */
2512 Node.encode = function encode(message, writer) {
2513 if (!writer)
2514 writer = $Writer.create();
2515 if (message.responseName != null && Object.hasOwnProperty.call(message, "responseName"))
2516 writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseName);
2517 if (message.index != null && Object.hasOwnProperty.call(message, "index"))
2518 writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.index);
2519 if (message.type != null && Object.hasOwnProperty.call(message, "type"))
2520 writer.uint32(/* id 3, wireType 2 =*/26).string(message.type);
2521 if (message.cachePolicy != null && Object.hasOwnProperty.call(message, "cachePolicy"))
2522 $root.Trace.CachePolicy.encode(message.cachePolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
2523 if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
2524 writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.startTime);
2525 if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime"))
2526 writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.endTime);
2527 if (message.error != null && message.error.length)
2528 for (var i = 0; i < message.error.length; ++i)
2529 $root.Trace.Error.encode(message.error[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
2530 if (message.child != null && message.child.length)
2531 for (var i = 0; i < message.child.length; ++i)
2532 $root.Trace.Node.encode(message.child[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
2533 if (message.parentType != null && Object.hasOwnProperty.call(message, "parentType"))
2534 writer.uint32(/* id 13, wireType 2 =*/106).string(message.parentType);
2535 if (message.originalFieldName != null && Object.hasOwnProperty.call(message, "originalFieldName"))
2536 writer.uint32(/* id 14, wireType 2 =*/114).string(message.originalFieldName);
2537 return writer;
2538 };
2539
2540 /**
2541 * Encodes the specified Node message, length delimited. Does not implicitly {@link Trace.Node.verify|verify} messages.
2542 * @function encodeDelimited
2543 * @memberof Trace.Node
2544 * @static
2545 * @param {Trace.INode} message Node message or plain object to encode
2546 * @param {$protobuf.Writer} [writer] Writer to encode to
2547 * @returns {$protobuf.Writer} Writer
2548 */
2549 Node.encodeDelimited = function encodeDelimited(message, writer) {
2550 return this.encode(message, writer).ldelim();
2551 };
2552
2553 /**
2554 * Decodes a Node message from the specified reader or buffer.
2555 * @function decode
2556 * @memberof Trace.Node
2557 * @static
2558 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2559 * @param {number} [length] Message length if known beforehand
2560 * @returns {Trace.Node} Node
2561 * @throws {Error} If the payload is not a reader or valid buffer
2562 * @throws {$protobuf.util.ProtocolError} If required fields are missing
2563 */
2564 Node.decode = function decode(reader, length) {
2565 if (!(reader instanceof $Reader))
2566 reader = $Reader.create(reader);
2567 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Node();
2568 while (reader.pos < end) {
2569 var tag = reader.uint32();
2570 switch (tag >>> 3) {
2571 case 1:
2572 message.responseName = reader.string();
2573 break;
2574 case 2:
2575 message.index = reader.uint32();
2576 break;
2577 case 14:
2578 message.originalFieldName = reader.string();
2579 break;
2580 case 3:
2581 message.type = reader.string();
2582 break;
2583 case 13:
2584 message.parentType = reader.string();
2585 break;
2586 case 5:
2587 message.cachePolicy = $root.Trace.CachePolicy.decode(reader, reader.uint32());
2588 break;
2589 case 8:
2590 message.startTime = reader.uint64();
2591 break;
2592 case 9:
2593 message.endTime = reader.uint64();
2594 break;
2595 case 11:
2596 if (!(message.error && message.error.length))
2597 message.error = [];
2598 message.error.push($root.Trace.Error.decode(reader, reader.uint32()));
2599 break;
2600 case 12:
2601 if (!(message.child && message.child.length))
2602 message.child = [];
2603 message.child.push($root.Trace.Node.decode(reader, reader.uint32()));
2604 break;
2605 default:
2606 reader.skipType(tag & 7);
2607 break;
2608 }
2609 }
2610 return message;
2611 };
2612
2613 /**
2614 * Decodes a Node message from the specified reader or buffer, length delimited.
2615 * @function decodeDelimited
2616 * @memberof Trace.Node
2617 * @static
2618 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2619 * @returns {Trace.Node} Node
2620 * @throws {Error} If the payload is not a reader or valid buffer
2621 * @throws {$protobuf.util.ProtocolError} If required fields are missing
2622 */
2623 Node.decodeDelimited = function decodeDelimited(reader) {
2624 if (!(reader instanceof $Reader))
2625 reader = new $Reader(reader);
2626 return this.decode(reader, reader.uint32());
2627 };
2628
2629 /**
2630 * Verifies a Node message.
2631 * @function verify
2632 * @memberof Trace.Node
2633 * @static
2634 * @param {Object.<string,*>} message Plain object to verify
2635 * @returns {string|null} `null` if valid, otherwise the reason why it is not
2636 */
2637 Node.verify = function verify(message) {
2638 if (typeof message !== "object" || message === null)
2639 return "object expected";
2640 var properties = {};
2641 if (message.responseName != null && message.hasOwnProperty("responseName")) {
2642 properties.id = 1;
2643 if (!$util.isString(message.responseName))
2644 return "responseName: string expected";
2645 }
2646 if (message.index != null && message.hasOwnProperty("index")) {
2647 if (properties.id === 1)
2648 return "id: multiple values";
2649 properties.id = 1;
2650 if (!$util.isInteger(message.index))
2651 return "index: integer expected";
2652 }
2653 if (message.originalFieldName != null && message.hasOwnProperty("originalFieldName"))
2654 if (!$util.isString(message.originalFieldName))
2655 return "originalFieldName: string expected";
2656 if (message.type != null && message.hasOwnProperty("type"))
2657 if (!$util.isString(message.type))
2658 return "type: string expected";
2659 if (message.parentType != null && message.hasOwnProperty("parentType"))
2660 if (!$util.isString(message.parentType))
2661 return "parentType: string expected";
2662 if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy")) {
2663 var error = $root.Trace.CachePolicy.verify(message.cachePolicy);
2664 if (error)
2665 return "cachePolicy." + error;
2666 }
2667 if (message.startTime != null && message.hasOwnProperty("startTime"))
2668 if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high)))
2669 return "startTime: integer|Long expected";
2670 if (message.endTime != null && message.hasOwnProperty("endTime"))
2671 if (!$util.isInteger(message.endTime) && !(message.endTime && $util.isInteger(message.endTime.low) && $util.isInteger(message.endTime.high)))
2672 return "endTime: integer|Long expected";
2673 if (message.error != null && message.hasOwnProperty("error")) {
2674 if (!Array.isArray(message.error))
2675 return "error: array expected";
2676 for (var i = 0; i < message.error.length; ++i) {
2677 var error = $root.Trace.Error.verify(message.error[i]);
2678 if (error)
2679 return "error." + error;
2680 }
2681 }
2682 if (message.child != null && message.hasOwnProperty("child")) {
2683 if (!Array.isArray(message.child))
2684 return "child: array expected";
2685 for (var i = 0; i < message.child.length; ++i) {
2686 var error = $root.Trace.Node.verify(message.child[i]);
2687 if (error)
2688 return "child." + error;
2689 }
2690 }
2691 return null;
2692 };
2693
2694 /**
2695 * Creates a Node message from a plain object. Also converts values to their respective internal types.
2696 * @function fromObject
2697 * @memberof Trace.Node
2698 * @static
2699 * @param {Object.<string,*>} object Plain object
2700 * @returns {Trace.Node} Node
2701 */
2702 Node.fromObject = function fromObject(object) {
2703 if (object instanceof $root.Trace.Node)
2704 return object;
2705 var message = new $root.Trace.Node();
2706 if (object.responseName != null)
2707 message.responseName = String(object.responseName);
2708 if (object.index != null)
2709 message.index = object.index >>> 0;
2710 if (object.originalFieldName != null)
2711 message.originalFieldName = String(object.originalFieldName);
2712 if (object.type != null)
2713 message.type = String(object.type);
2714 if (object.parentType != null)
2715 message.parentType = String(object.parentType);
2716 if (object.cachePolicy != null) {
2717 if (typeof object.cachePolicy !== "object")
2718 throw TypeError(".Trace.Node.cachePolicy: object expected");
2719 message.cachePolicy = $root.Trace.CachePolicy.fromObject(object.cachePolicy);
2720 }
2721 if (object.startTime != null)
2722 if ($util.Long)
2723 (message.startTime = $util.Long.fromValue(object.startTime)).unsigned = true;
2724 else if (typeof object.startTime === "string")
2725 message.startTime = parseInt(object.startTime, 10);
2726 else if (typeof object.startTime === "number")
2727 message.startTime = object.startTime;
2728 else if (typeof object.startTime === "object")
2729 message.startTime = new $util.LongBits(object.startTime.low >>> 0, object.startTime.high >>> 0).toNumber(true);
2730 if (object.endTime != null)
2731 if ($util.Long)
2732 (message.endTime = $util.Long.fromValue(object.endTime)).unsigned = true;
2733 else if (typeof object.endTime === "string")
2734 message.endTime = parseInt(object.endTime, 10);
2735 else if (typeof object.endTime === "number")
2736 message.endTime = object.endTime;
2737 else if (typeof object.endTime === "object")
2738 message.endTime = new $util.LongBits(object.endTime.low >>> 0, object.endTime.high >>> 0).toNumber(true);
2739 if (object.error) {
2740 if (!Array.isArray(object.error))
2741 throw TypeError(".Trace.Node.error: array expected");
2742 message.error = [];
2743 for (var i = 0; i < object.error.length; ++i) {
2744 if (typeof object.error[i] !== "object")
2745 throw TypeError(".Trace.Node.error: object expected");
2746 message.error[i] = $root.Trace.Error.fromObject(object.error[i]);
2747 }
2748 }
2749 if (object.child) {
2750 if (!Array.isArray(object.child))
2751 throw TypeError(".Trace.Node.child: array expected");
2752 message.child = [];
2753 for (var i = 0; i < object.child.length; ++i) {
2754 if (typeof object.child[i] !== "object")
2755 throw TypeError(".Trace.Node.child: object expected");
2756 message.child[i] = $root.Trace.Node.fromObject(object.child[i]);
2757 }
2758 }
2759 return message;
2760 };
2761
2762 /**
2763 * Creates a plain object from a Node message. Also converts values to other types if specified.
2764 * @function toObject
2765 * @memberof Trace.Node
2766 * @static
2767 * @param {Trace.Node} message Node
2768 * @param {$protobuf.IConversionOptions} [options] Conversion options
2769 * @returns {Object.<string,*>} Plain object
2770 */
2771 Node.toObject = function toObject(message, options) {
2772 if (!options)
2773 options = {};
2774 var object = {};
2775 if (options.arrays || options.defaults) {
2776 object.error = [];
2777 object.child = [];
2778 }
2779 if (options.defaults) {
2780 object.type = "";
2781 object.cachePolicy = null;
2782 if ($util.Long) {
2783 var long = new $util.Long(0, 0, true);
2784 object.startTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2785 } else
2786 object.startTime = options.longs === String ? "0" : 0;
2787 if ($util.Long) {
2788 var long = new $util.Long(0, 0, true);
2789 object.endTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2790 } else
2791 object.endTime = options.longs === String ? "0" : 0;
2792 object.parentType = "";
2793 object.originalFieldName = "";
2794 }
2795 if (message.responseName != null && message.hasOwnProperty("responseName")) {
2796 object.responseName = message.responseName;
2797 if (options.oneofs)
2798 object.id = "responseName";
2799 }
2800 if (message.index != null && message.hasOwnProperty("index")) {
2801 object.index = message.index;
2802 if (options.oneofs)
2803 object.id = "index";
2804 }
2805 if (message.type != null && message.hasOwnProperty("type"))
2806 object.type = message.type;
2807 if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy"))
2808 object.cachePolicy = $root.Trace.CachePolicy.toObject(message.cachePolicy, options);
2809 if (message.startTime != null && message.hasOwnProperty("startTime"))
2810 if (typeof message.startTime === "number")
2811 object.startTime = options.longs === String ? String(message.startTime) : message.startTime;
2812 else
2813 object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber(true) : message.startTime;
2814 if (message.endTime != null && message.hasOwnProperty("endTime"))
2815 if (typeof message.endTime === "number")
2816 object.endTime = options.longs === String ? String(message.endTime) : message.endTime;
2817 else
2818 object.endTime = options.longs === String ? $util.Long.prototype.toString.call(message.endTime) : options.longs === Number ? new $util.LongBits(message.endTime.low >>> 0, message.endTime.high >>> 0).toNumber(true) : message.endTime;
2819 if (message.error && message.error.length) {
2820 object.error = [];
2821 for (var j = 0; j < message.error.length; ++j)
2822 object.error[j] = $root.Trace.Error.toObject(message.error[j], options);
2823 }
2824 if (message.child && message.child.length) {
2825 object.child = [];
2826 for (var j = 0; j < message.child.length; ++j)
2827 object.child[j] = $root.Trace.Node.toObject(message.child[j], options);
2828 }
2829 if (message.parentType != null && message.hasOwnProperty("parentType"))
2830 object.parentType = message.parentType;
2831 if (message.originalFieldName != null && message.hasOwnProperty("originalFieldName"))
2832 object.originalFieldName = message.originalFieldName;
2833 return object;
2834 };
2835
2836 /**
2837 * Converts this Node to JSON.
2838 * @function toJSON
2839 * @memberof Trace.Node
2840 * @instance
2841 * @returns {Object.<string,*>} JSON object
2842 */
2843 Node.prototype.toJSON = function toJSON() {
2844 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2845 };
2846
2847 return Node;
2848 })();
2849
2850 Trace.QueryPlanNode = (function() {
2851
2852 /**
2853 * Properties of a QueryPlanNode.
2854 * @memberof Trace
2855 * @interface IQueryPlanNode
2856 * @property {Trace.QueryPlanNode.ISequenceNode|null} [sequence] QueryPlanNode sequence
2857 * @property {Trace.QueryPlanNode.IParallelNode|null} [parallel] QueryPlanNode parallel
2858 * @property {Trace.QueryPlanNode.IFetchNode|null} [fetch] QueryPlanNode fetch
2859 * @property {Trace.QueryPlanNode.IFlattenNode|null} [flatten] QueryPlanNode flatten
2860 */
2861
2862 /**
2863 * Constructs a new QueryPlanNode.
2864 * @memberof Trace
2865 * @classdesc Represents a QueryPlanNode.
2866 * @implements IQueryPlanNode
2867 * @constructor
2868 * @param {Trace.IQueryPlanNode=} [properties] Properties to set
2869 */
2870 function QueryPlanNode(properties) {
2871 if (properties)
2872 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2873 if (properties[keys[i]] != null)
2874 this[keys[i]] = properties[keys[i]];
2875 }
2876
2877 /**
2878 * QueryPlanNode sequence.
2879 * @member {Trace.QueryPlanNode.ISequenceNode|null|undefined} sequence
2880 * @memberof Trace.QueryPlanNode
2881 * @instance
2882 */
2883 QueryPlanNode.prototype.sequence = null;
2884
2885 /**
2886 * QueryPlanNode parallel.
2887 * @member {Trace.QueryPlanNode.IParallelNode|null|undefined} parallel
2888 * @memberof Trace.QueryPlanNode
2889 * @instance
2890 */
2891 QueryPlanNode.prototype.parallel = null;
2892
2893 /**
2894 * QueryPlanNode fetch.
2895 * @member {Trace.QueryPlanNode.IFetchNode|null|undefined} fetch
2896 * @memberof Trace.QueryPlanNode
2897 * @instance
2898 */
2899 QueryPlanNode.prototype.fetch = null;
2900
2901 /**
2902 * QueryPlanNode flatten.
2903 * @member {Trace.QueryPlanNode.IFlattenNode|null|undefined} flatten
2904 * @memberof Trace.QueryPlanNode
2905 * @instance
2906 */
2907 QueryPlanNode.prototype.flatten = null;
2908
2909 // OneOf field names bound to virtual getters and setters
2910 var $oneOfFields;
2911
2912 /**
2913 * QueryPlanNode node.
2914 * @member {"sequence"|"parallel"|"fetch"|"flatten"|undefined} node
2915 * @memberof Trace.QueryPlanNode
2916 * @instance
2917 */
2918 Object.defineProperty(QueryPlanNode.prototype, "node", {
2919 get: $util.oneOfGetter($oneOfFields = ["sequence", "parallel", "fetch", "flatten"]),
2920 set: $util.oneOfSetter($oneOfFields)
2921 });
2922
2923 /**
2924 * Creates a new QueryPlanNode instance using the specified properties.
2925 * @function create
2926 * @memberof Trace.QueryPlanNode
2927 * @static
2928 * @param {Trace.IQueryPlanNode=} [properties] Properties to set
2929 * @returns {Trace.QueryPlanNode} QueryPlanNode instance
2930 */
2931 QueryPlanNode.create = function create(properties) {
2932 return new QueryPlanNode(properties);
2933 };
2934
2935 /**
2936 * Encodes the specified QueryPlanNode message. Does not implicitly {@link Trace.QueryPlanNode.verify|verify} messages.
2937 * @function encode
2938 * @memberof Trace.QueryPlanNode
2939 * @static
2940 * @param {Trace.IQueryPlanNode} message QueryPlanNode message or plain object to encode
2941 * @param {$protobuf.Writer} [writer] Writer to encode to
2942 * @returns {$protobuf.Writer} Writer
2943 */
2944 QueryPlanNode.encode = function encode(message, writer) {
2945 if (!writer)
2946 writer = $Writer.create();
2947 if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence"))
2948 $root.Trace.QueryPlanNode.SequenceNode.encode(message.sequence, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
2949 if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel"))
2950 $root.Trace.QueryPlanNode.ParallelNode.encode(message.parallel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
2951 if (message.fetch != null && Object.hasOwnProperty.call(message, "fetch"))
2952 $root.Trace.QueryPlanNode.FetchNode.encode(message.fetch, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
2953 if (message.flatten != null && Object.hasOwnProperty.call(message, "flatten"))
2954 $root.Trace.QueryPlanNode.FlattenNode.encode(message.flatten, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
2955 return writer;
2956 };
2957
2958 /**
2959 * Encodes the specified QueryPlanNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.verify|verify} messages.
2960 * @function encodeDelimited
2961 * @memberof Trace.QueryPlanNode
2962 * @static
2963 * @param {Trace.IQueryPlanNode} message QueryPlanNode message or plain object to encode
2964 * @param {$protobuf.Writer} [writer] Writer to encode to
2965 * @returns {$protobuf.Writer} Writer
2966 */
2967 QueryPlanNode.encodeDelimited = function encodeDelimited(message, writer) {
2968 return this.encode(message, writer).ldelim();
2969 };
2970
2971 /**
2972 * Decodes a QueryPlanNode message from the specified reader or buffer.
2973 * @function decode
2974 * @memberof Trace.QueryPlanNode
2975 * @static
2976 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2977 * @param {number} [length] Message length if known beforehand
2978 * @returns {Trace.QueryPlanNode} QueryPlanNode
2979 * @throws {Error} If the payload is not a reader or valid buffer
2980 * @throws {$protobuf.util.ProtocolError} If required fields are missing
2981 */
2982 QueryPlanNode.decode = function decode(reader, length) {
2983 if (!(reader instanceof $Reader))
2984 reader = $Reader.create(reader);
2985 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode();
2986 while (reader.pos < end) {
2987 var tag = reader.uint32();
2988 switch (tag >>> 3) {
2989 case 1:
2990 message.sequence = $root.Trace.QueryPlanNode.SequenceNode.decode(reader, reader.uint32());
2991 break;
2992 case 2:
2993 message.parallel = $root.Trace.QueryPlanNode.ParallelNode.decode(reader, reader.uint32());
2994 break;
2995 case 3:
2996 message.fetch = $root.Trace.QueryPlanNode.FetchNode.decode(reader, reader.uint32());
2997 break;
2998 case 4:
2999 message.flatten = $root.Trace.QueryPlanNode.FlattenNode.decode(reader, reader.uint32());
3000 break;
3001 default:
3002 reader.skipType(tag & 7);
3003 break;
3004 }
3005 }
3006 return message;
3007 };
3008
3009 /**
3010 * Decodes a QueryPlanNode message from the specified reader or buffer, length delimited.
3011 * @function decodeDelimited
3012 * @memberof Trace.QueryPlanNode
3013 * @static
3014 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3015 * @returns {Trace.QueryPlanNode} QueryPlanNode
3016 * @throws {Error} If the payload is not a reader or valid buffer
3017 * @throws {$protobuf.util.ProtocolError} If required fields are missing
3018 */
3019 QueryPlanNode.decodeDelimited = function decodeDelimited(reader) {
3020 if (!(reader instanceof $Reader))
3021 reader = new $Reader(reader);
3022 return this.decode(reader, reader.uint32());
3023 };
3024
3025 /**
3026 * Verifies a QueryPlanNode message.
3027 * @function verify
3028 * @memberof Trace.QueryPlanNode
3029 * @static
3030 * @param {Object.<string,*>} message Plain object to verify
3031 * @returns {string|null} `null` if valid, otherwise the reason why it is not
3032 */
3033 QueryPlanNode.verify = function verify(message) {
3034 if (typeof message !== "object" || message === null)
3035 return "object expected";
3036 var properties = {};
3037 if (message.sequence != null && message.hasOwnProperty("sequence")) {
3038 properties.node = 1;
3039 {
3040 var error = $root.Trace.QueryPlanNode.SequenceNode.verify(message.sequence);
3041 if (error)
3042 return "sequence." + error;
3043 }
3044 }
3045 if (message.parallel != null && message.hasOwnProperty("parallel")) {
3046 if (properties.node === 1)
3047 return "node: multiple values";
3048 properties.node = 1;
3049 {
3050 var error = $root.Trace.QueryPlanNode.ParallelNode.verify(message.parallel);
3051 if (error)
3052 return "parallel." + error;
3053 }
3054 }
3055 if (message.fetch != null && message.hasOwnProperty("fetch")) {
3056 if (properties.node === 1)
3057 return "node: multiple values";
3058 properties.node = 1;
3059 {
3060 var error = $root.Trace.QueryPlanNode.FetchNode.verify(message.fetch);
3061 if (error)
3062 return "fetch." + error;
3063 }
3064 }
3065 if (message.flatten != null && message.hasOwnProperty("flatten")) {
3066 if (properties.node === 1)
3067 return "node: multiple values";
3068 properties.node = 1;
3069 {
3070 var error = $root.Trace.QueryPlanNode.FlattenNode.verify(message.flatten);
3071 if (error)
3072 return "flatten." + error;
3073 }
3074 }
3075 return null;
3076 };
3077
3078 /**
3079 * Creates a QueryPlanNode message from a plain object. Also converts values to their respective internal types.
3080 * @function fromObject
3081 * @memberof Trace.QueryPlanNode
3082 * @static
3083 * @param {Object.<string,*>} object Plain object
3084 * @returns {Trace.QueryPlanNode} QueryPlanNode
3085 */
3086 QueryPlanNode.fromObject = function fromObject(object) {
3087 if (object instanceof $root.Trace.QueryPlanNode)
3088 return object;
3089 var message = new $root.Trace.QueryPlanNode();
3090 if (object.sequence != null) {
3091 if (typeof object.sequence !== "object")
3092 throw TypeError(".Trace.QueryPlanNode.sequence: object expected");
3093 message.sequence = $root.Trace.QueryPlanNode.SequenceNode.fromObject(object.sequence);
3094 }
3095 if (object.parallel != null) {
3096 if (typeof object.parallel !== "object")
3097 throw TypeError(".Trace.QueryPlanNode.parallel: object expected");
3098 message.parallel = $root.Trace.QueryPlanNode.ParallelNode.fromObject(object.parallel);
3099 }
3100 if (object.fetch != null) {
3101 if (typeof object.fetch !== "object")
3102 throw TypeError(".Trace.QueryPlanNode.fetch: object expected");
3103 message.fetch = $root.Trace.QueryPlanNode.FetchNode.fromObject(object.fetch);
3104 }
3105 if (object.flatten != null) {
3106 if (typeof object.flatten !== "object")
3107 throw TypeError(".Trace.QueryPlanNode.flatten: object expected");
3108 message.flatten = $root.Trace.QueryPlanNode.FlattenNode.fromObject(object.flatten);
3109 }
3110 return message;
3111 };
3112
3113 /**
3114 * Creates a plain object from a QueryPlanNode message. Also converts values to other types if specified.
3115 * @function toObject
3116 * @memberof Trace.QueryPlanNode
3117 * @static
3118 * @param {Trace.QueryPlanNode} message QueryPlanNode
3119 * @param {$protobuf.IConversionOptions} [options] Conversion options
3120 * @returns {Object.<string,*>} Plain object
3121 */
3122 QueryPlanNode.toObject = function toObject(message, options) {
3123 if (!options)
3124 options = {};
3125 var object = {};
3126 if (message.sequence != null && message.hasOwnProperty("sequence")) {
3127 object.sequence = $root.Trace.QueryPlanNode.SequenceNode.toObject(message.sequence, options);
3128 if (options.oneofs)
3129 object.node = "sequence";
3130 }
3131 if (message.parallel != null && message.hasOwnProperty("parallel")) {
3132 object.parallel = $root.Trace.QueryPlanNode.ParallelNode.toObject(message.parallel, options);
3133 if (options.oneofs)
3134 object.node = "parallel";
3135 }
3136 if (message.fetch != null && message.hasOwnProperty("fetch")) {
3137 object.fetch = $root.Trace.QueryPlanNode.FetchNode.toObject(message.fetch, options);
3138 if (options.oneofs)
3139 object.node = "fetch";
3140 }
3141 if (message.flatten != null && message.hasOwnProperty("flatten")) {
3142 object.flatten = $root.Trace.QueryPlanNode.FlattenNode.toObject(message.flatten, options);
3143 if (options.oneofs)
3144 object.node = "flatten";
3145 }
3146 return object;
3147 };
3148
3149 /**
3150 * Converts this QueryPlanNode to JSON.
3151 * @function toJSON
3152 * @memberof Trace.QueryPlanNode
3153 * @instance
3154 * @returns {Object.<string,*>} JSON object
3155 */
3156 QueryPlanNode.prototype.toJSON = function toJSON() {
3157 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3158 };
3159
3160 QueryPlanNode.SequenceNode = (function() {
3161
3162 /**
3163 * Properties of a SequenceNode.
3164 * @memberof Trace.QueryPlanNode
3165 * @interface ISequenceNode
3166 * @property {Array.<Trace.IQueryPlanNode>|null} [nodes] SequenceNode nodes
3167 */
3168
3169 /**
3170 * Constructs a new SequenceNode.
3171 * @memberof Trace.QueryPlanNode
3172 * @classdesc Represents a SequenceNode.
3173 * @implements ISequenceNode
3174 * @constructor
3175 * @param {Trace.QueryPlanNode.ISequenceNode=} [properties] Properties to set
3176 */
3177 function SequenceNode(properties) {
3178 this.nodes = [];
3179 if (properties)
3180 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3181 if (properties[keys[i]] != null)
3182 this[keys[i]] = properties[keys[i]];
3183 }
3184
3185 /**
3186 * SequenceNode nodes.
3187 * @member {Array.<Trace.IQueryPlanNode>} nodes
3188 * @memberof Trace.QueryPlanNode.SequenceNode
3189 * @instance
3190 */
3191 SequenceNode.prototype.nodes = $util.emptyArray;
3192
3193 /**
3194 * Creates a new SequenceNode instance using the specified properties.
3195 * @function create
3196 * @memberof Trace.QueryPlanNode.SequenceNode
3197 * @static
3198 * @param {Trace.QueryPlanNode.ISequenceNode=} [properties] Properties to set
3199 * @returns {Trace.QueryPlanNode.SequenceNode} SequenceNode instance
3200 */
3201 SequenceNode.create = function create(properties) {
3202 return new SequenceNode(properties);
3203 };
3204
3205 /**
3206 * Encodes the specified SequenceNode message. Does not implicitly {@link Trace.QueryPlanNode.SequenceNode.verify|verify} messages.
3207 * @function encode
3208 * @memberof Trace.QueryPlanNode.SequenceNode
3209 * @static
3210 * @param {Trace.QueryPlanNode.ISequenceNode} message SequenceNode message or plain object to encode
3211 * @param {$protobuf.Writer} [writer] Writer to encode to
3212 * @returns {$protobuf.Writer} Writer
3213 */
3214 SequenceNode.encode = function encode(message, writer) {
3215 if (!writer)
3216 writer = $Writer.create();
3217 if (message.nodes != null && message.nodes.length)
3218 for (var i = 0; i < message.nodes.length; ++i)
3219 $root.Trace.QueryPlanNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
3220 return writer;
3221 };
3222
3223 /**
3224 * Encodes the specified SequenceNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.SequenceNode.verify|verify} messages.
3225 * @function encodeDelimited
3226 * @memberof Trace.QueryPlanNode.SequenceNode
3227 * @static
3228 * @param {Trace.QueryPlanNode.ISequenceNode} message SequenceNode message or plain object to encode
3229 * @param {$protobuf.Writer} [writer] Writer to encode to
3230 * @returns {$protobuf.Writer} Writer
3231 */
3232 SequenceNode.encodeDelimited = function encodeDelimited(message, writer) {
3233 return this.encode(message, writer).ldelim();
3234 };
3235
3236 /**
3237 * Decodes a SequenceNode message from the specified reader or buffer.
3238 * @function decode
3239 * @memberof Trace.QueryPlanNode.SequenceNode
3240 * @static
3241 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3242 * @param {number} [length] Message length if known beforehand
3243 * @returns {Trace.QueryPlanNode.SequenceNode} SequenceNode
3244 * @throws {Error} If the payload is not a reader or valid buffer
3245 * @throws {$protobuf.util.ProtocolError} If required fields are missing
3246 */
3247 SequenceNode.decode = function decode(reader, length) {
3248 if (!(reader instanceof $Reader))
3249 reader = $Reader.create(reader);
3250 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.SequenceNode();
3251 while (reader.pos < end) {
3252 var tag = reader.uint32();
3253 switch (tag >>> 3) {
3254 case 1:
3255 if (!(message.nodes && message.nodes.length))
3256 message.nodes = [];
3257 message.nodes.push($root.Trace.QueryPlanNode.decode(reader, reader.uint32()));
3258 break;
3259 default:
3260 reader.skipType(tag & 7);
3261 break;
3262 }
3263 }
3264 return message;
3265 };
3266
3267 /**
3268 * Decodes a SequenceNode message from the specified reader or buffer, length delimited.
3269 * @function decodeDelimited
3270 * @memberof Trace.QueryPlanNode.SequenceNode
3271 * @static
3272 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3273 * @returns {Trace.QueryPlanNode.SequenceNode} SequenceNode
3274 * @throws {Error} If the payload is not a reader or valid buffer
3275 * @throws {$protobuf.util.ProtocolError} If required fields are missing
3276 */
3277 SequenceNode.decodeDelimited = function decodeDelimited(reader) {
3278 if (!(reader instanceof $Reader))
3279 reader = new $Reader(reader);
3280 return this.decode(reader, reader.uint32());
3281 };
3282
3283 /**
3284 * Verifies a SequenceNode message.
3285 * @function verify
3286 * @memberof Trace.QueryPlanNode.SequenceNode
3287 * @static
3288 * @param {Object.<string,*>} message Plain object to verify
3289 * @returns {string|null} `null` if valid, otherwise the reason why it is not
3290 */
3291 SequenceNode.verify = function verify(message) {
3292 if (typeof message !== "object" || message === null)
3293 return "object expected";
3294 if (message.nodes != null && message.hasOwnProperty("nodes")) {
3295 if (!Array.isArray(message.nodes))
3296 return "nodes: array expected";
3297 for (var i = 0; i < message.nodes.length; ++i) {
3298 var error = $root.Trace.QueryPlanNode.verify(message.nodes[i]);
3299 if (error)
3300 return "nodes." + error;
3301 }
3302 }
3303 return null;
3304 };
3305
3306 /**
3307 * Creates a SequenceNode message from a plain object. Also converts values to their respective internal types.
3308 * @function fromObject
3309 * @memberof Trace.QueryPlanNode.SequenceNode
3310 * @static
3311 * @param {Object.<string,*>} object Plain object
3312 * @returns {Trace.QueryPlanNode.SequenceNode} SequenceNode
3313 */
3314 SequenceNode.fromObject = function fromObject(object) {
3315 if (object instanceof $root.Trace.QueryPlanNode.SequenceNode)
3316 return object;
3317 var message = new $root.Trace.QueryPlanNode.SequenceNode();
3318 if (object.nodes) {
3319 if (!Array.isArray(object.nodes))
3320 throw TypeError(".Trace.QueryPlanNode.SequenceNode.nodes: array expected");
3321 message.nodes = [];
3322 for (var i = 0; i < object.nodes.length; ++i) {
3323 if (typeof object.nodes[i] !== "object")
3324 throw TypeError(".Trace.QueryPlanNode.SequenceNode.nodes: object expected");
3325 message.nodes[i] = $root.Trace.QueryPlanNode.fromObject(object.nodes[i]);
3326 }
3327 }
3328 return message;
3329 };
3330
3331 /**
3332 * Creates a plain object from a SequenceNode message. Also converts values to other types if specified.
3333 * @function toObject
3334 * @memberof Trace.QueryPlanNode.SequenceNode
3335 * @static
3336 * @param {Trace.QueryPlanNode.SequenceNode} message SequenceNode
3337 * @param {$protobuf.IConversionOptions} [options] Conversion options
3338 * @returns {Object.<string,*>} Plain object
3339 */
3340 SequenceNode.toObject = function toObject(message, options) {
3341 if (!options)
3342 options = {};
3343 var object = {};
3344 if (options.arrays || options.defaults)
3345 object.nodes = [];
3346 if (message.nodes && message.nodes.length) {
3347 object.nodes = [];
3348 for (var j = 0; j < message.nodes.length; ++j)
3349 object.nodes[j] = $root.Trace.QueryPlanNode.toObject(message.nodes[j], options);
3350 }
3351 return object;
3352 };
3353
3354 /**
3355 * Converts this SequenceNode to JSON.
3356 * @function toJSON
3357 * @memberof Trace.QueryPlanNode.SequenceNode
3358 * @instance
3359 * @returns {Object.<string,*>} JSON object
3360 */
3361 SequenceNode.prototype.toJSON = function toJSON() {
3362 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3363 };
3364
3365 return SequenceNode;
3366 })();
3367
3368 QueryPlanNode.ParallelNode = (function() {
3369
3370 /**
3371 * Properties of a ParallelNode.
3372 * @memberof Trace.QueryPlanNode
3373 * @interface IParallelNode
3374 * @property {Array.<Trace.IQueryPlanNode>|null} [nodes] ParallelNode nodes
3375 */
3376
3377 /**
3378 * Constructs a new ParallelNode.
3379 * @memberof Trace.QueryPlanNode
3380 * @classdesc Represents a ParallelNode.
3381 * @implements IParallelNode
3382 * @constructor
3383 * @param {Trace.QueryPlanNode.IParallelNode=} [properties] Properties to set
3384 */
3385 function ParallelNode(properties) {
3386 this.nodes = [];
3387 if (properties)
3388 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3389 if (properties[keys[i]] != null)
3390 this[keys[i]] = properties[keys[i]];
3391 }
3392
3393 /**
3394 * ParallelNode nodes.
3395 * @member {Array.<Trace.IQueryPlanNode>} nodes
3396 * @memberof Trace.QueryPlanNode.ParallelNode
3397 * @instance
3398 */
3399 ParallelNode.prototype.nodes = $util.emptyArray;
3400
3401 /**
3402 * Creates a new ParallelNode instance using the specified properties.
3403 * @function create
3404 * @memberof Trace.QueryPlanNode.ParallelNode
3405 * @static
3406 * @param {Trace.QueryPlanNode.IParallelNode=} [properties] Properties to set
3407 * @returns {Trace.QueryPlanNode.ParallelNode} ParallelNode instance
3408 */
3409 ParallelNode.create = function create(properties) {
3410 return new ParallelNode(properties);
3411 };
3412
3413 /**
3414 * Encodes the specified ParallelNode message. Does not implicitly {@link Trace.QueryPlanNode.ParallelNode.verify|verify} messages.
3415 * @function encode
3416 * @memberof Trace.QueryPlanNode.ParallelNode
3417 * @static
3418 * @param {Trace.QueryPlanNode.IParallelNode} message ParallelNode message or plain object to encode
3419 * @param {$protobuf.Writer} [writer] Writer to encode to
3420 * @returns {$protobuf.Writer} Writer
3421 */
3422 ParallelNode.encode = function encode(message, writer) {
3423 if (!writer)
3424 writer = $Writer.create();
3425 if (message.nodes != null && message.nodes.length)
3426 for (var i = 0; i < message.nodes.length; ++i)
3427 $root.Trace.QueryPlanNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
3428 return writer;
3429 };
3430
3431 /**
3432 * Encodes the specified ParallelNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ParallelNode.verify|verify} messages.
3433 * @function encodeDelimited
3434 * @memberof Trace.QueryPlanNode.ParallelNode
3435 * @static
3436 * @param {Trace.QueryPlanNode.IParallelNode} message ParallelNode message or plain object to encode
3437 * @param {$protobuf.Writer} [writer] Writer to encode to
3438 * @returns {$protobuf.Writer} Writer
3439 */
3440 ParallelNode.encodeDelimited = function encodeDelimited(message, writer) {
3441 return this.encode(message, writer).ldelim();
3442 };
3443
3444 /**
3445 * Decodes a ParallelNode message from the specified reader or buffer.
3446 * @function decode
3447 * @memberof Trace.QueryPlanNode.ParallelNode
3448 * @static
3449 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3450 * @param {number} [length] Message length if known beforehand
3451 * @returns {Trace.QueryPlanNode.ParallelNode} ParallelNode
3452 * @throws {Error} If the payload is not a reader or valid buffer
3453 * @throws {$protobuf.util.ProtocolError} If required fields are missing
3454 */
3455 ParallelNode.decode = function decode(reader, length) {
3456 if (!(reader instanceof $Reader))
3457 reader = $Reader.create(reader);
3458 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.ParallelNode();
3459 while (reader.pos < end) {
3460 var tag = reader.uint32();
3461 switch (tag >>> 3) {
3462 case 1:
3463 if (!(message.nodes && message.nodes.length))
3464 message.nodes = [];
3465 message.nodes.push($root.Trace.QueryPlanNode.decode(reader, reader.uint32()));
3466 break;
3467 default:
3468 reader.skipType(tag & 7);
3469 break;
3470 }
3471 }
3472 return message;
3473 };
3474
3475 /**
3476 * Decodes a ParallelNode message from the specified reader or buffer, length delimited.
3477 * @function decodeDelimited
3478 * @memberof Trace.QueryPlanNode.ParallelNode
3479 * @static
3480 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3481 * @returns {Trace.QueryPlanNode.ParallelNode} ParallelNode
3482 * @throws {Error} If the payload is not a reader or valid buffer
3483 * @throws {$protobuf.util.ProtocolError} If required fields are missing
3484 */
3485 ParallelNode.decodeDelimited = function decodeDelimited(reader) {
3486 if (!(reader instanceof $Reader))
3487 reader = new $Reader(reader);
3488 return this.decode(reader, reader.uint32());
3489 };
3490
3491 /**
3492 * Verifies a ParallelNode message.
3493 * @function verify
3494 * @memberof Trace.QueryPlanNode.ParallelNode
3495 * @static
3496 * @param {Object.<string,*>} message Plain object to verify
3497 * @returns {string|null} `null` if valid, otherwise the reason why it is not
3498 */
3499 ParallelNode.verify = function verify(message) {
3500 if (typeof message !== "object" || message === null)
3501 return "object expected";
3502 if (message.nodes != null && message.hasOwnProperty("nodes")) {
3503 if (!Array.isArray(message.nodes))
3504 return "nodes: array expected";
3505 for (var i = 0; i < message.nodes.length; ++i) {
3506 var error = $root.Trace.QueryPlanNode.verify(message.nodes[i]);
3507 if (error)
3508 return "nodes." + error;
3509 }
3510 }
3511 return null;
3512 };
3513
3514 /**
3515 * Creates a ParallelNode message from a plain object. Also converts values to their respective internal types.
3516 * @function fromObject
3517 * @memberof Trace.QueryPlanNode.ParallelNode
3518 * @static
3519 * @param {Object.<string,*>} object Plain object
3520 * @returns {Trace.QueryPlanNode.ParallelNode} ParallelNode
3521 */
3522 ParallelNode.fromObject = function fromObject(object) {
3523 if (object instanceof $root.Trace.QueryPlanNode.ParallelNode)
3524 return object;
3525 var message = new $root.Trace.QueryPlanNode.ParallelNode();
3526 if (object.nodes) {
3527 if (!Array.isArray(object.nodes))
3528 throw TypeError(".Trace.QueryPlanNode.ParallelNode.nodes: array expected");
3529 message.nodes = [];
3530 for (var i = 0; i < object.nodes.length; ++i) {
3531 if (typeof object.nodes[i] !== "object")
3532 throw TypeError(".Trace.QueryPlanNode.ParallelNode.nodes: object expected");
3533 message.nodes[i] = $root.Trace.QueryPlanNode.fromObject(object.nodes[i]);
3534 }
3535 }
3536 return message;
3537 };
3538
3539 /**
3540 * Creates a plain object from a ParallelNode message. Also converts values to other types if specified.
3541 * @function toObject
3542 * @memberof Trace.QueryPlanNode.ParallelNode
3543 * @static
3544 * @param {Trace.QueryPlanNode.ParallelNode} message ParallelNode
3545 * @param {$protobuf.IConversionOptions} [options] Conversion options
3546 * @returns {Object.<string,*>} Plain object
3547 */
3548 ParallelNode.toObject = function toObject(message, options) {
3549 if (!options)
3550 options = {};
3551 var object = {};
3552 if (options.arrays || options.defaults)
3553 object.nodes = [];
3554 if (message.nodes && message.nodes.length) {
3555 object.nodes = [];
3556 for (var j = 0; j < message.nodes.length; ++j)
3557 object.nodes[j] = $root.Trace.QueryPlanNode.toObject(message.nodes[j], options);
3558 }
3559 return object;
3560 };
3561
3562 /**
3563 * Converts this ParallelNode to JSON.
3564 * @function toJSON
3565 * @memberof Trace.QueryPlanNode.ParallelNode
3566 * @instance
3567 * @returns {Object.<string,*>} JSON object
3568 */
3569 ParallelNode.prototype.toJSON = function toJSON() {
3570 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3571 };
3572
3573 return ParallelNode;
3574 })();
3575
3576 QueryPlanNode.FetchNode = (function() {
3577
3578 /**
3579 * Properties of a FetchNode.
3580 * @memberof Trace.QueryPlanNode
3581 * @interface IFetchNode
3582 * @property {string|null} [serviceName] FetchNode serviceName
3583 * @property {boolean|null} [traceParsingFailed] FetchNode traceParsingFailed
3584 * @property {ITrace|null} [trace] FetchNode trace
3585 * @property {number|null} [sentTimeOffset] FetchNode sentTimeOffset
3586 * @property {google.protobuf.ITimestamp|null} [sentTime] FetchNode sentTime
3587 * @property {google.protobuf.ITimestamp|null} [receivedTime] FetchNode receivedTime
3588 */
3589
3590 /**
3591 * Constructs a new FetchNode.
3592 * @memberof Trace.QueryPlanNode
3593 * @classdesc Represents a FetchNode.
3594 * @implements IFetchNode
3595 * @constructor
3596 * @param {Trace.QueryPlanNode.IFetchNode=} [properties] Properties to set
3597 */
3598 function FetchNode(properties) {
3599 if (properties)
3600 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3601 if (properties[keys[i]] != null)
3602 this[keys[i]] = properties[keys[i]];
3603 }
3604
3605 /**
3606 * FetchNode serviceName.
3607 * @member {string} serviceName
3608 * @memberof Trace.QueryPlanNode.FetchNode
3609 * @instance
3610 */
3611 FetchNode.prototype.serviceName = "";
3612
3613 /**
3614 * FetchNode traceParsingFailed.
3615 * @member {boolean} traceParsingFailed
3616 * @memberof Trace.QueryPlanNode.FetchNode
3617 * @instance
3618 */
3619 FetchNode.prototype.traceParsingFailed = false;
3620
3621 /**
3622 * FetchNode trace.
3623 * @member {ITrace|null|undefined} trace
3624 * @memberof Trace.QueryPlanNode.FetchNode
3625 * @instance
3626 */
3627 FetchNode.prototype.trace = null;
3628
3629 /**
3630 * FetchNode sentTimeOffset.
3631 * @member {number} sentTimeOffset
3632 * @memberof Trace.QueryPlanNode.FetchNode
3633 * @instance
3634 */
3635 FetchNode.prototype.sentTimeOffset = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
3636
3637 /**
3638 * FetchNode sentTime.
3639 * @member {google.protobuf.ITimestamp|null|undefined} sentTime
3640 * @memberof Trace.QueryPlanNode.FetchNode
3641 * @instance
3642 */
3643 FetchNode.prototype.sentTime = null;
3644
3645 /**
3646 * FetchNode receivedTime.
3647 * @member {google.protobuf.ITimestamp|null|undefined} receivedTime
3648 * @memberof Trace.QueryPlanNode.FetchNode
3649 * @instance
3650 */
3651 FetchNode.prototype.receivedTime = null;
3652
3653 /**
3654 * Creates a new FetchNode instance using the specified properties.
3655 * @function create
3656 * @memberof Trace.QueryPlanNode.FetchNode
3657 * @static
3658 * @param {Trace.QueryPlanNode.IFetchNode=} [properties] Properties to set
3659 * @returns {Trace.QueryPlanNode.FetchNode} FetchNode instance
3660 */
3661 FetchNode.create = function create(properties) {
3662 return new FetchNode(properties);
3663 };
3664
3665 /**
3666 * Encodes the specified FetchNode message. Does not implicitly {@link Trace.QueryPlanNode.FetchNode.verify|verify} messages.
3667 * @function encode
3668 * @memberof Trace.QueryPlanNode.FetchNode
3669 * @static
3670 * @param {Trace.QueryPlanNode.IFetchNode} message FetchNode message or plain object to encode
3671 * @param {$protobuf.Writer} [writer] Writer to encode to
3672 * @returns {$protobuf.Writer} Writer
3673 */
3674 FetchNode.encode = function encode(message, writer) {
3675 if (!writer)
3676 writer = $Writer.create();
3677 if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName"))
3678 writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName);
3679 if (message.traceParsingFailed != null && Object.hasOwnProperty.call(message, "traceParsingFailed"))
3680 writer.uint32(/* id 2, wireType 0 =*/16).bool(message.traceParsingFailed);
3681 if (message.trace != null && Object.hasOwnProperty.call(message, "trace"))
3682 $root.Trace.encode(message.trace, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
3683 if (message.sentTimeOffset != null && Object.hasOwnProperty.call(message, "sentTimeOffset"))
3684 writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sentTimeOffset);
3685 if (message.sentTime != null && Object.hasOwnProperty.call(message, "sentTime"))
3686 $root.google.protobuf.Timestamp.encode(message.sentTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
3687 if (message.receivedTime != null && Object.hasOwnProperty.call(message, "receivedTime"))
3688 $root.google.protobuf.Timestamp.encode(message.receivedTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
3689 return writer;
3690 };
3691
3692 /**
3693 * Encodes the specified FetchNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.FetchNode.verify|verify} messages.
3694 * @function encodeDelimited
3695 * @memberof Trace.QueryPlanNode.FetchNode
3696 * @static
3697 * @param {Trace.QueryPlanNode.IFetchNode} message FetchNode message or plain object to encode
3698 * @param {$protobuf.Writer} [writer] Writer to encode to
3699 * @returns {$protobuf.Writer} Writer
3700 */
3701 FetchNode.encodeDelimited = function encodeDelimited(message, writer) {
3702 return this.encode(message, writer).ldelim();
3703 };
3704
3705 /**
3706 * Decodes a FetchNode message from the specified reader or buffer.
3707 * @function decode
3708 * @memberof Trace.QueryPlanNode.FetchNode
3709 * @static
3710 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3711 * @param {number} [length] Message length if known beforehand
3712 * @returns {Trace.QueryPlanNode.FetchNode} FetchNode
3713 * @throws {Error} If the payload is not a reader or valid buffer
3714 * @throws {$protobuf.util.ProtocolError} If required fields are missing
3715 */
3716 FetchNode.decode = function decode(reader, length) {
3717 if (!(reader instanceof $Reader))
3718 reader = $Reader.create(reader);
3719 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.FetchNode();
3720 while (reader.pos < end) {
3721 var tag = reader.uint32();
3722 switch (tag >>> 3) {
3723 case 1:
3724 message.serviceName = reader.string();
3725 break;
3726 case 2:
3727 message.traceParsingFailed = reader.bool();
3728 break;
3729 case 3:
3730 message.trace = $root.Trace.decode(reader, reader.uint32());
3731 break;
3732 case 4:
3733 message.sentTimeOffset = reader.uint64();
3734 break;
3735 case 5:
3736 message.sentTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
3737 break;
3738 case 6:
3739 message.receivedTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
3740 break;
3741 default:
3742 reader.skipType(tag & 7);
3743 break;
3744 }
3745 }
3746 return message;
3747 };
3748
3749 /**
3750 * Decodes a FetchNode message from the specified reader or buffer, length delimited.
3751 * @function decodeDelimited
3752 * @memberof Trace.QueryPlanNode.FetchNode
3753 * @static
3754 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3755 * @returns {Trace.QueryPlanNode.FetchNode} FetchNode
3756 * @throws {Error} If the payload is not a reader or valid buffer
3757 * @throws {$protobuf.util.ProtocolError} If required fields are missing
3758 */
3759 FetchNode.decodeDelimited = function decodeDelimited(reader) {
3760 if (!(reader instanceof $Reader))
3761 reader = new $Reader(reader);
3762 return this.decode(reader, reader.uint32());
3763 };
3764
3765 /**
3766 * Verifies a FetchNode message.
3767 * @function verify
3768 * @memberof Trace.QueryPlanNode.FetchNode
3769 * @static
3770 * @param {Object.<string,*>} message Plain object to verify
3771 * @returns {string|null} `null` if valid, otherwise the reason why it is not
3772 */
3773 FetchNode.verify = function verify(message) {
3774 if (typeof message !== "object" || message === null)
3775 return "object expected";
3776 if (message.serviceName != null && message.hasOwnProperty("serviceName"))
3777 if (!$util.isString(message.serviceName))
3778 return "serviceName: string expected";
3779 if (message.traceParsingFailed != null && message.hasOwnProperty("traceParsingFailed"))
3780 if (typeof message.traceParsingFailed !== "boolean")
3781 return "traceParsingFailed: boolean expected";
3782 if (message.trace != null && message.hasOwnProperty("trace")) {
3783 var error = $root.Trace.verify(message.trace);
3784 if (error)
3785 return "trace." + error;
3786 }
3787 if (message.sentTimeOffset != null && message.hasOwnProperty("sentTimeOffset"))
3788 if (!$util.isInteger(message.sentTimeOffset) && !(message.sentTimeOffset && $util.isInteger(message.sentTimeOffset.low) && $util.isInteger(message.sentTimeOffset.high)))
3789 return "sentTimeOffset: integer|Long expected";
3790 if (message.sentTime != null && message.hasOwnProperty("sentTime")) {
3791 var error = $root.google.protobuf.Timestamp.verify(message.sentTime);
3792 if (error)
3793 return "sentTime." + error;
3794 }
3795 if (message.receivedTime != null && message.hasOwnProperty("receivedTime")) {
3796 var error = $root.google.protobuf.Timestamp.verify(message.receivedTime);
3797 if (error)
3798 return "receivedTime." + error;
3799 }
3800 return null;
3801 };
3802
3803 /**
3804 * Creates a FetchNode message from a plain object. Also converts values to their respective internal types.
3805 * @function fromObject
3806 * @memberof Trace.QueryPlanNode.FetchNode
3807 * @static
3808 * @param {Object.<string,*>} object Plain object
3809 * @returns {Trace.QueryPlanNode.FetchNode} FetchNode
3810 */
3811 FetchNode.fromObject = function fromObject(object) {
3812 if (object instanceof $root.Trace.QueryPlanNode.FetchNode)
3813 return object;
3814 var message = new $root.Trace.QueryPlanNode.FetchNode();
3815 if (object.serviceName != null)
3816 message.serviceName = String(object.serviceName);
3817 if (object.traceParsingFailed != null)
3818 message.traceParsingFailed = Boolean(object.traceParsingFailed);
3819 if (object.trace != null) {
3820 if (typeof object.trace !== "object")
3821 throw TypeError(".Trace.QueryPlanNode.FetchNode.trace: object expected");
3822 message.trace = $root.Trace.fromObject(object.trace);
3823 }
3824 if (object.sentTimeOffset != null)
3825 if ($util.Long)
3826 (message.sentTimeOffset = $util.Long.fromValue(object.sentTimeOffset)).unsigned = true;
3827 else if (typeof object.sentTimeOffset === "string")
3828 message.sentTimeOffset = parseInt(object.sentTimeOffset, 10);
3829 else if (typeof object.sentTimeOffset === "number")
3830 message.sentTimeOffset = object.sentTimeOffset;
3831 else if (typeof object.sentTimeOffset === "object")
3832 message.sentTimeOffset = new $util.LongBits(object.sentTimeOffset.low >>> 0, object.sentTimeOffset.high >>> 0).toNumber(true);
3833 if (object.sentTime != null) {
3834 if (typeof object.sentTime !== "object")
3835 throw TypeError(".Trace.QueryPlanNode.FetchNode.sentTime: object expected");
3836 message.sentTime = $root.google.protobuf.Timestamp.fromObject(object.sentTime);
3837 }
3838 if (object.receivedTime != null) {
3839 if (typeof object.receivedTime !== "object")
3840 throw TypeError(".Trace.QueryPlanNode.FetchNode.receivedTime: object expected");
3841 message.receivedTime = $root.google.protobuf.Timestamp.fromObject(object.receivedTime);
3842 }
3843 return message;
3844 };
3845
3846 /**
3847 * Creates a plain object from a FetchNode message. Also converts values to other types if specified.
3848 * @function toObject
3849 * @memberof Trace.QueryPlanNode.FetchNode
3850 * @static
3851 * @param {Trace.QueryPlanNode.FetchNode} message FetchNode
3852 * @param {$protobuf.IConversionOptions} [options] Conversion options
3853 * @returns {Object.<string,*>} Plain object
3854 */
3855 FetchNode.toObject = function toObject(message, options) {
3856 if (!options)
3857 options = {};
3858 var object = {};
3859 if (options.defaults) {
3860 object.serviceName = "";
3861 object.traceParsingFailed = false;
3862 object.trace = null;
3863 if ($util.Long) {
3864 var long = new $util.Long(0, 0, true);
3865 object.sentTimeOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
3866 } else
3867 object.sentTimeOffset = options.longs === String ? "0" : 0;
3868 object.sentTime = null;
3869 object.receivedTime = null;
3870 }
3871 if (message.serviceName != null && message.hasOwnProperty("serviceName"))
3872 object.serviceName = message.serviceName;
3873 if (message.traceParsingFailed != null && message.hasOwnProperty("traceParsingFailed"))
3874 object.traceParsingFailed = message.traceParsingFailed;
3875 if (message.trace != null && message.hasOwnProperty("trace"))
3876 object.trace = $root.Trace.toObject(message.trace, options);
3877 if (message.sentTimeOffset != null && message.hasOwnProperty("sentTimeOffset"))
3878 if (typeof message.sentTimeOffset === "number")
3879 object.sentTimeOffset = options.longs === String ? String(message.sentTimeOffset) : message.sentTimeOffset;
3880 else
3881 object.sentTimeOffset = options.longs === String ? $util.Long.prototype.toString.call(message.sentTimeOffset) : options.longs === Number ? new $util.LongBits(message.sentTimeOffset.low >>> 0, message.sentTimeOffset.high >>> 0).toNumber(true) : message.sentTimeOffset;
3882 if (message.sentTime != null && message.hasOwnProperty("sentTime"))
3883 object.sentTime = $root.google.protobuf.Timestamp.toObject(message.sentTime, options);
3884 if (message.receivedTime != null && message.hasOwnProperty("receivedTime"))
3885 object.receivedTime = $root.google.protobuf.Timestamp.toObject(message.receivedTime, options);
3886 return object;
3887 };
3888
3889 /**
3890 * Converts this FetchNode to JSON.
3891 * @function toJSON
3892 * @memberof Trace.QueryPlanNode.FetchNode
3893 * @instance
3894 * @returns {Object.<string,*>} JSON object
3895 */
3896 FetchNode.prototype.toJSON = function toJSON() {
3897 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3898 };
3899
3900 return FetchNode;
3901 })();
3902
3903 QueryPlanNode.FlattenNode = (function() {
3904
3905 /**
3906 * Properties of a FlattenNode.
3907 * @memberof Trace.QueryPlanNode
3908 * @interface IFlattenNode
3909 * @property {Array.<Trace.QueryPlanNode.IResponsePathElement>|null} [responsePath] FlattenNode responsePath
3910 * @property {Trace.IQueryPlanNode|null} [node] FlattenNode node
3911 */
3912
3913 /**
3914 * Constructs a new FlattenNode.
3915 * @memberof Trace.QueryPlanNode
3916 * @classdesc Represents a FlattenNode.
3917 * @implements IFlattenNode
3918 * @constructor
3919 * @param {Trace.QueryPlanNode.IFlattenNode=} [properties] Properties to set
3920 */
3921 function FlattenNode(properties) {
3922 this.responsePath = [];
3923 if (properties)
3924 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3925 if (properties[keys[i]] != null)
3926 this[keys[i]] = properties[keys[i]];
3927 }
3928
3929 /**
3930 * FlattenNode responsePath.
3931 * @member {Array.<Trace.QueryPlanNode.IResponsePathElement>} responsePath
3932 * @memberof Trace.QueryPlanNode.FlattenNode
3933 * @instance
3934 */
3935 FlattenNode.prototype.responsePath = $util.emptyArray;
3936
3937 /**
3938 * FlattenNode node.
3939 * @member {Trace.IQueryPlanNode|null|undefined} node
3940 * @memberof Trace.QueryPlanNode.FlattenNode
3941 * @instance
3942 */
3943 FlattenNode.prototype.node = null;
3944
3945 /**
3946 * Creates a new FlattenNode instance using the specified properties.
3947 * @function create
3948 * @memberof Trace.QueryPlanNode.FlattenNode
3949 * @static
3950 * @param {Trace.QueryPlanNode.IFlattenNode=} [properties] Properties to set
3951 * @returns {Trace.QueryPlanNode.FlattenNode} FlattenNode instance
3952 */
3953 FlattenNode.create = function create(properties) {
3954 return new FlattenNode(properties);
3955 };
3956
3957 /**
3958 * Encodes the specified FlattenNode message. Does not implicitly {@link Trace.QueryPlanNode.FlattenNode.verify|verify} messages.
3959 * @function encode
3960 * @memberof Trace.QueryPlanNode.FlattenNode
3961 * @static
3962 * @param {Trace.QueryPlanNode.IFlattenNode} message FlattenNode message or plain object to encode
3963 * @param {$protobuf.Writer} [writer] Writer to encode to
3964 * @returns {$protobuf.Writer} Writer
3965 */
3966 FlattenNode.encode = function encode(message, writer) {
3967 if (!writer)
3968 writer = $Writer.create();
3969 if (message.responsePath != null && message.responsePath.length)
3970 for (var i = 0; i < message.responsePath.length; ++i)
3971 $root.Trace.QueryPlanNode.ResponsePathElement.encode(message.responsePath[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
3972 if (message.node != null && Object.hasOwnProperty.call(message, "node"))
3973 $root.Trace.QueryPlanNode.encode(message.node, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
3974 return writer;
3975 };
3976
3977 /**
3978 * Encodes the specified FlattenNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.FlattenNode.verify|verify} messages.
3979 * @function encodeDelimited
3980 * @memberof Trace.QueryPlanNode.FlattenNode
3981 * @static
3982 * @param {Trace.QueryPlanNode.IFlattenNode} message FlattenNode message or plain object to encode
3983 * @param {$protobuf.Writer} [writer] Writer to encode to
3984 * @returns {$protobuf.Writer} Writer
3985 */
3986 FlattenNode.encodeDelimited = function encodeDelimited(message, writer) {
3987 return this.encode(message, writer).ldelim();
3988 };
3989
3990 /**
3991 * Decodes a FlattenNode message from the specified reader or buffer.
3992 * @function decode
3993 * @memberof Trace.QueryPlanNode.FlattenNode
3994 * @static
3995 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3996 * @param {number} [length] Message length if known beforehand
3997 * @returns {Trace.QueryPlanNode.FlattenNode} FlattenNode
3998 * @throws {Error} If the payload is not a reader or valid buffer
3999 * @throws {$protobuf.util.ProtocolError} If required fields are missing
4000 */
4001 FlattenNode.decode = function decode(reader, length) {
4002 if (!(reader instanceof $Reader))
4003 reader = $Reader.create(reader);
4004 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.FlattenNode();
4005 while (reader.pos < end) {
4006 var tag = reader.uint32();
4007 switch (tag >>> 3) {
4008 case 1:
4009 if (!(message.responsePath && message.responsePath.length))
4010 message.responsePath = [];
4011 message.responsePath.push($root.Trace.QueryPlanNode.ResponsePathElement.decode(reader, reader.uint32()));
4012 break;
4013 case 2:
4014 message.node = $root.Trace.QueryPlanNode.decode(reader, reader.uint32());
4015 break;
4016 default:
4017 reader.skipType(tag & 7);
4018 break;
4019 }
4020 }
4021 return message;
4022 };
4023
4024 /**
4025 * Decodes a FlattenNode message from the specified reader or buffer, length delimited.
4026 * @function decodeDelimited
4027 * @memberof Trace.QueryPlanNode.FlattenNode
4028 * @static
4029 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
4030 * @returns {Trace.QueryPlanNode.FlattenNode} FlattenNode
4031 * @throws {Error} If the payload is not a reader or valid buffer
4032 * @throws {$protobuf.util.ProtocolError} If required fields are missing
4033 */
4034 FlattenNode.decodeDelimited = function decodeDelimited(reader) {
4035 if (!(reader instanceof $Reader))
4036 reader = new $Reader(reader);
4037 return this.decode(reader, reader.uint32());
4038 };
4039
4040 /**
4041 * Verifies a FlattenNode message.
4042 * @function verify
4043 * @memberof Trace.QueryPlanNode.FlattenNode
4044 * @static
4045 * @param {Object.<string,*>} message Plain object to verify
4046 * @returns {string|null} `null` if valid, otherwise the reason why it is not
4047 */
4048 FlattenNode.verify = function verify(message) {
4049 if (typeof message !== "object" || message === null)
4050 return "object expected";
4051 if (message.responsePath != null && message.hasOwnProperty("responsePath")) {
4052 if (!Array.isArray(message.responsePath))
4053 return "responsePath: array expected";
4054 for (var i = 0; i < message.responsePath.length; ++i) {
4055 var error = $root.Trace.QueryPlanNode.ResponsePathElement.verify(message.responsePath[i]);
4056 if (error)
4057 return "responsePath." + error;
4058 }
4059 }
4060 if (message.node != null && message.hasOwnProperty("node")) {
4061 var error = $root.Trace.QueryPlanNode.verify(message.node);
4062 if (error)
4063 return "node." + error;
4064 }
4065 return null;
4066 };
4067
4068 /**
4069 * Creates a FlattenNode message from a plain object. Also converts values to their respective internal types.
4070 * @function fromObject
4071 * @memberof Trace.QueryPlanNode.FlattenNode
4072 * @static
4073 * @param {Object.<string,*>} object Plain object
4074 * @returns {Trace.QueryPlanNode.FlattenNode} FlattenNode
4075 */
4076 FlattenNode.fromObject = function fromObject(object) {
4077 if (object instanceof $root.Trace.QueryPlanNode.FlattenNode)
4078 return object;
4079 var message = new $root.Trace.QueryPlanNode.FlattenNode();
4080 if (object.responsePath) {
4081 if (!Array.isArray(object.responsePath))
4082 throw TypeError(".Trace.QueryPlanNode.FlattenNode.responsePath: array expected");
4083 message.responsePath = [];
4084 for (var i = 0; i < object.responsePath.length; ++i) {
4085 if (typeof object.responsePath[i] !== "object")
4086 throw TypeError(".Trace.QueryPlanNode.FlattenNode.responsePath: object expected");
4087 message.responsePath[i] = $root.Trace.QueryPlanNode.ResponsePathElement.fromObject(object.responsePath[i]);
4088 }
4089 }
4090 if (object.node != null) {
4091 if (typeof object.node !== "object")
4092 throw TypeError(".Trace.QueryPlanNode.FlattenNode.node: object expected");
4093 message.node = $root.Trace.QueryPlanNode.fromObject(object.node);
4094 }
4095 return message;
4096 };
4097
4098 /**
4099 * Creates a plain object from a FlattenNode message. Also converts values to other types if specified.
4100 * @function toObject
4101 * @memberof Trace.QueryPlanNode.FlattenNode
4102 * @static
4103 * @param {Trace.QueryPlanNode.FlattenNode} message FlattenNode
4104 * @param {$protobuf.IConversionOptions} [options] Conversion options
4105 * @returns {Object.<string,*>} Plain object
4106 */
4107 FlattenNode.toObject = function toObject(message, options) {
4108 if (!options)
4109 options = {};
4110 var object = {};
4111 if (options.arrays || options.defaults)
4112 object.responsePath = [];
4113 if (options.defaults)
4114 object.node = null;
4115 if (message.responsePath && message.responsePath.length) {
4116 object.responsePath = [];
4117 for (var j = 0; j < message.responsePath.length; ++j)
4118 object.responsePath[j] = $root.Trace.QueryPlanNode.ResponsePathElement.toObject(message.responsePath[j], options);
4119 }
4120 if (message.node != null && message.hasOwnProperty("node"))
4121 object.node = $root.Trace.QueryPlanNode.toObject(message.node, options);
4122 return object;
4123 };
4124
4125 /**
4126 * Converts this FlattenNode to JSON.
4127 * @function toJSON
4128 * @memberof Trace.QueryPlanNode.FlattenNode
4129 * @instance
4130 * @returns {Object.<string,*>} JSON object
4131 */
4132 FlattenNode.prototype.toJSON = function toJSON() {
4133 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
4134 };
4135
4136 return FlattenNode;
4137 })();
4138
4139 QueryPlanNode.ResponsePathElement = (function() {
4140
4141 /**
4142 * Properties of a ResponsePathElement.
4143 * @memberof Trace.QueryPlanNode
4144 * @interface IResponsePathElement
4145 * @property {string|null} [fieldName] ResponsePathElement fieldName
4146 * @property {number|null} [index] ResponsePathElement index
4147 */
4148
4149 /**
4150 * Constructs a new ResponsePathElement.
4151 * @memberof Trace.QueryPlanNode
4152 * @classdesc Represents a ResponsePathElement.
4153 * @implements IResponsePathElement
4154 * @constructor
4155 * @param {Trace.QueryPlanNode.IResponsePathElement=} [properties] Properties to set
4156 */
4157 function ResponsePathElement(properties) {
4158 if (properties)
4159 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
4160 if (properties[keys[i]] != null)
4161 this[keys[i]] = properties[keys[i]];
4162 }
4163
4164 /**
4165 * ResponsePathElement fieldName.
4166 * @member {string} fieldName
4167 * @memberof Trace.QueryPlanNode.ResponsePathElement
4168 * @instance
4169 */
4170 ResponsePathElement.prototype.fieldName = "";
4171
4172 /**
4173 * ResponsePathElement index.
4174 * @member {number} index
4175 * @memberof Trace.QueryPlanNode.ResponsePathElement
4176 * @instance
4177 */
4178 ResponsePathElement.prototype.index = 0;
4179
4180 // OneOf field names bound to virtual getters and setters
4181 var $oneOfFields;
4182
4183 /**
4184 * ResponsePathElement id.
4185 * @member {"fieldName"|"index"|undefined} id
4186 * @memberof Trace.QueryPlanNode.ResponsePathElement
4187 * @instance
4188 */
4189 Object.defineProperty(ResponsePathElement.prototype, "id", {
4190 get: $util.oneOfGetter($oneOfFields = ["fieldName", "index"]),
4191 set: $util.oneOfSetter($oneOfFields)
4192 });
4193
4194 /**
4195 * Creates a new ResponsePathElement instance using the specified properties.
4196 * @function create
4197 * @memberof Trace.QueryPlanNode.ResponsePathElement
4198 * @static
4199 * @param {Trace.QueryPlanNode.IResponsePathElement=} [properties] Properties to set
4200 * @returns {Trace.QueryPlanNode.ResponsePathElement} ResponsePathElement instance
4201 */
4202 ResponsePathElement.create = function create(properties) {
4203 return new ResponsePathElement(properties);
4204 };
4205
4206 /**
4207 * Encodes the specified ResponsePathElement message. Does not implicitly {@link Trace.QueryPlanNode.ResponsePathElement.verify|verify} messages.
4208 * @function encode
4209 * @memberof Trace.QueryPlanNode.ResponsePathElement
4210 * @static
4211 * @param {Trace.QueryPlanNode.IResponsePathElement} message ResponsePathElement message or plain object to encode
4212 * @param {$protobuf.Writer} [writer] Writer to encode to
4213 * @returns {$protobuf.Writer} Writer
4214 */
4215 ResponsePathElement.encode = function encode(message, writer) {
4216 if (!writer)
4217 writer = $Writer.create();
4218 if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName"))
4219 writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName);
4220 if (message.index != null && Object.hasOwnProperty.call(message, "index"))
4221 writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.index);
4222 return writer;
4223 };
4224
4225 /**
4226 * Encodes the specified ResponsePathElement message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ResponsePathElement.verify|verify} messages.
4227 * @function encodeDelimited
4228 * @memberof Trace.QueryPlanNode.ResponsePathElement
4229 * @static
4230 * @param {Trace.QueryPlanNode.IResponsePathElement} message ResponsePathElement message or plain object to encode
4231 * @param {$protobuf.Writer} [writer] Writer to encode to
4232 * @returns {$protobuf.Writer} Writer
4233 */
4234 ResponsePathElement.encodeDelimited = function encodeDelimited(message, writer) {
4235 return this.encode(message, writer).ldelim();
4236 };
4237
4238 /**
4239 * Decodes a ResponsePathElement message from the specified reader or buffer.
4240 * @function decode
4241 * @memberof Trace.QueryPlanNode.ResponsePathElement
4242 * @static
4243 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
4244 * @param {number} [length] Message length if known beforehand
4245 * @returns {Trace.QueryPlanNode.ResponsePathElement} ResponsePathElement
4246 * @throws {Error} If the payload is not a reader or valid buffer
4247 * @throws {$protobuf.util.ProtocolError} If required fields are missing
4248 */
4249 ResponsePathElement.decode = function decode(reader, length) {
4250 if (!(reader instanceof $Reader))
4251 reader = $Reader.create(reader);
4252 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.ResponsePathElement();
4253 while (reader.pos < end) {
4254 var tag = reader.uint32();
4255 switch (tag >>> 3) {
4256 case 1:
4257 message.fieldName = reader.string();
4258 break;
4259 case 2:
4260 message.index = reader.uint32();
4261 break;
4262 default:
4263 reader.skipType(tag & 7);
4264 break;
4265 }
4266 }
4267 return message;
4268 };
4269
4270 /**
4271 * Decodes a ResponsePathElement message from the specified reader or buffer, length delimited.
4272 * @function decodeDelimited
4273 * @memberof Trace.QueryPlanNode.ResponsePathElement
4274 * @static
4275 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
4276 * @returns {Trace.QueryPlanNode.ResponsePathElement} ResponsePathElement
4277 * @throws {Error} If the payload is not a reader or valid buffer
4278 * @throws {$protobuf.util.ProtocolError} If required fields are missing
4279 */
4280 ResponsePathElement.decodeDelimited = function decodeDelimited(reader) {
4281 if (!(reader instanceof $Reader))
4282 reader = new $Reader(reader);
4283 return this.decode(reader, reader.uint32());
4284 };
4285
4286 /**
4287 * Verifies a ResponsePathElement message.
4288 * @function verify
4289 * @memberof Trace.QueryPlanNode.ResponsePathElement
4290 * @static
4291 * @param {Object.<string,*>} message Plain object to verify
4292 * @returns {string|null} `null` if valid, otherwise the reason why it is not
4293 */
4294 ResponsePathElement.verify = function verify(message) {
4295 if (typeof message !== "object" || message === null)
4296 return "object expected";
4297 var properties = {};
4298 if (message.fieldName != null && message.hasOwnProperty("fieldName")) {
4299 properties.id = 1;
4300 if (!$util.isString(message.fieldName))
4301 return "fieldName: string expected";
4302 }
4303 if (message.index != null && message.hasOwnProperty("index")) {
4304 if (properties.id === 1)
4305 return "id: multiple values";
4306 properties.id = 1;
4307 if (!$util.isInteger(message.index))
4308 return "index: integer expected";
4309 }
4310 return null;
4311 };
4312
4313 /**
4314 * Creates a ResponsePathElement message from a plain object. Also converts values to their respective internal types.
4315 * @function fromObject
4316 * @memberof Trace.QueryPlanNode.ResponsePathElement
4317 * @static
4318 * @param {Object.<string,*>} object Plain object
4319 * @returns {Trace.QueryPlanNode.ResponsePathElement} ResponsePathElement
4320 */
4321 ResponsePathElement.fromObject = function fromObject(object) {
4322 if (object instanceof $root.Trace.QueryPlanNode.ResponsePathElement)
4323 return object;
4324 var message = new $root.Trace.QueryPlanNode.ResponsePathElement();
4325 if (object.fieldName != null)
4326 message.fieldName = String(object.fieldName);
4327 if (object.index != null)
4328 message.index = object.index >>> 0;
4329 return message;
4330 };
4331
4332 /**
4333 * Creates a plain object from a ResponsePathElement message. Also converts values to other types if specified.
4334 * @function toObject
4335 * @memberof Trace.QueryPlanNode.ResponsePathElement
4336 * @static
4337 * @param {Trace.QueryPlanNode.ResponsePathElement} message ResponsePathElement
4338 * @param {$protobuf.IConversionOptions} [options] Conversion options
4339 * @returns {Object.<string,*>} Plain object
4340 */
4341 ResponsePathElement.toObject = function toObject(message, options) {
4342 if (!options)
4343 options = {};
4344 var object = {};
4345 if (message.fieldName != null && message.hasOwnProperty("fieldName")) {
4346 object.fieldName = message.fieldName;
4347 if (options.oneofs)
4348 object.id = "fieldName";
4349 }
4350 if (message.index != null && message.hasOwnProperty("index")) {
4351 object.index = message.index;
4352 if (options.oneofs)
4353 object.id = "index";
4354 }
4355 return object;
4356 };
4357
4358 /**
4359 * Converts this ResponsePathElement to JSON.
4360 * @function toJSON
4361 * @memberof Trace.QueryPlanNode.ResponsePathElement
4362 * @instance
4363 * @returns {Object.<string,*>} JSON object
4364 */
4365 ResponsePathElement.prototype.toJSON = function toJSON() {
4366 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
4367 };
4368
4369 return ResponsePathElement;
4370 })();
4371
4372 return QueryPlanNode;
4373 })();
4374
4375 return Trace;
4376})();
4377
4378$root.ReportHeader = (function() {
4379
4380 /**
4381 * Properties of a ReportHeader.
4382 * @exports IReportHeader
4383 * @interface IReportHeader
4384 * @property {string|null} [hostname] ReportHeader hostname
4385 * @property {string|null} [agentVersion] ReportHeader agentVersion
4386 * @property {string|null} [serviceVersion] ReportHeader serviceVersion
4387 * @property {string|null} [runtimeVersion] ReportHeader runtimeVersion
4388 * @property {string|null} [uname] ReportHeader uname
4389 * @property {string|null} [schemaTag] ReportHeader schemaTag
4390 * @property {string|null} [executableSchemaId] ReportHeader executableSchemaId
4391 */
4392
4393 /**
4394 * Constructs a new ReportHeader.
4395 * @exports ReportHeader
4396 * @classdesc Represents a ReportHeader.
4397 * @implements IReportHeader
4398 * @constructor
4399 * @param {IReportHeader=} [properties] Properties to set
4400 */
4401 function ReportHeader(properties) {
4402 if (properties)
4403 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
4404 if (properties[keys[i]] != null)
4405 this[keys[i]] = properties[keys[i]];
4406 }
4407
4408 /**
4409 * ReportHeader hostname.
4410 * @member {string} hostname
4411 * @memberof ReportHeader
4412 * @instance
4413 */
4414 ReportHeader.prototype.hostname = "";
4415
4416 /**
4417 * ReportHeader agentVersion.
4418 * @member {string} agentVersion
4419 * @memberof ReportHeader
4420 * @instance
4421 */
4422 ReportHeader.prototype.agentVersion = "";
4423
4424 /**
4425 * ReportHeader serviceVersion.
4426 * @member {string} serviceVersion
4427 * @memberof ReportHeader
4428 * @instance
4429 */
4430 ReportHeader.prototype.serviceVersion = "";
4431
4432 /**
4433 * ReportHeader runtimeVersion.
4434 * @member {string} runtimeVersion
4435 * @memberof ReportHeader
4436 * @instance
4437 */
4438 ReportHeader.prototype.runtimeVersion = "";
4439
4440 /**
4441 * ReportHeader uname.
4442 * @member {string} uname
4443 * @memberof ReportHeader
4444 * @instance
4445 */
4446 ReportHeader.prototype.uname = "";
4447
4448 /**
4449 * ReportHeader schemaTag.
4450 * @member {string} schemaTag
4451 * @memberof ReportHeader
4452 * @instance
4453 */
4454 ReportHeader.prototype.schemaTag = "";
4455
4456 /**
4457 * ReportHeader executableSchemaId.
4458 * @member {string} executableSchemaId
4459 * @memberof ReportHeader
4460 * @instance
4461 */
4462 ReportHeader.prototype.executableSchemaId = "";
4463
4464 /**
4465 * Creates a new ReportHeader instance using the specified properties.
4466 * @function create
4467 * @memberof ReportHeader
4468 * @static
4469 * @param {IReportHeader=} [properties] Properties to set
4470 * @returns {ReportHeader} ReportHeader instance
4471 */
4472 ReportHeader.create = function create(properties) {
4473 return new ReportHeader(properties);
4474 };
4475
4476 /**
4477 * Encodes the specified ReportHeader message. Does not implicitly {@link ReportHeader.verify|verify} messages.
4478 * @function encode
4479 * @memberof ReportHeader
4480 * @static
4481 * @param {IReportHeader} message ReportHeader message or plain object to encode
4482 * @param {$protobuf.Writer} [writer] Writer to encode to
4483 * @returns {$protobuf.Writer} Writer
4484 */
4485 ReportHeader.encode = function encode(message, writer) {
4486 if (!writer)
4487 writer = $Writer.create();
4488 if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname"))
4489 writer.uint32(/* id 5, wireType 2 =*/42).string(message.hostname);
4490 if (message.agentVersion != null && Object.hasOwnProperty.call(message, "agentVersion"))
4491 writer.uint32(/* id 6, wireType 2 =*/50).string(message.agentVersion);
4492 if (message.serviceVersion != null && Object.hasOwnProperty.call(message, "serviceVersion"))
4493 writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceVersion);
4494 if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion"))
4495 writer.uint32(/* id 8, wireType 2 =*/66).string(message.runtimeVersion);
4496 if (message.uname != null && Object.hasOwnProperty.call(message, "uname"))
4497 writer.uint32(/* id 9, wireType 2 =*/74).string(message.uname);
4498 if (message.schemaTag != null && Object.hasOwnProperty.call(message, "schemaTag"))
4499 writer.uint32(/* id 10, wireType 2 =*/82).string(message.schemaTag);
4500 if (message.executableSchemaId != null && Object.hasOwnProperty.call(message, "executableSchemaId"))
4501 writer.uint32(/* id 11, wireType 2 =*/90).string(message.executableSchemaId);
4502 return writer;
4503 };
4504
4505 /**
4506 * Encodes the specified ReportHeader message, length delimited. Does not implicitly {@link ReportHeader.verify|verify} messages.
4507 * @function encodeDelimited
4508 * @memberof ReportHeader
4509 * @static
4510 * @param {IReportHeader} message ReportHeader message or plain object to encode
4511 * @param {$protobuf.Writer} [writer] Writer to encode to
4512 * @returns {$protobuf.Writer} Writer
4513 */
4514 ReportHeader.encodeDelimited = function encodeDelimited(message, writer) {
4515 return this.encode(message, writer).ldelim();
4516 };
4517
4518 /**
4519 * Decodes a ReportHeader message from the specified reader or buffer.
4520 * @function decode
4521 * @memberof ReportHeader
4522 * @static
4523 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
4524 * @param {number} [length] Message length if known beforehand
4525 * @returns {ReportHeader} ReportHeader
4526 * @throws {Error} If the payload is not a reader or valid buffer
4527 * @throws {$protobuf.util.ProtocolError} If required fields are missing
4528 */
4529 ReportHeader.decode = function decode(reader, length) {
4530 if (!(reader instanceof $Reader))
4531 reader = $Reader.create(reader);
4532 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ReportHeader();
4533 while (reader.pos < end) {
4534 var tag = reader.uint32();
4535 switch (tag >>> 3) {
4536 case 5:
4537 message.hostname = reader.string();
4538 break;
4539 case 6:
4540 message.agentVersion = reader.string();
4541 break;
4542 case 7:
4543 message.serviceVersion = reader.string();
4544 break;
4545 case 8:
4546 message.runtimeVersion = reader.string();
4547 break;
4548 case 9:
4549 message.uname = reader.string();
4550 break;
4551 case 10:
4552 message.schemaTag = reader.string();
4553 break;
4554 case 11:
4555 message.executableSchemaId = reader.string();
4556 break;
4557 default:
4558 reader.skipType(tag & 7);
4559 break;
4560 }
4561 }
4562 return message;
4563 };
4564
4565 /**
4566 * Decodes a ReportHeader message from the specified reader or buffer, length delimited.
4567 * @function decodeDelimited
4568 * @memberof ReportHeader
4569 * @static
4570 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
4571 * @returns {ReportHeader} ReportHeader
4572 * @throws {Error} If the payload is not a reader or valid buffer
4573 * @throws {$protobuf.util.ProtocolError} If required fields are missing
4574 */
4575 ReportHeader.decodeDelimited = function decodeDelimited(reader) {
4576 if (!(reader instanceof $Reader))
4577 reader = new $Reader(reader);
4578 return this.decode(reader, reader.uint32());
4579 };
4580
4581 /**
4582 * Verifies a ReportHeader message.
4583 * @function verify
4584 * @memberof ReportHeader
4585 * @static
4586 * @param {Object.<string,*>} message Plain object to verify
4587 * @returns {string|null} `null` if valid, otherwise the reason why it is not
4588 */
4589 ReportHeader.verify = function verify(message) {
4590 if (typeof message !== "object" || message === null)
4591 return "object expected";
4592 if (message.hostname != null && message.hasOwnProperty("hostname"))
4593 if (!$util.isString(message.hostname))
4594 return "hostname: string expected";
4595 if (message.agentVersion != null && message.hasOwnProperty("agentVersion"))
4596 if (!$util.isString(message.agentVersion))
4597 return "agentVersion: string expected";
4598 if (message.serviceVersion != null && message.hasOwnProperty("serviceVersion"))
4599 if (!$util.isString(message.serviceVersion))
4600 return "serviceVersion: string expected";
4601 if (message.runtimeVersion != null && message.hasOwnProperty("runtimeVersion"))
4602 if (!$util.isString(message.runtimeVersion))
4603 return "runtimeVersion: string expected";
4604 if (message.uname != null && message.hasOwnProperty("uname"))
4605 if (!$util.isString(message.uname))
4606 return "uname: string expected";
4607 if (message.schemaTag != null && message.hasOwnProperty("schemaTag"))
4608 if (!$util.isString(message.schemaTag))
4609 return "schemaTag: string expected";
4610 if (message.executableSchemaId != null && message.hasOwnProperty("executableSchemaId"))
4611 if (!$util.isString(message.executableSchemaId))
4612 return "executableSchemaId: string expected";
4613 return null;
4614 };
4615
4616 /**
4617 * Creates a ReportHeader message from a plain object. Also converts values to their respective internal types.
4618 * @function fromObject
4619 * @memberof ReportHeader
4620 * @static
4621 * @param {Object.<string,*>} object Plain object
4622 * @returns {ReportHeader} ReportHeader
4623 */
4624 ReportHeader.fromObject = function fromObject(object) {
4625 if (object instanceof $root.ReportHeader)
4626 return object;
4627 var message = new $root.ReportHeader();
4628 if (object.hostname != null)
4629 message.hostname = String(object.hostname);
4630 if (object.agentVersion != null)
4631 message.agentVersion = String(object.agentVersion);
4632 if (object.serviceVersion != null)
4633 message.serviceVersion = String(object.serviceVersion);
4634 if (object.runtimeVersion != null)
4635 message.runtimeVersion = String(object.runtimeVersion);
4636 if (object.uname != null)
4637 message.uname = String(object.uname);
4638 if (object.schemaTag != null)
4639 message.schemaTag = String(object.schemaTag);
4640 if (object.executableSchemaId != null)
4641 message.executableSchemaId = String(object.executableSchemaId);
4642 return message;
4643 };
4644
4645 /**
4646 * Creates a plain object from a ReportHeader message. Also converts values to other types if specified.
4647 * @function toObject
4648 * @memberof ReportHeader
4649 * @static
4650 * @param {ReportHeader} message ReportHeader
4651 * @param {$protobuf.IConversionOptions} [options] Conversion options
4652 * @returns {Object.<string,*>} Plain object
4653 */
4654 ReportHeader.toObject = function toObject(message, options) {
4655 if (!options)
4656 options = {};
4657 var object = {};
4658 if (options.defaults) {
4659 object.hostname = "";
4660 object.agentVersion = "";
4661 object.serviceVersion = "";
4662 object.runtimeVersion = "";
4663 object.uname = "";
4664 object.schemaTag = "";
4665 object.executableSchemaId = "";
4666 }
4667 if (message.hostname != null && message.hasOwnProperty("hostname"))
4668 object.hostname = message.hostname;
4669 if (message.agentVersion != null && message.hasOwnProperty("agentVersion"))
4670 object.agentVersion = message.agentVersion;
4671 if (message.serviceVersion != null && message.hasOwnProperty("serviceVersion"))
4672 object.serviceVersion = message.serviceVersion;
4673 if (message.runtimeVersion != null && message.hasOwnProperty("runtimeVersion"))
4674 object.runtimeVersion = message.runtimeVersion;
4675 if (message.uname != null && message.hasOwnProperty("uname"))
4676 object.uname = message.uname;
4677 if (message.schemaTag != null && message.hasOwnProperty("schemaTag"))
4678 object.schemaTag = message.schemaTag;
4679 if (message.executableSchemaId != null && message.hasOwnProperty("executableSchemaId"))
4680 object.executableSchemaId = message.executableSchemaId;
4681 return object;
4682 };
4683
4684 /**
4685 * Converts this ReportHeader to JSON.
4686 * @function toJSON
4687 * @memberof ReportHeader
4688 * @instance
4689 * @returns {Object.<string,*>} JSON object
4690 */
4691 ReportHeader.prototype.toJSON = function toJSON() {
4692 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
4693 };
4694
4695 return ReportHeader;
4696})();
4697
4698$root.PathErrorStats = (function() {
4699
4700 /**
4701 * Properties of a PathErrorStats.
4702 * @exports IPathErrorStats
4703 * @interface IPathErrorStats
4704 * @property {Object.<string,IPathErrorStats>|null} [children] PathErrorStats children
4705 * @property {number|null} [errorsCount] PathErrorStats errorsCount
4706 * @property {number|null} [requestsWithErrorsCount] PathErrorStats requestsWithErrorsCount
4707 */
4708
4709 /**
4710 * Constructs a new PathErrorStats.
4711 * @exports PathErrorStats
4712 * @classdesc Represents a PathErrorStats.
4713 * @implements IPathErrorStats
4714 * @constructor
4715 * @param {IPathErrorStats=} [properties] Properties to set
4716 */
4717 function PathErrorStats(properties) {
4718 this.children = {};
4719 if (properties)
4720 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
4721 if (properties[keys[i]] != null)
4722 this[keys[i]] = properties[keys[i]];
4723 }
4724
4725 /**
4726 * PathErrorStats children.
4727 * @member {Object.<string,IPathErrorStats>} children
4728 * @memberof PathErrorStats
4729 * @instance
4730 */
4731 PathErrorStats.prototype.children = $util.emptyObject;
4732
4733 /**
4734 * PathErrorStats errorsCount.
4735 * @member {number} errorsCount
4736 * @memberof PathErrorStats
4737 * @instance
4738 */
4739 PathErrorStats.prototype.errorsCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
4740
4741 /**
4742 * PathErrorStats requestsWithErrorsCount.
4743 * @member {number} requestsWithErrorsCount
4744 * @memberof PathErrorStats
4745 * @instance
4746 */
4747 PathErrorStats.prototype.requestsWithErrorsCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
4748
4749 /**
4750 * Creates a new PathErrorStats instance using the specified properties.
4751 * @function create
4752 * @memberof PathErrorStats
4753 * @static
4754 * @param {IPathErrorStats=} [properties] Properties to set
4755 * @returns {PathErrorStats} PathErrorStats instance
4756 */
4757 PathErrorStats.create = function create(properties) {
4758 return new PathErrorStats(properties);
4759 };
4760
4761 /**
4762 * Encodes the specified PathErrorStats message. Does not implicitly {@link PathErrorStats.verify|verify} messages.
4763 * @function encode
4764 * @memberof PathErrorStats
4765 * @static
4766 * @param {IPathErrorStats} message PathErrorStats message or plain object to encode
4767 * @param {$protobuf.Writer} [writer] Writer to encode to
4768 * @returns {$protobuf.Writer} Writer
4769 */
4770 PathErrorStats.encode = function encode(message, writer) {
4771 if (!writer)
4772 writer = $Writer.create();
4773 if (message.children != null && Object.hasOwnProperty.call(message, "children"))
4774 for (var keys = Object.keys(message.children), i = 0; i < keys.length; ++i) {
4775 writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
4776 $root.PathErrorStats.encode(message.children[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
4777 }
4778 if (message.errorsCount != null && Object.hasOwnProperty.call(message, "errorsCount"))
4779 writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.errorsCount);
4780 if (message.requestsWithErrorsCount != null && Object.hasOwnProperty.call(message, "requestsWithErrorsCount"))
4781 writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.requestsWithErrorsCount);
4782 return writer;
4783 };
4784
4785 /**
4786 * Encodes the specified PathErrorStats message, length delimited. Does not implicitly {@link PathErrorStats.verify|verify} messages.
4787 * @function encodeDelimited
4788 * @memberof PathErrorStats
4789 * @static
4790 * @param {IPathErrorStats} message PathErrorStats message or plain object to encode
4791 * @param {$protobuf.Writer} [writer] Writer to encode to
4792 * @returns {$protobuf.Writer} Writer
4793 */
4794 PathErrorStats.encodeDelimited = function encodeDelimited(message, writer) {
4795 return this.encode(message, writer).ldelim();
4796 };
4797
4798 /**
4799 * Decodes a PathErrorStats message from the specified reader or buffer.
4800 * @function decode
4801 * @memberof PathErrorStats
4802 * @static
4803 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
4804 * @param {number} [length] Message length if known beforehand
4805 * @returns {PathErrorStats} PathErrorStats
4806 * @throws {Error} If the payload is not a reader or valid buffer
4807 * @throws {$protobuf.util.ProtocolError} If required fields are missing
4808 */
4809 PathErrorStats.decode = function decode(reader, length) {
4810 if (!(reader instanceof $Reader))
4811 reader = $Reader.create(reader);
4812 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PathErrorStats(), key;
4813 while (reader.pos < end) {
4814 var tag = reader.uint32();
4815 switch (tag >>> 3) {
4816 case 1:
4817 reader.skip().pos++;
4818 if (message.children === $util.emptyObject)
4819 message.children = {};
4820 key = reader.string();
4821 reader.pos++;
4822 message.children[key] = $root.PathErrorStats.decode(reader, reader.uint32());
4823 break;
4824 case 4:
4825 message.errorsCount = reader.uint64();
4826 break;
4827 case 5:
4828 message.requestsWithErrorsCount = reader.uint64();
4829 break;
4830 default:
4831 reader.skipType(tag & 7);
4832 break;
4833 }
4834 }
4835 return message;
4836 };
4837
4838 /**
4839 * Decodes a PathErrorStats message from the specified reader or buffer, length delimited.
4840 * @function decodeDelimited
4841 * @memberof PathErrorStats
4842 * @static
4843 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
4844 * @returns {PathErrorStats} PathErrorStats
4845 * @throws {Error} If the payload is not a reader or valid buffer
4846 * @throws {$protobuf.util.ProtocolError} If required fields are missing
4847 */
4848 PathErrorStats.decodeDelimited = function decodeDelimited(reader) {
4849 if (!(reader instanceof $Reader))
4850 reader = new $Reader(reader);
4851 return this.decode(reader, reader.uint32());
4852 };
4853
4854 /**
4855 * Verifies a PathErrorStats message.
4856 * @function verify
4857 * @memberof PathErrorStats
4858 * @static
4859 * @param {Object.<string,*>} message Plain object to verify
4860 * @returns {string|null} `null` if valid, otherwise the reason why it is not
4861 */
4862 PathErrorStats.verify = function verify(message) {
4863 if (typeof message !== "object" || message === null)
4864 return "object expected";
4865 if (message.children != null && message.hasOwnProperty("children")) {
4866 if (!$util.isObject(message.children))
4867 return "children: object expected";
4868 var key = Object.keys(message.children);
4869 for (var i = 0; i < key.length; ++i) {
4870 var error = $root.PathErrorStats.verify(message.children[key[i]]);
4871 if (error)
4872 return "children." + error;
4873 }
4874 }
4875 if (message.errorsCount != null && message.hasOwnProperty("errorsCount"))
4876 if (!$util.isInteger(message.errorsCount) && !(message.errorsCount && $util.isInteger(message.errorsCount.low) && $util.isInteger(message.errorsCount.high)))
4877 return "errorsCount: integer|Long expected";
4878 if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount"))
4879 if (!$util.isInteger(message.requestsWithErrorsCount) && !(message.requestsWithErrorsCount && $util.isInteger(message.requestsWithErrorsCount.low) && $util.isInteger(message.requestsWithErrorsCount.high)))
4880 return "requestsWithErrorsCount: integer|Long expected";
4881 return null;
4882 };
4883
4884 /**
4885 * Creates a PathErrorStats message from a plain object. Also converts values to their respective internal types.
4886 * @function fromObject
4887 * @memberof PathErrorStats
4888 * @static
4889 * @param {Object.<string,*>} object Plain object
4890 * @returns {PathErrorStats} PathErrorStats
4891 */
4892 PathErrorStats.fromObject = function fromObject(object) {
4893 if (object instanceof $root.PathErrorStats)
4894 return object;
4895 var message = new $root.PathErrorStats();
4896 if (object.children) {
4897 if (typeof object.children !== "object")
4898 throw TypeError(".PathErrorStats.children: object expected");
4899 message.children = {};
4900 for (var keys = Object.keys(object.children), i = 0; i < keys.length; ++i) {
4901 if (typeof object.children[keys[i]] !== "object")
4902 throw TypeError(".PathErrorStats.children: object expected");
4903 message.children[keys[i]] = $root.PathErrorStats.fromObject(object.children[keys[i]]);
4904 }
4905 }
4906 if (object.errorsCount != null)
4907 if ($util.Long)
4908 (message.errorsCount = $util.Long.fromValue(object.errorsCount)).unsigned = true;
4909 else if (typeof object.errorsCount === "string")
4910 message.errorsCount = parseInt(object.errorsCount, 10);
4911 else if (typeof object.errorsCount === "number")
4912 message.errorsCount = object.errorsCount;
4913 else if (typeof object.errorsCount === "object")
4914 message.errorsCount = new $util.LongBits(object.errorsCount.low >>> 0, object.errorsCount.high >>> 0).toNumber(true);
4915 if (object.requestsWithErrorsCount != null)
4916 if ($util.Long)
4917 (message.requestsWithErrorsCount = $util.Long.fromValue(object.requestsWithErrorsCount)).unsigned = true;
4918 else if (typeof object.requestsWithErrorsCount === "string")
4919 message.requestsWithErrorsCount = parseInt(object.requestsWithErrorsCount, 10);
4920 else if (typeof object.requestsWithErrorsCount === "number")
4921 message.requestsWithErrorsCount = object.requestsWithErrorsCount;
4922 else if (typeof object.requestsWithErrorsCount === "object")
4923 message.requestsWithErrorsCount = new $util.LongBits(object.requestsWithErrorsCount.low >>> 0, object.requestsWithErrorsCount.high >>> 0).toNumber(true);
4924 return message;
4925 };
4926
4927 /**
4928 * Creates a plain object from a PathErrorStats message. Also converts values to other types if specified.
4929 * @function toObject
4930 * @memberof PathErrorStats
4931 * @static
4932 * @param {PathErrorStats} message PathErrorStats
4933 * @param {$protobuf.IConversionOptions} [options] Conversion options
4934 * @returns {Object.<string,*>} Plain object
4935 */
4936 PathErrorStats.toObject = function toObject(message, options) {
4937 if (!options)
4938 options = {};
4939 var object = {};
4940 if (options.objects || options.defaults)
4941 object.children = {};
4942 if (options.defaults) {
4943 if ($util.Long) {
4944 var long = new $util.Long(0, 0, true);
4945 object.errorsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
4946 } else
4947 object.errorsCount = options.longs === String ? "0" : 0;
4948 if ($util.Long) {
4949 var long = new $util.Long(0, 0, true);
4950 object.requestsWithErrorsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
4951 } else
4952 object.requestsWithErrorsCount = options.longs === String ? "0" : 0;
4953 }
4954 var keys2;
4955 if (message.children && (keys2 = Object.keys(message.children)).length) {
4956 object.children = {};
4957 for (var j = 0; j < keys2.length; ++j)
4958 object.children[keys2[j]] = $root.PathErrorStats.toObject(message.children[keys2[j]], options);
4959 }
4960 if (message.errorsCount != null && message.hasOwnProperty("errorsCount"))
4961 if (typeof message.errorsCount === "number")
4962 object.errorsCount = options.longs === String ? String(message.errorsCount) : message.errorsCount;
4963 else
4964 object.errorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.errorsCount) : options.longs === Number ? new $util.LongBits(message.errorsCount.low >>> 0, message.errorsCount.high >>> 0).toNumber(true) : message.errorsCount;
4965 if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount"))
4966 if (typeof message.requestsWithErrorsCount === "number")
4967 object.requestsWithErrorsCount = options.longs === String ? String(message.requestsWithErrorsCount) : message.requestsWithErrorsCount;
4968 else
4969 object.requestsWithErrorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestsWithErrorsCount) : options.longs === Number ? new $util.LongBits(message.requestsWithErrorsCount.low >>> 0, message.requestsWithErrorsCount.high >>> 0).toNumber(true) : message.requestsWithErrorsCount;
4970 return object;
4971 };
4972
4973 /**
4974 * Converts this PathErrorStats to JSON.
4975 * @function toJSON
4976 * @memberof PathErrorStats
4977 * @instance
4978 * @returns {Object.<string,*>} JSON object
4979 */
4980 PathErrorStats.prototype.toJSON = function toJSON() {
4981 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
4982 };
4983
4984 return PathErrorStats;
4985})();
4986
4987$root.QueryLatencyStats = (function() {
4988
4989 /**
4990 * Properties of a QueryLatencyStats.
4991 * @exports IQueryLatencyStats
4992 * @interface IQueryLatencyStats
4993 * @property {Array.<number>|null} [latencyCount] QueryLatencyStats latencyCount
4994 * @property {number|null} [requestCount] QueryLatencyStats requestCount
4995 * @property {number|null} [cacheHits] QueryLatencyStats cacheHits
4996 * @property {number|null} [persistedQueryHits] QueryLatencyStats persistedQueryHits
4997 * @property {number|null} [persistedQueryMisses] QueryLatencyStats persistedQueryMisses
4998 * @property {Array.<number>|null} [cacheLatencyCount] QueryLatencyStats cacheLatencyCount
4999 * @property {IPathErrorStats|null} [rootErrorStats] QueryLatencyStats rootErrorStats
5000 * @property {number|null} [requestsWithErrorsCount] QueryLatencyStats requestsWithErrorsCount
5001 * @property {Array.<number>|null} [publicCacheTtlCount] QueryLatencyStats publicCacheTtlCount
5002 * @property {Array.<number>|null} [privateCacheTtlCount] QueryLatencyStats privateCacheTtlCount
5003 * @property {number|null} [registeredOperationCount] QueryLatencyStats registeredOperationCount
5004 * @property {number|null} [forbiddenOperationCount] QueryLatencyStats forbiddenOperationCount
5005 */
5006
5007 /**
5008 * Constructs a new QueryLatencyStats.
5009 * @exports QueryLatencyStats
5010 * @classdesc Represents a QueryLatencyStats.
5011 * @implements IQueryLatencyStats
5012 * @constructor
5013 * @param {IQueryLatencyStats=} [properties] Properties to set
5014 */
5015 function QueryLatencyStats(properties) {
5016 this.latencyCount = [];
5017 this.cacheLatencyCount = [];
5018 this.publicCacheTtlCount = [];
5019 this.privateCacheTtlCount = [];
5020 if (properties)
5021 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
5022 if (properties[keys[i]] != null)
5023 this[keys[i]] = properties[keys[i]];
5024 }
5025
5026 /**
5027 * QueryLatencyStats latencyCount.
5028 * @member {Array.<number>} latencyCount
5029 * @memberof QueryLatencyStats
5030 * @instance
5031 */
5032 QueryLatencyStats.prototype.latencyCount = $util.emptyArray;
5033
5034 /**
5035 * QueryLatencyStats requestCount.
5036 * @member {number} requestCount
5037 * @memberof QueryLatencyStats
5038 * @instance
5039 */
5040 QueryLatencyStats.prototype.requestCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
5041
5042 /**
5043 * QueryLatencyStats cacheHits.
5044 * @member {number} cacheHits
5045 * @memberof QueryLatencyStats
5046 * @instance
5047 */
5048 QueryLatencyStats.prototype.cacheHits = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
5049
5050 /**
5051 * QueryLatencyStats persistedQueryHits.
5052 * @member {number} persistedQueryHits
5053 * @memberof QueryLatencyStats
5054 * @instance
5055 */
5056 QueryLatencyStats.prototype.persistedQueryHits = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
5057
5058 /**
5059 * QueryLatencyStats persistedQueryMisses.
5060 * @member {number} persistedQueryMisses
5061 * @memberof QueryLatencyStats
5062 * @instance
5063 */
5064 QueryLatencyStats.prototype.persistedQueryMisses = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
5065
5066 /**
5067 * QueryLatencyStats cacheLatencyCount.
5068 * @member {Array.<number>} cacheLatencyCount
5069 * @memberof QueryLatencyStats
5070 * @instance
5071 */
5072 QueryLatencyStats.prototype.cacheLatencyCount = $util.emptyArray;
5073
5074 /**
5075 * QueryLatencyStats rootErrorStats.
5076 * @member {IPathErrorStats|null|undefined} rootErrorStats
5077 * @memberof QueryLatencyStats
5078 * @instance
5079 */
5080 QueryLatencyStats.prototype.rootErrorStats = null;
5081
5082 /**
5083 * QueryLatencyStats requestsWithErrorsCount.
5084 * @member {number} requestsWithErrorsCount
5085 * @memberof QueryLatencyStats
5086 * @instance
5087 */
5088 QueryLatencyStats.prototype.requestsWithErrorsCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
5089
5090 /**
5091 * QueryLatencyStats publicCacheTtlCount.
5092 * @member {Array.<number>} publicCacheTtlCount
5093 * @memberof QueryLatencyStats
5094 * @instance
5095 */
5096 QueryLatencyStats.prototype.publicCacheTtlCount = $util.emptyArray;
5097
5098 /**
5099 * QueryLatencyStats privateCacheTtlCount.
5100 * @member {Array.<number>} privateCacheTtlCount
5101 * @memberof QueryLatencyStats
5102 * @instance
5103 */
5104 QueryLatencyStats.prototype.privateCacheTtlCount = $util.emptyArray;
5105
5106 /**
5107 * QueryLatencyStats registeredOperationCount.
5108 * @member {number} registeredOperationCount
5109 * @memberof QueryLatencyStats
5110 * @instance
5111 */
5112 QueryLatencyStats.prototype.registeredOperationCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
5113
5114 /**
5115 * QueryLatencyStats forbiddenOperationCount.
5116 * @member {number} forbiddenOperationCount
5117 * @memberof QueryLatencyStats
5118 * @instance
5119 */
5120 QueryLatencyStats.prototype.forbiddenOperationCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
5121
5122 /**
5123 * Creates a new QueryLatencyStats instance using the specified properties.
5124 * @function create
5125 * @memberof QueryLatencyStats
5126 * @static
5127 * @param {IQueryLatencyStats=} [properties] Properties to set
5128 * @returns {QueryLatencyStats} QueryLatencyStats instance
5129 */
5130 QueryLatencyStats.create = function create(properties) {
5131 return new QueryLatencyStats(properties);
5132 };
5133
5134 /**
5135 * Encodes the specified QueryLatencyStats message. Does not implicitly {@link QueryLatencyStats.verify|verify} messages.
5136 * @function encode
5137 * @memberof QueryLatencyStats
5138 * @static
5139 * @param {IQueryLatencyStats} message QueryLatencyStats message or plain object to encode
5140 * @param {$protobuf.Writer} [writer] Writer to encode to
5141 * @returns {$protobuf.Writer} Writer
5142 */
5143 QueryLatencyStats.encode = function encode(message, writer) {
5144 if (!writer)
5145 writer = $Writer.create();
5146 if (message.latencyCount != null && message.latencyCount.length) {
5147 writer.uint32(/* id 1, wireType 2 =*/10).fork();
5148 for (var i = 0; i < message.latencyCount.length; ++i)
5149 writer.int64(message.latencyCount[i]);
5150 writer.ldelim();
5151 }
5152 if (message.requestCount != null && Object.hasOwnProperty.call(message, "requestCount"))
5153 writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.requestCount);
5154 if (message.cacheHits != null && Object.hasOwnProperty.call(message, "cacheHits"))
5155 writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.cacheHits);
5156 if (message.persistedQueryHits != null && Object.hasOwnProperty.call(message, "persistedQueryHits"))
5157 writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.persistedQueryHits);
5158 if (message.persistedQueryMisses != null && Object.hasOwnProperty.call(message, "persistedQueryMisses"))
5159 writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.persistedQueryMisses);
5160 if (message.cacheLatencyCount != null && message.cacheLatencyCount.length) {
5161 writer.uint32(/* id 6, wireType 2 =*/50).fork();
5162 for (var i = 0; i < message.cacheLatencyCount.length; ++i)
5163 writer.int64(message.cacheLatencyCount[i]);
5164 writer.ldelim();
5165 }
5166 if (message.rootErrorStats != null && Object.hasOwnProperty.call(message, "rootErrorStats"))
5167 $root.PathErrorStats.encode(message.rootErrorStats, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
5168 if (message.requestsWithErrorsCount != null && Object.hasOwnProperty.call(message, "requestsWithErrorsCount"))
5169 writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.requestsWithErrorsCount);
5170 if (message.publicCacheTtlCount != null && message.publicCacheTtlCount.length) {
5171 writer.uint32(/* id 9, wireType 2 =*/74).fork();
5172 for (var i = 0; i < message.publicCacheTtlCount.length; ++i)
5173 writer.int64(message.publicCacheTtlCount[i]);
5174 writer.ldelim();
5175 }
5176 if (message.privateCacheTtlCount != null && message.privateCacheTtlCount.length) {
5177 writer.uint32(/* id 10, wireType 2 =*/82).fork();
5178 for (var i = 0; i < message.privateCacheTtlCount.length; ++i)
5179 writer.int64(message.privateCacheTtlCount[i]);
5180 writer.ldelim();
5181 }
5182 if (message.registeredOperationCount != null && Object.hasOwnProperty.call(message, "registeredOperationCount"))
5183 writer.uint32(/* id 11, wireType 0 =*/88).uint64(message.registeredOperationCount);
5184 if (message.forbiddenOperationCount != null && Object.hasOwnProperty.call(message, "forbiddenOperationCount"))
5185 writer.uint32(/* id 12, wireType 0 =*/96).uint64(message.forbiddenOperationCount);
5186 return writer;
5187 };
5188
5189 /**
5190 * Encodes the specified QueryLatencyStats message, length delimited. Does not implicitly {@link QueryLatencyStats.verify|verify} messages.
5191 * @function encodeDelimited
5192 * @memberof QueryLatencyStats
5193 * @static
5194 * @param {IQueryLatencyStats} message QueryLatencyStats message or plain object to encode
5195 * @param {$protobuf.Writer} [writer] Writer to encode to
5196 * @returns {$protobuf.Writer} Writer
5197 */
5198 QueryLatencyStats.encodeDelimited = function encodeDelimited(message, writer) {
5199 return this.encode(message, writer).ldelim();
5200 };
5201
5202 /**
5203 * Decodes a QueryLatencyStats message from the specified reader or buffer.
5204 * @function decode
5205 * @memberof QueryLatencyStats
5206 * @static
5207 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
5208 * @param {number} [length] Message length if known beforehand
5209 * @returns {QueryLatencyStats} QueryLatencyStats
5210 * @throws {Error} If the payload is not a reader or valid buffer
5211 * @throws {$protobuf.util.ProtocolError} If required fields are missing
5212 */
5213 QueryLatencyStats.decode = function decode(reader, length) {
5214 if (!(reader instanceof $Reader))
5215 reader = $Reader.create(reader);
5216 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.QueryLatencyStats();
5217 while (reader.pos < end) {
5218 var tag = reader.uint32();
5219 switch (tag >>> 3) {
5220 case 1:
5221 if (!(message.latencyCount && message.latencyCount.length))
5222 message.latencyCount = [];
5223 if ((tag & 7) === 2) {
5224 var end2 = reader.uint32() + reader.pos;
5225 while (reader.pos < end2)
5226 message.latencyCount.push(reader.int64());
5227 } else
5228 message.latencyCount.push(reader.int64());
5229 break;
5230 case 2:
5231 message.requestCount = reader.uint64();
5232 break;
5233 case 3:
5234 message.cacheHits = reader.uint64();
5235 break;
5236 case 4:
5237 message.persistedQueryHits = reader.uint64();
5238 break;
5239 case 5:
5240 message.persistedQueryMisses = reader.uint64();
5241 break;
5242 case 6:
5243 if (!(message.cacheLatencyCount && message.cacheLatencyCount.length))
5244 message.cacheLatencyCount = [];
5245 if ((tag & 7) === 2) {
5246 var end2 = reader.uint32() + reader.pos;
5247 while (reader.pos < end2)
5248 message.cacheLatencyCount.push(reader.int64());
5249 } else
5250 message.cacheLatencyCount.push(reader.int64());
5251 break;
5252 case 7:
5253 message.rootErrorStats = $root.PathErrorStats.decode(reader, reader.uint32());
5254 break;
5255 case 8:
5256 message.requestsWithErrorsCount = reader.uint64();
5257 break;
5258 case 9:
5259 if (!(message.publicCacheTtlCount && message.publicCacheTtlCount.length))
5260 message.publicCacheTtlCount = [];
5261 if ((tag & 7) === 2) {
5262 var end2 = reader.uint32() + reader.pos;
5263 while (reader.pos < end2)
5264 message.publicCacheTtlCount.push(reader.int64());
5265 } else
5266 message.publicCacheTtlCount.push(reader.int64());
5267 break;
5268 case 10:
5269 if (!(message.privateCacheTtlCount && message.privateCacheTtlCount.length))
5270 message.privateCacheTtlCount = [];
5271 if ((tag & 7) === 2) {
5272 var end2 = reader.uint32() + reader.pos;
5273 while (reader.pos < end2)
5274 message.privateCacheTtlCount.push(reader.int64());
5275 } else
5276 message.privateCacheTtlCount.push(reader.int64());
5277 break;
5278 case 11:
5279 message.registeredOperationCount = reader.uint64();
5280 break;
5281 case 12:
5282 message.forbiddenOperationCount = reader.uint64();
5283 break;
5284 default:
5285 reader.skipType(tag & 7);
5286 break;
5287 }
5288 }
5289 return message;
5290 };
5291
5292 /**
5293 * Decodes a QueryLatencyStats message from the specified reader or buffer, length delimited.
5294 * @function decodeDelimited
5295 * @memberof QueryLatencyStats
5296 * @static
5297 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
5298 * @returns {QueryLatencyStats} QueryLatencyStats
5299 * @throws {Error} If the payload is not a reader or valid buffer
5300 * @throws {$protobuf.util.ProtocolError} If required fields are missing
5301 */
5302 QueryLatencyStats.decodeDelimited = function decodeDelimited(reader) {
5303 if (!(reader instanceof $Reader))
5304 reader = new $Reader(reader);
5305 return this.decode(reader, reader.uint32());
5306 };
5307
5308 /**
5309 * Verifies a QueryLatencyStats message.
5310 * @function verify
5311 * @memberof QueryLatencyStats
5312 * @static
5313 * @param {Object.<string,*>} message Plain object to verify
5314 * @returns {string|null} `null` if valid, otherwise the reason why it is not
5315 */
5316 QueryLatencyStats.verify = function verify(message) {
5317 if (typeof message !== "object" || message === null)
5318 return "object expected";
5319 if (message.latencyCount != null && message.hasOwnProperty("latencyCount")) {
5320 if (!Array.isArray(message.latencyCount))
5321 return "latencyCount: array expected";
5322 for (var i = 0; i < message.latencyCount.length; ++i)
5323 if (!$util.isInteger(message.latencyCount[i]) && !(message.latencyCount[i] && $util.isInteger(message.latencyCount[i].low) && $util.isInteger(message.latencyCount[i].high)))
5324 return "latencyCount: integer|Long[] expected";
5325 }
5326 if (message.requestCount != null && message.hasOwnProperty("requestCount"))
5327 if (!$util.isInteger(message.requestCount) && !(message.requestCount && $util.isInteger(message.requestCount.low) && $util.isInteger(message.requestCount.high)))
5328 return "requestCount: integer|Long expected";
5329 if (message.cacheHits != null && message.hasOwnProperty("cacheHits"))
5330 if (!$util.isInteger(message.cacheHits) && !(message.cacheHits && $util.isInteger(message.cacheHits.low) && $util.isInteger(message.cacheHits.high)))
5331 return "cacheHits: integer|Long expected";
5332 if (message.persistedQueryHits != null && message.hasOwnProperty("persistedQueryHits"))
5333 if (!$util.isInteger(message.persistedQueryHits) && !(message.persistedQueryHits && $util.isInteger(message.persistedQueryHits.low) && $util.isInteger(message.persistedQueryHits.high)))
5334 return "persistedQueryHits: integer|Long expected";
5335 if (message.persistedQueryMisses != null && message.hasOwnProperty("persistedQueryMisses"))
5336 if (!$util.isInteger(message.persistedQueryMisses) && !(message.persistedQueryMisses && $util.isInteger(message.persistedQueryMisses.low) && $util.isInteger(message.persistedQueryMisses.high)))
5337 return "persistedQueryMisses: integer|Long expected";
5338 if (message.cacheLatencyCount != null && message.hasOwnProperty("cacheLatencyCount")) {
5339 if (!Array.isArray(message.cacheLatencyCount))
5340 return "cacheLatencyCount: array expected";
5341 for (var i = 0; i < message.cacheLatencyCount.length; ++i)
5342 if (!$util.isInteger(message.cacheLatencyCount[i]) && !(message.cacheLatencyCount[i] && $util.isInteger(message.cacheLatencyCount[i].low) && $util.isInteger(message.cacheLatencyCount[i].high)))
5343 return "cacheLatencyCount: integer|Long[] expected";
5344 }
5345 if (message.rootErrorStats != null && message.hasOwnProperty("rootErrorStats")) {
5346 var error = $root.PathErrorStats.verify(message.rootErrorStats);
5347 if (error)
5348 return "rootErrorStats." + error;
5349 }
5350 if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount"))
5351 if (!$util.isInteger(message.requestsWithErrorsCount) && !(message.requestsWithErrorsCount && $util.isInteger(message.requestsWithErrorsCount.low) && $util.isInteger(message.requestsWithErrorsCount.high)))
5352 return "requestsWithErrorsCount: integer|Long expected";
5353 if (message.publicCacheTtlCount != null && message.hasOwnProperty("publicCacheTtlCount")) {
5354 if (!Array.isArray(message.publicCacheTtlCount))
5355 return "publicCacheTtlCount: array expected";
5356 for (var i = 0; i < message.publicCacheTtlCount.length; ++i)
5357 if (!$util.isInteger(message.publicCacheTtlCount[i]) && !(message.publicCacheTtlCount[i] && $util.isInteger(message.publicCacheTtlCount[i].low) && $util.isInteger(message.publicCacheTtlCount[i].high)))
5358 return "publicCacheTtlCount: integer|Long[] expected";
5359 }
5360 if (message.privateCacheTtlCount != null && message.hasOwnProperty("privateCacheTtlCount")) {
5361 if (!Array.isArray(message.privateCacheTtlCount))
5362 return "privateCacheTtlCount: array expected";
5363 for (var i = 0; i < message.privateCacheTtlCount.length; ++i)
5364 if (!$util.isInteger(message.privateCacheTtlCount[i]) && !(message.privateCacheTtlCount[i] && $util.isInteger(message.privateCacheTtlCount[i].low) && $util.isInteger(message.privateCacheTtlCount[i].high)))
5365 return "privateCacheTtlCount: integer|Long[] expected";
5366 }
5367 if (message.registeredOperationCount != null && message.hasOwnProperty("registeredOperationCount"))
5368 if (!$util.isInteger(message.registeredOperationCount) && !(message.registeredOperationCount && $util.isInteger(message.registeredOperationCount.low) && $util.isInteger(message.registeredOperationCount.high)))
5369 return "registeredOperationCount: integer|Long expected";
5370 if (message.forbiddenOperationCount != null && message.hasOwnProperty("forbiddenOperationCount"))
5371 if (!$util.isInteger(message.forbiddenOperationCount) && !(message.forbiddenOperationCount && $util.isInteger(message.forbiddenOperationCount.low) && $util.isInteger(message.forbiddenOperationCount.high)))
5372 return "forbiddenOperationCount: integer|Long expected";
5373 return null;
5374 };
5375
5376 /**
5377 * Creates a QueryLatencyStats message from a plain object. Also converts values to their respective internal types.
5378 * @function fromObject
5379 * @memberof QueryLatencyStats
5380 * @static
5381 * @param {Object.<string,*>} object Plain object
5382 * @returns {QueryLatencyStats} QueryLatencyStats
5383 */
5384 QueryLatencyStats.fromObject = function fromObject(object) {
5385 if (object instanceof $root.QueryLatencyStats)
5386 return object;
5387 var message = new $root.QueryLatencyStats();
5388 if (object.latencyCount) {
5389 if (!Array.isArray(object.latencyCount))
5390 throw TypeError(".QueryLatencyStats.latencyCount: array expected");
5391 message.latencyCount = [];
5392 for (var i = 0; i < object.latencyCount.length; ++i)
5393 if ($util.Long)
5394 (message.latencyCount[i] = $util.Long.fromValue(object.latencyCount[i])).unsigned = false;
5395 else if (typeof object.latencyCount[i] === "string")
5396 message.latencyCount[i] = parseInt(object.latencyCount[i], 10);
5397 else if (typeof object.latencyCount[i] === "number")
5398 message.latencyCount[i] = object.latencyCount[i];
5399 else if (typeof object.latencyCount[i] === "object")
5400 message.latencyCount[i] = new $util.LongBits(object.latencyCount[i].low >>> 0, object.latencyCount[i].high >>> 0).toNumber();
5401 }
5402 if (object.requestCount != null)
5403 if ($util.Long)
5404 (message.requestCount = $util.Long.fromValue(object.requestCount)).unsigned = true;
5405 else if (typeof object.requestCount === "string")
5406 message.requestCount = parseInt(object.requestCount, 10);
5407 else if (typeof object.requestCount === "number")
5408 message.requestCount = object.requestCount;
5409 else if (typeof object.requestCount === "object")
5410 message.requestCount = new $util.LongBits(object.requestCount.low >>> 0, object.requestCount.high >>> 0).toNumber(true);
5411 if (object.cacheHits != null)
5412 if ($util.Long)
5413 (message.cacheHits = $util.Long.fromValue(object.cacheHits)).unsigned = true;
5414 else if (typeof object.cacheHits === "string")
5415 message.cacheHits = parseInt(object.cacheHits, 10);
5416 else if (typeof object.cacheHits === "number")
5417 message.cacheHits = object.cacheHits;
5418 else if (typeof object.cacheHits === "object")
5419 message.cacheHits = new $util.LongBits(object.cacheHits.low >>> 0, object.cacheHits.high >>> 0).toNumber(true);
5420 if (object.persistedQueryHits != null)
5421 if ($util.Long)
5422 (message.persistedQueryHits = $util.Long.fromValue(object.persistedQueryHits)).unsigned = true;
5423 else if (typeof object.persistedQueryHits === "string")
5424 message.persistedQueryHits = parseInt(object.persistedQueryHits, 10);
5425 else if (typeof object.persistedQueryHits === "number")
5426 message.persistedQueryHits = object.persistedQueryHits;
5427 else if (typeof object.persistedQueryHits === "object")
5428 message.persistedQueryHits = new $util.LongBits(object.persistedQueryHits.low >>> 0, object.persistedQueryHits.high >>> 0).toNumber(true);
5429 if (object.persistedQueryMisses != null)
5430 if ($util.Long)
5431 (message.persistedQueryMisses = $util.Long.fromValue(object.persistedQueryMisses)).unsigned = true;
5432 else if (typeof object.persistedQueryMisses === "string")
5433 message.persistedQueryMisses = parseInt(object.persistedQueryMisses, 10);
5434 else if (typeof object.persistedQueryMisses === "number")
5435 message.persistedQueryMisses = object.persistedQueryMisses;
5436 else if (typeof object.persistedQueryMisses === "object")
5437 message.persistedQueryMisses = new $util.LongBits(object.persistedQueryMisses.low >>> 0, object.persistedQueryMisses.high >>> 0).toNumber(true);
5438 if (object.cacheLatencyCount) {
5439 if (!Array.isArray(object.cacheLatencyCount))
5440 throw TypeError(".QueryLatencyStats.cacheLatencyCount: array expected");
5441 message.cacheLatencyCount = [];
5442 for (var i = 0; i < object.cacheLatencyCount.length; ++i)
5443 if ($util.Long)
5444 (message.cacheLatencyCount[i] = $util.Long.fromValue(object.cacheLatencyCount[i])).unsigned = false;
5445 else if (typeof object.cacheLatencyCount[i] === "string")
5446 message.cacheLatencyCount[i] = parseInt(object.cacheLatencyCount[i], 10);
5447 else if (typeof object.cacheLatencyCount[i] === "number")
5448 message.cacheLatencyCount[i] = object.cacheLatencyCount[i];
5449 else if (typeof object.cacheLatencyCount[i] === "object")
5450 message.cacheLatencyCount[i] = new $util.LongBits(object.cacheLatencyCount[i].low >>> 0, object.cacheLatencyCount[i].high >>> 0).toNumber();
5451 }
5452 if (object.rootErrorStats != null) {
5453 if (typeof object.rootErrorStats !== "object")
5454 throw TypeError(".QueryLatencyStats.rootErrorStats: object expected");
5455 message.rootErrorStats = $root.PathErrorStats.fromObject(object.rootErrorStats);
5456 }
5457 if (object.requestsWithErrorsCount != null)
5458 if ($util.Long)
5459 (message.requestsWithErrorsCount = $util.Long.fromValue(object.requestsWithErrorsCount)).unsigned = true;
5460 else if (typeof object.requestsWithErrorsCount === "string")
5461 message.requestsWithErrorsCount = parseInt(object.requestsWithErrorsCount, 10);
5462 else if (typeof object.requestsWithErrorsCount === "number")
5463 message.requestsWithErrorsCount = object.requestsWithErrorsCount;
5464 else if (typeof object.requestsWithErrorsCount === "object")
5465 message.requestsWithErrorsCount = new $util.LongBits(object.requestsWithErrorsCount.low >>> 0, object.requestsWithErrorsCount.high >>> 0).toNumber(true);
5466 if (object.publicCacheTtlCount) {
5467 if (!Array.isArray(object.publicCacheTtlCount))
5468 throw TypeError(".QueryLatencyStats.publicCacheTtlCount: array expected");
5469 message.publicCacheTtlCount = [];
5470 for (var i = 0; i < object.publicCacheTtlCount.length; ++i)
5471 if ($util.Long)
5472 (message.publicCacheTtlCount[i] = $util.Long.fromValue(object.publicCacheTtlCount[i])).unsigned = false;
5473 else if (typeof object.publicCacheTtlCount[i] === "string")
5474 message.publicCacheTtlCount[i] = parseInt(object.publicCacheTtlCount[i], 10);
5475 else if (typeof object.publicCacheTtlCount[i] === "number")
5476 message.publicCacheTtlCount[i] = object.publicCacheTtlCount[i];
5477 else if (typeof object.publicCacheTtlCount[i] === "object")
5478 message.publicCacheTtlCount[i] = new $util.LongBits(object.publicCacheTtlCount[i].low >>> 0, object.publicCacheTtlCount[i].high >>> 0).toNumber();
5479 }
5480 if (object.privateCacheTtlCount) {
5481 if (!Array.isArray(object.privateCacheTtlCount))
5482 throw TypeError(".QueryLatencyStats.privateCacheTtlCount: array expected");
5483 message.privateCacheTtlCount = [];
5484 for (var i = 0; i < object.privateCacheTtlCount.length; ++i)
5485 if ($util.Long)
5486 (message.privateCacheTtlCount[i] = $util.Long.fromValue(object.privateCacheTtlCount[i])).unsigned = false;
5487 else if (typeof object.privateCacheTtlCount[i] === "string")
5488 message.privateCacheTtlCount[i] = parseInt(object.privateCacheTtlCount[i], 10);
5489 else if (typeof object.privateCacheTtlCount[i] === "number")
5490 message.privateCacheTtlCount[i] = object.privateCacheTtlCount[i];
5491 else if (typeof object.privateCacheTtlCount[i] === "object")
5492 message.privateCacheTtlCount[i] = new $util.LongBits(object.privateCacheTtlCount[i].low >>> 0, object.privateCacheTtlCount[i].high >>> 0).toNumber();
5493 }
5494 if (object.registeredOperationCount != null)
5495 if ($util.Long)
5496 (message.registeredOperationCount = $util.Long.fromValue(object.registeredOperationCount)).unsigned = true;
5497 else if (typeof object.registeredOperationCount === "string")
5498 message.registeredOperationCount = parseInt(object.registeredOperationCount, 10);
5499 else if (typeof object.registeredOperationCount === "number")
5500 message.registeredOperationCount = object.registeredOperationCount;
5501 else if (typeof object.registeredOperationCount === "object")
5502 message.registeredOperationCount = new $util.LongBits(object.registeredOperationCount.low >>> 0, object.registeredOperationCount.high >>> 0).toNumber(true);
5503 if (object.forbiddenOperationCount != null)
5504 if ($util.Long)
5505 (message.forbiddenOperationCount = $util.Long.fromValue(object.forbiddenOperationCount)).unsigned = true;
5506 else if (typeof object.forbiddenOperationCount === "string")
5507 message.forbiddenOperationCount = parseInt(object.forbiddenOperationCount, 10);
5508 else if (typeof object.forbiddenOperationCount === "number")
5509 message.forbiddenOperationCount = object.forbiddenOperationCount;
5510 else if (typeof object.forbiddenOperationCount === "object")
5511 message.forbiddenOperationCount = new $util.LongBits(object.forbiddenOperationCount.low >>> 0, object.forbiddenOperationCount.high >>> 0).toNumber(true);
5512 return message;
5513 };
5514
5515 /**
5516 * Creates a plain object from a QueryLatencyStats message. Also converts values to other types if specified.
5517 * @function toObject
5518 * @memberof QueryLatencyStats
5519 * @static
5520 * @param {QueryLatencyStats} message QueryLatencyStats
5521 * @param {$protobuf.IConversionOptions} [options] Conversion options
5522 * @returns {Object.<string,*>} Plain object
5523 */
5524 QueryLatencyStats.toObject = function toObject(message, options) {
5525 if (!options)
5526 options = {};
5527 var object = {};
5528 if (options.arrays || options.defaults) {
5529 object.latencyCount = [];
5530 object.cacheLatencyCount = [];
5531 object.publicCacheTtlCount = [];
5532 object.privateCacheTtlCount = [];
5533 }
5534 if (options.defaults) {
5535 if ($util.Long) {
5536 var long = new $util.Long(0, 0, true);
5537 object.requestCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
5538 } else
5539 object.requestCount = options.longs === String ? "0" : 0;
5540 if ($util.Long) {
5541 var long = new $util.Long(0, 0, true);
5542 object.cacheHits = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
5543 } else
5544 object.cacheHits = options.longs === String ? "0" : 0;
5545 if ($util.Long) {
5546 var long = new $util.Long(0, 0, true);
5547 object.persistedQueryHits = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
5548 } else
5549 object.persistedQueryHits = options.longs === String ? "0" : 0;
5550 if ($util.Long) {
5551 var long = new $util.Long(0, 0, true);
5552 object.persistedQueryMisses = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
5553 } else
5554 object.persistedQueryMisses = options.longs === String ? "0" : 0;
5555 object.rootErrorStats = null;
5556 if ($util.Long) {
5557 var long = new $util.Long(0, 0, true);
5558 object.requestsWithErrorsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
5559 } else
5560 object.requestsWithErrorsCount = options.longs === String ? "0" : 0;
5561 if ($util.Long) {
5562 var long = new $util.Long(0, 0, true);
5563 object.registeredOperationCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
5564 } else
5565 object.registeredOperationCount = options.longs === String ? "0" : 0;
5566 if ($util.Long) {
5567 var long = new $util.Long(0, 0, true);
5568 object.forbiddenOperationCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
5569 } else
5570 object.forbiddenOperationCount = options.longs === String ? "0" : 0;
5571 }
5572 if (message.latencyCount && message.latencyCount.length) {
5573 object.latencyCount = [];
5574 for (var j = 0; j < message.latencyCount.length; ++j)
5575 if (typeof message.latencyCount[j] === "number")
5576 object.latencyCount[j] = options.longs === String ? String(message.latencyCount[j]) : message.latencyCount[j];
5577 else
5578 object.latencyCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.latencyCount[j]) : options.longs === Number ? new $util.LongBits(message.latencyCount[j].low >>> 0, message.latencyCount[j].high >>> 0).toNumber() : message.latencyCount[j];
5579 }
5580 if (message.requestCount != null && message.hasOwnProperty("requestCount"))
5581 if (typeof message.requestCount === "number")
5582 object.requestCount = options.longs === String ? String(message.requestCount) : message.requestCount;
5583 else
5584 object.requestCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestCount) : options.longs === Number ? new $util.LongBits(message.requestCount.low >>> 0, message.requestCount.high >>> 0).toNumber(true) : message.requestCount;
5585 if (message.cacheHits != null && message.hasOwnProperty("cacheHits"))
5586 if (typeof message.cacheHits === "number")
5587 object.cacheHits = options.longs === String ? String(message.cacheHits) : message.cacheHits;
5588 else
5589 object.cacheHits = options.longs === String ? $util.Long.prototype.toString.call(message.cacheHits) : options.longs === Number ? new $util.LongBits(message.cacheHits.low >>> 0, message.cacheHits.high >>> 0).toNumber(true) : message.cacheHits;
5590 if (message.persistedQueryHits != null && message.hasOwnProperty("persistedQueryHits"))
5591 if (typeof message.persistedQueryHits === "number")
5592 object.persistedQueryHits = options.longs === String ? String(message.persistedQueryHits) : message.persistedQueryHits;
5593 else
5594 object.persistedQueryHits = options.longs === String ? $util.Long.prototype.toString.call(message.persistedQueryHits) : options.longs === Number ? new $util.LongBits(message.persistedQueryHits.low >>> 0, message.persistedQueryHits.high >>> 0).toNumber(true) : message.persistedQueryHits;
5595 if (message.persistedQueryMisses != null && message.hasOwnProperty("persistedQueryMisses"))
5596 if (typeof message.persistedQueryMisses === "number")
5597 object.persistedQueryMisses = options.longs === String ? String(message.persistedQueryMisses) : message.persistedQueryMisses;
5598 else
5599 object.persistedQueryMisses = options.longs === String ? $util.Long.prototype.toString.call(message.persistedQueryMisses) : options.longs === Number ? new $util.LongBits(message.persistedQueryMisses.low >>> 0, message.persistedQueryMisses.high >>> 0).toNumber(true) : message.persistedQueryMisses;
5600 if (message.cacheLatencyCount && message.cacheLatencyCount.length) {
5601 object.cacheLatencyCount = [];
5602 for (var j = 0; j < message.cacheLatencyCount.length; ++j)
5603 if (typeof message.cacheLatencyCount[j] === "number")
5604 object.cacheLatencyCount[j] = options.longs === String ? String(message.cacheLatencyCount[j]) : message.cacheLatencyCount[j];
5605 else
5606 object.cacheLatencyCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.cacheLatencyCount[j]) : options.longs === Number ? new $util.LongBits(message.cacheLatencyCount[j].low >>> 0, message.cacheLatencyCount[j].high >>> 0).toNumber() : message.cacheLatencyCount[j];
5607 }
5608 if (message.rootErrorStats != null && message.hasOwnProperty("rootErrorStats"))
5609 object.rootErrorStats = $root.PathErrorStats.toObject(message.rootErrorStats, options);
5610 if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount"))
5611 if (typeof message.requestsWithErrorsCount === "number")
5612 object.requestsWithErrorsCount = options.longs === String ? String(message.requestsWithErrorsCount) : message.requestsWithErrorsCount;
5613 else
5614 object.requestsWithErrorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestsWithErrorsCount) : options.longs === Number ? new $util.LongBits(message.requestsWithErrorsCount.low >>> 0, message.requestsWithErrorsCount.high >>> 0).toNumber(true) : message.requestsWithErrorsCount;
5615 if (message.publicCacheTtlCount && message.publicCacheTtlCount.length) {
5616 object.publicCacheTtlCount = [];
5617 for (var j = 0; j < message.publicCacheTtlCount.length; ++j)
5618 if (typeof message.publicCacheTtlCount[j] === "number")
5619 object.publicCacheTtlCount[j] = options.longs === String ? String(message.publicCacheTtlCount[j]) : message.publicCacheTtlCount[j];
5620 else
5621 object.publicCacheTtlCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.publicCacheTtlCount[j]) : options.longs === Number ? new $util.LongBits(message.publicCacheTtlCount[j].low >>> 0, message.publicCacheTtlCount[j].high >>> 0).toNumber() : message.publicCacheTtlCount[j];
5622 }
5623 if (message.privateCacheTtlCount && message.privateCacheTtlCount.length) {
5624 object.privateCacheTtlCount = [];
5625 for (var j = 0; j < message.privateCacheTtlCount.length; ++j)
5626 if (typeof message.privateCacheTtlCount[j] === "number")
5627 object.privateCacheTtlCount[j] = options.longs === String ? String(message.privateCacheTtlCount[j]) : message.privateCacheTtlCount[j];
5628 else
5629 object.privateCacheTtlCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.privateCacheTtlCount[j]) : options.longs === Number ? new $util.LongBits(message.privateCacheTtlCount[j].low >>> 0, message.privateCacheTtlCount[j].high >>> 0).toNumber() : message.privateCacheTtlCount[j];
5630 }
5631 if (message.registeredOperationCount != null && message.hasOwnProperty("registeredOperationCount"))
5632 if (typeof message.registeredOperationCount === "number")
5633 object.registeredOperationCount = options.longs === String ? String(message.registeredOperationCount) : message.registeredOperationCount;
5634 else
5635 object.registeredOperationCount = options.longs === String ? $util.Long.prototype.toString.call(message.registeredOperationCount) : options.longs === Number ? new $util.LongBits(message.registeredOperationCount.low >>> 0, message.registeredOperationCount.high >>> 0).toNumber(true) : message.registeredOperationCount;
5636 if (message.forbiddenOperationCount != null && message.hasOwnProperty("forbiddenOperationCount"))
5637 if (typeof message.forbiddenOperationCount === "number")
5638 object.forbiddenOperationCount = options.longs === String ? String(message.forbiddenOperationCount) : message.forbiddenOperationCount;
5639 else
5640 object.forbiddenOperationCount = options.longs === String ? $util.Long.prototype.toString.call(message.forbiddenOperationCount) : options.longs === Number ? new $util.LongBits(message.forbiddenOperationCount.low >>> 0, message.forbiddenOperationCount.high >>> 0).toNumber(true) : message.forbiddenOperationCount;
5641 return object;
5642 };
5643
5644 /**
5645 * Converts this QueryLatencyStats to JSON.
5646 * @function toJSON
5647 * @memberof QueryLatencyStats
5648 * @instance
5649 * @returns {Object.<string,*>} JSON object
5650 */
5651 QueryLatencyStats.prototype.toJSON = function toJSON() {
5652 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
5653 };
5654
5655 return QueryLatencyStats;
5656})();
5657
5658$root.StatsContext = (function() {
5659
5660 /**
5661 * Properties of a StatsContext.
5662 * @exports IStatsContext
5663 * @interface IStatsContext
5664 * @property {string|null} [clientReferenceId] StatsContext clientReferenceId
5665 * @property {string|null} [clientName] StatsContext clientName
5666 * @property {string|null} [clientVersion] StatsContext clientVersion
5667 */
5668
5669 /**
5670 * Constructs a new StatsContext.
5671 * @exports StatsContext
5672 * @classdesc Represents a StatsContext.
5673 * @implements IStatsContext
5674 * @constructor
5675 * @param {IStatsContext=} [properties] Properties to set
5676 */
5677 function StatsContext(properties) {
5678 if (properties)
5679 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
5680 if (properties[keys[i]] != null)
5681 this[keys[i]] = properties[keys[i]];
5682 }
5683
5684 /**
5685 * StatsContext clientReferenceId.
5686 * @member {string} clientReferenceId
5687 * @memberof StatsContext
5688 * @instance
5689 */
5690 StatsContext.prototype.clientReferenceId = "";
5691
5692 /**
5693 * StatsContext clientName.
5694 * @member {string} clientName
5695 * @memberof StatsContext
5696 * @instance
5697 */
5698 StatsContext.prototype.clientName = "";
5699
5700 /**
5701 * StatsContext clientVersion.
5702 * @member {string} clientVersion
5703 * @memberof StatsContext
5704 * @instance
5705 */
5706 StatsContext.prototype.clientVersion = "";
5707
5708 /**
5709 * Creates a new StatsContext instance using the specified properties.
5710 * @function create
5711 * @memberof StatsContext
5712 * @static
5713 * @param {IStatsContext=} [properties] Properties to set
5714 * @returns {StatsContext} StatsContext instance
5715 */
5716 StatsContext.create = function create(properties) {
5717 return new StatsContext(properties);
5718 };
5719
5720 /**
5721 * Encodes the specified StatsContext message. Does not implicitly {@link StatsContext.verify|verify} messages.
5722 * @function encode
5723 * @memberof StatsContext
5724 * @static
5725 * @param {IStatsContext} message StatsContext message or plain object to encode
5726 * @param {$protobuf.Writer} [writer] Writer to encode to
5727 * @returns {$protobuf.Writer} Writer
5728 */
5729 StatsContext.encode = function encode(message, writer) {
5730 if (!writer)
5731 writer = $Writer.create();
5732 if (message.clientReferenceId != null && Object.hasOwnProperty.call(message, "clientReferenceId"))
5733 writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientReferenceId);
5734 if (message.clientName != null && Object.hasOwnProperty.call(message, "clientName"))
5735 writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientName);
5736 if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion"))
5737 writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientVersion);
5738 return writer;
5739 };
5740
5741 /**
5742 * Encodes the specified StatsContext message, length delimited. Does not implicitly {@link StatsContext.verify|verify} messages.
5743 * @function encodeDelimited
5744 * @memberof StatsContext
5745 * @static
5746 * @param {IStatsContext} message StatsContext message or plain object to encode
5747 * @param {$protobuf.Writer} [writer] Writer to encode to
5748 * @returns {$protobuf.Writer} Writer
5749 */
5750 StatsContext.encodeDelimited = function encodeDelimited(message, writer) {
5751 return this.encode(message, writer).ldelim();
5752 };
5753
5754 /**
5755 * Decodes a StatsContext message from the specified reader or buffer.
5756 * @function decode
5757 * @memberof StatsContext
5758 * @static
5759 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
5760 * @param {number} [length] Message length if known beforehand
5761 * @returns {StatsContext} StatsContext
5762 * @throws {Error} If the payload is not a reader or valid buffer
5763 * @throws {$protobuf.util.ProtocolError} If required fields are missing
5764 */
5765 StatsContext.decode = function decode(reader, length) {
5766 if (!(reader instanceof $Reader))
5767 reader = $Reader.create(reader);
5768 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StatsContext();
5769 while (reader.pos < end) {
5770 var tag = reader.uint32();
5771 switch (tag >>> 3) {
5772 case 1:
5773 message.clientReferenceId = reader.string();
5774 break;
5775 case 2:
5776 message.clientName = reader.string();
5777 break;
5778 case 3:
5779 message.clientVersion = reader.string();
5780 break;
5781 default:
5782 reader.skipType(tag & 7);
5783 break;
5784 }
5785 }
5786 return message;
5787 };
5788
5789 /**
5790 * Decodes a StatsContext message from the specified reader or buffer, length delimited.
5791 * @function decodeDelimited
5792 * @memberof StatsContext
5793 * @static
5794 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
5795 * @returns {StatsContext} StatsContext
5796 * @throws {Error} If the payload is not a reader or valid buffer
5797 * @throws {$protobuf.util.ProtocolError} If required fields are missing
5798 */
5799 StatsContext.decodeDelimited = function decodeDelimited(reader) {
5800 if (!(reader instanceof $Reader))
5801 reader = new $Reader(reader);
5802 return this.decode(reader, reader.uint32());
5803 };
5804
5805 /**
5806 * Verifies a StatsContext message.
5807 * @function verify
5808 * @memberof StatsContext
5809 * @static
5810 * @param {Object.<string,*>} message Plain object to verify
5811 * @returns {string|null} `null` if valid, otherwise the reason why it is not
5812 */
5813 StatsContext.verify = function verify(message) {
5814 if (typeof message !== "object" || message === null)
5815 return "object expected";
5816 if (message.clientReferenceId != null && message.hasOwnProperty("clientReferenceId"))
5817 if (!$util.isString(message.clientReferenceId))
5818 return "clientReferenceId: string expected";
5819 if (message.clientName != null && message.hasOwnProperty("clientName"))
5820 if (!$util.isString(message.clientName))
5821 return "clientName: string expected";
5822 if (message.clientVersion != null && message.hasOwnProperty("clientVersion"))
5823 if (!$util.isString(message.clientVersion))
5824 return "clientVersion: string expected";
5825 return null;
5826 };
5827
5828 /**
5829 * Creates a StatsContext message from a plain object. Also converts values to their respective internal types.
5830 * @function fromObject
5831 * @memberof StatsContext
5832 * @static
5833 * @param {Object.<string,*>} object Plain object
5834 * @returns {StatsContext} StatsContext
5835 */
5836 StatsContext.fromObject = function fromObject(object) {
5837 if (object instanceof $root.StatsContext)
5838 return object;
5839 var message = new $root.StatsContext();
5840 if (object.clientReferenceId != null)
5841 message.clientReferenceId = String(object.clientReferenceId);
5842 if (object.clientName != null)
5843 message.clientName = String(object.clientName);
5844 if (object.clientVersion != null)
5845 message.clientVersion = String(object.clientVersion);
5846 return message;
5847 };
5848
5849 /**
5850 * Creates a plain object from a StatsContext message. Also converts values to other types if specified.
5851 * @function toObject
5852 * @memberof StatsContext
5853 * @static
5854 * @param {StatsContext} message StatsContext
5855 * @param {$protobuf.IConversionOptions} [options] Conversion options
5856 * @returns {Object.<string,*>} Plain object
5857 */
5858 StatsContext.toObject = function toObject(message, options) {
5859 if (!options)
5860 options = {};
5861 var object = {};
5862 if (options.defaults) {
5863 object.clientReferenceId = "";
5864 object.clientName = "";
5865 object.clientVersion = "";
5866 }
5867 if (message.clientReferenceId != null && message.hasOwnProperty("clientReferenceId"))
5868 object.clientReferenceId = message.clientReferenceId;
5869 if (message.clientName != null && message.hasOwnProperty("clientName"))
5870 object.clientName = message.clientName;
5871 if (message.clientVersion != null && message.hasOwnProperty("clientVersion"))
5872 object.clientVersion = message.clientVersion;
5873 return object;
5874 };
5875
5876 /**
5877 * Converts this StatsContext to JSON.
5878 * @function toJSON
5879 * @memberof StatsContext
5880 * @instance
5881 * @returns {Object.<string,*>} JSON object
5882 */
5883 StatsContext.prototype.toJSON = function toJSON() {
5884 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
5885 };
5886
5887 return StatsContext;
5888})();
5889
5890$root.ContextualizedQueryLatencyStats = (function() {
5891
5892 /**
5893 * Properties of a ContextualizedQueryLatencyStats.
5894 * @exports IContextualizedQueryLatencyStats
5895 * @interface IContextualizedQueryLatencyStats
5896 * @property {IQueryLatencyStats|null} [queryLatencyStats] ContextualizedQueryLatencyStats queryLatencyStats
5897 * @property {IStatsContext|null} [context] ContextualizedQueryLatencyStats context
5898 */
5899
5900 /**
5901 * Constructs a new ContextualizedQueryLatencyStats.
5902 * @exports ContextualizedQueryLatencyStats
5903 * @classdesc Represents a ContextualizedQueryLatencyStats.
5904 * @implements IContextualizedQueryLatencyStats
5905 * @constructor
5906 * @param {IContextualizedQueryLatencyStats=} [properties] Properties to set
5907 */
5908 function ContextualizedQueryLatencyStats(properties) {
5909 if (properties)
5910 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
5911 if (properties[keys[i]] != null)
5912 this[keys[i]] = properties[keys[i]];
5913 }
5914
5915 /**
5916 * ContextualizedQueryLatencyStats queryLatencyStats.
5917 * @member {IQueryLatencyStats|null|undefined} queryLatencyStats
5918 * @memberof ContextualizedQueryLatencyStats
5919 * @instance
5920 */
5921 ContextualizedQueryLatencyStats.prototype.queryLatencyStats = null;
5922
5923 /**
5924 * ContextualizedQueryLatencyStats context.
5925 * @member {IStatsContext|null|undefined} context
5926 * @memberof ContextualizedQueryLatencyStats
5927 * @instance
5928 */
5929 ContextualizedQueryLatencyStats.prototype.context = null;
5930
5931 /**
5932 * Creates a new ContextualizedQueryLatencyStats instance using the specified properties.
5933 * @function create
5934 * @memberof ContextualizedQueryLatencyStats
5935 * @static
5936 * @param {IContextualizedQueryLatencyStats=} [properties] Properties to set
5937 * @returns {ContextualizedQueryLatencyStats} ContextualizedQueryLatencyStats instance
5938 */
5939 ContextualizedQueryLatencyStats.create = function create(properties) {
5940 return new ContextualizedQueryLatencyStats(properties);
5941 };
5942
5943 /**
5944 * Encodes the specified ContextualizedQueryLatencyStats message. Does not implicitly {@link ContextualizedQueryLatencyStats.verify|verify} messages.
5945 * @function encode
5946 * @memberof ContextualizedQueryLatencyStats
5947 * @static
5948 * @param {IContextualizedQueryLatencyStats} message ContextualizedQueryLatencyStats message or plain object to encode
5949 * @param {$protobuf.Writer} [writer] Writer to encode to
5950 * @returns {$protobuf.Writer} Writer
5951 */
5952 ContextualizedQueryLatencyStats.encode = function encode(message, writer) {
5953 if (!writer)
5954 writer = $Writer.create();
5955 if (message.queryLatencyStats != null && Object.hasOwnProperty.call(message, "queryLatencyStats"))
5956 $root.QueryLatencyStats.encode(message.queryLatencyStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
5957 if (message.context != null && Object.hasOwnProperty.call(message, "context"))
5958 $root.StatsContext.encode(message.context, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
5959 return writer;
5960 };
5961
5962 /**
5963 * Encodes the specified ContextualizedQueryLatencyStats message, length delimited. Does not implicitly {@link ContextualizedQueryLatencyStats.verify|verify} messages.
5964 * @function encodeDelimited
5965 * @memberof ContextualizedQueryLatencyStats
5966 * @static
5967 * @param {IContextualizedQueryLatencyStats} message ContextualizedQueryLatencyStats message or plain object to encode
5968 * @param {$protobuf.Writer} [writer] Writer to encode to
5969 * @returns {$protobuf.Writer} Writer
5970 */
5971 ContextualizedQueryLatencyStats.encodeDelimited = function encodeDelimited(message, writer) {
5972 return this.encode(message, writer).ldelim();
5973 };
5974
5975 /**
5976 * Decodes a ContextualizedQueryLatencyStats message from the specified reader or buffer.
5977 * @function decode
5978 * @memberof ContextualizedQueryLatencyStats
5979 * @static
5980 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
5981 * @param {number} [length] Message length if known beforehand
5982 * @returns {ContextualizedQueryLatencyStats} ContextualizedQueryLatencyStats
5983 * @throws {Error} If the payload is not a reader or valid buffer
5984 * @throws {$protobuf.util.ProtocolError} If required fields are missing
5985 */
5986 ContextualizedQueryLatencyStats.decode = function decode(reader, length) {
5987 if (!(reader instanceof $Reader))
5988 reader = $Reader.create(reader);
5989 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ContextualizedQueryLatencyStats();
5990 while (reader.pos < end) {
5991 var tag = reader.uint32();
5992 switch (tag >>> 3) {
5993 case 1:
5994 message.queryLatencyStats = $root.QueryLatencyStats.decode(reader, reader.uint32());
5995 break;
5996 case 2:
5997 message.context = $root.StatsContext.decode(reader, reader.uint32());
5998 break;
5999 default:
6000 reader.skipType(tag & 7);
6001 break;
6002 }
6003 }
6004 return message;
6005 };
6006
6007 /**
6008 * Decodes a ContextualizedQueryLatencyStats message from the specified reader or buffer, length delimited.
6009 * @function decodeDelimited
6010 * @memberof ContextualizedQueryLatencyStats
6011 * @static
6012 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
6013 * @returns {ContextualizedQueryLatencyStats} ContextualizedQueryLatencyStats
6014 * @throws {Error} If the payload is not a reader or valid buffer
6015 * @throws {$protobuf.util.ProtocolError} If required fields are missing
6016 */
6017 ContextualizedQueryLatencyStats.decodeDelimited = function decodeDelimited(reader) {
6018 if (!(reader instanceof $Reader))
6019 reader = new $Reader(reader);
6020 return this.decode(reader, reader.uint32());
6021 };
6022
6023 /**
6024 * Verifies a ContextualizedQueryLatencyStats message.
6025 * @function verify
6026 * @memberof ContextualizedQueryLatencyStats
6027 * @static
6028 * @param {Object.<string,*>} message Plain object to verify
6029 * @returns {string|null} `null` if valid, otherwise the reason why it is not
6030 */
6031 ContextualizedQueryLatencyStats.verify = function verify(message) {
6032 if (typeof message !== "object" || message === null)
6033 return "object expected";
6034 if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats")) {
6035 var error = $root.QueryLatencyStats.verify(message.queryLatencyStats);
6036 if (error)
6037 return "queryLatencyStats." + error;
6038 }
6039 if (message.context != null && message.hasOwnProperty("context")) {
6040 var error = $root.StatsContext.verify(message.context);
6041 if (error)
6042 return "context." + error;
6043 }
6044 return null;
6045 };
6046
6047 /**
6048 * Creates a ContextualizedQueryLatencyStats message from a plain object. Also converts values to their respective internal types.
6049 * @function fromObject
6050 * @memberof ContextualizedQueryLatencyStats
6051 * @static
6052 * @param {Object.<string,*>} object Plain object
6053 * @returns {ContextualizedQueryLatencyStats} ContextualizedQueryLatencyStats
6054 */
6055 ContextualizedQueryLatencyStats.fromObject = function fromObject(object) {
6056 if (object instanceof $root.ContextualizedQueryLatencyStats)
6057 return object;
6058 var message = new $root.ContextualizedQueryLatencyStats();
6059 if (object.queryLatencyStats != null) {
6060 if (typeof object.queryLatencyStats !== "object")
6061 throw TypeError(".ContextualizedQueryLatencyStats.queryLatencyStats: object expected");
6062 message.queryLatencyStats = $root.QueryLatencyStats.fromObject(object.queryLatencyStats);
6063 }
6064 if (object.context != null) {
6065 if (typeof object.context !== "object")
6066 throw TypeError(".ContextualizedQueryLatencyStats.context: object expected");
6067 message.context = $root.StatsContext.fromObject(object.context);
6068 }
6069 return message;
6070 };
6071
6072 /**
6073 * Creates a plain object from a ContextualizedQueryLatencyStats message. Also converts values to other types if specified.
6074 * @function toObject
6075 * @memberof ContextualizedQueryLatencyStats
6076 * @static
6077 * @param {ContextualizedQueryLatencyStats} message ContextualizedQueryLatencyStats
6078 * @param {$protobuf.IConversionOptions} [options] Conversion options
6079 * @returns {Object.<string,*>} Plain object
6080 */
6081 ContextualizedQueryLatencyStats.toObject = function toObject(message, options) {
6082 if (!options)
6083 options = {};
6084 var object = {};
6085 if (options.defaults) {
6086 object.queryLatencyStats = null;
6087 object.context = null;
6088 }
6089 if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats"))
6090 object.queryLatencyStats = $root.QueryLatencyStats.toObject(message.queryLatencyStats, options);
6091 if (message.context != null && message.hasOwnProperty("context"))
6092 object.context = $root.StatsContext.toObject(message.context, options);
6093 return object;
6094 };
6095
6096 /**
6097 * Converts this ContextualizedQueryLatencyStats to JSON.
6098 * @function toJSON
6099 * @memberof ContextualizedQueryLatencyStats
6100 * @instance
6101 * @returns {Object.<string,*>} JSON object
6102 */
6103 ContextualizedQueryLatencyStats.prototype.toJSON = function toJSON() {
6104 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
6105 };
6106
6107 return ContextualizedQueryLatencyStats;
6108})();
6109
6110$root.ContextualizedTypeStats = (function() {
6111
6112 /**
6113 * Properties of a ContextualizedTypeStats.
6114 * @exports IContextualizedTypeStats
6115 * @interface IContextualizedTypeStats
6116 * @property {IStatsContext|null} [context] ContextualizedTypeStats context
6117 * @property {Object.<string,ITypeStat>|null} [perTypeStat] ContextualizedTypeStats perTypeStat
6118 */
6119
6120 /**
6121 * Constructs a new ContextualizedTypeStats.
6122 * @exports ContextualizedTypeStats
6123 * @classdesc Represents a ContextualizedTypeStats.
6124 * @implements IContextualizedTypeStats
6125 * @constructor
6126 * @param {IContextualizedTypeStats=} [properties] Properties to set
6127 */
6128 function ContextualizedTypeStats(properties) {
6129 this.perTypeStat = {};
6130 if (properties)
6131 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
6132 if (properties[keys[i]] != null)
6133 this[keys[i]] = properties[keys[i]];
6134 }
6135
6136 /**
6137 * ContextualizedTypeStats context.
6138 * @member {IStatsContext|null|undefined} context
6139 * @memberof ContextualizedTypeStats
6140 * @instance
6141 */
6142 ContextualizedTypeStats.prototype.context = null;
6143
6144 /**
6145 * ContextualizedTypeStats perTypeStat.
6146 * @member {Object.<string,ITypeStat>} perTypeStat
6147 * @memberof ContextualizedTypeStats
6148 * @instance
6149 */
6150 ContextualizedTypeStats.prototype.perTypeStat = $util.emptyObject;
6151
6152 /**
6153 * Creates a new ContextualizedTypeStats instance using the specified properties.
6154 * @function create
6155 * @memberof ContextualizedTypeStats
6156 * @static
6157 * @param {IContextualizedTypeStats=} [properties] Properties to set
6158 * @returns {ContextualizedTypeStats} ContextualizedTypeStats instance
6159 */
6160 ContextualizedTypeStats.create = function create(properties) {
6161 return new ContextualizedTypeStats(properties);
6162 };
6163
6164 /**
6165 * Encodes the specified ContextualizedTypeStats message. Does not implicitly {@link ContextualizedTypeStats.verify|verify} messages.
6166 * @function encode
6167 * @memberof ContextualizedTypeStats
6168 * @static
6169 * @param {IContextualizedTypeStats} message ContextualizedTypeStats message or plain object to encode
6170 * @param {$protobuf.Writer} [writer] Writer to encode to
6171 * @returns {$protobuf.Writer} Writer
6172 */
6173 ContextualizedTypeStats.encode = function encode(message, writer) {
6174 if (!writer)
6175 writer = $Writer.create();
6176 if (message.context != null && Object.hasOwnProperty.call(message, "context"))
6177 $root.StatsContext.encode(message.context, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
6178 if (message.perTypeStat != null && Object.hasOwnProperty.call(message, "perTypeStat"))
6179 for (var keys = Object.keys(message.perTypeStat), i = 0; i < keys.length; ++i) {
6180 writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
6181 $root.TypeStat.encode(message.perTypeStat[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
6182 }
6183 return writer;
6184 };
6185
6186 /**
6187 * Encodes the specified ContextualizedTypeStats message, length delimited. Does not implicitly {@link ContextualizedTypeStats.verify|verify} messages.
6188 * @function encodeDelimited
6189 * @memberof ContextualizedTypeStats
6190 * @static
6191 * @param {IContextualizedTypeStats} message ContextualizedTypeStats message or plain object to encode
6192 * @param {$protobuf.Writer} [writer] Writer to encode to
6193 * @returns {$protobuf.Writer} Writer
6194 */
6195 ContextualizedTypeStats.encodeDelimited = function encodeDelimited(message, writer) {
6196 return this.encode(message, writer).ldelim();
6197 };
6198
6199 /**
6200 * Decodes a ContextualizedTypeStats message from the specified reader or buffer.
6201 * @function decode
6202 * @memberof ContextualizedTypeStats
6203 * @static
6204 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
6205 * @param {number} [length] Message length if known beforehand
6206 * @returns {ContextualizedTypeStats} ContextualizedTypeStats
6207 * @throws {Error} If the payload is not a reader or valid buffer
6208 * @throws {$protobuf.util.ProtocolError} If required fields are missing
6209 */
6210 ContextualizedTypeStats.decode = function decode(reader, length) {
6211 if (!(reader instanceof $Reader))
6212 reader = $Reader.create(reader);
6213 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ContextualizedTypeStats(), key;
6214 while (reader.pos < end) {
6215 var tag = reader.uint32();
6216 switch (tag >>> 3) {
6217 case 1:
6218 message.context = $root.StatsContext.decode(reader, reader.uint32());
6219 break;
6220 case 2:
6221 reader.skip().pos++;
6222 if (message.perTypeStat === $util.emptyObject)
6223 message.perTypeStat = {};
6224 key = reader.string();
6225 reader.pos++;
6226 message.perTypeStat[key] = $root.TypeStat.decode(reader, reader.uint32());
6227 break;
6228 default:
6229 reader.skipType(tag & 7);
6230 break;
6231 }
6232 }
6233 return message;
6234 };
6235
6236 /**
6237 * Decodes a ContextualizedTypeStats message from the specified reader or buffer, length delimited.
6238 * @function decodeDelimited
6239 * @memberof ContextualizedTypeStats
6240 * @static
6241 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
6242 * @returns {ContextualizedTypeStats} ContextualizedTypeStats
6243 * @throws {Error} If the payload is not a reader or valid buffer
6244 * @throws {$protobuf.util.ProtocolError} If required fields are missing
6245 */
6246 ContextualizedTypeStats.decodeDelimited = function decodeDelimited(reader) {
6247 if (!(reader instanceof $Reader))
6248 reader = new $Reader(reader);
6249 return this.decode(reader, reader.uint32());
6250 };
6251
6252 /**
6253 * Verifies a ContextualizedTypeStats message.
6254 * @function verify
6255 * @memberof ContextualizedTypeStats
6256 * @static
6257 * @param {Object.<string,*>} message Plain object to verify
6258 * @returns {string|null} `null` if valid, otherwise the reason why it is not
6259 */
6260 ContextualizedTypeStats.verify = function verify(message) {
6261 if (typeof message !== "object" || message === null)
6262 return "object expected";
6263 if (message.context != null && message.hasOwnProperty("context")) {
6264 var error = $root.StatsContext.verify(message.context);
6265 if (error)
6266 return "context." + error;
6267 }
6268 if (message.perTypeStat != null && message.hasOwnProperty("perTypeStat")) {
6269 if (!$util.isObject(message.perTypeStat))
6270 return "perTypeStat: object expected";
6271 var key = Object.keys(message.perTypeStat);
6272 for (var i = 0; i < key.length; ++i) {
6273 var error = $root.TypeStat.verify(message.perTypeStat[key[i]]);
6274 if (error)
6275 return "perTypeStat." + error;
6276 }
6277 }
6278 return null;
6279 };
6280
6281 /**
6282 * Creates a ContextualizedTypeStats message from a plain object. Also converts values to their respective internal types.
6283 * @function fromObject
6284 * @memberof ContextualizedTypeStats
6285 * @static
6286 * @param {Object.<string,*>} object Plain object
6287 * @returns {ContextualizedTypeStats} ContextualizedTypeStats
6288 */
6289 ContextualizedTypeStats.fromObject = function fromObject(object) {
6290 if (object instanceof $root.ContextualizedTypeStats)
6291 return object;
6292 var message = new $root.ContextualizedTypeStats();
6293 if (object.context != null) {
6294 if (typeof object.context !== "object")
6295 throw TypeError(".ContextualizedTypeStats.context: object expected");
6296 message.context = $root.StatsContext.fromObject(object.context);
6297 }
6298 if (object.perTypeStat) {
6299 if (typeof object.perTypeStat !== "object")
6300 throw TypeError(".ContextualizedTypeStats.perTypeStat: object expected");
6301 message.perTypeStat = {};
6302 for (var keys = Object.keys(object.perTypeStat), i = 0; i < keys.length; ++i) {
6303 if (typeof object.perTypeStat[keys[i]] !== "object")
6304 throw TypeError(".ContextualizedTypeStats.perTypeStat: object expected");
6305 message.perTypeStat[keys[i]] = $root.TypeStat.fromObject(object.perTypeStat[keys[i]]);
6306 }
6307 }
6308 return message;
6309 };
6310
6311 /**
6312 * Creates a plain object from a ContextualizedTypeStats message. Also converts values to other types if specified.
6313 * @function toObject
6314 * @memberof ContextualizedTypeStats
6315 * @static
6316 * @param {ContextualizedTypeStats} message ContextualizedTypeStats
6317 * @param {$protobuf.IConversionOptions} [options] Conversion options
6318 * @returns {Object.<string,*>} Plain object
6319 */
6320 ContextualizedTypeStats.toObject = function toObject(message, options) {
6321 if (!options)
6322 options = {};
6323 var object = {};
6324 if (options.objects || options.defaults)
6325 object.perTypeStat = {};
6326 if (options.defaults)
6327 object.context = null;
6328 if (message.context != null && message.hasOwnProperty("context"))
6329 object.context = $root.StatsContext.toObject(message.context, options);
6330 var keys2;
6331 if (message.perTypeStat && (keys2 = Object.keys(message.perTypeStat)).length) {
6332 object.perTypeStat = {};
6333 for (var j = 0; j < keys2.length; ++j)
6334 object.perTypeStat[keys2[j]] = $root.TypeStat.toObject(message.perTypeStat[keys2[j]], options);
6335 }
6336 return object;
6337 };
6338
6339 /**
6340 * Converts this ContextualizedTypeStats to JSON.
6341 * @function toJSON
6342 * @memberof ContextualizedTypeStats
6343 * @instance
6344 * @returns {Object.<string,*>} JSON object
6345 */
6346 ContextualizedTypeStats.prototype.toJSON = function toJSON() {
6347 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
6348 };
6349
6350 return ContextualizedTypeStats;
6351})();
6352
6353$root.FieldStat = (function() {
6354
6355 /**
6356 * Properties of a FieldStat.
6357 * @exports IFieldStat
6358 * @interface IFieldStat
6359 * @property {string|null} [returnType] FieldStat returnType
6360 * @property {number|null} [errorsCount] FieldStat errorsCount
6361 * @property {number|null} [count] FieldStat count
6362 * @property {number|null} [requestsWithErrorsCount] FieldStat requestsWithErrorsCount
6363 * @property {Array.<number>|null} [latencyCount] FieldStat latencyCount
6364 */
6365
6366 /**
6367 * Constructs a new FieldStat.
6368 * @exports FieldStat
6369 * @classdesc Represents a FieldStat.
6370 * @implements IFieldStat
6371 * @constructor
6372 * @param {IFieldStat=} [properties] Properties to set
6373 */
6374 function FieldStat(properties) {
6375 this.latencyCount = [];
6376 if (properties)
6377 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
6378 if (properties[keys[i]] != null)
6379 this[keys[i]] = properties[keys[i]];
6380 }
6381
6382 /**
6383 * FieldStat returnType.
6384 * @member {string} returnType
6385 * @memberof FieldStat
6386 * @instance
6387 */
6388 FieldStat.prototype.returnType = "";
6389
6390 /**
6391 * FieldStat errorsCount.
6392 * @member {number} errorsCount
6393 * @memberof FieldStat
6394 * @instance
6395 */
6396 FieldStat.prototype.errorsCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
6397
6398 /**
6399 * FieldStat count.
6400 * @member {number} count
6401 * @memberof FieldStat
6402 * @instance
6403 */
6404 FieldStat.prototype.count = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
6405
6406 /**
6407 * FieldStat requestsWithErrorsCount.
6408 * @member {number} requestsWithErrorsCount
6409 * @memberof FieldStat
6410 * @instance
6411 */
6412 FieldStat.prototype.requestsWithErrorsCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
6413
6414 /**
6415 * FieldStat latencyCount.
6416 * @member {Array.<number>} latencyCount
6417 * @memberof FieldStat
6418 * @instance
6419 */
6420 FieldStat.prototype.latencyCount = $util.emptyArray;
6421
6422 /**
6423 * Creates a new FieldStat instance using the specified properties.
6424 * @function create
6425 * @memberof FieldStat
6426 * @static
6427 * @param {IFieldStat=} [properties] Properties to set
6428 * @returns {FieldStat} FieldStat instance
6429 */
6430 FieldStat.create = function create(properties) {
6431 return new FieldStat(properties);
6432 };
6433
6434 /**
6435 * Encodes the specified FieldStat message. Does not implicitly {@link FieldStat.verify|verify} messages.
6436 * @function encode
6437 * @memberof FieldStat
6438 * @static
6439 * @param {IFieldStat} message FieldStat message or plain object to encode
6440 * @param {$protobuf.Writer} [writer] Writer to encode to
6441 * @returns {$protobuf.Writer} Writer
6442 */
6443 FieldStat.encode = function encode(message, writer) {
6444 if (!writer)
6445 writer = $Writer.create();
6446 if (message.returnType != null && Object.hasOwnProperty.call(message, "returnType"))
6447 writer.uint32(/* id 3, wireType 2 =*/26).string(message.returnType);
6448 if (message.errorsCount != null && Object.hasOwnProperty.call(message, "errorsCount"))
6449 writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.errorsCount);
6450 if (message.count != null && Object.hasOwnProperty.call(message, "count"))
6451 writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.count);
6452 if (message.requestsWithErrorsCount != null && Object.hasOwnProperty.call(message, "requestsWithErrorsCount"))
6453 writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.requestsWithErrorsCount);
6454 if (message.latencyCount != null && message.latencyCount.length) {
6455 writer.uint32(/* id 8, wireType 2 =*/66).fork();
6456 for (var i = 0; i < message.latencyCount.length; ++i)
6457 writer.int64(message.latencyCount[i]);
6458 writer.ldelim();
6459 }
6460 return writer;
6461 };
6462
6463 /**
6464 * Encodes the specified FieldStat message, length delimited. Does not implicitly {@link FieldStat.verify|verify} messages.
6465 * @function encodeDelimited
6466 * @memberof FieldStat
6467 * @static
6468 * @param {IFieldStat} message FieldStat message or plain object to encode
6469 * @param {$protobuf.Writer} [writer] Writer to encode to
6470 * @returns {$protobuf.Writer} Writer
6471 */
6472 FieldStat.encodeDelimited = function encodeDelimited(message, writer) {
6473 return this.encode(message, writer).ldelim();
6474 };
6475
6476 /**
6477 * Decodes a FieldStat message from the specified reader or buffer.
6478 * @function decode
6479 * @memberof FieldStat
6480 * @static
6481 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
6482 * @param {number} [length] Message length if known beforehand
6483 * @returns {FieldStat} FieldStat
6484 * @throws {Error} If the payload is not a reader or valid buffer
6485 * @throws {$protobuf.util.ProtocolError} If required fields are missing
6486 */
6487 FieldStat.decode = function decode(reader, length) {
6488 if (!(reader instanceof $Reader))
6489 reader = $Reader.create(reader);
6490 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.FieldStat();
6491 while (reader.pos < end) {
6492 var tag = reader.uint32();
6493 switch (tag >>> 3) {
6494 case 3:
6495 message.returnType = reader.string();
6496 break;
6497 case 4:
6498 message.errorsCount = reader.uint64();
6499 break;
6500 case 5:
6501 message.count = reader.uint64();
6502 break;
6503 case 6:
6504 message.requestsWithErrorsCount = reader.uint64();
6505 break;
6506 case 8:
6507 if (!(message.latencyCount && message.latencyCount.length))
6508 message.latencyCount = [];
6509 if ((tag & 7) === 2) {
6510 var end2 = reader.uint32() + reader.pos;
6511 while (reader.pos < end2)
6512 message.latencyCount.push(reader.int64());
6513 } else
6514 message.latencyCount.push(reader.int64());
6515 break;
6516 default:
6517 reader.skipType(tag & 7);
6518 break;
6519 }
6520 }
6521 return message;
6522 };
6523
6524 /**
6525 * Decodes a FieldStat message from the specified reader or buffer, length delimited.
6526 * @function decodeDelimited
6527 * @memberof FieldStat
6528 * @static
6529 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
6530 * @returns {FieldStat} FieldStat
6531 * @throws {Error} If the payload is not a reader or valid buffer
6532 * @throws {$protobuf.util.ProtocolError} If required fields are missing
6533 */
6534 FieldStat.decodeDelimited = function decodeDelimited(reader) {
6535 if (!(reader instanceof $Reader))
6536 reader = new $Reader(reader);
6537 return this.decode(reader, reader.uint32());
6538 };
6539
6540 /**
6541 * Verifies a FieldStat message.
6542 * @function verify
6543 * @memberof FieldStat
6544 * @static
6545 * @param {Object.<string,*>} message Plain object to verify
6546 * @returns {string|null} `null` if valid, otherwise the reason why it is not
6547 */
6548 FieldStat.verify = function verify(message) {
6549 if (typeof message !== "object" || message === null)
6550 return "object expected";
6551 if (message.returnType != null && message.hasOwnProperty("returnType"))
6552 if (!$util.isString(message.returnType))
6553 return "returnType: string expected";
6554 if (message.errorsCount != null && message.hasOwnProperty("errorsCount"))
6555 if (!$util.isInteger(message.errorsCount) && !(message.errorsCount && $util.isInteger(message.errorsCount.low) && $util.isInteger(message.errorsCount.high)))
6556 return "errorsCount: integer|Long expected";
6557 if (message.count != null && message.hasOwnProperty("count"))
6558 if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high)))
6559 return "count: integer|Long expected";
6560 if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount"))
6561 if (!$util.isInteger(message.requestsWithErrorsCount) && !(message.requestsWithErrorsCount && $util.isInteger(message.requestsWithErrorsCount.low) && $util.isInteger(message.requestsWithErrorsCount.high)))
6562 return "requestsWithErrorsCount: integer|Long expected";
6563 if (message.latencyCount != null && message.hasOwnProperty("latencyCount")) {
6564 if (!Array.isArray(message.latencyCount))
6565 return "latencyCount: array expected";
6566 for (var i = 0; i < message.latencyCount.length; ++i)
6567 if (!$util.isInteger(message.latencyCount[i]) && !(message.latencyCount[i] && $util.isInteger(message.latencyCount[i].low) && $util.isInteger(message.latencyCount[i].high)))
6568 return "latencyCount: integer|Long[] expected";
6569 }
6570 return null;
6571 };
6572
6573 /**
6574 * Creates a FieldStat message from a plain object. Also converts values to their respective internal types.
6575 * @function fromObject
6576 * @memberof FieldStat
6577 * @static
6578 * @param {Object.<string,*>} object Plain object
6579 * @returns {FieldStat} FieldStat
6580 */
6581 FieldStat.fromObject = function fromObject(object) {
6582 if (object instanceof $root.FieldStat)
6583 return object;
6584 var message = new $root.FieldStat();
6585 if (object.returnType != null)
6586 message.returnType = String(object.returnType);
6587 if (object.errorsCount != null)
6588 if ($util.Long)
6589 (message.errorsCount = $util.Long.fromValue(object.errorsCount)).unsigned = true;
6590 else if (typeof object.errorsCount === "string")
6591 message.errorsCount = parseInt(object.errorsCount, 10);
6592 else if (typeof object.errorsCount === "number")
6593 message.errorsCount = object.errorsCount;
6594 else if (typeof object.errorsCount === "object")
6595 message.errorsCount = new $util.LongBits(object.errorsCount.low >>> 0, object.errorsCount.high >>> 0).toNumber(true);
6596 if (object.count != null)
6597 if ($util.Long)
6598 (message.count = $util.Long.fromValue(object.count)).unsigned = true;
6599 else if (typeof object.count === "string")
6600 message.count = parseInt(object.count, 10);
6601 else if (typeof object.count === "number")
6602 message.count = object.count;
6603 else if (typeof object.count === "object")
6604 message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(true);
6605 if (object.requestsWithErrorsCount != null)
6606 if ($util.Long)
6607 (message.requestsWithErrorsCount = $util.Long.fromValue(object.requestsWithErrorsCount)).unsigned = true;
6608 else if (typeof object.requestsWithErrorsCount === "string")
6609 message.requestsWithErrorsCount = parseInt(object.requestsWithErrorsCount, 10);
6610 else if (typeof object.requestsWithErrorsCount === "number")
6611 message.requestsWithErrorsCount = object.requestsWithErrorsCount;
6612 else if (typeof object.requestsWithErrorsCount === "object")
6613 message.requestsWithErrorsCount = new $util.LongBits(object.requestsWithErrorsCount.low >>> 0, object.requestsWithErrorsCount.high >>> 0).toNumber(true);
6614 if (object.latencyCount) {
6615 if (!Array.isArray(object.latencyCount))
6616 throw TypeError(".FieldStat.latencyCount: array expected");
6617 message.latencyCount = [];
6618 for (var i = 0; i < object.latencyCount.length; ++i)
6619 if ($util.Long)
6620 (message.latencyCount[i] = $util.Long.fromValue(object.latencyCount[i])).unsigned = false;
6621 else if (typeof object.latencyCount[i] === "string")
6622 message.latencyCount[i] = parseInt(object.latencyCount[i], 10);
6623 else if (typeof object.latencyCount[i] === "number")
6624 message.latencyCount[i] = object.latencyCount[i];
6625 else if (typeof object.latencyCount[i] === "object")
6626 message.latencyCount[i] = new $util.LongBits(object.latencyCount[i].low >>> 0, object.latencyCount[i].high >>> 0).toNumber();
6627 }
6628 return message;
6629 };
6630
6631 /**
6632 * Creates a plain object from a FieldStat message. Also converts values to other types if specified.
6633 * @function toObject
6634 * @memberof FieldStat
6635 * @static
6636 * @param {FieldStat} message FieldStat
6637 * @param {$protobuf.IConversionOptions} [options] Conversion options
6638 * @returns {Object.<string,*>} Plain object
6639 */
6640 FieldStat.toObject = function toObject(message, options) {
6641 if (!options)
6642 options = {};
6643 var object = {};
6644 if (options.arrays || options.defaults)
6645 object.latencyCount = [];
6646 if (options.defaults) {
6647 object.returnType = "";
6648 if ($util.Long) {
6649 var long = new $util.Long(0, 0, true);
6650 object.errorsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
6651 } else
6652 object.errorsCount = options.longs === String ? "0" : 0;
6653 if ($util.Long) {
6654 var long = new $util.Long(0, 0, true);
6655 object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
6656 } else
6657 object.count = options.longs === String ? "0" : 0;
6658 if ($util.Long) {
6659 var long = new $util.Long(0, 0, true);
6660 object.requestsWithErrorsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
6661 } else
6662 object.requestsWithErrorsCount = options.longs === String ? "0" : 0;
6663 }
6664 if (message.returnType != null && message.hasOwnProperty("returnType"))
6665 object.returnType = message.returnType;
6666 if (message.errorsCount != null && message.hasOwnProperty("errorsCount"))
6667 if (typeof message.errorsCount === "number")
6668 object.errorsCount = options.longs === String ? String(message.errorsCount) : message.errorsCount;
6669 else
6670 object.errorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.errorsCount) : options.longs === Number ? new $util.LongBits(message.errorsCount.low >>> 0, message.errorsCount.high >>> 0).toNumber(true) : message.errorsCount;
6671 if (message.count != null && message.hasOwnProperty("count"))
6672 if (typeof message.count === "number")
6673 object.count = options.longs === String ? String(message.count) : message.count;
6674 else
6675 object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber(true) : message.count;
6676 if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount"))
6677 if (typeof message.requestsWithErrorsCount === "number")
6678 object.requestsWithErrorsCount = options.longs === String ? String(message.requestsWithErrorsCount) : message.requestsWithErrorsCount;
6679 else
6680 object.requestsWithErrorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestsWithErrorsCount) : options.longs === Number ? new $util.LongBits(message.requestsWithErrorsCount.low >>> 0, message.requestsWithErrorsCount.high >>> 0).toNumber(true) : message.requestsWithErrorsCount;
6681 if (message.latencyCount && message.latencyCount.length) {
6682 object.latencyCount = [];
6683 for (var j = 0; j < message.latencyCount.length; ++j)
6684 if (typeof message.latencyCount[j] === "number")
6685 object.latencyCount[j] = options.longs === String ? String(message.latencyCount[j]) : message.latencyCount[j];
6686 else
6687 object.latencyCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.latencyCount[j]) : options.longs === Number ? new $util.LongBits(message.latencyCount[j].low >>> 0, message.latencyCount[j].high >>> 0).toNumber() : message.latencyCount[j];
6688 }
6689 return object;
6690 };
6691
6692 /**
6693 * Converts this FieldStat to JSON.
6694 * @function toJSON
6695 * @memberof FieldStat
6696 * @instance
6697 * @returns {Object.<string,*>} JSON object
6698 */
6699 FieldStat.prototype.toJSON = function toJSON() {
6700 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
6701 };
6702
6703 return FieldStat;
6704})();
6705
6706$root.TypeStat = (function() {
6707
6708 /**
6709 * Properties of a TypeStat.
6710 * @exports ITypeStat
6711 * @interface ITypeStat
6712 * @property {Object.<string,IFieldStat>|null} [perFieldStat] TypeStat perFieldStat
6713 */
6714
6715 /**
6716 * Constructs a new TypeStat.
6717 * @exports TypeStat
6718 * @classdesc Represents a TypeStat.
6719 * @implements ITypeStat
6720 * @constructor
6721 * @param {ITypeStat=} [properties] Properties to set
6722 */
6723 function TypeStat(properties) {
6724 this.perFieldStat = {};
6725 if (properties)
6726 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
6727 if (properties[keys[i]] != null)
6728 this[keys[i]] = properties[keys[i]];
6729 }
6730
6731 /**
6732 * TypeStat perFieldStat.
6733 * @member {Object.<string,IFieldStat>} perFieldStat
6734 * @memberof TypeStat
6735 * @instance
6736 */
6737 TypeStat.prototype.perFieldStat = $util.emptyObject;
6738
6739 /**
6740 * Creates a new TypeStat instance using the specified properties.
6741 * @function create
6742 * @memberof TypeStat
6743 * @static
6744 * @param {ITypeStat=} [properties] Properties to set
6745 * @returns {TypeStat} TypeStat instance
6746 */
6747 TypeStat.create = function create(properties) {
6748 return new TypeStat(properties);
6749 };
6750
6751 /**
6752 * Encodes the specified TypeStat message. Does not implicitly {@link TypeStat.verify|verify} messages.
6753 * @function encode
6754 * @memberof TypeStat
6755 * @static
6756 * @param {ITypeStat} message TypeStat message or plain object to encode
6757 * @param {$protobuf.Writer} [writer] Writer to encode to
6758 * @returns {$protobuf.Writer} Writer
6759 */
6760 TypeStat.encode = function encode(message, writer) {
6761 if (!writer)
6762 writer = $Writer.create();
6763 if (message.perFieldStat != null && Object.hasOwnProperty.call(message, "perFieldStat"))
6764 for (var keys = Object.keys(message.perFieldStat), i = 0; i < keys.length; ++i) {
6765 writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
6766 $root.FieldStat.encode(message.perFieldStat[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
6767 }
6768 return writer;
6769 };
6770
6771 /**
6772 * Encodes the specified TypeStat message, length delimited. Does not implicitly {@link TypeStat.verify|verify} messages.
6773 * @function encodeDelimited
6774 * @memberof TypeStat
6775 * @static
6776 * @param {ITypeStat} message TypeStat message or plain object to encode
6777 * @param {$protobuf.Writer} [writer] Writer to encode to
6778 * @returns {$protobuf.Writer} Writer
6779 */
6780 TypeStat.encodeDelimited = function encodeDelimited(message, writer) {
6781 return this.encode(message, writer).ldelim();
6782 };
6783
6784 /**
6785 * Decodes a TypeStat message from the specified reader or buffer.
6786 * @function decode
6787 * @memberof TypeStat
6788 * @static
6789 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
6790 * @param {number} [length] Message length if known beforehand
6791 * @returns {TypeStat} TypeStat
6792 * @throws {Error} If the payload is not a reader or valid buffer
6793 * @throws {$protobuf.util.ProtocolError} If required fields are missing
6794 */
6795 TypeStat.decode = function decode(reader, length) {
6796 if (!(reader instanceof $Reader))
6797 reader = $Reader.create(reader);
6798 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TypeStat(), key;
6799 while (reader.pos < end) {
6800 var tag = reader.uint32();
6801 switch (tag >>> 3) {
6802 case 3:
6803 reader.skip().pos++;
6804 if (message.perFieldStat === $util.emptyObject)
6805 message.perFieldStat = {};
6806 key = reader.string();
6807 reader.pos++;
6808 message.perFieldStat[key] = $root.FieldStat.decode(reader, reader.uint32());
6809 break;
6810 default:
6811 reader.skipType(tag & 7);
6812 break;
6813 }
6814 }
6815 return message;
6816 };
6817
6818 /**
6819 * Decodes a TypeStat message from the specified reader or buffer, length delimited.
6820 * @function decodeDelimited
6821 * @memberof TypeStat
6822 * @static
6823 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
6824 * @returns {TypeStat} TypeStat
6825 * @throws {Error} If the payload is not a reader or valid buffer
6826 * @throws {$protobuf.util.ProtocolError} If required fields are missing
6827 */
6828 TypeStat.decodeDelimited = function decodeDelimited(reader) {
6829 if (!(reader instanceof $Reader))
6830 reader = new $Reader(reader);
6831 return this.decode(reader, reader.uint32());
6832 };
6833
6834 /**
6835 * Verifies a TypeStat message.
6836 * @function verify
6837 * @memberof TypeStat
6838 * @static
6839 * @param {Object.<string,*>} message Plain object to verify
6840 * @returns {string|null} `null` if valid, otherwise the reason why it is not
6841 */
6842 TypeStat.verify = function verify(message) {
6843 if (typeof message !== "object" || message === null)
6844 return "object expected";
6845 if (message.perFieldStat != null && message.hasOwnProperty("perFieldStat")) {
6846 if (!$util.isObject(message.perFieldStat))
6847 return "perFieldStat: object expected";
6848 var key = Object.keys(message.perFieldStat);
6849 for (var i = 0; i < key.length; ++i) {
6850 var error = $root.FieldStat.verify(message.perFieldStat[key[i]]);
6851 if (error)
6852 return "perFieldStat." + error;
6853 }
6854 }
6855 return null;
6856 };
6857
6858 /**
6859 * Creates a TypeStat message from a plain object. Also converts values to their respective internal types.
6860 * @function fromObject
6861 * @memberof TypeStat
6862 * @static
6863 * @param {Object.<string,*>} object Plain object
6864 * @returns {TypeStat} TypeStat
6865 */
6866 TypeStat.fromObject = function fromObject(object) {
6867 if (object instanceof $root.TypeStat)
6868 return object;
6869 var message = new $root.TypeStat();
6870 if (object.perFieldStat) {
6871 if (typeof object.perFieldStat !== "object")
6872 throw TypeError(".TypeStat.perFieldStat: object expected");
6873 message.perFieldStat = {};
6874 for (var keys = Object.keys(object.perFieldStat), i = 0; i < keys.length; ++i) {
6875 if (typeof object.perFieldStat[keys[i]] !== "object")
6876 throw TypeError(".TypeStat.perFieldStat: object expected");
6877 message.perFieldStat[keys[i]] = $root.FieldStat.fromObject(object.perFieldStat[keys[i]]);
6878 }
6879 }
6880 return message;
6881 };
6882
6883 /**
6884 * Creates a plain object from a TypeStat message. Also converts values to other types if specified.
6885 * @function toObject
6886 * @memberof TypeStat
6887 * @static
6888 * @param {TypeStat} message TypeStat
6889 * @param {$protobuf.IConversionOptions} [options] Conversion options
6890 * @returns {Object.<string,*>} Plain object
6891 */
6892 TypeStat.toObject = function toObject(message, options) {
6893 if (!options)
6894 options = {};
6895 var object = {};
6896 if (options.objects || options.defaults)
6897 object.perFieldStat = {};
6898 var keys2;
6899 if (message.perFieldStat && (keys2 = Object.keys(message.perFieldStat)).length) {
6900 object.perFieldStat = {};
6901 for (var j = 0; j < keys2.length; ++j)
6902 object.perFieldStat[keys2[j]] = $root.FieldStat.toObject(message.perFieldStat[keys2[j]], options);
6903 }
6904 return object;
6905 };
6906
6907 /**
6908 * Converts this TypeStat to JSON.
6909 * @function toJSON
6910 * @memberof TypeStat
6911 * @instance
6912 * @returns {Object.<string,*>} JSON object
6913 */
6914 TypeStat.prototype.toJSON = function toJSON() {
6915 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
6916 };
6917
6918 return TypeStat;
6919})();
6920
6921$root.Field = (function() {
6922
6923 /**
6924 * Properties of a Field.
6925 * @exports IField
6926 * @interface IField
6927 * @property {string|null} [name] Field name
6928 * @property {string|null} [returnType] Field returnType
6929 */
6930
6931 /**
6932 * Constructs a new Field.
6933 * @exports Field
6934 * @classdesc Represents a Field.
6935 * @implements IField
6936 * @constructor
6937 * @param {IField=} [properties] Properties to set
6938 */
6939 function Field(properties) {
6940 if (properties)
6941 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
6942 if (properties[keys[i]] != null)
6943 this[keys[i]] = properties[keys[i]];
6944 }
6945
6946 /**
6947 * Field name.
6948 * @member {string} name
6949 * @memberof Field
6950 * @instance
6951 */
6952 Field.prototype.name = "";
6953
6954 /**
6955 * Field returnType.
6956 * @member {string} returnType
6957 * @memberof Field
6958 * @instance
6959 */
6960 Field.prototype.returnType = "";
6961
6962 /**
6963 * Creates a new Field instance using the specified properties.
6964 * @function create
6965 * @memberof Field
6966 * @static
6967 * @param {IField=} [properties] Properties to set
6968 * @returns {Field} Field instance
6969 */
6970 Field.create = function create(properties) {
6971 return new Field(properties);
6972 };
6973
6974 /**
6975 * Encodes the specified Field message. Does not implicitly {@link Field.verify|verify} messages.
6976 * @function encode
6977 * @memberof Field
6978 * @static
6979 * @param {IField} message Field message or plain object to encode
6980 * @param {$protobuf.Writer} [writer] Writer to encode to
6981 * @returns {$protobuf.Writer} Writer
6982 */
6983 Field.encode = function encode(message, writer) {
6984 if (!writer)
6985 writer = $Writer.create();
6986 if (message.name != null && Object.hasOwnProperty.call(message, "name"))
6987 writer.uint32(/* id 2, wireType 2 =*/18).string(message.name);
6988 if (message.returnType != null && Object.hasOwnProperty.call(message, "returnType"))
6989 writer.uint32(/* id 3, wireType 2 =*/26).string(message.returnType);
6990 return writer;
6991 };
6992
6993 /**
6994 * Encodes the specified Field message, length delimited. Does not implicitly {@link Field.verify|verify} messages.
6995 * @function encodeDelimited
6996 * @memberof Field
6997 * @static
6998 * @param {IField} message Field message or plain object to encode
6999 * @param {$protobuf.Writer} [writer] Writer to encode to
7000 * @returns {$protobuf.Writer} Writer
7001 */
7002 Field.encodeDelimited = function encodeDelimited(message, writer) {
7003 return this.encode(message, writer).ldelim();
7004 };
7005
7006 /**
7007 * Decodes a Field message from the specified reader or buffer.
7008 * @function decode
7009 * @memberof Field
7010 * @static
7011 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7012 * @param {number} [length] Message length if known beforehand
7013 * @returns {Field} Field
7014 * @throws {Error} If the payload is not a reader or valid buffer
7015 * @throws {$protobuf.util.ProtocolError} If required fields are missing
7016 */
7017 Field.decode = function decode(reader, length) {
7018 if (!(reader instanceof $Reader))
7019 reader = $Reader.create(reader);
7020 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Field();
7021 while (reader.pos < end) {
7022 var tag = reader.uint32();
7023 switch (tag >>> 3) {
7024 case 2:
7025 message.name = reader.string();
7026 break;
7027 case 3:
7028 message.returnType = reader.string();
7029 break;
7030 default:
7031 reader.skipType(tag & 7);
7032 break;
7033 }
7034 }
7035 return message;
7036 };
7037
7038 /**
7039 * Decodes a Field message from the specified reader or buffer, length delimited.
7040 * @function decodeDelimited
7041 * @memberof Field
7042 * @static
7043 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7044 * @returns {Field} Field
7045 * @throws {Error} If the payload is not a reader or valid buffer
7046 * @throws {$protobuf.util.ProtocolError} If required fields are missing
7047 */
7048 Field.decodeDelimited = function decodeDelimited(reader) {
7049 if (!(reader instanceof $Reader))
7050 reader = new $Reader(reader);
7051 return this.decode(reader, reader.uint32());
7052 };
7053
7054 /**
7055 * Verifies a Field message.
7056 * @function verify
7057 * @memberof Field
7058 * @static
7059 * @param {Object.<string,*>} message Plain object to verify
7060 * @returns {string|null} `null` if valid, otherwise the reason why it is not
7061 */
7062 Field.verify = function verify(message) {
7063 if (typeof message !== "object" || message === null)
7064 return "object expected";
7065 if (message.name != null && message.hasOwnProperty("name"))
7066 if (!$util.isString(message.name))
7067 return "name: string expected";
7068 if (message.returnType != null && message.hasOwnProperty("returnType"))
7069 if (!$util.isString(message.returnType))
7070 return "returnType: string expected";
7071 return null;
7072 };
7073
7074 /**
7075 * Creates a Field message from a plain object. Also converts values to their respective internal types.
7076 * @function fromObject
7077 * @memberof Field
7078 * @static
7079 * @param {Object.<string,*>} object Plain object
7080 * @returns {Field} Field
7081 */
7082 Field.fromObject = function fromObject(object) {
7083 if (object instanceof $root.Field)
7084 return object;
7085 var message = new $root.Field();
7086 if (object.name != null)
7087 message.name = String(object.name);
7088 if (object.returnType != null)
7089 message.returnType = String(object.returnType);
7090 return message;
7091 };
7092
7093 /**
7094 * Creates a plain object from a Field message. Also converts values to other types if specified.
7095 * @function toObject
7096 * @memberof Field
7097 * @static
7098 * @param {Field} message Field
7099 * @param {$protobuf.IConversionOptions} [options] Conversion options
7100 * @returns {Object.<string,*>} Plain object
7101 */
7102 Field.toObject = function toObject(message, options) {
7103 if (!options)
7104 options = {};
7105 var object = {};
7106 if (options.defaults) {
7107 object.name = "";
7108 object.returnType = "";
7109 }
7110 if (message.name != null && message.hasOwnProperty("name"))
7111 object.name = message.name;
7112 if (message.returnType != null && message.hasOwnProperty("returnType"))
7113 object.returnType = message.returnType;
7114 return object;
7115 };
7116
7117 /**
7118 * Converts this Field to JSON.
7119 * @function toJSON
7120 * @memberof Field
7121 * @instance
7122 * @returns {Object.<string,*>} JSON object
7123 */
7124 Field.prototype.toJSON = function toJSON() {
7125 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
7126 };
7127
7128 return Field;
7129})();
7130
7131$root.Type = (function() {
7132
7133 /**
7134 * Properties of a Type.
7135 * @exports IType
7136 * @interface IType
7137 * @property {string|null} [name] Type name
7138 * @property {Array.<IField>|null} [field] Type field
7139 */
7140
7141 /**
7142 * Constructs a new Type.
7143 * @exports Type
7144 * @classdesc Represents a Type.
7145 * @implements IType
7146 * @constructor
7147 * @param {IType=} [properties] Properties to set
7148 */
7149 function Type(properties) {
7150 this.field = [];
7151 if (properties)
7152 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
7153 if (properties[keys[i]] != null)
7154 this[keys[i]] = properties[keys[i]];
7155 }
7156
7157 /**
7158 * Type name.
7159 * @member {string} name
7160 * @memberof Type
7161 * @instance
7162 */
7163 Type.prototype.name = "";
7164
7165 /**
7166 * Type field.
7167 * @member {Array.<IField>} field
7168 * @memberof Type
7169 * @instance
7170 */
7171 Type.prototype.field = $util.emptyArray;
7172
7173 /**
7174 * Creates a new Type instance using the specified properties.
7175 * @function create
7176 * @memberof Type
7177 * @static
7178 * @param {IType=} [properties] Properties to set
7179 * @returns {Type} Type instance
7180 */
7181 Type.create = function create(properties) {
7182 return new Type(properties);
7183 };
7184
7185 /**
7186 * Encodes the specified Type message. Does not implicitly {@link Type.verify|verify} messages.
7187 * @function encode
7188 * @memberof Type
7189 * @static
7190 * @param {IType} message Type message or plain object to encode
7191 * @param {$protobuf.Writer} [writer] Writer to encode to
7192 * @returns {$protobuf.Writer} Writer
7193 */
7194 Type.encode = function encode(message, writer) {
7195 if (!writer)
7196 writer = $Writer.create();
7197 if (message.name != null && Object.hasOwnProperty.call(message, "name"))
7198 writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
7199 if (message.field != null && message.field.length)
7200 for (var i = 0; i < message.field.length; ++i)
7201 $root.Field.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
7202 return writer;
7203 };
7204
7205 /**
7206 * Encodes the specified Type message, length delimited. Does not implicitly {@link Type.verify|verify} messages.
7207 * @function encodeDelimited
7208 * @memberof Type
7209 * @static
7210 * @param {IType} message Type message or plain object to encode
7211 * @param {$protobuf.Writer} [writer] Writer to encode to
7212 * @returns {$protobuf.Writer} Writer
7213 */
7214 Type.encodeDelimited = function encodeDelimited(message, writer) {
7215 return this.encode(message, writer).ldelim();
7216 };
7217
7218 /**
7219 * Decodes a Type message from the specified reader or buffer.
7220 * @function decode
7221 * @memberof Type
7222 * @static
7223 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7224 * @param {number} [length] Message length if known beforehand
7225 * @returns {Type} Type
7226 * @throws {Error} If the payload is not a reader or valid buffer
7227 * @throws {$protobuf.util.ProtocolError} If required fields are missing
7228 */
7229 Type.decode = function decode(reader, length) {
7230 if (!(reader instanceof $Reader))
7231 reader = $Reader.create(reader);
7232 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Type();
7233 while (reader.pos < end) {
7234 var tag = reader.uint32();
7235 switch (tag >>> 3) {
7236 case 1:
7237 message.name = reader.string();
7238 break;
7239 case 2:
7240 if (!(message.field && message.field.length))
7241 message.field = [];
7242 message.field.push($root.Field.decode(reader, reader.uint32()));
7243 break;
7244 default:
7245 reader.skipType(tag & 7);
7246 break;
7247 }
7248 }
7249 return message;
7250 };
7251
7252 /**
7253 * Decodes a Type message from the specified reader or buffer, length delimited.
7254 * @function decodeDelimited
7255 * @memberof Type
7256 * @static
7257 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7258 * @returns {Type} Type
7259 * @throws {Error} If the payload is not a reader or valid buffer
7260 * @throws {$protobuf.util.ProtocolError} If required fields are missing
7261 */
7262 Type.decodeDelimited = function decodeDelimited(reader) {
7263 if (!(reader instanceof $Reader))
7264 reader = new $Reader(reader);
7265 return this.decode(reader, reader.uint32());
7266 };
7267
7268 /**
7269 * Verifies a Type message.
7270 * @function verify
7271 * @memberof Type
7272 * @static
7273 * @param {Object.<string,*>} message Plain object to verify
7274 * @returns {string|null} `null` if valid, otherwise the reason why it is not
7275 */
7276 Type.verify = function verify(message) {
7277 if (typeof message !== "object" || message === null)
7278 return "object expected";
7279 if (message.name != null && message.hasOwnProperty("name"))
7280 if (!$util.isString(message.name))
7281 return "name: string expected";
7282 if (message.field != null && message.hasOwnProperty("field")) {
7283 if (!Array.isArray(message.field))
7284 return "field: array expected";
7285 for (var i = 0; i < message.field.length; ++i) {
7286 var error = $root.Field.verify(message.field[i]);
7287 if (error)
7288 return "field." + error;
7289 }
7290 }
7291 return null;
7292 };
7293
7294 /**
7295 * Creates a Type message from a plain object. Also converts values to their respective internal types.
7296 * @function fromObject
7297 * @memberof Type
7298 * @static
7299 * @param {Object.<string,*>} object Plain object
7300 * @returns {Type} Type
7301 */
7302 Type.fromObject = function fromObject(object) {
7303 if (object instanceof $root.Type)
7304 return object;
7305 var message = new $root.Type();
7306 if (object.name != null)
7307 message.name = String(object.name);
7308 if (object.field) {
7309 if (!Array.isArray(object.field))
7310 throw TypeError(".Type.field: array expected");
7311 message.field = [];
7312 for (var i = 0; i < object.field.length; ++i) {
7313 if (typeof object.field[i] !== "object")
7314 throw TypeError(".Type.field: object expected");
7315 message.field[i] = $root.Field.fromObject(object.field[i]);
7316 }
7317 }
7318 return message;
7319 };
7320
7321 /**
7322 * Creates a plain object from a Type message. Also converts values to other types if specified.
7323 * @function toObject
7324 * @memberof Type
7325 * @static
7326 * @param {Type} message Type
7327 * @param {$protobuf.IConversionOptions} [options] Conversion options
7328 * @returns {Object.<string,*>} Plain object
7329 */
7330 Type.toObject = function toObject(message, options) {
7331 if (!options)
7332 options = {};
7333 var object = {};
7334 if (options.arrays || options.defaults)
7335 object.field = [];
7336 if (options.defaults)
7337 object.name = "";
7338 if (message.name != null && message.hasOwnProperty("name"))
7339 object.name = message.name;
7340 if (message.field && message.field.length) {
7341 object.field = [];
7342 for (var j = 0; j < message.field.length; ++j)
7343 object.field[j] = $root.Field.toObject(message.field[j], options);
7344 }
7345 return object;
7346 };
7347
7348 /**
7349 * Converts this Type to JSON.
7350 * @function toJSON
7351 * @memberof Type
7352 * @instance
7353 * @returns {Object.<string,*>} JSON object
7354 */
7355 Type.prototype.toJSON = function toJSON() {
7356 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
7357 };
7358
7359 return Type;
7360})();
7361
7362$root.Report = (function() {
7363
7364 /**
7365 * Properties of a Report.
7366 * @exports IReport
7367 * @interface IReport
7368 * @property {IReportHeader|null} [header] Report header
7369 * @property {Object.<string,ITracesAndStats>|null} [tracesPerQuery] Report tracesPerQuery
7370 * @property {google.protobuf.ITimestamp|null} [endTime] Report endTime
7371 */
7372
7373 /**
7374 * Constructs a new Report.
7375 * @exports Report
7376 * @classdesc Represents a Report.
7377 * @implements IReport
7378 * @constructor
7379 * @param {IReport=} [properties] Properties to set
7380 */
7381 function Report(properties) {
7382 this.tracesPerQuery = {};
7383 if (properties)
7384 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
7385 if (properties[keys[i]] != null)
7386 this[keys[i]] = properties[keys[i]];
7387 }
7388
7389 /**
7390 * Report header.
7391 * @member {IReportHeader|null|undefined} header
7392 * @memberof Report
7393 * @instance
7394 */
7395 Report.prototype.header = null;
7396
7397 /**
7398 * Report tracesPerQuery.
7399 * @member {Object.<string,ITracesAndStats>} tracesPerQuery
7400 * @memberof Report
7401 * @instance
7402 */
7403 Report.prototype.tracesPerQuery = $util.emptyObject;
7404
7405 /**
7406 * Report endTime.
7407 * @member {google.protobuf.ITimestamp|null|undefined} endTime
7408 * @memberof Report
7409 * @instance
7410 */
7411 Report.prototype.endTime = null;
7412
7413 /**
7414 * Creates a new Report instance using the specified properties.
7415 * @function create
7416 * @memberof Report
7417 * @static
7418 * @param {IReport=} [properties] Properties to set
7419 * @returns {Report} Report instance
7420 */
7421 Report.create = function create(properties) {
7422 return new Report(properties);
7423 };
7424
7425 /**
7426 * Encodes the specified Report message. Does not implicitly {@link Report.verify|verify} messages.
7427 * @function encode
7428 * @memberof Report
7429 * @static
7430 * @param {IReport} message Report message or plain object to encode
7431 * @param {$protobuf.Writer} [writer] Writer to encode to
7432 * @returns {$protobuf.Writer} Writer
7433 */
7434 Report.encode = function encode(message, writer) {
7435 if (!writer)
7436 writer = $Writer.create();
7437 if (message.header != null && Object.hasOwnProperty.call(message, "header"))
7438 $root.ReportHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
7439 if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime"))
7440 $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
7441 if (message.tracesPerQuery != null && Object.hasOwnProperty.call(message, "tracesPerQuery"))
7442 for (var keys = Object.keys(message.tracesPerQuery), i = 0; i < keys.length; ++i) {
7443 writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
7444 $root.TracesAndStats.encode(message.tracesPerQuery[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
7445 }
7446 return writer;
7447 };
7448
7449 /**
7450 * Encodes the specified Report message, length delimited. Does not implicitly {@link Report.verify|verify} messages.
7451 * @function encodeDelimited
7452 * @memberof Report
7453 * @static
7454 * @param {IReport} message Report message or plain object to encode
7455 * @param {$protobuf.Writer} [writer] Writer to encode to
7456 * @returns {$protobuf.Writer} Writer
7457 */
7458 Report.encodeDelimited = function encodeDelimited(message, writer) {
7459 return this.encode(message, writer).ldelim();
7460 };
7461
7462 /**
7463 * Decodes a Report message from the specified reader or buffer.
7464 * @function decode
7465 * @memberof Report
7466 * @static
7467 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7468 * @param {number} [length] Message length if known beforehand
7469 * @returns {Report} Report
7470 * @throws {Error} If the payload is not a reader or valid buffer
7471 * @throws {$protobuf.util.ProtocolError} If required fields are missing
7472 */
7473 Report.decode = function decode(reader, length) {
7474 if (!(reader instanceof $Reader))
7475 reader = $Reader.create(reader);
7476 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Report(), key;
7477 while (reader.pos < end) {
7478 var tag = reader.uint32();
7479 switch (tag >>> 3) {
7480 case 1:
7481 message.header = $root.ReportHeader.decode(reader, reader.uint32());
7482 break;
7483 case 5:
7484 reader.skip().pos++;
7485 if (message.tracesPerQuery === $util.emptyObject)
7486 message.tracesPerQuery = {};
7487 key = reader.string();
7488 reader.pos++;
7489 message.tracesPerQuery[key] = $root.TracesAndStats.decode(reader, reader.uint32());
7490 break;
7491 case 2:
7492 message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
7493 break;
7494 default:
7495 reader.skipType(tag & 7);
7496 break;
7497 }
7498 }
7499 return message;
7500 };
7501
7502 /**
7503 * Decodes a Report message from the specified reader or buffer, length delimited.
7504 * @function decodeDelimited
7505 * @memberof Report
7506 * @static
7507 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7508 * @returns {Report} Report
7509 * @throws {Error} If the payload is not a reader or valid buffer
7510 * @throws {$protobuf.util.ProtocolError} If required fields are missing
7511 */
7512 Report.decodeDelimited = function decodeDelimited(reader) {
7513 if (!(reader instanceof $Reader))
7514 reader = new $Reader(reader);
7515 return this.decode(reader, reader.uint32());
7516 };
7517
7518 /**
7519 * Verifies a Report message.
7520 * @function verify
7521 * @memberof Report
7522 * @static
7523 * @param {Object.<string,*>} message Plain object to verify
7524 * @returns {string|null} `null` if valid, otherwise the reason why it is not
7525 */
7526 Report.verify = function verify(message) {
7527 if (typeof message !== "object" || message === null)
7528 return "object expected";
7529 if (message.header != null && message.hasOwnProperty("header")) {
7530 var error = $root.ReportHeader.verify(message.header);
7531 if (error)
7532 return "header." + error;
7533 }
7534 if (message.tracesPerQuery != null && message.hasOwnProperty("tracesPerQuery")) {
7535 if (!$util.isObject(message.tracesPerQuery))
7536 return "tracesPerQuery: object expected";
7537 var key = Object.keys(message.tracesPerQuery);
7538 for (var i = 0; i < key.length; ++i) {
7539 var error = $root.TracesAndStats.verify(message.tracesPerQuery[key[i]]);
7540 if (error)
7541 return "tracesPerQuery." + error;
7542 }
7543 }
7544 if (message.endTime != null && message.hasOwnProperty("endTime")) {
7545 var error = $root.google.protobuf.Timestamp.verify(message.endTime);
7546 if (error)
7547 return "endTime." + error;
7548 }
7549 return null;
7550 };
7551
7552 /**
7553 * Creates a Report message from a plain object. Also converts values to their respective internal types.
7554 * @function fromObject
7555 * @memberof Report
7556 * @static
7557 * @param {Object.<string,*>} object Plain object
7558 * @returns {Report} Report
7559 */
7560 Report.fromObject = function fromObject(object) {
7561 if (object instanceof $root.Report)
7562 return object;
7563 var message = new $root.Report();
7564 if (object.header != null) {
7565 if (typeof object.header !== "object")
7566 throw TypeError(".Report.header: object expected");
7567 message.header = $root.ReportHeader.fromObject(object.header);
7568 }
7569 if (object.tracesPerQuery) {
7570 if (typeof object.tracesPerQuery !== "object")
7571 throw TypeError(".Report.tracesPerQuery: object expected");
7572 message.tracesPerQuery = {};
7573 for (var keys = Object.keys(object.tracesPerQuery), i = 0; i < keys.length; ++i) {
7574 if (typeof object.tracesPerQuery[keys[i]] !== "object")
7575 throw TypeError(".Report.tracesPerQuery: object expected");
7576 message.tracesPerQuery[keys[i]] = $root.TracesAndStats.fromObject(object.tracesPerQuery[keys[i]]);
7577 }
7578 }
7579 if (object.endTime != null) {
7580 if (typeof object.endTime !== "object")
7581 throw TypeError(".Report.endTime: object expected");
7582 message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime);
7583 }
7584 return message;
7585 };
7586
7587 /**
7588 * Creates a plain object from a Report message. Also converts values to other types if specified.
7589 * @function toObject
7590 * @memberof Report
7591 * @static
7592 * @param {Report} message Report
7593 * @param {$protobuf.IConversionOptions} [options] Conversion options
7594 * @returns {Object.<string,*>} Plain object
7595 */
7596 Report.toObject = function toObject(message, options) {
7597 if (!options)
7598 options = {};
7599 var object = {};
7600 if (options.objects || options.defaults)
7601 object.tracesPerQuery = {};
7602 if (options.defaults) {
7603 object.header = null;
7604 object.endTime = null;
7605 }
7606 if (message.header != null && message.hasOwnProperty("header"))
7607 object.header = $root.ReportHeader.toObject(message.header, options);
7608 if (message.endTime != null && message.hasOwnProperty("endTime"))
7609 object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options);
7610 var keys2;
7611 if (message.tracesPerQuery && (keys2 = Object.keys(message.tracesPerQuery)).length) {
7612 object.tracesPerQuery = {};
7613 for (var j = 0; j < keys2.length; ++j)
7614 object.tracesPerQuery[keys2[j]] = $root.TracesAndStats.toObject(message.tracesPerQuery[keys2[j]], options);
7615 }
7616 return object;
7617 };
7618
7619 /**
7620 * Converts this Report to JSON.
7621 * @function toJSON
7622 * @memberof Report
7623 * @instance
7624 * @returns {Object.<string,*>} JSON object
7625 */
7626 Report.prototype.toJSON = function toJSON() {
7627 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
7628 };
7629
7630 return Report;
7631})();
7632
7633$root.ContextualizedStats = (function() {
7634
7635 /**
7636 * Properties of a ContextualizedStats.
7637 * @exports IContextualizedStats
7638 * @interface IContextualizedStats
7639 * @property {IStatsContext|null} [context] ContextualizedStats context
7640 * @property {IQueryLatencyStats|null} [queryLatencyStats] ContextualizedStats queryLatencyStats
7641 * @property {Object.<string,ITypeStat>|null} [perTypeStat] ContextualizedStats perTypeStat
7642 */
7643
7644 /**
7645 * Constructs a new ContextualizedStats.
7646 * @exports ContextualizedStats
7647 * @classdesc Represents a ContextualizedStats.
7648 * @implements IContextualizedStats
7649 * @constructor
7650 * @param {IContextualizedStats=} [properties] Properties to set
7651 */
7652 function ContextualizedStats(properties) {
7653 this.perTypeStat = {};
7654 if (properties)
7655 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
7656 if (properties[keys[i]] != null)
7657 this[keys[i]] = properties[keys[i]];
7658 }
7659
7660 /**
7661 * ContextualizedStats context.
7662 * @member {IStatsContext|null|undefined} context
7663 * @memberof ContextualizedStats
7664 * @instance
7665 */
7666 ContextualizedStats.prototype.context = null;
7667
7668 /**
7669 * ContextualizedStats queryLatencyStats.
7670 * @member {IQueryLatencyStats|null|undefined} queryLatencyStats
7671 * @memberof ContextualizedStats
7672 * @instance
7673 */
7674 ContextualizedStats.prototype.queryLatencyStats = null;
7675
7676 /**
7677 * ContextualizedStats perTypeStat.
7678 * @member {Object.<string,ITypeStat>} perTypeStat
7679 * @memberof ContextualizedStats
7680 * @instance
7681 */
7682 ContextualizedStats.prototype.perTypeStat = $util.emptyObject;
7683
7684 /**
7685 * Creates a new ContextualizedStats instance using the specified properties.
7686 * @function create
7687 * @memberof ContextualizedStats
7688 * @static
7689 * @param {IContextualizedStats=} [properties] Properties to set
7690 * @returns {ContextualizedStats} ContextualizedStats instance
7691 */
7692 ContextualizedStats.create = function create(properties) {
7693 return new ContextualizedStats(properties);
7694 };
7695
7696 /**
7697 * Encodes the specified ContextualizedStats message. Does not implicitly {@link ContextualizedStats.verify|verify} messages.
7698 * @function encode
7699 * @memberof ContextualizedStats
7700 * @static
7701 * @param {IContextualizedStats} message ContextualizedStats message or plain object to encode
7702 * @param {$protobuf.Writer} [writer] Writer to encode to
7703 * @returns {$protobuf.Writer} Writer
7704 */
7705 ContextualizedStats.encode = function encode(message, writer) {
7706 if (!writer)
7707 writer = $Writer.create();
7708 if (message.context != null && Object.hasOwnProperty.call(message, "context"))
7709 $root.StatsContext.encode(message.context, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
7710 if (message.queryLatencyStats != null && Object.hasOwnProperty.call(message, "queryLatencyStats"))
7711 $root.QueryLatencyStats.encode(message.queryLatencyStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
7712 if (message.perTypeStat != null && Object.hasOwnProperty.call(message, "perTypeStat"))
7713 for (var keys = Object.keys(message.perTypeStat), i = 0; i < keys.length; ++i) {
7714 writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
7715 $root.TypeStat.encode(message.perTypeStat[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
7716 }
7717 return writer;
7718 };
7719
7720 /**
7721 * Encodes the specified ContextualizedStats message, length delimited. Does not implicitly {@link ContextualizedStats.verify|verify} messages.
7722 * @function encodeDelimited
7723 * @memberof ContextualizedStats
7724 * @static
7725 * @param {IContextualizedStats} message ContextualizedStats message or plain object to encode
7726 * @param {$protobuf.Writer} [writer] Writer to encode to
7727 * @returns {$protobuf.Writer} Writer
7728 */
7729 ContextualizedStats.encodeDelimited = function encodeDelimited(message, writer) {
7730 return this.encode(message, writer).ldelim();
7731 };
7732
7733 /**
7734 * Decodes a ContextualizedStats message from the specified reader or buffer.
7735 * @function decode
7736 * @memberof ContextualizedStats
7737 * @static
7738 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7739 * @param {number} [length] Message length if known beforehand
7740 * @returns {ContextualizedStats} ContextualizedStats
7741 * @throws {Error} If the payload is not a reader or valid buffer
7742 * @throws {$protobuf.util.ProtocolError} If required fields are missing
7743 */
7744 ContextualizedStats.decode = function decode(reader, length) {
7745 if (!(reader instanceof $Reader))
7746 reader = $Reader.create(reader);
7747 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ContextualizedStats(), key;
7748 while (reader.pos < end) {
7749 var tag = reader.uint32();
7750 switch (tag >>> 3) {
7751 case 1:
7752 message.context = $root.StatsContext.decode(reader, reader.uint32());
7753 break;
7754 case 2:
7755 message.queryLatencyStats = $root.QueryLatencyStats.decode(reader, reader.uint32());
7756 break;
7757 case 3:
7758 reader.skip().pos++;
7759 if (message.perTypeStat === $util.emptyObject)
7760 message.perTypeStat = {};
7761 key = reader.string();
7762 reader.pos++;
7763 message.perTypeStat[key] = $root.TypeStat.decode(reader, reader.uint32());
7764 break;
7765 default:
7766 reader.skipType(tag & 7);
7767 break;
7768 }
7769 }
7770 return message;
7771 };
7772
7773 /**
7774 * Decodes a ContextualizedStats message from the specified reader or buffer, length delimited.
7775 * @function decodeDelimited
7776 * @memberof ContextualizedStats
7777 * @static
7778 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7779 * @returns {ContextualizedStats} ContextualizedStats
7780 * @throws {Error} If the payload is not a reader or valid buffer
7781 * @throws {$protobuf.util.ProtocolError} If required fields are missing
7782 */
7783 ContextualizedStats.decodeDelimited = function decodeDelimited(reader) {
7784 if (!(reader instanceof $Reader))
7785 reader = new $Reader(reader);
7786 return this.decode(reader, reader.uint32());
7787 };
7788
7789 /**
7790 * Verifies a ContextualizedStats message.
7791 * @function verify
7792 * @memberof ContextualizedStats
7793 * @static
7794 * @param {Object.<string,*>} message Plain object to verify
7795 * @returns {string|null} `null` if valid, otherwise the reason why it is not
7796 */
7797 ContextualizedStats.verify = function verify(message) {
7798 if (typeof message !== "object" || message === null)
7799 return "object expected";
7800 if (message.context != null && message.hasOwnProperty("context")) {
7801 var error = $root.StatsContext.verify(message.context);
7802 if (error)
7803 return "context." + error;
7804 }
7805 if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats")) {
7806 var error = $root.QueryLatencyStats.verify(message.queryLatencyStats);
7807 if (error)
7808 return "queryLatencyStats." + error;
7809 }
7810 if (message.perTypeStat != null && message.hasOwnProperty("perTypeStat")) {
7811 if (!$util.isObject(message.perTypeStat))
7812 return "perTypeStat: object expected";
7813 var key = Object.keys(message.perTypeStat);
7814 for (var i = 0; i < key.length; ++i) {
7815 var error = $root.TypeStat.verify(message.perTypeStat[key[i]]);
7816 if (error)
7817 return "perTypeStat." + error;
7818 }
7819 }
7820 return null;
7821 };
7822
7823 /**
7824 * Creates a ContextualizedStats message from a plain object. Also converts values to their respective internal types.
7825 * @function fromObject
7826 * @memberof ContextualizedStats
7827 * @static
7828 * @param {Object.<string,*>} object Plain object
7829 * @returns {ContextualizedStats} ContextualizedStats
7830 */
7831 ContextualizedStats.fromObject = function fromObject(object) {
7832 if (object instanceof $root.ContextualizedStats)
7833 return object;
7834 var message = new $root.ContextualizedStats();
7835 if (object.context != null) {
7836 if (typeof object.context !== "object")
7837 throw TypeError(".ContextualizedStats.context: object expected");
7838 message.context = $root.StatsContext.fromObject(object.context);
7839 }
7840 if (object.queryLatencyStats != null) {
7841 if (typeof object.queryLatencyStats !== "object")
7842 throw TypeError(".ContextualizedStats.queryLatencyStats: object expected");
7843 message.queryLatencyStats = $root.QueryLatencyStats.fromObject(object.queryLatencyStats);
7844 }
7845 if (object.perTypeStat) {
7846 if (typeof object.perTypeStat !== "object")
7847 throw TypeError(".ContextualizedStats.perTypeStat: object expected");
7848 message.perTypeStat = {};
7849 for (var keys = Object.keys(object.perTypeStat), i = 0; i < keys.length; ++i) {
7850 if (typeof object.perTypeStat[keys[i]] !== "object")
7851 throw TypeError(".ContextualizedStats.perTypeStat: object expected");
7852 message.perTypeStat[keys[i]] = $root.TypeStat.fromObject(object.perTypeStat[keys[i]]);
7853 }
7854 }
7855 return message;
7856 };
7857
7858 /**
7859 * Creates a plain object from a ContextualizedStats message. Also converts values to other types if specified.
7860 * @function toObject
7861 * @memberof ContextualizedStats
7862 * @static
7863 * @param {ContextualizedStats} message ContextualizedStats
7864 * @param {$protobuf.IConversionOptions} [options] Conversion options
7865 * @returns {Object.<string,*>} Plain object
7866 */
7867 ContextualizedStats.toObject = function toObject(message, options) {
7868 if (!options)
7869 options = {};
7870 var object = {};
7871 if (options.objects || options.defaults)
7872 object.perTypeStat = {};
7873 if (options.defaults) {
7874 object.context = null;
7875 object.queryLatencyStats = null;
7876 }
7877 if (message.context != null && message.hasOwnProperty("context"))
7878 object.context = $root.StatsContext.toObject(message.context, options);
7879 if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats"))
7880 object.queryLatencyStats = $root.QueryLatencyStats.toObject(message.queryLatencyStats, options);
7881 var keys2;
7882 if (message.perTypeStat && (keys2 = Object.keys(message.perTypeStat)).length) {
7883 object.perTypeStat = {};
7884 for (var j = 0; j < keys2.length; ++j)
7885 object.perTypeStat[keys2[j]] = $root.TypeStat.toObject(message.perTypeStat[keys2[j]], options);
7886 }
7887 return object;
7888 };
7889
7890 /**
7891 * Converts this ContextualizedStats to JSON.
7892 * @function toJSON
7893 * @memberof ContextualizedStats
7894 * @instance
7895 * @returns {Object.<string,*>} JSON object
7896 */
7897 ContextualizedStats.prototype.toJSON = function toJSON() {
7898 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
7899 };
7900
7901 return ContextualizedStats;
7902})();
7903
7904$root.TracesAndStats = (function() {
7905
7906 /**
7907 * Properties of a TracesAndStats.
7908 * @exports ITracesAndStats
7909 * @interface ITracesAndStats
7910 * @property {Array.<ITrace>|null} [trace] TracesAndStats trace
7911 * @property {Array.<IContextualizedStats>|null} [statsWithContext] TracesAndStats statsWithContext
7912 */
7913
7914 /**
7915 * Constructs a new TracesAndStats.
7916 * @exports TracesAndStats
7917 * @classdesc Represents a TracesAndStats.
7918 * @implements ITracesAndStats
7919 * @constructor
7920 * @param {ITracesAndStats=} [properties] Properties to set
7921 */
7922 function TracesAndStats(properties) {
7923 this.trace = [];
7924 this.statsWithContext = [];
7925 if (properties)
7926 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
7927 if (properties[keys[i]] != null)
7928 this[keys[i]] = properties[keys[i]];
7929 }
7930
7931 /**
7932 * TracesAndStats trace.
7933 * @member {Array.<ITrace>} trace
7934 * @memberof TracesAndStats
7935 * @instance
7936 */
7937 TracesAndStats.prototype.trace = $util.emptyArray;
7938
7939 /**
7940 * TracesAndStats statsWithContext.
7941 * @member {Array.<IContextualizedStats>} statsWithContext
7942 * @memberof TracesAndStats
7943 * @instance
7944 */
7945 TracesAndStats.prototype.statsWithContext = $util.emptyArray;
7946
7947 /**
7948 * Creates a new TracesAndStats instance using the specified properties.
7949 * @function create
7950 * @memberof TracesAndStats
7951 * @static
7952 * @param {ITracesAndStats=} [properties] Properties to set
7953 * @returns {TracesAndStats} TracesAndStats instance
7954 */
7955 TracesAndStats.create = function create(properties) {
7956 return new TracesAndStats(properties);
7957 };
7958
7959 /**
7960 * Encodes the specified TracesAndStats message. Does not implicitly {@link TracesAndStats.verify|verify} messages.
7961 * @function encode
7962 * @memberof TracesAndStats
7963 * @static
7964 * @param {ITracesAndStats} message TracesAndStats message or plain object to encode
7965 * @param {$protobuf.Writer} [writer] Writer to encode to
7966 * @returns {$protobuf.Writer} Writer
7967 */
7968 TracesAndStats.encode = function encode(message, writer) {
7969 if (!writer)
7970 writer = $Writer.create();
7971 if (message.trace != null && message.trace.length)
7972 for (var i = 0; i < message.trace.length; ++i)
7973 $root.Trace.encode(message.trace[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
7974 if (message.statsWithContext != null && message.statsWithContext.length)
7975 for (var i = 0; i < message.statsWithContext.length; ++i)
7976 $root.ContextualizedStats.encode(message.statsWithContext[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
7977 return writer;
7978 };
7979
7980 /**
7981 * Encodes the specified TracesAndStats message, length delimited. Does not implicitly {@link TracesAndStats.verify|verify} messages.
7982 * @function encodeDelimited
7983 * @memberof TracesAndStats
7984 * @static
7985 * @param {ITracesAndStats} message TracesAndStats message or plain object to encode
7986 * @param {$protobuf.Writer} [writer] Writer to encode to
7987 * @returns {$protobuf.Writer} Writer
7988 */
7989 TracesAndStats.encodeDelimited = function encodeDelimited(message, writer) {
7990 return this.encode(message, writer).ldelim();
7991 };
7992
7993 /**
7994 * Decodes a TracesAndStats message from the specified reader or buffer.
7995 * @function decode
7996 * @memberof TracesAndStats
7997 * @static
7998 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7999 * @param {number} [length] Message length if known beforehand
8000 * @returns {TracesAndStats} TracesAndStats
8001 * @throws {Error} If the payload is not a reader or valid buffer
8002 * @throws {$protobuf.util.ProtocolError} If required fields are missing
8003 */
8004 TracesAndStats.decode = function decode(reader, length) {
8005 if (!(reader instanceof $Reader))
8006 reader = $Reader.create(reader);
8007 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TracesAndStats();
8008 while (reader.pos < end) {
8009 var tag = reader.uint32();
8010 switch (tag >>> 3) {
8011 case 1:
8012 if (!(message.trace && message.trace.length))
8013 message.trace = [];
8014 message.trace.push($root.Trace.decode(reader, reader.uint32()));
8015 break;
8016 case 2:
8017 if (!(message.statsWithContext && message.statsWithContext.length))
8018 message.statsWithContext = [];
8019 message.statsWithContext.push($root.ContextualizedStats.decode(reader, reader.uint32()));
8020 break;
8021 default:
8022 reader.skipType(tag & 7);
8023 break;
8024 }
8025 }
8026 return message;
8027 };
8028
8029 /**
8030 * Decodes a TracesAndStats message from the specified reader or buffer, length delimited.
8031 * @function decodeDelimited
8032 * @memberof TracesAndStats
8033 * @static
8034 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
8035 * @returns {TracesAndStats} TracesAndStats
8036 * @throws {Error} If the payload is not a reader or valid buffer
8037 * @throws {$protobuf.util.ProtocolError} If required fields are missing
8038 */
8039 TracesAndStats.decodeDelimited = function decodeDelimited(reader) {
8040 if (!(reader instanceof $Reader))
8041 reader = new $Reader(reader);
8042 return this.decode(reader, reader.uint32());
8043 };
8044
8045 /**
8046 * Verifies a TracesAndStats message.
8047 * @function verify
8048 * @memberof TracesAndStats
8049 * @static
8050 * @param {Object.<string,*>} message Plain object to verify
8051 * @returns {string|null} `null` if valid, otherwise the reason why it is not
8052 */
8053 TracesAndStats.verify = function verify(message) {
8054 if (typeof message !== "object" || message === null)
8055 return "object expected";
8056 if (message.trace != null && message.hasOwnProperty("trace")) {
8057 if (!Array.isArray(message.trace))
8058 return "trace: array expected";
8059 for (var i = 0; i < message.trace.length; ++i) {
8060 var error = $root.Trace.verify(message.trace[i]);
8061 if (error)
8062 return "trace." + error;
8063 }
8064 }
8065 if (message.statsWithContext != null && message.hasOwnProperty("statsWithContext")) {
8066 if (!Array.isArray(message.statsWithContext))
8067 return "statsWithContext: array expected";
8068 for (var i = 0; i < message.statsWithContext.length; ++i) {
8069 var error = $root.ContextualizedStats.verify(message.statsWithContext[i]);
8070 if (error)
8071 return "statsWithContext." + error;
8072 }
8073 }
8074 return null;
8075 };
8076
8077 /**
8078 * Creates a TracesAndStats message from a plain object. Also converts values to their respective internal types.
8079 * @function fromObject
8080 * @memberof TracesAndStats
8081 * @static
8082 * @param {Object.<string,*>} object Plain object
8083 * @returns {TracesAndStats} TracesAndStats
8084 */
8085 TracesAndStats.fromObject = function fromObject(object) {
8086 if (object instanceof $root.TracesAndStats)
8087 return object;
8088 var message = new $root.TracesAndStats();
8089 if (object.trace) {
8090 if (!Array.isArray(object.trace))
8091 throw TypeError(".TracesAndStats.trace: array expected");
8092 message.trace = [];
8093 for (var i = 0; i < object.trace.length; ++i) {
8094 if (typeof object.trace[i] !== "object")
8095 throw TypeError(".TracesAndStats.trace: object expected");
8096 message.trace[i] = $root.Trace.fromObject(object.trace[i]);
8097 }
8098 }
8099 if (object.statsWithContext) {
8100 if (!Array.isArray(object.statsWithContext))
8101 throw TypeError(".TracesAndStats.statsWithContext: array expected");
8102 message.statsWithContext = [];
8103 for (var i = 0; i < object.statsWithContext.length; ++i) {
8104 if (typeof object.statsWithContext[i] !== "object")
8105 throw TypeError(".TracesAndStats.statsWithContext: object expected");
8106 message.statsWithContext[i] = $root.ContextualizedStats.fromObject(object.statsWithContext[i]);
8107 }
8108 }
8109 return message;
8110 };
8111
8112 /**
8113 * Creates a plain object from a TracesAndStats message. Also converts values to other types if specified.
8114 * @function toObject
8115 * @memberof TracesAndStats
8116 * @static
8117 * @param {TracesAndStats} message TracesAndStats
8118 * @param {$protobuf.IConversionOptions} [options] Conversion options
8119 * @returns {Object.<string,*>} Plain object
8120 */
8121 TracesAndStats.toObject = function toObject(message, options) {
8122 if (!options)
8123 options = {};
8124 var object = {};
8125 if (options.arrays || options.defaults) {
8126 object.trace = [];
8127 object.statsWithContext = [];
8128 }
8129 if (message.trace && message.trace.length) {
8130 object.trace = [];
8131 for (var j = 0; j < message.trace.length; ++j)
8132 object.trace[j] = $root.Trace.toObject(message.trace[j], options);
8133 }
8134 if (message.statsWithContext && message.statsWithContext.length) {
8135 object.statsWithContext = [];
8136 for (var j = 0; j < message.statsWithContext.length; ++j)
8137 object.statsWithContext[j] = $root.ContextualizedStats.toObject(message.statsWithContext[j], options);
8138 }
8139 return object;
8140 };
8141
8142 /**
8143 * Converts this TracesAndStats to JSON.
8144 * @function toJSON
8145 * @memberof TracesAndStats
8146 * @instance
8147 * @returns {Object.<string,*>} JSON object
8148 */
8149 TracesAndStats.prototype.toJSON = function toJSON() {
8150 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
8151 };
8152
8153 return TracesAndStats;
8154})();
8155
8156$root.google = (function() {
8157
8158 /**
8159 * Namespace google.
8160 * @exports google
8161 * @namespace
8162 */
8163 var google = {};
8164
8165 google.protobuf = (function() {
8166
8167 /**
8168 * Namespace protobuf.
8169 * @memberof google
8170 * @namespace
8171 */
8172 var protobuf = {};
8173
8174 protobuf.Timestamp = (function() {
8175
8176 /**
8177 * Properties of a Timestamp.
8178 * @memberof google.protobuf
8179 * @interface ITimestamp
8180 * @property {number|null} [seconds] Timestamp seconds
8181 * @property {number|null} [nanos] Timestamp nanos
8182 */
8183
8184 /**
8185 * Constructs a new Timestamp.
8186 * @memberof google.protobuf
8187 * @classdesc Represents a Timestamp.
8188 * @implements ITimestamp
8189 * @constructor
8190 * @param {google.protobuf.ITimestamp=} [properties] Properties to set
8191 */
8192 function Timestamp(properties) {
8193 if (properties)
8194 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
8195 if (properties[keys[i]] != null)
8196 this[keys[i]] = properties[keys[i]];
8197 }
8198
8199 /**
8200 * Timestamp seconds.
8201 * @member {number} seconds
8202 * @memberof google.protobuf.Timestamp
8203 * @instance
8204 */
8205 Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
8206
8207 /**
8208 * Timestamp nanos.
8209 * @member {number} nanos
8210 * @memberof google.protobuf.Timestamp
8211 * @instance
8212 */
8213 Timestamp.prototype.nanos = 0;
8214
8215 /**
8216 * Creates a new Timestamp instance using the specified properties.
8217 * @function create
8218 * @memberof google.protobuf.Timestamp
8219 * @static
8220 * @param {google.protobuf.ITimestamp=} [properties] Properties to set
8221 * @returns {google.protobuf.Timestamp} Timestamp instance
8222 */
8223 Timestamp.create = function create(properties) {
8224 return new Timestamp(properties);
8225 };
8226
8227 /**
8228 * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
8229 * @function encode
8230 * @memberof google.protobuf.Timestamp
8231 * @static
8232 * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
8233 * @param {$protobuf.Writer} [writer] Writer to encode to
8234 * @returns {$protobuf.Writer} Writer
8235 */
8236 Timestamp.encode = function encode(message, writer) {
8237 if (!writer)
8238 writer = $Writer.create();
8239 if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
8240 writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
8241 if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
8242 writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
8243 return writer;
8244 };
8245
8246 /**
8247 * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
8248 * @function encodeDelimited
8249 * @memberof google.protobuf.Timestamp
8250 * @static
8251 * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
8252 * @param {$protobuf.Writer} [writer] Writer to encode to
8253 * @returns {$protobuf.Writer} Writer
8254 */
8255 Timestamp.encodeDelimited = function encodeDelimited(message, writer) {
8256 return this.encode(message, writer).ldelim();
8257 };
8258
8259 /**
8260 * Decodes a Timestamp message from the specified reader or buffer.
8261 * @function decode
8262 * @memberof google.protobuf.Timestamp
8263 * @static
8264 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
8265 * @param {number} [length] Message length if known beforehand
8266 * @returns {google.protobuf.Timestamp} Timestamp
8267 * @throws {Error} If the payload is not a reader or valid buffer
8268 * @throws {$protobuf.util.ProtocolError} If required fields are missing
8269 */
8270 Timestamp.decode = function decode(reader, length) {
8271 if (!(reader instanceof $Reader))
8272 reader = $Reader.create(reader);
8273 var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp();
8274 while (reader.pos < end) {
8275 var tag = reader.uint32();
8276 switch (tag >>> 3) {
8277 case 1:
8278 message.seconds = reader.int64();
8279 break;
8280 case 2:
8281 message.nanos = reader.int32();
8282 break;
8283 default:
8284 reader.skipType(tag & 7);
8285 break;
8286 }
8287 }
8288 return message;
8289 };
8290
8291 /**
8292 * Decodes a Timestamp message from the specified reader or buffer, length delimited.
8293 * @function decodeDelimited
8294 * @memberof google.protobuf.Timestamp
8295 * @static
8296 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
8297 * @returns {google.protobuf.Timestamp} Timestamp
8298 * @throws {Error} If the payload is not a reader or valid buffer
8299 * @throws {$protobuf.util.ProtocolError} If required fields are missing
8300 */
8301 Timestamp.decodeDelimited = function decodeDelimited(reader) {
8302 if (!(reader instanceof $Reader))
8303 reader = new $Reader(reader);
8304 return this.decode(reader, reader.uint32());
8305 };
8306
8307 /**
8308 * Verifies a Timestamp message.
8309 * @function verify
8310 * @memberof google.protobuf.Timestamp
8311 * @static
8312 * @param {Object.<string,*>} message Plain object to verify
8313 * @returns {string|null} `null` if valid, otherwise the reason why it is not
8314 */
8315 Timestamp.verify = function verify(message) {
8316 if (typeof message !== "object" || message === null)
8317 return "object expected";
8318 if (message.seconds != null && message.hasOwnProperty("seconds"))
8319 if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
8320 return "seconds: integer|Long expected";
8321 if (message.nanos != null && message.hasOwnProperty("nanos"))
8322 if (!$util.isInteger(message.nanos))
8323 return "nanos: integer expected";
8324 return null;
8325 };
8326
8327 /**
8328 * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
8329 * @function fromObject
8330 * @memberof google.protobuf.Timestamp
8331 * @static
8332 * @param {Object.<string,*>} object Plain object
8333 * @returns {google.protobuf.Timestamp} Timestamp
8334 */
8335 Timestamp.fromObject = function fromObject(object) {
8336 if (object instanceof $root.google.protobuf.Timestamp)
8337 return object;
8338 var message = new $root.google.protobuf.Timestamp();
8339 if (object.seconds != null)
8340 if ($util.Long)
8341 (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
8342 else if (typeof object.seconds === "string")
8343 message.seconds = parseInt(object.seconds, 10);
8344 else if (typeof object.seconds === "number")
8345 message.seconds = object.seconds;
8346 else if (typeof object.seconds === "object")
8347 message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
8348 if (object.nanos != null)
8349 message.nanos = object.nanos | 0;
8350 return message;
8351 };
8352
8353 /**
8354 * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
8355 * @function toObject
8356 * @memberof google.protobuf.Timestamp
8357 * @static
8358 * @param {google.protobuf.Timestamp} message Timestamp
8359 * @param {$protobuf.IConversionOptions} [options] Conversion options
8360 * @returns {Object.<string,*>} Plain object
8361 */
8362 Timestamp.toObject = function toObject(message, options) {
8363 if (!options)
8364 options = {};
8365 var object = {};
8366 if (options.defaults) {
8367 if ($util.Long) {
8368 var long = new $util.Long(0, 0, false);
8369 object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
8370 } else
8371 object.seconds = options.longs === String ? "0" : 0;
8372 object.nanos = 0;
8373 }
8374 if (message.seconds != null && message.hasOwnProperty("seconds"))
8375 if (typeof message.seconds === "number")
8376 object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
8377 else
8378 object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds;
8379 if (message.nanos != null && message.hasOwnProperty("nanos"))
8380 object.nanos = message.nanos;
8381 return object;
8382 };
8383
8384 /**
8385 * Converts this Timestamp to JSON.
8386 * @function toJSON
8387 * @memberof google.protobuf.Timestamp
8388 * @instance
8389 * @returns {Object.<string,*>} JSON object
8390 */
8391 Timestamp.prototype.toJSON = function toJSON() {
8392 return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
8393 };
8394
8395 return Timestamp;
8396 })();
8397
8398 return protobuf;
8399 })();
8400
8401 return google;
8402})();
8403
8404module.exports = $root;