// source: tulip.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 =
    (typeof globalThis !== 'undefined' && globalThis) ||
    (typeof window !== 'undefined' && window) ||
    (typeof global !== 'undefined' && global) ||
    (typeof self !== 'undefined' && self) ||
    (function () { return this; }).call(null) ||
    Function('return this')();

goog.exportSymbol('proto.mint.tulip.v1.SearchRequest', null, global);
goog.exportSymbol('proto.mint.tulip.v1.SearchRequest.Page', null, global);
goog.exportSymbol('proto.mint.tulip.v1.SearchResponse', null, global);
goog.exportSymbol('proto.mint.tulip.v1.SearchResponse.Item', 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.mint.tulip.v1.SearchRequest = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, proto.mint.tulip.v1.SearchRequest.repeatedFields_, null);
};
goog.inherits(proto.mint.tulip.v1.SearchRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.mint.tulip.v1.SearchRequest.displayName = 'proto.mint.tulip.v1.SearchRequest';
}
/**
 * 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.mint.tulip.v1.SearchRequest.Page = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.mint.tulip.v1.SearchRequest.Page, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.mint.tulip.v1.SearchRequest.Page.displayName = 'proto.mint.tulip.v1.SearchRequest.Page';
}
/**
 * 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.mint.tulip.v1.SearchResponse = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, proto.mint.tulip.v1.SearchResponse.repeatedFields_, null);
};
goog.inherits(proto.mint.tulip.v1.SearchResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.mint.tulip.v1.SearchResponse.displayName = 'proto.mint.tulip.v1.SearchResponse';
}
/**
 * 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.mint.tulip.v1.SearchResponse.Item = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.mint.tulip.v1.SearchResponse.Item, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.mint.tulip.v1.SearchResponse.Item.displayName = 'proto.mint.tulip.v1.SearchResponse.Item';
}

/**
 * List of repeated fields within this message type.
 * @private {!Array<number>}
 * @const
 */
proto.mint.tulip.v1.SearchRequest.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.mint.tulip.v1.SearchRequest.prototype.toObject = function(opt_includeInstance) {
  return proto.mint.tulip.v1.SearchRequest.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.mint.tulip.v1.SearchRequest} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.mint.tulip.v1.SearchRequest.toObject = function(includeInstance, msg) {
  var f, obj = {
    keywordsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f,
    book: jspb.Message.getFieldWithDefault(msg, 2, 0),
    page: (f = msg.getPage()) && proto.mint.tulip.v1.SearchRequest.Page.toObject(includeInstance, f)
  };

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


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


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.mint.tulip.v1.SearchRequest} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.mint.tulip.v1.SearchRequest}
 */
proto.mint.tulip.v1.SearchRequest.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.addKeywords(value);
      break;
    case 2:
      var value = /** @type {number} */ (reader.readInt32());
      msg.setBook(value);
      break;
    case 99:
      var value = new proto.mint.tulip.v1.SearchRequest.Page;
      reader.readMessage(value,proto.mint.tulip.v1.SearchRequest.Page.deserializeBinaryFromReader);
      msg.setPage(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


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


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.mint.tulip.v1.SearchRequest} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.mint.tulip.v1.SearchRequest.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getKeywordsList();
  if (f.length > 0) {
    writer.writeRepeatedString(
      1,
      f
    );
  }
  f = message.getBook();
  if (f !== 0) {
    writer.writeInt32(
      2,
      f
    );
  }
  f = message.getPage();
  if (f != null) {
    writer.writeMessage(
      99,
      f,
      proto.mint.tulip.v1.SearchRequest.Page.serializeBinaryToWriter
    );
  }
};





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.mint.tulip.v1.SearchRequest.Page.prototype.toObject = function(opt_includeInstance) {
  return proto.mint.tulip.v1.SearchRequest.Page.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.mint.tulip.v1.SearchRequest.Page} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.mint.tulip.v1.SearchRequest.Page.toObject = function(includeInstance, msg) {
  var f, obj = {
    index: jspb.Message.getFieldWithDefault(msg, 1, 0),
    size: 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.mint.tulip.v1.SearchRequest.Page}
 */
proto.mint.tulip.v1.SearchRequest.Page.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.mint.tulip.v1.SearchRequest.Page;
  return proto.mint.tulip.v1.SearchRequest.Page.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.mint.tulip.v1.SearchRequest.Page} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.mint.tulip.v1.SearchRequest.Page}
 */
