Source: proto/spine/core/user_id_pb.js

  1. // source: spine/core/user_id.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. goog.exportSymbol('proto.spine.core.UserId', null, global);
  16. /**
  17. * Generated by JsPbCodeGenerator.
  18. * @param {Array=} opt_data Optional initial data array, typically from a
  19. * server response, or constructed directly in Javascript. The array is used
  20. * in place and becomes part of the constructed object. It is not cloned.
  21. * If no data is provided, the constructed object will be empty, but still
  22. * valid.
  23. * @extends {jspb.Message}
  24. * @constructor
  25. */
  26. proto.spine.core.UserId = function(opt_data) {
  27. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  28. };
  29. goog.inherits(proto.spine.core.UserId, jspb.Message);
  30. if (goog.DEBUG && !COMPILED) {
  31. /**
  32. * @public
  33. * @override
  34. */
  35. proto.spine.core.UserId.displayName = 'proto.spine.core.UserId';
  36. }
  37. if (jspb.Message.GENERATE_TO_OBJECT) {
  38. /**
  39. * Creates an object representation of this proto.
  40. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  41. * Optional fields that are not set will be set to undefined.
  42. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  43. * For the list of reserved names please see:
  44. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  45. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  46. * JSPB instance for transitional soy proto support:
  47. * http://goto/soy-param-migration
  48. * @return {!Object}
  49. */
  50. proto.spine.core.UserId.prototype.toObject = function(opt_includeInstance) {
  51. return proto.spine.core.UserId.toObject(opt_includeInstance, this);
  52. };
  53. /**
  54. * Static version of the {@see toObject} method.
  55. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  56. * the JSPB instance for transitional soy proto support:
  57. * http://goto/soy-param-migration
  58. * @param {!proto.spine.core.UserId} msg The msg instance to transform.
  59. * @return {!Object}
  60. * @suppress {unusedLocalVariables} f is only used for nested messages
  61. */
  62. proto.spine.core.UserId.toObject = function(includeInstance, msg) {
  63. var f, obj = {
  64. value: jspb.Message.getFieldWithDefault(msg, 1, "")
  65. };
  66. if (includeInstance) {
  67. obj.$jspbMessageInstance = msg;
  68. }
  69. return obj;
  70. };
  71. }
  72. /**
  73. * Deserializes binary data (in protobuf wire format).
  74. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  75. * @return {!proto.spine.core.UserId}
  76. */
  77. proto.spine.core.UserId.deserializeBinary = function(bytes) {
  78. var reader = new jspb.BinaryReader(bytes);
  79. var msg = new proto.spine.core.UserId;
  80. return proto.spine.core.UserId.deserializeBinaryFromReader(msg, reader);
  81. };
  82. /**
  83. * Deserializes binary data (in protobuf wire format) from the
  84. * given reader into the given message object.
  85. * @param {!proto.spine.core.UserId} msg The message object to deserialize into.
  86. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  87. * @return {!proto.spine.core.UserId}
  88. */
  89. proto.spine.core.UserId.deserializeBinaryFromReader = function(msg, reader) {
  90. while (reader.nextField()) {
  91. if (reader.isEndGroup()) {
  92. break;
  93. }
  94. var field = reader.getFieldNumber();
  95. switch (field) {
  96. case 1:
  97. var value = /** @type {string} */ (reader.readString());
  98. msg.setValue(value);
  99. break;
  100. default:
  101. reader.skipField();
  102. break;
  103. }
  104. }
  105. return msg;
  106. };
  107. /**
  108. * Serializes the message to binary data (in protobuf wire format).
  109. * @return {!Uint8Array}
  110. */
  111. proto.spine.core.UserId.prototype.serializeBinary = function() {
  112. var writer = new jspb.BinaryWriter();
  113. proto.spine.core.UserId.serializeBinaryToWriter(this, writer);
  114. return writer.getResultBuffer();
  115. };
  116. /**
  117. * Serializes the given message to binary data (in protobuf wire
  118. * format), writing to the given BinaryWriter.
  119. * @param {!proto.spine.core.UserId} message
  120. * @param {!jspb.BinaryWriter} writer
  121. * @suppress {unusedLocalVariables} f is only used for nested messages
  122. */
  123. proto.spine.core.UserId.serializeBinaryToWriter = function(message, writer) {
  124. var f = undefined;
  125. f = message.getValue();
  126. if (f.length > 0) {
  127. writer.writeString(
  128. 1,
  129. f
  130. );
  131. }
  132. };
  133. /**
  134. * optional string value = 1;
  135. * @return {string}
  136. */
  137. proto.spine.core.UserId.prototype.getValue = function() {
  138. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  139. };
  140. /**
  141. * @param {string} value
  142. * @return {!proto.spine.core.UserId} returns this
  143. */
  144. proto.spine.core.UserId.prototype.setValue = function(value) {
  145. return jspb.Message.setProto3StringField(this, 1, value);
  146. };
  147. goog.object.extend(exports, proto.spine.core);
  148. // Generated by Spine ProtoJs Plugin
  149. let ObjectParser = require('../../../client/parser/object-parser.js').default;
  150. let TypeParsers = require('../../../client/parser/type-parsers.js').default;
  151. proto.spine.core.UserId.Parser = function() {
  152. ObjectParser.call(this);
  153. };
  154. proto.spine.core.UserId.Parser.prototype = Object.create(ObjectParser.prototype);
  155. proto.spine.core.UserId.Parser.prototype.constructor = proto.spine.core.UserId.Parser;
  156. proto.spine.core.UserId.Parser.prototype.fromObject = function(obj) {
  157. if (obj === null) {
  158. return null;
  159. }
  160. let msg = new proto.spine.core.UserId();
  161. if (obj.value !== undefined) {
  162. if (obj.value !== null) {
  163. let value = obj.value;
  164. msg.setValue(value);
  165. }
  166. }
  167. return msg;
  168. };
  169. // Generated by Spine ProtoJs Plugin
  170. proto.spine.core.UserId.typeUrl = function() {
  171. return 'type.spine.io/spine.core.UserId';
  172. };