Source: proto/spine/core/ack_pb.js

  1. // source: spine/core/ack.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_any_pb = require('../../google/protobuf/any_pb.js');
  16. goog.object.extend(proto, google_protobuf_any_pb);
  17. var spine_core_response_pb = require('../../spine/core/response_pb.js');
  18. goog.object.extend(proto, spine_core_response_pb);
  19. goog.exportSymbol('proto.spine.core.Ack', 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.core.Ack = function(opt_data) {
  31. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  32. };
  33. goog.inherits(proto.spine.core.Ack, jspb.Message);
  34. if (goog.DEBUG && !COMPILED) {
  35. /**
  36. * @public
  37. * @override
  38. */
  39. proto.spine.core.Ack.displayName = 'proto.spine.core.Ack';
  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.core.Ack.prototype.toObject = function(opt_includeInstance) {
  55. return proto.spine.core.Ack.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.core.Ack} msg The msg instance to transform.
  63. * @return {!Object}
  64. * @suppress {unusedLocalVariables} f is only used for nested messages
  65. */
  66. proto.spine.core.Ack.toObject = function(includeInstance, msg) {
  67. var f, obj = {
  68. messageId: (f = msg.getMessageId()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
  69. status: (f = msg.getStatus()) && spine_core_response_pb.Status.toObject(includeInstance, f)
  70. };
  71. if (includeInstance) {
  72. obj.$jspbMessageInstance = msg;
  73. }
  74. return obj;
  75. };
  76. }
  77. /**
  78. * Deserializes binary data (in protobuf wire format).
  79. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  80. * @return {!proto.spine.core.Ack}
  81. */
  82. proto.spine.core.Ack.deserializeBinary = function(bytes) {
  83. var reader = new jspb.BinaryReader(bytes);
  84. var msg = new proto.spine.core.Ack;
  85. return proto.spine.core.Ack.deserializeBinaryFromReader(msg, reader);
  86. };
  87. /**
  88. * Deserializes binary data (in protobuf wire format) from the
  89. * given reader into the given message object.
  90. * @param {!proto.spine.core.Ack} msg The message object to deserialize into.
  91. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  92. * @return {!proto.spine.core.Ack}
  93. */
  94. proto.spine.core.Ack.deserializeBinaryFromReader = function(msg, reader) {
  95. while (reader.nextField()) {
  96. if (reader.isEndGroup()) {
  97. break;
  98. }
  99. var field = reader.getFieldNumber();
  100. switch (field) {
  101. case 1:
  102. var value = new google_protobuf_any_pb.Any;
  103. reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
  104. msg.setMessageId(value);
  105. break;
  106. case 2:
  107. var value = new spine_core_response_pb.Status;
  108. reader.readMessage(value,spine_core_response_pb.Status.deserializeBinaryFromReader);
  109. msg.setStatus(value);
  110. break;
  111. default:
  112. reader.skipField();
  113. break;
  114. }
  115. }
  116. return msg;
  117. };
  118. /**
  119. * Serializes the message to binary data (in protobuf wire format).
  120. * @return {!Uint8Array}
  121. */
  122. proto.spine.core.Ack.prototype.serializeBinary = function() {
  123. var writer = new jspb.BinaryWriter();
  124. proto.spine.core.Ack.serializeBinaryToWriter(this, writer);
  125. return writer.getResultBuffer();
  126. };
  127. /**
  128. * Serializes the given message to binary data (in protobuf wire
  129. * format), writing to the given BinaryWriter.
  130. * @param {!proto.spine.core.Ack} message
  131. * @param {!jspb.BinaryWriter} writer
  132. * @suppress {unusedLocalVariables} f is only used for nested messages
  133. */
  134. proto.spine.core.Ack.serializeBinaryToWriter = function(message, writer) {
  135. var f = undefined;
  136. f = message.getMessageId();
  137. if (f != null) {
  138. writer.writeMessage(
  139. 1,
  140. f,
  141. google_protobuf_any_pb.Any.serializeBinaryToWriter
  142. );
  143. }
  144. f = message.getStatus();
  145. if (f != null) {
  146. writer.writeMessage(
  147. 2,
  148. f,
  149. spine_core_response_pb.Status.serializeBinaryToWriter
  150. );
  151. }
  152. };
  153. /**
  154. * optional google.protobuf.Any message_id = 1;
  155. * @return {?proto.google.protobuf.Any}
  156. */
  157. proto.spine.core.Ack.prototype.getMessageId = function() {
  158. return /** @type{?proto.google.protobuf.Any} */ (
  159. jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 1));
  160. };
  161. /**
  162. * @param {?proto.google.protobuf.Any|undefined} value
  163. * @return {!proto.spine.core.Ack} returns this
  164. */
  165. proto.spine.core.Ack.prototype.setMessageId = function(value) {
  166. return jspb.Message.setWrapperField(this, 1, value);
  167. };
  168. /**
  169. * Clears the message field making it undefined.
  170. * @return {!proto.spine.core.Ack} returns this
  171. */
  172. proto.spine.core.Ack.prototype.clearMessageId = function() {
  173. return this.setMessageId(undefined);
  174. };
  175. /**
  176. * Returns whether this field is set.
  177. * @return {boolean}
  178. */
  179. proto.spine.core.Ack.prototype.hasMessageId = function() {
  180. return jspb.Message.getField(this, 1) != null;
  181. };
  182. /**
  183. * optional Status status = 2;
  184. * @return {?proto.spine.core.Status}
  185. */
  186. proto.spine.core.Ack.prototype.getStatus = function() {
  187. return /** @type{?proto.spine.core.Status} */ (
  188. jspb.Message.getWrapperField(this, spine_core_response_pb.Status, 2));
  189. };
  190. /**
  191. * @param {?proto.spine.core.Status|undefined} value
  192. * @return {!proto.spine.core.Ack} returns this
  193. */
  194. proto.spine.core.Ack.prototype.setStatus = function(value) {
  195. return jspb.Message.setWrapperField(this, 2, value);
  196. };
  197. /**
  198. * Clears the message field making it undefined.
  199. * @return {!proto.spine.core.Ack} returns this
  200. */
  201. proto.spine.core.Ack.prototype.clearStatus = function() {
  202. return this.setStatus(undefined);
  203. };
  204. /**
  205. * Returns whether this field is set.
  206. * @return {boolean}
  207. */
  208. proto.spine.core.Ack.prototype.hasStatus = function() {
  209. return jspb.Message.getField(this, 2) != null;
  210. };
  211. goog.object.extend(exports, proto.spine.core);
  212. // Generated by Spine ProtoJs Plugin
  213. let ObjectParser = require('../../../client/parser/object-parser.js').default;
  214. let TypeParsers = require('../../../client/parser/type-parsers.js').default;
  215. proto.spine.core.Ack.Parser = function() {
  216. ObjectParser.call(this);
  217. };
  218. proto.spine.core.Ack.Parser.prototype = Object.create(ObjectParser.prototype);
  219. proto.spine.core.Ack.Parser.prototype.constructor = proto.spine.core.Ack.Parser;
  220. proto.spine.core.Ack.Parser.prototype.fromObject = function(obj) {
  221. if (obj === null) {
  222. return null;
  223. }
  224. let msg = new proto.spine.core.Ack();
  225. if (obj.messageId !== undefined) {
  226. if (obj.messageId === null) {
  227. msg.setMessageId(null);
  228. } else {
  229. let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.messageId);
  230. msg.setMessageId(value);
  231. }
  232. }
  233. if (obj.status !== undefined) {
  234. if (obj.status === null) {
  235. msg.setStatus(null);
  236. } else {
  237. let value = TypeParsers.parserFor('type.spine.io/spine.core.Status').fromObject(obj.status);
  238. msg.setStatus(value);
  239. }
  240. }
  241. return msg;
  242. };
  243. // Generated by Spine ProtoJs Plugin
  244. proto.spine.core.Ack.typeUrl = function() {
  245. return 'type.spine.io/spine.core.Ack';
  246. };