type.googleapis.com.DepthPbMsg.js 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  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. var $protobuf = require("protobufjs/minimal");
  4. // Common aliases
  5. var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
  6. // Exported root namespace
  7. var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
  8. $root.type = (function() {
  9. /**
  10. * Namespace type.
  11. * @exports type
  12. * @namespace
  13. */
  14. var type = {};
  15. type.googleapis = (function() {
  16. /**
  17. * Namespace googleapis.
  18. * @memberof type
  19. * @namespace
  20. */
  21. var googleapis = {};
  22. googleapis.com = (function() {
  23. /**
  24. * Namespace com.
  25. * @memberof type.googleapis
  26. * @namespace
  27. */
  28. var com = {};
  29. com.DepthPbMsg = (function() {
  30. /**
  31. * Namespace DepthPbMsg.
  32. * @memberof type.googleapis.com
  33. * @namespace
  34. */
  35. var DepthPbMsg = {};
  36. DepthPbMsg.Response = (function() {
  37. /**
  38. * Properties of a Response.
  39. * @memberof type.googleapis.com.DepthPbMsg
  40. * @interface IResponse
  41. * @property {string|null} [biz] Response biz
  42. * @property {string|null} [type] Response type
  43. * @property {string|null} [base] Response base
  44. * @property {string|null} [quote] Response quote
  45. * @property {string|null} [contractcode] Response contractcode
  46. * @property {string|null} [granularity] Response granularity
  47. * @property {type.googleapis.com.DepthPbMsg.IData|null} [data] Response data
  48. * @property {number|null} [env] Response env
  49. */
  50. /**
  51. * Constructs a new Response.
  52. * @memberof type.googleapis.com.DepthPbMsg
  53. * @classdesc Represents a Response.
  54. * @implements IResponse
  55. * @constructor
  56. * @param {type.googleapis.com.DepthPbMsg.IResponse=} [properties] Properties to set
  57. */
  58. function Response(properties) {
  59. if (properties)
  60. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  61. if (properties[keys[i]] != null)
  62. this[keys[i]] = properties[keys[i]];
  63. }
  64. /**
  65. * Response biz.
  66. * @member {string} biz
  67. * @memberof type.googleapis.com.DepthPbMsg.Response
  68. * @instance
  69. */
  70. Response.prototype.biz = "";
  71. /**
  72. * Response type.
  73. * @member {string} type
  74. * @memberof type.googleapis.com.DepthPbMsg.Response
  75. * @instance
  76. */
  77. Response.prototype.type = "";
  78. /**
  79. * Response base.
  80. * @member {string} base
  81. * @memberof type.googleapis.com.DepthPbMsg.Response
  82. * @instance
  83. */
  84. Response.prototype.base = "";
  85. /**
  86. * Response quote.
  87. * @member {string} quote
  88. * @memberof type.googleapis.com.DepthPbMsg.Response
  89. * @instance
  90. */
  91. Response.prototype.quote = "";
  92. /**
  93. * Response contractcode.
  94. * @member {string} contractcode
  95. * @memberof type.googleapis.com.DepthPbMsg.Response
  96. * @instance
  97. */
  98. Response.prototype.contractcode = "";
  99. /**
  100. * Response granularity.
  101. * @member {string} granularity
  102. * @memberof type.googleapis.com.DepthPbMsg.Response
  103. * @instance
  104. */
  105. Response.prototype.granularity = "";
  106. /**
  107. * Response data.
  108. * @member {type.googleapis.com.DepthPbMsg.IData|null|undefined} data
  109. * @memberof type.googleapis.com.DepthPbMsg.Response
  110. * @instance
  111. */
  112. Response.prototype.data = null;
  113. /**
  114. * Response env.
  115. * @member {number} env
  116. * @memberof type.googleapis.com.DepthPbMsg.Response
  117. * @instance
  118. */
  119. Response.prototype.env = 0;
  120. /**
  121. * Creates a new Response instance using the specified properties.
  122. * @function create
  123. * @memberof type.googleapis.com.DepthPbMsg.Response
  124. * @static
  125. * @param {type.googleapis.com.DepthPbMsg.IResponse=} [properties] Properties to set
  126. * @returns {type.googleapis.com.DepthPbMsg.Response} Response instance
  127. */
  128. Response.create = function create(properties) {
  129. return new Response(properties);
  130. };
  131. /**
  132. * Encodes the specified Response message. Does not implicitly {@link type.googleapis.com.DepthPbMsg.Response.verify|verify} messages.
  133. * @function encode
  134. * @memberof type.googleapis.com.DepthPbMsg.Response
  135. * @static
  136. * @param {type.googleapis.com.DepthPbMsg.IResponse} message Response message or plain object to encode
  137. * @param {$protobuf.Writer} [writer] Writer to encode to
  138. * @returns {$protobuf.Writer} Writer
  139. */
  140. Response.encode = function encode(message, writer) {
  141. if (!writer)
  142. writer = $Writer.create();
  143. if (message.biz != null && Object.hasOwnProperty.call(message, "biz"))
  144. writer.uint32(/* id 1, wireType 2 =*/10).string(message.biz);
  145. if (message.type != null && Object.hasOwnProperty.call(message, "type"))
  146. writer.uint32(/* id 2, wireType 2 =*/18).string(message.type);
  147. if (message.base != null && Object.hasOwnProperty.call(message, "base"))
  148. writer.uint32(/* id 3, wireType 2 =*/26).string(message.base);
  149. if (message.quote != null && Object.hasOwnProperty.call(message, "quote"))
  150. writer.uint32(/* id 4, wireType 2 =*/34).string(message.quote);
  151. if (message.contractcode != null && Object.hasOwnProperty.call(message, "contractcode"))
  152. writer.uint32(/* id 5, wireType 2 =*/42).string(message.contractcode);
  153. if (message.granularity != null && Object.hasOwnProperty.call(message, "granularity"))
  154. writer.uint32(/* id 6, wireType 2 =*/50).string(message.granularity);
  155. if (message.data != null && Object.hasOwnProperty.call(message, "data"))
  156. $root.type.googleapis.com.DepthPbMsg.Data.encode(message.data, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
  157. if (message.env != null && Object.hasOwnProperty.call(message, "env"))
  158. writer.uint32(/* id 8, wireType 0 =*/64).int32(message.env);
  159. return writer;
  160. };
  161. /**
  162. * Encodes the specified Response message, length delimited. Does not implicitly {@link type.googleapis.com.DepthPbMsg.Response.verify|verify} messages.
  163. * @function encodeDelimited
  164. * @memberof type.googleapis.com.DepthPbMsg.Response
  165. * @static
  166. * @param {type.googleapis.com.DepthPbMsg.IResponse} message Response message or plain object to encode
  167. * @param {$protobuf.Writer} [writer] Writer to encode to
  168. * @returns {$protobuf.Writer} Writer
  169. */
  170. Response.encodeDelimited = function encodeDelimited(message, writer) {
  171. return this.encode(message, writer).ldelim();
  172. };
  173. /**
  174. * Decodes a Response message from the specified reader or buffer.
  175. * @function decode
  176. * @memberof type.googleapis.com.DepthPbMsg.Response
  177. * @static
  178. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  179. * @param {number} [length] Message length if known beforehand
  180. * @returns {type.googleapis.com.DepthPbMsg.Response} Response
  181. * @throws {Error} If the payload is not a reader or valid buffer
  182. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  183. */
  184. Response.decode = function decode(reader, length) {
  185. if (!(reader instanceof $Reader))
  186. reader = $Reader.create(reader);
  187. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.type.googleapis.com.DepthPbMsg.Response();
  188. while (reader.pos < end) {
  189. var tag = reader.uint32();
  190. switch (tag >>> 3) {
  191. case 1: {
  192. message.biz = reader.string();
  193. break;
  194. }
  195. case 2: {
  196. message.type = reader.string();
  197. break;
  198. }
  199. case 3: {
  200. message.base = reader.string();
  201. break;
  202. }
  203. case 4: {
  204. message.quote = reader.string();
  205. break;
  206. }
  207. case 5: {
  208. message.contractcode = reader.string();
  209. break;
  210. }
  211. case 6: {
  212. message.granularity = reader.string();
  213. break;
  214. }
  215. case 7: {
  216. message.data = $root.type.googleapis.com.DepthPbMsg.Data.decode(reader, reader.uint32());
  217. break;
  218. }
  219. case 8: {
  220. message.env = reader.int32();
  221. break;
  222. }
  223. default:
  224. reader.skipType(tag & 7);
  225. break;
  226. }
  227. }
  228. return message;
  229. };
  230. /**
  231. * Decodes a Response message from the specified reader or buffer, length delimited.
  232. * @function decodeDelimited
  233. * @memberof type.googleapis.com.DepthPbMsg.Response
  234. * @static
  235. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  236. * @returns {type.googleapis.com.DepthPbMsg.Response} Response
  237. * @throws {Error} If the payload is not a reader or valid buffer
  238. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  239. */
  240. Response.decodeDelimited = function decodeDelimited(reader) {
  241. if (!(reader instanceof $Reader))
  242. reader = new $Reader(reader);
  243. return this.decode(reader, reader.uint32());
  244. };
  245. /**
  246. * Verifies a Response message.
  247. * @function verify
  248. * @memberof type.googleapis.com.DepthPbMsg.Response
  249. * @static
  250. * @param {Object.<string,*>} message Plain object to verify
  251. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  252. */
  253. Response.verify = function verify(message) {
  254. if (typeof message !== "object" || message === null)
  255. return "object expected";
  256. if (message.biz != null && message.hasOwnProperty("biz"))
  257. if (!$util.isString(message.biz))
  258. return "biz: string expected";
  259. if (message.type != null && message.hasOwnProperty("type"))
  260. if (!$util.isString(message.type))
  261. return "type: string expected";
  262. if (message.base != null && message.hasOwnProperty("base"))
  263. if (!$util.isString(message.base))
  264. return "base: string expected";
  265. if (message.quote != null && message.hasOwnProperty("quote"))
  266. if (!$util.isString(message.quote))
  267. return "quote: string expected";
  268. if (message.contractcode != null && message.hasOwnProperty("contractcode"))
  269. if (!$util.isString(message.contractcode))
  270. return "contractcode: string expected";
  271. if (message.granularity != null && message.hasOwnProperty("granularity"))
  272. if (!$util.isString(message.granularity))
  273. return "granularity: string expected";
  274. if (message.data != null && message.hasOwnProperty("data")) {
  275. var error = $root.type.googleapis.com.DepthPbMsg.Data.verify(message.data);
  276. if (error)
  277. return "data." + error;
  278. }
  279. if (message.env != null && message.hasOwnProperty("env"))
  280. if (!$util.isInteger(message.env))
  281. return "env: integer expected";
  282. return null;
  283. };
  284. /**
  285. * Creates a Response message from a plain object. Also converts values to their respective internal types.
  286. * @function fromObject
  287. * @memberof type.googleapis.com.DepthPbMsg.Response
  288. * @static
  289. * @param {Object.<string,*>} object Plain object
  290. * @returns {type.googleapis.com.DepthPbMsg.Response} Response
  291. */
  292. Response.fromObject = function fromObject(object) {
  293. if (object instanceof $root.type.googleapis.com.DepthPbMsg.Response)
  294. return object;
  295. var message = new $root.type.googleapis.com.DepthPbMsg.Response();
  296. if (object.biz != null)
  297. message.biz = String(object.biz);
  298. if (object.type != null)
  299. message.type = String(object.type);
  300. if (object.base != null)
  301. message.base = String(object.base);
  302. if (object.quote != null)
  303. message.quote = String(object.quote);
  304. if (object.contractcode != null)
  305. message.contractcode = String(object.contractcode);
  306. if (object.granularity != null)
  307. message.granularity = String(object.granularity);
  308. if (object.data != null) {
  309. if (typeof object.data !== "object")
  310. throw TypeError(".type.googleapis.com.DepthPbMsg.Response.data: object expected");
  311. message.data = $root.type.googleapis.com.DepthPbMsg.Data.fromObject(object.data);
  312. }
  313. if (object.env != null)
  314. message.env = object.env | 0;
  315. return message;
  316. };
  317. /**
  318. * Creates a plain object from a Response message. Also converts values to other types if specified.
  319. * @function toObject
  320. * @memberof type.googleapis.com.DepthPbMsg.Response
  321. * @static
  322. * @param {type.googleapis.com.DepthPbMsg.Response} message Response
  323. * @param {$protobuf.IConversionOptions} [options] Conversion options
  324. * @returns {Object.<string,*>} Plain object
  325. */
  326. Response.toObject = function toObject(message, options) {
  327. if (!options)
  328. options = {};
  329. var object = {};
  330. if (options.defaults) {
  331. object.biz = "";
  332. object.type = "";
  333. object.base = "";
  334. object.quote = "";
  335. object.contractcode = "";
  336. object.granularity = "";
  337. object.data = null;
  338. object.env = 0;
  339. }
  340. if (message.biz != null && message.hasOwnProperty("biz"))
  341. object.biz = message.biz;
  342. if (message.type != null && message.hasOwnProperty("type"))
  343. object.type = message.type;
  344. if (message.base != null && message.hasOwnProperty("base"))
  345. object.base = message.base;
  346. if (message.quote != null && message.hasOwnProperty("quote"))
  347. object.quote = message.quote;
  348. if (message.contractcode != null && message.hasOwnProperty("contractcode"))
  349. object.contractcode = message.contractcode;
  350. if (message.granularity != null && message.hasOwnProperty("granularity"))
  351. object.granularity = message.granularity;
  352. if (message.data != null && message.hasOwnProperty("data"))
  353. object.data = $root.type.googleapis.com.DepthPbMsg.Data.toObject(message.data, options);
  354. if (message.env != null && message.hasOwnProperty("env"))
  355. object.env = message.env;
  356. return object;
  357. };
  358. /**
  359. * Converts this Response to JSON.
  360. * @function toJSON
  361. * @memberof type.googleapis.com.DepthPbMsg.Response
  362. * @instance
  363. * @returns {Object.<string,*>} JSON object
  364. */
  365. Response.prototype.toJSON = function toJSON() {
  366. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  367. };
  368. /**
  369. * Gets the default type url for Response
  370. * @function getTypeUrl
  371. * @memberof type.googleapis.com.DepthPbMsg.Response
  372. * @static
  373. * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
  374. * @returns {string} The default type url
  375. */
  376. Response.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
  377. if (typeUrlPrefix === undefined) {
  378. typeUrlPrefix = "type.googleapis.com";
  379. }
  380. return typeUrlPrefix + "/type.googleapis.com.DepthPbMsg.Response";
  381. };
  382. return Response;
  383. })();
  384. DepthPbMsg.Data = (function() {
  385. /**
  386. * Properties of a Data.
  387. * @memberof type.googleapis.com.DepthPbMsg
  388. * @interface IData
  389. * @property {string|null} [typeUrl] Data typeUrl
  390. * @property {type.googleapis.com.DepthPbMsg.IDepthPbMsg|null} [value] Data value
  391. */
  392. /**
  393. * Constructs a new Data.
  394. * @memberof type.googleapis.com.DepthPbMsg
  395. * @classdesc Represents a Data.
  396. * @implements IData
  397. * @constructor
  398. * @param {type.googleapis.com.DepthPbMsg.IData=} [properties] Properties to set
  399. */
  400. function Data(properties) {
  401. if (properties)
  402. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  403. if (properties[keys[i]] != null)
  404. this[keys[i]] = properties[keys[i]];
  405. }
  406. /**
  407. * Data typeUrl.
  408. * @member {string} typeUrl
  409. * @memberof type.googleapis.com.DepthPbMsg.Data
  410. * @instance
  411. */
  412. Data.prototype.typeUrl = "";
  413. /**
  414. * Data value.
  415. * @member {type.googleapis.com.DepthPbMsg.IDepthPbMsg|null|undefined} value
  416. * @memberof type.googleapis.com.DepthPbMsg.Data
  417. * @instance
  418. */
  419. Data.prototype.value = null;
  420. /**
  421. * Creates a new Data instance using the specified properties.
  422. * @function create
  423. * @memberof type.googleapis.com.DepthPbMsg.Data
  424. * @static
  425. * @param {type.googleapis.com.DepthPbMsg.IData=} [properties] Properties to set
  426. * @returns {type.googleapis.com.DepthPbMsg.Data} Data instance
  427. */
  428. Data.create = function create(properties) {
  429. return new Data(properties);
  430. };
  431. /**
  432. * Encodes the specified Data message. Does not implicitly {@link type.googleapis.com.DepthPbMsg.Data.verify|verify} messages.
  433. * @function encode
  434. * @memberof type.googleapis.com.DepthPbMsg.Data
  435. * @static
  436. * @param {type.googleapis.com.DepthPbMsg.IData} message Data message or plain object to encode
  437. * @param {$protobuf.Writer} [writer] Writer to encode to
  438. * @returns {$protobuf.Writer} Writer
  439. */
  440. Data.encode = function encode(message, writer) {
  441. if (!writer)
  442. writer = $Writer.create();
  443. if (message.typeUrl != null && Object.hasOwnProperty.call(message, "typeUrl"))
  444. writer.uint32(/* id 1, wireType 2 =*/10).string(message.typeUrl);
  445. if (message.value != null && Object.hasOwnProperty.call(message, "value"))
  446. $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
  447. return writer;
  448. };
  449. /**
  450. * Encodes the specified Data message, length delimited. Does not implicitly {@link type.googleapis.com.DepthPbMsg.Data.verify|verify} messages.
  451. * @function encodeDelimited
  452. * @memberof type.googleapis.com.DepthPbMsg.Data
  453. * @static
  454. * @param {type.googleapis.com.DepthPbMsg.IData} message Data message or plain object to encode
  455. * @param {$protobuf.Writer} [writer] Writer to encode to
  456. * @returns {$protobuf.Writer} Writer
  457. */
  458. Data.encodeDelimited = function encodeDelimited(message, writer) {
  459. return this.encode(message, writer).ldelim();
  460. };
  461. /**
  462. * Decodes a Data message from the specified reader or buffer.
  463. * @function decode
  464. * @memberof type.googleapis.com.DepthPbMsg.Data
  465. * @static
  466. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  467. * @param {number} [length] Message length if known beforehand
  468. * @returns {type.googleapis.com.DepthPbMsg.Data} Data
  469. * @throws {Error} If the payload is not a reader or valid buffer
  470. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  471. */
  472. Data.decode = function decode(reader, length) {
  473. if (!(reader instanceof $Reader))
  474. reader = $Reader.create(reader);
  475. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.type.googleapis.com.DepthPbMsg.Data();
  476. while (reader.pos < end) {
  477. var tag = reader.uint32();
  478. switch (tag >>> 3) {
  479. case 1: {
  480. message.typeUrl = reader.string();
  481. break;
  482. }
  483. case 2: {
  484. message.value = $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.decode(reader, reader.uint32());
  485. break;
  486. }
  487. default:
  488. reader.skipType(tag & 7);
  489. break;
  490. }
  491. }
  492. return message;
  493. };
  494. /**
  495. * Decodes a Data message from the specified reader or buffer, length delimited.
  496. * @function decodeDelimited
  497. * @memberof type.googleapis.com.DepthPbMsg.Data
  498. * @static
  499. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  500. * @returns {type.googleapis.com.DepthPbMsg.Data} Data
  501. * @throws {Error} If the payload is not a reader or valid buffer
  502. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  503. */
  504. Data.decodeDelimited = function decodeDelimited(reader) {
  505. if (!(reader instanceof $Reader))
  506. reader = new $Reader(reader);
  507. return this.decode(reader, reader.uint32());
  508. };
  509. /**
  510. * Verifies a Data message.
  511. * @function verify
  512. * @memberof type.googleapis.com.DepthPbMsg.Data
  513. * @static
  514. * @param {Object.<string,*>} message Plain object to verify
  515. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  516. */
  517. Data.verify = function verify(message) {
  518. if (typeof message !== "object" || message === null)
  519. return "object expected";
  520. if (message.typeUrl != null && message.hasOwnProperty("typeUrl"))
  521. if (!$util.isString(message.typeUrl))
  522. return "typeUrl: string expected";
  523. if (message.value != null && message.hasOwnProperty("value")) {
  524. var error = $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.verify(message.value);
  525. if (error)
  526. return "value." + error;
  527. }
  528. return null;
  529. };
  530. /**
  531. * Creates a Data message from a plain object. Also converts values to their respective internal types.
  532. * @function fromObject
  533. * @memberof type.googleapis.com.DepthPbMsg.Data
  534. * @static
  535. * @param {Object.<string,*>} object Plain object
  536. * @returns {type.googleapis.com.DepthPbMsg.Data} Data
  537. */
  538. Data.fromObject = function fromObject(object) {
  539. if (object instanceof $root.type.googleapis.com.DepthPbMsg.Data)
  540. return object;
  541. var message = new $root.type.googleapis.com.DepthPbMsg.Data();
  542. if (object.typeUrl != null)
  543. message.typeUrl = String(object.typeUrl);
  544. if (object.value != null) {
  545. if (typeof object.value !== "object")
  546. throw TypeError(".type.googleapis.com.DepthPbMsg.Data.value: object expected");
  547. message.value = $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.fromObject(object.value);
  548. }
  549. return message;
  550. };
  551. /**
  552. * Creates a plain object from a Data message. Also converts values to other types if specified.
  553. * @function toObject
  554. * @memberof type.googleapis.com.DepthPbMsg.Data
  555. * @static
  556. * @param {type.googleapis.com.DepthPbMsg.Data} message Data
  557. * @param {$protobuf.IConversionOptions} [options] Conversion options
  558. * @returns {Object.<string,*>} Plain object
  559. */
  560. Data.toObject = function toObject(message, options) {
  561. if (!options)
  562. options = {};
  563. var object = {};
  564. if (options.defaults) {
  565. object.typeUrl = "";
  566. object.value = null;
  567. }
  568. if (message.typeUrl != null && message.hasOwnProperty("typeUrl"))
  569. object.typeUrl = message.typeUrl;
  570. if (message.value != null && message.hasOwnProperty("value"))
  571. object.value = $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.toObject(message.value, options);
  572. return object;
  573. };
  574. /**
  575. * Converts this Data to JSON.
  576. * @function toJSON
  577. * @memberof type.googleapis.com.DepthPbMsg.Data
  578. * @instance
  579. * @returns {Object.<string,*>} JSON object
  580. */
  581. Data.prototype.toJSON = function toJSON() {
  582. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  583. };
  584. /**
  585. * Gets the default type url for Data
  586. * @function getTypeUrl
  587. * @memberof type.googleapis.com.DepthPbMsg.Data
  588. * @static
  589. * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
  590. * @returns {string} The default type url
  591. */
  592. Data.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
  593. if (typeUrlPrefix === undefined) {
  594. typeUrlPrefix = "type.googleapis.com";
  595. }
  596. return typeUrlPrefix + "/type.googleapis.com.DepthPbMsg.Data";
  597. };
  598. return Data;
  599. })();
  600. DepthPbMsg.DepthPbMsg = (function() {
  601. /**
  602. * Properties of a DepthPbMsg.
  603. * @memberof type.googleapis.com.DepthPbMsg
  604. * @interface IDepthPbMsg
  605. * @property {Array.<type.googleapis.com.DepthPbMsg.DepthPbMsg.IBody>|null} [asksList] DepthPbMsg asksList
  606. * @property {Array.<type.googleapis.com.DepthPbMsg.DepthPbMsg.IBody>|null} [bidsList] DepthPbMsg bidsList
  607. */
  608. /**
  609. * Constructs a new DepthPbMsg.
  610. * @memberof type.googleapis.com.DepthPbMsg
  611. * @classdesc Represents a DepthPbMsg.
  612. * @implements IDepthPbMsg
  613. * @constructor
  614. * @param {type.googleapis.com.DepthPbMsg.IDepthPbMsg=} [properties] Properties to set
  615. */
  616. function DepthPbMsg(properties) {
  617. this.asksList = [];
  618. this.bidsList = [];
  619. if (properties)
  620. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  621. if (properties[keys[i]] != null)
  622. this[keys[i]] = properties[keys[i]];
  623. }
  624. /**
  625. * DepthPbMsg asksList.
  626. * @member {Array.<type.googleapis.com.DepthPbMsg.DepthPbMsg.IBody>} asksList
  627. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  628. * @instance
  629. */
  630. DepthPbMsg.prototype.asksList = $util.emptyArray;
  631. /**
  632. * DepthPbMsg bidsList.
  633. * @member {Array.<type.googleapis.com.DepthPbMsg.DepthPbMsg.IBody>} bidsList
  634. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  635. * @instance
  636. */
  637. DepthPbMsg.prototype.bidsList = $util.emptyArray;
  638. /**
  639. * Creates a new DepthPbMsg instance using the specified properties.
  640. * @function create
  641. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  642. * @static
  643. * @param {type.googleapis.com.DepthPbMsg.IDepthPbMsg=} [properties] Properties to set
  644. * @returns {type.googleapis.com.DepthPbMsg.DepthPbMsg} DepthPbMsg instance
  645. */
  646. DepthPbMsg.create = function create(properties) {
  647. return new DepthPbMsg(properties);
  648. };
  649. /**
  650. * Encodes the specified DepthPbMsg message. Does not implicitly {@link type.googleapis.com.DepthPbMsg.DepthPbMsg.verify|verify} messages.
  651. * @function encode
  652. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  653. * @static
  654. * @param {type.googleapis.com.DepthPbMsg.IDepthPbMsg} message DepthPbMsg message or plain object to encode
  655. * @param {$protobuf.Writer} [writer] Writer to encode to
  656. * @returns {$protobuf.Writer} Writer
  657. */
  658. DepthPbMsg.encode = function encode(message, writer) {
  659. if (!writer)
  660. writer = $Writer.create();
  661. if (message.asksList != null && message.asksList.length)
  662. for (var i = 0; i < message.asksList.length; ++i)
  663. $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.encode(message.asksList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
  664. if (message.bidsList != null && message.bidsList.length)
  665. for (var i = 0; i < message.bidsList.length; ++i)
  666. $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.encode(message.bidsList[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
  667. return writer;
  668. };
  669. /**
  670. * Encodes the specified DepthPbMsg message, length delimited. Does not implicitly {@link type.googleapis.com.DepthPbMsg.DepthPbMsg.verify|verify} messages.
  671. * @function encodeDelimited
  672. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  673. * @static
  674. * @param {type.googleapis.com.DepthPbMsg.IDepthPbMsg} message DepthPbMsg message or plain object to encode
  675. * @param {$protobuf.Writer} [writer] Writer to encode to
  676. * @returns {$protobuf.Writer} Writer
  677. */
  678. DepthPbMsg.encodeDelimited = function encodeDelimited(message, writer) {
  679. return this.encode(message, writer).ldelim();
  680. };
  681. /**
  682. * Decodes a DepthPbMsg message from the specified reader or buffer.
  683. * @function decode
  684. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  685. * @static
  686. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  687. * @param {number} [length] Message length if known beforehand
  688. * @returns {type.googleapis.com.DepthPbMsg.DepthPbMsg} DepthPbMsg
  689. * @throws {Error} If the payload is not a reader or valid buffer
  690. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  691. */
  692. DepthPbMsg.decode = function decode(reader, length) {
  693. if (!(reader instanceof $Reader))
  694. reader = $Reader.create(reader);
  695. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.type.googleapis.com.DepthPbMsg.DepthPbMsg();
  696. while (reader.pos < end) {
  697. var tag = reader.uint32();
  698. switch (tag >>> 3) {
  699. case 1: {
  700. if (!(message.asksList && message.asksList.length))
  701. message.asksList = [];
  702. message.asksList.push($root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.decode(reader, reader.uint32()));
  703. break;
  704. }
  705. case 2: {
  706. if (!(message.bidsList && message.bidsList.length))
  707. message.bidsList = [];
  708. message.bidsList.push($root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.decode(reader, reader.uint32()));
  709. break;
  710. }
  711. default:
  712. reader.skipType(tag & 7);
  713. break;
  714. }
  715. }
  716. return message;
  717. };
  718. /**
  719. * Decodes a DepthPbMsg message from the specified reader or buffer, length delimited.
  720. * @function decodeDelimited
  721. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  722. * @static
  723. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  724. * @returns {type.googleapis.com.DepthPbMsg.DepthPbMsg} DepthPbMsg
  725. * @throws {Error} If the payload is not a reader or valid buffer
  726. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  727. */
  728. DepthPbMsg.decodeDelimited = function decodeDelimited(reader) {
  729. if (!(reader instanceof $Reader))
  730. reader = new $Reader(reader);
  731. return this.decode(reader, reader.uint32());
  732. };
  733. /**
  734. * Verifies a DepthPbMsg message.
  735. * @function verify
  736. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  737. * @static
  738. * @param {Object.<string,*>} message Plain object to verify
  739. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  740. */
  741. DepthPbMsg.verify = function verify(message) {
  742. if (typeof message !== "object" || message === null)
  743. return "object expected";
  744. if (message.asksList != null && message.hasOwnProperty("asksList")) {
  745. if (!Array.isArray(message.asksList))
  746. return "asksList: array expected";
  747. for (var i = 0; i < message.asksList.length; ++i) {
  748. var error = $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.verify(message.asksList[i]);
  749. if (error)
  750. return "asksList." + error;
  751. }
  752. }
  753. if (message.bidsList != null && message.hasOwnProperty("bidsList")) {
  754. if (!Array.isArray(message.bidsList))
  755. return "bidsList: array expected";
  756. for (var i = 0; i < message.bidsList.length; ++i) {
  757. var error = $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.verify(message.bidsList[i]);
  758. if (error)
  759. return "bidsList." + error;
  760. }
  761. }
  762. return null;
  763. };
  764. /**
  765. * Creates a DepthPbMsg message from a plain object. Also converts values to their respective internal types.
  766. * @function fromObject
  767. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  768. * @static
  769. * @param {Object.<string,*>} object Plain object
  770. * @returns {type.googleapis.com.DepthPbMsg.DepthPbMsg} DepthPbMsg
  771. */
  772. DepthPbMsg.fromObject = function fromObject(object) {
  773. if (object instanceof $root.type.googleapis.com.DepthPbMsg.DepthPbMsg)
  774. return object;
  775. var message = new $root.type.googleapis.com.DepthPbMsg.DepthPbMsg();
  776. if (object.asksList) {
  777. if (!Array.isArray(object.asksList))
  778. throw TypeError(".type.googleapis.com.DepthPbMsg.DepthPbMsg.asksList: array expected");
  779. message.asksList = [];
  780. for (var i = 0; i < object.asksList.length; ++i) {
  781. if (typeof object.asksList[i] !== "object")
  782. throw TypeError(".type.googleapis.com.DepthPbMsg.DepthPbMsg.asksList: object expected");
  783. message.asksList[i] = $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.fromObject(object.asksList[i]);
  784. }
  785. }
  786. if (object.bidsList) {
  787. if (!Array.isArray(object.bidsList))
  788. throw TypeError(".type.googleapis.com.DepthPbMsg.DepthPbMsg.bidsList: array expected");
  789. message.bidsList = [];
  790. for (var i = 0; i < object.bidsList.length; ++i) {
  791. if (typeof object.bidsList[i] !== "object")
  792. throw TypeError(".type.googleapis.com.DepthPbMsg.DepthPbMsg.bidsList: object expected");
  793. message.bidsList[i] = $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.fromObject(object.bidsList[i]);
  794. }
  795. }
  796. return message;
  797. };
  798. /**
  799. * Creates a plain object from a DepthPbMsg message. Also converts values to other types if specified.
  800. * @function toObject
  801. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  802. * @static
  803. * @param {type.googleapis.com.DepthPbMsg.DepthPbMsg} message DepthPbMsg
  804. * @param {$protobuf.IConversionOptions} [options] Conversion options
  805. * @returns {Object.<string,*>} Plain object
  806. */
  807. DepthPbMsg.toObject = function toObject(message, options) {
  808. if (!options)
  809. options = {};
  810. var object = {};
  811. if (options.arrays || options.defaults) {
  812. object.asksList = [];
  813. object.bidsList = [];
  814. }
  815. if (message.asksList && message.asksList.length) {
  816. object.asksList = [];
  817. for (var j = 0; j < message.asksList.length; ++j)
  818. object.asksList[j] = $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.toObject(message.asksList[j], options);
  819. }
  820. if (message.bidsList && message.bidsList.length) {
  821. object.bidsList = [];
  822. for (var j = 0; j < message.bidsList.length; ++j)
  823. object.bidsList[j] = $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.toObject(message.bidsList[j], options);
  824. }
  825. return object;
  826. };
  827. /**
  828. * Converts this DepthPbMsg to JSON.
  829. * @function toJSON
  830. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  831. * @instance
  832. * @returns {Object.<string,*>} JSON object
  833. */
  834. DepthPbMsg.prototype.toJSON = function toJSON() {
  835. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  836. };
  837. /**
  838. * Gets the default type url for DepthPbMsg
  839. * @function getTypeUrl
  840. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  841. * @static
  842. * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
  843. * @returns {string} The default type url
  844. */
  845. DepthPbMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
  846. if (typeUrlPrefix === undefined) {
  847. typeUrlPrefix = "type.googleapis.com";
  848. }
  849. return typeUrlPrefix + "/type.googleapis.com.DepthPbMsg.DepthPbMsg";
  850. };
  851. DepthPbMsg.Body = (function() {
  852. /**
  853. * Properties of a Body.
  854. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  855. * @interface IBody
  856. */
  857. /**
  858. * Constructs a new Body.
  859. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg
  860. * @classdesc Represents a Body.
  861. * @implements IBody
  862. * @constructor
  863. * @param {type.googleapis.com.DepthPbMsg.DepthPbMsg.IBody=} [properties] Properties to set
  864. */
  865. function Body(properties) {
  866. if (properties)
  867. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  868. if (properties[keys[i]] != null)
  869. this[keys[i]] = properties[keys[i]];
  870. }
  871. /**
  872. * Creates a new Body instance using the specified properties.
  873. * @function create
  874. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg.Body
  875. * @static
  876. * @param {type.googleapis.com.DepthPbMsg.DepthPbMsg.IBody=} [properties] Properties to set
  877. * @returns {type.googleapis.com.DepthPbMsg.DepthPbMsg.Body} Body instance
  878. */
  879. Body.create = function create(properties) {
  880. return new Body(properties);
  881. };
  882. /**
  883. * Encodes the specified Body message. Does not implicitly {@link type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.verify|verify} messages.
  884. * @function encode
  885. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg.Body
  886. * @static
  887. * @param {type.googleapis.com.DepthPbMsg.DepthPbMsg.IBody} message Body message or plain object to encode
  888. * @param {$protobuf.Writer} [writer] Writer to encode to
  889. * @returns {$protobuf.Writer} Writer
  890. */
  891. Body.encode = function encode(message, writer) {
  892. if (!writer)
  893. writer = $Writer.create();
  894. return writer;
  895. };
  896. /**
  897. * Encodes the specified Body message, length delimited. Does not implicitly {@link type.googleapis.com.DepthPbMsg.DepthPbMsg.Body.verify|verify} messages.
  898. * @function encodeDelimited
  899. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg.Body
  900. * @static
  901. * @param {type.googleapis.com.DepthPbMsg.DepthPbMsg.IBody} message Body message or plain object to encode
  902. * @param {$protobuf.Writer} [writer] Writer to encode to
  903. * @returns {$protobuf.Writer} Writer
  904. */
  905. Body.encodeDelimited = function encodeDelimited(message, writer) {
  906. return this.encode(message, writer).ldelim();
  907. };
  908. /**
  909. * Decodes a Body message from the specified reader or buffer.
  910. * @function decode
  911. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg.Body
  912. * @static
  913. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  914. * @param {number} [length] Message length if known beforehand
  915. * @returns {type.googleapis.com.DepthPbMsg.DepthPbMsg.Body} Body
  916. * @throws {Error} If the payload is not a reader or valid buffer
  917. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  918. */
  919. Body.decode = function decode(reader, length) {
  920. if (!(reader instanceof $Reader))
  921. reader = $Reader.create(reader);
  922. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body();
  923. while (reader.pos < end) {
  924. var tag = reader.uint32();
  925. switch (tag >>> 3) {
  926. default:
  927. reader.skipType(tag & 7);
  928. break;
  929. }
  930. }
  931. return message;
  932. };
  933. /**
  934. * Decodes a Body message from the specified reader or buffer, length delimited.
  935. * @function decodeDelimited
  936. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg.Body
  937. * @static
  938. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  939. * @returns {type.googleapis.com.DepthPbMsg.DepthPbMsg.Body} Body
  940. * @throws {Error} If the payload is not a reader or valid buffer
  941. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  942. */
  943. Body.decodeDelimited = function decodeDelimited(reader) {
  944. if (!(reader instanceof $Reader))
  945. reader = new $Reader(reader);
  946. return this.decode(reader, reader.uint32());
  947. };
  948. /**
  949. * Verifies a Body message.
  950. * @function verify
  951. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg.Body
  952. * @static
  953. * @param {Object.<string,*>} message Plain object to verify
  954. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  955. */
  956. Body.verify = function verify(message) {
  957. if (typeof message !== "object" || message === null)
  958. return "object expected";
  959. return null;
  960. };
  961. /**
  962. * Creates a Body message from a plain object. Also converts values to their respective internal types.
  963. * @function fromObject
  964. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg.Body
  965. * @static
  966. * @param {Object.<string,*>} object Plain object
  967. * @returns {type.googleapis.com.DepthPbMsg.DepthPbMsg.Body} Body
  968. */
  969. Body.fromObject = function fromObject(object) {
  970. if (object instanceof $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body)
  971. return object;
  972. return new $root.type.googleapis.com.DepthPbMsg.DepthPbMsg.Body();
  973. };
  974. /**
  975. * Creates a plain object from a Body message. Also converts values to other types if specified.
  976. * @function toObject
  977. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg.Body
  978. * @static
  979. * @param {type.googleapis.com.DepthPbMsg.DepthPbMsg.Body} message Body
  980. * @param {$protobuf.IConversionOptions} [options] Conversion options
  981. * @returns {Object.<string,*>} Plain object
  982. */
  983. Body.toObject = function toObject() {
  984. return {};
  985. };
  986. /**
  987. * Converts this Body to JSON.
  988. * @function toJSON
  989. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg.Body
  990. * @instance
  991. * @returns {Object.<string,*>} JSON object
  992. */
  993. Body.prototype.toJSON = function toJSON() {
  994. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  995. };
  996. /**
  997. * Gets the default type url for Body
  998. * @function getTypeUrl
  999. * @memberof type.googleapis.com.DepthPbMsg.DepthPbMsg.Body
  1000. * @static
  1001. * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
  1002. * @returns {string} The default type url
  1003. */
  1004. Body.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
  1005. if (typeUrlPrefix === undefined) {
  1006. typeUrlPrefix = "type.googleapis.com";
  1007. }
  1008. return typeUrlPrefix + "/type.googleapis.com.DepthPbMsg.DepthPbMsg.Body";
  1009. };
  1010. return Body;
  1011. })();
  1012. return DepthPbMsg;
  1013. })();
  1014. return DepthPbMsg;
  1015. })();
  1016. return com;
  1017. })();
  1018. return googleapis;
  1019. })();
  1020. return type;
  1021. })();
  1022. module.exports = $root;