github.com/simpleiot/simpleiot@v0.18.3/frontend/lib/protobuf/notification_pb.js (about)

     1  // source: notification.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.Notification', 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.Notification = function(opt_data) {
    36    jspb.Message.initialize(this, opt_data, 0, -1, null, null);
    37  };
    38  goog.inherits(proto.pb.Notification, jspb.Message);
    39  if (goog.DEBUG && !COMPILED) {
    40    /**
    41     * @public
    42     * @override
    43     */
    44    proto.pb.Notification.displayName = 'proto.pb.Notification';
    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.Notification.prototype.toObject = function(opt_includeInstance) {
    63    return proto.pb.Notification.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.Notification} msg The msg instance to transform.
    73   * @return {!Object}
    74   * @suppress {unusedLocalVariables} f is only used for nested messages
    75   */
    76  proto.pb.Notification.toObject = function(includeInstance, msg) {
    77    var f, obj = {
    78      id: jspb.Message.getFieldWithDefault(msg, 1, ""),
    79      sourcenode: jspb.Message.getFieldWithDefault(msg, 2, ""),
    80      subject: jspb.Message.getFieldWithDefault(msg, 3, ""),
    81      msg: jspb.Message.getFieldWithDefault(msg, 4, ""),
    82      parent: jspb.Message.getFieldWithDefault(msg, 5, "")
    83    };
    84  
    85    if (includeInstance) {
    86      obj.$jspbMessageInstance = msg;
    87    }
    88    return obj;
    89  };
    90  }
    91  
    92  
    93  /**
    94   * Deserializes binary data (in protobuf wire format).
    95   * @param {jspb.ByteSource} bytes The bytes to deserialize.
    96   * @return {!proto.pb.Notification}
    97   */
    98  proto.pb.Notification.deserializeBinary = function(bytes) {
    99    var reader = new jspb.BinaryReader(bytes);
   100    var msg = new proto.pb.Notification;
   101    return proto.pb.Notification.deserializeBinaryFromReader(msg, reader);
   102  };
   103  
   104  
   105  /**
   106   * Deserializes binary data (in protobuf wire format) from the
   107   * given reader into the given message object.
   108   * @param {!proto.pb.Notification} msg The message object to deserialize into.
   109   * @param {!jspb.BinaryReader} reader The BinaryReader to use.
   110   * @return {!proto.pb.Notification}
   111   */
   112  proto.pb.Notification.deserializeBinaryFromReader = function(msg, reader) {
   113    while (reader.nextField()) {
   114      if (reader.isEndGroup()) {
   115        break;
   116      }
   117      var field = reader.getFieldNumber();
   118      switch (field) {
   119      case 1:
   120        var value = /** @type {string} */ (reader.readString());
   121        msg.setId(value);
   122        break;
   123      case 2:
   124        var value = /** @type {string} */ (reader.readString());
   125        msg.setSourcenode(value);
   126        break;
   127      case 3:
   128        var value = /** @type {string} */ (reader.readString());
   129        msg.setSubject(value);
   130        break;
   131      case 4:
   132        var value = /** @type {string} */ (reader.readString());
   133        msg.setMsg(value);
   134        break;
   135      case 5:
   136        var value = /** @type {string} */ (reader.readString());
   137        msg.setParent(value);
   138        break;
   139      default:
   140        reader.skipField();
   141        break;
   142      }
   143    }
   144    return msg;
   145  };
   146  
   147  
   148  /**
   149   * Serializes the message to binary data (in protobuf wire format).
   150   * @return {!Uint8Array}
   151   */
   152  proto.pb.Notification.prototype.serializeBinary = function() {
   153    var writer = new jspb.BinaryWriter();
   154    proto.pb.Notification.serializeBinaryToWriter(this, writer);
   155    return writer.getResultBuffer();
   156  };
   157  
   158  
   159  /**
   160   * Serializes the given message to binary data (in protobuf wire
   161   * format), writing to the given BinaryWriter.
   162   * @param {!proto.pb.Notification} message
   163   * @param {!jspb.BinaryWriter} writer
   164   * @suppress {unusedLocalVariables} f is only used for nested messages
   165   */
   166  proto.pb.Notification.serializeBinaryToWriter = function(message, writer) {
   167    var f = undefined;
   168    f = message.getId();
   169    if (f.length > 0) {
   170      writer.writeString(
   171        1,
   172        f
   173      );
   174    }
   175    f = message.getSourcenode();
   176    if (f.length > 0) {
   177      writer.writeString(
   178        2,
   179        f
   180      );
   181    }
   182    f = message.getSubject();
   183    if (f.length > 0) {
   184      writer.writeString(
   185        3,
   186        f
   187      );
   188    }
   189    f = message.getMsg();
   190    if (f.length > 0) {
   191      writer.writeString(
   192        4,
   193        f
   194      );
   195    }
   196    f = message.getParent();
   197    if (f.length > 0) {
   198      writer.writeString(
   199        5,
   200        f
   201      );
   202    }
   203  };
   204  
   205  
   206  /**
   207   * optional string id = 1;
   208   * @return {string}
   209   */
   210  proto.pb.Notification.prototype.getId = function() {
   211    return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
   212  };
   213  
   214  
   215  /**
   216   * @param {string} value
   217   * @return {!proto.pb.Notification} returns this
   218   */
   219  proto.pb.Notification.prototype.setId = function(value) {
   220    return jspb.Message.setProto3StringField(this, 1, value);
   221  };
   222  
   223  
   224  /**
   225   * optional string sourceNode = 2;
   226   * @return {string}
   227   */
   228  proto.pb.Notification.prototype.getSourcenode = function() {
   229    return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
   230  };
   231  
   232  
   233  /**
   234   * @param {string} value
   235   * @return {!proto.pb.Notification} returns this
   236   */
   237  proto.pb.Notification.prototype.setSourcenode = function(value) {
   238    return jspb.Message.setProto3StringField(this, 2, value);
   239  };
   240  
   241  
   242  /**
   243   * optional string subject = 3;
   244   * @return {string}
   245   */
   246  proto.pb.Notification.prototype.getSubject = function() {
   247    return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
   248  };
   249  
   250  
   251  /**
   252   * @param {string} value
   253   * @return {!proto.pb.Notification} returns this
   254   */
   255  proto.pb.Notification.prototype.setSubject = function(value) {
   256    return jspb.Message.setProto3StringField(this, 3, value);
   257  };
   258  
   259  
   260  /**
   261   * optional string msg = 4;
   262   * @return {string}
   263   */
   264  proto.pb.Notification.prototype.getMsg = function() {
   265    return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
   266  };
   267  
   268  
   269  /**
   270   * @param {string} value
   271   * @return {!proto.pb.Notification} returns this
   272   */
   273  proto.pb.Notification.prototype.setMsg = function(value) {
   274    return jspb.Message.setProto3StringField(this, 4, value);
   275  };
   276  
   277  
   278  /**
   279   * optional string parent = 5;
   280   * @return {string}
   281   */
   282  proto.pb.Notification.prototype.getParent = function() {
   283    return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
   284  };
   285  
   286  
   287  /**
   288   * @param {string} value
   289   * @return {!proto.pb.Notification} returns this
   290   */
   291  proto.pb.Notification.prototype.setParent = function(value) {
   292    return jspb.Message.setProto3StringField(this, 5, value);
   293  };
   294  
   295  
   296  goog.object.extend(exports, proto.pb);