api.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993
  1. // source: google/protobuf/api.proto
  2. /**
  3. * @fileoverview
  4. * @enhanceable
  5. * @suppress {missingRequire} reports error on implicit type usages.
  6. * @suppress {messageConventions} JS Compiler reports an error if a variable or
  7. * field starts with 'MSG_' and isn't a translatable message.
  8. * @public
  9. */
  10. // GENERATED CODE -- DO NOT EDIT!
  11. /* eslint-disable */
  12. // @ts-nocheck
  13. goog.provide('proto.google.protobuf.Api');
  14. goog.provide('proto.google.protobuf.Method');
  15. goog.provide('proto.google.protobuf.Mixin');
  16. goog.require('jspb.BinaryReader');
  17. goog.require('jspb.BinaryWriter');
  18. goog.require('jspb.Message');
  19. goog.require('proto.google.protobuf.Option');
  20. goog.require('proto.google.protobuf.SourceContext');
  21. goog.forwardDeclare('proto.google.protobuf.Syntax');
  22. /**
  23. * Generated by JsPbCodeGenerator.
  24. * @param {Array=} opt_data Optional initial data array, typically from a
  25. * server response, or constructed directly in Javascript. The array is used
  26. * in place and becomes part of the constructed object. It is not cloned.
  27. * If no data is provided, the constructed object will be empty, but still
  28. * valid.
  29. * @extends {jspb.Message}
  30. * @constructor
  31. */
  32. proto.google.protobuf.Api = function(opt_data) {
  33. jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.Api.repeatedFields_, null);
  34. };
  35. goog.inherits(proto.google.protobuf.Api, jspb.Message);
  36. if (goog.DEBUG && !COMPILED) {
  37. /**
  38. * @public
  39. * @override
  40. */
  41. proto.google.protobuf.Api.displayName = 'proto.google.protobuf.Api';
  42. }
  43. /**
  44. * Generated by JsPbCodeGenerator.
  45. * @param {Array=} opt_data Optional initial data array, typically from a
  46. * server response, or constructed directly in Javascript. The array is used
  47. * in place and becomes part of the constructed object. It is not cloned.
  48. * If no data is provided, the constructed object will be empty, but still
  49. * valid.
  50. * @extends {jspb.Message}
  51. * @constructor
  52. */
  53. proto.google.protobuf.Method = function(opt_data) {
  54. jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.Method.repeatedFields_, null);
  55. };
  56. goog.inherits(proto.google.protobuf.Method, jspb.Message);
  57. if (goog.DEBUG && !COMPILED) {
  58. /**
  59. * @public
  60. * @override
  61. */
  62. proto.google.protobuf.Method.displayName = 'proto.google.protobuf.Method';
  63. }
  64. /**
  65. * Generated by JsPbCodeGenerator.
  66. * @param {Array=} opt_data Optional initial data array, typically from a
  67. * server response, or constructed directly in Javascript. The array is used
  68. * in place and becomes part of the constructed object. It is not cloned.
  69. * If no data is provided, the constructed object will be empty, but still
  70. * valid.
  71. * @extends {jspb.Message}
  72. * @constructor
  73. */
  74. proto.google.protobuf.Mixin = function(opt_data) {
  75. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  76. };
  77. goog.inherits(proto.google.protobuf.Mixin, jspb.Message);
  78. if (goog.DEBUG && !COMPILED) {
  79. /**
  80. * @public
  81. * @override
  82. */
  83. proto.google.protobuf.Mixin.displayName = 'proto.google.protobuf.Mixin';
  84. }
  85. /**
  86. * List of repeated fields within this message type.
  87. * @private {!Array<number>}
  88. * @const
  89. */
  90. proto.google.protobuf.Api.repeatedFields_ = [2,3,6];
  91. if (jspb.Message.GENERATE_TO_OBJECT) {
  92. /**
  93. * Creates an object representation of this proto.
  94. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  95. * Optional fields that are not set will be set to undefined.
  96. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  97. * For the list of reserved names please see:
  98. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  99. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  100. * JSPB instance for transitional soy proto support:
  101. * http://goto/soy-param-migration
  102. * @return {!Object}
  103. */
  104. proto.google.protobuf.Api.prototype.toObject = function(opt_includeInstance) {
  105. return proto.google.protobuf.Api.toObject(opt_includeInstance, this);
  106. };
  107. /**
  108. * Static version of the {@see toObject} method.
  109. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  110. * the JSPB instance for transitional soy proto support:
  111. * http://goto/soy-param-migration
  112. * @param {!proto.google.protobuf.Api} msg The msg instance to transform.
  113. * @return {!Object}
  114. * @suppress {unusedLocalVariables} f is only used for nested messages
  115. */
  116. proto.google.protobuf.Api.toObject = function(includeInstance, msg) {
  117. var f, obj = {
  118. name: jspb.Message.getFieldWithDefault(msg, 1, ""),
  119. methodsList: jspb.Message.toObjectList(msg.getMethodsList(),
  120. proto.google.protobuf.Method.toObject, includeInstance),
  121. optionsList: jspb.Message.toObjectList(msg.getOptionsList(),
  122. proto.google.protobuf.Option.toObject, includeInstance),
  123. version: jspb.Message.getFieldWithDefault(msg, 4, ""),
  124. sourceContext: (f = msg.getSourceContext()) && proto.google.protobuf.SourceContext.toObject(includeInstance, f),
  125. mixinsList: jspb.Message.toObjectList(msg.getMixinsList(),
  126. proto.google.protobuf.Mixin.toObject, includeInstance),
  127. syntax: jspb.Message.getFieldWithDefault(msg, 7, 0)
  128. };
  129. if (includeInstance) {
  130. obj.$jspbMessageInstance = msg;
  131. }
  132. return obj;
  133. };
  134. }
  135. /**
  136. * Deserializes binary data (in protobuf wire format).
  137. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  138. * @return {!proto.google.protobuf.Api}
  139. */
  140. proto.google.protobuf.Api.deserializeBinary = function(bytes) {
  141. var reader = new jspb.BinaryReader(bytes);
  142. var msg = new proto.google.protobuf.Api;
  143. return proto.google.protobuf.Api.deserializeBinaryFromReader(msg, reader);
  144. };
  145. /**
  146. * Deserializes binary data (in protobuf wire format) from the
  147. * given reader into the given message object.
  148. * @param {!proto.google.protobuf.Api} msg The message object to deserialize into.
  149. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  150. * @return {!proto.google.protobuf.Api}
  151. */
  152. proto.google.protobuf.Api.deserializeBinaryFromReader = function(msg, reader) {
  153. while (reader.nextField()) {
  154. if (reader.isEndGroup()) {
  155. break;
  156. }
  157. var field = reader.getFieldNumber();
  158. switch (field) {
  159. case 1:
  160. var value = /** @type {string} */ (reader.readString());
  161. msg.setName(value);
  162. break;
  163. case 2:
  164. var value = new proto.google.protobuf.Method;
  165. reader.readMessage(value,proto.google.protobuf.Method.deserializeBinaryFromReader);
  166. msg.addMethods(value);
  167. break;
  168. case 3:
  169. var value = new proto.google.protobuf.Option;
  170. reader.readMessage(value,proto.google.protobuf.Option.deserializeBinaryFromReader);
  171. msg.addOptions(value);
  172. break;
  173. case 4:
  174. var value = /** @type {string} */ (reader.readString());
  175. msg.setVersion(value);
  176. break;
  177. case 5:
  178. var value = new proto.google.protobuf.SourceContext;
  179. reader.readMessage(value,proto.google.protobuf.SourceContext.deserializeBinaryFromReader);
  180. msg.setSourceContext(value);
  181. break;
  182. case 6:
  183. var value = new proto.google.protobuf.Mixin;
  184. reader.readMessage(value,proto.google.protobuf.Mixin.deserializeBinaryFromReader);
  185. msg.addMixins(value);
  186. break;
  187. case 7:
  188. var value = /** @type {!proto.google.protobuf.Syntax} */ (reader.readEnum());
  189. msg.setSyntax(value);
  190. break;
  191. default:
  192. reader.skipField();
  193. break;
  194. }
  195. }
  196. return msg;
  197. };
  198. /**
  199. * Serializes the message to binary data (in protobuf wire format).
  200. * @return {!Uint8Array}
  201. */
  202. proto.google.protobuf.Api.prototype.serializeBinary = function() {
  203. var writer = new jspb.BinaryWriter();
  204. proto.google.protobuf.Api.serializeBinaryToWriter(this, writer);
  205. return writer.getResultBuffer();
  206. };
  207. /**
  208. * Serializes the given message to binary data (in protobuf wire
  209. * format), writing to the given BinaryWriter.
  210. * @param {!proto.google.protobuf.Api} message
  211. * @param {!jspb.BinaryWriter} writer
  212. * @suppress {unusedLocalVariables} f is only used for nested messages
  213. */
  214. proto.google.protobuf.Api.serializeBinaryToWriter = function(message, writer) {
  215. var f = undefined;
  216. f = message.getName();
  217. if (f.length > 0) {
  218. writer.writeString(
  219. 1,
  220. f
  221. );
  222. }
  223. f = message.getMethodsList();
  224. if (f.length > 0) {
  225. writer.writeRepeatedMessage(
  226. 2,
  227. f,
  228. proto.google.protobuf.Method.serializeBinaryToWriter
  229. );
  230. }
  231. f = message.getOptionsList();
  232. if (f.length > 0) {
  233. writer.writeRepeatedMessage(
  234. 3,
  235. f,
  236. proto.google.protobuf.Option.serializeBinaryToWriter
  237. );
  238. }
  239. f = message.getVersion();
  240. if (f.length > 0) {
  241. writer.writeString(
  242. 4,
  243. f
  244. );
  245. }
  246. f = message.getSourceContext();
  247. if (f != null) {
  248. writer.writeMessage(
  249. 5,
  250. f,
  251. proto.google.protobuf.SourceContext.serializeBinaryToWriter
  252. );
  253. }
  254. f = message.getMixinsList();
  255. if (f.length > 0) {
  256. writer.writeRepeatedMessage(
  257. 6,
  258. f,
  259. proto.google.protobuf.Mixin.serializeBinaryToWriter
  260. );
  261. }
  262. f = message.getSyntax();
  263. if (f !== 0.0) {
  264. writer.writeEnum(
  265. 7,
  266. f
  267. );
  268. }
  269. };
  270. /**
  271. * optional string name = 1;
  272. * @return {string}
  273. */
  274. proto.google.protobuf.Api.prototype.getName = function() {
  275. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  276. };
  277. /**
  278. * @param {string} value
  279. * @return {!proto.google.protobuf.Api} returns this
  280. */
  281. proto.google.protobuf.Api.prototype.setName = function(value) {
  282. return jspb.Message.setProto3StringField(this, 1, value);
  283. };
  284. /**
  285. * repeated Method methods = 2;
  286. * @return {!Array<!proto.google.protobuf.Method>}
  287. */
  288. proto.google.protobuf.Api.prototype.getMethodsList = function() {
  289. return /** @type{!Array<!proto.google.protobuf.Method>} */ (
  290. jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Method, 2));
  291. };
  292. /**
  293. * @param {!Array<!proto.google.protobuf.Method>} value
  294. * @return {!proto.google.protobuf.Api} returns this
  295. */
  296. proto.google.protobuf.Api.prototype.setMethodsList = function(value) {
  297. return jspb.Message.setRepeatedWrapperField(this, 2, value);
  298. };
  299. /**
  300. * @param {!proto.google.protobuf.Method=} opt_value
  301. * @param {number=} opt_index
  302. * @return {!proto.google.protobuf.Method}
  303. */
  304. proto.google.protobuf.Api.prototype.addMethods = function(opt_value, opt_index) {
  305. return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.google.protobuf.Method, opt_index);
  306. };
  307. /**
  308. * Clears the list making it empty but non-null.
  309. * @return {!proto.google.protobuf.Api} returns this
  310. */
  311. proto.google.protobuf.Api.prototype.clearMethodsList = function() {
  312. return this.setMethodsList([]);
  313. };
  314. /**
  315. * repeated Option options = 3;
  316. * @return {!Array<!proto.google.protobuf.Option>}
  317. */
  318. proto.google.protobuf.Api.prototype.getOptionsList = function() {
  319. return /** @type{!Array<!proto.google.protobuf.Option>} */ (
  320. jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Option, 3));
  321. };
  322. /**
  323. * @param {!Array<!proto.google.protobuf.Option>} value
  324. * @return {!proto.google.protobuf.Api} returns this
  325. */
  326. proto.google.protobuf.Api.prototype.setOptionsList = function(value) {
  327. return jspb.Message.setRepeatedWrapperField(this, 3, value);
  328. };
  329. /**
  330. * @param {!proto.google.protobuf.Option=} opt_value
  331. * @param {number=} opt_index
  332. * @return {!proto.google.protobuf.Option}
  333. */
  334. proto.google.protobuf.Api.prototype.addOptions = function(opt_value, opt_index) {
  335. return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.protobuf.Option, opt_index);
  336. };
  337. /**
  338. * Clears the list making it empty but non-null.
  339. * @return {!proto.google.protobuf.Api} returns this
  340. */
  341. proto.google.protobuf.Api.prototype.clearOptionsList = function() {
  342. return this.setOptionsList([]);
  343. };
  344. /**
  345. * optional string version = 4;
  346. * @return {string}
  347. */
  348. proto.google.protobuf.Api.prototype.getVersion = function() {
  349. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
  350. };
  351. /**
  352. * @param {string} value
  353. * @return {!proto.google.protobuf.Api} returns this
  354. */
  355. proto.google.protobuf.Api.prototype.setVersion = function(value) {
  356. return jspb.Message.setProto3StringField(this, 4, value);
  357. };
  358. /**
  359. * optional SourceContext source_context = 5;
  360. * @return {?proto.google.protobuf.SourceContext}
  361. */
  362. proto.google.protobuf.Api.prototype.getSourceContext = function() {
  363. return /** @type{?proto.google.protobuf.SourceContext} */ (
  364. jspb.Message.getWrapperField(this, proto.google.protobuf.SourceContext, 5));
  365. };
  366. /**
  367. * @param {?proto.google.protobuf.SourceContext|undefined} value
  368. * @return {!proto.google.protobuf.Api} returns this
  369. */
  370. proto.google.protobuf.Api.prototype.setSourceContext = function(value) {
  371. return jspb.Message.setWrapperField(this, 5, value);
  372. };
  373. /**
  374. * Clears the message field making it undefined.
  375. * @return {!proto.google.protobuf.Api} returns this
  376. */
  377. proto.google.protobuf.Api.prototype.clearSourceContext = function() {
  378. return this.setSourceContext(undefined);
  379. };
  380. /**
  381. * Returns whether this field is set.
  382. * @return {boolean}
  383. */
  384. proto.google.protobuf.Api.prototype.hasSourceContext = function() {
  385. return jspb.Message.getField(this, 5) != null;
  386. };
  387. /**
  388. * repeated Mixin mixins = 6;
  389. * @return {!Array<!proto.google.protobuf.Mixin>}
  390. */
  391. proto.google.protobuf.Api.prototype.getMixinsList = function() {
  392. return /** @type{!Array<!proto.google.protobuf.Mixin>} */ (
  393. jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Mixin, 6));
  394. };
  395. /**
  396. * @param {!Array<!proto.google.protobuf.Mixin>} value
  397. * @return {!proto.google.protobuf.Api} returns this
  398. */
  399. proto.google.protobuf.Api.prototype.setMixinsList = function(value) {
  400. return jspb.Message.setRepeatedWrapperField(this, 6, value);
  401. };
  402. /**
  403. * @param {!proto.google.protobuf.Mixin=} opt_value
  404. * @param {number=} opt_index
  405. * @return {!proto.google.protobuf.Mixin}
  406. */
  407. proto.google.protobuf.Api.prototype.addMixins = function(opt_value, opt_index) {
  408. return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.google.protobuf.Mixin, opt_index);
  409. };
  410. /**
  411. * Clears the list making it empty but non-null.
  412. * @return {!proto.google.protobuf.Api} returns this
  413. */
  414. proto.google.protobuf.Api.prototype.clearMixinsList = function() {
  415. return this.setMixinsList([]);
  416. };
  417. /**
  418. * optional Syntax syntax = 7;
  419. * @return {!proto.google.protobuf.Syntax}
  420. */
  421. proto.google.protobuf.Api.prototype.getSyntax = function() {
  422. return /** @type {!proto.google.protobuf.Syntax} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
  423. };
  424. /**
  425. * @param {!proto.google.protobuf.Syntax} value
  426. * @return {!proto.google.protobuf.Api} returns this
  427. */
  428. proto.google.protobuf.Api.prototype.setSyntax = function(value) {
  429. return jspb.Message.setProto3EnumField(this, 7, value);
  430. };
  431. /**
  432. * List of repeated fields within this message type.
  433. * @private {!Array<number>}
  434. * @const
  435. */
  436. proto.google.protobuf.Method.repeatedFields_ = [6];
  437. if (jspb.Message.GENERATE_TO_OBJECT) {
  438. /**
  439. * Creates an object representation of this proto.
  440. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  441. * Optional fields that are not set will be set to undefined.
  442. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  443. * For the list of reserved names please see:
  444. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  445. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  446. * JSPB instance for transitional soy proto support:
  447. * http://goto/soy-param-migration
  448. * @return {!Object}
  449. */
  450. proto.google.protobuf.Method.prototype.toObject = function(opt_includeInstance) {
  451. return proto.google.protobuf.Method.toObject(opt_includeInstance, this);
  452. };
  453. /**
  454. * Static version of the {@see toObject} method.
  455. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  456. * the JSPB instance for transitional soy proto support:
  457. * http://goto/soy-param-migration
  458. * @param {!proto.google.protobuf.Method} msg The msg instance to transform.
  459. * @return {!Object}
  460. * @suppress {unusedLocalVariables} f is only used for nested messages
  461. */
  462. proto.google.protobuf.Method.toObject = function(includeInstance, msg) {
  463. var f, obj = {
  464. name: jspb.Message.getFieldWithDefault(msg, 1, ""),
  465. requestTypeUrl: jspb.Message.getFieldWithDefault(msg, 2, ""),
  466. requestStreaming: jspb.Message.getBooleanFieldWithDefault(msg, 3, false),
  467. responseTypeUrl: jspb.Message.getFieldWithDefault(msg, 4, ""),
  468. responseStreaming: jspb.Message.getBooleanFieldWithDefault(msg, 5, false),
  469. optionsList: jspb.Message.toObjectList(msg.getOptionsList(),
  470. proto.google.protobuf.Option.toObject, includeInstance),
  471. syntax: jspb.Message.getFieldWithDefault(msg, 7, 0)
  472. };
  473. if (includeInstance) {
  474. obj.$jspbMessageInstance = msg;
  475. }
  476. return obj;
  477. };
  478. }
  479. /**
  480. * Deserializes binary data (in protobuf wire format).
  481. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  482. * @return {!proto.google.protobuf.Method}
  483. */
  484. proto.google.protobuf.Method.deserializeBinary = function(bytes) {
  485. var reader = new jspb.BinaryReader(bytes);
  486. var msg = new proto.google.protobuf.Method;
  487. return proto.google.protobuf.Method.deserializeBinaryFromReader(msg, reader);
  488. };
  489. /**
  490. * Deserializes binary data (in protobuf wire format) from the
  491. * given reader into the given message object.
  492. * @param {!proto.google.protobuf.Method} msg The message object to deserialize into.
  493. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  494. * @return {!proto.google.protobuf.Method}
  495. */
  496. proto.google.protobuf.Method.deserializeBinaryFromReader = function(msg, reader) {
  497. while (reader.nextField()) {
  498. if (reader.isEndGroup()) {
  499. break;
  500. }
  501. var field = reader.getFieldNumber();
  502. switch (field) {
  503. case 1:
  504. var value = /** @type {string} */ (reader.readString());
  505. msg.setName(value);
  506. break;
  507. case 2:
  508. var value = /** @type {string} */ (reader.readString());
  509. msg.setRequestTypeUrl(value);
  510. break;
  511. case 3:
  512. var value = /** @type {boolean} */ (reader.readBool());
  513. msg.setRequestStreaming(value);
  514. break;
  515. case 4:
  516. var value = /** @type {string} */ (reader.readString());
  517. msg.setResponseTypeUrl(value);
  518. break;
  519. case 5:
  520. var value = /** @type {boolean} */ (reader.readBool());
  521. msg.setResponseStreaming(value);
  522. break;
  523. case 6:
  524. var value = new proto.google.protobuf.Option;
  525. reader.readMessage(value,proto.google.protobuf.Option.deserializeBinaryFromReader);
  526. msg.addOptions(value);
  527. break;
  528. case 7:
  529. var value = /** @type {!proto.google.protobuf.Syntax} */ (reader.readEnum());
  530. msg.setSyntax(value);
  531. break;
  532. default:
  533. reader.skipField();
  534. break;
  535. }
  536. }
  537. return msg;
  538. };
  539. /**
  540. * Serializes the message to binary data (in protobuf wire format).
  541. * @return {!Uint8Array}
  542. */
  543. proto.google.protobuf.Method.prototype.serializeBinary = function() {
  544. var writer = new jspb.BinaryWriter();
  545. proto.google.protobuf.Method.serializeBinaryToWriter(this, writer);
  546. return writer.getResultBuffer();
  547. };
  548. /**
  549. * Serializes the given message to binary data (in protobuf wire
  550. * format), writing to the given BinaryWriter.
  551. * @param {!proto.google.protobuf.Method} message
  552. * @param {!jspb.BinaryWriter} writer
  553. * @suppress {unusedLocalVariables} f is only used for nested messages
  554. */
  555. proto.google.protobuf.Method.serializeBinaryToWriter = function(message, writer) {
  556. var f = undefined;
  557. f = message.getName();
  558. if (f.length > 0) {
  559. writer.writeString(
  560. 1,
  561. f
  562. );
  563. }
  564. f = message.getRequestTypeUrl();
  565. if (f.length > 0) {
  566. writer.writeString(
  567. 2,
  568. f
  569. );
  570. }
  571. f = message.getRequestStreaming();
  572. if (f) {
  573. writer.writeBool(
  574. 3,
  575. f
  576. );
  577. }
  578. f = message.getResponseTypeUrl();
  579. if (f.length > 0) {
  580. writer.writeString(
  581. 4,
  582. f
  583. );
  584. }
  585. f = message.getResponseStreaming();
  586. if (f) {
  587. writer.writeBool(
  588. 5,
  589. f
  590. );
  591. }
  592. f = message.getOptionsList();
  593. if (f.length > 0) {
  594. writer.writeRepeatedMessage(
  595. 6,
  596. f,
  597. proto.google.protobuf.Option.serializeBinaryToWriter
  598. );
  599. }
  600. f = message.getSyntax();
  601. if (f !== 0.0) {
  602. writer.writeEnum(
  603. 7,
  604. f
  605. );
  606. }
  607. };
  608. /**
  609. * optional string name = 1;
  610. * @return {string}
  611. */
  612. proto.google.protobuf.Method.prototype.getName = function() {
  613. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  614. };
  615. /**
  616. * @param {string} value
  617. * @return {!proto.google.protobuf.Method} returns this
  618. */
  619. proto.google.protobuf.Method.prototype.setName = function(value) {
  620. return jspb.Message.setProto3StringField(this, 1, value);
  621. };
  622. /**
  623. * optional string request_type_url = 2;
  624. * @return {string}
  625. */
  626. proto.google.protobuf.Method.prototype.getRequestTypeUrl = function() {
  627. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
  628. };
  629. /**
  630. * @param {string} value
  631. * @return {!proto.google.protobuf.Method} returns this
  632. */
  633. proto.google.protobuf.Method.prototype.setRequestTypeUrl = function(value) {
  634. return jspb.Message.setProto3StringField(this, 2, value);
  635. };
  636. /**
  637. * optional bool request_streaming = 3;
  638. * @return {boolean}
  639. */
  640. proto.google.protobuf.Method.prototype.getRequestStreaming = function() {
  641. return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
  642. };
  643. /**
  644. * @param {boolean} value
  645. * @return {!proto.google.protobuf.Method} returns this
  646. */
  647. proto.google.protobuf.Method.prototype.setRequestStreaming = function(value) {
  648. return jspb.Message.setProto3BooleanField(this, 3, value);
  649. };
  650. /**
  651. * optional string response_type_url = 4;
  652. * @return {string}
  653. */
  654. proto.google.protobuf.Method.prototype.getResponseTypeUrl = function() {
  655. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
  656. };
  657. /**
  658. * @param {string} value
  659. * @return {!proto.google.protobuf.Method} returns this
  660. */
  661. proto.google.protobuf.Method.prototype.setResponseTypeUrl = function(value) {
  662. return jspb.Message.setProto3StringField(this, 4, value);
  663. };
  664. /**
  665. * optional bool response_streaming = 5;
  666. * @return {boolean}
  667. */
  668. proto.google.protobuf.Method.prototype.getResponseStreaming = function() {
  669. return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false));
  670. };
  671. /**
  672. * @param {boolean} value
  673. * @return {!proto.google.protobuf.Method} returns this
  674. */
  675. proto.google.protobuf.Method.prototype.setResponseStreaming = function(value) {
  676. return jspb.Message.setProto3BooleanField(this, 5, value);
  677. };
  678. /**
  679. * repeated Option options = 6;
  680. * @return {!Array<!proto.google.protobuf.Option>}
  681. */
  682. proto.google.protobuf.Method.prototype.getOptionsList = function() {
  683. return /** @type{!Array<!proto.google.protobuf.Option>} */ (
  684. jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Option, 6));
  685. };
  686. /**
  687. * @param {!Array<!proto.google.protobuf.Option>} value
  688. * @return {!proto.google.protobuf.Method} returns this
  689. */
  690. proto.google.protobuf.Method.prototype.setOptionsList = function(value) {
  691. return jspb.Message.setRepeatedWrapperField(this, 6, value);
  692. };
  693. /**
  694. * @param {!proto.google.protobuf.Option=} opt_value
  695. * @param {number=} opt_index
  696. * @return {!proto.google.protobuf.Option}
  697. */
  698. proto.google.protobuf.Method.prototype.addOptions = function(opt_value, opt_index) {
  699. return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.google.protobuf.Option, opt_index);
  700. };
  701. /**
  702. * Clears the list making it empty but non-null.
  703. * @return {!proto.google.protobuf.Method} returns this
  704. */
  705. proto.google.protobuf.Method.prototype.clearOptionsList = function() {
  706. return this.setOptionsList([]);
  707. };
  708. /**
  709. * optional Syntax syntax = 7;
  710. * @return {!proto.google.protobuf.Syntax}
  711. */
  712. proto.google.protobuf.Method.prototype.getSyntax = function() {
  713. return /** @type {!proto.google.protobuf.Syntax} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
  714. };
  715. /**
  716. * @param {!proto.google.protobuf.Syntax} value
  717. * @return {!proto.google.protobuf.Method} returns this
  718. */
  719. proto.google.protobuf.Method.prototype.setSyntax = function(value) {
  720. return jspb.Message.setProto3EnumField(this, 7, value);
  721. };
  722. if (jspb.Message.GENERATE_TO_OBJECT) {
  723. /**
  724. * Creates an object representation of this proto.
  725. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  726. * Optional fields that are not set will be set to undefined.
  727. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  728. * For the list of reserved names please see:
  729. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  730. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  731. * JSPB instance for transitional soy proto support:
  732. * http://goto/soy-param-migration
  733. * @return {!Object}
  734. */
  735. proto.google.protobuf.Mixin.prototype.toObject = function(opt_includeInstance) {
  736. return proto.google.protobuf.Mixin.toObject(opt_includeInstance, this);
  737. };
  738. /**
  739. * Static version of the {@see toObject} method.
  740. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  741. * the JSPB instance for transitional soy proto support:
  742. * http://goto/soy-param-migration
  743. * @param {!proto.google.protobuf.Mixin} msg The msg instance to transform.
  744. * @return {!Object}
  745. * @suppress {unusedLocalVariables} f is only used for nested messages
  746. */
  747. proto.google.protobuf.Mixin.toObject = function(includeInstance, msg) {
  748. var f, obj = {
  749. name: jspb.Message.getFieldWithDefault(msg, 1, ""),
  750. root: jspb.Message.getFieldWithDefault(msg, 2, "")
  751. };
  752. if (includeInstance) {
  753. obj.$jspbMessageInstance = msg;
  754. }
  755. return obj;
  756. };
  757. }
  758. /**
  759. * Deserializes binary data (in protobuf wire format).
  760. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  761. * @return {!proto.google.protobuf.Mixin}
  762. */
  763. proto.google.protobuf.Mixin.deserializeBinary = function(bytes) {
  764. var reader = new jspb.BinaryReader(bytes);
  765. var msg = new proto.google.protobuf.Mixin;
  766. return proto.google.protobuf.Mixin.deserializeBinaryFromReader(msg, reader);
  767. };
  768. /**
  769. * Deserializes binary data (in protobuf wire format) from the
  770. * given reader into the given message object.
  771. * @param {!proto.google.protobuf.Mixin} msg The message object to deserialize into.
  772. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  773. * @return {!proto.google.protobuf.Mixin}
  774. */
  775. proto.google.protobuf.Mixin.deserializeBinaryFromReader = function(msg, reader) {
  776. while (reader.nextField()) {
  777. if (reader.isEndGroup()) {
  778. break;
  779. }
  780. var field = reader.getFieldNumber();
  781. switch (field) {
  782. case 1:
  783. var value = /** @type {string} */ (reader.readString());
  784. msg.setName(value);
  785. break;
  786. case 2:
  787. var value = /** @type {string} */ (reader.readString());
  788. msg.setRoot(value);
  789. break;
  790. default:
  791. reader.skipField();
  792. break;
  793. }
  794. }
  795. return msg;
  796. };
  797. /**
  798. * Serializes the message to binary data (in protobuf wire format).
  799. * @return {!Uint8Array}
  800. */
  801. proto.google.protobuf.Mixin.prototype.serializeBinary = function() {
  802. var writer = new jspb.BinaryWriter();
  803. proto.google.protobuf.Mixin.serializeBinaryToWriter(this, writer);
  804. return writer.getResultBuffer();
  805. };
  806. /**
  807. * Serializes the given message to binary data (in protobuf wire
  808. * format), writing to the given BinaryWriter.
  809. * @param {!proto.google.protobuf.Mixin} message
  810. * @param {!jspb.BinaryWriter} writer
  811. * @suppress {unusedLocalVariables} f is only used for nested messages
  812. */
  813. proto.google.protobuf.Mixin.serializeBinaryToWriter = function(message, writer) {
  814. var f = undefined;
  815. f = message.getName();
  816. if (f.length > 0) {
  817. writer.writeString(
  818. 1,
  819. f
  820. );
  821. }
  822. f = message.getRoot();
  823. if (f.length > 0) {
  824. writer.writeString(
  825. 2,
  826. f
  827. );
  828. }
  829. };
  830. /**
  831. * optional string name = 1;
  832. * @return {string}
  833. */
  834. proto.google.protobuf.Mixin.prototype.getName = function() {
  835. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  836. };
  837. /**
  838. * @param {string} value
  839. * @return {!proto.google.protobuf.Mixin} returns this
  840. */
  841. proto.google.protobuf.Mixin.prototype.setName = function(value) {
  842. return jspb.Message.setProto3StringField(this, 1, value);
  843. };
  844. /**
  845. * optional string root = 2;
  846. * @return {string}
  847. */
  848. proto.google.protobuf.Mixin.prototype.getRoot = function() {
  849. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
  850. };
  851. /**
  852. * @param {string} value
  853. * @return {!proto.google.protobuf.Mixin} returns this
  854. */
  855. proto.google.protobuf.Mixin.prototype.setRoot = function(value) {
  856. return jspb.Message.setProto3StringField(this, 2, value);
  857. };