Source: proto/spine/core/actor_context_pb.js

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