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

  1. // source: spine/system/server/scheduled_command.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 google_protobuf_timestamp_pb = require('../../../google/protobuf/timestamp_pb.js');
  16. goog.object.extend(proto, google_protobuf_timestamp_pb);
  17. var spine_core_command_pb = require('../../../spine/core/command_pb.js');
  18. goog.object.extend(proto, spine_core_command_pb);
  19. goog.exportSymbol('proto.spine.system.server.ScheduledCommandRecord', null, global);
  20. /**
  21. * Generated by JsPbCodeGenerator.
  22. * @param {Array=} opt_data Optional initial data array, typically from a
  23. * server response, or constructed directly in Javascript. The array is used
  24. * in place and becomes part of the constructed object. It is not cloned.
  25. * If no data is provided, the constructed object will be empty, but still
  26. * valid.
  27. * @extends {jspb.Message}
  28. * @constructor
  29. */
  30. proto.spine.system.server.ScheduledCommandRecord = function(opt_data) {
  31. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  32. };
  33. goog.inherits(proto.spine.system.server.ScheduledCommandRecord, jspb.Message);
  34. if (goog.DEBUG && !COMPILED) {
  35. /**
  36. * @public
  37. * @override
  38. */
  39. proto.spine.system.server.ScheduledCommandRecord.displayName = 'proto.spine.system.server.ScheduledCommandRecord';
  40. }
  41. if (jspb.Message.GENERATE_TO_OBJECT) {
  42. /**
  43. * Creates an object representation of this proto.
  44. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  45. * Optional fields that are not set will be set to undefined.
  46. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  47. * For the list of reserved names please see:
  48. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  49. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  50. * JSPB instance for transitional soy proto support:
  51. * http://goto/soy-param-migration
  52. * @return {!Object}
  53. */
  54. proto.spine.system.server.ScheduledCommandRecord.prototype.toObject = function(opt_includeInstance) {
  55. return proto.spine.system.server.ScheduledCommandRecord.toObject(opt_includeInstance, this);
  56. };
  57. /**
  58. * Static version of the {@see toObject} method.
  59. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  60. * the JSPB instance for transitional soy proto support:
  61. * http://goto/soy-param-migration
  62. * @param {!proto.spine.system.server.ScheduledCommandRecord} msg The msg instance to transform.
  63. * @return {!Object}
  64. * @suppress {unusedLocalVariables} f is only used for nested messages
  65. */
  66. proto.spine.system.server.ScheduledCommandRecord.toObject = function(includeInstance, msg) {
  67. var f, obj = {
  68. id: (f = msg.getId()) && spine_core_command_pb.CommandId.toObject(includeInstance, f),
  69. command: (f = msg.getCommand()) && spine_core_command_pb.Command.toObject(includeInstance, f),
  70. schedulingTime: (f = msg.getSchedulingTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
  71. };
  72. if (includeInstance) {
  73. obj.$jspbMessageInstance = msg;
  74. }
  75. return obj;
  76. };
  77. }
  78. /**
  79. * Deserializes binary data (in protobuf wire format).
  80. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  81. * @return {!proto.spine.system.server.ScheduledCommandRecord}
  82. */
  83. proto.spine.system.server.ScheduledCommandRecord.deserializeBinary = function(bytes) {
  84. var reader = new jspb.BinaryReader(bytes);
  85. var msg = new proto.spine.system.server.ScheduledCommandRecord;
  86. return proto.spine.system.server.ScheduledCommandRecord.deserializeBinaryFromReader(msg, reader);
  87. };
  88. /**
  89. * Deserializes binary data (in protobuf wire format) from the
  90. * given reader into the given message object.
  91. * @param {!proto.spine.system.server.ScheduledCommandRecord} msg The message object to deserialize into.
  92. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  93. * @return {!proto.spine.system.server.ScheduledCommandRecord}
  94. */
  95. proto.spine.system.server.ScheduledCommandRecord.deserializeBinaryFromReader = function(msg, reader) {
  96. while (reader.nextField()) {
  97. if (reader.isEndGroup()) {
  98. break;
  99. }
  100. var field = reader.getFieldNumber();
  101. switch (field) {
  102. case 1:
  103. var value = new spine_core_command_pb.CommandId;
  104. reader.readMessage(value,spine_core_command_pb.CommandId.deserializeBinaryFromReader);
  105. msg.setId(value);
  106. break;
  107. case 2:
  108. var value = new spine_core_command_pb.Command;
  109. reader.readMessage(value,spine_core_command_pb.Command.deserializeBinaryFromReader);
  110. msg.setCommand(value);
  111. break;
  112. case 3:
  113. var value = new google_protobuf_timestamp_pb.Timestamp;
  114. reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
  115. msg.setSchedulingTime(value);
  116. break;
  117. default:
  118. reader.skipField();
  119. break;
  120. }
  121. }
  122. return msg;
  123. };
  124. /**
  125. * Serializes the message to binary data (in protobuf wire format).
  126. * @return {!Uint8Array}
  127. */
  128. proto.spine.system.server.ScheduledCommandRecord.prototype.serializeBinary = function() {
  129. var writer = new jspb.BinaryWriter();
  130. proto.spine.system.server.ScheduledCommandRecord.serializeBinaryToWriter(this, writer);
  131. return writer.getResultBuffer();
  132. };
  133. /**
  134. * Serializes the given message to binary data (in protobuf wire
  135. * format), writing to the given BinaryWriter.
  136. * @param {!proto.spine.system.server.ScheduledCommandRecord} message
  137. * @param {!jspb.BinaryWriter} writer
  138. * @suppress {unusedLocalVariables} f is only used for nested messages
  139. */
  140. proto.spine.system.server.ScheduledCommandRecord.serializeBinaryToWriter = function(message, writer) {
  141. var f = undefined;
  142. f = message.getId();
  143. if (f != null) {
  144. writer.writeMessage(
  145. 1,
  146. f,
  147. spine_core_command_pb.CommandId.serializeBinaryToWriter
  148. );
  149. }
  150. f = message.getCommand();
  151. if (f != null) {
  152. writer.writeMessage(
  153. 2,
  154. f,
  155. spine_core_command_pb.Command.serializeBinaryToWriter
  156. );
  157. }
  158. f = message.getSchedulingTime();
  159. if (f != null) {
  160. writer.writeMessage(
  161. 3,
  162. f,
  163. google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
  164. );
  165. }
  166. };
  167. /**
  168. * optional spine.core.CommandId id = 1;
  169. * @return {?proto.spine.core.CommandId}
  170. */
  171. proto.spine.system.server.ScheduledCommandRecord.prototype.getId = function() {
  172. return /** @type{?proto.spine.core.CommandId} */ (
  173. jspb.Message.getWrapperField(this, spine_core_command_pb.CommandId, 1));
  174. };
  175. /**
  176. * @param {?proto.spine.core.CommandId|undefined} value
  177. * @return {!proto.spine.system.server.ScheduledCommandRecord} returns this
  178. */
  179. proto.spine.system.server.ScheduledCommandRecord.prototype.setId = function(value) {
  180. return jspb.Message.setWrapperField(this, 1, value);
  181. };
  182. /**
  183. * Clears the message field making it undefined.
  184. * @return {!proto.spine.system.server.ScheduledCommandRecord} returns this
  185. */
  186. proto.spine.system.server.ScheduledCommandRecord.prototype.clearId = function() {
  187. return this.setId(undefined);
  188. };
  189. /**
  190. * Returns whether this field is set.
  191. * @return {boolean}
  192. */
  193. proto.spine.system.server.ScheduledCommandRecord.prototype.hasId = function() {
  194. return jspb.Message.getField(this, 1) != null;
  195. };
  196. /**
  197. * optional spine.core.Command command = 2;
  198. * @return {?proto.spine.core.Command}
  199. */
  200. proto.spine.system.server.ScheduledCommandRecord.prototype.getCommand = function() {
  201. return /** @type{?proto.spine.core.Command} */ (
  202. jspb.Message.getWrapperField(this, spine_core_command_pb.Command, 2));
  203. };
  204. /**
  205. * @param {?proto.spine.core.Command|undefined} value
  206. * @return {!proto.spine.system.server.ScheduledCommandRecord} returns this
  207. */
  208. proto.spine.system.server.ScheduledCommandRecord.prototype.setCommand = function(value) {
  209. return jspb.Message.setWrapperField(this, 2, value);
  210. };
  211. /**
  212. * Clears the message field making it undefined.
  213. * @return {!proto.spine.system.server.ScheduledCommandRecord} returns this
  214. */
  215. proto.spine.system.server.ScheduledCommandRecord.prototype.clearCommand = function() {
  216. return this.setCommand(undefined);
  217. };
  218. /**
  219. * Returns whether this field is set.
  220. * @return {boolean}
  221. */
  222. proto.spine.system.server.ScheduledCommandRecord.prototype.hasCommand = function() {
  223. return jspb.Message.getField(this, 2) != null;
  224. };
  225. /**
  226. * optional google.protobuf.Timestamp scheduling_time = 3;
  227. * @return {?proto.google.protobuf.Timestamp}
  228. */
  229. proto.spine.system.server.ScheduledCommandRecord.prototype.getSchedulingTime = function() {
  230. return /** @type{?proto.google.protobuf.Timestamp} */ (
  231. jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
  232. };
  233. /**
  234. * @param {?proto.google.protobuf.Timestamp|undefined} value
  235. * @return {!proto.spine.system.server.ScheduledCommandRecord} returns this
  236. */
  237. proto.spine.system.server.ScheduledCommandRecord.prototype.setSchedulingTime = function(value) {
  238. return jspb.Message.setWrapperField(this, 3, value);
  239. };
  240. /**
  241. * Clears the message field making it undefined.
  242. * @return {!proto.spine.system.server.ScheduledCommandRecord} returns this
  243. */
  244. proto.spine.system.server.ScheduledCommandRecord.prototype.clearSchedulingTime = function() {
  245. return this.setSchedulingTime(undefined);
  246. };
  247. /**
  248. * Returns whether this field is set.
  249. * @return {boolean}
  250. */
  251. proto.spine.system.server.ScheduledCommandRecord.prototype.hasSchedulingTime = function() {
  252. return jspb.Message.getField(this, 3) != null;
  253. };
  254. goog.object.extend(exports, proto.spine.system.server);
  255. // Generated by Spine ProtoJs Plugin
  256. let ObjectParser = require('../../../../client/parser/object-parser.js').default;
  257. let TypeParsers = require('../../../../client/parser/type-parsers.js').default;
  258. proto.spine.system.server.ScheduledCommandRecord.Parser = function() {
  259. ObjectParser.call(this);
  260. };
  261. proto.spine.system.server.ScheduledCommandRecord.Parser.prototype = Object.create(ObjectParser.prototype);
  262. proto.spine.system.server.ScheduledCommandRecord.Parser.prototype.constructor = proto.spine.system.server.ScheduledCommandRecord.Parser;
  263. proto.spine.system.server.ScheduledCommandRecord.Parser.prototype.fromObject = function(obj) {
  264. if (obj === null) {
  265. return null;
  266. }
  267. let msg = new proto.spine.system.server.ScheduledCommandRecord();
  268. if (obj.id !== undefined) {
  269. if (obj.id === null) {
  270. msg.setId(null);
  271. } else {
  272. let value = TypeParsers.parserFor('type.spine.io/spine.core.CommandId').fromObject(obj.id);
  273. msg.setId(value);
  274. }
  275. }
  276. if (obj.command !== undefined) {
  277. if (obj.command === null) {
  278. msg.setCommand(null);
  279. } else {
  280. let value = TypeParsers.parserFor('type.spine.io/spine.core.Command').fromObject(obj.command);
  281. msg.setCommand(value);
  282. }
  283. }
  284. if (obj.schedulingTime !== undefined) {
  285. if (obj.schedulingTime === null) {
  286. msg.setSchedulingTime(null);
  287. } else {
  288. let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Timestamp').fromObject(obj.schedulingTime);
  289. msg.setSchedulingTime(value);
  290. }
  291. }
  292. return msg;
  293. };
  294. // Generated by Spine ProtoJs Plugin
  295. proto.spine.system.server.ScheduledCommandRecord.typeUrl = function() {
  296. return 'type.spine.io/spine.system.server.ScheduledCommandRecord';
  297. };