proto.mint.tulip.v1.SearchRequest.Page.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.setIndex(value);
      break;
    case 2:
      var value = /** @type {number} */ (reader.readInt32());
      msg.setSize(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


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


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.mint.tulip.v1.SearchRequest.Page} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.mint.tulip.v1.SearchRequest.Page.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getIndex();
  if (f !== 0) {
    writer.writeInt32(
      1,
      f
    );
  }
  f = message.getSize();
  if (f !== 0) {
    writer.writeInt32(
      2,
      f
    );
  }
};


/**
 * optional int32 index = 1;
 * @return {number}
 */
proto.mint.tulip.v1.SearchRequest.Page.prototype.getIndex = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};


/**
 * @param {number} value
 * @return {!proto.mint.tulip.v1.SearchRequest.Page} returns this
 */
proto.mint.tulip.v1.SearchRequest.Page.prototype.setIndex = function(value) {
  return jspb.Message.setProto3IntField(this, 1, value);
};


/**
 * optional int32 size = 2;
 * @return {number}
 */
proto.mint.tulip.v1.SearchRequest.Page.prototype.getSize = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};


/**
 * @param {number} value
 * @return {!proto.mint.tulip.v1.SearchRequest.Page} returns this
 */
proto.mint.tulip.v1.SearchRequest.Page.prototype.setSize = function(value) {
  return jspb.Message.setProto3IntField(this, 2, value);
};


/**
 * repeated string keywords = 1;
 * @return {!Array<string>}
 */
proto.mint.tulip.v1.SearchRequest.prototype.getKeywordsList = function() {
  return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 1));
};


/**
 * @param {!Array<string>} value
 * @return {!proto.mint.tulip.v1.SearchRequest} returns this
 */
proto.mint.tulip.v1.SearchRequest.prototype.setKeywordsList = function(value) {
  return jspb.Message.setField(this, 1, value || []);
};


/**
 * @param {string} value
 * @param {number=} opt_index
 * @return {!proto.mint.tulip.v1.SearchRequest} returns this
 */
proto.mint.tulip.v1.SearchRequest.prototype.addKeywords = function(value, opt_index) {
  return jspb.Message.addToRepeatedField(this, 1, value, opt_index);
};


/**
 * Clears the list making it empty but non-null.
 * @return {!proto.mint.tulip.v1.SearchRequest} returns this
 */
proto.mint.tulip.v1.SearchRequest.prototype.clearKeywordsList = function() {
  return this.setKeywordsList([]);
};


/**
 * optional int32 book = 2;
 * @return {number}
 */
proto.mint.tulip.v1.SearchRequest.prototype.getBook = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};


/**
 * @param {number} value
 * @return {!proto.mint.tulip.v1.SearchRequest} returns this
 */
proto.mint.tulip.v1.SearchRequest.prototype.setBook = function(value) {
  return jspb.Message.setProto3IntField(this, 2, value);
};


/**
 * optional Page page = 99;
 * @return {?proto.mint.tulip.v1.SearchRequest.Page}
 */
proto.mint.tulip.v1.SearchRequest.prototype.getPage = function() {
  return /** @type{?proto.mint.tulip.v1.SearchRequest.Page} */ (
    jspb.Message.getWrapperField(this, proto.mint.tulip.v1.SearchRequest.Page, 99));
};


