Person_pb.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. // source: proto/Person.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. /* eslint-disable */
  11. // @ts-nocheck
  12. var jspb = require('google-protobuf');
  13. var goog = jspb;
  14. var global = Function('return this')();
  15. goog.exportSymbol('proto.PersonMetadata', 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.PersonMetadata = function(opt_data) {
  27. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  28. };
  29. goog.inherits(proto.PersonMetadata, jspb.Message);
  30. if (goog.DEBUG && !COMPILED) {
  31. /**
  32. * @public
  33. * @override
  34. */
  35. proto.PersonMetadata.displayName = 'proto.PersonMetadata';
  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.PersonMetadata.prototype.toObject = function(opt_includeInstance) {
  51. return proto.PersonMetadata.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.PersonMetadata} msg The msg instance to transform.
  59. * @return {!Object}
  60. * @suppress {unusedLocalVariables} f is only used for nested messages
  61. */
  62. proto.PersonMetadata.toObject = function(includeInstance, msg) {
  63. var f, obj = {
  64. firstName: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
  65. middleName: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
  66. lastName: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
  67. about: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f
  68. };
  69. if (includeInstance) {
  70. obj.$jspbMessageInstance = msg;
  71. }
  72. return obj;
  73. };
  74. }
  75. /**
  76. * Deserializes binary data (in protobuf wire format).
  77. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  78. * @return {!proto.PersonMetadata}
  79. */
  80. proto.PersonMetadata.deserializeBinary = function(bytes) {
  81. var reader = new jspb.BinaryReader(bytes);
  82. var msg = new proto.PersonMetadata;
  83. return proto.PersonMetadata.deserializeBinaryFromReader(msg, reader);
  84. };
  85. /**
  86. * Deserializes binary data (in protobuf wire format) from the
  87. * given reader into the given message object.
  88. * @param {!proto.PersonMetadata} msg The message object to deserialize into.
  89. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  90. * @return {!proto.PersonMetadata}
  91. */
  92. proto.PersonMetadata.deserializeBinaryFromReader = function(msg, reader) {
  93. while (reader.nextField()) {
  94. if (reader.isEndGroup()) {
  95. break;
  96. }
  97. var field = reader.getFieldNumber();
  98. switch (field) {
  99. case 1:
  100. var value = /** @type {string} */ (reader.readString());
  101. msg.setFirstName(value);
  102. break;
  103. case 2:
  104. var value = /** @type {string} */ (reader.readString());
  105. msg.setMiddleName(value);
  106. break;
  107. case 3:
  108. var value = /** @type {string} */ (reader.readString());
  109. msg.setLastName(value);
  110. break;
  111. case 4:
  112. var value = /** @type {string} */ (reader.readString());
  113. msg.setAbout(value);
  114. break;
  115. default:
  116. reader.skipField();
  117. break;
  118. }
  119. }
  120. return msg;
  121. };
  122. /**
  123. * Serializes the message to binary data (in protobuf wire format).
  124. * @return {!Uint8Array}
  125. */
  126. proto.PersonMetadata.prototype.serializeBinary = function() {
  127. var writer = new jspb.BinaryWriter();
  128. proto.PersonMetadata.serializeBinaryToWriter(this, writer);
  129. return writer.getResultBuffer();
  130. };
  131. /**
  132. * Serializes the given message to binary data (in protobuf wire
  133. * format), writing to the given BinaryWriter.
  134. * @param {!proto.PersonMetadata} message
  135. * @param {!jspb.BinaryWriter} writer
  136. * @suppress {unusedLocalVariables} f is only used for nested messages
  137. */
  138. proto.PersonMetadata.serializeBinaryToWriter = function(message, writer) {
  139. var f = undefined;
  140. f = /** @type {string} */ (jspb.Message.getField(message, 1));
  141. if (f != null) {
  142. writer.writeString(
  143. 1,
  144. f
  145. );
  146. }
  147. f = /** @type {string} */ (jspb.Message.getField(message, 2));
  148. if (f != null) {
  149. writer.writeString(
  150. 2,
  151. f
  152. );
  153. }
  154. f = /** @type {string} */ (jspb.Message.getField(message, 3));
  155. if (f != null) {
  156. writer.writeString(
  157. 3,
  158. f
  159. );
  160. }
  161. f = /** @type {string} */ (jspb.Message.getField(message, 4));
  162. if (f != null) {
  163. writer.writeString(
  164. 4,
  165. f
  166. );
  167. }
  168. };
  169. /**
  170. * optional string first_name = 1;
  171. * @return {string}
  172. */
  173. proto.PersonMetadata.prototype.getFirstName = function() {
  174. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  175. };
  176. /**
  177. * @param {string} value
  178. * @return {!proto.PersonMetadata} returns this
  179. */
  180. proto.PersonMetadata.prototype.setFirstName = function(value) {
  181. return jspb.Message.setField(this, 1, value);
  182. };
  183. /**
  184. * Clears the field making it undefined.
  185. * @return {!proto.PersonMetadata} returns this
  186. */
  187. proto.PersonMetadata.prototype.clearFirstName = function() {
  188. return jspb.Message.setField(this, 1, undefined);
  189. };
  190. /**
  191. * Returns whether this field is set.
  192. * @return {boolean}
  193. */
  194. proto.PersonMetadata.prototype.hasFirstName = function() {
  195. return jspb.Message.getField(this, 1) != null;
  196. };
  197. /**
  198. * optional string middle_name = 2;
  199. * @return {string}
  200. */
  201. proto.PersonMetadata.prototype.getMiddleName = function() {
  202. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
  203. };
  204. /**
  205. * @param {string} value
  206. * @return {!proto.PersonMetadata} returns this
  207. */
  208. proto.PersonMetadata.prototype.setMiddleName = function(value) {
  209. return jspb.Message.setField(this, 2, value);
  210. };
  211. /**
  212. * Clears the field making it undefined.
  213. * @return {!proto.PersonMetadata} returns this
  214. */
  215. proto.PersonMetadata.prototype.clearMiddleName = function() {
  216. return jspb.Message.setField(this, 2, undefined);
  217. };
  218. /**
  219. * Returns whether this field is set.
  220. * @return {boolean}
  221. */
  222. proto.PersonMetadata.prototype.hasMiddleName = function() {
  223. return jspb.Message.getField(this, 2) != null;
  224. };
  225. /**
  226. * optional string last_name = 3;
  227. * @return {string}
  228. */
  229. proto.PersonMetadata.prototype.getLastName = function() {
  230. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
  231. };
  232. /**
  233. * @param {string} value
  234. * @return {!proto.PersonMetadata} returns this
  235. */
  236. proto.PersonMetadata.prototype.setLastName = function(value) {
  237. return jspb.Message.setField(this, 3, value);
  238. };
  239. /**
  240. * Clears the field making it undefined.
  241. * @return {!proto.PersonMetadata} returns this
  242. */
  243. proto.PersonMetadata.prototype.clearLastName = function() {
  244. return jspb.Message.setField(this, 3, undefined);
  245. };
  246. /**
  247. * Returns whether this field is set.
  248. * @return {boolean}
  249. */
  250. proto.PersonMetadata.prototype.hasLastName = function() {
  251. return jspb.Message.getField(this, 3) != null;
  252. };
  253. /**
  254. * optional string about = 4;
  255. * @return {string}
  256. */
  257. proto.PersonMetadata.prototype.getAbout = function() {
  258. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
  259. };
  260. /**
  261. * @param {string} value
  262. * @return {!proto.PersonMetadata} returns this
  263. */
  264. proto.PersonMetadata.prototype.setAbout = function(value) {
  265. return jspb.Message.setField(this, 4, value);
  266. };
  267. /**
  268. * Clears the field making it undefined.
  269. * @return {!proto.PersonMetadata} returns this
  270. */
  271. proto.PersonMetadata.prototype.clearAbout = function() {
  272. return jspb.Message.setField(this, 4, undefined);
  273. };
  274. /**
  275. * Returns whether this field is set.
  276. * @return {boolean}
  277. */
  278. proto.PersonMetadata.prototype.hasAbout = function() {
  279. return jspb.Message.getField(this, 4) != null;
  280. };
  281. goog.object.extend(exports, proto);