// source: spine/system/server/event_lifecycle_events.proto
/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var spine_options_pb = require('../../../spine/options_pb.js');
goog.object.extend(proto, spine_options_pb);
var spine_core_command_pb = require('../../../spine/core/command_pb.js');
goog.object.extend(proto, spine_core_command_pb);
var spine_core_event_pb = require('../../../spine/core/event_pb.js');
goog.object.extend(proto, spine_core_event_pb);
goog.exportSymbol('proto.spine.system.server.EventCausedCommand', null, global);
goog.exportSymbol('proto.spine.system.server.EventCausedCommands', 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.system.server.EventCausedCommand = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.system.server.EventCausedCommand, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.system.server.EventCausedCommand.displayName = 'proto.spine.system.server.EventCausedCommand';
}
/**
* 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.system.server.EventCausedCommands = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.spine.system.server.EventCausedCommands.repeatedFields_, null);
};
goog.inherits(proto.spine.system.server.EventCausedCommands, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.system.server.EventCausedCommands.displayName = 'proto.spine.system.server.EventCausedCommands';
}
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.system.server.EventCausedCommand.prototype.toObject = function(opt_includeInstance) {
return proto.spine.system.server.EventCausedCommand.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.system.server.EventCausedCommand} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.system.server.EventCausedCommand.toObject = function(includeInstance, msg) {
var f, obj = {
id: (f = msg.getId()) && spine_core_event_pb.EventId.toObject(includeInstance, f),
produced: (f = msg.getProduced()) && spine_core_command_pb.CommandId.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.system.server.EventCausedCommand}
*/
proto.spine.system.server.EventCausedCommand.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.system.server.EventCausedCommand;
return proto.spine.system.server.EventCausedCommand.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.system.server.EventCausedCommand} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.system.server.EventCausedCommand}
*/
proto.spine.system.server.EventCausedCommand.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new spine_core_event_pb.EventId;
reader.readMessage(value,spine_core_event_pb.EventId.deserializeBinaryFromReader);
msg.setId(value);
break;
case 2:
var value = new spine_core_command_pb.CommandId;
reader.readMessage(value,spine_core_command_pb.CommandId.deserializeBinaryFromReader);
msg.setProduced(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.system.server.EventCausedCommand.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.system.server.EventCausedCommand.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.system.server.EventCausedCommand} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.system.server.EventCausedCommand.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f != null) {
writer.writeMessage(
1,
f,
spine_core_event_pb.EventId.serializeBinaryToWriter
);
}
f = message.getProduced();
if (f != null) {
writer.writeMessage(
2,
f,
spine_core_command_pb.CommandId.serializeBinaryToWriter
);
}
};
/**
* optional spine.core.EventId id = 1;
* @return {?proto.spine.core.EventId}
*/
proto.spine.system.server.EventCausedCommand.prototype.getId = function() {
return /** @type{?proto.spine.core.EventId} */ (
jspb.Message.getWrapperField(this, spine_core_event_pb.EventId, 1));
};
/**
* @param {?proto.spine.core.EventId|undefined} value
* @return {!proto.spine.system.server.EventCausedCommand} returns this
*/
proto.spine.system.server.EventCausedCommand.prototype.setId = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.system.server.EventCausedCommand} returns this
*/
proto.spine.system.server.EventCausedCommand.prototype.clearId = function() {
return this.setId(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.system.server.EventCausedCommand.prototype.hasId = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional spine.core.CommandId produced = 2;
* @return {?proto.spine.core.CommandId}
*/
proto.spine.system.server.EventCausedCommand.prototype.getProduced = function() {
return /** @type{?proto.spine.core.CommandId} */ (
jspb.Message.getWrapperField(this, spine_core_command_pb.CommandId, 2));
};
/**
* @param {?proto.spine.core.CommandId|undefined} value
* @return {!proto.spine.system.server.EventCausedCommand} returns this
*/
proto.spine.system.server.EventCausedCommand.prototype.setProduced = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.system.server.EventCausedCommand} returns this
*/
proto.spine.system.server.EventCausedCommand.prototype.clearProduced = function() {
return this.setProduced(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.system.server.EventCausedCommand.prototype.hasProduced = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.spine.system.server.EventCausedCommands.repeatedFields_ = [2];
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.system.server.EventCausedCommands.prototype.toObject = function(opt_includeInstance) {
return proto.spine.system.server.EventCausedCommands.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.system.server.EventCausedCommands} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.system.server.EventCausedCommands.toObject = function(includeInstance, msg) {
var f, obj = {
id: (f = msg.getId()) && spine_core_event_pb.EventId.toObject(includeInstance, f),
producedList: jspb.Message.toObjectList(msg.getProducedList(),
spine_core_command_pb.CommandId.toObject, includeInstance)
};
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.system.server.EventCausedCommands}
*/
proto.spine.system.server.EventCausedCommands.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.system.server.EventCausedCommands;
return proto.spine.system.server.EventCausedCommands.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.system.server.EventCausedCommands} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.system.server.EventCausedCommands}
*/
proto.spine.system.server.EventCausedCommands.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new spine_core_event_pb.EventId;
reader.readMessage(value,spine_core_event_pb.EventId.deserializeBinaryFromReader);
msg.setId(value);
break;
case 2:
var value = new spine_core_command_pb.CommandId;
reader.readMessage(value,spine_core_command_pb.CommandId.deserializeBinaryFromReader);
msg.addProduced(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.system.server.EventCausedCommands.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.system.server.EventCausedCommands.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.system.server.EventCausedCommands} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.system.server.EventCausedCommands.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f != null) {
writer.writeMessage(
1,
f,
spine_core_event_pb.EventId.serializeBinaryToWriter
);
}
f = message.getProducedList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
spine_core_command_pb.CommandId.serializeBinaryToWriter
);
}
};
/**
* optional spine.core.EventId id = 1;
* @return {?proto.spine.core.EventId}
*/
proto.spine.system.server.EventCausedCommands.prototype.getId = function() {
return /** @type{?proto.spine.core.EventId} */ (
jspb.Message.getWrapperField(this, spine_core_event_pb.EventId, 1));
};
/**
* @param {?proto.spine.core.EventId|undefined} value
* @return {!proto.spine.system.server.EventCausedCommands} returns this
*/
proto.spine.system.server.EventCausedCommands.prototype.setId = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.system.server.EventCausedCommands} returns this
*/
proto.spine.system.server.EventCausedCommands.prototype.clearId = function() {
return this.setId(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.system.server.EventCausedCommands.prototype.hasId = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* repeated spine.core.CommandId produced = 2;
* @return {!Array<!proto.spine.core.CommandId>}
*/
proto.spine.system.server.EventCausedCommands.prototype.getProducedList = function() {
return /** @type{!Array<!proto.spine.core.CommandId>} */ (
jspb.Message.getRepeatedWrapperField(this, spine_core_command_pb.CommandId, 2));
};
/**
* @param {!Array<!proto.spine.core.CommandId>} value
* @return {!proto.spine.system.server.EventCausedCommands} returns this
*/
proto.spine.system.server.EventCausedCommands.prototype.setProducedList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.spine.core.CommandId=} opt_value
* @param {number=} opt_index
* @return {!proto.spine.core.CommandId}
*/
proto.spine.system.server.EventCausedCommands.prototype.addProduced = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.spine.core.CommandId, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.spine.system.server.EventCausedCommands} returns this
*/
proto.spine.system.server.EventCausedCommands.prototype.clearProducedList = function() {
return this.setProducedList([]);
};
goog.object.extend(exports, proto.spine.system.server);
// 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.system.server.EventCausedCommand.Parser = function() {
ObjectParser.call(this);
};
proto.spine.system.server.EventCausedCommand.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.system.server.EventCausedCommand.Parser.prototype.constructor = proto.spine.system.server.EventCausedCommand.Parser;
proto.spine.system.server.EventCausedCommand.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.system.server.EventCausedCommand();
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.produced !== undefined) {
if (obj.produced === null) {
msg.setProduced(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.core.CommandId').fromObject(obj.produced);
msg.setProduced(value);
}
}
return msg;
};
proto.spine.system.server.EventCausedCommands.Parser = function() {
ObjectParser.call(this);
};
proto.spine.system.server.EventCausedCommands.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.system.server.EventCausedCommands.Parser.prototype.constructor = proto.spine.system.server.EventCausedCommands.Parser;
proto.spine.system.server.EventCausedCommands.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.system.server.EventCausedCommands();
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.produced !== undefined && obj.produced !== null) {
obj.produced.forEach(
(listItem, index, array) => {
if (listItem === null) {
msg.addProduced(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.core.CommandId').fromObject(listItem);
msg.addProduced(value);
}
}
);
}
return msg;
};
// Generated by Spine ProtoJs Plugin
proto.spine.system.server.EventCausedCommand.typeUrl = function() {
return 'type.spine.io/spine.system.server.EventCausedCommand';
};
// Generated by Spine ProtoJs Plugin
proto.spine.system.server.EventCausedCommands.typeUrl = function() {
return 'type.spine.io/spine.system.server.EventCausedCommands';
};