Person_pb.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. // source: proto/Person.proto
  2. /**
  3. * @fileoverview
  4. * @enhanceable
  5. * @suppress {missingRequire} reports error on implicit type usages.
  6. * @suppress {messageConventions} JS Compiler reports an error if a variable or
  7. * field starts with 'MSG_' and isn't a translatable message.
  8. * @public
  9. */
  10. // GENERATED CODE -- DO NOT EDIT!
  11. /* eslint-disable */
  12. // @ts-nocheck
  13. var jspb = require('google-protobuf');
  14. var goog = jspb;
  15. var global = Function('return this')();
  16. goog.exportSymbol('proto.PersonMetadata', null, global);
  17. /**
  18. * Generated by JsPbCodeGenerator.
  19. * @param {Array=} opt_data Optional initial data array, typically from a
  20. * server response, or constructed directly in Javascript. The array is used
  21. * in place and becomes part of the constructed object. It is not cloned.
  22. * If no data is provided, the constructed object will be empty, but still
  23. * valid.
  24. * @extends {jspb.Message}
  25. * @constructor
  26. */
  27. proto.PersonMetadata = function(opt_data) {
  28. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  29. };
  30. goog.inherits(proto.PersonMetadata, jspb.Message);
  31. if (goog.DEBUG && !COMPILED) {
  32. /**
  33. * @public
  34. * @override
  35. */
  36. proto.PersonMetadata.displayName = 'proto.PersonMetadata';
  37. }
  38. if (jspb.Message.GENERATE_TO_OBJECT) {
  39. /**
  40. * Creates an object representation of this proto.
  41. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  42. * Optional fields that are not set will be set to undefined.
  43. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  44. * For the list of reserved names please see:
  45. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  46. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  47. * JSPB instance for transitional soy proto support:
  48. * http://goto/soy-param-migration
  49. * @return {!Object}
  50. */
  51. proto.PersonMetadata.prototype.toObject = function(opt_includeInstance) {
  52. return proto.PersonMetadata.toObject(opt_includeInstance, this);
  53. };
  54. /**
  55. * Static version of the {@see toObject} method.
  56. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  57. * the JSPB instance for transitional soy proto support:
  58. * http://goto/soy-param-migration
  59. * @param {!proto.PersonMetadata} msg The msg instance to transform.
  60. * @return {!Object}
  61. * @suppress {unusedLocalVariables} f is only used for nested messages
  62. */
  63. proto.PersonMetadata.toObject = function(includeInstance, msg) {
  64. var f, obj = {
  65. firstName: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
  66. middleName: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
  67. lastName: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
  68. about: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f,
  69. coverPhoto: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f,
  70. avatarPhoto: (f = jspb.Message.getField(msg, 6)) == null ? undefined : f
  71. };
  72. if (includeInstance) {
  73. obj.$jspbMessageInstance = msg;
  74. }
  75. return obj;
  76. };
  77. }
  78. /**
  79. * Deserializes binary data (in protobuf wire format).
  80. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  81. * @return {!proto.PersonMetadata}
  82. */
  83. proto.PersonMetadata.deserializeBinary = function(bytes) {
  84. var reader = new jspb.BinaryReader(bytes);
  85. var msg = new proto.PersonMetadata;
  86. return proto.PersonMetadata.deserializeBinaryFromReader(msg, reader);
  87. };
  88. /**
  89. * Deserializes binary data (in protobuf wire format) from the
  90. * given reader into the given message object.
  91. * @param {!proto.PersonMetadata} msg The message object to deserialize into.
  92. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  93. * @return {!proto.PersonMetadata}
  94. */
  95. proto.PersonMetadata.deserializeBinaryFromReader = function(msg, reader) {
  96. while (reader.nextField()) {
  97. if (reader.isEndGroup()) {
  98. break;
  99. }
  100. var field = reader.getFieldNumber();
  101. switch (field) {
  102. case 1:
  103. var value = /** @type {string} */ (reader.readString());
  104. msg.setFirstName(value);
  105. break;
  106. case 2:
  107. var value = /** @type {string} */ (reader.readString());
  108. msg.setMiddleName(value);
  109. break;
  110. case 3:
  111. var value = /** @type {string} */ (reader.readString());
  112. msg.setLastName(value);
  113. break;
  114. case 4:
  115. var value = /** @type {string} */ (reader.readString());
  116. msg.setAbout(value);
  117. break;
  118. case 5:
  119. var value = /** @type {number} */ (reader.readUint32());
  120. msg.setCoverPhoto(value);
  121. break;
  122. case 6:
  123. var value = /** @type {number} */ (reader.readUint32());
  124. msg.setAvatarPhoto(value);
  125. break;
  126. default:
  127. reader.skipField();
  128. break;
  129. }
  130. }
  131. return msg;
  132. };
  133. /**
  134. * Serializes the message to binary data (in protobuf wire format).
  135. * @return {!Uint8Array}
  136. */
  137. proto.PersonMetadata.prototype.serializeBinary = function() {
  138. var writer = new jspb.BinaryWriter();
  139. proto.PersonMetadata.serializeBinaryToWriter(this, writer);
  140. return writer.getResultBuffer();
  141. };
  142. /**
  143. * Serializes the given message to binary data (in protobuf wire
  144. * format), writing to the given BinaryWriter.
  145. * @param {!proto.PersonMetadata} message
  146. * @param {!jspb.BinaryWriter} writer
  147. * @suppress {unusedLocalVariables} f is only used for nested messages
  148. */
  149. proto.PersonMetadata.serializeBinaryToWriter = function(message, writer) {
  150. var f = undefined;
  151. f = /** @type {string} */ (jspb.Message.getField(message, 1));
  152. if (f != null) {
  153. writer.writeString(
  154. 1,
  155. f
  156. );
  157. }
  158. f = /** @type {string} */ (jspb.Message.getField(message, 2));
  159. if (f != null) {
  160. writer.writeString(
  161. 2,
  162. f
  163. );
  164. }
  165. f = /** @type {string} */ (jspb.Message.getField(message, 3));
  166. if (f != null) {
  167. writer.writeString(
  168. 3,
  169. f
  170. );
  171. }
  172. f = /** @type {string} */ (jspb.Message.getField(message, 4));
  173. if (f != null) {
  174. writer.writeString(
  175. 4,
  176. f
  177. );
  178. }
  179. f = /** @type {number} */ (jspb.Message.getField(message, 5));
  180. if (f != null) {
  181. writer.writeUint32(
  182. 5,
  183. f
  184. );
  185. }
  186. f = /** @type {number} */ (jspb.Message.getField(message, 6));
  187. if (f != null) {
  188. writer.writeUint32(
  189. 6,
  190. f
  191. );
  192. }
  193. };
  194. /**
  195. * optional string first_name = 1;
  196. * @return {string}
  197. */
  198. proto.PersonMetadata.prototype.getFirstName = function() {
  199. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  200. };
  201. /**
  202. * @param {string} value
  203. * @return {!proto.PersonMetadata} returns this
  204. */
  205. proto.PersonMetadata.prototype.setFirstName = function(value) {
  206. return jspb.Message.setField(this, 1, value);
  207. };
  208. /**
  209. * Clears the field making it undefined.
  210. * @return {!proto.PersonMetadata} returns this
  211. */
  212. proto.PersonMetadata.prototype.clearFirstName = function() {
  213. return jspb.Message.setField(this, 1, undefined);
  214. };
  215. /**
  216. * Returns whether this field is set.
  217. * @return {boolean}
  218. */
  219. proto.PersonMetadata.prototype.hasFirstName = function() {
  220. return jspb.Message.getField(this, 1) != null;
  221. };
  222. /**
  223. * optional string middle_name = 2;
  224. * @return {string}
  225. */
  226. proto.PersonMetadata.prototype.getMiddleName = function() {
  227. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
  228. };
  229. /**
  230. * @param {string} value
  231. * @return {!proto.PersonMetadata} returns this
  232. */
  233. proto.PersonMetadata.prototype.setMiddleName = function(value) {
  234. return jspb.Message.setField(this, 2, value);
  235. };
  236. /**
  237. * Clears the field making it undefined.
  238. * @return {!proto.PersonMetadata} returns this
  239. */
  240. proto.PersonMetadata.prototype.clearMiddleName = function() {
  241. return jspb.Message.setField(this, 2, undefined);
  242. };
  243. /**
  244. * Returns whether this field is set.
  245. * @return {boolean}
  246. */
  247. proto.PersonMetadata.prototype.hasMiddleName = function() {
  248. return jspb.Message.getField(this, 2) != null;
  249. };
  250. /**
  251. * optional string last_name = 3;
  252. * @return {string}
  253. */
  254. proto.PersonMetadata.prototype.getLastName = function() {
  255. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
  256. };
  257. /**
  258. * @param {string} value
  259. * @return {!proto.PersonMetadata} returns this
  260. */
  261. proto.PersonMetadata.prototype.setLastName = function(value) {
  262. return jspb.Message.setField(this, 3, value);
  263. };
  264. /**
  265. * Clears the field making it undefined.
  266. * @return {!proto.PersonMetadata} returns this
  267. */
  268. proto.PersonMetadata.prototype.clearLastName = function() {
  269. return jspb.Message.setField(this, 3, undefined);
  270. };
  271. /**
  272. * Returns whether this field is set.
  273. * @return {boolean}
  274. */
  275. proto.PersonMetadata.prototype.hasLastName = function() {
  276. return jspb.Message.getField(this, 3) != null;
  277. };
  278. /**
  279. * optional string about = 4;
  280. * @return {string}
  281. */
  282. proto.PersonMetadata.prototype.getAbout = function() {
  283. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
  284. };
  285. /**
  286. * @param {string} value
  287. * @return {!proto.PersonMetadata} returns this
  288. */
  289. proto.PersonMetadata.prototype.setAbout = function(value) {
  290. return jspb.Message.setField(this, 4, value);
  291. };
  292. /**
  293. * Clears the field making it undefined.
  294. * @return {!proto.PersonMetadata} returns this
  295. */
  296. proto.PersonMetadata.prototype.clearAbout = function() {
  297. return jspb.Message.setField(this, 4, undefined);
  298. };
  299. /**
  300. * Returns whether this field is set.
  301. * @return {boolean}
  302. */
  303. proto.PersonMetadata.prototype.hasAbout = function() {
  304. return jspb.Message.getField(this, 4) != null;
  305. };
  306. /**
  307. * optional uint32 cover_photo = 5;
  308. * @return {number}
  309. */
  310. proto.PersonMetadata.prototype.getCoverPhoto = function() {
  311. return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
  312. };
  313. /**
  314. * @param {number} value
  315. * @return {!proto.PersonMetadata} returns this
  316. */
  317. proto.PersonMetadata.prototype.setCoverPhoto = function(value) {
  318. return jspb.Message.setField(this, 5, value);
  319. };
  320. /**
  321. * Clears the field making it undefined.
  322. * @return {!proto.PersonMetadata} returns this
  323. */
  324. proto.PersonMetadata.prototype.clearCoverPhoto = function() {
  325. return jspb.Message.setField(this, 5, undefined);
  326. };
  327. /**
  328. * Returns whether this field is set.
  329. * @return {boolean}
  330. */
  331. proto.PersonMetadata.prototype.hasCoverPhoto = function() {
  332. return jspb.Message.getField(this, 5) != null;
  333. };
  334. /**
  335. * optional uint32 avatar_photo = 6;
  336. * @return {number}
  337. */
  338. proto.PersonMetadata.prototype.getAvatarPhoto = function() {
  339. return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
  340. };
  341. /**
  342. * @param {number} value
  343. * @return {!proto.PersonMetadata} returns this
  344. */
  345. proto.PersonMetadata.prototype.setAvatarPhoto = function(value) {
  346. return jspb.Message.setField(this, 6, value);
  347. };
  348. /**
  349. * Clears the field making it undefined.
  350. * @return {!proto.PersonMetadata} returns this
  351. */
  352. proto.PersonMetadata.prototype.clearAvatarPhoto = function() {
  353. return jspb.Message.setField(this, 6, undefined);
  354. };
  355. /**
  356. * Returns whether this field is set.
  357. * @return {boolean}
  358. */
  359. proto.PersonMetadata.prototype.hasAvatarPhoto = function() {
  360. return jspb.Message.getField(this, 6) != null;
  361. };
  362. goog.object.extend(exports, proto);