type.googleapis.com.FillsPbMsg.js 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978
  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.FillsPbMsg = (function() {
  30. /**
  31. * Namespace FillsPbMsg.
  32. * @memberof type.googleapis.com
  33. * @namespace
  34. */
  35. var FillsPbMsg = {};
  36. FillsPbMsg.Response = (function() {
  37. /**
  38. * Properties of a Response.
  39. * @memberof type.googleapis.com.FillsPbMsg
  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.FillsPbMsg.IData|null} [data] Response data
  48. * @property {number|null} [env] Response env
  49. */
  50. /**
  51. * Constructs a new Response.
  52. * @memberof type.googleapis.com.FillsPbMsg
  53. * @classdesc Represents a Response.
  54. * @implements IResponse
  55. * @constructor
  56. * @param {type.googleapis.com.FillsPbMsg.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.FillsPbMsg.Response
  68. * @instance
  69. */
  70. Response.prototype.biz = "";
  71. /**
  72. * Response type.
  73. * @member {string} type
  74. * @memberof type.googleapis.com.FillsPbMsg.Response
  75. * @instance
  76. */
  77. Response.prototype.type = "";
  78. /**
  79. * Response base.
  80. * @member {string} base
  81. * @memberof type.googleapis.com.FillsPbMsg.Response
  82. * @instance
  83. */
  84. Response.prototype.base = "";
  85. /**
  86. * Response quote.
  87. * @member {string} quote
  88. * @memberof type.googleapis.com.FillsPbMsg.Response
  89. * @instance
  90. */
  91. Response.prototype.quote = "";
  92. /**
  93. * Response contractcode.
  94. * @member {string} contractcode
  95. * @memberof type.googleapis.com.FillsPbMsg.Response
  96. * @instance
  97. */
  98. Response.prototype.contractcode = "";
  99. /**
  100. * Response granularity.
  101. * @member {string} granularity
  102. * @memberof type.googleapis.com.FillsPbMsg.Response
  103. * @instance
  104. */
  105. Response.prototype.granularity = "";
  106. /**
  107. * Response data.
  108. * @member {type.googleapis.com.FillsPbMsg.IData|null|undefined} data
  109. * @memberof type.googleapis.com.FillsPbMsg.Response
  110. * @instance
  111. */
  112. Response.prototype.data = null;
  113. /**
  114. * Response env.
  115. * @member {number} env
  116. * @memberof type.googleapis.com.FillsPbMsg.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.FillsPbMsg.Response
  124. * @static
  125. * @param {type.googleapis.com.FillsPbMsg.IResponse=} [properties] Properties to set
  126. * @returns {type.googleapis.com.FillsPbMsg.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.FillsPbMsg.Response.verify|verify} messages.
  133. * @function encode
  134. * @memberof type.googleapis.com.FillsPbMsg.Response
  135. * @static
  136. * @param {type.googleapis.com.FillsPbMsg.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.FillsPbMsg.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.FillsPbMsg.Response.verify|verify} messages.
  163. * @function encodeDelimited
  164. * @memberof type.googleapis.com.FillsPbMsg.Response
  165. * @static
  166. * @param {type.googleapis.com.FillsPbMsg.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.FillsPbMsg.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.FillsPbMsg.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.FillsPbMsg.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.FillsPbMsg.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.FillsPbMsg.Response
  234. * @static
  235. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  236. * @returns {type.googleapis.com.FillsPbMsg.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.FillsPbMsg.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.FillsPbMsg.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.FillsPbMsg.Response
  288. * @static
  289. * @param {Object.<string,*>} object Plain object
  290. * @returns {type.googleapis.com.FillsPbMsg.Response} Response
  291. */
  292. Response.fromObject = function fromObject(object) {
  293. if (object instanceof $root.type.googleapis.com.FillsPbMsg.Response)
  294. return object;
  295. var message = new $root.type.googleapis.com.FillsPbMsg.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.FillsPbMsg.Response.data: object expected");
  311. message.data = $root.type.googleapis.com.FillsPbMsg.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.FillsPbMsg.Response
  321. * @static
  322. * @param {type.googleapis.com.FillsPbMsg.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.FillsPbMsg.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.FillsPbMsg.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.FillsPbMsg.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.FillsPbMsg.Response";
  381. };
  382. return Response;
  383. })();
  384. FillsPbMsg.Data = (function() {
  385. /**
  386. * Properties of a Data.
  387. * @memberof type.googleapis.com.FillsPbMsg
  388. * @interface IData
  389. * @property {Array.<type.googleapis.com.FillsPbMsg.IBody>|null} [fills] Data fills
  390. */
  391. /**
  392. * Constructs a new Data.
  393. * @memberof type.googleapis.com.FillsPbMsg
  394. * @classdesc Represents a Data.
  395. * @implements IData
  396. * @constructor
  397. * @param {type.googleapis.com.FillsPbMsg.IData=} [properties] Properties to set
  398. */
  399. function Data(properties) {
  400. this.fills = [];
  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 fills.
  408. * @member {Array.<type.googleapis.com.FillsPbMsg.IBody>} fills
  409. * @memberof type.googleapis.com.FillsPbMsg.Data
  410. * @instance
  411. */
  412. Data.prototype.fills = $util.emptyArray;
  413. /**
  414. * Creates a new Data instance using the specified properties.
  415. * @function create
  416. * @memberof type.googleapis.com.FillsPbMsg.Data
  417. * @static
  418. * @param {type.googleapis.com.FillsPbMsg.IData=} [properties] Properties to set
  419. * @returns {type.googleapis.com.FillsPbMsg.Data} Data instance
  420. */
  421. Data.create = function create(properties) {
  422. return new Data(properties);
  423. };
  424. /**
  425. * Encodes the specified Data message. Does not implicitly {@link type.googleapis.com.FillsPbMsg.Data.verify|verify} messages.
  426. * @function encode
  427. * @memberof type.googleapis.com.FillsPbMsg.Data
  428. * @static
  429. * @param {type.googleapis.com.FillsPbMsg.IData} message Data message or plain object to encode
  430. * @param {$protobuf.Writer} [writer] Writer to encode to
  431. * @returns {$protobuf.Writer} Writer
  432. */
  433. Data.encode = function encode(message, writer) {
  434. if (!writer)
  435. writer = $Writer.create();
  436. if (message.fills != null && message.fills.length)
  437. for (var i = 0; i < message.fills.length; ++i)
  438. $root.type.googleapis.com.FillsPbMsg.Body.encode(message.fills[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
  439. return writer;
  440. };
  441. /**
  442. * Encodes the specified Data message, length delimited. Does not implicitly {@link type.googleapis.com.FillsPbMsg.Data.verify|verify} messages.
  443. * @function encodeDelimited
  444. * @memberof type.googleapis.com.FillsPbMsg.Data
  445. * @static
  446. * @param {type.googleapis.com.FillsPbMsg.IData} message Data message or plain object to encode
  447. * @param {$protobuf.Writer} [writer] Writer to encode to
  448. * @returns {$protobuf.Writer} Writer
  449. */
  450. Data.encodeDelimited = function encodeDelimited(message, writer) {
  451. return this.encode(message, writer).ldelim();
  452. };
  453. /**
  454. * Decodes a Data message from the specified reader or buffer.
  455. * @function decode
  456. * @memberof type.googleapis.com.FillsPbMsg.Data
  457. * @static
  458. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  459. * @param {number} [length] Message length if known beforehand
  460. * @returns {type.googleapis.com.FillsPbMsg.Data} Data
  461. * @throws {Error} If the payload is not a reader or valid buffer
  462. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  463. */
  464. Data.decode = function decode(reader, length) {
  465. if (!(reader instanceof $Reader))
  466. reader = $Reader.create(reader);
  467. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.type.googleapis.com.FillsPbMsg.Data();
  468. while (reader.pos < end) {
  469. var tag = reader.uint32();
  470. switch (tag >>> 3) {
  471. case 1: {
  472. if (!(message.fills && message.fills.length))
  473. message.fills = [];
  474. message.fills.push($root.type.googleapis.com.FillsPbMsg.Body.decode(reader, reader.uint32()));
  475. break;
  476. }
  477. default:
  478. reader.skipType(tag & 7);
  479. break;
  480. }
  481. }
  482. return message;
  483. };
  484. /**
  485. * Decodes a Data message from the specified reader or buffer, length delimited.
  486. * @function decodeDelimited
  487. * @memberof type.googleapis.com.FillsPbMsg.Data
  488. * @static
  489. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  490. * @returns {type.googleapis.com.FillsPbMsg.Data} Data
  491. * @throws {Error} If the payload is not a reader or valid buffer
  492. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  493. */
  494. Data.decodeDelimited = function decodeDelimited(reader) {
  495. if (!(reader instanceof $Reader))
  496. reader = new $Reader(reader);
  497. return this.decode(reader, reader.uint32());
  498. };
  499. /**
  500. * Verifies a Data message.
  501. * @function verify
  502. * @memberof type.googleapis.com.FillsPbMsg.Data
  503. * @static
  504. * @param {Object.<string,*>} message Plain object to verify
  505. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  506. */
  507. Data.verify = function verify(message) {
  508. if (typeof message !== "object" || message === null)
  509. return "object expected";
  510. if (message.fills != null && message.hasOwnProperty("fills")) {
  511. if (!Array.isArray(message.fills))
  512. return "fills: array expected";
  513. for (var i = 0; i < message.fills.length; ++i) {
  514. var error = $root.type.googleapis.com.FillsPbMsg.Body.verify(message.fills[i]);
  515. if (error)
  516. return "fills." + error;
  517. }
  518. }
  519. return null;
  520. };
  521. /**
  522. * Creates a Data message from a plain object. Also converts values to their respective internal types.
  523. * @function fromObject
  524. * @memberof type.googleapis.com.FillsPbMsg.Data
  525. * @static
  526. * @param {Object.<string,*>} object Plain object
  527. * @returns {type.googleapis.com.FillsPbMsg.Data} Data
  528. */
  529. Data.fromObject = function fromObject(object) {
  530. if (object instanceof $root.type.googleapis.com.FillsPbMsg.Data)
  531. return object;
  532. var message = new $root.type.googleapis.com.FillsPbMsg.Data();
  533. if (object.fills) {
  534. if (!Array.isArray(object.fills))
  535. throw TypeError(".type.googleapis.com.FillsPbMsg.Data.fills: array expected");
  536. message.fills = [];
  537. for (var i = 0; i < object.fills.length; ++i) {
  538. if (typeof object.fills[i] !== "object")
  539. throw TypeError(".type.googleapis.com.FillsPbMsg.Data.fills: object expected");
  540. message.fills[i] = $root.type.googleapis.com.FillsPbMsg.Body.fromObject(object.fills[i]);
  541. }
  542. }
  543. return message;
  544. };
  545. /**
  546. * Creates a plain object from a Data message. Also converts values to other types if specified.
  547. * @function toObject
  548. * @memberof type.googleapis.com.FillsPbMsg.Data
  549. * @static
  550. * @param {type.googleapis.com.FillsPbMsg.Data} message Data
  551. * @param {$protobuf.IConversionOptions} [options] Conversion options
  552. * @returns {Object.<string,*>} Plain object
  553. */
  554. Data.toObject = function toObject(message, options) {
  555. if (!options)
  556. options = {};
  557. var object = {};
  558. if (options.arrays || options.defaults)
  559. object.fills = [];
  560. if (message.fills && message.fills.length) {
  561. object.fills = [];
  562. for (var j = 0; j < message.fills.length; ++j)
  563. object.fills[j] = $root.type.googleapis.com.FillsPbMsg.Body.toObject(message.fills[j], options);
  564. }
  565. return object;
  566. };
  567. /**
  568. * Converts this Data to JSON.
  569. * @function toJSON
  570. * @memberof type.googleapis.com.FillsPbMsg.Data
  571. * @instance
  572. * @returns {Object.<string,*>} JSON object
  573. */
  574. Data.prototype.toJSON = function toJSON() {
  575. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  576. };
  577. /**
  578. * Gets the default type url for Data
  579. * @function getTypeUrl
  580. * @memberof type.googleapis.com.FillsPbMsg.Data
  581. * @static
  582. * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
  583. * @returns {string} The default type url
  584. */
  585. Data.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
  586. if (typeUrlPrefix === undefined) {
  587. typeUrlPrefix = "type.googleapis.com";
  588. }
  589. return typeUrlPrefix + "/type.googleapis.com.FillsPbMsg.Data";
  590. };
  591. return Data;
  592. })();
  593. FillsPbMsg.Body = (function() {
  594. /**
  595. * Properties of a Body.
  596. * @memberof type.googleapis.com.FillsPbMsg
  597. * @interface IBody
  598. * @property {string|null} [price] Body price
  599. * @property {string|null} [amount] Body amount
  600. * @property {string|null} [side] Body side
  601. * @property {number|Long|null} [createddate] Body createddate
  602. * @property {number|Long|null} [id] Body id
  603. */
  604. /**
  605. * Constructs a new Body.
  606. * @memberof type.googleapis.com.FillsPbMsg
  607. * @classdesc Represents a Body.
  608. * @implements IBody
  609. * @constructor
  610. * @param {type.googleapis.com.FillsPbMsg.IBody=} [properties] Properties to set
  611. */
  612. function Body(properties) {
  613. if (properties)
  614. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  615. if (properties[keys[i]] != null)
  616. this[keys[i]] = properties[keys[i]];
  617. }
  618. /**
  619. * Body price.
  620. * @member {string} price
  621. * @memberof type.googleapis.com.FillsPbMsg.Body
  622. * @instance
  623. */
  624. Body.prototype.price = "";
  625. /**
  626. * Body amount.
  627. * @member {string} amount
  628. * @memberof type.googleapis.com.FillsPbMsg.Body
  629. * @instance
  630. */
  631. Body.prototype.amount = "";
  632. /**
  633. * Body side.
  634. * @member {string} side
  635. * @memberof type.googleapis.com.FillsPbMsg.Body
  636. * @instance
  637. */
  638. Body.prototype.side = "";
  639. /**
  640. * Body createddate.
  641. * @member {number|Long} createddate
  642. * @memberof type.googleapis.com.FillsPbMsg.Body
  643. * @instance
  644. */
  645. Body.prototype.createddate = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  646. /**
  647. * Body id.
  648. * @member {number|Long} id
  649. * @memberof type.googleapis.com.FillsPbMsg.Body
  650. * @instance
  651. */
  652. Body.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  653. /**
  654. * Creates a new Body instance using the specified properties.
  655. * @function create
  656. * @memberof type.googleapis.com.FillsPbMsg.Body
  657. * @static
  658. * @param {type.googleapis.com.FillsPbMsg.IBody=} [properties] Properties to set
  659. * @returns {type.googleapis.com.FillsPbMsg.Body} Body instance
  660. */
  661. Body.create = function create(properties) {
  662. return new Body(properties);
  663. };
  664. /**
  665. * Encodes the specified Body message. Does not implicitly {@link type.googleapis.com.FillsPbMsg.Body.verify|verify} messages.
  666. * @function encode
  667. * @memberof type.googleapis.com.FillsPbMsg.Body
  668. * @static
  669. * @param {type.googleapis.com.FillsPbMsg.IBody} message Body message or plain object to encode
  670. * @param {$protobuf.Writer} [writer] Writer to encode to
  671. * @returns {$protobuf.Writer} Writer
  672. */
  673. Body.encode = function encode(message, writer) {
  674. if (!writer)
  675. writer = $Writer.create();
  676. if (message.price != null && Object.hasOwnProperty.call(message, "price"))
  677. writer.uint32(/* id 1, wireType 2 =*/10).string(message.price);
  678. if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
  679. writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount);
  680. if (message.side != null && Object.hasOwnProperty.call(message, "side"))
  681. writer.uint32(/* id 3, wireType 2 =*/26).string(message.side);
  682. if (message.createddate != null && Object.hasOwnProperty.call(message, "createddate"))
  683. writer.uint32(/* id 4, wireType 0 =*/32).int64(message.createddate);
  684. if (message.id != null && Object.hasOwnProperty.call(message, "id"))
  685. writer.uint32(/* id 5, wireType 0 =*/40).int64(message.id);
  686. return writer;
  687. };
  688. /**
  689. * Encodes the specified Body message, length delimited. Does not implicitly {@link type.googleapis.com.FillsPbMsg.Body.verify|verify} messages.
  690. * @function encodeDelimited
  691. * @memberof type.googleapis.com.FillsPbMsg.Body
  692. * @static
  693. * @param {type.googleapis.com.FillsPbMsg.IBody} message Body message or plain object to encode
  694. * @param {$protobuf.Writer} [writer] Writer to encode to
  695. * @returns {$protobuf.Writer} Writer
  696. */
  697. Body.encodeDelimited = function encodeDelimited(message, writer) {
  698. return this.encode(message, writer).ldelim();
  699. };
  700. /**
  701. * Decodes a Body message from the specified reader or buffer.
  702. * @function decode
  703. * @memberof type.googleapis.com.FillsPbMsg.Body
  704. * @static
  705. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  706. * @param {number} [length] Message length if known beforehand
  707. * @returns {type.googleapis.com.FillsPbMsg.Body} Body
  708. * @throws {Error} If the payload is not a reader or valid buffer
  709. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  710. */
  711. Body.decode = function decode(reader, length) {
  712. if (!(reader instanceof $Reader))
  713. reader = $Reader.create(reader);
  714. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.type.googleapis.com.FillsPbMsg.Body();
  715. while (reader.pos < end) {
  716. var tag = reader.uint32();
  717. switch (tag >>> 3) {
  718. case 1: {
  719. message.price = reader.string();
  720. break;
  721. }
  722. case 2: {
  723. message.amount = reader.string();
  724. break;
  725. }
  726. case 3: {
  727. message.side = reader.string();
  728. break;
  729. }
  730. case 4: {
  731. message.createddate = reader.int64();
  732. break;
  733. }
  734. case 5: {
  735. message.id = reader.int64();
  736. break;
  737. }
  738. default:
  739. reader.skipType(tag & 7);
  740. break;
  741. }
  742. }
  743. return message;
  744. };
  745. /**
  746. * Decodes a Body message from the specified reader or buffer, length delimited.
  747. * @function decodeDelimited
  748. * @memberof type.googleapis.com.FillsPbMsg.Body
  749. * @static
  750. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  751. * @returns {type.googleapis.com.FillsPbMsg.Body} Body
  752. * @throws {Error} If the payload is not a reader or valid buffer
  753. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  754. */
  755. Body.decodeDelimited = function decodeDelimited(reader) {
  756. if (!(reader instanceof $Reader))
  757. reader = new $Reader(reader);
  758. return this.decode(reader, reader.uint32());
  759. };
  760. /**
  761. * Verifies a Body message.
  762. * @function verify
  763. * @memberof type.googleapis.com.FillsPbMsg.Body
  764. * @static
  765. * @param {Object.<string,*>} message Plain object to verify
  766. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  767. */
  768. Body.verify = function verify(message) {
  769. if (typeof message !== "object" || message === null)
  770. return "object expected";
  771. if (message.price != null && message.hasOwnProperty("price"))
  772. if (!$util.isString(message.price))
  773. return "price: string expected";
  774. if (message.amount != null && message.hasOwnProperty("amount"))
  775. if (!$util.isString(message.amount))
  776. return "amount: string expected";
  777. if (message.side != null && message.hasOwnProperty("side"))
  778. if (!$util.isString(message.side))
  779. return "side: string expected";
  780. if (message.createddate != null && message.hasOwnProperty("createddate"))
  781. if (!$util.isInteger(message.createddate) && !(message.createddate && $util.isInteger(message.createddate.low) && $util.isInteger(message.createddate.high)))
  782. return "createddate: integer|Long expected";
  783. if (message.id != null && message.hasOwnProperty("id"))
  784. if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
  785. return "id: integer|Long expected";
  786. return null;
  787. };
  788. /**
  789. * Creates a Body message from a plain object. Also converts values to their respective internal types.
  790. * @function fromObject
  791. * @memberof type.googleapis.com.FillsPbMsg.Body
  792. * @static
  793. * @param {Object.<string,*>} object Plain object
  794. * @returns {type.googleapis.com.FillsPbMsg.Body} Body
  795. */
  796. Body.fromObject = function fromObject(object) {
  797. if (object instanceof $root.type.googleapis.com.FillsPbMsg.Body)
  798. return object;
  799. var message = new $root.type.googleapis.com.FillsPbMsg.Body();
  800. if (object.price != null)
  801. message.price = String(object.price);
  802. if (object.amount != null)
  803. message.amount = String(object.amount);
  804. if (object.side != null)
  805. message.side = String(object.side);
  806. if (object.createddate != null)
  807. if ($util.Long)
  808. (message.createddate = $util.Long.fromValue(object.createddate)).unsigned = false;
  809. else if (typeof object.createddate === "string")
  810. message.createddate = parseInt(object.createddate, 10);
  811. else if (typeof object.createddate === "number")
  812. message.createddate = object.createddate;
  813. else if (typeof object.createddate === "object")
  814. message.createddate = new $util.LongBits(object.createddate.low >>> 0, object.createddate.high >>> 0).toNumber();
  815. if (object.id != null)
  816. if ($util.Long)
  817. (message.id = $util.Long.fromValue(object.id)).unsigned = false;
  818. else if (typeof object.id === "string")
  819. message.id = parseInt(object.id, 10);
  820. else if (typeof object.id === "number")
  821. message.id = object.id;
  822. else if (typeof object.id === "object")
  823. message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber();
  824. return message;
  825. };
  826. /**
  827. * Creates a plain object from a Body message. Also converts values to other types if specified.
  828. * @function toObject
  829. * @memberof type.googleapis.com.FillsPbMsg.Body
  830. * @static
  831. * @param {type.googleapis.com.FillsPbMsg.Body} message Body
  832. * @param {$protobuf.IConversionOptions} [options] Conversion options
  833. * @returns {Object.<string,*>} Plain object
  834. */
  835. Body.toObject = function toObject(message, options) {
  836. if (!options)
  837. options = {};
  838. var object = {};
  839. if (options.defaults) {
  840. object.price = "";
  841. object.amount = "";
  842. object.side = "";
  843. if ($util.Long) {
  844. var long = new $util.Long(0, 0, false);
  845. object.createddate = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  846. } else
  847. object.createddate = options.longs === String ? "0" : 0;
  848. if ($util.Long) {
  849. var long = new $util.Long(0, 0, false);
  850. object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  851. } else
  852. object.id = options.longs === String ? "0" : 0;
  853. }
  854. if (message.price != null && message.hasOwnProperty("price"))
  855. object.price = message.price;
  856. if (message.amount != null && message.hasOwnProperty("amount"))
  857. object.amount = message.amount;
  858. if (message.side != null && message.hasOwnProperty("side"))
  859. object.side = message.side;
  860. if (message.createddate != null && message.hasOwnProperty("createddate"))
  861. if (typeof message.createddate === "number")
  862. object.createddate = options.longs === String ? String(message.createddate) : message.createddate;
  863. else
  864. object.createddate = options.longs === String ? $util.Long.prototype.toString.call(message.createddate) : options.longs === Number ? new $util.LongBits(message.createddate.low >>> 0, message.createddate.high >>> 0).toNumber() : message.createddate;
  865. if (message.id != null && message.hasOwnProperty("id"))
  866. if (typeof message.id === "number")
  867. object.id = options.longs === String ? String(message.id) : message.id;
  868. else
  869. object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id;
  870. return object;
  871. };
  872. /**
  873. * Converts this Body to JSON.
  874. * @function toJSON
  875. * @memberof type.googleapis.com.FillsPbMsg.Body
  876. * @instance
  877. * @returns {Object.<string,*>} JSON object
  878. */
  879. Body.prototype.toJSON = function toJSON() {
  880. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  881. };
  882. /**
  883. * Gets the default type url for Body
  884. * @function getTypeUrl
  885. * @memberof type.googleapis.com.FillsPbMsg.Body
  886. * @static
  887. * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
  888. * @returns {string} The default type url
  889. */
  890. Body.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
  891. if (typeUrlPrefix === undefined) {
  892. typeUrlPrefix = "type.googleapis.com";
  893. }
  894. return typeUrlPrefix + "/type.googleapis.com.FillsPbMsg.Body";
  895. };
  896. return Body;
  897. })();
  898. return FillsPbMsg;
  899. })();
  900. return com;
  901. })();
  902. return googleapis;
  903. })();
  904. return type;
  905. })();
  906. module.exports = $root;