// source: cc/arduino/cli/monitor/v1/monitor.proto
/**
 * @fileoverview
 * @enhanceable
 * @suppress {missingRequire} reports error on implicit type usages.
 * @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!
/* eslint-disable */
// @ts-nocheck

var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();

var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js');
goog.object.extend(proto, google_protobuf_struct_pb);
goog.exportSymbol('proto.cc.arduino.cli.monitor.v1.MonitorConfig', null, global);
goog.exportSymbol('proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType', null, global);
goog.exportSymbol('proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest', null, global);
goog.exportSymbol('proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.ContentCase', null, global);
goog.exportSymbol('proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse', 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.cc.arduino.cli.monitor.v1.StreamingOpenRequest = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_);
};
goog.inherits(proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.displayName = 'proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest';
}
/**
 * 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.cc.arduino.cli.monitor.v1.MonitorConfig = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.monitor.v1.MonitorConfig, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.cc.arduino.cli.monitor.v1.MonitorConfig.displayName = 'proto.cc.arduino.cli.monitor.v1.MonitorConfig';
}
/**
 * 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.cc.arduino.cli.monitor.v1.StreamingOpenResponse = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.displayName = 'proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse';
}

/**
 * Oneof group definitions for this message. Each group defines the field
 * numbers belonging to that group. When of these fields' value is set, all
 * other fields in the group are cleared. During deserialization, if multiple
 * fields are encountered for a group, only the last value seen will be kept.
 * @private {!Array<!Array<number>>}
 * @const
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_ = [[1,2,3]];

/**
 * @enum {number}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.ContentCase = {
  CONTENT_NOT_SET: 0,
  CONFIG: 1,
  DATA: 2,
  RECV_ACKNOWLEDGE: 3
};

/**
 * @return {proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.ContentCase}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getContentCase = function() {
  return /** @type {proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.ContentCase} */(jspb.Message.computeOneofCase(this, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0]));
};



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.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.toObject = function(opt_includeInstance) {
  return proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.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.cc.arduino.cli.monitor.v1.StreamingOpenRequest} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.toObject = function(includeInstance, msg) {
  var f, obj = {
    config: (f = msg.getConfig()) && proto.cc.arduino.cli.monitor.v1.MonitorConfig.toObject(includeInstance, f),
    data: msg.getData_asB64(),
    recvAcknowledge: jspb.Message.getFieldWithDefault(msg, 3, 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.cc.arduino.cli.monitor.v1.StreamingOpenRequest}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest;
  return proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new proto.cc.arduino.cli.monitor.v1.MonitorConfig;
      reader.readMessage(value,proto.cc.arduino.cli.monitor.v1.MonitorConfig.deserializeBinaryFromReader);
      msg.setConfig(value);
      break;
    case 2:
      var value = /** @type {!Uint8Array} */ (reader.readBytes());
      msg.setData(value);
      break;
    case 3:
      var value = /** @type {number} */ (reader.readInt32());
      msg.setRecvAcknowledge(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getConfig();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      proto.cc.arduino.cli.monitor.v1.MonitorConfig.serializeBinaryToWriter
    );
  }
  f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2));
  if (f != null) {
    writer.writeBytes(
      2,
      f
    );
  }
  f = /** @type {number} */ (jspb.Message.getField(message, 3));
  if (f != null) {
    writer.writeInt32(
      3,
      f
    );
  }
};


/**
 * optional MonitorConfig config = 1;
 * @return {?proto.cc.arduino.cli.monitor.v1.MonitorConfig}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getConfig = function() {
  return /** @type{?proto.cc.arduino.cli.monitor.v1.MonitorConfig} */ (
    jspb.Message.getWrapperField(this, proto.cc.arduino.cli.monitor.v1.MonitorConfig, 1));
};


