Source: proto/spine/core/response_pb.js

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