Source: proto/spine/server/delivery/inbox_pb.js

// source: spine/server/delivery/inbox.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 google_protobuf_timestamp_pb = require('../../../google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var spine_client_entities_pb = require('../../../spine/client/entities_pb.js');
goog.object.extend(proto, spine_client_entities_pb);
var spine_core_event_pb = require('../../../spine/core/event_pb.js');
goog.object.extend(proto, spine_core_event_pb);
var spine_core_command_pb = require('../../../spine/core/command_pb.js');
goog.object.extend(proto, spine_core_command_pb);
var spine_server_delivery_delivery_pb = require('../../../spine/server/delivery/delivery_pb.js');
goog.object.extend(proto, spine_server_delivery_delivery_pb);
goog.exportSymbol('proto.spine.server.delivery.InboxId', null, global);
goog.exportSymbol('proto.spine.server.delivery.InboxLabel', null, global);
goog.exportSymbol('proto.spine.server.delivery.InboxMessage', null, global);
goog.exportSymbol('proto.spine.server.delivery.InboxMessage.PayloadCase', null, global);
goog.exportSymbol('proto.spine.server.delivery.InboxMessageId', null, global);
goog.exportSymbol('proto.spine.server.delivery.InboxMessageStatus', null, global);
goog.exportSymbol('proto.spine.server.delivery.InboxSignalId', 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.delivery.InboxId = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.server.delivery.InboxId, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.server.delivery.InboxId.displayName = 'proto.spine.server.delivery.InboxId';
}
/**
 * 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.delivery.InboxMessageId = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.server.delivery.InboxMessageId, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.server.delivery.InboxMessageId.displayName = 'proto.spine.server.delivery.InboxMessageId';
}
/**
 * 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.delivery.InboxSignalId = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.server.delivery.InboxSignalId, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.server.delivery.InboxSignalId.displayName = 'proto.spine.server.delivery.InboxSignalId';
}
/**
 * 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.delivery.InboxMessage = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, proto.spine.server.delivery.InboxMessage.oneofGroups_);
};
goog.inherits(proto.spine.server.delivery.InboxMessage, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.server.delivery.InboxMessage.displayName = 'proto.spine.server.delivery.InboxMessage';
}



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.delivery.InboxId.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.server.delivery.InboxId.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.delivery.InboxId} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.delivery.InboxId.toObject = function(includeInstance, msg) {
  var f, obj = {
    entityId: (f = msg.getEntityId()) && spine_client_entities_pb.EntityId.toObject(includeInstance, f),
    typeUrl: 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.delivery.InboxId}
 */
proto.spine.server.delivery.InboxId.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.server.delivery.InboxId;
  return proto.spine.server.delivery.InboxId.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.server.delivery.InboxId} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.server.delivery.InboxId}
 */
proto.spine.server.delivery.InboxId.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new spine_client_entities_pb.EntityId;
      reader.readMessage(value,spine_client_entities_pb.EntityId.deserializeBinaryFromReader);
      msg.setEntityId(value);
      break;
    case 2:
      var value = /** @type {string} */ (reader.readString());
      msg.setTypeUrl(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.spine.server.delivery.InboxId.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.spine.server.delivery.InboxId.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.delivery.InboxId} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.delivery.InboxId.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getEntityId();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      spine_client_entities_pb.EntityId.serializeBinaryToWriter
    );
  }
  f = message.getTypeUrl();
  if (f.length > 0) {
    writer.writeString(
      2,
      f
    );
  }
};


/**
 * optional spine.client.EntityId entity_id = 1;
 * @return {?proto.spine.client.EntityId}
 */
proto.spine.server.delivery.InboxId.prototype.getEntityId = function() {
  return /** @type{?proto.spine.client.EntityId} */ (
    jspb.Message.getWrapperField(this, spine_client_entities_pb.EntityId, 1));
};


