Source: proto/google/protobuf/type_pb.js

  1. // source: google/protobuf/type.proto
  2. /**
  3. * @fileoverview
  4. * @enhanceable
  5. * @suppress {messageConventions} JS Compiler reports an error if a variable or
  6. * field starts with 'MSG_' and isn't a translatable message.
  7. * @public
  8. */
  9. // GENERATED CODE -- DO NOT EDIT!
  10. var jspb = require('google-protobuf');
  11. var goog = jspb;
  12. var global = Function('return this')();
  13. var google_protobuf_any_pb = require('../../google/protobuf/any_pb.js');
  14. goog.object.extend(proto, google_protobuf_any_pb);
  15. var google_protobuf_source_context_pb = require('../../google/protobuf/source_context_pb.js');
  16. goog.object.extend(proto, google_protobuf_source_context_pb);
  17. goog.exportSymbol('proto.google.protobuf.Enum', null, global);
  18. goog.exportSymbol('proto.google.protobuf.EnumValue', null, global);
  19. goog.exportSymbol('proto.google.protobuf.Field', null, global);
  20. goog.exportSymbol('proto.google.protobuf.Field.Cardinality', null, global);
  21. goog.exportSymbol('proto.google.protobuf.Field.Kind', null, global);
  22. goog.exportSymbol('proto.google.protobuf.Option', null, global);
  23. goog.exportSymbol('proto.google.protobuf.Syntax', null, global);
  24. goog.exportSymbol('proto.google.protobuf.Type', null, global);
  25. /**
  26. * Generated by JsPbCodeGenerator.
  27. * @param {Array=} opt_data Optional initial data array, typically from a
  28. * server response, or constructed directly in Javascript. The array is used
  29. * in place and becomes part of the constructed object. It is not cloned.
  30. * If no data is provided, the constructed object will be empty, but still
  31. * valid.
  32. * @extends {jspb.Message}
  33. * @constructor
  34. */
  35. proto.google.protobuf.Type = function(opt_data) {
  36. jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.Type.repeatedFields_, null);
  37. };
  38. goog.inherits(proto.google.protobuf.Type, jspb.Message);
  39. if (goog.DEBUG && !COMPILED) {
  40. /**
  41. * @public
  42. * @override
  43. */
  44. proto.google.protobuf.Type.displayName = 'proto.google.protobuf.Type';
  45. }
  46. /**
  47. * Generated by JsPbCodeGenerator.
  48. * @param {Array=} opt_data Optional initial data array, typically from a
  49. * server response, or constructed directly in Javascript. The array is used
  50. * in place and becomes part of the constructed object. It is not cloned.
  51. * If no data is provided, the constructed object will be empty, but still
  52. * valid.
  53. * @extends {jspb.Message}
  54. * @constructor
  55. */
  56. proto.google.protobuf.Field = function(opt_data) {
  57. jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.Field.repeatedFields_, null);
  58. };
  59. goog.inherits(proto.google.protobuf.Field, jspb.Message);
  60. if (goog.DEBUG && !COMPILED) {
  61. /**
  62. * @public
  63. * @override
  64. */
  65. proto.google.protobuf.Field.displayName = 'proto.google.protobuf.Field';
  66. }
  67. /**
  68. * Generated by JsPbCodeGenerator.
  69. * @param {Array=} opt_data Optional initial data array, typically from a
  70. * server response, or constructed directly in Javascript. The array is used
  71. * in place and becomes part of the constructed object. It is not cloned.
  72. * If no data is provided, the constructed object will be empty, but still
  73. * valid.
  74. * @extends {jspb.Message}
  75. * @constructor
  76. */
  77. proto.google.protobuf.Enum = function(opt_data) {
  78. jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.Enum.repeatedFields_, null);
  79. };
  80. goog.inherits(proto.google.protobuf.Enum, jspb.Message);
  81. if (goog.DEBUG && !COMPILED) {
  82. /**
  83. * @public
  84. * @override
  85. */
  86. proto.google.protobuf.Enum.displayName = 'proto.google.protobuf.Enum';
  87. }
  88. /**
  89. * Generated by JsPbCodeGenerator.
  90. * @param {Array=} opt_data Optional initial data array, typically from a
  91. * server response, or constructed directly in Javascript. The array is used
  92. * in place and becomes part of the constructed object. It is not cloned.
  93. * If no data is provided, the constructed object will be empty, but still
  94. * valid.
  95. * @extends {jspb.Message}
  96. * @constructor
  97. */
  98. proto.google.protobuf.EnumValue = function(opt_data) {
  99. jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.EnumValue.repeatedFields_, null);
  100. };
  101. goog.inherits(proto.google.protobuf.EnumValue, jspb.Message);
  102. if (goog.DEBUG && !COMPILED) {
  103. /**
  104. * @public
  105. * @override
  106. */
  107. proto.google.protobuf.EnumValue.displayName = 'proto.google.protobuf.EnumValue';
  108. }
  109. /**
  110. * Generated by JsPbCodeGenerator.
  111. * @param {Array=} opt_data Optional initial data array, typically from a
  112. * server response, or constructed directly in Javascript. The array is used
  113. * in place and becomes part of the constructed object. It is not cloned.
  114. * If no data is provided, the constructed object will be empty, but still
  115. * valid.
  116. * @extends {jspb.Message}
  117. * @constructor
  118. */
  119. proto.google.protobuf.Option = function(opt_data) {
  120. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  121. };
  122. goog.inherits(proto.google.protobuf.Option, jspb.Message);
  123. if (goog.DEBUG && !COMPILED) {
  124. /**
  125. * @public
  126. * @override
  127. */
  128. proto.google.protobuf.Option.displayName = 'proto.google.protobuf.Option';
  129. }
  130. /**
  131. * List of repeated fields within this message type.
  132. * @private {!Array<number>}
  133. * @const
  134. */
  135. proto.google.protobuf.Type.repeatedFields_ = [2,3,4];
  136. if (jspb.Message.GENERATE_TO_OBJECT) {
  137. /**
  138. * Creates an object representation of this proto.
  139. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  140. * Optional fields that are not set will be set to undefined.
  141. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  142. * For the list of reserved names please see:
  143. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  144. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  145. * JSPB instance for transitional soy proto support:
  146. * http://goto/soy-param-migration
  147. * @return {!Object}
  148. */
  149. proto.google.protobuf.Type.prototype.toObject = function(opt_includeInstance) {
  150. return proto.google.protobuf.Type.toObject(opt_includeInstance, this);
  151. };
  152. /**
  153. * Static version of the {@see toObject} method.
  154. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  155. * the JSPB instance for transitional soy proto support:
  156. * http://goto/soy-param-migration
  157. * @param {!proto.google.protobuf.Type} msg The msg instance to transform.
  158. * @return {!Object}
  159. * @suppress {unusedLocalVariables} f is only used for nested messages
  160. */
  161. proto.google.protobuf.Type.toObject = function(includeInstance, msg) {
  162. var f, obj = {
  163. name: jspb.Message.getFieldWithDefault(msg, 1, ""),
  164. fieldsList: jspb.Message.toObjectList(msg.getFieldsList(),
  165. proto.google.protobuf.Field.toObject, includeInstance),
  166. oneofsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
  167. optionsList: jspb.Message.toObjectList(msg.getOptionsList(),
  168. proto.google.protobuf.Option.toObject, includeInstance),
  169. sourceContext: (f = msg.getSourceContext()) && google_protobuf_source_context_pb.SourceContext.toObject(includeInstance, f),
  170. syntax: jspb.Message.getFieldWithDefault(msg, 6, 0)
  171. };
  172. if (includeInstance) {
  173. obj.$jspbMessageInstance = msg;
  174. }
  175. return obj;
  176. };
  177. }
  178. /**
  179. * Deserializes binary data (in protobuf wire format).
  180. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  181. * @return {!proto.google.protobuf.Type}
  182. */
  183. proto.google.protobuf.Type.deserializeBinary = function(bytes) {
  184. var reader = new jspb.BinaryReader(bytes);
  185. var msg = new proto.google.protobuf.Type;
  186. return proto.google.protobuf.Type.deserializeBinaryFromReader(msg, reader);
  187. };
  188. /**
  189. * Deserializes binary data (in protobuf wire format) from the
  190. * given reader into the given message object.
  191. * @param {!proto.google.protobuf.Type} msg The message object to deserialize into.
  192. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  193. * @return {!proto.google.protobuf.Type}
  194. */
  195. proto.google.protobuf.Type.deserializeBinaryFromReader = function(msg, reader) {
  196. while (reader.nextField()) {
  197. if (reader.isEndGroup()) {
  198. break;
  199. }
  200. var field = reader.getFieldNumber();
  201. switch (field) {
  202. case 1:
  203. var value = /** @type {string} */ (reader.readString());
  204. msg.setName(value);
  205. break;
  206. case 2:
  207. var value = new proto.google.protobuf.Field;
  208. reader.readMessage(value,proto.google.protobuf.Field.deserializeBinaryFromReader);
  209. msg.addFields(value);
  210. break;
  211. case 3:
  212. var value = /** @type {string} */ (reader.readString());
  213. msg.addOneofs(value);
  214. break;
  215. case 4:
  216. var value = new proto.google.protobuf.Option;
  217. reader.readMessage(value,proto.google.protobuf.Option.deserializeBinaryFromReader);
  218. msg.addOptions(value);
  219. break;
  220. case 5:
  221. var value = new google_protobuf_source_context_pb.SourceContext;
  222. reader.readMessage(value,google_protobuf_source_context_pb.SourceContext.deserializeBinaryFromReader);
  223. msg.setSourceContext(value);
  224. break;
  225. case 6:
  226. var value = /** @type {!proto.google.protobuf.Syntax} */ (reader.readEnum());
  227. msg.setSyntax(value);
  228. break;
  229. default:
  230. reader.skipField();
  231. break;
  232. }
  233. }
  234. return msg;
  235. };
  236. /**
  237. * Serializes the message to binary data (in protobuf wire format).
  238. * @return {!Uint8Array}
  239. */
  240. proto.google.protobuf.Type.prototype.serializeBinary = function() {
  241. var writer = new jspb.BinaryWriter();
  242. proto.google.protobuf.Type.serializeBinaryToWriter(this, writer);
  243. return writer.getResultBuffer();
  244. };
  245. /**
  246. * Serializes the given message to binary data (in protobuf wire
  247. * format), writing to the given BinaryWriter.
  248. * @param {!proto.google.protobuf.Type} message
  249. * @param {!jspb.BinaryWriter} writer
  250. * @suppress {unusedLocalVariables} f is only used for nested messages
  251. */
  252. proto.google.protobuf.Type.serializeBinaryToWriter = function(message, writer) {
  253. var f = undefined;
  254. f = message.getName();
  255. if (f.length > 0) {
  256. writer.writeString(
  257. 1,
  258. f
  259. );
  260. }
  261. f = message.getFieldsList();
  262. if (f.length > 0) {
  263. writer.writeRepeatedMessage(
  264. 2,
  265. f,
  266. proto.google.protobuf.Field.serializeBinaryToWriter
  267. );
  268. }
  269. f = message.getOneofsList();
  270. if (f.length > 0) {
  271. writer.writeRepeatedString(
  272. 3,
  273. f
  274. );
  275. }
  276. f = message.getOptionsList();
  277. if (f.length > 0) {
  278. writer.writeRepeatedMessage(
  279. 4,
  280. f,
  281. proto.google.protobuf.Option.serializeBinaryToWriter
  282. );
  283. }
  284. f = message.getSourceContext();
  285. if (f != null) {
  286. writer.writeMessage(
  287. 5,
  288. f,
  289. google_protobuf_source_context_pb.SourceContext.serializeBinaryToWriter
  290. );
  291. }
  292. f = message.getSyntax();
  293. if (f !== 0.0) {
  294. writer.writeEnum(
  295. 6,
  296. f
  297. );
  298. }
  299. };
  300. /**
  301. * optional string name = 1;
  302. * @return {string}
  303. */
  304. proto.google.protobuf.Type.prototype.getName = function() {
  305. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  306. };
  307. /**
  308. * @param {string} value
  309. * @return {!proto.google.protobuf.Type} returns this
  310. */
  311. proto.google.protobuf.Type.prototype.setName = function(value) {
  312. return jspb.Message.setProto3StringField(this, 1, value);
  313. };
  314. /**
  315. * repeated Field fields = 2;
  316. * @return {!Array<!proto.google.protobuf.Field>}
  317. */
  318. proto.google.protobuf.Type.prototype.getFieldsList = function() {
  319. return /** @type{!Array<!proto.google.protobuf.Field>} */ (
  320. jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Field, 2));
  321. };
  322. /**
  323. * @param {!Array<!proto.google.protobuf.Field>} value
  324. * @return {!proto.google.protobuf.Type} returns this
  325. */
  326. proto.google.protobuf.Type.prototype.setFieldsList = function(value) {
  327. return jspb.Message.setRepeatedWrapperField(this, 2, value);
  328. };
  329. /**
  330. * @param {!proto.google.protobuf.Field=} opt_value
  331. * @param {number=} opt_index
  332. * @return {!proto.google.protobuf.Field}
  333. */
  334. proto.google.protobuf.Type.prototype.addFields = function(opt_value, opt_index) {
  335. return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.google.protobuf.Field, opt_index);
  336. };
  337. /**
  338. * Clears the list making it empty but non-null.
  339. * @return {!proto.google.protobuf.Type} returns this
  340. */
  341. proto.google.protobuf.Type.prototype.clearFieldsList = function() {
  342. return this.setFieldsList([]);
  343. };
  344. /**
  345. * repeated string oneofs = 3;
  346. * @return {!Array<string>}
  347. */
  348. proto.google.protobuf.Type.prototype.getOneofsList = function() {
  349. return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3));
  350. };
  351. /**
  352. * @param {!Array<string>} value
  353. * @return {!proto.google.protobuf.Type} returns this
  354. */
  355. proto.google.protobuf.Type.prototype.setOneofsList = function(value) {
  356. return jspb.Message.setField(this, 3, value || []);
  357. };
  358. /**
  359. * @param {string} value
  360. * @param {number=} opt_index
  361. * @return {!proto.google.protobuf.Type} returns this
  362. */
  363. proto.google.protobuf.Type.prototype.addOneofs = function(value, opt_index) {
  364. return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
  365. };
  366. /**
  367. * Clears the list making it empty but non-null.
  368. * @return {!proto.google.protobuf.Type} returns this
  369. */
  370. proto.google.protobuf.Type.prototype.clearOneofsList = function() {
  371. return this.setOneofsList([]);
  372. };
  373. /**
  374. * repeated Option options = 4;
  375. * @return {!Array<!proto.google.protobuf.Option>}
  376. */
  377. proto.google.protobuf.Type.prototype.getOptionsList = function() {
  378. return /** @type{!Array<!proto.google.protobuf.Option>} */ (
  379. jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Option, 4));
  380. };
  381. /**
  382. * @param {!Array<!proto.google.protobuf.Option>} value
  383. * @return {!proto.google.protobuf.Type} returns this
  384. */
  385. proto.google.protobuf.Type.prototype.setOptionsList = function(value) {
  386. return jspb.Message.setRepeatedWrapperField(this, 4, value);
  387. };
  388. /**
  389. * @param {!proto.google.protobuf.Option=} opt_value
  390. * @param {number=} opt_index
  391. * @return {!proto.google.protobuf.Option}
  392. */
  393. proto.google.protobuf.Type.prototype.addOptions = function(opt_value, opt_index) {
  394. return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.google.protobuf.Option, opt_index);
  395. };
  396. /**
  397. * Clears the list making it empty but non-null.
  398. * @return {!proto.google.protobuf.Type} returns this
  399. */
  400. proto.google.protobuf.Type.prototype.clearOptionsList = function() {
  401. return this.setOptionsList([]);
  402. };
  403. /**
  404. * optional SourceContext source_context = 5;
  405. * @return {?proto.google.protobuf.SourceContext}
  406. */
  407. proto.google.protobuf.Type.prototype.getSourceContext = function() {
  408. return /** @type{?proto.google.protobuf.SourceContext} */ (
  409. jspb.Message.getWrapperField(this, google_protobuf_source_context_pb.SourceContext, 5));
  410. };
  411. /**
  412. * @param {?proto.google.protobuf.SourceContext|undefined} value
  413. * @return {!proto.google.protobuf.Type} returns this
  414. */
  415. proto.google.protobuf.Type.prototype.setSourceContext = function(value) {
  416. return jspb.Message.setWrapperField(this, 5, value);
  417. };
  418. /**
  419. * Clears the message field making it undefined.
  420. * @return {!proto.google.protobuf.Type} returns this
  421. */
  422. proto.google.protobuf.Type.prototype.clearSourceContext = function() {
  423. return this.setSourceContext(undefined);
  424. };
  425. /**
  426. * Returns whether this field is set.
  427. * @return {boolean}
  428. */
  429. proto.google.protobuf.Type.prototype.hasSourceContext = function() {
  430. return jspb.Message.getField(this, 5) != null;
  431. };
  432. /**
  433. * optional Syntax syntax = 6;
  434. * @return {!proto.google.protobuf.Syntax}
  435. */
  436. proto.google.protobuf.Type.prototype.getSyntax = function() {
  437. return /** @type {!proto.google.protobuf.Syntax} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
  438. };
  439. /**
  440. * @param {!proto.google.protobuf.Syntax} value
  441. * @return {!proto.google.protobuf.Type} returns this
  442. */
  443. proto.google.protobuf.Type.prototype.setSyntax = function(value) {
  444. return jspb.Message.setProto3EnumField(this, 6, value);
  445. };
  446. /**
  447. * List of repeated fields within this message type.
  448. * @private {!Array<number>}
  449. * @const
  450. */
  451. proto.google.protobuf.Field.repeatedFields_ = [9];
  452. if (jspb.Message.GENERATE_TO_OBJECT) {
  453. /**
  454. * Creates an object representation of this proto.
  455. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  456. * Optional fields that are not set will be set to undefined.
  457. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  458. * For the list of reserved names please see:
  459. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  460. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  461. * JSPB instance for transitional soy proto support:
  462. * http://goto/soy-param-migration
  463. * @return {!Object}
  464. */
  465. proto.google.protobuf.Field.prototype.toObject = function(opt_includeInstance) {
  466. return proto.google.protobuf.Field.toObject(opt_includeInstance, this);
  467. };
  468. /**
  469. * Static version of the {@see toObject} method.
  470. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  471. * the JSPB instance for transitional soy proto support:
  472. * http://goto/soy-param-migration
  473. * @param {!proto.google.protobuf.Field} msg The msg instance to transform.
  474. * @return {!Object}
  475. * @suppress {unusedLocalVariables} f is only used for nested messages
  476. */
  477. proto.google.protobuf.Field.toObject = function(includeInstance, msg) {
  478. var f, obj = {
  479. kind: jspb.Message.getFieldWithDefault(msg, 1, 0),
  480. cardinality: jspb.Message.getFieldWithDefault(msg, 2, 0),
  481. number: jspb.Message.getFieldWithDefault(msg, 3, 0),
  482. name: jspb.Message.getFieldWithDefault(msg, 4, ""),
  483. typeUrl: jspb.Message.getFieldWithDefault(msg, 6, ""),
  484. oneofIndex: jspb.Message.getFieldWithDefault(msg, 7, 0),
  485. packed: jspb.Message.getBooleanFieldWithDefault(msg, 8, false),
  486. optionsList: jspb.Message.toObjectList(msg.getOptionsList(),
  487. proto.google.protobuf.Option.toObject, includeInstance),
  488. jsonName: jspb.Message.getFieldWithDefault(msg, 10, ""),
  489. defaultValue: jspb.Message.getFieldWithDefault(msg, 11, "")
  490. };
  491. if (includeInstance) {
  492. obj.$jspbMessageInstance = msg;
  493. }
  494. return obj;
  495. };
  496. }
  497. /**
  498. * Deserializes binary data (in protobuf wire format).
  499. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  500. * @return {!proto.google.protobuf.Field}
  501. */
  502. proto.google.protobuf.Field.deserializeBinary = function(bytes) {
  503. var reader = new jspb.BinaryReader(bytes);
  504. var msg = new proto.google.protobuf.Field;
  505. return proto.google.protobuf.Field.deserializeBinaryFromReader(msg, reader);
  506. };
  507. /**
  508. * Deserializes binary data (in protobuf wire format) from the
  509. * given reader into the given message object.
  510. * @param {!proto.google.protobuf.Field} msg The message object to deserialize into.
  511. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  512. * @return {!proto.google.protobuf.Field}
  513. */
  514. proto.google.protobuf.Field.deserializeBinaryFromReader = function(msg, reader) {
  515. while (reader.nextField()) {
  516. if (reader.isEndGroup()) {
  517. break;
  518. }
  519. var field = reader.getFieldNumber();
  520. switch (field) {
  521. case 1:
  522. var value = /** @type {!proto.google.protobuf.Field.Kind} */ (reader.readEnum());
  523. msg.setKind(value);
  524. break;
  525. case 2:
  526. var value = /** @type {!proto.google.protobuf.Field.Cardinality} */ (reader.readEnum());
  527. msg.setCardinality(value);
  528. break;
  529. case 3:
  530. var value = /** @type {number} */ (reader.readInt32());
  531. msg.setNumber(value);
  532. break;
  533. case 4:
  534. var value = /** @type {string} */ (reader.readString());
  535. msg.setName(value);
  536. break;
  537. case 6:
  538. var value = /** @type {string} */ (reader.readString());
  539. msg.setTypeUrl(value);
  540. break;
  541. case 7:
  542. var value = /** @type {number} */ (reader.readInt32());
  543. msg.setOneofIndex(value);
  544. break;
  545. case 8:
  546. var value = /** @type {boolean} */ (reader.readBool());
  547. msg.setPacked(value);
  548. break;
  549. case 9:
  550. var value = new proto.google.protobuf.Option;
  551. reader.readMessage(value,proto.google.protobuf.Option.deserializeBinaryFromReader);
  552. msg.addOptions(value);
  553. break;
  554. case 10:
  555. var value = /** @type {string} */ (reader.readString());
  556. msg.setJsonName(value);
  557. break;
  558. case 11:
  559. var value = /** @type {string} */ (reader.readString());
  560. msg.setDefaultValue(value);
  561. break;
  562. default:
  563. reader.skipField();
  564. break;
  565. }
  566. }
  567. return msg;
  568. };
  569. /**
  570. * Serializes the message to binary data (in protobuf wire format).
  571. * @return {!Uint8Array}
  572. */
  573. proto.google.protobuf.Field.prototype.serializeBinary = function() {
  574. var writer = new jspb.BinaryWriter();
  575. proto.google.protobuf.Field.serializeBinaryToWriter(this, writer);
  576. return writer.getResultBuffer();
  577. };
  578. /**
  579. * Serializes the given message to binary data (in protobuf wire
  580. * format), writing to the given BinaryWriter.
  581. * @param {!proto.google.protobuf.Field} message
  582. * @param {!jspb.BinaryWriter} writer
  583. * @suppress {unusedLocalVariables} f is only used for nested messages
  584. */
  585. proto.google.protobuf.Field.serializeBinaryToWriter = function(message, writer) {
  586. var f = undefined;
  587. f = message.getKind();
  588. if (f !== 0.0) {
  589. writer.writeEnum(
  590. 1,
  591. f
  592. );
  593. }
  594. f = message.getCardinality();
  595. if (f !== 0.0) {
  596. writer.writeEnum(
  597. 2,
  598. f
  599. );
  600. }
  601. f = message.getNumber();
  602. if (f !== 0) {
  603. writer.writeInt32(
  604. 3,
  605. f
  606. );
  607. }
  608. f = message.getName();
  609. if (f.length > 0) {
  610. writer.writeString(
  611. 4,
  612. f
  613. );
  614. }
  615. f = message.getTypeUrl();
  616. if (f.length > 0) {
  617. writer.writeString(
  618. 6,
  619. f
  620. );
  621. }
  622. f = message.getOneofIndex();
  623. if (f !== 0) {
  624. writer.writeInt32(
  625. 7,
  626. f
  627. );
  628. }
  629. f = message.getPacked();
  630. if (f) {
  631. writer.writeBool(
  632. 8,
  633. f
  634. );
  635. }
  636. f = message.getOptionsList();
  637. if (f.length > 0) {
  638. writer.writeRepeatedMessage(
  639. 9,
  640. f,
  641. proto.google.protobuf.Option.serializeBinaryToWriter
  642. );
  643. }
  644. f = message.getJsonName();
  645. if (f.length > 0) {
  646. writer.writeString(
  647. 10,
  648. f
  649. );
  650. }
  651. f = message.getDefaultValue();
  652. if (f.length > 0) {
  653. writer.writeString(
  654. 11,
  655. f
  656. );
  657. }
  658. };
  659. /**
  660. * @enum {number}
  661. */
  662. proto.google.protobuf.Field.Kind = {
  663. TYPE_UNKNOWN: 0,
  664. TYPE_DOUBLE: 1,
  665. TYPE_FLOAT: 2,
  666. TYPE_INT64: 3,
  667. TYPE_UINT64: 4,
  668. TYPE_INT32: 5,
  669. TYPE_FIXED64: 6,
  670. TYPE_FIXED32: 7,
  671. TYPE_BOOL: 8,
  672. TYPE_STRING: 9,
  673. TYPE_GROUP: 10,
  674. TYPE_MESSAGE: 11,
  675. TYPE_BYTES: 12,
  676. TYPE_UINT32: 13,
  677. TYPE_ENUM: 14,
  678. TYPE_SFIXED32: 15,
  679. TYPE_SFIXED64: 16,
  680. TYPE_SINT32: 17,
  681. TYPE_SINT64: 18
  682. };
  683. /**
  684. * @enum {number}
  685. */
  686. proto.google.protobuf.Field.Cardinality = {
  687. CARDINALITY_UNKNOWN: 0,
  688. CARDINALITY_OPTIONAL: 1,
  689. CARDINALITY_REQUIRED: 2,
  690. CARDINALITY_REPEATED: 3
  691. };
  692. /**
  693. * optional Kind kind = 1;
  694. * @return {!proto.google.protobuf.Field.Kind}
  695. */
  696. proto.google.protobuf.Field.prototype.getKind = function() {
  697. return /** @type {!proto.google.protobuf.Field.Kind} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
  698. };
  699. /**
  700. * @param {!proto.google.protobuf.Field.Kind} value
  701. * @return {!proto.google.protobuf.Field} returns this
  702. */
  703. proto.google.protobuf.Field.prototype.setKind = function(value) {
  704. return jspb.Message.setProto3EnumField(this, 1, value);
  705. };
  706. /**
  707. * optional Cardinality cardinality = 2;
  708. * @return {!proto.google.protobuf.Field.Cardinality}
  709. */
  710. proto.google.protobuf.Field.prototype.getCardinality = function() {
  711. return /** @type {!proto.google.protobuf.Field.Cardinality} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
  712. };
  713. /**
  714. * @param {!proto.google.protobuf.Field.Cardinality} value
  715. * @return {!proto.google.protobuf.Field} returns this
  716. */
  717. proto.google.protobuf.Field.prototype.setCardinality = function(value) {
  718. return jspb.Message.setProto3EnumField(this, 2, value);
  719. };
  720. /**
  721. * optional int32 number = 3;
  722. * @return {number}
  723. */
  724. proto.google.protobuf.Field.prototype.getNumber = function() {
  725. return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
  726. };
  727. /**
  728. * @param {number} value
  729. * @return {!proto.google.protobuf.Field} returns this
  730. */
  731. proto.google.protobuf.Field.prototype.setNumber = function(value) {
  732. return jspb.Message.setProto3IntField(this, 3, value);
  733. };
  734. /**
  735. * optional string name = 4;
  736. * @return {string}
  737. */
  738. proto.google.protobuf.Field.prototype.getName = function() {
  739. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
  740. };
  741. /**
  742. * @param {string} value
  743. * @return {!proto.google.protobuf.Field} returns this
  744. */
  745. proto.google.protobuf.Field.prototype.setName = function(value) {
  746. return jspb.Message.setProto3StringField(this, 4, value);
  747. };
  748. /**
  749. * optional string type_url = 6;
  750. * @return {string}
  751. */
  752. proto.google.protobuf.Field.prototype.getTypeUrl = function() {
  753. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
  754. };
  755. /**
  756. * @param {string} value
  757. * @return {!proto.google.protobuf.Field} returns this
  758. */
  759. proto.google.protobuf.Field.prototype.setTypeUrl = function(value) {
  760. return jspb.Message.setProto3StringField(this, 6, value);
  761. };
  762. /**
  763. * optional int32 oneof_index = 7;
  764. * @return {number}
  765. */
  766. proto.google.protobuf.Field.prototype.getOneofIndex = function() {
  767. return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
  768. };
  769. /**
  770. * @param {number} value
  771. * @return {!proto.google.protobuf.Field} returns this
  772. */
  773. proto.google.protobuf.Field.prototype.setOneofIndex = function(value) {
  774. return jspb.Message.setProto3IntField(this, 7, value);
  775. };
  776. /**
  777. * optional bool packed = 8;
  778. * @return {boolean}
  779. */
  780. proto.google.protobuf.Field.prototype.getPacked = function() {
  781. return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false));
  782. };
  783. /**
  784. * @param {boolean} value
  785. * @return {!proto.google.protobuf.Field} returns this
  786. */
  787. proto.google.protobuf.Field.prototype.setPacked = function(value) {
  788. return jspb.Message.setProto3BooleanField(this, 8, value);
  789. };
  790. /**
  791. * repeated Option options = 9;
  792. * @return {!Array<!proto.google.protobuf.Option>}
  793. */
  794. proto.google.protobuf.Field.prototype.getOptionsList = function() {
  795. return /** @type{!Array<!proto.google.protobuf.Option>} */ (
  796. jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Option, 9));
  797. };
  798. /**
  799. * @param {!Array<!proto.google.protobuf.Option>} value
  800. * @return {!proto.google.protobuf.Field} returns this
  801. */
  802. proto.google.protobuf.Field.prototype.setOptionsList = function(value) {
  803. return jspb.Message.setRepeatedWrapperField(this, 9, value);
  804. };
  805. /**
  806. * @param {!proto.google.protobuf.Option=} opt_value
  807. * @param {number=} opt_index
  808. * @return {!proto.google.protobuf.Option}
  809. */
  810. proto.google.protobuf.Field.prototype.addOptions = function(opt_value, opt_index) {
  811. return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.google.protobuf.Option, opt_index);
  812. };
  813. /**
  814. * Clears the list making it empty but non-null.
  815. * @return {!proto.google.protobuf.Field} returns this
  816. */
  817. proto.google.protobuf.Field.prototype.clearOptionsList = function() {
  818. return this.setOptionsList([]);
  819. };
  820. /**
  821. * optional string json_name = 10;
  822. * @return {string}
  823. */
  824. proto.google.protobuf.Field.prototype.getJsonName = function() {
  825. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, ""));
  826. };
  827. /**
  828. * @param {string} value
  829. * @return {!proto.google.protobuf.Field} returns this
  830. */
  831. proto.google.protobuf.Field.prototype.setJsonName = function(value) {
  832. return jspb.Message.setProto3StringField(this, 10, value);
  833. };
  834. /**
  835. * optional string default_value = 11;
  836. * @return {string}
  837. */
  838. proto.google.protobuf.Field.prototype.getDefaultValue = function() {
  839. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, ""));
  840. };
  841. /**
  842. * @param {string} value
  843. * @return {!proto.google.protobuf.Field} returns this
  844. */
  845. proto.google.protobuf.Field.prototype.setDefaultValue = function(value) {
  846. return jspb.Message.setProto3StringField(this, 11, value);
  847. };
  848. /**
  849. * List of repeated fields within this message type.
  850. * @private {!Array<number>}
  851. * @const
  852. */
  853. proto.google.protobuf.Enum.repeatedFields_ = [2,3];
  854. if (jspb.Message.GENERATE_TO_OBJECT) {
  855. /**
  856. * Creates an object representation of this proto.
  857. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  858. * Optional fields that are not set will be set to undefined.
  859. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  860. * For the list of reserved names please see:
  861. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  862. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  863. * JSPB instance for transitional soy proto support:
  864. * http://goto/soy-param-migration
  865. * @return {!Object}
  866. */
  867. proto.google.protobuf.Enum.prototype.toObject = function(opt_includeInstance) {
  868. return proto.google.protobuf.Enum.toObject(opt_includeInstance, this);
  869. };
  870. /**
  871. * Static version of the {@see toObject} method.
  872. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  873. * the JSPB instance for transitional soy proto support:
  874. * http://goto/soy-param-migration
  875. * @param {!proto.google.protobuf.Enum} msg The msg instance to transform.
  876. * @return {!Object}
  877. * @suppress {unusedLocalVariables} f is only used for nested messages
  878. */
  879. proto.google.protobuf.Enum.toObject = function(includeInstance, msg) {
  880. var f, obj = {
  881. name: jspb.Message.getFieldWithDefault(msg, 1, ""),
  882. enumvalueList: jspb.Message.toObjectList(msg.getEnumvalueList(),
  883. proto.google.protobuf.EnumValue.toObject, includeInstance),
  884. optionsList: jspb.Message.toObjectList(msg.getOptionsList(),
  885. proto.google.protobuf.Option.toObject, includeInstance),
  886. sourceContext: (f = msg.getSourceContext()) && google_protobuf_source_context_pb.SourceContext.toObject(includeInstance, f),
  887. syntax: jspb.Message.getFieldWithDefault(msg, 5, 0)
  888. };
  889. if (includeInstance) {
  890. obj.$jspbMessageInstance = msg;
  891. }
  892. return obj;
  893. };
  894. }
  895. /**
  896. * Deserializes binary data (in protobuf wire format).
  897. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  898. * @return {!proto.google.protobuf.Enum}
  899. */
  900. proto.google.protobuf.Enum.deserializeBinary = function(bytes) {
  901. var reader = new jspb.BinaryReader(bytes);
  902. var msg = new proto.google.protobuf.Enum;
  903. return proto.google.protobuf.Enum.deserializeBinaryFromReader(msg, reader);
  904. };
  905. /**
  906. * Deserializes binary data (in protobuf wire format) from the
  907. * given reader into the given message object.
  908. * @param {!proto.google.protobuf.Enum} msg The message object to deserialize into.
  909. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  910. * @return {!proto.google.protobuf.Enum}
  911. */
  912. proto.google.protobuf.Enum.deserializeBinaryFromReader = function(msg, reader) {
  913. while (reader.nextField()) {
  914. if (reader.isEndGroup()) {
  915. break;
  916. }
  917. var field = reader.getFieldNumber();
  918. switch (field) {
  919. case 1:
  920. var value = /** @type {string} */ (reader.readString());
  921. msg.setName(value);
  922. break;
  923. case 2:
  924. var value = new proto.google.protobuf.EnumValue;
  925. reader.readMessage(value,proto.google.protobuf.EnumValue.deserializeBinaryFromReader);
  926. msg.addEnumvalue(value);
  927. break;
  928. case 3:
  929. var value = new proto.google.protobuf.Option;
  930. reader.readMessage(value,proto.google.protobuf.Option.deserializeBinaryFromReader);
  931. msg.addOptions(value);
  932. break;
  933. case 4:
  934. var value = new google_protobuf_source_context_pb.SourceContext;
  935. reader.readMessage(value,google_protobuf_source_context_pb.SourceContext.deserializeBinaryFromReader);
  936. msg.setSourceContext(value);
  937. break;
  938. case 5:
  939. var value = /** @type {!proto.google.protobuf.Syntax} */ (reader.readEnum());
  940. msg.setSyntax(value);
  941. break;
  942. default:
  943. reader.skipField();
  944. break;
  945. }
  946. }
  947. return msg;
  948. };
  949. /**
  950. * Serializes the message to binary data (in protobuf wire format).
  951. * @return {!Uint8Array}
  952. */
  953. proto.google.protobuf.Enum.prototype.serializeBinary = function() {
  954. var writer = new jspb.BinaryWriter();
  955. proto.google.protobuf.Enum.serializeBinaryToWriter(this, writer);
  956. return writer.getResultBuffer();
  957. };
  958. /**
  959. * Serializes the given message to binary data (in protobuf wire
  960. * format), writing to the given BinaryWriter.
  961. * @param {!proto.google.protobuf.Enum} message
  962. * @param {!jspb.BinaryWriter} writer
  963. * @suppress {unusedLocalVariables} f is only used for nested messages
  964. */
  965. proto.google.protobuf.Enum.serializeBinaryToWriter = function(message, writer) {
  966. var f = undefined;
  967. f = message.getName();
  968. if (f.length > 0) {
  969. writer.writeString(
  970. 1,
  971. f
  972. );
  973. }
  974. f = message.getEnumvalueList();
  975. if (f.length > 0) {
  976. writer.writeRepeatedMessage(
  977. 2,
  978. f,
  979. proto.google.protobuf.EnumValue.serializeBinaryToWriter
  980. );
  981. }
  982. f = message.getOptionsList();
  983. if (f.length > 0) {
  984. writer.writeRepeatedMessage(
  985. 3,
  986. f,
  987. proto.google.protobuf.Option.serializeBinaryToWriter
  988. );
  989. }
  990. f = message.getSourceContext();
  991. if (f != null) {
  992. writer.writeMessage(
  993. 4,
  994. f,
  995. google_protobuf_source_context_pb.SourceContext.serializeBinaryToWriter
  996. );
  997. }
  998. f = message.getSyntax();
  999. if (f !== 0.0) {
  1000. writer.writeEnum(
  1001. 5,
  1002. f
  1003. );
  1004. }
  1005. };
  1006. /**
  1007. * optional string name = 1;
  1008. * @return {string}
  1009. */
  1010. proto.google.protobuf.Enum.prototype.getName = function() {
  1011. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  1012. };
  1013. /**
  1014. * @param {string} value
  1015. * @return {!proto.google.protobuf.Enum} returns this
  1016. */
  1017. proto.google.protobuf.Enum.prototype.setName = function(value) {
  1018. return jspb.Message.setProto3StringField(this, 1, value);
  1019. };
  1020. /**
  1021. * repeated EnumValue enumvalue = 2;
  1022. * @return {!Array<!proto.google.protobuf.EnumValue>}
  1023. */
  1024. proto.google.protobuf.Enum.prototype.getEnumvalueList = function() {
  1025. return /** @type{!Array<!proto.google.protobuf.EnumValue>} */ (
  1026. jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.EnumValue, 2));
  1027. };
  1028. /**
  1029. * @param {!Array<!proto.google.protobuf.EnumValue>} value
  1030. * @return {!proto.google.protobuf.Enum} returns this
  1031. */
  1032. proto.google.protobuf.Enum.prototype.setEnumvalueList = function(value) {
  1033. return jspb.Message.setRepeatedWrapperField(this, 2, value);
  1034. };
  1035. /**
  1036. * @param {!proto.google.protobuf.EnumValue=} opt_value
  1037. * @param {number=} opt_index
  1038. * @return {!proto.google.protobuf.EnumValue}
  1039. */
  1040. proto.google.protobuf.Enum.prototype.addEnumvalue = function(opt_value, opt_index) {
  1041. return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.google.protobuf.EnumValue, opt_index);
  1042. };
  1043. /**
  1044. * Clears the list making it empty but non-null.
  1045. * @return {!proto.google.protobuf.Enum} returns this
  1046. */
  1047. proto.google.protobuf.Enum.prototype.clearEnumvalueList = function() {
  1048. return this.setEnumvalueList([]);
  1049. };
  1050. /**
  1051. * repeated Option options = 3;
  1052. * @return {!Array<!proto.google.protobuf.Option>}
  1053. */
  1054. proto.google.protobuf.Enum.prototype.getOptionsList = function() {
  1055. return /** @type{!Array<!proto.google.protobuf.Option>} */ (
  1056. jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Option, 3));
  1057. };
  1058. /**
  1059. * @param {!Array<!proto.google.protobuf.Option>} value
  1060. * @return {!proto.google.protobuf.Enum} returns this
  1061. */
  1062. proto.google.protobuf.Enum.prototype.setOptionsList = function(value) {
  1063. return jspb.Message.setRepeatedWrapperField(this, 3, value);
  1064. };
  1065. /**
  1066. * @param {!proto.google.protobuf.Option=} opt_value
  1067. * @param {number=} opt_index
  1068. * @return {!proto.google.protobuf.Option}
  1069. */
  1070. proto.google.protobuf.Enum.prototype.addOptions = function(opt_value, opt_index) {
  1071. return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.protobuf.Option, opt_index);
  1072. };
  1073. /**
  1074. * Clears the list making it empty but non-null.
  1075. * @return {!proto.google.protobuf.Enum} returns this
  1076. */
  1077. proto.google.protobuf.Enum.prototype.clearOptionsList = function() {
  1078. return this.setOptionsList([]);
  1079. };
  1080. /**
  1081. * optional SourceContext source_context = 4;
  1082. * @return {?proto.google.protobuf.SourceContext}
  1083. */
  1084. proto.google.protobuf.Enum.prototype.getSourceContext = function() {
  1085. return /** @type{?proto.google.protobuf.SourceContext} */ (
  1086. jspb.Message.getWrapperField(this, google_protobuf_source_context_pb.SourceContext, 4));
  1087. };
  1088. /**
  1089. * @param {?proto.google.protobuf.SourceContext|undefined} value
  1090. * @return {!proto.google.protobuf.Enum} returns this
  1091. */
  1092. proto.google.protobuf.Enum.prototype.setSourceContext = function(value) {
  1093. return jspb.Message.setWrapperField(this, 4, value);
  1094. };
  1095. /**
  1096. * Clears the message field making it undefined.
  1097. * @return {!proto.google.protobuf.Enum} returns this
  1098. */
  1099. proto.google.protobuf.Enum.prototype.clearSourceContext = function() {
  1100. return this.setSourceContext(undefined);
  1101. };
  1102. /**
  1103. * Returns whether this field is set.
  1104. * @return {boolean}
  1105. */
  1106. proto.google.protobuf.Enum.prototype.hasSourceContext = function() {
  1107. return jspb.Message.getField(this, 4) != null;
  1108. };
  1109. /**
  1110. * optional Syntax syntax = 5;
  1111. * @return {!proto.google.protobuf.Syntax}
  1112. */
  1113. proto.google.protobuf.Enum.prototype.getSyntax = function() {
  1114. return /** @type {!proto.google.protobuf.Syntax} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
  1115. };
  1116. /**
  1117. * @param {!proto.google.protobuf.Syntax} value
  1118. * @return {!proto.google.protobuf.Enum} returns this
  1119. */
  1120. proto.google.protobuf.Enum.prototype.setSyntax = function(value) {
  1121. return jspb.Message.setProto3EnumField(this, 5, value);
  1122. };
  1123. /**
  1124. * List of repeated fields within this message type.
  1125. * @private {!Array<number>}
  1126. * @const
  1127. */
  1128. proto.google.protobuf.EnumValue.repeatedFields_ = [3];
  1129. if (jspb.Message.GENERATE_TO_OBJECT) {
  1130. /**
  1131. * Creates an object representation of this proto.
  1132. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  1133. * Optional fields that are not set will be set to undefined.
  1134. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  1135. * For the list of reserved names please see:
  1136. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  1137. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  1138. * JSPB instance for transitional soy proto support:
  1139. * http://goto/soy-param-migration
  1140. * @return {!Object}
  1141. */
  1142. proto.google.protobuf.EnumValue.prototype.toObject = function(opt_includeInstance) {
  1143. return proto.google.protobuf.EnumValue.toObject(opt_includeInstance, this);
  1144. };
  1145. /**
  1146. * Static version of the {@see toObject} method.
  1147. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  1148. * the JSPB instance for transitional soy proto support:
  1149. * http://goto/soy-param-migration
  1150. * @param {!proto.google.protobuf.EnumValue} msg The msg instance to transform.
  1151. * @return {!Object}
  1152. * @suppress {unusedLocalVariables} f is only used for nested messages
  1153. */
  1154. proto.google.protobuf.EnumValue.toObject = function(includeInstance, msg) {
  1155. var f, obj = {
  1156. name: jspb.Message.getFieldWithDefault(msg, 1, ""),
  1157. number: jspb.Message.getFieldWithDefault(msg, 2, 0),
  1158. optionsList: jspb.Message.toObjectList(msg.getOptionsList(),
  1159. proto.google.protobuf.Option.toObject, includeInstance)
  1160. };
  1161. if (includeInstance) {
  1162. obj.$jspbMessageInstance = msg;
  1163. }
  1164. return obj;
  1165. };
  1166. }
  1167. /**
  1168. * Deserializes binary data (in protobuf wire format).
  1169. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  1170. * @return {!proto.google.protobuf.EnumValue}
  1171. */
  1172. proto.google.protobuf.EnumValue.deserializeBinary = function(bytes) {
  1173. var reader = new jspb.BinaryReader(bytes);
  1174. var msg = new proto.google.protobuf.EnumValue;
  1175. return proto.google.protobuf.EnumValue.deserializeBinaryFromReader(msg, reader);
  1176. };
  1177. /**
  1178. * Deserializes binary data (in protobuf wire format) from the
  1179. * given reader into the given message object.
  1180. * @param {!proto.google.protobuf.EnumValue} msg The message object to deserialize into.
  1181. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  1182. * @return {!proto.google.protobuf.EnumValue}
  1183. */
  1184. proto.google.protobuf.EnumValue.deserializeBinaryFromReader = function(msg, reader) {
  1185. while (reader.nextField()) {
  1186. if (reader.isEndGroup()) {
  1187. break;
  1188. }
  1189. var field = reader.getFieldNumber();
  1190. switch (field) {
  1191. case 1:
  1192. var value = /** @type {string} */ (reader.readString());
  1193. msg.setName(value);
  1194. break;
  1195. case 2:
  1196. var value = /** @type {number} */ (reader.readInt32());
  1197. msg.setNumber(value);
  1198. break;
  1199. case 3:
  1200. var value = new proto.google.protobuf.Option;
  1201. reader.readMessage(value,proto.google.protobuf.Option.deserializeBinaryFromReader);
  1202. msg.addOptions(value);
  1203. break;
  1204. default:
  1205. reader.skipField();
  1206. break;
  1207. }
  1208. }
  1209. return msg;
  1210. };
  1211. /**
  1212. * Serializes the message to binary data (in protobuf wire format).
  1213. * @return {!Uint8Array}
  1214. */
  1215. proto.google.protobuf.EnumValue.prototype.serializeBinary = function() {
  1216. var writer = new jspb.BinaryWriter();
  1217. proto.google.protobuf.EnumValue.serializeBinaryToWriter(this, writer);
  1218. return writer.getResultBuffer();
  1219. };
  1220. /**
  1221. * Serializes the given message to binary data (in protobuf wire
  1222. * format), writing to the given BinaryWriter.
  1223. * @param {!proto.google.protobuf.EnumValue} message
  1224. * @param {!jspb.BinaryWriter} writer
  1225. * @suppress {unusedLocalVariables} f is only used for nested messages
  1226. */
  1227. proto.google.protobuf.EnumValue.serializeBinaryToWriter = function(message, writer) {
  1228. var f = undefined;
  1229. f = message.getName();
  1230. if (f.length > 0) {
  1231. writer.writeString(
  1232. 1,
  1233. f
  1234. );
  1235. }
  1236. f = message.getNumber();
  1237. if (f !== 0) {
  1238. writer.writeInt32(
  1239. 2,
  1240. f
  1241. );
  1242. }
  1243. f = message.getOptionsList();
  1244. if (f.length > 0) {
  1245. writer.writeRepeatedMessage(
  1246. 3,
  1247. f,
  1248. proto.google.protobuf.Option.serializeBinaryToWriter
  1249. );
  1250. }
  1251. };
  1252. /**
  1253. * optional string name = 1;
  1254. * @return {string}
  1255. */
  1256. proto.google.protobuf.EnumValue.prototype.getName = function() {
  1257. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  1258. };
  1259. /**
  1260. * @param {string} value
  1261. * @return {!proto.google.protobuf.EnumValue} returns this
  1262. */
  1263. proto.google.protobuf.EnumValue.prototype.setName = function(value) {
  1264. return jspb.Message.setProto3StringField(this, 1, value);
  1265. };
  1266. /**
  1267. * optional int32 number = 2;
  1268. * @return {number}
  1269. */
  1270. proto.google.protobuf.EnumValue.prototype.getNumber = function() {
  1271. return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
  1272. };
  1273. /**
  1274. * @param {number} value
  1275. * @return {!proto.google.protobuf.EnumValue} returns this
  1276. */
  1277. proto.google.protobuf.EnumValue.prototype.setNumber = function(value) {
  1278. return jspb.Message.setProto3IntField(this, 2, value);
  1279. };
  1280. /**
  1281. * repeated Option options = 3;
  1282. * @return {!Array<!proto.google.protobuf.Option>}
  1283. */
  1284. proto.google.protobuf.EnumValue.prototype.getOptionsList = function() {
  1285. return /** @type{!Array<!proto.google.protobuf.Option>} */ (
  1286. jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Option, 3));
  1287. };
  1288. /**
  1289. * @param {!Array<!proto.google.protobuf.Option>} value
  1290. * @return {!proto.google.protobuf.EnumValue} returns this
  1291. */
  1292. proto.google.protobuf.EnumValue.prototype.setOptionsList = function(value) {
  1293. return jspb.Message.setRepeatedWrapperField(this, 3, value);
  1294. };
  1295. /**
  1296. * @param {!proto.google.protobuf.Option=} opt_value
  1297. * @param {number=} opt_index
  1298. * @return {!proto.google.protobuf.Option}
  1299. */
  1300. proto.google.protobuf.EnumValue.prototype.addOptions = function(opt_value, opt_index) {
  1301. return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.protobuf.Option, opt_index);
  1302. };
  1303. /**
  1304. * Clears the list making it empty but non-null.
  1305. * @return {!proto.google.protobuf.EnumValue} returns this
  1306. */
  1307. proto.google.protobuf.EnumValue.prototype.clearOptionsList = function() {
  1308. return this.setOptionsList([]);
  1309. };
  1310. if (jspb.Message.GENERATE_TO_OBJECT) {
  1311. /**
  1312. * Creates an object representation of this proto.
  1313. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  1314. * Optional fields that are not set will be set to undefined.
  1315. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  1316. * For the list of reserved names please see:
  1317. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  1318. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  1319. * JSPB instance for transitional soy proto support:
  1320. * http://goto/soy-param-migration
  1321. * @return {!Object}
  1322. */
  1323. proto.google.protobuf.Option.prototype.toObject = function(opt_includeInstance) {
  1324. return proto.google.protobuf.Option.toObject(opt_includeInstance, this);
  1325. };
  1326. /**
  1327. * Static version of the {@see toObject} method.
  1328. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  1329. * the JSPB instance for transitional soy proto support:
  1330. * http://goto/soy-param-migration
  1331. * @param {!proto.google.protobuf.Option} msg The msg instance to transform.
  1332. * @return {!Object}
  1333. * @suppress {unusedLocalVariables} f is only used for nested messages
  1334. */
  1335. proto.google.protobuf.Option.toObject = function(includeInstance, msg) {
  1336. var f, obj = {
  1337. name: jspb.Message.getFieldWithDefault(msg, 1, ""),
  1338. value: (f = msg.getValue()) && google_protobuf_any_pb.Any.toObject(includeInstance, f)
  1339. };
  1340. if (includeInstance) {
  1341. obj.$jspbMessageInstance = msg;
  1342. }
  1343. return obj;
  1344. };
  1345. }
  1346. /**
  1347. * Deserializes binary data (in protobuf wire format).
  1348. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  1349. * @return {!proto.google.protobuf.Option}
  1350. */
  1351. proto.google.protobuf.Option.deserializeBinary = function(bytes) {
  1352. var reader = new jspb.BinaryReader(bytes);
  1353. var msg = new proto.google.protobuf.Option;
  1354. return proto.google.protobuf.Option.deserializeBinaryFromReader(msg, reader);
  1355. };
  1356. /**
  1357. * Deserializes binary data (in protobuf wire format) from the
  1358. * given reader into the given message object.
  1359. * @param {!proto.google.protobuf.Option} msg The message object to deserialize into.
  1360. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  1361. * @return {!proto.google.protobuf.Option}
  1362. */
  1363. proto.google.protobuf.Option.deserializeBinaryFromReader = function(msg, reader) {
  1364. while (reader.nextField()) {
  1365. if (reader.isEndGroup()) {
  1366. break;
  1367. }
  1368. var field = reader.getFieldNumber();
  1369. switch (field) {
  1370. case 1:
  1371. var value = /** @type {string} */ (reader.readString());
  1372. msg.setName(value);
  1373. break;
  1374. case 2:
  1375. var value = new google_protobuf_any_pb.Any;
  1376. reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
  1377. msg.setValue(value);
  1378. break;
  1379. default:
  1380. reader.skipField();
  1381. break;
  1382. }
  1383. }
  1384. return msg;
  1385. };
  1386. /**
  1387. * Serializes the message to binary data (in protobuf wire format).
  1388. * @return {!Uint8Array}
  1389. */
  1390. proto.google.protobuf.Option.prototype.serializeBinary = function() {
  1391. var writer = new jspb.BinaryWriter();
  1392. proto.google.protobuf.Option.serializeBinaryToWriter(this, writer);
  1393. return writer.getResultBuffer();
  1394. };
  1395. /**
  1396. * Serializes the given message to binary data (in protobuf wire
  1397. * format), writing to the given BinaryWriter.
  1398. * @param {!proto.google.protobuf.Option} message
  1399. * @param {!jspb.BinaryWriter} writer
  1400. * @suppress {unusedLocalVariables} f is only used for nested messages
  1401. */
  1402. proto.google.protobuf.Option.serializeBinaryToWriter = function(message, writer) {
  1403. var f = undefined;
  1404. f = message.getName();
  1405. if (f.length > 0) {
  1406. writer.writeString(
  1407. 1,
  1408. f
  1409. );
  1410. }
  1411. f = message.getValue();
  1412. if (f != null) {
  1413. writer.writeMessage(
  1414. 2,
  1415. f,
  1416. google_protobuf_any_pb.Any.serializeBinaryToWriter
  1417. );
  1418. }
  1419. };
  1420. /**
  1421. * optional string name = 1;
  1422. * @return {string}
  1423. */
  1424. proto.google.protobuf.Option.prototype.getName = function() {
  1425. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  1426. };
  1427. /**
  1428. * @param {string} value
  1429. * @return {!proto.google.protobuf.Option} returns this
  1430. */
  1431. proto.google.protobuf.Option.prototype.setName = function(value) {
  1432. return jspb.Message.setProto3StringField(this, 1, value);
  1433. };
  1434. /**
  1435. * optional Any value = 2;
  1436. * @return {?proto.google.protobuf.Any}
  1437. */
  1438. proto.google.protobuf.Option.prototype.getValue = function() {
  1439. return /** @type{?proto.google.protobuf.Any} */ (
  1440. jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2));
  1441. };
  1442. /**
  1443. * @param {?proto.google.protobuf.Any|undefined} value
  1444. * @return {!proto.google.protobuf.Option} returns this
  1445. */
  1446. proto.google.protobuf.Option.prototype.setValue = function(value) {
  1447. return jspb.Message.setWrapperField(this, 2, value);
  1448. };
  1449. /**
  1450. * Clears the message field making it undefined.
  1451. * @return {!proto.google.protobuf.Option} returns this
  1452. */
  1453. proto.google.protobuf.Option.prototype.clearValue = function() {
  1454. return this.setValue(undefined);
  1455. };
  1456. /**
  1457. * Returns whether this field is set.
  1458. * @return {boolean}
  1459. */
  1460. proto.google.protobuf.Option.prototype.hasValue = function() {
  1461. return jspb.Message.getField(this, 2) != null;
  1462. };
  1463. /**
  1464. * @enum {number}
  1465. */
  1466. proto.google.protobuf.Syntax = {
  1467. SYNTAX_PROTO2: 0,
  1468. SYNTAX_PROTO3: 1
  1469. };
  1470. goog.object.extend(exports, proto.google.protobuf);
  1471. // Generated by Spine ProtoJs Plugin
  1472. proto.google.protobuf.Field.typeUrl = function() {
  1473. return 'type.googleapis.com/google.protobuf.Field';
  1474. };
  1475. // Generated by Spine ProtoJs Plugin
  1476. proto.google.protobuf.Enum.typeUrl = function() {
  1477. return 'type.googleapis.com/google.protobuf.Enum';
  1478. };
  1479. // Generated by Spine ProtoJs Plugin
  1480. proto.google.protobuf.Type.typeUrl = function() {
  1481. return 'type.googleapis.com/google.protobuf.Type';
  1482. };
  1483. // Generated by Spine ProtoJs Plugin
  1484. proto.google.protobuf.Option.typeUrl = function() {
  1485. return 'type.googleapis.com/google.protobuf.Option';
  1486. };
  1487. // Generated by Spine ProtoJs Plugin
  1488. proto.google.protobuf.EnumValue.typeUrl = function() {
  1489. return 'type.googleapis.com/google.protobuf.EnumValue';
  1490. };
  1491. // Generated by Spine ProtoJs Plugin
  1492. proto.google.protobuf.Field.Kind.typeUrl = function() {
  1493. return 'type.googleapis.com/google.protobuf.Field.Kind';
  1494. };
  1495. // Generated by Spine ProtoJs Plugin
  1496. proto.google.protobuf.Syntax.typeUrl = function() {
  1497. return 'type.googleapis.com/google.protobuf.Syntax';
  1498. };
  1499. // Generated by Spine ProtoJs Plugin
  1500. proto.google.protobuf.Field.Cardinality.typeUrl = function() {
  1501. return 'type.googleapis.com/google.protobuf.Field.Cardinality';
  1502. };