text: // source: chat.proto
  /**
   * @fileoverview
   * @enhanceable
   * @suppress {messageConventions} JS Compiler reports an error if a variable or
   *     field starts with 'MSG_' and isn't a translatable message.
   * @public
   */
  // GENERATED CODE -- DO NOT EDIT!
  
  var jspb = require('google-protobuf');
  var goog = jspb;
  var global = Function('return this')();
  
  var users_pb = require('./users_pb.js');
  goog.object.extend(proto, users_pb);
  var api_pb = require('./api_pb.js');
  goog.object.extend(proto, api_pb);
  goog.exportSymbol('proto.chat.Channel', null, global);
  goog.exportSymbol('proto.chat.ChatStreamResponse', null, global);
  goog.exportSymbol('proto.chat.ConnectRequest', null, global);
  goog.exportSymbol('proto.chat.ConnectionsResponse', null, global);
  goog.exportSymbol('proto.chat.ConnectionsStreamResponse', null, global);
  goog.exportSymbol('proto.chat.Message', null, global);
  /**
   * Generated by JsPbCodeGenerator.
   * @param {Array=} opt_data Optional initial data array, typically from a
   * server response, or constructed directly in Javascript. The array is used
   * in place and becomes part of the constructed object. It is not cloned.
   * If no data is provided, the constructed object will be empty, but still
   * valid.
   * @extends {jspb.Message}
   * @constructor
   */
  proto.chat.ConnectRequest = function(opt_data) {
    jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  };
  goog.inherits(proto.chat.ConnectRequest, jspb.Message);
  if (goog.DEBUG && !COMPILED) {
    /**
     * @public
     * @override
     */
    proto.chat.ConnectRequest.displayName = 'proto.chat.ConnectRequest';
  }
  /**
   * Generated by JsPbCodeGenerator.
   * @param {Array=} opt_data Optional initial data array, typically from a
   * server response, or constructed directly in Javascript. The array is used
   * in place and becomes part of the constructed object. It is not cloned.
   * If no data is provided, the constructed object will be empty, but still
   * valid.
   * @extends {jspb.Message}
   * @constructor
   */
  proto.chat.ConnectionsStreamResponse = function(opt_data) {
    jspb.Message.initialize(this, opt_data, 0, -1, proto.chat.ConnectionsStreamResponse.repeatedFields_, null);
  };
  goog.inherits(proto.chat.ConnectionsStreamResponse, jspb.Message);
  if (goog.DEBUG && !COMPILED) {
    /**
     * @public
     * @override
     */
    proto.chat.ConnectionsStreamResponse.displayName = 'proto.chat.ConnectionsStreamResponse';
  }
  /**
   * Generated by JsPbCodeGenerator.
   * @param {Array=} opt_data Optional initial data array, typically from a
   * server response, or constructed directly in Javascript. The array is used
   * in place and becomes part of the constructed object. It is not cloned.
   * If no data is provided, the constructed object will be empty, but still
   * valid.
   * @extends {jspb.Message}
   * @constructor
   */
  proto.chat.ConnectionsResponse = function(opt_data) {
    jspb.Message.initialize(this, opt_data, 0, -1, proto.chat.ConnectionsResponse.repeatedFields_, null);
  };
  goog.inherits(proto.chat.ConnectionsResponse, jspb.Message);
  if (goog.DEBUG && !COMPILED) {
    /**
     * @public
     * @override
     */
    proto.chat.ConnectionsResponse.displayName = 'proto.chat.ConnectionsResponse';
  }
  /**
   * Generated by JsPbCodeGenerator.
   * @param {Array=} opt_data Optional initial data array, typically from a
   * server response, or constructed directly in Javascript. The array is used
   * in place and becomes part of the constructed object. It is not cloned.
   * If no data is provided, the constructed object will be empty, but still
   * valid.
   * @extends {jspb.Message}
   * @constructor
   */
  proto.chat.ChatStreamResponse = function(opt_data) {
    jspb.Message.initialize(this, opt_data, 0, -1, proto.chat.ChatStreamResponse.repeatedFields_, null);
  };
  goog.inherits(proto.chat.ChatStreamResponse, jspb.Message);
  if (goog.DEBUG && !COMPILED) {
    /**
     * @public
     * @override
     */
    proto.chat.ChatStreamResponse.displayName = 'proto.chat.ChatStreamResponse';
  }
  /**
   * Generated by JsPbCodeGenerator.
   * @param {Array=} opt_data Optional initial data array, typically from a
   * server response, or constructed directly in Javascript. The array is used
   * in place and becomes part of the constructed object. It is not cloned.
   * If no data is provided, the constructed object will be empty, but still
   * valid.
   * @extends {jspb.Message}
   * @constructor
   */
  proto.chat.Channel = function(opt_data) {
    jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  };
  goog.inherits(proto.chat.Channel, jspb.Message);
  if (goog.DEBUG && !COMPILED) {
    /**
     * @public
     * @override
     */
    proto.chat.Channel.displayName = 'proto.chat.Channel';
  }
  /**
   * Generated by JsPbCodeGenerator.
   * @param {Array=} opt_data Optional initial data array, typically from a
   * server response, or constructed directly in Javascript. The array is used
   * in place and becomes part of the constructed object. It is not cloned.
   * If no data is provided, the constructed object will be empty, but still
   * valid.
   * @extends {jspb.Message}
   * @constructor
   */
  proto.chat.Message = function(opt_data) {
    jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  };
  goog.inherits(proto.chat.Message, jspb.Message);
  if (goog.DEBUG && !COMPILED) {
    /**
     * @public
     * @override
     */
    proto.chat.Message.displayName = 'proto.chat.Message';
  }
  
  
  
  if (jspb.Message.GENERATE_TO_OBJECT) {
  /**
   * Creates an object representation of this proto.
   * Field names that are reserved in JavaScript and will be renamed to pb_name.
   * Optional fields that are not set will be set to undefined.
   * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
   * For the list of reserved names please see:
   *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
   * @param {boolean=} opt_includeInstance Deprecated. whether to include the
   *     JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @return {!Object}
   */
  proto.chat.ConnectRequest.prototype.toObject = function(opt_includeInstance) {
    return proto.chat.ConnectRequest.toObject(opt_includeInstance, this);
  };
  
  
  /**
   * Static version of the {@see toObject} method.
   * @param {boolean|undefined} includeInstance Deprecated. Whether to include
   *     the JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @param {!proto.chat.ConnectRequest} msg The msg instance to transform.
   * @return {!Object}
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.ConnectRequest.toObject = function(includeInstance, msg) {
    var f, obj = {
      userId: jspb.Message.getFieldWithDefault(msg, 1, 0),
      active: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
    };
  
    if (includeInstance) {
      obj.$jspbMessageInstance = msg;
    }
    return obj;
  };
  }
  
  
  /**
   * Deserializes binary data (in protobuf wire format).
   * @param {jspb.ByteSource} bytes The bytes to deserialize.
   * @return {!proto.chat.ConnectRequest}
   */
  proto.chat.ConnectRequest.deserializeBinary = function(bytes) {
    var reader = new jspb.BinaryReader(bytes);
    var msg = new proto.chat.ConnectRequest;
    return proto.chat.ConnectRequest.deserializeBinaryFromReader(msg, reader);
  };
  
  
  /**
   * Deserializes binary data (in protobuf wire format) from the
   * given reader into the given message object.
   * @param {!proto.chat.ConnectRequest} msg The message object to deserialize into.
   * @param {!jspb.BinaryReader} reader The BinaryReader to use.
   * @return {!proto.chat.ConnectRequest}
   */
  proto.chat.ConnectRequest.deserializeBinaryFromReader = function(msg, reader) {
    while (reader.nextField()) {
      if (reader.isEndGroup()) {
        break;
      }
      var field = reader.getFieldNumber();
      switch (field) {
      case 1:
        var value = /** @type {number} */ (reader.readInt32());
        msg.setUserId(value);
        break;
      case 2:
        var value = /** @type {boolean} */ (reader.readBool());
        msg.setActive(value);
        break;
      default:
        reader.skipField();
        break;
      }
    }
    return msg;
  };
  
  
  /**
   * Serializes the message to binary data (in protobuf wire format).
   * @return {!Uint8Array}
   */
  proto.chat.ConnectRequest.prototype.serializeBinary = function() {
    var writer = new jspb.BinaryWriter();
    proto.chat.ConnectRequest.serializeBinaryToWriter(this, writer);
    return writer.getResultBuffer();
  };
  
  
  /**
   * Serializes the given message to binary data (in protobuf wire
   * format), writing to the given BinaryWriter.
   * @param {!proto.chat.ConnectRequest} message
   * @param {!jspb.BinaryWriter} writer
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.ConnectRequest.serializeBinaryToWriter = function(message, writer) {
    var f = undefined;
    f = message.getUserId();
    if (f !== 0) {
      writer.writeInt32(
        1,
        f
      );
    }
    f = message.getActive();
    if (f) {
      writer.writeBool(
        2,
        f
      );
    }
  };
  
  
  /**
   * optional int32 user_id = 1;
   * @return {number}
   */
  proto.chat.ConnectRequest.prototype.getUserId = function() {
    return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
  };
  
  
  /**
   * @param {number} value
   * @return {!proto.chat.ConnectRequest} returns this
   */
  proto.chat.ConnectRequest.prototype.setUserId = function(value) {
    return jspb.Message.setProto3IntField(this, 1, value);
  };
  
  
  /**
   * optional bool active = 2;
   * @return {boolean}
   */
  proto.chat.ConnectRequest.prototype.getActive = function() {
    return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
  };
  
  
  /**
   * @param {boolean} value
   * @return {!proto.chat.ConnectRequest} returns this
   */
  proto.chat.ConnectRequest.prototype.setActive = function(value) {
    return jspb.Message.setProto3BooleanField(this, 2, value);
  };
  
  
  
  /**
   * List of repeated fields within this message type.
   * @private {!Array<number>}
   * @const
   */
  proto.chat.ConnectionsStreamResponse.repeatedFields_ = [1];
  
  
  
  if (jspb.Message.GENERATE_TO_OBJECT) {
  /**
   * Creates an object representation of this proto.
   * Field names that are reserved in JavaScript and will be renamed to pb_name.
   * Optional fields that are not set will be set to undefined.
   * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
   * For the list of reserved names please see:
   *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
   * @param {boolean=} opt_includeInstance Deprecated. whether to include the
   *     JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @return {!Object}
   */
  proto.chat.ConnectionsStreamResponse.prototype.toObject = function(opt_includeInstance) {
    return proto.chat.ConnectionsStreamResponse.toObject(opt_includeInstance, this);
  };
  
  
  /**
   * Static version of the {@see toObject} method.
   * @param {boolean|undefined} includeInstance Deprecated. Whether to include
   *     the JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @param {!proto.chat.ConnectionsStreamResponse} msg The msg instance to transform.
   * @return {!Object}
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.ConnectionsStreamResponse.toObject = function(includeInstance, msg) {
    var f, obj = {
      usersList: jspb.Message.toObjectList(msg.getUsersList(),
      users_pb.User.toObject, includeInstance)
    };
  
    if (includeInstance) {
      obj.$jspbMessageInstance = msg;
    }
    return obj;
  };
  }
  
  
  /**
   * Deserializes binary data (in protobuf wire format).
   * @param {jspb.ByteSource} bytes The bytes to deserialize.
   * @return {!proto.chat.ConnectionsStreamResponse}
   */
  proto.chat.ConnectionsStreamResponse.deserializeBinary = function(bytes) {
    var reader = new jspb.BinaryReader(bytes);
    var msg = new proto.chat.ConnectionsStreamResponse;
    return proto.chat.ConnectionsStreamResponse.deserializeBinaryFromReader(msg, reader);
  };
  
  
  /**
   * Deserializes binary data (in protobuf wire format) from the
   * given reader into the given message object.
   * @param {!proto.chat.ConnectionsStreamResponse} msg The message object to deserialize into.
   * @param {!jspb.BinaryReader} reader The BinaryReader to use.
   * @return {!proto.chat.ConnectionsStreamResponse}
   */
  proto.chat.ConnectionsStreamResponse.deserializeBinaryFromReader = function(msg, reader) {
    while (reader.nextField()) {
      if (reader.isEndGroup()) {
        break;
      }
      var field = reader.getFieldNumber();
      switch (field) {
      case 1:
        var value = new users_pb.User;
        reader.readMessage(value,users_pb.User.deserializeBinaryFromReader);
        msg.addUsers(value);
        break;
      default:
        reader.skipField();
        break;
      }
    }
    return msg;
  };
  
  
  /**
   * Serializes the message to binary data (in protobuf wire format).
   * @return {!Uint8Array}
   */
  proto.chat.ConnectionsStreamResponse.prototype.serializeBinary = function() {
    var writer = new jspb.BinaryWriter();
    proto.chat.ConnectionsStreamResponse.serializeBinaryToWriter(this, writer);
    return writer.getResultBuffer();
  };
  
  
  /**
   * Serializes the given message to binary data (in protobuf wire
   * format), writing to the given BinaryWriter.
   * @param {!proto.chat.ConnectionsStreamResponse} message
   * @param {!jspb.BinaryWriter} writer
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.ConnectionsStreamResponse.serializeBinaryToWriter = function(message, writer) {
    var f = undefined;
    f = message.getUsersList();
    if (f.length > 0) {
      writer.writeRepeatedMessage(
        1,
        f,
        users_pb.User.serializeBinaryToWriter
      );
    }
  };
  
  
  /**
   * repeated users.User users = 1;
   * @return {!Array<!proto.users.User>}
   */
  proto.chat.ConnectionsStreamResponse.prototype.getUsersList = function() {
    return /** @type{!Array<!proto.users.User>} */ (
      jspb.Message.getRepeatedWrapperField(this, users_pb.User, 1));
  };
  
  
  /**
   * @param {!Array<!proto.users.User>} value
   * @return {!proto.chat.ConnectionsStreamResponse} returns this
  */
  proto.chat.ConnectionsStreamResponse.prototype.setUsersList = function(value) {
    return jspb.Message.setRepeatedWrapperField(this, 1, value);
  };
  
  
  /**
   * @param {!proto.users.User=} opt_value
   * @param {number=} opt_index
   * @return {!proto.users.User}
   */
  proto.chat.ConnectionsStreamResponse.prototype.addUsers = function(opt_value, opt_index) {
    return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.users.User, opt_index);
  };
  
  
  /**
   * Clears the list making it empty but non-null.
   * @return {!proto.chat.ConnectionsStreamResponse} returns this
   */
  proto.chat.ConnectionsStreamResponse.prototype.clearUsersList = function() {
    return this.setUsersList([]);
  };
  
  
  
  /**
   * List of repeated fields within this message type.
   * @private {!Array<number>}
   * @const
   */
  proto.chat.ConnectionsResponse.repeatedFields_ = [1];
  
  
  
  if (jspb.Message.GENERATE_TO_OBJECT) {
  /**
   * Creates an object representation of this proto.
   * Field names that are reserved in JavaScript and will be renamed to pb_name.
   * Optional fields that are not set will be set to undefined.
   * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
   * For the list of reserved names please see:
   *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
   * @param {boolean=} opt_includeInstance Deprecated. whether to include the
   *     JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @return {!Object}
   */
  proto.chat.ConnectionsResponse.prototype.toObject = function(opt_includeInstance) {
    return proto.chat.ConnectionsResponse.toObject(opt_includeInstance, this);
  };
  
  
  /**
   * Static version of the {@see toObject} method.
   * @param {boolean|undefined} includeInstance Deprecated. Whether to include
   *     the JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @param {!proto.chat.ConnectionsResponse} msg The msg instance to transform.
   * @return {!Object}
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.ConnectionsResponse.toObject = function(includeInstance, msg) {
    var f, obj = {
      usersList: jspb.Message.toObjectList(msg.getUsersList(),
      users_pb.User.toObject, includeInstance)
    };
  
    if (includeInstance) {
      obj.$jspbMessageInstance = msg;
    }
    return obj;
  };
  }
  
  
  /**
   * Deserializes binary data (in protobuf wire format).
   * @param {jspb.ByteSource} bytes The bytes to deserialize.
   * @return {!proto.chat.ConnectionsResponse}
   */
  proto.chat.ConnectionsResponse.deserializeBinary = function(bytes) {
    var reader = new jspb.BinaryReader(bytes);
    var msg = new proto.chat.ConnectionsResponse;
    return proto.chat.ConnectionsResponse.deserializeBinaryFromReader(msg, reader);
  };
  
  
  /**
   * Deserializes binary data (in protobuf wire format) from the
   * given reader into the given message object.
   * @param {!proto.chat.ConnectionsResponse} msg The message object to deserialize into.
   * @param {!jspb.BinaryReader} reader The BinaryReader to use.
   * @return {!proto.chat.ConnectionsResponse}
   */
  proto.chat.ConnectionsResponse.deserializeBinaryFromReader = function(msg, reader) {
    while (reader.nextField()) {
      if (reader.isEndGroup()) {
        break;
      }
      var field = reader.getFieldNumber();
      switch (field) {
      case 1:
        var value = new users_pb.User;
        reader.readMessage(value,users_pb.User.deserializeBinaryFromReader);
        msg.addUsers(value);
        break;
      default:
        reader.skipField();
        break;
      }
    }
    return msg;
  };
  
  
  /**
   * Serializes the message to binary data (in protobuf wire format).
   * @return {!Uint8Array}
   */
  proto.chat.ConnectionsResponse.prototype.serializeBinary = function() {
    var writer = new jspb.BinaryWriter();
    proto.chat.ConnectionsResponse.serializeBinaryToWriter(this, writer);
    return writer.getResultBuffer();
  };
  
  
  /**
   * Serializes the given message to binary data (in protobuf wire
   * format), writing to the given BinaryWriter.
   * @param {!proto.chat.ConnectionsResponse} message
   * @param {!jspb.BinaryWriter} writer
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.ConnectionsResponse.serializeBinaryToWriter = function(message, writer) {
    var f = undefined;
    f = message.getUsersList();
    if (f.length > 0) {
      writer.writeRepeatedMessage(
        1,
        f,
        users_pb.User.serializeBinaryToWriter
      );
    }
  };
  
  
  /**
   * repeated users.User users = 1;
   * @return {!Array<!proto.users.User>}
   */
  proto.chat.ConnectionsResponse.prototype.getUsersList = function() {
    return /** @type{!Array<!proto.users.User>} */ (
      jspb.Message.getRepeatedWrapperField(this, users_pb.User, 1));
  };
  
  
  /**
   * @param {!Array<!proto.users.User>} value
   * @return {!proto.chat.ConnectionsResponse} returns this
  */
  proto.chat.ConnectionsResponse.prototype.setUsersList = function(value) {
    return jspb.Message.setRepeatedWrapperField(this, 1, value);
  };
  
  
  /**
   * @param {!proto.users.User=} opt_value
   * @param {number=} opt_index
   * @return {!proto.users.User}
   */
  proto.chat.ConnectionsResponse.prototype.addUsers = function(opt_value, opt_index) {
    return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.users.User, opt_index);
  };
  
  
  /**
   * Clears the list making it empty but non-null.
   * @return {!proto.chat.ConnectionsResponse} returns this
   */
  proto.chat.ConnectionsResponse.prototype.clearUsersList = function() {
    return this.setUsersList([]);
  };
  
  
  
  /**
   * List of repeated fields within this message type.
   * @private {!Array<number>}
   * @const
   */
  proto.chat.ChatStreamResponse.repeatedFields_ = [1];
  
  
  
  if (jspb.Message.GENERATE_TO_OBJECT) {
  /**
   * Creates an object representation of this proto.
   * Field names that are reserved in JavaScript and will be renamed to pb_name.
   * Optional fields that are not set will be set to undefined.
   * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
   * For the list of reserved names please see:
   *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
   * @param {boolean=} opt_includeInstance Deprecated. whether to include the
   *     JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @return {!Object}
   */
  proto.chat.ChatStreamResponse.prototype.toObject = function(opt_includeInstance) {
    return proto.chat.ChatStreamResponse.toObject(opt_includeInstance, this);
  };
  
  
  /**
   * Static version of the {@see toObject} method.
   * @param {boolean|undefined} includeInstance Deprecated. Whether to include
   *     the JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @param {!proto.chat.ChatStreamResponse} msg The msg instance to transform.
   * @return {!Object}
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.ChatStreamResponse.toObject = function(includeInstance, msg) {
    var f, obj = {
      messagesList: jspb.Message.toObjectList(msg.getMessagesList(),
      proto.chat.Message.toObject, includeInstance)
    };
  
    if (includeInstance) {
      obj.$jspbMessageInstance = msg;
    }
    return obj;
  };
  }
  
  
  /**
   * Deserializes binary data (in protobuf wire format).
   * @param {jspb.ByteSource} bytes The bytes to deserialize.
   * @return {!proto.chat.ChatStreamResponse}
   */
  proto.chat.ChatStreamResponse.deserializeBinary = function(bytes) {
    var reader = new jspb.BinaryReader(bytes);
    var msg = new proto.chat.ChatStreamResponse;
    return proto.chat.ChatStreamResponse.deserializeBinaryFromReader(msg, reader);
  };
  
  
  /**
   * Deserializes binary data (in protobuf wire format) from the
   * given reader into the given message object.
   * @param {!proto.chat.ChatStreamResponse} msg The message object to deserialize into.
   * @param {!jspb.BinaryReader} reader The BinaryReader to use.
   * @return {!proto.chat.ChatStreamResponse}
   */
  proto.chat.ChatStreamResponse.deserializeBinaryFromReader = function(msg, reader) {
    while (reader.nextField()) {
      if (reader.isEndGroup()) {
        break;
      }
      var field = reader.getFieldNumber();
      switch (field) {
      case 1:
        var value = new proto.chat.Message;
        reader.readMessage(value,proto.chat.Message.deserializeBinaryFromReader);
        msg.addMessages(value);
        break;
      default:
        reader.skipField();
        break;
      }
    }
    return msg;
  };
  
  
  /**
   * Serializes the message to binary data (in protobuf wire format).
   * @return {!Uint8Array}
   */
  proto.chat.ChatStreamResponse.prototype.serializeBinary = function() {
    var writer = new jspb.BinaryWriter();
    proto.chat.ChatStreamResponse.serializeBinaryToWriter(this, writer);
    return writer.getResultBuffer();
  };
  
  
  /**
   * Serializes the given message to binary data (in protobuf wire
   * format), writing to the given BinaryWriter.
   * @param {!proto.chat.ChatStreamResponse} message
   * @param {!jspb.BinaryWriter} writer
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.ChatStreamResponse.serializeBinaryToWriter = function(message, writer) {
    var f = undefined;
    f = message.getMessagesList();
    if (f.length > 0) {
      writer.writeRepeatedMessage(
        1,
        f,
        proto.chat.Message.serializeBinaryToWriter
      );
    }
  };
  
  
  /**
   * repeated Message messages = 1;
   * @return {!Array<!proto.chat.Message>}
   */
  proto.chat.ChatStreamResponse.prototype.getMessagesList = function() {
    return /** @type{!Array<!proto.chat.Message>} */ (
      jspb.Message.getRepeatedWrapperField(this, proto.chat.Message, 1));
  };
  
  
  /**
   * @param {!Array<!proto.chat.Message>} value
   * @return {!proto.chat.ChatStreamResponse} returns this
  */
  proto.chat.ChatStreamResponse.prototype.setMessagesList = function(value) {
    return jspb.Message.setRepeatedWrapperField(this, 1, value);
  };
  
  
  /**
   * @param {!proto.chat.Message=} opt_value
   * @param {number=} opt_index
   * @return {!proto.chat.Message}
   */
  proto.chat.ChatStreamResponse.prototype.addMessages = function(opt_value, opt_index) {
    return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.chat.Message, opt_index);
  };
  
  
  /**
   * Clears the list making it empty but non-null.
   * @return {!proto.chat.ChatStreamResponse} returns this
   */
  proto.chat.ChatStreamResponse.prototype.clearMessagesList = function() {
    return this.setMessagesList([]);
  };
  
  
  
  
  
  if (jspb.Message.GENERATE_TO_OBJECT) {
  /**
   * Creates an object representation of this proto.
   * Field names that are reserved in JavaScript and will be renamed to pb_name.
   * Optional fields that are not set will be set to undefined.
   * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
   * For the list of reserved names please see:
   *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
   * @param {boolean=} opt_includeInstance Deprecated. whether to include the
   *     JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @return {!Object}
   */
  proto.chat.Channel.prototype.toObject = function(opt_includeInstance) {
    return proto.chat.Channel.toObject(opt_includeInstance, this);
  };
  
  
  /**
   * Static version of the {@see toObject} method.
   * @param {boolean|undefined} includeInstance Deprecated. Whether to include
   *     the JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @param {!proto.chat.Channel} msg The msg instance to transform.
   * @return {!Object}
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.Channel.toObject = function(includeInstance, msg) {
    var f, obj = {
      id: jspb.Message.getFieldWithDefault(msg, 1, 0),
      name: jspb.Message.getFieldWithDefault(msg, 2, "")
    };
  
    if (includeInstance) {
      obj.$jspbMessageInstance = msg;
    }
    return obj;
  };
  }
  
  
  /**
   * Deserializes binary data (in protobuf wire format).
   * @param {jspb.ByteSource} bytes The bytes to deserialize.
   * @return {!proto.chat.Channel}
   */
  proto.chat.Channel.deserializeBinary = function(bytes) {
    var reader = new jspb.BinaryReader(bytes);
    var msg = new proto.chat.Channel;
    return proto.chat.Channel.deserializeBinaryFromReader(msg, reader);
  };
  
  
  /**
   * Deserializes binary data (in protobuf wire format) from the
   * given reader into the given message object.
   * @param {!proto.chat.Channel} msg The message object to deserialize into.
   * @param {!jspb.BinaryReader} reader The BinaryReader to use.
   * @return {!proto.chat.Channel}
   */
  proto.chat.Channel.deserializeBinaryFromReader = function(msg, reader) {
    while (reader.nextField()) {
      if (reader.isEndGroup()) {
        break;
      }
      var field = reader.getFieldNumber();
      switch (field) {
      case 1:
        var value = /** @type {number} */ (reader.readInt32());
        msg.setId(value);
        break;
      case 2:
        var value = /** @type {string} */ (reader.readString());
        msg.setName(value);
        break;
      default:
        reader.skipField();
        break;
      }
    }
    return msg;
  };
  
  
  /**
   * Serializes the message to binary data (in protobuf wire format).
   * @return {!Uint8Array}
   */
  proto.chat.Channel.prototype.serializeBinary = function() {
    var writer = new jspb.BinaryWriter();
    proto.chat.Channel.serializeBinaryToWriter(this, writer);
    return writer.getResultBuffer();
  };
  
  
  /**
   * Serializes the given message to binary data (in protobuf wire
   * format), writing to the given BinaryWriter.
   * @param {!proto.chat.Channel} message
   * @param {!jspb.BinaryWriter} writer
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.Channel.serializeBinaryToWriter = function(message, writer) {
    var f = undefined;
    f = message.getId();
    if (f !== 0) {
      writer.writeInt32(
        1,
        f
      );
    }
    f = message.getName();
    if (f.length > 0) {
      writer.writeString(
        2,
        f
      );
    }
  };
  
  
  /**
   * optional int32 id = 1;
   * @return {number}
   */
  proto.chat.Channel.prototype.getId = function() {
    return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
  };
  
  
  /**
   * @param {number} value
   * @return {!proto.chat.Channel} returns this
   */
  proto.chat.Channel.prototype.setId = function(value) {
    return jspb.Message.setProto3IntField(this, 1, value);
  };
  
  
  /**
   * optional string name = 2;
   * @return {string}
   */
  proto.chat.Channel.prototype.getName = function() {
    return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
  };
  
  
  /**
   * @param {string} value
   * @return {!proto.chat.Channel} returns this
   */
  proto.chat.Channel.prototype.setName = function(value) {
    return jspb.Message.setProto3StringField(this, 2, value);
  };
  
  
  
  
  
  if (jspb.Message.GENERATE_TO_OBJECT) {
  /**
   * Creates an object representation of this proto.
   * Field names that are reserved in JavaScript and will be renamed to pb_name.
   * Optional fields that are not set will be set to undefined.
   * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
   * For the list of reserved names please see:
   *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
   * @param {boolean=} opt_includeInstance Deprecated. whether to include the
   *     JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @return {!Object}
   */
  proto.chat.Message.prototype.toObject = function(opt_includeInstance) {
    return proto.chat.Message.toObject(opt_includeInstance, this);
  };
  
  
  /**
   * Static version of the {@see toObject} method.
   * @param {boolean|undefined} includeInstance Deprecated. Whether to include
   *     the JSPB instance for transitional soy proto support:
   *     http://goto/soy-param-migration
   * @param {!proto.chat.Message} msg The msg instance to transform.
   * @return {!Object}
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.Message.toObject = function(includeInstance, msg) {
    var f, obj = {
      id: jspb.Message.getFieldWithDefault(msg, 1, 0),
      content: jspb.Message.getFieldWithDefault(msg, 2, ""),
      timestamp: jspb.Message.getFieldWithDefault(msg, 3, ""),
      userId: jspb.Message.getFieldWithDefault(msg, 4, 0)
    };
  
    if (includeInstance) {
      obj.$jspbMessageInstance = msg;
    }
    return obj;
  };
  }
  
  
  /**
   * Deserializes binary data (in protobuf wire format).
   * @param {jspb.ByteSource} bytes The bytes to deserialize.
   * @return {!proto.chat.Message}
   */
  proto.chat.Message.deserializeBinary = function(bytes) {
    var reader = new jspb.BinaryReader(bytes);
    var msg = new proto.chat.Message;
    return proto.chat.Message.deserializeBinaryFromReader(msg, reader);
  };
  
  
  /**
   * Deserializes binary data (in protobuf wire format) from the
   * given reader into the given message object.
   * @param {!proto.chat.Message} msg The message object to deserialize into.
   * @param {!jspb.BinaryReader} reader The BinaryReader to use.
   * @return {!proto.chat.Message}
   */
  proto.chat.Message.deserializeBinaryFromReader = function(msg, reader) {
    while (reader.nextField()) {
      if (reader.isEndGroup()) {
        break;
      }
      var field = reader.getFieldNumber();
      switch (field) {
      case 1:
        var value = /** @type {number} */ (reader.readInt32());
        msg.setId(value);
        break;
      case 2:
        var value = /** @type {string} */ (reader.readString());
        msg.setContent(value);
        break;
      case 3:
        var value = /** @type {string} */ (reader.readString());
        msg.setTimestamp(value);
        break;
      case 4:
        var value = /** @type {number} */ (reader.readInt32());
        msg.setUserId(value);
        break;
      default:
        reader.skipField();
        break;
      }
    }
    return msg;
  };
  
  
  /**
   * Serializes the message to binary data (in protobuf wire format).
   * @return {!Uint8Array}
   */
  proto.chat.Message.prototype.serializeBinary = function() {
    var writer = new jspb.BinaryWriter();
    proto.chat.Message.serializeBinaryToWriter(this, writer);
    return writer.getResultBuffer();
  };
  
  
  /**
   * Serializes the given message to binary data (in protobuf wire
   * format), writing to the given BinaryWriter.
   * @param {!proto.chat.Message} message
   * @param {!jspb.BinaryWriter} writer
   * @suppress {unusedLocalVariables} f is only used for nested messages
   */
  proto.chat.Message.serializeBinaryToWriter = function(message, writer) {
    var f = undefined;
    f = message.getId();
    if (f !== 0) {
      writer.writeInt32(
        1,
        f
      );
    }
    f = message.getContent();
    if (f.length > 0) {
      writer.writeString(
        2,
        f
      );
    }
    f = message.getTimestamp();
    if (f.length > 0) {
      writer.writeString(
        3,
        f
      );
    }
    f = message.getUserId();
    if (f !== 0) {
      writer.writeInt32(
        4,
        f
      );
    }
  };
  
  
  /**
   * optional int32 id = 1;
   * @return {number}
   */
  proto.chat.Message.prototype.getId = function() {
    return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
  };
  
  
  /**
   * @param {number} value
   * @return {!proto.chat.Message} returns this
   */
  proto.chat.Message.prototype.setId = function(value) {
    return jspb.Message.setProto3IntField(this, 1, value);
  };
  
  
  /**
   * optional string content = 2;
   * @return {string}
   */
  proto.chat.Message.prototype.getContent = function() {
    return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
  };
  
  
  /**
   * @param {string} value
   * @return {!proto.chat.Message} returns this
   */
  proto.chat.Message.prototype.setContent = function(value) {
    return jspb.Message.setProto3StringField(this, 2, value);
  };
  
  
  /**
   * optional string timestamp = 3;
   * @return {string}
   */
  proto.chat.Message.prototype.getTimestamp = function() {
    return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
  };
  
  
  /**
   * @param {string} value
   * @return {!proto.chat.Message} returns this
   */
  proto.chat.Message.prototype.setTimestamp = function(value) {
    return jspb.Message.setProto3StringField(this, 3, value);
  };
  
  
  /**
   * optional int32 user_id = 4;
   * @return {number}
   */
  proto.chat.Message.prototype.getUserId = function() {
    return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
  };
  
  
  /**
   * @param {number} value
   * @return {!proto.chat.Message} returns this
   */
  proto.chat.Message.prototype.setUserId = function(value) {
    return jspb.Message.setProto3IntField(this, 4, value);
  };
  
  
  goog.object.extend(exports, proto.chat);
  