/**
 * @param {?proto.spine.client.EntityId|undefined} value
 * @return {!proto.spine.server.delivery.InboxId} returns this
*/
proto.spine.server.delivery.InboxId.prototype.setEntityId = function(value) {
  return jspb.Message.setWrapperField(this, 1, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.delivery.InboxId} returns this
 */
proto.spine.server.delivery.InboxId.prototype.clearEntityId = function() {
  return this.setEntityId(undefined);
};


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


/**
 * optional string type_url = 2;
 * @return {string}
 */
proto.spine.server.delivery.InboxId.prototype.getTypeUrl = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};


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





if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.spine.server.delivery.InboxMessageId.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.server.delivery.InboxMessageId.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.delivery.InboxMessageId} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.delivery.InboxMessageId.toObject = function(includeInstance, msg) {
  var f, obj = {
    uuid: jspb.Message.getFieldWithDefault(msg, 1, ""),
    index: (f = msg.getIndex()) && spine_server_delivery_delivery_pb.ShardIndex.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.spine.server.delivery.InboxMessageId}
 */
proto.spine.server.delivery.InboxMessageId.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.server.delivery.InboxMessageId;
  return proto.spine.server.delivery.InboxMessageId.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.server.delivery.InboxMessageId} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.server.delivery.InboxMessageId}
 */
proto.spine.server.delivery.InboxMessageId.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 = new spine_server_delivery_delivery_pb.ShardIndex;
      reader.readMessage(value,spine_server_delivery_delivery_pb.ShardIndex.deserializeBinaryFromReader);
      msg.setIndex(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.spine.server.delivery.InboxMessageId.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.spine.server.delivery.InboxMessageId.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.delivery.InboxMessageId} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.delivery.InboxMessageId.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getUuid();
  if (f.length > 0) {
    writer.writeString(
      1,
      f
    );
  }
  f = message.getIndex();
  if (f != null) {
    writer.writeMessage(
      2,
      f,
      spine_server_delivery_delivery_pb.ShardIndex.serializeBinaryToWriter
    );
  }
};


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


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


/**
 * optional ShardIndex index = 2;
 * @return {?proto.spine.server.delivery.ShardIndex}
 */
proto.spine.server.delivery.InboxMessageId.prototype.getIndex = function() {
  return /** @type{?proto.spine.server.delivery.ShardIndex} */ (
    jspb.Message.getWrapperField(this, spine_server_delivery_delivery_pb.ShardIndex, 2));
};


/**
 * @param {?proto.spine.server.delivery.ShardIndex|undefined} value
 * @return {!proto.spine.server.delivery.InboxMessageId} returns this
*/
proto.spine.server.delivery.InboxMessageId.prototype.setIndex = function(value) {
  return jspb.Message.setWrapperField(this, 2, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.delivery.InboxMessageId} returns this
 */
proto.spine.server.delivery.InboxMessageId.prototype.clearIndex = function() {
  return this.setIndex(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.server.delivery.InboxMessageId.prototype.hasIndex = function() {
  return jspb.Message.getField(this, 2) != 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.spine.server.delivery.InboxSignalId.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.server.delivery.InboxSignalId.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.delivery.InboxSignalId} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.delivery.InboxSignalId.toObject = function(includeInstance, msg) {
  var f, obj = {
    value: jspb.Message.getFieldWithDefault(msg, 1, "")
  };

  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.delivery.InboxSignalId}
 */
proto.spine.server.delivery.InboxSignalId.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.server.delivery.InboxSignalId;
  return proto.spine.server.delivery.InboxSignalId.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.server.delivery.InboxSignalId} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.server.delivery.InboxSignalId}
 */
proto.spine.server.delivery.InboxSignalId.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.setValue(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.spine.server.delivery.InboxSignalId.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.spine.server.delivery.InboxSignalId.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.delivery.InboxSignalId} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.delivery.InboxSignalId.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getValue();
  if (f.length > 0) {
    writer.writeString(
      1,
      f
    );
  }
};


/**
 * optional string value = 1;
 * @return {string}
 */
proto.spine.server.delivery.InboxSignalId.prototype.getValue = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};


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



/**
 * 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.spine.server.delivery.InboxMessage.oneofGroups_ = [[5,6]];

/**
 * @enum {number}
 */
proto.spine.server.delivery.InboxMessage.PayloadCase = {
  PAYLOAD_NOT_SET: 0,
  EVENT: 5,
  COMMAND: 6
};

