Source: proto/spine/server/catchup/catch_up_pb.js

// source: spine/server/catchup/catch_up.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 spine_options_pb = require('../../../spine/options_pb.js');
goog.object.extend(proto, spine_options_pb);
var spine_time_options_pb = require('../../../spine/time_options_pb.js');
goog.object.extend(proto, spine_time_options_pb);
var google_protobuf_any_pb = require('../../../google/protobuf/any_pb.js');
goog.object.extend(proto, google_protobuf_any_pb);
var google_protobuf_timestamp_pb = require('../../../google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var spine_core_event_pb = require('../../../spine/core/event_pb.js');
goog.object.extend(proto, spine_core_event_pb);
goog.exportSymbol('proto.spine.server.catchup.CatchUp', null, global);
goog.exportSymbol('proto.spine.server.catchup.CatchUp.Request', null, global);
goog.exportSymbol('proto.spine.server.catchup.CatchUpId', null, global);
goog.exportSymbol('proto.spine.server.catchup.CatchUpStatus', 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.spine.server.catchup.CatchUp = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, proto.spine.server.catchup.CatchUp.repeatedFields_, null);
};
goog.inherits(proto.spine.server.catchup.CatchUp, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.server.catchup.CatchUp.displayName = 'proto.spine.server.catchup.CatchUp';
}
/**
 * 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.spine.server.catchup.CatchUp.Request = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, proto.spine.server.catchup.CatchUp.Request.repeatedFields_, null);
};
goog.inherits(proto.spine.server.catchup.CatchUp.Request, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.server.catchup.CatchUp.Request.displayName = 'proto.spine.server.catchup.CatchUp.Request';
}
/**
 * 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.spine.server.catchup.CatchUpId = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.server.catchup.CatchUpId, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.server.catchup.CatchUpId.displayName = 'proto.spine.server.catchup.CatchUpId';
}

/**
 * List of repeated fields within this message type.
 * @private {!Array<number>}
 * @const
 */
proto.spine.server.catchup.CatchUp.repeatedFields_ = [6];



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.spine.server.catchup.CatchUp.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.server.catchup.CatchUp.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.spine.server.catchup.CatchUp} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.catchup.CatchUp.toObject = function(includeInstance, msg) {
  var f, obj = {
    id: (f = msg.getId()) && proto.spine.server.catchup.CatchUpId.toObject(includeInstance, f),
    request: (f = msg.getRequest()) && proto.spine.server.catchup.CatchUp.Request.toObject(includeInstance, f),
    whenLastRead: (f = msg.getWhenLastRead()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
    status: jspb.Message.getFieldWithDefault(msg, 4, 0),
    totalShards: jspb.Message.getFieldWithDefault(msg, 5, 0),
    affectedShardList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : 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.spine.server.catchup.CatchUp}
 */
proto.spine.server.catchup.CatchUp.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.server.catchup.CatchUp;
  return proto.spine.server.catchup.CatchUp.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.server.catchup.CatchUp} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.server.catchup.CatchUp}
 */
proto.spine.server.catchup.CatchUp.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new proto.spine.server.catchup.CatchUpId;
      reader.readMessage(value,proto.spine.server.catchup.CatchUpId.deserializeBinaryFromReader);
      msg.setId(value);
      break;
    case 2:
      var value = new proto.spine.server.catchup.CatchUp.Request;
      reader.readMessage(value,proto.spine.server.catchup.CatchUp.Request.deserializeBinaryFromReader);
      msg.setRequest(value);
      break;
    case 3:
      var value = new google_protobuf_timestamp_pb.Timestamp;
      reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
      msg.setWhenLastRead(value);
      break;
    case 4:
      var value = /** @type {!proto.spine.server.catchup.CatchUpStatus} */ (reader.readEnum());
      msg.setStatus(value);
      break;
    case 5:
      var value = /** @type {number} */ (reader.readInt32());
      msg.setTotalShards(value);
      break;
    case 6:
      var value = /** @type {!Array<number>} */ (reader.readPackedInt32());
      msg.setAffectedShardList(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


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


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.spine.server.catchup.CatchUp} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.catchup.CatchUp.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getId();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      proto.spine.server.catchup.CatchUpId.serializeBinaryToWriter
    );
  }
  f = message.getRequest();
  if (f != null) {
    writer.writeMessage(
      2,
      f,
      proto.spine.server.catchup.CatchUp.Request.serializeBinaryToWriter
    );
  }
  f = message.getWhenLastRead();
  if (f != null) {
    writer.writeMessage(
      3,
      f,
      google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
    );
  }
  f = message.getStatus();
  if (f !== 0.0) {
    writer.writeEnum(
      4,
      f
    );
  }
  f = message.getTotalShards();
  if (f !== 0) {
    writer.writeInt32(
      5,
      f
    );
  }
  f = message.getAffectedShardList();
  if (f.length > 0) {
    writer.writePackedInt32(
      6,
      f
    );
  }
};



