Source: proto/spine/server/catchup/catch_up_pb.js

  1. // source: spine/server/catchup/catch_up.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 spine_options_pb = require('../../../spine/options_pb.js');
  14. goog.object.extend(proto, spine_options_pb);
  15. var spine_time_options_pb = require('../../../spine/time_options_pb.js');
  16. goog.object.extend(proto, spine_time_options_pb);
  17. var google_protobuf_any_pb = require('../../../google/protobuf/any_pb.js');
  18. goog.object.extend(proto, google_protobuf_any_pb);
  19. var google_protobuf_timestamp_pb = require('../../../google/protobuf/timestamp_pb.js');
  20. goog.object.extend(proto, google_protobuf_timestamp_pb);
  21. var spine_core_event_pb = require('../../../spine/core/event_pb.js');
  22. goog.object.extend(proto, spine_core_event_pb);
  23. goog.exportSymbol('proto.spine.server.catchup.CatchUp', null, global);
  24. goog.exportSymbol('proto.spine.server.catchup.CatchUp.Request', null, global);
  25. goog.exportSymbol('proto.spine.server.catchup.CatchUpId', null, global);
  26. goog.exportSymbol('proto.spine.server.catchup.CatchUpStatus', null, global);
  27. /**
  28. * Generated by JsPbCodeGenerator.
  29. * @param {Array=} opt_data Optional initial data array, typically from a
  30. * server response, or constructed directly in Javascript. The array is used
  31. * in place and becomes part of the constructed object. It is not cloned.
  32. * If no data is provided, the constructed object will be empty, but still
  33. * valid.
  34. * @extends {jspb.Message}
  35. * @constructor
  36. */
  37. proto.spine.server.catchup.CatchUp = function(opt_data) {
  38. jspb.Message.initialize(this, opt_data, 0, -1, proto.spine.server.catchup.CatchUp.repeatedFields_, null);
  39. };
  40. goog.inherits(proto.spine.server.catchup.CatchUp, jspb.Message);
  41. if (goog.DEBUG && !COMPILED) {
  42. /**
  43. * @public
  44. * @override
  45. */
  46. proto.spine.server.catchup.CatchUp.displayName = 'proto.spine.server.catchup.CatchUp';
  47. }
  48. /**
  49. * Generated by JsPbCodeGenerator.
  50. * @param {Array=} opt_data Optional initial data array, typically from a
  51. * server response, or constructed directly in Javascript. The array is used
  52. * in place and becomes part of the constructed object. It is not cloned.
  53. * If no data is provided, the constructed object will be empty, but still
  54. * valid.
  55. * @extends {jspb.Message}
  56. * @constructor
  57. */
  58. proto.spine.server.catchup.CatchUp.Request = function(opt_data) {
  59. jspb.Message.initialize(this, opt_data, 0, -1, proto.spine.server.catchup.CatchUp.Request.repeatedFields_, null);
  60. };
  61. goog.inherits(proto.spine.server.catchup.CatchUp.Request, jspb.Message);
  62. if (goog.DEBUG && !COMPILED) {
  63. /**
  64. * @public
  65. * @override
  66. */
  67. proto.spine.server.catchup.CatchUp.Request.displayName = 'proto.spine.server.catchup.CatchUp.Request';
  68. }
  69. /**
  70. * Generated by JsPbCodeGenerator.
  71. * @param {Array=} opt_data Optional initial data array, typically from a
  72. * server response, or constructed directly in Javascript. The array is used
  73. * in place and becomes part of the constructed object. It is not cloned.
  74. * If no data is provided, the constructed object will be empty, but still
  75. * valid.
  76. * @extends {jspb.Message}
  77. * @constructor
  78. */
  79. proto.spine.server.catchup.CatchUpId = function(opt_data) {
  80. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  81. };
  82. goog.inherits(proto.spine.server.catchup.CatchUpId, jspb.Message);
  83. if (goog.DEBUG && !COMPILED) {
  84. /**
  85. * @public
  86. * @override
  87. */
  88. proto.spine.server.catchup.CatchUpId.displayName = 'proto.spine.server.catchup.CatchUpId';
  89. }
  90. /**
  91. * List of repeated fields within this message type.
  92. * @private {!Array<number>}
  93. * @const
  94. */
  95. proto.spine.server.catchup.CatchUp.repeatedFields_ = [6];
  96. if (jspb.Message.GENERATE_TO_OBJECT) {
  97. /**
  98. * Creates an object representation of this proto.
  99. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  100. * Optional fields that are not set will be set to undefined.
  101. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  102. * For the list of reserved names please see:
  103. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  104. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  105. * JSPB instance for transitional soy proto support:
  106. * http://goto/soy-param-migration
  107. * @return {!Object}
  108. */
  109. proto.spine.server.catchup.CatchUp.prototype.toObject = function(opt_includeInstance) {
  110. return proto.spine.server.catchup.CatchUp.toObject(opt_includeInstance, this);
  111. };
  112. /**
  113. * Static version of the {@see toObject} method.
  114. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  115. * the JSPB instance for transitional soy proto support:
  116. * http://goto/soy-param-migration
  117. * @param {!proto.spine.server.catchup.CatchUp} msg The msg instance to transform.
  118. * @return {!Object}
  119. * @suppress {unusedLocalVariables} f is only used for nested messages
  120. */
  121. proto.spine.server.catchup.CatchUp.toObject = function(includeInstance, msg) {
  122. var f, obj = {
  123. id: (f = msg.getId()) && proto.spine.server.catchup.CatchUpId.toObject(includeInstance, f),
  124. request: (f = msg.getRequest()) && proto.spine.server.catchup.CatchUp.Request.toObject(includeInstance, f),
  125. whenLastRead: (f = msg.getWhenLastRead()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
  126. status: jspb.Message.getFieldWithDefault(msg, 4, 0),
  127. totalShards: jspb.Message.getFieldWithDefault(msg, 5, 0),
  128. affectedShardList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f
  129. };
  130. if (includeInstance) {
  131. obj.$jspbMessageInstance = msg;
  132. }
  133. return obj;
  134. };
  135. }
  136. /**
  137. * Deserializes binary data (in protobuf wire format).
  138. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  139. * @return {!proto.spine.server.catchup.CatchUp}
  140. */
  141. proto.spine.server.catchup.CatchUp.deserializeBinary = function(bytes) {
  142. var reader = new jspb.BinaryReader(bytes);
  143. var msg = new proto.spine.server.catchup.CatchUp;
  144. return proto.spine.server.catchup.CatchUp.deserializeBinaryFromReader(msg, reader);
  145. };
  146. /**
  147. * Deserializes binary data (in protobuf wire format) from the
  148. * given reader into the given message object.
  149. * @param {!proto.spine.server.catchup.CatchUp} msg The message object to deserialize into.
  150. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  151. * @return {!proto.spine.server.catchup.CatchUp}
  152. */
  153. proto.spine.server.catchup.CatchUp.deserializeBinaryFromReader = function(msg, reader) {
  154. while (reader.nextField()) {
  155. if (reader.isEndGroup()) {
  156. break;
  157. }
  158. var field = reader.getFieldNumber();
  159. switch (field) {
  160. case 1:
  161. var value = new proto.spine.server.catchup.CatchUpId;
  162. reader.readMessage(value,proto.spine.server.catchup.CatchUpId.deserializeBinaryFromReader);
  163. msg.setId(value);
  164. break;
  165. case 2:
  166. var value = new proto.spine.server.catchup.CatchUp.Request;
  167. reader.readMessage(value,proto.spine.server.catchup.CatchUp.Request.deserializeBinaryFromReader);
  168. msg.setRequest(value);
  169. break;
  170. case 3:
  171. var value = new google_protobuf_timestamp_pb.Timestamp;
  172. reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
  173. msg.setWhenLastRead(value);
  174. break;
  175. case 4:
  176. var value = /** @type {!proto.spine.server.catchup.CatchUpStatus} */ (reader.readEnum());
  177. msg.setStatus(value);
  178. break;
  179. case 5:
  180. var value = /** @type {number} */ (reader.readInt32());
  181. msg.setTotalShards(value);
  182. break;
  183. case 6:
  184. var value = /** @type {!Array<number>} */ (reader.readPackedInt32());
  185. msg.setAffectedShardList(value);
  186. break;
  187. default:
  188. reader.skipField();
  189. break;
  190. }
  191. }
  192. return msg;
  193. };
  194. /**
  195. * Serializes the message to binary data (in protobuf wire format).
  196. * @return {!Uint8Array}
  197. */
  198. proto.spine.server.catchup.CatchUp.prototype.serializeBinary = function() {
  199. var writer = new jspb.BinaryWriter();
  200. proto.spine.server.catchup.CatchUp.serializeBinaryToWriter(this, writer);
  201. return writer.getResultBuffer();
  202. };
  203. /**
  204. * Serializes the given message to binary data (in protobuf wire
  205. * format), writing to the given BinaryWriter.
  206. * @param {!proto.spine.server.catchup.CatchUp} message
  207. * @param {!jspb.BinaryWriter} writer
  208. * @suppress {unusedLocalVariables} f is only used for nested messages
  209. */
  210. proto.spine.server.catchup.CatchUp.serializeBinaryToWriter = function(message, writer) {
  211. var f = undefined;
  212. f = message.getId();
  213. if (f != null) {
  214. writer.writeMessage(
  215. 1,
  216. f,
  217. proto.spine.server.catchup.CatchUpId.serializeBinaryToWriter
  218. );
  219. }
  220. f = message.getRequest();
  221. if (f != null) {
  222. writer.writeMessage(
  223. 2,
  224. f,
  225. proto.spine.server.catchup.CatchUp.Request.serializeBinaryToWriter
  226. );
  227. }
  228. f = message.getWhenLastRead();
  229. if (f != null) {
  230. writer.writeMessage(
  231. 3,
  232. f,
  233. google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
  234. );
  235. }
  236. f = message.getStatus();
  237. if (f !== 0.0) {
  238. writer.writeEnum(
  239. 4,
  240. f
  241. );
  242. }
  243. f = message.getTotalShards();
  244. if (f !== 0) {
  245. writer.writeInt32(
  246. 5,
  247. f
  248. );
  249. }
  250. f = message.getAffectedShardList();
  251. if (f.length > 0) {
  252. writer.writePackedInt32(
  253. 6,
  254. f
  255. );
  256. }
  257. };
  258. /**
  259. * List of repeated fields within this message type.
  260. * @private {!Array<number>}
  261. * @const
  262. */
  263. proto.spine.server.catchup.CatchUp.Request.repeatedFields_ = [1,3];
  264. if (jspb.Message.GENERATE_TO_OBJECT) {
  265. /**
  266. * Creates an object representation of this proto.
  267. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  268. * Optional fields that are not set will be set to undefined.
  269. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  270. * For the list of reserved names please see:
  271. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  272. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  273. * JSPB instance for transitional soy proto support:
  274. * http://goto/soy-param-migration
  275. * @return {!Object}
  276. */
  277. proto.spine.server.catchup.CatchUp.Request.prototype.toObject = function(opt_includeInstance) {
  278. return proto.spine.server.catchup.CatchUp.Request.toObject(opt_includeInstance, this);
  279. };
  280. /**
  281. * Static version of the {@see toObject} method.
  282. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  283. * the JSPB instance for transitional soy proto support:
  284. * http://goto/soy-param-migration
  285. * @param {!proto.spine.server.catchup.CatchUp.Request} msg The msg instance to transform.
  286. * @return {!Object}
  287. * @suppress {unusedLocalVariables} f is only used for nested messages
  288. */
  289. proto.spine.server.catchup.CatchUp.Request.toObject = function(includeInstance, msg) {
  290. var f, obj = {
  291. targetList: jspb.Message.toObjectList(msg.getTargetList(),
  292. google_protobuf_any_pb.Any.toObject, includeInstance),
  293. sinceWhen: (f = msg.getSinceWhen()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
  294. eventTypeList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f
  295. };
  296. if (includeInstance) {
  297. obj.$jspbMessageInstance = msg;
  298. }
  299. return obj;
  300. };
  301. }
  302. /**
  303. * Deserializes binary data (in protobuf wire format).
  304. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  305. * @return {!proto.spine.server.catchup.CatchUp.Request}
  306. */
  307. proto.spine.server.catchup.CatchUp.Request.deserializeBinary = function(bytes) {
  308. var reader = new jspb.BinaryReader(bytes);
  309. var msg = new proto.spine.server.catchup.CatchUp.Request;
  310. return proto.spine.server.catchup.CatchUp.Request.deserializeBinaryFromReader(msg, reader);
  311. };
  312. /**
  313. * Deserializes binary data (in protobuf wire format) from the
  314. * given reader into the given message object.
  315. * @param {!proto.spine.server.catchup.CatchUp.Request} msg The message object to deserialize into.
  316. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  317. * @return {!proto.spine.server.catchup.CatchUp.Request}
  318. */
  319. proto.spine.server.catchup.CatchUp.Request.deserializeBinaryFromReader = function(msg, reader) {
  320. while (reader.nextField()) {
  321. if (reader.isEndGroup()) {
  322. break;
  323. }
  324. var field = reader.getFieldNumber();
  325. switch (field) {
  326. case 1:
  327. var value = new google_protobuf_any_pb.Any;
  328. reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
  329. msg.addTarget(value);
  330. break;
  331. case 2:
  332. var value = new google_protobuf_timestamp_pb.Timestamp;
  333. reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
  334. msg.setSinceWhen(value);
  335. break;
  336. case 3:
  337. var value = /** @type {string} */ (reader.readString());
  338. msg.addEventType(value);
  339. break;
  340. default:
  341. reader.skipField();
  342. break;
  343. }
  344. }
  345. return msg;
  346. };
  347. /**
  348. * Serializes the message to binary data (in protobuf wire format).
  349. * @return {!Uint8Array}
  350. */
  351. proto.spine.server.catchup.CatchUp.Request.prototype.serializeBinary = function() {
  352. var writer = new jspb.BinaryWriter();
  353. proto.spine.server.catchup.CatchUp.Request.serializeBinaryToWriter(this, writer);
  354. return writer.getResultBuffer();
  355. };
  356. /**
  357. * Serializes the given message to binary data (in protobuf wire
  358. * format), writing to the given BinaryWriter.
  359. * @param {!proto.spine.server.catchup.CatchUp.Request} message
  360. * @param {!jspb.BinaryWriter} writer
  361. * @suppress {unusedLocalVariables} f is only used for nested messages
  362. */
  363. proto.spine.server.catchup.CatchUp.Request.serializeBinaryToWriter = function(message, writer) {
  364. var f = undefined;
  365. f = message.getTargetList();
  366. if (f.length > 0) {
  367. writer.writeRepeatedMessage(
  368. 1,
  369. f,
  370. google_protobuf_any_pb.Any.serializeBinaryToWriter
  371. );
  372. }
  373. f = message.getSinceWhen();
  374. if (f != null) {
  375. writer.writeMessage(
  376. 2,
  377. f,
  378. google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
  379. );
  380. }
  381. f = message.getEventTypeList();
  382. if (f.length > 0) {
  383. writer.writeRepeatedString(
  384. 3,
  385. f
  386. );
  387. }
  388. };
  389. /**
  390. * repeated google.protobuf.Any target = 1;
  391. * @return {!Array<!proto.google.protobuf.Any>}
  392. */
  393. proto.spine.server.catchup.CatchUp.Request.prototype.getTargetList = function() {
  394. return /** @type{!Array<!proto.google.protobuf.Any>} */ (
  395. jspb.Message.getRepeatedWrapperField(this, google_protobuf_any_pb.Any, 1));
  396. };
  397. /**
  398. * @param {!Array<!proto.google.protobuf.Any>} value
  399. * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
  400. */
  401. proto.spine.server.catchup.CatchUp.Request.prototype.setTargetList = function(value) {
  402. return jspb.Message.setRepeatedWrapperField(this, 1, value);
  403. };
  404. /**
  405. * @param {!proto.google.protobuf.Any=} opt_value
  406. * @param {number=} opt_index
  407. * @return {!proto.google.protobuf.Any}
  408. */
  409. proto.spine.server.catchup.CatchUp.Request.prototype.addTarget = function(opt_value, opt_index) {
  410. return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.google.protobuf.Any, opt_index);
  411. };
  412. /**
  413. * Clears the list making it empty but non-null.
  414. * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
  415. */
  416. proto.spine.server.catchup.CatchUp.Request.prototype.clearTargetList = function() {
  417. return this.setTargetList([]);
  418. };
  419. /**
  420. * optional google.protobuf.Timestamp since_when = 2;
  421. * @return {?proto.google.protobuf.Timestamp}
  422. */
  423. proto.spine.server.catchup.CatchUp.Request.prototype.getSinceWhen = function() {
  424. return /** @type{?proto.google.protobuf.Timestamp} */ (
  425. jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2));
  426. };
  427. /**
  428. * @param {?proto.google.protobuf.Timestamp|undefined} value
  429. * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
  430. */
  431. proto.spine.server.catchup.CatchUp.Request.prototype.setSinceWhen = function(value) {
  432. return jspb.Message.setWrapperField(this, 2, value);
  433. };
  434. /**
  435. * Clears the message field making it undefined.
  436. * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
  437. */
  438. proto.spine.server.catchup.CatchUp.Request.prototype.clearSinceWhen = function() {
  439. return this.setSinceWhen(undefined);
  440. };
  441. /**
  442. * Returns whether this field is set.
  443. * @return {boolean}
  444. */
  445. proto.spine.server.catchup.CatchUp.Request.prototype.hasSinceWhen = function() {
  446. return jspb.Message.getField(this, 2) != null;
  447. };
  448. /**
  449. * repeated string event_type = 3;
  450. * @return {!Array<string>}
  451. */
  452. proto.spine.server.catchup.CatchUp.Request.prototype.getEventTypeList = function() {
  453. return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3));
  454. };
  455. /**
  456. * @param {!Array<string>} value
  457. * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
  458. */
  459. proto.spine.server.catchup.CatchUp.Request.prototype.setEventTypeList = function(value) {
  460. return jspb.Message.setField(this, 3, value || []);
  461. };
  462. /**
  463. * @param {string} value
  464. * @param {number=} opt_index
  465. * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
  466. */
  467. proto.spine.server.catchup.CatchUp.Request.prototype.addEventType = function(value, opt_index) {
  468. return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
  469. };
  470. /**
  471. * Clears the list making it empty but non-null.
  472. * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
  473. */
  474. proto.spine.server.catchup.CatchUp.Request.prototype.clearEventTypeList = function() {
  475. return this.setEventTypeList([]);
  476. };
  477. /**
  478. * optional CatchUpId id = 1;
  479. * @return {?proto.spine.server.catchup.CatchUpId}
  480. */
  481. proto.spine.server.catchup.CatchUp.prototype.getId = function() {
  482. return /** @type{?proto.spine.server.catchup.CatchUpId} */ (
  483. jspb.Message.getWrapperField(this, proto.spine.server.catchup.CatchUpId, 1));
  484. };
  485. /**
  486. * @param {?proto.spine.server.catchup.CatchUpId|undefined} value
  487. * @return {!proto.spine.server.catchup.CatchUp} returns this
  488. */
  489. proto.spine.server.catchup.CatchUp.prototype.setId = function(value) {
  490. return jspb.Message.setWrapperField(this, 1, value);
  491. };
  492. /**
  493. * Clears the message field making it undefined.
  494. * @return {!proto.spine.server.catchup.CatchUp} returns this
  495. */
  496. proto.spine.server.catchup.CatchUp.prototype.clearId = function() {
  497. return this.setId(undefined);
  498. };
  499. /**
  500. * Returns whether this field is set.
  501. * @return {boolean}
  502. */
  503. proto.spine.server.catchup.CatchUp.prototype.hasId = function() {
  504. return jspb.Message.getField(this, 1) != null;
  505. };
  506. /**
  507. * optional Request request = 2;
  508. * @return {?proto.spine.server.catchup.CatchUp.Request}
  509. */
  510. proto.spine.server.catchup.CatchUp.prototype.getRequest = function() {
  511. return /** @type{?proto.spine.server.catchup.CatchUp.Request} */ (
  512. jspb.Message.getWrapperField(this, proto.spine.server.catchup.CatchUp.Request, 2));
  513. };
  514. /**
  515. * @param {?proto.spine.server.catchup.CatchUp.Request|undefined} value
  516. * @return {!proto.spine.server.catchup.CatchUp} returns this
  517. */
  518. proto.spine.server.catchup.CatchUp.prototype.setRequest = function(value) {
  519. return jspb.Message.setWrapperField(this, 2, value);
  520. };
  521. /**
  522. * Clears the message field making it undefined.
  523. * @return {!proto.spine.server.catchup.CatchUp} returns this
  524. */
  525. proto.spine.server.catchup.CatchUp.prototype.clearRequest = function() {
  526. return this.setRequest(undefined);
  527. };
  528. /**
  529. * Returns whether this field is set.
  530. * @return {boolean}
  531. */
  532. proto.spine.server.catchup.CatchUp.prototype.hasRequest = function() {
  533. return jspb.Message.getField(this, 2) != null;
  534. };
  535. /**
  536. * optional google.protobuf.Timestamp when_last_read = 3;
  537. * @return {?proto.google.protobuf.Timestamp}
  538. */
  539. proto.spine.server.catchup.CatchUp.prototype.getWhenLastRead = function() {
  540. return /** @type{?proto.google.protobuf.Timestamp} */ (
  541. jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
  542. };
  543. /**
  544. * @param {?proto.google.protobuf.Timestamp|undefined} value
  545. * @return {!proto.spine.server.catchup.CatchUp} returns this
  546. */
  547. proto.spine.server.catchup.CatchUp.prototype.setWhenLastRead = function(value) {
  548. return jspb.Message.setWrapperField(this, 3, value);
  549. };
  550. /**
  551. * Clears the message field making it undefined.
  552. * @return {!proto.spine.server.catchup.CatchUp} returns this
  553. */
  554. proto.spine.server.catchup.CatchUp.prototype.clearWhenLastRead = function() {
  555. return this.setWhenLastRead(undefined);
  556. };
  557. /**
  558. * Returns whether this field is set.
  559. * @return {boolean}
  560. */
  561. proto.spine.server.catchup.CatchUp.prototype.hasWhenLastRead = function() {
  562. return jspb.Message.getField(this, 3) != null;
  563. };
  564. /**
  565. * optional CatchUpStatus status = 4;
  566. * @return {!proto.spine.server.catchup.CatchUpStatus}
  567. */
  568. proto.spine.server.catchup.CatchUp.prototype.getStatus = function() {
  569. return /** @type {!proto.spine.server.catchup.CatchUpStatus} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
  570. };
  571. /**
  572. * @param {!proto.spine.server.catchup.CatchUpStatus} value
  573. * @return {!proto.spine.server.catchup.CatchUp} returns this
  574. */
  575. proto.spine.server.catchup.CatchUp.prototype.setStatus = function(value) {
  576. return jspb.Message.setProto3EnumField(this, 4, value);
  577. };
  578. /**
  579. * optional int32 total_shards = 5;
  580. * @return {number}
  581. */
  582. proto.spine.server.catchup.CatchUp.prototype.getTotalShards = function() {
  583. return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
  584. };
  585. /**
  586. * @param {number} value
  587. * @return {!proto.spine.server.catchup.CatchUp} returns this
  588. */
  589. proto.spine.server.catchup.CatchUp.prototype.setTotalShards = function(value) {
  590. return jspb.Message.setProto3IntField(this, 5, value);
  591. };
  592. /**
  593. * repeated int32 affected_shard = 6;
  594. * @return {!Array<number>}
  595. */
  596. proto.spine.server.catchup.CatchUp.prototype.getAffectedShardList = function() {
  597. return /** @type {!Array<number>} */ (jspb.Message.getRepeatedField(this, 6));
  598. };
  599. /**
  600. * @param {!Array<number>} value
  601. * @return {!proto.spine.server.catchup.CatchUp} returns this
  602. */
  603. proto.spine.server.catchup.CatchUp.prototype.setAffectedShardList = function(value) {
  604. return jspb.Message.setField(this, 6, value || []);
  605. };
  606. /**
  607. * @param {number} value
  608. * @param {number=} opt_index
  609. * @return {!proto.spine.server.catchup.CatchUp} returns this
  610. */
  611. proto.spine.server.catchup.CatchUp.prototype.addAffectedShard = function(value, opt_index) {
  612. return jspb.Message.addToRepeatedField(this, 6, value, opt_index);
  613. };
  614. /**
  615. * Clears the list making it empty but non-null.
  616. * @return {!proto.spine.server.catchup.CatchUp} returns this
  617. */
  618. proto.spine.server.catchup.CatchUp.prototype.clearAffectedShardList = function() {
  619. return this.setAffectedShardList([]);
  620. };
  621. if (jspb.Message.GENERATE_TO_OBJECT) {
  622. /**
  623. * Creates an object representation of this proto.
  624. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  625. * Optional fields that are not set will be set to undefined.
  626. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  627. * For the list of reserved names please see:
  628. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  629. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  630. * JSPB instance for transitional soy proto support:
  631. * http://goto/soy-param-migration
  632. * @return {!Object}
  633. */
  634. proto.spine.server.catchup.CatchUpId.prototype.toObject = function(opt_includeInstance) {
  635. return proto.spine.server.catchup.CatchUpId.toObject(opt_includeInstance, this);
  636. };
  637. /**
  638. * Static version of the {@see toObject} method.
  639. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  640. * the JSPB instance for transitional soy proto support:
  641. * http://goto/soy-param-migration
  642. * @param {!proto.spine.server.catchup.CatchUpId} msg The msg instance to transform.
  643. * @return {!Object}
  644. * @suppress {unusedLocalVariables} f is only used for nested messages
  645. */
  646. proto.spine.server.catchup.CatchUpId.toObject = function(includeInstance, msg) {
  647. var f, obj = {
  648. uuid: jspb.Message.getFieldWithDefault(msg, 1, ""),
  649. projectionType: jspb.Message.getFieldWithDefault(msg, 2, "")
  650. };
  651. if (includeInstance) {
  652. obj.$jspbMessageInstance = msg;
  653. }
  654. return obj;
  655. };
  656. }
  657. /**
  658. * Deserializes binary data (in protobuf wire format).
  659. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  660. * @return {!proto.spine.server.catchup.CatchUpId}
  661. */
  662. proto.spine.server.catchup.CatchUpId.deserializeBinary = function(bytes) {
  663. var reader = new jspb.BinaryReader(bytes);
  664. var msg = new proto.spine.server.catchup.CatchUpId;
  665. return proto.spine.server.catchup.CatchUpId.deserializeBinaryFromReader(msg, reader);
  666. };
  667. /**
  668. * Deserializes binary data (in protobuf wire format) from the
  669. * given reader into the given message object.
  670. * @param {!proto.spine.server.catchup.CatchUpId} msg The message object to deserialize into.
  671. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  672. * @return {!proto.spine.server.catchup.CatchUpId}
  673. */
  674. proto.spine.server.catchup.CatchUpId.deserializeBinaryFromReader = function(msg, reader) {
  675. while (reader.nextField()) {
  676. if (reader.isEndGroup()) {
  677. break;
  678. }
  679. var field = reader.getFieldNumber();
  680. switch (field) {
  681. case 1:
  682. var value = /** @type {string} */ (reader.readString());
  683. msg.setUuid(value);
  684. break;
  685. case 2:
  686. var value = /** @type {string} */ (reader.readString());
  687. msg.setProjectionType(value);
  688. break;
  689. default:
  690. reader.skipField();
  691. break;
  692. }
  693. }
  694. return msg;
  695. };
  696. /**
  697. * Serializes the message to binary data (in protobuf wire format).
  698. * @return {!Uint8Array}
  699. */
  700. proto.spine.server.catchup.CatchUpId.prototype.serializeBinary = function() {
  701. var writer = new jspb.BinaryWriter();
  702. proto.spine.server.catchup.CatchUpId.serializeBinaryToWriter(this, writer);
  703. return writer.getResultBuffer();
  704. };
  705. /**
  706. * Serializes the given message to binary data (in protobuf wire
  707. * format), writing to the given BinaryWriter.
  708. * @param {!proto.spine.server.catchup.CatchUpId} message
  709. * @param {!jspb.BinaryWriter} writer
  710. * @suppress {unusedLocalVariables} f is only used for nested messages
  711. */
  712. proto.spine.server.catchup.CatchUpId.serializeBinaryToWriter = function(message, writer) {
  713. var f = undefined;
  714. f = message.getUuid();
  715. if (f.length > 0) {
  716. writer.writeString(
  717. 1,
  718. f
  719. );
  720. }
  721. f = message.getProjectionType();
  722. if (f.length > 0) {
  723. writer.writeString(
  724. 2,
  725. f
  726. );
  727. }
  728. };
  729. /**
  730. * optional string uuid = 1;
  731. * @return {string}
  732. */
  733. proto.spine.server.catchup.CatchUpId.prototype.getUuid = function() {
  734. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  735. };
  736. /**
  737. * @param {string} value
  738. * @return {!proto.spine.server.catchup.CatchUpId} returns this
  739. */
  740. proto.spine.server.catchup.CatchUpId.prototype.setUuid = function(value) {
  741. return jspb.Message.setProto3StringField(this, 1, value);
  742. };
  743. /**
  744. * optional string projection_type = 2;
  745. * @return {string}
  746. */
  747. proto.spine.server.catchup.CatchUpId.prototype.getProjectionType = function() {
  748. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
  749. };
  750. /**
  751. * @param {string} value
  752. * @return {!proto.spine.server.catchup.CatchUpId} returns this
  753. */
  754. proto.spine.server.catchup.CatchUpId.prototype.setProjectionType = function(value) {
  755. return jspb.Message.setProto3StringField(this, 2, value);
  756. };
  757. /**
  758. * @enum {number}
  759. */
  760. proto.spine.server.catchup.CatchUpStatus = {
  761. CUS_UNDEFINED: 0,
  762. IN_PROGRESS: 1,
  763. FINALIZING: 2,
  764. COMPLETED: 3
  765. };
  766. goog.object.extend(exports, proto.spine.server.catchup);
  767. // Generated by Spine ProtoJs Plugin
  768. let ObjectParser = require('../../../../client/parser/object-parser.js').default;
  769. let TypeParsers = require('../../../../client/parser/type-parsers.js').default;
  770. proto.spine.server.catchup.CatchUp.Request.Parser = function() {
  771. ObjectParser.call(this);
  772. };
  773. proto.spine.server.catchup.CatchUp.Request.Parser.prototype = Object.create(ObjectParser.prototype);
  774. proto.spine.server.catchup.CatchUp.Request.Parser.prototype.constructor = proto.spine.server.catchup.CatchUp.Request.Parser;
  775. proto.spine.server.catchup.CatchUp.Request.Parser.prototype.fromObject = function(obj) {
  776. if (obj === null) {
  777. return null;
  778. }
  779. let msg = new proto.spine.server.catchup.CatchUp.Request();
  780. if (obj.target !== undefined && obj.target !== null) {
  781. obj.target.forEach(
  782. (listItem, index, array) => {
  783. if (listItem === null) {
  784. msg.addTarget(null);
  785. } else {
  786. let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(listItem);
  787. msg.addTarget(value);
  788. }
  789. }
  790. );
  791. }
  792. if (obj.sinceWhen !== undefined) {
  793. if (obj.sinceWhen === null) {
  794. msg.setSinceWhen(null);
  795. } else {
  796. let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Timestamp').fromObject(obj.sinceWhen);
  797. msg.setSinceWhen(value);
  798. }
  799. }
  800. if (obj.eventType !== undefined && obj.eventType !== null) {
  801. obj.eventType.forEach(
  802. (listItem, index, array) => {
  803. if (listItem !== null) {
  804. let value = listItem;
  805. msg.addEventType(value);
  806. }
  807. }
  808. );
  809. }
  810. return msg;
  811. };
  812. proto.spine.server.catchup.CatchUp.Parser = function() {
  813. ObjectParser.call(this);
  814. };
  815. proto.spine.server.catchup.CatchUp.Parser.prototype = Object.create(ObjectParser.prototype);
  816. proto.spine.server.catchup.CatchUp.Parser.prototype.constructor = proto.spine.server.catchup.CatchUp.Parser;
  817. proto.spine.server.catchup.CatchUp.Parser.prototype.fromObject = function(obj) {
  818. if (obj === null) {
  819. return null;
  820. }
  821. let msg = new proto.spine.server.catchup.CatchUp();
  822. if (obj.id !== undefined) {
  823. if (obj.id === null) {
  824. msg.setId(null);
  825. } else {
  826. let value = TypeParsers.parserFor('type.spine.io/spine.server.catchup.CatchUpId').fromObject(obj.id);
  827. msg.setId(value);
  828. }
  829. }
  830. if (obj.request !== undefined) {
  831. if (obj.request === null) {
  832. msg.setRequest(null);
  833. } else {
  834. let value = TypeParsers.parserFor('type.spine.io/spine.server.catchup.CatchUp.Request').fromObject(obj.request);
  835. msg.setRequest(value);
  836. }
  837. }
  838. if (obj.whenLastRead !== undefined) {
  839. if (obj.whenLastRead === null) {
  840. msg.setWhenLastRead(null);
  841. } else {
  842. let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Timestamp').fromObject(obj.whenLastRead);
  843. msg.setWhenLastRead(value);
  844. }
  845. }
  846. if (obj.status !== undefined) {
  847. if (obj.status !== null) {
  848. let value = proto.spine.server.catchup.CatchUpStatus[obj.status];
  849. msg.setStatus(value);
  850. }
  851. }
  852. if (obj.totalShards !== undefined) {
  853. if (obj.totalShards !== null) {
  854. let value = obj.totalShards;
  855. msg.setTotalShards(value);
  856. }
  857. }
  858. if (obj.affectedShard !== undefined && obj.affectedShard !== null) {
  859. obj.affectedShard.forEach(
  860. (listItem, index, array) => {
  861. if (listItem !== null) {
  862. let value = listItem;
  863. msg.addAffectedShard(value);
  864. }
  865. }
  866. );
  867. }
  868. return msg;
  869. };
  870. proto.spine.server.catchup.CatchUpId.Parser = function() {
  871. ObjectParser.call(this);
  872. };
  873. proto.spine.server.catchup.CatchUpId.Parser.prototype = Object.create(ObjectParser.prototype);
  874. proto.spine.server.catchup.CatchUpId.Parser.prototype.constructor = proto.spine.server.catchup.CatchUpId.Parser;
  875. proto.spine.server.catchup.CatchUpId.Parser.prototype.fromObject = function(obj) {
  876. if (obj === null) {
  877. return null;
  878. }
  879. let msg = new proto.spine.server.catchup.CatchUpId();
  880. if (obj.uuid !== undefined) {
  881. if (obj.uuid !== null) {
  882. let value = obj.uuid;
  883. msg.setUuid(value);
  884. }
  885. }
  886. if (obj.projectionType !== undefined) {
  887. if (obj.projectionType !== null) {
  888. let value = obj.projectionType;
  889. msg.setProjectionType(value);
  890. }
  891. }
  892. return msg;
  893. };
  894. // Generated by Spine ProtoJs Plugin
  895. proto.spine.server.catchup.CatchUp.Request.typeUrl = function() {
  896. return 'type.spine.io/spine.server.catchup.CatchUp.Request';
  897. };
  898. // Generated by Spine ProtoJs Plugin
  899. proto.spine.server.catchup.CatchUp.typeUrl = function() {
  900. return 'type.spine.io/spine.server.catchup.CatchUp';
  901. };
  902. // Generated by Spine ProtoJs Plugin
  903. proto.spine.server.catchup.CatchUpId.typeUrl = function() {
  904. return 'type.spine.io/spine.server.catchup.CatchUpId';
  905. };
  906. // Generated by Spine ProtoJs Plugin
  907. proto.spine.server.catchup.CatchUpStatus.typeUrl = function() {
  908. return 'type.spine.io/spine.server.catchup.CatchUpStatus';
  909. };