/**
 * @return {proto.spine.server.delivery.InboxMessage.PayloadCase}
 */
proto.spine.server.delivery.InboxMessage.prototype.getPayloadCase = function() {
  return /** @type {proto.spine.server.delivery.InboxMessage.PayloadCase} */(jspb.Message.computeOneofCase(this, proto.spine.server.delivery.InboxMessage.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.spine.server.delivery.InboxMessage.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.server.delivery.InboxMessage.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.delivery.InboxMessage} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.delivery.InboxMessage.toObject = function(includeInstance, msg) {
  var f, obj = {
    id: (f = msg.getId()) && proto.spine.server.delivery.InboxMessageId.toObject(includeInstance, f),
    signalId: (f = msg.getSignalId()) && proto.spine.server.delivery.InboxSignalId.toObject(includeInstance, f),
    inboxId: (f = msg.getInboxId()) && proto.spine.server.delivery.InboxId.toObject(includeInstance, f),
    event: (f = msg.getEvent()) && spine_core_event_pb.Event.toObject(includeInstance, f),
    command: (f = msg.getCommand()) && spine_core_command_pb.Command.toObject(includeInstance, f),
    label: jspb.Message.getFieldWithDefault(msg, 7, 0),
    status: jspb.Message.getFieldWithDefault(msg, 8, 0),
    whenReceived: (f = msg.getWhenReceived()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
    version: jspb.Message.getFieldWithDefault(msg, 10, 0),
    keepUntil: (f = msg.getKeepUntil()) && google_protobuf_timestamp_pb.Timestamp.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.spine.server.delivery.InboxMessage}
 */
proto.spine.server.delivery.InboxMessage.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.server.delivery.InboxMessage;
  return proto.spine.server.delivery.InboxMessage.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.server.delivery.InboxMessage} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.server.delivery.InboxMessage}
 */
proto.spine.server.delivery.InboxMessage.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.delivery.InboxMessageId;
      reader.readMessage(value,proto.spine.server.delivery.InboxMessageId.deserializeBinaryFromReader);
      msg.setId(value);
      break;
    case 2:
      var value = new proto.spine.server.delivery.InboxSignalId;
      reader.readMessage(value,proto.spine.server.delivery.InboxSignalId.deserializeBinaryFromReader);
      msg.setSignalId(value);
      break;
    case 3:
      var value = new proto.spine.server.delivery.InboxId;
      reader.readMessage(value,proto.spine.server.delivery.InboxId.deserializeBinaryFromReader);
      msg.setInboxId(value);
      break;
    case 5:
      var value = new spine_core_event_pb.Event;
      reader.readMessage(value,spine_core_event_pb.Event.deserializeBinaryFromReader);
      msg.setEvent(value);
      break;
    case 6:
      var value = new spine_core_command_pb.Command;
      reader.readMessage(value,spine_core_command_pb.Command.deserializeBinaryFromReader);
      msg.setCommand(value);
      break;
    case 7:
      var value = /** @type {!proto.spine.server.delivery.InboxLabel} */ (reader.readEnum());
      msg.setLabel(value);
      break;
    case 8:
      var value = /** @type {!proto.spine.server.delivery.InboxMessageStatus} */ (reader.readEnum());
      msg.setStatus(value);
      break;
    case 9:
      var value = new google_protobuf_timestamp_pb.Timestamp;
      reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
      msg.setWhenReceived(value);
      break;
    case 10:
      var value = /** @type {number} */ (reader.readInt32());
      msg.setVersion(value);
      break;
    case 11:
      var value = new google_protobuf_timestamp_pb.Timestamp;
      reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
      msg.setKeepUntil(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.spine.server.delivery.InboxMessage.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.spine.server.delivery.InboxMessage.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.delivery.InboxMessage} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.delivery.InboxMessage.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getId();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      proto.spine.server.delivery.InboxMessageId.serializeBinaryToWriter
    );
  }
  f = message.getSignalId();
  if (f != null) {
    writer.writeMessage(
      2,
      f,
      proto.spine.server.delivery.InboxSignalId.serializeBinaryToWriter
    );
  }
  f = message.getInboxId();
  if (f != null) {
    writer.writeMessage(
      3,
      f,
      proto.spine.server.delivery.InboxId.serializeBinaryToWriter
    );
  }
  f = message.getEvent();
  if (f != null) {
    writer.writeMessage(
      5,
      f,
      spine_core_event_pb.Event.serializeBinaryToWriter
    );
  }
  f = message.getCommand();
  if (f != null) {
    writer.writeMessage(
      6,
      f,
      spine_core_command_pb.Command.serializeBinaryToWriter
    );
  }
  f = message.getLabel();
  if (f !== 0.0) {
    writer.writeEnum(
      7,
      f
    );
  }
  f = message.getStatus();
  if (f !== 0.0) {
    writer.writeEnum(
      8,
      f
    );
  }
  f = message.getWhenReceived();
  if (f != null) {
    writer.writeMessage(
      9,
      f,
      google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
    );
  }
  f = message.getVersion();
  if (f !== 0) {
    writer.writeInt32(
      10,
      f
    );
  }
  f = message.getKeepUntil();
  if (f != null) {
    writer.writeMessage(
      11,
      f,
      google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
    );
  }
};


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


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


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


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


