type.googleapis.com.CommonPbMsg.js 29 KB

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