github.com/simpleiot/simpleiot@v0.18.3/frontend/lib/protobuf/message_pb.js (about) 1 // source: message.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 14 var jspb = require('google-protobuf'); 15 var goog = jspb; 16 var global = 17 (typeof globalThis !== 'undefined' && globalThis) || 18 (typeof window !== 'undefined' && window) || 19 (typeof global !== 'undefined' && global) || 20 (typeof self !== 'undefined' && self) || 21 (function () { return this; }).call(null) || 22 Function('return this')(); 23 24 goog.exportSymbol('proto.pb.Message', null, global); 25 /** 26 * Generated by JsPbCodeGenerator. 27 * @param {Array=} opt_data Optional initial data array, typically from a 28 * server response, or constructed directly in Javascript. The array is used 29 * in place and becomes part of the constructed object. It is not cloned. 30 * If no data is provided, the constructed object will be empty, but still 31 * valid. 32 * @extends {jspb.Message} 33 * @constructor 34 */ 35 proto.pb.Message = function(opt_data) { 36 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 37 }; 38 goog.inherits(proto.pb.Message, jspb.Message); 39 if (goog.DEBUG && !COMPILED) { 40 /** 41 * @public 42 * @override 43 */ 44 proto.pb.Message.displayName = 'proto.pb.Message'; 45 } 46 47 48 49 if (jspb.Message.GENERATE_TO_OBJECT) { 50 /** 51 * Creates an object representation of this proto. 52 * Field names that are reserved in JavaScript and will be renamed to pb_name. 53 * Optional fields that are not set will be set to undefined. 54 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 55 * For the list of reserved names please see: 56 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 57 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 58 * JSPB instance for transitional soy proto support: 59 * http://goto/soy-param-migration 60 * @return {!Object} 61 */ 62 proto.pb.Message.prototype.toObject = function(opt_includeInstance) { 63 return proto.pb.Message.toObject(opt_includeInstance, this); 64 }; 65 66 67 /** 68 * Static version of the {@see toObject} method. 69 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 70 * the JSPB instance for transitional soy proto support: 71 * http://goto/soy-param-migration 72 * @param {!proto.pb.Message} msg The msg instance to transform. 73 * @return {!Object} 74 * @suppress {unusedLocalVariables} f is only used for nested messages 75 */ 76 proto.pb.Message.toObject = function(includeInstance, msg) { 77 var f, obj = { 78 id: jspb.Message.getFieldWithDefault(msg, 1, ""), 79 userid: jspb.Message.getFieldWithDefault(msg, 2, ""), 80 notificationid: jspb.Message.getFieldWithDefault(msg, 3, ""), 81 email: jspb.Message.getFieldWithDefault(msg, 4, ""), 82 phone: jspb.Message.getFieldWithDefault(msg, 5, ""), 83 subject: jspb.Message.getFieldWithDefault(msg, 6, ""), 84 message: jspb.Message.getFieldWithDefault(msg, 7, ""), 85 parentid: jspb.Message.getFieldWithDefault(msg, 8, "") 86 }; 87 88 if (includeInstance) { 89 obj.$jspbMessageInstance = msg; 90 } 91 return obj; 92 }; 93 } 94 95 96 /** 97 * Deserializes binary data (in protobuf wire format). 98 * @param {jspb.ByteSource} bytes The bytes to deserialize. 99 * @return {!proto.pb.Message} 100 */ 101 proto.pb.Message.deserializeBinary = function(bytes) { 102 var reader = new jspb.BinaryReader(bytes); 103 var msg = new proto.pb.Message; 104 return proto.pb.Message.deserializeBinaryFromReader(msg, reader); 105 }; 106 107 108 /** 109 * Deserializes binary data (in protobuf wire format) from the 110 * given reader into the given message object. 111 * @param {!proto.pb.Message} msg The message object to deserialize into. 112 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 113 * @return {!proto.pb.Message} 114 */ 115 proto.pb.Message.deserializeBinaryFromReader = function(msg, reader) { 116 while (reader.nextField()) { 117 if (reader.isEndGroup()) { 118 break; 119 } 120 var field = reader.getFieldNumber(); 121 switch (field) { 122 case 1: 123 var value = /** @type {string} */ (reader.readString()); 124 msg.setId(value); 125 break; 126 case 2: 127 var value = /** @type {string} */ (reader.readString()); 128 msg.setUserid(value); 129 break; 130 case 3: 131 var value = /** @type {string} */ (reader.readString()); 132 msg.setNotificationid(value); 133 break; 134 case 4: 135 var value = /** @type {string} */ (reader.readString()); 136 msg.setEmail(value); 137 break; 138 case 5: 139 var value = /** @type {string} */ (reader.readString()); 140 msg.setPhone(value); 141 break; 142 case 6: 143 var value = /** @type {string} */ (reader.readString()); 144 msg.setSubject(value); 145 break; 146 case 7: 147 var value = /** @type {string} */ (reader.readString()); 148 msg.setMessage(value); 149 break; 150 case 8: 151 var value = /** @type {string} */ (reader.readString()); 152 msg.setParentid(value); 153 break; 154 default: 155 reader.skipField(); 156 break; 157 } 158 } 159 return msg; 160 }; 161 162 163 /** 164 * Serializes the message to binary data (in protobuf wire format). 165 * @return {!Uint8Array} 166 */ 167 proto.pb.Message.prototype.serializeBinary = function() { 168 var writer = new jspb.BinaryWriter(); 169 proto.pb.Message.serializeBinaryToWriter(this, writer); 170 return writer.getResultBuffer(); 171 }; 172 173 174 /** 175 * Serializes the given message to binary data (in protobuf wire 176 * format), writing to the given BinaryWriter. 177 * @param {!proto.pb.Message} message 178 * @param {!jspb.BinaryWriter} writer 179 * @suppress {unusedLocalVariables} f is only used for nested messages 180 */ 181 proto.pb.Message.serializeBinaryToWriter = function(message, writer) { 182 var f = undefined; 183 f = message.getId(); 184 if (f.length > 0) { 185 writer.writeString( 186 1, 187 f 188 ); 189 } 190 f = message.getUserid(); 191 if (f.length > 0) { 192 writer.writeString( 193 2, 194 f 195 ); 196 } 197 f = message.getNotificationid(); 198 if (f.length > 0) { 199 writer.writeString( 200 3, 201 f 202 ); 203 } 204 f = message.getEmail(); 205 if (f.length > 0) { 206 writer.writeString( 207 4, 208 f 209 ); 210 } 211 f = message.getPhone(); 212 if (f.length > 0) { 213 writer.writeString( 214 5, 215 f 216 ); 217 } 218 f = message.getSubject(); 219 if (f.length > 0) { 220 writer.writeString( 221 6, 222 f 223 ); 224 } 225 f = message.getMessage(); 226 if (f.length > 0) { 227 writer.writeString( 228 7, 229 f 230 ); 231 } 232 f = message.getParentid(); 233 if (f.length > 0) { 234 writer.writeString( 235 8, 236 f 237 ); 238 } 239 }; 240 241 242 /** 243 * optional string id = 1; 244 * @return {string} 245 */ 246 proto.pb.Message.prototype.getId = function() { 247 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); 248 }; 249 250 251 /** 252 * @param {string} value 253 * @return {!proto.pb.Message} returns this 254 */ 255 proto.pb.Message.prototype.setId = function(value) { 256 return jspb.Message.setProto3StringField(this, 1, value); 257 }; 258 259 260 /** 261 * optional string userId = 2; 262 * @return {string} 263 */ 264 proto.pb.Message.prototype.getUserid = function() { 265 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 266 }; 267 268 269 /** 270 * @param {string} value 271 * @return {!proto.pb.Message} returns this 272 */ 273 proto.pb.Message.prototype.setUserid = function(value) { 274 return jspb.Message.setProto3StringField(this, 2, value); 275 }; 276 277 278 /** 279 * optional string notificationId = 3; 280 * @return {string} 281 */ 282 proto.pb.Message.prototype.getNotificationid = function() { 283 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); 284 }; 285 286 287 /** 288 * @param {string} value 289 * @return {!proto.pb.Message} returns this 290 */ 291 proto.pb.Message.prototype.setNotificationid = function(value) { 292 return jspb.Message.setProto3StringField(this, 3, value); 293 }; 294 295 296 /** 297 * optional string email = 4; 298 * @return {string} 299 */ 300 proto.pb.Message.prototype.getEmail = function() { 301 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); 302 }; 303 304 305 /** 306 * @param {string} value 307 * @return {!proto.pb.Message} returns this 308 */ 309 proto.pb.Message.prototype.setEmail = function(value) { 310 return jspb.Message.setProto3StringField(this, 4, value); 311 }; 312 313 314 /** 315 * optional string phone = 5; 316 * @return {string} 317 */ 318 proto.pb.Message.prototype.getPhone = function() { 319 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); 320 }; 321 322 323 /** 324 * @param {string} value 325 * @return {!proto.pb.Message} returns this 326 */ 327 proto.pb.Message.prototype.setPhone = function(value) { 328 return jspb.Message.setProto3StringField(this, 5, value); 329 }; 330 331 332 /** 333 * optional string subject = 6; 334 * @return {string} 335 */ 336 proto.pb.Message.prototype.getSubject = function() { 337 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); 338 }; 339 340 341 /** 342 * @param {string} value 343 * @return {!proto.pb.Message} returns this 344 */ 345 proto.pb.Message.prototype.setSubject = function(value) { 346 return jspb.Message.setProto3StringField(this, 6, value); 347 }; 348 349 350 /** 351 * optional string message = 7; 352 * @return {string} 353 */ 354 proto.pb.Message.prototype.getMessage = function() { 355 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); 356 }; 357 358 359 /** 360 * @param {string} value 361 * @return {!proto.pb.Message} returns this 362 */ 363 proto.pb.Message.prototype.setMessage = function(value) { 364 return jspb.Message.setProto3StringField(this, 7, value); 365 }; 366 367 368 /** 369 * optional string parentId = 8; 370 * @return {string} 371 */ 372 proto.pb.Message.prototype.getParentid = function() { 373 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); 374 }; 375 376 377 /** 378 * @param {string} value 379 * @return {!proto.pb.Message} returns this 380 */ 381 proto.pb.Message.prototype.setParentid = function(value) { 382 return jspb.Message.setProto3StringField(this, 8, value); 383 }; 384 385 386 goog.object.extend(exports, proto.pb);