/**
 * List of repeated fields within this message type.
 * @private {!Array<number>}
 * @const
 */
proto.spine.server.catchup.CatchUp.Request.repeatedFields_ = [1,3];



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.spine.server.catchup.CatchUp.Request.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.server.catchup.CatchUp.Request.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.spine.server.catchup.CatchUp.Request} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.catchup.CatchUp.Request.toObject = function(includeInstance, msg) {
  var f, obj = {
    targetList: jspb.Message.toObjectList(msg.getTargetList(),
    google_protobuf_any_pb.Any.toObject, includeInstance),
    sinceWhen: (f = msg.getSinceWhen()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
    eventTypeList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : 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.spine.server.catchup.CatchUp.Request}
 */
proto.spine.server.catchup.CatchUp.Request.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.server.catchup.CatchUp.Request;
  return proto.spine.server.catchup.CatchUp.Request.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.server.catchup.CatchUp.Request} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.server.catchup.CatchUp.Request}
 */
proto.spine.server.catchup.CatchUp.Request.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new google_protobuf_any_pb.Any;
      reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
      msg.addTarget(value);
      break;
    case 2:
      var value = new google_protobuf_timestamp_pb.Timestamp;
      reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
      msg.setSinceWhen(value);
      break;
    case 3:
      var value = /** @type {string} */ (reader.readString());
      msg.addEventType(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


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


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.spine.server.catchup.CatchUp.Request} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.catchup.CatchUp.Request.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getTargetList();
  if (f.length > 0) {
    writer.writeRepeatedMessage(
      1,
      f,
      google_protobuf_any_pb.Any.serializeBinaryToWriter
    );
  }
  f = message.getSinceWhen();
  if (f != null) {
    writer.writeMessage(
      2,
      f,
      google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
    );
  }
  f = message.getEventTypeList();
  if (f.length > 0) {
    writer.writeRepeatedString(
      3,
      f
    );
  }
};


/**
 * repeated google.protobuf.Any target = 1;
 * @return {!Array<!proto.google.protobuf.Any>}
 */
proto.spine.server.catchup.CatchUp.Request.prototype.getTargetList = function() {
  return /** @type{!Array<!proto.google.protobuf.Any>} */ (
    jspb.Message.getRepeatedWrapperField(this, google_protobuf_any_pb.Any, 1));
};


/**
 * @param {!Array<!proto.google.protobuf.Any>} value
 * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
*/
proto.spine.server.catchup.CatchUp.Request.prototype.setTargetList = function(value) {
  return jspb.Message.setRepeatedWrapperField(this, 1, value);
};


/**
 * @param {!proto.google.protobuf.Any=} opt_value
 * @param {number=} opt_index
 * @return {!proto.google.protobuf.Any}
 */
proto.spine.server.catchup.CatchUp.Request.prototype.addTarget = function(opt_value, opt_index) {
  return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.google.protobuf.Any, opt_index);
};


/**
 * Clears the list making it empty but non-null.
 * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
 */
proto.spine.server.catchup.CatchUp.Request.prototype.clearTargetList = function() {
  return this.setTargetList([]);
};


/**
 * optional google.protobuf.Timestamp since_when = 2;
 * @return {?proto.google.protobuf.Timestamp}
 */
proto.spine.server.catchup.CatchUp.Request.prototype.getSinceWhen = function() {
  return /** @type{?proto.google.protobuf.Timestamp} */ (
    jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2));
};