/**
 * @param {?proto.cc.arduino.cli.monitor.v1.MonitorConfig|undefined} value
 * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this
*/
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.setConfig = function(value) {
  return jspb.Message.setOneofWrapperField(this, 1, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0], value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.clearConfig = function() {
  return this.setConfig(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.hasConfig = function() {
  return jspb.Message.getField(this, 1) != null;
};


/**
 * optional bytes data = 2;
 * @return {!(string|Uint8Array)}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getData = function() {
  return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};


/**
 * optional bytes data = 2;
 * This is a type-conversion wrapper around `getData()`
 * @return {string}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getData_asB64 = function() {
  return /** @type {string} */ (jspb.Message.bytesAsB64(
      this.getData()));
};


/**
 * optional bytes data = 2;
 * Note that Uint8Array is not supported on all browsers.
 * @see http://caniuse.com/Uint8Array
 * This is a type-conversion wrapper around `getData()`
 * @return {!Uint8Array}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getData_asU8 = function() {
  return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
      this.getData()));
};


/**
 * @param {!(string|Uint8Array)} value
 * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.setData = function(value) {
  return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0], value);
};


/**
 * Clears the field making it undefined.
 * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.clearData = function() {
  return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0], undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.hasData = function() {
  return jspb.Message.getField(this, 2) != null;
};


/**
 * optional int32 recv_acknowledge = 3;
 * @return {number}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getRecvAcknowledge = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};


/**
 * @param {number} value
 * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.setRecvAcknowledge = function(value) {
  return jspb.Message.setOneofField(this, 3, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0], value);
};


/**
 * Clears the field making it undefined.
 * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.clearRecvAcknowledge = function() {
  return jspb.Message.setOneofField(this, 3, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0], undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.hasRecvAcknowledge = function() {
  return jspb.Message.getField(this, 3) != null;
};





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.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.toObject = function(opt_includeInstance) {
  return proto.cc.arduino.cli.monitor.v1.MonitorConfig.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.cc.arduino.cli.monitor.v1.MonitorConfig} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.toObject = function(includeInstance, msg) {
  var f, obj = {
    target: jspb.Message.getFieldWithDefault(msg, 1, ""),
    type: jspb.Message.getFieldWithDefault(msg, 2, 0),
    additionalConfig: (f = msg.getAdditionalConfig()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f),
    recvRateLimitBuffer: 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.cc.arduino.cli.monitor.v1.MonitorConfig}
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.cc.arduino.cli.monitor.v1.MonitorConfig;
  return proto.cc.arduino.cli.monitor.v1.MonitorConfig.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig}
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = /** @type {string} */ (reader.readString());
      msg.setTarget(value);
      break;
    case 2:
      var value = /** @type {!proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType} */ (reader.readEnum());
      msg.setType(value);
      break;
    case 3:
      var value = new google_protobuf_struct_pb.Struct;
      reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
      msg.setAdditionalConfig(value);
      break;
    case 4:
      var value = /** @type {number} */ (reader.readInt32());
      msg.setRecvRateLimitBuffer(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.cc.arduino.cli.monitor.v1.MonitorConfig.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getTarget();
  if (f.length > 0) {
    writer.writeString(
      1,
      f
    );
  }
  f = message.getType();
  if (f !== 0.0) {
    writer.writeEnum(
      2,
      f
    );
  }
  f = message.getAdditionalConfig();
  if (f != null) {
    writer.writeMessage(
      3,
      f,
      google_protobuf_struct_pb.Struct.serializeBinaryToWriter
    );
  }
  f = message.getRecvRateLimitBuffer();
  if (f !== 0) {
    writer.writeInt32(
      4,
      f
    );
  }
};


/**
 * @enum {number}
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType = {
  TARGET_TYPE_SERIAL: 0,
  TARGET_TYPE_NULL: 99
};

/**
 * optional string target = 1;
 * @return {string}
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.getTarget = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};


/**
 * @param {string} value
 * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} returns this
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.setTarget = function(value) {
  return jspb.Message.setProto3StringField(this, 1, value);
};


/**
 * optional TargetType type = 2;
 * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType}
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.getType = function() {
  return /** @type {!proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};


/**
 * @param {!proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType} value
 * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} returns this
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.setType = function(value) {
  return jspb.Message.setProto3EnumField(this, 2, value);
};


/**
 * optional google.protobuf.Struct additional_config = 3;
 * @return {?proto.google.protobuf.Struct}
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.getAdditionalConfig = function() {
  return /** @type{?proto.google.protobuf.Struct} */ (
    jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3));
};


/**
 * @param {?proto.google.protobuf.Struct|undefined} value
 * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} returns this
*/
proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.setAdditionalConfig = function(value) {
  return jspb.Message.setWrapperField(this, 3, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} returns this
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.clearAdditionalConfig = function() {
  return this.setAdditionalConfig(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.hasAdditionalConfig = function() {
  return jspb.Message.getField(this, 3) != null;
};


/**
 * optional int32 recv_rate_limit_buffer = 4;
 * @return {number}
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.getRecvRateLimitBuffer = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};


/**
 * @param {number} value
 * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} returns this
 */
proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.setRecvRateLimitBuffer = function(value) {
  return jspb.Message.setProto3IntField(this, 4, 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.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.toObject = function(opt_includeInstance) {
  return proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.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.cc.arduino.cli.monitor.v1.StreamingOpenResponse} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.toObject = function(includeInstance, msg) {
  var f, obj = {
    data: msg.getData_asB64(),
    dropped: jspb.Message.getFieldWithDefault(msg, 2, 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.cc.arduino.cli.monitor.v1.StreamingOpenResponse}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse;
  return proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = /** @type {!Uint8Array} */ (reader.readBytes());
      msg.setData(value);
      break;
    case 2:
      var value = /** @type {number} */ (reader.readInt32());
      msg.setDropped(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getData_asU8();
  if (f.length > 0) {
    writer.writeBytes(
      1,
      f
    );
  }
  f = message.getDropped();
  if (f !== 0) {
    writer.writeInt32(
      2,
      f
    );
  }
};


/**
 * optional bytes data = 1;
 * @return {!(string|Uint8Array)}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.getData = function() {
  return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};


/**
 * optional bytes data = 1;
 * This is a type-conversion wrapper around `getData()`
 * @return {string}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.getData_asB64 = function() {
  return /** @type {string} */ (jspb.Message.bytesAsB64(
      this.getData()));
};


/**
 * optional bytes data = 1;
 * Note that Uint8Array is not supported on all browsers.
 * @see http://caniuse.com/Uint8Array
 * This is a type-conversion wrapper around `getData()`
 * @return {!Uint8Array}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.getData_asU8 = function() {
  return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
      this.getData()));
};


/**
 * @param {!(string|Uint8Array)} value
 * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse} returns this
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.setData = function(value) {
  return jspb.Message.setProto3BytesField(this, 1, value);
};


/**
 * optional int32 dropped = 2;
 * @return {number}
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.getDropped = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};


/**
 * @param {number} value
 * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse} returns this
 */
proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.setDropped = function(value) {
  return jspb.Message.setProto3IntField(this, 2, value);
};


goog.object.extend(exports, proto.cc.arduino.cli.monitor.v1);
