Source: proto/spine/core/event_pb.js

// source: spine/core/event.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_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_actor_context_pb = require('../../spine/core/actor_context_pb.js');
goog.object.extend(proto, spine_core_actor_context_pb);
var spine_core_command_pb = require('../../spine/core/command_pb.js');
goog.object.extend(proto, spine_core_command_pb);
var spine_core_diagnostics_pb = require('../../spine/core/diagnostics_pb.js');
goog.object.extend(proto, spine_core_diagnostics_pb);
var spine_core_enrichment_pb = require('../../spine/core/enrichment_pb.js');
goog.object.extend(proto, spine_core_enrichment_pb);
var spine_core_version_pb = require('../../spine/core/version_pb.js');
goog.object.extend(proto, spine_core_version_pb);
goog.exportSymbol('proto.spine.core.Event', null, global);
goog.exportSymbol('proto.spine.core.EventContext', null, global);
goog.exportSymbol('proto.spine.core.EventContext.OriginCase', null, global);
goog.exportSymbol('proto.spine.core.EventContext.OriginIdCase', null, global);
goog.exportSymbol('proto.spine.core.EventId', null, global);
goog.exportSymbol('proto.spine.core.EventValidationError', null, global);
goog.exportSymbol('proto.spine.core.RejectionEventContext', 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.core.EventId = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.core.EventId, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.core.EventId.displayName = 'proto.spine.core.EventId';
}
/**
 * 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.core.Event = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.core.Event, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.core.Event.displayName = 'proto.spine.core.Event';
}
/**
 * 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.core.EventContext = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, proto.spine.core.EventContext.oneofGroups_);
};
goog.inherits(proto.spine.core.EventContext, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.core.EventContext.displayName = 'proto.spine.core.EventContext';
}
/**
 * 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.core.RejectionEventContext = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.core.RejectionEventContext, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.core.RejectionEventContext.displayName = 'proto.spine.core.RejectionEventContext';
}



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.core.EventId.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.core.EventId.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.core.EventId} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.core.EventId.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.core.EventId}
 */
proto.spine.core.EventId.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.core.EventId;
  return proto.spine.core.EventId.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.core.EventId} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.core.EventId}
 */
proto.spine.core.EventId.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.core.EventId.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.spine.core.EventId.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.core.EventId} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.core.EventId.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.core.EventId.prototype.getValue = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};


/**
 * @param {string} value
 * @return {!proto.spine.core.EventId} returns this
 */
proto.spine.core.EventId.prototype.setValue = function(value) {
  return jspb.Message.setProto3StringField(this, 1, 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.core.Event.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.core.Event.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.core.Event} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.core.Event.toObject = function(includeInstance, msg) {
  var f, obj = {
    id: (f = msg.getId()) && proto.spine.core.EventId.toObject(includeInstance, f),
    message: (f = msg.getMessage()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
    context: (f = msg.getContext()) && proto.spine.core.EventContext.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.core.Event}
 */
proto.spine.core.Event.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.core.Event;
  return proto.spine.core.Event.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.core.Event} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.core.Event}
 */
proto.spine.core.Event.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new proto.spine.core.EventId;
      reader.readMessage(value,proto.spine.core.EventId.deserializeBinaryFromReader);
      msg.setId(value);
      break;
    case 2:
      var value = new google_protobuf_any_pb.Any;
      reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
      msg.setMessage(value);
      break;
    case 3:
      var value = new proto.spine.core.EventContext;
      reader.readMessage(value,proto.spine.core.EventContext.deserializeBinaryFromReader);
      msg.setContext(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.spine.core.Event.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.spine.core.Event.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.core.Event} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.core.Event.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getId();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      proto.spine.core.EventId.serializeBinaryToWriter
    );
  }
  f = message.getMessage();
  if (f != null) {
    writer.writeMessage(
      2,
      f,
      google_protobuf_any_pb.Any.serializeBinaryToWriter
    );
  }
  f = message.getContext();
  if (f != null) {
    writer.writeMessage(
      3,
      f,
      proto.spine.core.EventContext.serializeBinaryToWriter
    );
  }
};


/**
 * optional EventId id = 1;
 * @return {?proto.spine.core.EventId}
 */
proto.spine.core.Event.prototype.getId = function() {
  return /** @type{?proto.spine.core.EventId} */ (
    jspb.Message.getWrapperField(this, proto.spine.core.EventId, 1));
};


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


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


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


