Source: proto/spine/system/server/event_lifecycle_events_pb.js

  1. // source: spine/system/server/event_lifecycle_events.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_core_command_pb = require('../../../spine/core/command_pb.js');
  16. goog.object.extend(proto, spine_core_command_pb);
  17. var spine_core_event_pb = require('../../../spine/core/event_pb.js');
  18. goog.object.extend(proto, spine_core_event_pb);
  19. goog.exportSymbol('proto.spine.system.server.EventCausedCommand', null, global);
  20. goog.exportSymbol('proto.spine.system.server.EventCausedCommands', null, global);
  21. /**
  22. * Generated by JsPbCodeGenerator.
  23. * @param {Array=} opt_data Optional initial data array, typically from a
  24. * server response, or constructed directly in Javascript. The array is used
  25. * in place and becomes part of the constructed object. It is not cloned.
  26. * If no data is provided, the constructed object will be empty, but still
  27. * valid.
  28. * @extends {jspb.Message}
  29. * @constructor
  30. */
  31. proto.spine.system.server.EventCausedCommand = function(opt_data) {
  32. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  33. };
  34. goog.inherits(proto.spine.system.server.EventCausedCommand, jspb.Message);
  35. if (goog.DEBUG && !COMPILED) {
  36. /**
  37. * @public
  38. * @override
  39. */
  40. proto.spine.system.server.EventCausedCommand.displayName = 'proto.spine.system.server.EventCausedCommand';
  41. }
  42. /**
  43. * Generated by JsPbCodeGenerator.
  44. * @param {Array=} opt_data Optional initial data array, typically from a
  45. * server response, or constructed directly in Javascript. The array is used
  46. * in place and becomes part of the constructed object. It is not cloned.
  47. * If no data is provided, the constructed object will be empty, but still
  48. * valid.
  49. * @extends {jspb.Message}
  50. * @constructor
  51. */
  52. proto.spine.system.server.EventCausedCommands = function(opt_data) {
  53. jspb.Message.initialize(this, opt_data, 0, -1, proto.spine.system.server.EventCausedCommands.repeatedFields_, null);
  54. };
  55. goog.inherits(proto.spine.system.server.EventCausedCommands, jspb.Message);
  56. if (goog.DEBUG && !COMPILED) {
  57. /**
  58. * @public
  59. * @override
  60. */
  61. proto.spine.system.server.EventCausedCommands.displayName = 'proto.spine.system.server.EventCausedCommands';
  62. }
  63. if (jspb.Message.GENERATE_TO_OBJECT) {
  64. /**
  65. * Creates an object representation of this proto.
  66. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  67. * Optional fields that are not set will be set to undefined.
  68. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  69. * For the list of reserved names please see:
  70. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  71. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  72. * JSPB instance for transitional soy proto support:
  73. * http://goto/soy-param-migration
  74. * @return {!Object}
  75. */
  76. proto.spine.system.server.EventCausedCommand.prototype.toObject = function(opt_includeInstance) {
  77. return proto.spine.system.server.EventCausedCommand.toObject(opt_includeInstance, this);
  78. };
  79. /**
  80. * Static version of the {@see toObject} method.
  81. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  82. * the JSPB instance for transitional soy proto support:
  83. * http://goto/soy-param-migration
  84. * @param {!proto.spine.system.server.EventCausedCommand} msg The msg instance to transform.
  85. * @return {!Object}
  86. * @suppress {unusedLocalVariables} f is only used for nested messages
  87. */
  88. proto.spine.system.server.EventCausedCommand.toObject = function(includeInstance, msg) {
  89. var f, obj = {
  90. id: (f = msg.getId()) && spine_core_event_pb.EventId.toObject(includeInstance, f),
  91. produced: (f = msg.getProduced()) && spine_core_command_pb.CommandId.toObject(includeInstance, f)
  92. };
  93. if (includeInstance) {
  94. obj.$jspbMessageInstance = msg;
  95. }
  96. return obj;
  97. };
  98. }
  99. /**
  100. * Deserializes binary data (in protobuf wire format).
  101. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  102. * @return {!proto.spine.system.server.EventCausedCommand}
  103. */
  104. proto.spine.system.server.EventCausedCommand.deserializeBinary = function(bytes) {
  105. var reader = new jspb.BinaryReader(bytes);
  106. var msg = new proto.spine.system.server.EventCausedCommand;
  107. return proto.spine.system.server.EventCausedCommand.deserializeBinaryFromReader(msg, reader);
  108. };
  109. /**
  110. * Deserializes binary data (in protobuf wire format) from the
  111. * given reader into the given message object.
  112. * @param {!proto.spine.system.server.EventCausedCommand} msg The message object to deserialize into.
  113. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  114. * @return {!proto.spine.system.server.EventCausedCommand}
  115. */
  116. proto.spine.system.server.EventCausedCommand.deserializeBinaryFromReader = function(msg, reader) {
  117. while (reader.nextField()) {
  118. if (reader.isEndGroup()) {
  119. break;
  120. }
  121. var field = reader.getFieldNumber();
  122. switch (field) {
  123. case 1:
  124. var value = new spine_core_event_pb.EventId;
  125. reader.readMessage(value,spine_core_event_pb.EventId.deserializeBinaryFromReader);
  126. msg.setId(value);
  127. break;
  128. case 2:
  129. var value = new spine_core_command_pb.CommandId;
  130. reader.readMessage(value,spine_core_command_pb.CommandId.deserializeBinaryFromReader);
  131. msg.setProduced(value);
  132. break;
  133. default:
  134. reader.skipField();
  135. break;
  136. }
  137. }
  138. return msg;
  139. };
  140. /**
  141. * Serializes the message to binary data (in protobuf wire format).
  142. * @return {!Uint8Array}
  143. */
  144. proto.spine.system.server.EventCausedCommand.prototype.serializeBinary = function() {
  145. var writer = new jspb.BinaryWriter();
  146. proto.spine.system.server.EventCausedCommand.serializeBinaryToWriter(this, writer);
  147. return writer.getResultBuffer();
  148. };
  149. /**
  150. * Serializes the given message to binary data (in protobuf wire
  151. * format), writing to the given BinaryWriter.
  152. * @param {!proto.spine.system.server.EventCausedCommand} message
  153. * @param {!jspb.BinaryWriter} writer
  154. * @suppress {unusedLocalVariables} f is only used for nested messages
  155. */
  156. proto.spine.system.server.EventCausedCommand.serializeBinaryToWriter = function(message, writer) {
  157. var f = undefined;
  158. f = message.getId();
  159. if (f != null) {
  160. writer.writeMessage(
  161. 1,
  162. f,
  163. spine_core_event_pb.EventId.serializeBinaryToWriter
  164. );
  165. }
  166. f = message.getProduced();
  167. if (f != null) {
  168. writer.writeMessage(
  169. 2,
  170. f,
  171. spine_core_command_pb.CommandId.serializeBinaryToWriter
  172. );
  173. }
  174. };
  175. /**
  176. * optional spine.core.EventId id = 1;
  177. * @return {?proto.spine.core.EventId}
  178. */
  179. proto.spine.system.server.EventCausedCommand.prototype.getId = function() {
  180. return /** @type{?proto.spine.core.EventId} */ (
  181. jspb.Message.getWrapperField(this, spine_core_event_pb.EventId, 1));
  182. };
  183. /**
  184. * @param {?proto.spine.core.EventId|undefined} value
  185. * @return {!proto.spine.system.server.EventCausedCommand} returns this
  186. */
  187. proto.spine.system.server.EventCausedCommand.prototype.setId = function(value) {
  188. return jspb.Message.setWrapperField(this, 1, value);
  189. };
  190. /**
  191. * Clears the message field making it undefined.
  192. * @return {!proto.spine.system.server.EventCausedCommand} returns this
  193. */
  194. proto.spine.system.server.EventCausedCommand.prototype.clearId = function() {
  195. return this.setId(undefined);
  196. };
  197. /**
  198. * Returns whether this field is set.
  199. * @return {boolean}
  200. */
  201. proto.spine.system.server.EventCausedCommand.prototype.hasId = function() {
  202. return jspb.Message.getField(this, 1) != null;
  203. };
  204. /**
  205. * optional spine.core.CommandId produced = 2;
  206. * @return {?proto.spine.core.CommandId}
  207. */
  208. proto.spine.system.server.EventCausedCommand.prototype.getProduced = function() {
  209. return /** @type{?proto.spine.core.CommandId} */ (
  210. jspb.Message.getWrapperField(this, spine_core_command_pb.CommandId, 2));
  211. };
  212. /**
  213. * @param {?proto.spine.core.CommandId|undefined} value
  214. * @return {!proto.spine.system.server.EventCausedCommand} returns this
  215. */
  216. proto.spine.system.server.EventCausedCommand.prototype.setProduced = function(value) {
  217. return jspb.Message.setWrapperField(this, 2, value);
  218. };
  219. /**
  220. * Clears the message field making it undefined.
  221. * @return {!proto.spine.system.server.EventCausedCommand} returns this
  222. */
  223. proto.spine.system.server.EventCausedCommand.prototype.clearProduced = function() {
  224. return this.setProduced(undefined);
  225. };
  226. /**
  227. * Returns whether this field is set.
  228. * @return {boolean}
  229. */
  230. proto.spine.system.server.EventCausedCommand.prototype.hasProduced = function() {
  231. return jspb.Message.getField(this, 2) != null;
  232. };
  233. /**
  234. * List of repeated fields within this message type.
  235. * @private {!Array<number>}
  236. * @const
  237. */
  238. proto.spine.system.server.EventCausedCommands.repeatedFields_ = [2];
  239. if (jspb.Message.GENERATE_TO_OBJECT) {
  240. /**
  241. * Creates an object representation of this proto.
  242. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  243. * Optional fields that are not set will be set to undefined.
  244. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  245. * For the list of reserved names please see:
  246. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  247. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  248. * JSPB instance for transitional soy proto support:
  249. * http://goto/soy-param-migration
  250. * @return {!Object}
  251. */
  252. proto.spine.system.server.EventCausedCommands.prototype.toObject = function(opt_includeInstance) {
  253. return proto.spine.system.server.EventCausedCommands.toObject(opt_includeInstance, this);
  254. };
  255. /**
  256. * Static version of the {@see toObject} method.
  257. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  258. * the JSPB instance for transitional soy proto support:
  259. * http://goto/soy-param-migration
  260. * @param {!proto.spine.system.server.EventCausedCommands} msg The msg instance to transform.
  261. * @return {!Object}
  262. * @suppress {unusedLocalVariables} f is only used for nested messages
  263. */
  264. proto.spine.system.server.EventCausedCommands.toObject = function(includeInstance, msg) {
  265. var f, obj = {
  266. id: (f = msg.getId()) && spine_core_event_pb.EventId.toObject(includeInstance, f),
  267. producedList: jspb.Message.toObjectList(msg.getProducedList(),
  268. spine_core_command_pb.CommandId.toObject, includeInstance)
  269. };
  270. if (includeInstance) {
  271. obj.$jspbMessageInstance = msg;
  272. }
  273. return obj;
  274. };
  275. }
  276. /**
  277. * Deserializes binary data (in protobuf wire format).
  278. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  279. * @return {!proto.spine.system.server.EventCausedCommands}
  280. */
  281. proto.spine.system.server.EventCausedCommands.deserializeBinary = function(bytes) {
  282. var reader = new jspb.BinaryReader(bytes);
  283. var msg = new proto.spine.system.server.EventCausedCommands;
  284. return proto.spine.system.server.EventCausedCommands.deserializeBinaryFromReader(msg, reader);
  285. };
  286. /**
  287. * Deserializes binary data (in protobuf wire format) from the
  288. * given reader into the given message object.
  289. * @param {!proto.spine.system.server.EventCausedCommands} msg The message object to deserialize into.
  290. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  291. * @return {!proto.spine.system.server.EventCausedCommands}
  292. */
  293. proto.spine.system.server.EventCausedCommands.deserializeBinaryFromReader = function(msg, reader) {
  294. while (reader.nextField()) {
  295. if (reader.isEndGroup()) {
  296. break;
  297. }
  298. var field = reader.getFieldNumber();
  299. switch (field) {
  300. case 1:
  301. var value = new spine_core_event_pb.EventId;
  302. reader.readMessage(value,spine_core_event_pb.EventId.deserializeBinaryFromReader);
  303. msg.setId(value);
  304. break;
  305. case 2:
  306. var value = new spine_core_command_pb.CommandId;
  307. reader.readMessage(value,spine_core_command_pb.CommandId.deserializeBinaryFromReader);
  308. msg.addProduced(value);
  309. break;
  310. default:
  311. reader.skipField();
  312. break;
  313. }
  314. }
  315. return msg;
  316. };
  317. /**
  318. * Serializes the message to binary data (in protobuf wire format).
  319. * @return {!Uint8Array}
  320. */
  321. proto.spine.system.server.EventCausedCommands.prototype.serializeBinary = function() {
  322. var writer = new jspb.BinaryWriter();
  323. proto.spine.system.server.EventCausedCommands.serializeBinaryToWriter(this, writer);
  324. return writer.getResultBuffer();
  325. };
  326. /**
  327. * Serializes the given message to binary data (in protobuf wire
  328. * format), writing to the given BinaryWriter.
  329. * @param {!proto.spine.system.server.EventCausedCommands} message
  330. * @param {!jspb.BinaryWriter} writer
  331. * @suppress {unusedLocalVariables} f is only used for nested messages
  332. */
  333. proto.spine.system.server.EventCausedCommands.serializeBinaryToWriter = function(message, writer) {
  334. var f = undefined;
  335. f = message.getId();
  336. if (f != null) {
  337. writer.writeMessage(
  338. 1,
  339. f,
  340. spine_core_event_pb.EventId.serializeBinaryToWriter
  341. );
  342. }
  343. f = message.getProducedList();
  344. if (f.length > 0) {
  345. writer.writeRepeatedMessage(
  346. 2,
  347. f,
  348. spine_core_command_pb.CommandId.serializeBinaryToWriter
  349. );
  350. }
  351. };
  352. /**
  353. * optional spine.core.EventId id = 1;
  354. * @return {?proto.spine.core.EventId}
  355. */
  356. proto.spine.system.server.EventCausedCommands.prototype.getId = function() {
  357. return /** @type{?proto.spine.core.EventId} */ (
  358. jspb.Message.getWrapperField(this, spine_core_event_pb.EventId, 1));
  359. };
  360. /**
  361. * @param {?proto.spine.core.EventId|undefined} value
  362. * @return {!proto.spine.system.server.EventCausedCommands} returns this
  363. */
  364. proto.spine.system.server.EventCausedCommands.prototype.setId = function(value) {
  365. return jspb.Message.setWrapperField(this, 1, value);
  366. };
  367. /**
  368. * Clears the message field making it undefined.
  369. * @return {!proto.spine.system.server.EventCausedCommands} returns this
  370. */
  371. proto.spine.system.server.EventCausedCommands.prototype.clearId = function() {
  372. return this.setId(undefined);
  373. };
  374. /**
  375. * Returns whether this field is set.
  376. * @return {boolean}
  377. */
  378. proto.spine.system.server.EventCausedCommands.prototype.hasId = function() {
  379. return jspb.Message.getField(this, 1) != null;
  380. };
  381. /**
  382. * repeated spine.core.CommandId produced = 2;
  383. * @return {!Array<!proto.spine.core.CommandId>}
  384. */
  385. proto.spine.system.server.EventCausedCommands.prototype.getProducedList = function() {
  386. return /** @type{!Array<!proto.spine.core.CommandId>} */ (
  387. jspb.Message.getRepeatedWrapperField(this, spine_core_command_pb.CommandId, 2));
  388. };
  389. /**
  390. * @param {!Array<!proto.spine.core.CommandId>} value
  391. * @return {!proto.spine.system.server.EventCausedCommands} returns this
  392. */
  393. proto.spine.system.server.EventCausedCommands.prototype.setProducedList = function(value) {
  394. return jspb.Message.setRepeatedWrapperField(this, 2, value);
  395. };
  396. /**
  397. * @param {!proto.spine.core.CommandId=} opt_value
  398. * @param {number=} opt_index
  399. * @return {!proto.spine.core.CommandId}
  400. */
  401. proto.spine.system.server.EventCausedCommands.prototype.addProduced = function(opt_value, opt_index) {
  402. return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.spine.core.CommandId, opt_index);
  403. };
  404. /**
  405. * Clears the list making it empty but non-null.
  406. * @return {!proto.spine.system.server.EventCausedCommands} returns this
  407. */
  408. proto.spine.system.server.EventCausedCommands.prototype.clearProducedList = function() {
  409. return this.setProducedList([]);
  410. };
  411. goog.object.extend(exports, proto.spine.system.server);
  412. // Generated by Spine ProtoJs Plugin
  413. let ObjectParser = require('../../../../client/parser/object-parser.js').default;
  414. let TypeParsers = require('../../../../client/parser/type-parsers.js').default;
  415. proto.spine.system.server.EventCausedCommand.Parser = function() {
  416. ObjectParser.call(this);
  417. };
  418. proto.spine.system.server.EventCausedCommand.Parser.prototype = Object.create(ObjectParser.prototype);
  419. proto.spine.system.server.EventCausedCommand.Parser.prototype.constructor = proto.spine.system.server.EventCausedCommand.Parser;
  420. proto.spine.system.server.EventCausedCommand.Parser.prototype.fromObject = function(obj) {
  421. if (obj === null) {
  422. return null;
  423. }
  424. let msg = new proto.spine.system.server.EventCausedCommand();
  425. if (obj.id !== undefined) {
  426. if (obj.id === null) {
  427. msg.setId(null);
  428. } else {
  429. let value = TypeParsers.parserFor('type.spine.io/spine.core.EventId').fromObject(obj.id);
  430. msg.setId(value);
  431. }
  432. }
  433. if (obj.produced !== undefined) {
  434. if (obj.produced === null) {
  435. msg.setProduced(null);
  436. } else {
  437. let value = TypeParsers.parserFor('type.spine.io/spine.core.CommandId').fromObject(obj.produced);
  438. msg.setProduced(value);
  439. }
  440. }
  441. return msg;
  442. };
  443. proto.spine.system.server.EventCausedCommands.Parser = function() {
  444. ObjectParser.call(this);
  445. };
  446. proto.spine.system.server.EventCausedCommands.Parser.prototype = Object.create(ObjectParser.prototype);
  447. proto.spine.system.server.EventCausedCommands.Parser.prototype.constructor = proto.spine.system.server.EventCausedCommands.Parser;
  448. proto.spine.system.server.EventCausedCommands.Parser.prototype.fromObject = function(obj) {
  449. if (obj === null) {
  450. return null;
  451. }
  452. let msg = new proto.spine.system.server.EventCausedCommands();
  453. if (obj.id !== undefined) {
  454. if (obj.id === null) {
  455. msg.setId(null);
  456. } else {
  457. let value = TypeParsers.parserFor('type.spine.io/spine.core.EventId').fromObject(obj.id);
  458. msg.setId(value);
  459. }
  460. }
  461. if (obj.produced !== undefined && obj.produced !== null) {
  462. obj.produced.forEach(
  463. (listItem, index, array) => {
  464. if (listItem === null) {
  465. msg.addProduced(null);
  466. } else {
  467. let value = TypeParsers.parserFor('type.spine.io/spine.core.CommandId').fromObject(listItem);
  468. msg.addProduced(value);
  469. }
  470. }
  471. );
  472. }
  473. return msg;
  474. };
  475. // Generated by Spine ProtoJs Plugin
  476. proto.spine.system.server.EventCausedCommand.typeUrl = function() {
  477. return 'type.spine.io/spine.system.server.EventCausedCommand';
  478. };
  479. // Generated by Spine ProtoJs Plugin
  480. proto.spine.system.server.EventCausedCommands.typeUrl = function() {
  481. return 'type.spine.io/spine.system.server.EventCausedCommands';
  482. };