/**
 * optional InboxSignalId signal_id = 2;
 * @return {?proto.spine.server.delivery.InboxSignalId}
 */
proto.spine.server.delivery.InboxMessage.prototype.getSignalId = function() {
  return /** @type{?proto.spine.server.delivery.InboxSignalId} */ (
    jspb.Message.getWrapperField(this, proto.spine.server.delivery.InboxSignalId, 2));
};


/**
 * @param {?proto.spine.server.delivery.InboxSignalId|undefined} value
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
*/
proto.spine.server.delivery.InboxMessage.prototype.setSignalId = function(value) {
  return jspb.Message.setWrapperField(this, 2, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
 */
proto.spine.server.delivery.InboxMessage.prototype.clearSignalId = function() {
  return this.setSignalId(undefined);
};


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


/**
 * optional InboxId inbox_id = 3;
 * @return {?proto.spine.server.delivery.InboxId}
 */
proto.spine.server.delivery.InboxMessage.prototype.getInboxId = function() {
  return /** @type{?proto.spine.server.delivery.InboxId} */ (
    jspb.Message.getWrapperField(this, proto.spine.server.delivery.InboxId, 3));
};


/**
 * @param {?proto.spine.server.delivery.InboxId|undefined} value
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
*/
proto.spine.server.delivery.InboxMessage.prototype.setInboxId = function(value) {
  return jspb.Message.setWrapperField(this, 3, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
 */
proto.spine.server.delivery.InboxMessage.prototype.clearInboxId = function() {
  return this.setInboxId(undefined);
};


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


/**
 * optional spine.core.Event event = 5;
 * @return {?proto.spine.core.Event}
 */
proto.spine.server.delivery.InboxMessage.prototype.getEvent = function() {
  return /** @type{?proto.spine.core.Event} */ (
    jspb.Message.getWrapperField(this, spine_core_event_pb.Event, 5));
};


/**
 * @param {?proto.spine.core.Event|undefined} value
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
*/
proto.spine.server.delivery.InboxMessage.prototype.setEvent = function(value) {
  return jspb.Message.setOneofWrapperField(this, 5, proto.spine.server.delivery.InboxMessage.oneofGroups_[0], value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
 */
proto.spine.server.delivery.InboxMessage.prototype.clearEvent = function() {
  return this.setEvent(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.server.delivery.InboxMessage.prototype.hasEvent = function() {
  return jspb.Message.getField(this, 5) != null;
};


/**
 * optional spine.core.Command command = 6;
 * @return {?proto.spine.core.Command}
 */
proto.spine.server.delivery.InboxMessage.prototype.getCommand = function() {
  return /** @type{?proto.spine.core.Command} */ (
    jspb.Message.getWrapperField(this, spine_core_command_pb.Command, 6));
};


/**
 * @param {?proto.spine.core.Command|undefined} value
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
*/
proto.spine.server.delivery.InboxMessage.prototype.setCommand = function(value) {
  return jspb.Message.setOneofWrapperField(this, 6, proto.spine.server.delivery.InboxMessage.oneofGroups_[0], value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
 */
proto.spine.server.delivery.InboxMessage.prototype.clearCommand = function() {
  return this.setCommand(undefined);
};


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


/**
 * optional InboxLabel label = 7;
 * @return {!proto.spine.server.delivery.InboxLabel}
 */
proto.spine.server.delivery.InboxMessage.prototype.getLabel = function() {
  return /** @type {!proto.spine.server.delivery.InboxLabel} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
};


/**
 * @param {!proto.spine.server.delivery.InboxLabel} value
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
 */
proto.spine.server.delivery.InboxMessage.prototype.setLabel = function(value) {
  return jspb.Message.setProto3EnumField(this, 7, value);
};


/**
 * optional InboxMessageStatus status = 8;
 * @return {!proto.spine.server.delivery.InboxMessageStatus}
 */
proto.spine.server.delivery.InboxMessage.prototype.getStatus = function() {
  return /** @type {!proto.spine.server.delivery.InboxMessageStatus} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
};


/**
 * @param {!proto.spine.server.delivery.InboxMessageStatus} value
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
 */
proto.spine.server.delivery.InboxMessage.prototype.setStatus = function(value) {
  return jspb.Message.setProto3EnumField(this, 8, value);
};


/**
 * optional google.protobuf.Timestamp when_received = 9;
 * @return {?proto.google.protobuf.Timestamp}
 */
proto.spine.server.delivery.InboxMessage.prototype.getWhenReceived = function() {
  return /** @type{?proto.google.protobuf.Timestamp} */ (
    jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 9));
};


/**
 * @param {?proto.google.protobuf.Timestamp|undefined} value
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
*/
proto.spine.server.delivery.InboxMessage.prototype.setWhenReceived = function(value) {
  return jspb.Message.setWrapperField(this, 9, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
 */
proto.spine.server.delivery.InboxMessage.prototype.clearWhenReceived = function() {
  return this.setWhenReceived(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.server.delivery.InboxMessage.prototype.hasWhenReceived = function() {
  return jspb.Message.getField(this, 9) != null;
};


/**
 * optional int32 version = 10;
 * @return {number}
 */
proto.spine.server.delivery.InboxMessage.prototype.getVersion = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
};


/**
 * @param {number} value
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
 */
proto.spine.server.delivery.InboxMessage.prototype.setVersion = function(value) {
  return jspb.Message.setProto3IntField(this, 10, value);
};


/**
 * optional google.protobuf.Timestamp keep_until = 11;
 * @return {?proto.google.protobuf.Timestamp}
 */
proto.spine.server.delivery.InboxMessage.prototype.getKeepUntil = function() {
  return /** @type{?proto.google.protobuf.Timestamp} */ (
    jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 11));
};


/**
 * @param {?proto.google.protobuf.Timestamp|undefined} value
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
*/
proto.spine.server.delivery.InboxMessage.prototype.setKeepUntil = function(value) {
  return jspb.Message.setWrapperField(this, 11, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.delivery.InboxMessage} returns this
 */
proto.spine.server.delivery.InboxMessage.prototype.clearKeepUntil = function() {
  return this.setKeepUntil(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.server.delivery.InboxMessage.prototype.hasKeepUntil = function() {
  return jspb.Message.getField(this, 11) != null;
};


/**
 * @enum {number}
 */
proto.spine.server.delivery.InboxLabel = {
  IL_UNKNOWN: 0,
  HANDLE_COMMAND: 1,
  UPDATE_SUBSCRIBER: 3,
  REACT_UPON_EVENT: 4,
  IMPORT_EVENT: 5,
  CATCH_UP: 6
};

/**
 * @enum {number}
 */
proto.spine.server.delivery.InboxMessageStatus = {
  IMS_UNKNOWN: 0,
  TO_DELIVER: 1,
  SCHEDULED: 2,
  DELIVERED: 3,
  TO_CATCH_UP: 4
};

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

// 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.delivery.InboxId.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.server.delivery.InboxId.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.delivery.InboxId.Parser.prototype.constructor = proto.spine.server.delivery.InboxId.Parser;
proto.spine.server.delivery.InboxId.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.server.delivery.InboxId();
  
  if (obj.entityId !== undefined) {
    if (obj.entityId === null) {
      msg.setEntityId(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.client.EntityId').fromObject(obj.entityId);
      msg.setEntityId(value);
    }
  }
  
  if (obj.typeUrl !== undefined) {
    if (obj.typeUrl !== null) {
      let value = obj.typeUrl;
      msg.setTypeUrl(value);
    }
  }
  return msg;
};

proto.spine.server.delivery.InboxMessage.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.server.delivery.InboxMessage.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.delivery.InboxMessage.Parser.prototype.constructor = proto.spine.server.delivery.InboxMessage.Parser;
proto.spine.server.delivery.InboxMessage.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.server.delivery.InboxMessage();
  
  if (obj.id !== undefined) {
    if (obj.id === null) {
      msg.setId(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.server.delivery.InboxMessageId').fromObject(obj.id);
      msg.setId(value);
    }
  }
  
  if (obj.signalId !== undefined) {
    if (obj.signalId === null) {
      msg.setSignalId(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.server.delivery.InboxSignalId').fromObject(obj.signalId);
      msg.setSignalId(value);
    }
  }
  
  if (obj.inboxId !== undefined) {
    if (obj.inboxId === null) {
      msg.setInboxId(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.server.delivery.InboxId').fromObject(obj.inboxId);
      msg.setInboxId(value);
    }
  }
  
  if (obj.event !== undefined) {
    if (obj.event === null) {
      msg.setEvent(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.Event').fromObject(obj.event);
      msg.setEvent(value);
    }
  }
  
  if (obj.command !== undefined) {
    if (obj.command === null) {
      msg.setCommand(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.Command').fromObject(obj.command);
      msg.setCommand(value);
    }
  }
  
  if (obj.label !== undefined) {
    if (obj.label !== null) {
      let value = proto.spine.server.delivery.InboxLabel[obj.label];
      msg.setLabel(value);
    }
  }
  
  if (obj.status !== undefined) {
    if (obj.status !== null) {
      let value = proto.spine.server.delivery.InboxMessageStatus[obj.status];
      msg.setStatus(value);
    }
  }
  
  if (obj.whenReceived !== undefined) {
    if (obj.whenReceived === null) {
      msg.setWhenReceived(null);
    } else {
      let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Timestamp').fromObject(obj.whenReceived);
      msg.setWhenReceived(value);
    }
  }
  
  if (obj.version !== undefined) {
    if (obj.version !== null) {
      let value = obj.version;
      msg.setVersion(value);
    }
  }
  
  if (obj.keepUntil !== undefined) {
    if (obj.keepUntil === null) {
      msg.setKeepUntil(null);
    } else {
      let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Timestamp').fromObject(obj.keepUntil);
      msg.setKeepUntil(value);
    }
  }
  return msg;
};

proto.spine.server.delivery.InboxMessageId.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.server.delivery.InboxMessageId.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.delivery.InboxMessageId.Parser.prototype.constructor = proto.spine.server.delivery.InboxMessageId.Parser;
proto.spine.server.delivery.InboxMessageId.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.server.delivery.InboxMessageId();
  
  if (obj.uuid !== undefined) {
    if (obj.uuid !== null) {
      let value = obj.uuid;
      msg.setUuid(value);
    }
  }
  
  if (obj.index !== undefined) {
    if (obj.index === null) {
      msg.setIndex(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.server.delivery.ShardIndex').fromObject(obj.index);
      msg.setIndex(value);
    }
  }
  return msg;
};

proto.spine.server.delivery.InboxSignalId.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.server.delivery.InboxSignalId.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.delivery.InboxSignalId.Parser.prototype.constructor = proto.spine.server.delivery.InboxSignalId.Parser;
proto.spine.server.delivery.InboxSignalId.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.server.delivery.InboxSignalId();
  
  if (obj.value !== undefined) {
    if (obj.value !== null) {
      let value = obj.value;
      msg.setValue(value);
    }
  }
  return msg;
};

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

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

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

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

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

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