/*eslint-env node */
/**
 * @fileoverview
 * @enhanceable
 * @public
 */
// GENERATED CODE -- DO NOT EDIT!

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

goog.exportSymbol("proto.LogMessage", null, global);
goog.exportSymbol("proto.LogMessage.LogMessageType", 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.LogMessage = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.LogMessage, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  proto.LogMessage.displayName = "proto.LogMessage";
}


if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto suitable for use in Soy templates.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
 *     for transitional soy proto support: http://goto/soy-param-migration
 * @return {!Object}
 */
proto.LogMessage.prototype.toObject = function(opt_includeInstance) {
  return proto.LogMessage.toObject(opt_includeInstance, this);
};


/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Whether to include the JSPB
 *     instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.LogMessage} msg The msg instance to transform.
 * @return {!Object}
 */
proto.LogMessage.toObject = function(includeInstance, msg) {
  var f, obj = {
    message: jspb.Message.getField(msg, 1),
    messageType: jspb.Message.getField(msg, 2),
    timestamp: jspb.Message.getField(msg, 3),
    appId: jspb.Message.getField(msg, 4),
    sourceType: jspb.Message.getField(msg, 8),
    sourceInstance: jspb.Message.getField(msg, 6)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}


/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.LogMessage}
 */
proto.LogMessage.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.LogMessage;
  return proto.LogMessage.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.LogMessage} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.LogMessage}
 */
proto.LogMessage.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.setMessage(value);
      break;
    case 2:
      var value = /** @type {!proto.LogMessage.LogMessageType} */ (reader.readEnum());
      msg.setMessageType(value);
      break;
    case 3:
      var value = /** @type {number} */ (reader.readSint64());
      msg.setTimestamp(value);
      break;
    case 4:
      var value = /** @type {string} */ (reader.readString());
      msg.setAppId(value);
      break;
    case 8:
      var value = /** @type {string} */ (reader.readString());
      msg.setSourceType(value);
      break;
    case 6:
      var value = /** @type {string} */ (reader.readString());
      msg.setSourceInstance(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Class method variant: serializes the given message to binary data
 * (in protobuf wire format), writing to the given BinaryWriter.
 * @param {!proto.LogMessage} message
 * @param {!jspb.BinaryWriter} writer
 */
proto.LogMessage.serializeBinaryToWriter = function(message, writer) {
  message.serializeBinaryToWriter(writer);
};


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


/**
 * Serializes the message to binary data (in protobuf wire format),
 * writing to the given BinaryWriter.
 * @param {!jspb.BinaryWriter} writer
 */
proto.LogMessage.prototype.serializeBinaryToWriter = function (writer) {
  var f = undefined;
  f = this.getMessage();
  if (f != null) {
    writer.writeString(
      1,
      f
    );
  }
  f = this.getMessageType();
  if (f != null) {
    writer.writeEnum(
      2,
      f
    );
  }
  f = this.getTimestamp();
  if (f != null) {
    writer.writeSint64(
      3,
      f
    );
  }
  f = this.getAppId();
  if (f != null) {
    writer.writeString(
      4,
      f
    );
  }
  f = this.getSourceType();
  if (f != null) {
    writer.writeString(
      8,
      f
    );
  }
  f = this.getSourceInstance();
  if (f != null) {
    writer.writeString(
      6,
      f
    );
  }
};


/**
 * Creates a deep clone of this proto. No data is shared with the original.
 * @return {!proto.LogMessage} The clone.
 */
proto.LogMessage.prototype.cloneMessage = function() {
  return /** @type {!proto.LogMessage} */ (jspb.Message.cloneMessage(this));
};


/**
 * required string message = 1;
 * @return {string}
 */
proto.LogMessage.prototype.getMessage = function() {
  return /** @type {string} */ (jspb.Message.getField(this, 1));
};


/** @param {string|undefined} value  */
proto.LogMessage.prototype.setMessage = function(value) {
  jspb.Message.setField(this, 1, value);
};


proto.LogMessage.prototype.clearMessage = function() {
  jspb.Message.setField(this, 1, undefined);
};


/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.LogMessage.prototype.hasMessage = function() {
  return jspb.Message.getField(this, 1) != null;
};


/**
 * required LogMessageType message_type = 2;
 * @return {!proto.LogMessage.LogMessageType}
 */
proto.LogMessage.prototype.getMessageType = function() {
  return /** @type {!proto.LogMessage.LogMessageType} */ (jspb.Message.getField(this, 2));
};


/** @param {proto.LogMessage.LogMessageType|undefined} value  */
proto.LogMessage.prototype.setMessageType = function(value) {
  jspb.Message.setField(this, 2, value);
};


proto.LogMessage.prototype.clearMessageType = function() {
  jspb.Message.setField(this, 2, undefined);
};


/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.LogMessage.prototype.hasMessageType = function() {
  return jspb.Message.getField(this, 2) != null;
};


/**
 * required sint64 timestamp = 3;
 * @return {number}
 */
proto.LogMessage.prototype.getTimestamp = function() {
  return /** @type {number} */ (jspb.Message.getField(this, 3));
};


/** @param {number|undefined} value  */
proto.LogMessage.prototype.setTimestamp = function(value) {
  jspb.Message.setField(this, 3, value);
};


proto.LogMessage.prototype.clearTimestamp = function() {
  jspb.Message.setField(this, 3, undefined);
};


/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.LogMessage.prototype.hasTimestamp = function() {
  return jspb.Message.getField(this, 3) != null;
};


/**
 * optional string app_id = 4;
 * @return {string?}
 */
proto.LogMessage.prototype.getAppId = function() {
  return /** @type {string?} */ (jspb.Message.getField(this, 4));
};


/** @param {string?|undefined} value  */
proto.LogMessage.prototype.setAppId = function(value) {
  jspb.Message.setField(this, 4, value);
};


proto.LogMessage.prototype.clearAppId = function() {
  jspb.Message.setField(this, 4, undefined);
};


/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.LogMessage.prototype.hasAppId = function() {
  return jspb.Message.getField(this, 4) != null;
};


/**
 * optional string source_type = 8;
 * @return {string?}
 */
proto.LogMessage.prototype.getSourceType = function() {
  return /** @type {string?} */ (jspb.Message.getField(this, 8));
};


/** @param {string?|undefined} value  */
proto.LogMessage.prototype.setSourceType = function(value) {
  jspb.Message.setField(this, 8, value);
};


proto.LogMessage.prototype.clearSourceType = function() {
  jspb.Message.setField(this, 8, undefined);
};


/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.LogMessage.prototype.hasSourceType = function() {
  return jspb.Message.getField(this, 8) != null;
};


/**
 * optional string source_instance = 6;
 * @return {string?}
 */
proto.LogMessage.prototype.getSourceInstance = function() {
  return /** @type {string?} */ (jspb.Message.getField(this, 6));
};


/** @param {string?|undefined} value  */
proto.LogMessage.prototype.setSourceInstance = function(value) {
  jspb.Message.setField(this, 6, value);
};


proto.LogMessage.prototype.clearSourceInstance = function() {
  jspb.Message.setField(this, 6, undefined);
};


/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.LogMessage.prototype.hasSourceInstance = function() {
  return jspb.Message.getField(this, 6) != null;
};


/**
 * @enum {number}
 */
proto.LogMessage.LogMessageType = {
  OUT: 1,
  ERR: 2
};

goog.object.extend(exports, proto);