/**
 * @param {?proto.mint.tulip.v1.SearchRequest.Page|undefined} value
 * @return {!proto.mint.tulip.v1.SearchRequest} returns this
*/
proto.mint.tulip.v1.SearchRequest.prototype.setPage = function(value) {
  return jspb.Message.setWrapperField(this, 99, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.mint.tulip.v1.SearchRequest} returns this
 */
proto.mint.tulip.v1.SearchRequest.prototype.clearPage = function() {
  return this.setPage(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.mint.tulip.v1.SearchRequest.prototype.hasPage = function() {
  return jspb.Message.getField(this, 99) != null;
};



/**
 * List of repeated fields within this message type.
 * @private {!Array<number>}
 * @const
 */
proto.mint.tulip.v1.SearchResponse.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.mint.tulip.v1.SearchResponse.prototype.toObject = function(opt_includeInstance) {
  return proto.mint.tulip.v1.SearchResponse.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.mint.tulip.v1.SearchResponse} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.mint.tulip.v1.SearchResponse.toObject = function(includeInstance, msg) {
  var f, obj = {
    itemsList: jspb.Message.toObjectList(msg.getItemsList(),
    proto.mint.tulip.v1.SearchResponse.Item.toObject, includeInstance),
    page: (f = msg.getPage()) && proto.mint.tulip.v1.SearchRequest.Page.toObject(includeInstance, f),
    total: jspb.Message.getFieldWithDefault(msg, 99, 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.mint.tulip.v1.SearchResponse}
 */
proto.mint.tulip.v1.SearchResponse.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.mint.tulip.v1.SearchResponse;
  return proto.mint.tulip.v1.SearchResponse.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.mint.tulip.v1.SearchResponse} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.mint.tulip.v1.SearchResponse}
 */
proto.mint.tulip.v1.SearchResponse.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new proto.mint.tulip.v1.SearchResponse.Item;
      reader.readMessage(value,proto.mint.tulip.v1.SearchResponse.Item.deserializeBinaryFromReader);
      msg.addItems(value);
      break;
    case 98:
      var value = new proto.mint.tulip.v1.SearchRequest.Page;
      reader.readMessage(value,proto.mint.tulip.v1.SearchRequest.Page.deserializeBinaryFromReader);
      msg.setPage(value);
      break;
    case 99:
      var value = /** @type {number} */ (reader.readInt32());
      msg.setTotal(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


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


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.mint.tulip.v1.SearchResponse} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.mint.tulip.v1.SearchResponse.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getItemsList();
  if (f.length > 0) {
    writer.writeRepeatedMessage(
      1,
      f,
      proto.mint.tulip.v1.SearchResponse.Item.serializeBinaryToWriter
    );
  }
  f = message.getPage();
  if (f != null) {
    writer.writeMessage(
      98,
      f,
      proto.mint.tulip.v1.SearchRequest.Page.serializeBinaryToWriter
    );
  }
  f = message.getTotal();
  if (f !== 0) {
    writer.writeInt32(
      99,
      f
    );
  }
};





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.mint.tulip.v1.SearchResponse.Item.prototype.toObject = function(opt_includeInstance) {
  return proto.mint.tulip.v1.SearchResponse.Item.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.mint.tulip.v1.SearchResponse.Item} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.mint.tulip.v1.SearchResponse.Item.toObject = function(includeInstance, msg) {
  var f, obj = {
    rank: jspb.Message.getFieldWithDefault(msg, 1, 0),
    highlight: jspb.Message.getFieldWithDefault(msg, 2, ""),
    book: jspb.Message.getFieldWithDefault(msg, 3, 0),
    paragraph: jspb.Message.getFieldWithDefault(msg, 4, 0),
    content: jspb.Message.getFieldWithDefault(msg, 5, "")
  };

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


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


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.mint.tulip.v1.SearchResponse.Item} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.mint.tulip.v1.SearchResponse.Item}
 */
proto.mint.tulip.v1.SearchResponse.Item.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.setRank(value);
      break;
    case 2:
      var value = /** @type {string} */ (reader.readString());
      msg.setHighlight(value);
      break;
    case 3:
      var value = /** @type {number} */ (reader.readInt32());
      msg.setBook(value);
      break;
    case 4:
      var value = /** @type {number} */ (reader.readInt32());
      msg.setParagraph(value);
      break;
    case 5:
      var value = /** @type {string} */ (reader.readString());
      msg.setContent(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


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


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.mint.tulip.v1.SearchResponse.Item} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.mint.tulip.v1.SearchResponse.Item.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getRank();
  if (f !== 0) {
    writer.writeInt32(
      1,
      f
    );
  }
  f = message.getHighlight();
  if (f.length > 0) {
    writer.writeString(
      2,
      f
    );
  }
  f = message.getBook();
  if (f !== 0) {
    writer.writeInt32(
      3,
      f
    );
  }
  f = message.getParagraph();
  if (f !== 0) {
    writer.writeInt32(
      4,
      f
    );
  }
  f = message.getContent();
  if (f.length > 0) {
    writer.writeString(
      5,
      f
    );
  }
};


/**
 * optional int32 rank = 1;
 * @return {number}
 */
proto.mint.tulip.v1.SearchResponse.Item.prototype.getRank = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};


/**
 * @param {number} value
 * @return {!proto.mint.tulip.v1.SearchResponse.Item} returns this
 */
proto.mint.tulip.v1.SearchResponse.Item.prototype.setRank = function(value) {
  return jspb.Message.setProto3IntField(this, 1, value);
};


/**
 * optional string highlight = 2;
 * @return {string}
 */
proto.mint.tulip.v1.SearchResponse.Item.prototype.getHighlight = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};


/**
 * @param {string} value
 * @return {!proto.mint.tulip.v1.SearchResponse.Item} returns this
 */
