Source: proto/spine/core/enrichment_pb.js

  1. // source: spine/core/enrichment.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. goog.exportSymbol('proto.spine.core.Enrichment', null, global);
  18. goog.exportSymbol('proto.spine.core.Enrichment.Container', null, global);
  19. goog.exportSymbol('proto.spine.core.Enrichment.ModeCase', 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.Enrichment = function(opt_data) {
  31. jspb.Message.initialize(this, opt_data, 0, -1, null, proto.spine.core.Enrichment.oneofGroups_);
  32. };
  33. goog.inherits(proto.spine.core.Enrichment, jspb.Message);
  34. if (goog.DEBUG && !COMPILED) {
  35. /**
  36. * @public
  37. * @override
  38. */
  39. proto.spine.core.Enrichment.displayName = 'proto.spine.core.Enrichment';
  40. }
  41. /**
  42. * Generated by JsPbCodeGenerator.
  43. * @param {Array=} opt_data Optional initial data array, typically from a
  44. * server response, or constructed directly in Javascript. The array is used
  45. * in place and becomes part of the constructed object. It is not cloned.
  46. * If no data is provided, the constructed object will be empty, but still
  47. * valid.
  48. * @extends {jspb.Message}
  49. * @constructor
  50. */
  51. proto.spine.core.Enrichment.Container = function(opt_data) {
  52. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  53. };
  54. goog.inherits(proto.spine.core.Enrichment.Container, jspb.Message);
  55. if (goog.DEBUG && !COMPILED) {
  56. /**
  57. * @public
  58. * @override
  59. */
  60. proto.spine.core.Enrichment.Container.displayName = 'proto.spine.core.Enrichment.Container';
  61. }
  62. /**
  63. * Oneof group definitions for this message. Each group defines the field
  64. * numbers belonging to that group. When of these fields' value is set, all
  65. * other fields in the group are cleared. During deserialization, if multiple
  66. * fields are encountered for a group, only the last value seen will be kept.
  67. * @private {!Array<!Array<number>>}
  68. * @const
  69. */
  70. proto.spine.core.Enrichment.oneofGroups_ = [[1,2]];
  71. /**
  72. * @enum {number}
  73. */
  74. proto.spine.core.Enrichment.ModeCase = {
  75. MODE_NOT_SET: 0,
  76. DO_NOT_ENRICH: 1,
  77. CONTAINER: 2
  78. };
  79. /**
  80. * @return {proto.spine.core.Enrichment.ModeCase}
  81. */
  82. proto.spine.core.Enrichment.prototype.getModeCase = function() {
  83. return /** @type {proto.spine.core.Enrichment.ModeCase} */(jspb.Message.computeOneofCase(this, proto.spine.core.Enrichment.oneofGroups_[0]));
  84. };
  85. if (jspb.Message.GENERATE_TO_OBJECT) {
  86. /**
  87. * Creates an object representation of this proto.
  88. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  89. * Optional fields that are not set will be set to undefined.
  90. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  91. * For the list of reserved names please see:
  92. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  93. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  94. * JSPB instance for transitional soy proto support:
  95. * http://goto/soy-param-migration
  96. * @return {!Object}
  97. */
  98. proto.spine.core.Enrichment.prototype.toObject = function(opt_includeInstance) {
  99. return proto.spine.core.Enrichment.toObject(opt_includeInstance, this);
  100. };
  101. /**
  102. * Static version of the {@see toObject} method.
  103. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  104. * the JSPB instance for transitional soy proto support:
  105. * http://goto/soy-param-migration
  106. * @param {!proto.spine.core.Enrichment} msg The msg instance to transform.
  107. * @return {!Object}
  108. * @suppress {unusedLocalVariables} f is only used for nested messages
  109. */
  110. proto.spine.core.Enrichment.toObject = function(includeInstance, msg) {
  111. var f, obj = {
  112. doNotEnrich: jspb.Message.getBooleanFieldWithDefault(msg, 1, false),
  113. container: (f = msg.getContainer()) && proto.spine.core.Enrichment.Container.toObject(includeInstance, f)
  114. };
  115. if (includeInstance) {
  116. obj.$jspbMessageInstance = msg;
  117. }
  118. return obj;
  119. };
  120. }
  121. /**
  122. * Deserializes binary data (in protobuf wire format).
  123. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  124. * @return {!proto.spine.core.Enrichment}
  125. */
  126. proto.spine.core.Enrichment.deserializeBinary = function(bytes) {
  127. var reader = new jspb.BinaryReader(bytes);
  128. var msg = new proto.spine.core.Enrichment;
  129. return proto.spine.core.Enrichment.deserializeBinaryFromReader(msg, reader);
  130. };
  131. /**
  132. * Deserializes binary data (in protobuf wire format) from the
  133. * given reader into the given message object.
  134. * @param {!proto.spine.core.Enrichment} msg The message object to deserialize into.
  135. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  136. * @return {!proto.spine.core.Enrichment}
  137. */
  138. proto.spine.core.Enrichment.deserializeBinaryFromReader = function(msg, reader) {
  139. while (reader.nextField()) {
  140. if (reader.isEndGroup()) {
  141. break;
  142. }
  143. var field = reader.getFieldNumber();
  144. switch (field) {
  145. case 1:
  146. var value = /** @type {boolean} */ (reader.readBool());
  147. msg.setDoNotEnrich(value);
  148. break;
  149. case 2:
  150. var value = new proto.spine.core.Enrichment.Container;
  151. reader.readMessage(value,proto.spine.core.Enrichment.Container.deserializeBinaryFromReader);
  152. msg.setContainer(value);
  153. break;
  154. default:
  155. reader.skipField();
  156. break;
  157. }
  158. }
  159. return msg;
  160. };
  161. /**
  162. * Serializes the message to binary data (in protobuf wire format).
  163. * @return {!Uint8Array}
  164. */
  165. proto.spine.core.Enrichment.prototype.serializeBinary = function() {
  166. var writer = new jspb.BinaryWriter();
  167. proto.spine.core.Enrichment.serializeBinaryToWriter(this, writer);
  168. return writer.getResultBuffer();
  169. };
  170. /**
  171. * Serializes the given message to binary data (in protobuf wire
  172. * format), writing to the given BinaryWriter.
  173. * @param {!proto.spine.core.Enrichment} message
  174. * @param {!jspb.BinaryWriter} writer
  175. * @suppress {unusedLocalVariables} f is only used for nested messages
  176. */
  177. proto.spine.core.Enrichment.serializeBinaryToWriter = function(message, writer) {
  178. var f = undefined;
  179. f = /** @type {boolean} */ (jspb.Message.getField(message, 1));
  180. if (f != null) {
  181. writer.writeBool(
  182. 1,
  183. f
  184. );
  185. }
  186. f = message.getContainer();
  187. if (f != null) {
  188. writer.writeMessage(
  189. 2,
  190. f,
  191. proto.spine.core.Enrichment.Container.serializeBinaryToWriter
  192. );
  193. }
  194. };
  195. if (jspb.Message.GENERATE_TO_OBJECT) {
  196. /**
  197. * Creates an object representation of this proto.
  198. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  199. * Optional fields that are not set will be set to undefined.
  200. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  201. * For the list of reserved names please see:
  202. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  203. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  204. * JSPB instance for transitional soy proto support:
  205. * http://goto/soy-param-migration
  206. * @return {!Object}
  207. */
  208. proto.spine.core.Enrichment.Container.prototype.toObject = function(opt_includeInstance) {
  209. return proto.spine.core.Enrichment.Container.toObject(opt_includeInstance, this);
  210. };
  211. /**
  212. * Static version of the {@see toObject} method.
  213. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  214. * the JSPB instance for transitional soy proto support:
  215. * http://goto/soy-param-migration
  216. * @param {!proto.spine.core.Enrichment.Container} msg The msg instance to transform.
  217. * @return {!Object}
  218. * @suppress {unusedLocalVariables} f is only used for nested messages
  219. */
  220. proto.spine.core.Enrichment.Container.toObject = function(includeInstance, msg) {
  221. var f, obj = {
  222. itemsMap: (f = msg.getItemsMap()) ? f.toObject(includeInstance, proto.google.protobuf.Any.toObject) : []
  223. };
  224. if (includeInstance) {
  225. obj.$jspbMessageInstance = msg;
  226. }
  227. return obj;
  228. };
  229. }
  230. /**
  231. * Deserializes binary data (in protobuf wire format).
  232. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  233. * @return {!proto.spine.core.Enrichment.Container}
  234. */
  235. proto.spine.core.Enrichment.Container.deserializeBinary = function(bytes) {
  236. var reader = new jspb.BinaryReader(bytes);
  237. var msg = new proto.spine.core.Enrichment.Container;
  238. return proto.spine.core.Enrichment.Container.deserializeBinaryFromReader(msg, reader);
  239. };
  240. /**
  241. * Deserializes binary data (in protobuf wire format) from the
  242. * given reader into the given message object.
  243. * @param {!proto.spine.core.Enrichment.Container} msg The message object to deserialize into.
  244. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  245. * @return {!proto.spine.core.Enrichment.Container}
  246. */
  247. proto.spine.core.Enrichment.Container.deserializeBinaryFromReader = function(msg, reader) {
  248. while (reader.nextField()) {
  249. if (reader.isEndGroup()) {
  250. break;
  251. }
  252. var field = reader.getFieldNumber();
  253. switch (field) {
  254. case 1:
  255. var value = msg.getItemsMap();
  256. reader.readMessage(value, function(message, reader) {
  257. jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Any.deserializeBinaryFromReader, "", new proto.google.protobuf.Any());
  258. });
  259. break;
  260. default:
  261. reader.skipField();
  262. break;
  263. }
  264. }
  265. return msg;
  266. };
  267. /**
  268. * Serializes the message to binary data (in protobuf wire format).
  269. * @return {!Uint8Array}
  270. */
  271. proto.spine.core.Enrichment.Container.prototype.serializeBinary = function() {
  272. var writer = new jspb.BinaryWriter();
  273. proto.spine.core.Enrichment.Container.serializeBinaryToWriter(this, writer);
  274. return writer.getResultBuffer();
  275. };
  276. /**
  277. * Serializes the given message to binary data (in protobuf wire
  278. * format), writing to the given BinaryWriter.
  279. * @param {!proto.spine.core.Enrichment.Container} message
  280. * @param {!jspb.BinaryWriter} writer
  281. * @suppress {unusedLocalVariables} f is only used for nested messages
  282. */
  283. proto.spine.core.Enrichment.Container.serializeBinaryToWriter = function(message, writer) {
  284. var f = undefined;
  285. f = message.getItemsMap(true);
  286. if (f && f.getLength() > 0) {
  287. f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.google.protobuf.Any.serializeBinaryToWriter);
  288. }
  289. };
  290. /**
  291. * map<string, google.protobuf.Any> items = 1;
  292. * @param {boolean=} opt_noLazyCreate Do not create the map if
  293. * empty, instead returning `undefined`
  294. * @return {!jspb.Map<string,!proto.google.protobuf.Any>}
  295. */
  296. proto.spine.core.Enrichment.Container.prototype.getItemsMap = function(opt_noLazyCreate) {
  297. return /** @type {!jspb.Map<string,!proto.google.protobuf.Any>} */ (
  298. jspb.Message.getMapField(this, 1, opt_noLazyCreate,
  299. proto.google.protobuf.Any));
  300. };
  301. /**
  302. * Clears values from the map. The map will be non-null.
  303. * @return {!proto.spine.core.Enrichment.Container} returns this
  304. */
  305. proto.spine.core.Enrichment.Container.prototype.clearItemsMap = function() {
  306. this.getItemsMap().clear();
  307. return this;};
  308. /**
  309. * optional bool do_not_enrich = 1;
  310. * @return {boolean}
  311. */
  312. proto.spine.core.Enrichment.prototype.getDoNotEnrich = function() {
  313. return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false));
  314. };
  315. /**
  316. * @param {boolean} value
  317. * @return {!proto.spine.core.Enrichment} returns this
  318. */
  319. proto.spine.core.Enrichment.prototype.setDoNotEnrich = function(value) {
  320. return jspb.Message.setOneofField(this, 1, proto.spine.core.Enrichment.oneofGroups_[0], value);
  321. };
  322. /**
  323. * Clears the field making it undefined.
  324. * @return {!proto.spine.core.Enrichment} returns this
  325. */
  326. proto.spine.core.Enrichment.prototype.clearDoNotEnrich = function() {
  327. return jspb.Message.setOneofField(this, 1, proto.spine.core.Enrichment.oneofGroups_[0], undefined);
  328. };
  329. /**
  330. * Returns whether this field is set.
  331. * @return {boolean}
  332. */
  333. proto.spine.core.Enrichment.prototype.hasDoNotEnrich = function() {
  334. return jspb.Message.getField(this, 1) != null;
  335. };
  336. /**
  337. * optional Container container = 2;
  338. * @return {?proto.spine.core.Enrichment.Container}
  339. */
  340. proto.spine.core.Enrichment.prototype.getContainer = function() {
  341. return /** @type{?proto.spine.core.Enrichment.Container} */ (
  342. jspb.Message.getWrapperField(this, proto.spine.core.Enrichment.Container, 2));
  343. };
  344. /**
  345. * @param {?proto.spine.core.Enrichment.Container|undefined} value
  346. * @return {!proto.spine.core.Enrichment} returns this
  347. */
  348. proto.spine.core.Enrichment.prototype.setContainer = function(value) {
  349. return jspb.Message.setOneofWrapperField(this, 2, proto.spine.core.Enrichment.oneofGroups_[0], value);
  350. };
  351. /**
  352. * Clears the message field making it undefined.
  353. * @return {!proto.spine.core.Enrichment} returns this
  354. */
  355. proto.spine.core.Enrichment.prototype.clearContainer = function() {
  356. return this.setContainer(undefined);
  357. };
  358. /**
  359. * Returns whether this field is set.
  360. * @return {boolean}
  361. */
  362. proto.spine.core.Enrichment.prototype.hasContainer = function() {
  363. return jspb.Message.getField(this, 2) != null;
  364. };
  365. goog.object.extend(exports, proto.spine.core);
  366. // Generated by Spine ProtoJs Plugin
  367. let ObjectParser = require('../../../client/parser/object-parser.js').default;
  368. let TypeParsers = require('../../../client/parser/type-parsers.js').default;
  369. proto.spine.core.Enrichment.Container.Parser = function() {
  370. ObjectParser.call(this);
  371. };
  372. proto.spine.core.Enrichment.Container.Parser.prototype = Object.create(ObjectParser.prototype);
  373. proto.spine.core.Enrichment.Container.Parser.prototype.constructor = proto.spine.core.Enrichment.Container.Parser;
  374. proto.spine.core.Enrichment.Container.Parser.prototype.fromObject = function(obj) {
  375. if (obj === null) {
  376. return null;
  377. }
  378. let msg = new proto.spine.core.Enrichment.Container();
  379. if (obj.items !== undefined && obj.items !== null) {
  380. for (let attribute in obj.items) {
  381. if (obj.items.hasOwnProperty(attribute)) {
  382. let mapKey = attribute;
  383. if (obj.items[attribute] === null) {
  384. msg.getItemsMap().set(mapKey, null);
  385. } else {
  386. let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.items[attribute]);
  387. msg.getItemsMap().set(mapKey, value);
  388. }
  389. }
  390. }
  391. }
  392. return msg;
  393. };
  394. proto.spine.core.Enrichment.Parser = function() {
  395. ObjectParser.call(this);
  396. };
  397. proto.spine.core.Enrichment.Parser.prototype = Object.create(ObjectParser.prototype);
  398. proto.spine.core.Enrichment.Parser.prototype.constructor = proto.spine.core.Enrichment.Parser;
  399. proto.spine.core.Enrichment.Parser.prototype.fromObject = function(obj) {
  400. if (obj === null) {
  401. return null;
  402. }
  403. let msg = new proto.spine.core.Enrichment();
  404. if (obj.doNotEnrich !== undefined) {
  405. if (obj.doNotEnrich !== null) {
  406. let value = obj.doNotEnrich;
  407. msg.setDoNotEnrich(value);
  408. }
  409. }
  410. if (obj.container !== undefined) {
  411. if (obj.container === null) {
  412. msg.setContainer(null);
  413. } else {
  414. let value = TypeParsers.parserFor('type.spine.io/spine.core.Enrichment.Container').fromObject(obj.container);
  415. msg.setContainer(value);
  416. }
  417. }
  418. return msg;
  419. };
  420. // Generated by Spine ProtoJs Plugin
  421. proto.spine.core.Enrichment.Container.typeUrl = function() {
  422. return 'type.spine.io/spine.core.Enrichment.Container';
  423. };
  424. // Generated by Spine ProtoJs Plugin
  425. proto.spine.core.Enrichment.typeUrl = function() {
  426. return 'type.spine.io/spine.core.Enrichment';
  427. };