/**
 * optional google.protobuf.Any message = 2;
 * @return {?proto.google.protobuf.Any}
 */
proto.spine.core.Event.prototype.getMessage = function() {
  return /** @type{?proto.google.protobuf.Any} */ (
    jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2));
};


/**
 * @param {?proto.google.protobuf.Any|undefined} value
 * @return {!proto.spine.core.Event} returns this
*/
proto.spine.core.Event.prototype.setMessage = function(value) {
  return jspb.Message.setWrapperField(this, 2, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.Event} returns this
 */
proto.spine.core.Event.prototype.clearMessage = function() {
  return this.setMessage(undefined);
};


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


/**
 * optional EventContext context = 3;
 * @return {?proto.spine.core.EventContext}
 */
proto.spine.core.Event.prototype.getContext = function() {
  return /** @type{?proto.spine.core.EventContext} */ (
    jspb.Message.getWrapperField(this, proto.spine.core.EventContext, 3));
};


/**
 * @param {?proto.spine.core.EventContext|undefined} value
 * @return {!proto.spine.core.Event} returns this
*/
proto.spine.core.Event.prototype.setContext = function(value) {
  return jspb.Message.setWrapperField(this, 3, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.Event} returns this
 */
proto.spine.core.Event.prototype.clearContext = function() {
  return this.setContext(undefined);
};


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



/**
 * 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.core.EventContext.oneofGroups_ = [[2,6,14,11],[12,13]];

/**
 * @enum {number}
 */
proto.spine.core.EventContext.OriginCase = {
  ORIGIN_NOT_SET: 0,
  COMMAND_CONTEXT: 2,
  EVENT_CONTEXT: 6,
  PAST_MESSAGE: 14,
  IMPORT_CONTEXT: 11
};

/**
 * @return {proto.spine.core.EventContext.OriginCase}
 */
proto.spine.core.EventContext.prototype.getOriginCase = function() {
  return /** @type {proto.spine.core.EventContext.OriginCase} */(jspb.Message.computeOneofCase(this, proto.spine.core.EventContext.oneofGroups_[0]));
};

/**
 * @enum {number}
 */
proto.spine.core.EventContext.OriginIdCase = {
  ORIGIN_ID_NOT_SET: 0,
  COMMAND_ID: 12,
  EVENT_ID: 13
};

/**
 * @return {proto.spine.core.EventContext.OriginIdCase}
 */
proto.spine.core.EventContext.prototype.getOriginIdCase = function() {
  return /** @type {proto.spine.core.EventContext.OriginIdCase} */(jspb.Message.computeOneofCase(this, proto.spine.core.EventContext.oneofGroups_[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.spine.core.EventContext.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.core.EventContext.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.core.EventContext} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.core.EventContext.toObject = function(includeInstance, msg) {
  var f, obj = {
    timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
    commandContext: (f = msg.getCommandContext()) && spine_core_command_pb.CommandContext.toObject(includeInstance, f),
    eventContext: (f = msg.getEventContext()) && proto.spine.core.EventContext.toObject(includeInstance, f),
    pastMessage: (f = msg.getPastMessage()) && spine_core_diagnostics_pb.Origin.toObject(includeInstance, f),
    importContext: (f = msg.getImportContext()) && spine_core_actor_context_pb.ActorContext.toObject(includeInstance, f),
    commandId: (f = msg.getCommandId()) && spine_core_command_pb.CommandId.toObject(includeInstance, f),
    eventId: (f = msg.getEventId()) && proto.spine.core.EventId.toObject(includeInstance, f),
    rootCommandId: (f = msg.getRootCommandId()) && spine_core_command_pb.CommandId.toObject(includeInstance, f),
    producerId: (f = msg.getProducerId()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
    version: (f = msg.getVersion()) && spine_core_version_pb.Version.toObject(includeInstance, f),
    enrichment: (f = msg.getEnrichment()) && spine_core_enrichment_pb.Enrichment.toObject(includeInstance, f),
    external: jspb.Message.getBooleanFieldWithDefault(msg, 8, false),
    rejection: (f = msg.getRejection()) && proto.spine.core.RejectionEventContext.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.core.EventContext}
 */
proto.spine.core.EventContext.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.core.EventContext;
  return proto.spine.core.EventContext.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.core.EventContext} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.core.EventContext}
 */
proto.spine.core.EventContext.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new google_protobuf_timestamp_pb.Timestamp;
      reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
      msg.setTimestamp(value);
      break;
    case 2:
      var value = new spine_core_command_pb.CommandContext;
      reader.readMessage(value,spine_core_command_pb.CommandContext.deserializeBinaryFromReader);
      msg.setCommandContext(value);
      break;
    case 6:
      var value = new proto.spine.core.EventContext;
      reader.readMessage(value,proto.spine.core.EventContext.deserializeBinaryFromReader);
      msg.setEventContext(value);
      break;
    case 14:
      var value = new spine_core_diagnostics_pb.Origin;
      reader.readMessage(value,spine_core_diagnostics_pb.Origin.deserializeBinaryFromReader);
      msg.setPastMessage(value);
      break;
    case 11:
      var value = new spine_core_actor_context_pb.ActorContext;
      reader.readMessage(value,spine_core_actor_context_pb.ActorContext.deserializeBinaryFromReader);
      msg.setImportContext(value);
      break;
    case 12:
      var value = new spine_core_command_pb.CommandId;
      reader.readMessage(value,spine_core_command_pb.CommandId.deserializeBinaryFromReader);
      msg.setCommandId(value);
      break;
    case 13:
      var value = new proto.spine.core.EventId;
      reader.readMessage(value,proto.spine.core.EventId.deserializeBinaryFromReader);
      msg.setEventId(value);
      break;
    case 9:
      var value = new spine_core_command_pb.CommandId;
      reader.readMessage(value,spine_core_command_pb.CommandId.deserializeBinaryFromReader);
      msg.setRootCommandId(value);
      break;
    case 3:
      var value = new google_protobuf_any_pb.Any;
      reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
      msg.setProducerId(value);
      break;
    case 4:
      var value = new spine_core_version_pb.Version;
      reader.readMessage(value,spine_core_version_pb.Version.deserializeBinaryFromReader);
      msg.setVersion(value);
      break;
    case 5:
      var value = new spine_core_enrichment_pb.Enrichment;
      reader.readMessage(value,spine_core_enrichment_pb.Enrichment.deserializeBinaryFromReader);
      msg.setEnrichment(value);
      break;
    case 8:
      var value = /** @type {boolean} */ (reader.readBool());
      msg.setExternal(value);
      break;
    case 10:
      var value = new proto.spine.core.RejectionEventContext;
      reader.readMessage(value,proto.spine.core.RejectionEventContext.deserializeBinaryFromReader);
      msg.setRejection(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.spine.core.EventContext.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.spine.core.EventContext.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.core.EventContext} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.core.EventContext.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getTimestamp();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
    );
  }
  f = message.getCommandContext();
  if (f != null) {
    writer.writeMessage(
      2,
      f,
      spine_core_command_pb.CommandContext.serializeBinaryToWriter
    );
  }
  f = message.getEventContext();
  if (f != null) {
    writer.writeMessage(
      6,
      f,
      proto.spine.core.EventContext.serializeBinaryToWriter
    );
  }
  f = message.getPastMessage();
  if (f != null) {
    writer.writeMessage(
      14,
      f,
      spine_core_diagnostics_pb.Origin.serializeBinaryToWriter
    );
  }
  f = message.getImportContext();
  if (f != null) {
    writer.writeMessage(
      11,
      f,
      spine_core_actor_context_pb.ActorContext.serializeBinaryToWriter
    );
  }
  f = message.getCommandId();
  if (f != null) {
    writer.writeMessage(
      12,
      f,
      spine_core_command_pb.CommandId.serializeBinaryToWriter
    );
  }
  f = message.getEventId();
  if (f != null) {
    writer.writeMessage(
      13,
      f,
      proto.spine.core.EventId.serializeBinaryToWriter
    );
  }
  f = message.getRootCommandId();
  if (f != null) {
    writer.writeMessage(
      9,
      f,
      spine_core_command_pb.CommandId.serializeBinaryToWriter
    );
  }
  f = message.getProducerId();
  if (f != null) {
    writer.writeMessage(
      3,
      f,
      google_protobuf_any_pb.Any.serializeBinaryToWriter
    );
  }
  f = message.getVersion();
  if (f != null) {
    writer.writeMessage(
      4,
      f,
      spine_core_version_pb.Version.serializeBinaryToWriter
    );
  }
  f = message.getEnrichment();
  if (f != null) {
    writer.writeMessage(
      5,
      f,
      spine_core_enrichment_pb.Enrichment.serializeBinaryToWriter
    );
  }
  f = message.getExternal();
  if (f) {
    writer.writeBool(
      8,
      f
    );
  }
  f = message.getRejection();
  if (f != null) {
    writer.writeMessage(
      10,
      f,
      proto.spine.core.RejectionEventContext.serializeBinaryToWriter
    );
  }
};


/**
 * optional google.protobuf.Timestamp timestamp = 1;
 * @return {?proto.google.protobuf.Timestamp}
 */
proto.spine.core.EventContext.prototype.getTimestamp = function() {
  return /** @type{?proto.google.protobuf.Timestamp} */ (
    jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1));
};


/**
 * @param {?proto.google.protobuf.Timestamp|undefined} value
 * @return {!proto.spine.core.EventContext} returns this
*/
proto.spine.core.EventContext.prototype.setTimestamp = function(value) {
  return jspb.Message.setWrapperField(this, 1, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearTimestamp = function() {
  return this.setTimestamp(undefined);
};


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


/**
 * optional CommandContext command_context = 2;
 * @return {?proto.spine.core.CommandContext}
 */
proto.spine.core.EventContext.prototype.getCommandContext = function() {
  return /** @type{?proto.spine.core.CommandContext} */ (
    jspb.Message.getWrapperField(this, spine_core_command_pb.CommandContext, 2));
};


/**
 * @param {?proto.spine.core.CommandContext|undefined} value
 * @return {!proto.spine.core.EventContext} returns this
*/
proto.spine.core.EventContext.prototype.setCommandContext = function(value) {
  return jspb.Message.setOneofWrapperField(this, 2, proto.spine.core.EventContext.oneofGroups_[0], value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearCommandContext = function() {
  return this.setCommandContext(undefined);
};


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


/**
 * optional EventContext event_context = 6;
 * @return {?proto.spine.core.EventContext}
 */
proto.spine.core.EventContext.prototype.getEventContext = function() {
  return /** @type{?proto.spine.core.EventContext} */ (
    jspb.Message.getWrapperField(this, proto.spine.core.EventContext, 6));
};


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


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearEventContext = function() {
  return this.setEventContext(undefined);
};


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


/**
 * optional Origin past_message = 14;
 * @return {?proto.spine.core.Origin}
 */
proto.spine.core.EventContext.prototype.getPastMessage = function() {
  return /** @type{?proto.spine.core.Origin} */ (
    jspb.Message.getWrapperField(this, spine_core_diagnostics_pb.Origin, 14));
};


/**
 * @param {?proto.spine.core.Origin|undefined} value
 * @return {!proto.spine.core.EventContext} returns this
*/
proto.spine.core.EventContext.prototype.setPastMessage = function(value) {
  return jspb.Message.setOneofWrapperField(this, 14, proto.spine.core.EventContext.oneofGroups_[0], value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearPastMessage = function() {
  return this.setPastMessage(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.core.EventContext.prototype.hasPastMessage = function() {
  return jspb.Message.getField(this, 14) != null;
};


/**
 * optional ActorContext import_context = 11;
 * @return {?proto.spine.core.ActorContext}
 */
proto.spine.core.EventContext.prototype.getImportContext = function() {
  return /** @type{?proto.spine.core.ActorContext} */ (
    jspb.Message.getWrapperField(this, spine_core_actor_context_pb.ActorContext, 11));
};


/**
 * @param {?proto.spine.core.ActorContext|undefined} value
 * @return {!proto.spine.core.EventContext} returns this
*/
proto.spine.core.EventContext.prototype.setImportContext = function(value) {
  return jspb.Message.setOneofWrapperField(this, 11, proto.spine.core.EventContext.oneofGroups_[0], value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearImportContext = function() {
  return this.setImportContext(undefined);
};


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


/**
 * optional CommandId command_id = 12;
 * @return {?proto.spine.core.CommandId}
 */
proto.spine.core.EventContext.prototype.getCommandId = function() {
  return /** @type{?proto.spine.core.CommandId} */ (
    jspb.Message.getWrapperField(this, spine_core_command_pb.CommandId, 12));
};


/**
 * @param {?proto.spine.core.CommandId|undefined} value
 * @return {!proto.spine.core.EventContext} returns this
*/
proto.spine.core.EventContext.prototype.setCommandId = function(value) {
  return jspb.Message.setOneofWrapperField(this, 12, proto.spine.core.EventContext.oneofGroups_[1], value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearCommandId = function() {
  return this.setCommandId(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.core.EventContext.prototype.hasCommandId = function() {
  return jspb.Message.getField(this, 12) != null;
};


/**
 * optional EventId event_id = 13;
 * @return {?proto.spine.core.EventId}
 */
proto.spine.core.EventContext.prototype.getEventId = function() {
  return /** @type{?proto.spine.core.EventId} */ (
    jspb.Message.getWrapperField(this, proto.spine.core.EventId, 13));
};


/**
 * @param {?proto.spine.core.EventId|undefined} value
 * @return {!proto.spine.core.EventContext} returns this
*/
proto.spine.core.EventContext.prototype.setEventId = function(value) {
  return jspb.Message.setOneofWrapperField(this, 13, proto.spine.core.EventContext.oneofGroups_[1], value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearEventId = function() {
  return this.setEventId(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.core.EventContext.prototype.hasEventId = function() {
  return jspb.Message.getField(this, 13) != null;
};


/**
 * optional CommandId root_command_id = 9;
 * @return {?proto.spine.core.CommandId}
 */
proto.spine.core.EventContext.prototype.getRootCommandId = function() {
  return /** @type{?proto.spine.core.CommandId} */ (
    jspb.Message.getWrapperField(this, spine_core_command_pb.CommandId, 9));
};


/**
 * @param {?proto.spine.core.CommandId|undefined} value
 * @return {!proto.spine.core.EventContext} returns this
*/
proto.spine.core.EventContext.prototype.setRootCommandId = function(value) {
  return jspb.Message.setWrapperField(this, 9, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearRootCommandId = function() {
  return this.setRootCommandId(undefined);
};


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


/**
 * optional google.protobuf.Any producer_id = 3;
 * @return {?proto.google.protobuf.Any}
 */
proto.spine.core.EventContext.prototype.getProducerId = function() {
  return /** @type{?proto.google.protobuf.Any} */ (
    jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 3));
};


/**
 * @param {?proto.google.protobuf.Any|undefined} value
 * @return {!proto.spine.core.EventContext} returns this
*/
proto.spine.core.EventContext.prototype.setProducerId = function(value) {
  return jspb.Message.setWrapperField(this, 3, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearProducerId = function() {
  return this.setProducerId(undefined);
};


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


/**
 * optional Version version = 4;
 * @return {?proto.spine.core.Version}
 */
proto.spine.core.EventContext.prototype.getVersion = function() {
  return /** @type{?proto.spine.core.Version} */ (
    jspb.Message.getWrapperField(this, spine_core_version_pb.Version, 4));
};


/**
 * @param {?proto.spine.core.Version|undefined} value
 * @return {!proto.spine.core.EventContext} returns this
*/
proto.spine.core.EventContext.prototype.setVersion = function(value) {
  return jspb.Message.setWrapperField(this, 4, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearVersion = function() {
  return this.setVersion(undefined);
};


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


/**
 * optional Enrichment enrichment = 5;
 * @return {?proto.spine.core.Enrichment}
 */
proto.spine.core.EventContext.prototype.getEnrichment = function() {
  return /** @type{?proto.spine.core.Enrichment} */ (
    jspb.Message.getWrapperField(this, spine_core_enrichment_pb.Enrichment, 5));
};


/**
 * @param {?proto.spine.core.Enrichment|undefined} value
 * @return {!proto.spine.core.EventContext} returns this
*/
proto.spine.core.EventContext.prototype.setEnrichment = function(value) {
  return jspb.Message.setWrapperField(this, 5, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearEnrichment = function() {
  return this.setEnrichment(undefined);
};


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


/**
 * optional bool external = 8;
 * @return {boolean}
 */
proto.spine.core.EventContext.prototype.getExternal = function() {
  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false));
};


/**
 * @param {boolean} value
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.setExternal = function(value) {
  return jspb.Message.setProto3BooleanField(this, 8, value);
};


/**
 * optional RejectionEventContext rejection = 10;
 * @return {?proto.spine.core.RejectionEventContext}
 */
proto.spine.core.EventContext.prototype.getRejection = function() {
  return /** @type{?proto.spine.core.RejectionEventContext} */ (
    jspb.Message.getWrapperField(this, proto.spine.core.RejectionEventContext, 10));
};


/**
 * @param {?proto.spine.core.RejectionEventContext|undefined} value
 * @return {!proto.spine.core.EventContext} returns this
*/
proto.spine.core.EventContext.prototype.setRejection = function(value) {
  return jspb.Message.setWrapperField(this, 10, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.EventContext} returns this
 */
proto.spine.core.EventContext.prototype.clearRejection = function() {
  return this.setRejection(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.core.EventContext.prototype.hasRejection = function() {
  return jspb.Message.getField(this, 10) != 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.core.RejectionEventContext.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.core.RejectionEventContext.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.core.RejectionEventContext} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.core.RejectionEventContext.toObject = function(includeInstance, msg) {
  var f, obj = {
    command: (f = msg.getCommand()) && spine_core_command_pb.Command.toObject(includeInstance, f),
    stacktrace: jspb.Message.getFieldWithDefault(msg, 2, ""),
    commandMessage: (f = msg.getCommandMessage()) && google_protobuf_any_pb.Any.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.core.RejectionEventContext}
 */
proto.spine.core.RejectionEventContext.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.core.RejectionEventContext;
  return proto.spine.core.RejectionEventContext.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.core.RejectionEventContext} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.core.RejectionEventContext}
 */
proto.spine.core.RejectionEventContext.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 3:
      var value = new spine_core_command_pb.Command;
      reader.readMessage(value,spine_core_command_pb.Command.deserializeBinaryFromReader);
      msg.setCommand(value);
      break;
    case 2:
      var value = /** @type {string} */ (reader.readString());
      msg.setStacktrace(value);
      break;
    case 1:
      var value = new google_protobuf_any_pb.Any;
      reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
      msg.setCommandMessage(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.spine.core.RejectionEventContext.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.spine.core.RejectionEventContext.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.core.RejectionEventContext} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.core.RejectionEventContext.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getCommand();
  if (f != null) {
    writer.writeMessage(
      3,
      f,
      spine_core_command_pb.Command.serializeBinaryToWriter
    );
  }
  f = message.getStacktrace();
  if (f.length > 0) {
    writer.writeString(
      2,
      f
    );
  }
  f = message.getCommandMessage();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      google_protobuf_any_pb.Any.serializeBinaryToWriter
    );
  }
};


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


/**
 * @param {?proto.spine.core.Command|undefined} value
 * @return {!proto.spine.core.RejectionEventContext} returns this
*/
proto.spine.core.RejectionEventContext.prototype.setCommand = function(value) {
  return jspb.Message.setWrapperField(this, 3, value);
};


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


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


/**
 * optional string stacktrace = 2;
 * @return {string}
 */
proto.spine.core.RejectionEventContext.prototype.getStacktrace = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};


/**
 * @param {string} value
 * @return {!proto.spine.core.RejectionEventContext} returns this
 */
proto.spine.core.RejectionEventContext.prototype.setStacktrace = function(value) {
  return jspb.Message.setProto3StringField(this, 2, value);
};


/**
 * optional google.protobuf.Any command_message = 1;
 * @return {?proto.google.protobuf.Any}
 */
proto.spine.core.RejectionEventContext.prototype.getCommandMessage = function() {
  return /** @type{?proto.google.protobuf.Any} */ (
    jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 1));
};


/**
 * @param {?proto.google.protobuf.Any|undefined} value
 * @return {!proto.spine.core.RejectionEventContext} returns this
*/
proto.spine.core.RejectionEventContext.prototype.setCommandMessage = function(value) {
  return jspb.Message.setWrapperField(this, 1, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.core.RejectionEventContext} returns this
 */
proto.spine.core.RejectionEventContext.prototype.clearCommandMessage = function() {
  return this.setCommandMessage(undefined);
};


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


/**
 * @enum {number}
 */
proto.spine.core.EventValidationError = {
  UNKNOWN_REASON: 0,
  UNSUPPORTED_EVENT: 1,
  INVALID_EVENT: 2,
  DUPLICATE_EVENT: 3
};

goog.object.extend(exports, proto.spine.core);

// 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.core.EventId.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.core.EventId.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.core.EventId.Parser.prototype.constructor = proto.spine.core.EventId.Parser;
proto.spine.core.EventId.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.core.EventId();
  
  if (obj.value !== undefined) {
    if (obj.value !== null) {
      let value = obj.value;
      msg.setValue(value);
    }
  }
  return msg;
};

proto.spine.core.RejectionEventContext.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.core.RejectionEventContext.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.core.RejectionEventContext.Parser.prototype.constructor = proto.spine.core.RejectionEventContext.Parser;
proto.spine.core.RejectionEventContext.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.core.RejectionEventContext();
  
  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.stacktrace !== undefined) {
    if (obj.stacktrace !== null) {
      let value = obj.stacktrace;
      msg.setStacktrace(value);
    }
  }
  
  if (obj.commandMessage !== undefined) {
    if (obj.commandMessage === null) {
      msg.setCommandMessage(null);
    } else {
      let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.commandMessage);
      msg.setCommandMessage(value);
    }
  }
  return msg;
};

proto.spine.core.Event.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.core.Event.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.core.Event.Parser.prototype.constructor = proto.spine.core.Event.Parser;
proto.spine.core.Event.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.core.Event();
  
  if (obj.id !== undefined) {
    if (obj.id === null) {
      msg.setId(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.EventId').fromObject(obj.id);
      msg.setId(value);
    }
  }
  
  if (obj.message !== undefined) {
    if (obj.message === null) {
      msg.setMessage(null);
    } else {
      let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.message);
      msg.setMessage(value);
    }
  }
  
  if (obj.context !== undefined) {
    if (obj.context === null) {
      msg.setContext(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.EventContext').fromObject(obj.context);
      msg.setContext(value);
    }
  }
  return msg;
};

proto.spine.core.EventContext.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.core.EventContext.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.core.EventContext.Parser.prototype.constructor = proto.spine.core.EventContext.Parser;
proto.spine.core.EventContext.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.core.EventContext();
  
  if (obj.timestamp !== undefined) {
    if (obj.timestamp === null) {
      msg.setTimestamp(null);
    } else {
      let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Timestamp').fromObject(obj.timestamp);
      msg.setTimestamp(value);
    }
  }
  
  if (obj.commandContext !== undefined) {
    if (obj.commandContext === null) {
      msg.setCommandContext(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.CommandContext').fromObject(obj.commandContext);
      msg.setCommandContext(value);
    }
  }
  
  if (obj.eventContext !== undefined) {
    if (obj.eventContext === null) {
      msg.setEventContext(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.EventContext').fromObject(obj.eventContext);
      msg.setEventContext(value);
    }
  }
  
  if (obj.pastMessage !== undefined) {
    if (obj.pastMessage === null) {
      msg.setPastMessage(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.Origin').fromObject(obj.pastMessage);
      msg.setPastMessage(value);
    }
  }
  
  if (obj.importContext !== undefined) {
    if (obj.importContext === null) {
      msg.setImportContext(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.ActorContext').fromObject(obj.importContext);
      msg.setImportContext(value);
    }
  }
  
  if (obj.commandId !== undefined) {
    if (obj.commandId === null) {
      msg.setCommandId(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.CommandId').fromObject(obj.commandId);
      msg.setCommandId(value);
    }
  }
  
  if (obj.eventId !== undefined) {
    if (obj.eventId === null) {
      msg.setEventId(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.EventId').fromObject(obj.eventId);
      msg.setEventId(value);
    }
  }
  
  if (obj.rootCommandId !== undefined) {
    if (obj.rootCommandId === null) {
      msg.setRootCommandId(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.CommandId').fromObject(obj.rootCommandId);
      msg.setRootCommandId(value);
    }
  }
  
  if (obj.producerId !== undefined) {
    if (obj.producerId === null) {
      msg.setProducerId(null);
    } else {
      let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.producerId);
      msg.setProducerId(value);
    }
  }
  
  if (obj.version !== undefined) {
    if (obj.version === null) {
      msg.setVersion(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.Version').fromObject(obj.version);
      msg.setVersion(value);
    }
  }
  
  if (obj.enrichment !== undefined) {
    if (obj.enrichment === null) {
      msg.setEnrichment(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.Enrichment').fromObject(obj.enrichment);
      msg.setEnrichment(value);
    }
  }
  
  if (obj.external !== undefined) {
    if (obj.external !== null) {
      let value = obj.external;
      msg.setExternal(value);
    }
  }
  
  if (obj.rejection !== undefined) {
    if (obj.rejection === null) {
      msg.setRejection(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.RejectionEventContext').fromObject(obj.rejection);
      msg.setRejection(value);
    }
  }
  return msg;
};

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

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

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

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

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