proto.mint.tulip.v1.SearchResponse.Item.prototype.setHighlight = function(value) {
  return jspb.Message.setProto3StringField(this, 2, value);
};


/**
 * optional int32 book = 3;
 * @return {number}
 */
proto.mint.tulip.v1.SearchResponse.Item.prototype.getBook = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};


/**
 * @param {number} value
 * @return {!proto.mint.tulip.v1.SearchResponse.Item} returns this
 */
proto.mint.tulip.v1.SearchResponse.Item.prototype.setBook = function(value) {
  return jspb.Message.setProto3IntField(this, 3, value);
};


/**
 * optional int32 paragraph = 4;
 * @return {number}
 */
proto.mint.tulip.v1.SearchResponse.Item.prototype.getParagraph = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};


/**
 * @param {number} value
 * @return {!proto.mint.tulip.v1.SearchResponse.Item} returns this
 */
proto.mint.tulip.v1.SearchResponse.Item.prototype.setParagraph = function(value) {
  return jspb.Message.setProto3IntField(this, 4, value);
};


/**
 * optional string content = 5;
 * @return {string}
 */
proto.mint.tulip.v1.SearchResponse.Item.prototype.getContent = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};


/**
 * @param {string} value
 * @return {!proto.mint.tulip.v1.SearchResponse.Item} returns this
 */
proto.mint.tulip.v1.SearchResponse.Item.prototype.setContent = function(value) {
  return jspb.Message.setProto3StringField(this, 5, value);
};


/**
 * repeated Item items = 1;
 * @return {!Array<!proto.mint.tulip.v1.SearchResponse.Item>}
 */
proto.mint.tulip.v1.SearchResponse.prototype.getItemsList = function() {
  return /** @type{!Array<!proto.mint.tulip.v1.SearchResponse.Item>} */ (
    jspb.Message.getRepeatedWrapperField(this, proto.mint.tulip.v1.SearchResponse.Item, 1));
};


/**
 * @param {!Array<!proto.mint.tulip.v1.SearchResponse.Item>} value
 * @return {!proto.mint.tulip.v1.SearchResponse} returns this
*/
proto.mint.tulip.v1.SearchResponse.prototype.setItemsList = function(value) {
  return jspb.Message.setRepeatedWrapperField(this, 1, value);
};


/**
 * @param {!proto.mint.tulip.v1.SearchResponse.Item=} opt_value
 * @param {number=} opt_index
 * @return {!proto.mint.tulip.v1.SearchResponse.Item}
 */
proto.mint.tulip.v1.SearchResponse.prototype.addItems = function(opt_value, opt_index) {
  return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.mint.tulip.v1.SearchResponse.Item, opt_index);
};


/**
 * Clears the list making it empty but non-null.
 * @return {!proto.mint.tulip.v1.SearchResponse} returns this
 */
proto.mint.tulip.v1.SearchResponse.prototype.clearItemsList = function() {
  return this.setItemsList([]);
};


/**
 * optional SearchRequest.Page page = 98;
 * @return {?proto.mint.tulip.v1.SearchRequest.Page}
 */
proto.mint.tulip.v1.SearchResponse.prototype.getPage = function() {
  return /** @type{?proto.mint.tulip.v1.SearchRequest.Page} */ (
    jspb.Message.getWrapperField(this, proto.mint.tulip.v1.SearchRequest.Page, 98));
};


/**
 * @param {?proto.mint.tulip.v1.SearchRequest.Page|undefined} value
 * @return {!proto.mint.tulip.v1.SearchResponse} returns this
*/
proto.mint.tulip.v1.SearchResponse.prototype.setPage = function(value) {
  return jspb.Message.setWrapperField(this, 98, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.mint.tulip.v1.SearchResponse} returns this
 */
proto.mint.tulip.v1.SearchResponse.prototype.clearPage = function() {
  return this.setPage(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.mint.tulip.v1.SearchResponse.prototype.hasPage = function() {
  return jspb.Message.getField(this, 98) != null;
};


/**
 * optional int32 total = 99;
 * @return {number}
 */
proto.mint.tulip.v1.SearchResponse.prototype.getTotal = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 99, 0));
};


/**
 * @param {number} value
 * @return {!proto.mint.tulip.v1.SearchResponse} returns this
 */
proto.mint.tulip.v1.SearchResponse.prototype.setTotal = function(value) {
  return jspb.Message.setProto3IntField(this, 99, value);
};


goog.object.extend(exports, proto.mint.tulip.v1);