/**
 * @param {?proto.google.protobuf.Timestamp|undefined} value
 * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
*/
proto.spine.server.catchup.CatchUp.Request.prototype.setSinceWhen = function(value) {
  return jspb.Message.setWrapperField(this, 2, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
 */
proto.spine.server.catchup.CatchUp.Request.prototype.clearSinceWhen = function() {
  return this.setSinceWhen(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.server.catchup.CatchUp.Request.prototype.hasSinceWhen = function() {
  return jspb.Message.getField(this, 2) != null;
};


/**
 * repeated string event_type = 3;
 * @return {!Array<string>}
 */
proto.spine.server.catchup.CatchUp.Request.prototype.getEventTypeList = function() {
  return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3));
};


/**
 * @param {!Array<string>} value
 * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
 */
proto.spine.server.catchup.CatchUp.Request.prototype.setEventTypeList = function(value) {
  return jspb.Message.setField(this, 3, value || []);
};


/**
 * @param {string} value
 * @param {number=} opt_index
 * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
 */
proto.spine.server.catchup.CatchUp.Request.prototype.addEventType = function(value, opt_index) {
  return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
};


/**
 * Clears the list making it empty but non-null.
 * @return {!proto.spine.server.catchup.CatchUp.Request} returns this
 */
proto.spine.server.catchup.CatchUp.Request.prototype.clearEventTypeList = function() {
  return this.setEventTypeList([]);
};


/**
 * optional CatchUpId id = 1;
 * @return {?proto.spine.server.catchup.CatchUpId}
 */
proto.spine.server.catchup.CatchUp.prototype.getId = function() {
  return /** @type{?proto.spine.server.catchup.CatchUpId} */ (
    jspb.Message.getWrapperField(this, proto.spine.server.catchup.CatchUpId, 1));
};


/**
 * @param {?proto.spine.server.catchup.CatchUpId|undefined} value
 * @return {!proto.spine.server.catchup.CatchUp} returns this
*/
proto.spine.server.catchup.CatchUp.prototype.setId = function(value) {
  return jspb.Message.setWrapperField(this, 1, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.catchup.CatchUp} returns this
 */
proto.spine.server.catchup.CatchUp.prototype.clearId = function() {
  return this.setId(undefined);
};


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


/**
 * optional Request request = 2;
 * @return {?proto.spine.server.catchup.CatchUp.Request}
 */
proto.spine.server.catchup.CatchUp.prototype.getRequest = function() {
  return /** @type{?proto.spine.server.catchup.CatchUp.Request} */ (
    jspb.Message.getWrapperField(this, proto.spine.server.catchup.CatchUp.Request, 2));
};


/**
 * @param {?proto.spine.server.catchup.CatchUp.Request|undefined} value
 * @return {!proto.spine.server.catchup.CatchUp} returns this
*/
proto.spine.server.catchup.CatchUp.prototype.setRequest = function(value) {
  return jspb.Message.setWrapperField(this, 2, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.catchup.CatchUp} returns this
 */
proto.spine.server.catchup.CatchUp.prototype.clearRequest = function() {
  return this.setRequest(undefined);
};


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


/**
 * optional google.protobuf.Timestamp when_last_read = 3;
 * @return {?proto.google.protobuf.Timestamp}
 */
proto.spine.server.catchup.CatchUp.prototype.getWhenLastRead = function() {
  return /** @type{?proto.google.protobuf.Timestamp} */ (
    jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
};


/**
 * @param {?proto.google.protobuf.Timestamp|undefined} value
 * @return {!proto.spine.server.catchup.CatchUp} returns this
*/
proto.spine.server.catchup.CatchUp.prototype.setWhenLastRead = function(value) {
  return jspb.Message.setWrapperField(this, 3, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.catchup.CatchUp} returns this
 */
proto.spine.server.catchup.CatchUp.prototype.clearWhenLastRead = function() {
  return this.setWhenLastRead(undefined);
};


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


/**
 * optional CatchUpStatus status = 4;
 * @return {!proto.spine.server.catchup.CatchUpStatus}
 */
proto.spine.server.catchup.CatchUp.prototype.getStatus = function() {
  return /** @type {!proto.spine.server.catchup.CatchUpStatus} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};


/**
 * @param {!proto.spine.server.catchup.CatchUpStatus} value
 * @return {!proto.spine.server.catchup.CatchUp} returns this
 */
proto.spine.server.catchup.CatchUp.prototype.setStatus = function(value) {
  return jspb.Message.setProto3EnumField(this, 4, value);
};


/**
 * optional int32 total_shards = 5;
 * @return {number}
 */
proto.spine.server.catchup.CatchUp.prototype.getTotalShards = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};


/**
 * @param {number} value
 * @return {!proto.spine.server.catchup.CatchUp} returns this
 */
proto.spine.server.catchup.CatchUp.prototype.setTotalShards = function(value) {
  return jspb.Message.setProto3IntField(this, 5, value);
};


/**
 * repeated int32 affected_shard = 6;
 * @return {!Array<number>}
 */
proto.spine.server.catchup.CatchUp.prototype.getAffectedShardList = function() {
  return /** @type {!Array<number>} */ (jspb.Message.getRepeatedField(this, 6));
};


/**
 * @param {!Array<number>} value
 * @return {!proto.spine.server.catchup.CatchUp} returns this
 */
proto.spine.server.catchup.CatchUp.prototype.setAffectedShardList = function(value) {
  return jspb.Message.setField(this, 6, value || []);
};


/**
 * @param {number} value
 * @param {number=} opt_index
 * @return {!proto.spine.server.catchup.CatchUp} returns this
 */
proto.spine.server.catchup.CatchUp.prototype.addAffectedShard = function(value, opt_index) {
  return jspb.Message.addToRepeatedField(this, 6, value, opt_index);
};


/**
 * Clears the list making it empty but non-null.
 * @return {!proto.spine.server.catchup.CatchUp} returns this
 */
proto.spine.server.catchup.CatchUp.prototype.clearAffectedShardList = function() {
  return this.setAffectedShardList([]);
};





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.spine.server.catchup.CatchUpId.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.server.catchup.CatchUpId.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.spine.server.catchup.CatchUpId} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.catchup.CatchUpId.toObject = function(includeInstance, msg) {
  var f, obj = {
    uuid: jspb.Message.getFieldWithDefault(msg, 1, ""),
    projectionType: 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.spine.server.catchup.CatchUpId}
 */
proto.spine.server.catchup.CatchUpId.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.server.catchup.CatchUpId;
  return proto.spine.server.catchup.CatchUpId.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.server.catchup.CatchUpId} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.server.catchup.CatchUpId}
 */
proto.spine.server.catchup.CatchUpId.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.setUuid(value);
      break;
    case 2:
      var value = /** @type {string} */ (reader.readString());
      msg.setProjectionType(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


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


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.spine.server.catchup.CatchUpId} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.catchup.CatchUpId.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getUuid();
  if (f.length > 0) {
    writer.writeString(
      1,
      f
    );
  }
  f = message.getProjectionType();
  if (f.length > 0) {
    writer.writeString(
      2,
      f
    );
  }
};


/**
 * optional string uuid = 1;
 * @return {string}
 */
proto.spine.server.catchup.CatchUpId.prototype.getUuid = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};


/**
 * @param {string} value
 * @return {!proto.spine.server.catchup.CatchUpId} returns this
 */
proto.spine.server.catchup.CatchUpId.prototype.setUuid = function(value) {
  return jspb.Message.setProto3StringField(this, 1, value);
};


/**
 * optional string projection_type = 2;
 * @return {string}
 */
proto.spine.server.catchup.CatchUpId.prototype.getProjectionType = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};


/**
 * @param {string} value
 * @return {!proto.spine.server.catchup.CatchUpId} returns this
 */
proto.spine.server.catchup.CatchUpId.prototype.setProjectionType = function(value) {
  return jspb.Message.setProto3StringField(this, 2, value);
};


/**
 * @enum {number}
 */
proto.spine.server.catchup.CatchUpStatus = {
  CUS_UNDEFINED: 0,
  IN_PROGRESS: 1,
  FINALIZING: 2,
  COMPLETED: 3
};

goog.object.extend(exports, proto.spine.server.catchup);

// Generated by Spine ProtoJs Plugin

let ObjectParser = require('../../../../client/parser/object-parser.js').default;
let TypeParsers = require('../../../../client/parser/type-parsers.js').default;

proto.spine.server.catchup.CatchUp.Request.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.server.catchup.CatchUp.Request.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.catchup.CatchUp.Request.Parser.prototype.constructor = proto.spine.server.catchup.CatchUp.Request.Parser;
proto.spine.server.catchup.CatchUp.Request.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.server.catchup.CatchUp.Request();
  
  if (obj.target !== undefined && obj.target !== null) {
    obj.target.forEach(
      (listItem, index, array) => {
        if (listItem === null) {
          msg.addTarget(null);
        } else {
          let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(listItem);
          msg.addTarget(value);
        }
      }
    );
  }
  
  if (obj.sinceWhen !== undefined) {
    if (obj.sinceWhen === null) {
      msg.setSinceWhen(null);
    } else {
      let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Timestamp').fromObject(obj.sinceWhen);
      msg.setSinceWhen(value);
    }
  }
  
  if (obj.eventType !== undefined && obj.eventType !== null) {
    obj.eventType.forEach(
      (listItem, index, array) => {
        if (listItem !== null) {
          let value = listItem;
          msg.addEventType(value);
        }
      }
    );
  }
  return msg;
};

