Source: proto/spine/core/diagnostics_pb.js

// source: spine/core/diagnostics.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 spine_core_actor_context_pb = require('../../spine/core/actor_context_pb.js');
goog.object.extend(proto, spine_core_actor_context_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.MessageId', null, global);
goog.exportSymbol('proto.spine.core.Origin', 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.MessageId = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.core.MessageId, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.core.MessageId.displayName = 'proto.spine.core.MessageId';
}
/**
 * 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.Origin = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.core.Origin, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.core.Origin.displayName = 'proto.spine.core.Origin';
}



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.MessageId.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.core.MessageId.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.MessageId} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.core.MessageId.toObject = function(includeInstance, msg) {
  var f, obj = {
    id: (f = msg.getId()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
    typeUrl: jspb.Message.getFieldWithDefault(msg, 2, ""),
    version: (f = msg.getVersion()) && spine_core_version_pb.Version.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.MessageId}
 */
proto.spine.core.MessageId.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.core.MessageId;
  return proto.spine.core.MessageId.deserializeBinaryFromReader(msg, reader);
};


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


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


/**
 * optional google.protobuf.Any id = 1;
 * @return {?proto.google.protobuf.Any}
 */
proto.spine.core.MessageId.prototype.getId = 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.MessageId} returns this
*/
proto.spine.core.MessageId.prototype.setId = function(value) {
  return jspb.Message.setWrapperField(this, 1, value);
};


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


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


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


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


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


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


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


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.core.MessageId.prototype.hasVersion = function() {
  return jspb.Message.getField(this, 3) != 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.Origin.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.core.Origin.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.Origin} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.core.Origin.toObject = function(includeInstance, msg) {
  var f, obj = {
    message: (f = msg.getMessage()) && proto.spine.core.MessageId.toObject(includeInstance, f),
    grandOrigin: (f = msg.getGrandOrigin()) && proto.spine.core.Origin.toObject(includeInstance, f),
    actorContext: (f = msg.getActorContext()) && spine_core_actor_context_pb.ActorContext.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.Origin}
 */
proto.spine.core.Origin.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.core.Origin;
  return proto.spine.core.Origin.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.core.Origin} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.core.Origin}
 */
proto.spine.core.Origin.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.MessageId;
      reader.readMessage(value,proto.spine.core.MessageId.deserializeBinaryFromReader);
      msg.setMessage(value);
      break;
    case 2:
      var value = new proto.spine.core.Origin;
      reader.readMessage(value,proto.spine.core.Origin.deserializeBinaryFromReader);
      msg.setGrandOrigin(value);
      break;
    case 3:
      var value = new spine_core_actor_context_pb.ActorContext;
      reader.readMessage(value,spine_core_actor_context_pb.ActorContext.deserializeBinaryFromReader);
      msg.setActorContext(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


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


/**
 * optional MessageId message = 1;
 * @return {?proto.spine.core.MessageId}
 */
proto.spine.core.Origin.prototype.getMessage = function() {
  return /** @type{?proto.spine.core.MessageId} */ (
    jspb.Message.getWrapperField(this, proto.spine.core.MessageId, 1));
};


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


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


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


/**
 * optional Origin grand_origin = 2;
 * @return {?proto.spine.core.Origin}
 */
proto.spine.core.Origin.prototype.getGrandOrigin = function() {
  return /** @type{?proto.spine.core.Origin} */ (
    jspb.Message.getWrapperField(this, proto.spine.core.Origin, 2));
};


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


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


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


/**
 * optional ActorContext actor_context = 3;
 * @return {?proto.spine.core.ActorContext}
 */
proto.spine.core.Origin.prototype.getActorContext = function() {
  return /** @type{?proto.spine.core.ActorContext} */ (
    jspb.Message.getWrapperField(this, spine_core_actor_context_pb.ActorContext, 3));
};


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


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


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


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

proto.spine.core.Origin.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.core.Origin.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.core.Origin.Parser.prototype.constructor = proto.spine.core.Origin.Parser;
proto.spine.core.Origin.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.core.Origin();
  
  if (obj.message !== undefined) {
    if (obj.message === null) {
      msg.setMessage(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.MessageId').fromObject(obj.message);
      msg.setMessage(value);
    }
  }
  
  if (obj.grandOrigin !== undefined) {
    if (obj.grandOrigin === null) {
      msg.setGrandOrigin(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.Origin').fromObject(obj.grandOrigin);
      msg.setGrandOrigin(value);
    }
  }
  
  if (obj.actorContext !== undefined) {
    if (obj.actorContext === null) {
      msg.setActorContext(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.ActorContext').fromObject(obj.actorContext);
      msg.setActorContext(value);
    }
  }
  return msg;
};

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

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