Person_pb.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  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. coverPhoto: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f,
  69. avatarPhoto: (f = jspb.Message.getField(msg, 6)) == null ? undefined : f
  70. };
  71. if (includeInstance) {
  72. obj.$jspbMessageInstance = msg;
  73. }
  74. return obj;
  75. };
  76. }
  77. /**
  78. * Deserializes binary data (in protobuf wire format).
  79. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  80. * @return {!proto.PersonMetadata}
  81. */
  82. proto.PersonMetadata.deserializeBinary = function(bytes) {
  83. var reader = new jspb.BinaryReader(bytes);
  84. var msg = new proto.PersonMetadata;
  85. return proto.PersonMetadata.deserializeBinaryFromReader(msg, reader);
  86. };
  87. /**
  88. * Deserializes binary data (in protobuf wire format) from the
  89. * given reader into the given message object.
  90. * @param {!proto.PersonMetadata} msg The message object to deserialize into.
  91. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  92. * @return {!proto.PersonMetadata}
  93. */
  94. proto.PersonMetadata.deserializeBinaryFromReader = function(msg, reader) {
  95. while (reader.nextField()) {
  96. if (reader.isEndGroup()) {
  97. break;
  98. }
  99. var field = reader.getFieldNumber();
  100. switch (field) {
  101. case 1:
  102. var value = /** @type {string} */ (reader.readString());
  103. msg.setFirstName(value);
  104. break;
  105. case 2:
  106. var value = /** @type {string} */ (reader.readString());
  107. msg.setMiddleName(value);
  108. break;
  109. case 3:
  110. var value = /** @type {string} */ (reader.readString());
  111. msg.setLastName(value);
  112. break;
  113. case 4:
  114. var value = /** @type {string} */ (reader.readString());
  115. msg.setAbout(value);
  116. break;
  117. case 5:
  118. var value = /** @type {number} */ (reader.readUint32());
  119. msg.setCoverPhoto(value);
  120. break;
  121. case 6:
  122. var value = /** @type {number} */ (reader.readUint32());
  123. msg.setAvatarPhoto(value);
  124. break;
  125. default:
  126. reader.skipField();
  127. break;
  128. }
  129. }
  130. return msg;
  131. };
  132. /**
  133. * Serializes the message to binary data (in protobuf wire format).
  134. * @return {!Uint8Array}
  135. */
  136. proto.PersonMetadata.prototype.serializeBinary = function() {
  137. var writer = new jspb.BinaryWriter();
  138. proto.PersonMetadata.serializeBinaryToWriter(this, writer);
  139. return writer.getResultBuffer();
  140. };
  141. /**
  142. * Serializes the given message to binary data (in protobuf wire
  143. * format), writing to the given BinaryWriter.
  144. * @param {!proto.PersonMetadata} message
  145. * @param {!jspb.BinaryWriter} writer
  146. * @suppress {unusedLocalVariables} f is only used for nested messages
  147. */
  148. proto.PersonMetadata.serializeBinaryToWriter = function(message, writer) {
  149. var f = undefined;
  150. f = /** @type {string} */ (jspb.Message.getField(message, 1));
  151. if (f != null) {
  152. writer.writeString(
  153. 1,
  154. f
  155. );
  156. }
  157. f = /** @type {string} */ (jspb.Message.getField(message, 2));
  158. if (f != null) {
  159. writer.writeString(
  160. 2,
  161. f
  162. );
  163. }
  164. f = /** @type {string} */ (jspb.Message.getField(message, 3));
  165. if (f != null) {
  166. writer.writeString(
  167. 3,
  168. f
  169. );
  170. }
  171. f = /** @type {string} */ (jspb.Message.getField(message, 4));
  172. if (f != null) {
  173. writer.writeString(
  174. 4,
  175. f
  176. );
  177. }
  178. f = /** @type {number} */ (jspb.Message.getField(message, 5));
  179. if (f != null) {
  180. writer.writeUint32(
  181. 5,
  182. f
  183. );
  184. }
  185. f = /** @type {number} */ (jspb.Message.getField(message, 6));
  186. if (f != null) {
  187. writer.writeUint32(
  188. 6,
  189. f
  190. );
  191. }
  192. };
  193. /**
  194. * optional string first_name = 1;
  195. * @return {string}
  196. */
  197. proto.PersonMetadata.prototype.getFirstName = function() {
  198. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  199. };
  200. /**
  201. * @param {string} value
  202. * @return {!proto.PersonMetadata} returns this
  203. */
  204. proto.PersonMetadata.prototype.setFirstName = function(value) {
  205. return jspb.Message.setField(this, 1, value);
  206. };
  207. /**
  208. * Clears the field making it undefined.
  209. * @return {!proto.PersonMetadata} returns this
  210. */
  211. proto.PersonMetadata.prototype.clearFirstName = function() {
  212. return jspb.Message.setField(this, 1, undefined);
  213. };
  214. /**
  215. * Returns whether this field is set.
  216. * @return {boolean}
  217. */
  218. proto.PersonMetadata.prototype.hasFirstName = function() {
  219. return jspb.Message.getField(this, 1) != null;
  220. };
  221. /**
  222. * optional string middle_name = 2;
  223. * @return {string}
  224. */
  225. proto.PersonMetadata.prototype.getMiddleName = function() {
  226. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
  227. };
  228. /**
  229. * @param {string} value
  230. * @return {!proto.PersonMetadata} returns this
  231. */
  232. proto.PersonMetadata.prototype.setMiddleName = function(value) {
  233. return jspb.Message.setField(this, 2, value);
  234. };
  235. /**
  236. * Clears the field making it undefined.
  237. * @return {!proto.PersonMetadata} returns this
  238. */
  239. proto.PersonMetadata.prototype.clearMiddleName = function() {
  240. return jspb.Message.setField(this, 2, undefined);
  241. };
  242. /**
  243. * Returns whether this field is set.
  244. * @return {boolean}
  245. */
  246. proto.PersonMetadata.prototype.hasMiddleName = function() {
  247. return jspb.Message.getField(this, 2) != null;
  248. };
  249. /**
  250. * optional string last_name = 3;
  251. * @return {string}
  252. */
  253. proto.PersonMetadata.prototype.getLastName = function() {
  254. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
  255. };
  256. /**
  257. * @param {string} value
  258. * @return {!proto.PersonMetadata} returns this
  259. */
  260. proto.PersonMetadata.prototype.setLastName = function(value) {
  261. return jspb.Message.setField(this, 3, value);
  262. };
  263. /**
  264. * Clears the field making it undefined.
  265. * @return {!proto.PersonMetadata} returns this
  266. */
  267. proto.PersonMetadata.prototype.clearLastName = function() {
  268. return jspb.Message.setField(this, 3, undefined);
  269. };
  270. /**
  271. * Returns whether this field is set.
  272. * @return {boolean}
  273. */
  274. proto.PersonMetadata.prototype.hasLastName = function() {
  275. return jspb.Message.getField(this, 3) != null;
  276. };
  277. /**
  278. * optional string about = 4;
  279. * @return {string}
  280. */
  281. proto.PersonMetadata.prototype.getAbout = function() {
  282. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
  283. };
  284. /**
  285. * @param {string} value
  286. * @return {!proto.PersonMetadata} returns this
  287. */
  288. proto.PersonMetadata.prototype.setAbout = function(value) {
  289. return jspb.Message.setField(this, 4, value);
  290. };
  291. /**
  292. * Clears the field making it undefined.
  293. * @return {!proto.PersonMetadata} returns this
  294. */
  295. proto.PersonMetadata.prototype.clearAbout = function() {
  296. return jspb.Message.setField(this, 4, undefined);
  297. };
  298. /**
  299. * Returns whether this field is set.
  300. * @return {boolean}
  301. */
  302. proto.PersonMetadata.prototype.hasAbout = function() {
  303. return jspb.Message.getField(this, 4) != null;
  304. };
  305. /**
  306. * optional uint32 cover_photo = 5;
  307. * @return {number}
  308. */
  309. proto.PersonMetadata.prototype.getCoverPhoto = function() {
  310. return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
  311. };
  312. /**
  313. * @param {number} value
  314. * @return {!proto.PersonMetadata} returns this
  315. */
  316. proto.PersonMetadata.prototype.setCoverPhoto = function(value) {
  317. return jspb.Message.setField(this, 5, value);
  318. };
  319. /**
  320. * Clears the field making it undefined.
  321. * @return {!proto.PersonMetadata} returns this
  322. */
  323. proto.PersonMetadata.prototype.clearCoverPhoto = function() {
  324. return jspb.Message.setField(this, 5, undefined);
  325. };
  326. /**
  327. * Returns whether this field is set.
  328. * @return {boolean}
  329. */
  330. proto.PersonMetadata.prototype.hasCoverPhoto = function() {
  331. return jspb.Message.getField(this, 5) != null;
  332. };
  333. /**
  334. * optional uint32 avatar_photo = 6;
  335. * @return {number}
  336. */
  337. proto.PersonMetadata.prototype.getAvatarPhoto = function() {
  338. return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
  339. };
  340. /**
  341. * @param {number} value
  342. * @return {!proto.PersonMetadata} returns this
  343. */
  344. proto.PersonMetadata.prototype.setAvatarPhoto = function(value) {
  345. return jspb.Message.setField(this, 6, value);
  346. };
  347. /**
  348. * Clears the field making it undefined.
  349. * @return {!proto.PersonMetadata} returns this
  350. */
  351. proto.PersonMetadata.prototype.clearAvatarPhoto = function() {
  352. return jspb.Message.setField(this, 6, undefined);
  353. };
  354. /**
  355. * Returns whether this field is set.
  356. * @return {boolean}
  357. */
  358. proto.PersonMetadata.prototype.hasAvatarPhoto = function() {
  359. return jspb.Message.getField(this, 6) != null;
  360. };
  361. goog.object.extend(exports, proto);