proto.spine.server.catchup.CatchUp.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.server.catchup.CatchUp.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.catchup.CatchUp.Parser.prototype.constructor = proto.spine.server.catchup.CatchUp.Parser;
proto.spine.server.catchup.CatchUp.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.server.catchup.CatchUp();
  
  if (obj.id !== undefined) {
    if (obj.id === null) {
      msg.setId(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.server.catchup.CatchUpId').fromObject(obj.id);
      msg.setId(value);
    }
  }
  
  if (obj.request !== undefined) {
    if (obj.request === null) {
      msg.setRequest(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.server.catchup.CatchUp.Request').fromObject(obj.request);
      msg.setRequest(value);
    }
  }
  
  if (obj.whenLastRead !== undefined) {
    if (obj.whenLastRead === null) {
      msg.setWhenLastRead(null);
    } else {
      let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Timestamp').fromObject(obj.whenLastRead);
      msg.setWhenLastRead(value);
    }
  }
  
  if (obj.status !== undefined) {
    if (obj.status !== null) {
      let value = proto.spine.server.catchup.CatchUpStatus[obj.status];
      msg.setStatus(value);
    }
  }
  
  if (obj.totalShards !== undefined) {
    if (obj.totalShards !== null) {
      let value = obj.totalShards;
      msg.setTotalShards(value);
    }
  }
  
  if (obj.affectedShard !== undefined && obj.affectedShard !== null) {
    obj.affectedShard.forEach(
      (listItem, index, array) => {
        if (listItem !== null) {
          let value = listItem;
          msg.addAffectedShard(value);
        }
      }
    );
  }
  return msg;
};

proto.spine.server.catchup.CatchUpId.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.server.catchup.CatchUpId.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.catchup.CatchUpId.Parser.prototype.constructor = proto.spine.server.catchup.CatchUpId.Parser;
proto.spine.server.catchup.CatchUpId.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.server.catchup.CatchUpId();
  
  if (obj.uuid !== undefined) {
    if (obj.uuid !== null) {
      let value = obj.uuid;
      msg.setUuid(value);
    }
  }
  
  if (obj.projectionType !== undefined) {
    if (obj.projectionType !== null) {
      let value = obj.projectionType;
      msg.setProjectionType(value);
    }
  }
  return msg;
};

// Generated by Spine ProtoJs Plugin
proto.spine.server.catchup.CatchUp.Request.typeUrl = function() {
  return 'type.spine.io/spine.server.catchup.CatchUp.Request';
};

// Generated by Spine ProtoJs Plugin
proto.spine.server.catchup.CatchUp.typeUrl = function() {
  return 'type.spine.io/spine.server.catchup.CatchUp';
};

// Generated by Spine ProtoJs Plugin
proto.spine.server.catchup.CatchUpId.typeUrl = function() {
  return 'type.spine.io/spine.server.catchup.CatchUpId';
};

// Generated by Spine ProtoJs Plugin
proto.spine.server.catchup.CatchUpStatus.typeUrl = function() {
  return 'type.spine.io/spine.server.catchup.CatchUpStatus';
};