// source: spine/server/aggregate/aggregate.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_event_pb = require('../../../spine/core/event_pb.js');
goog.object.extend(proto, spine_core_event_pb);
var spine_core_version_pb = require('../../../spine/core/version_pb.js');
goog.object.extend(proto, spine_core_version_pb);
goog.exportSymbol('proto.spine.server.aggregate.AggregateEventRecord', null, global);
goog.exportSymbol('proto.spine.server.aggregate.AggregateEventRecord.KindCase', null, global);
goog.exportSymbol('proto.spine.server.aggregate.AggregateHistory', null, global);
goog.exportSymbol('proto.spine.server.aggregate.Snapshot', 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.aggregate.Snapshot = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.server.aggregate.Snapshot, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.server.aggregate.Snapshot.displayName = 'proto.spine.server.aggregate.Snapshot';
}
/**
* 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.aggregate.AggregateEventRecord = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.spine.server.aggregate.AggregateEventRecord.oneofGroups_);
};
goog.inherits(proto.spine.server.aggregate.AggregateEventRecord, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.server.aggregate.AggregateEventRecord.displayName = 'proto.spine.server.aggregate.AggregateEventRecord';
}
/**
* 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.aggregate.AggregateHistory = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.spine.server.aggregate.AggregateHistory.repeatedFields_, null);
};
goog.inherits(proto.spine.server.aggregate.AggregateHistory, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.server.aggregate.AggregateHistory.displayName = 'proto.spine.server.aggregate.AggregateHistory';
}
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.aggregate.Snapshot.prototype.toObject = function(opt_includeInstance) {
return proto.spine.server.aggregate.Snapshot.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.aggregate.Snapshot} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.server.aggregate.Snapshot.toObject = function(includeInstance, msg) {
var f, obj = {
state: (f = msg.getState()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
version: (f = msg.getVersion()) && spine_core_version_pb.Version.toObject(includeInstance, f),
timestamp: (f = msg.getTimestamp()) && 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.aggregate.Snapshot}
*/
proto.spine.server.aggregate.Snapshot.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.server.aggregate.Snapshot;
return proto.spine.server.aggregate.Snapshot.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.server.aggregate.Snapshot} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.server.aggregate.Snapshot}
*/
proto.spine.server.aggregate.Snapshot.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.setState(value);
break;
case 2:
var value = new spine_core_version_pb.Version;
reader.readMessage(value,spine_core_version_pb.Version.deserializeBinaryFromReader);
msg.setVersion(value);
break;
case 3:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setTimestamp(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.server.aggregate.Snapshot.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.server.aggregate.Snapshot.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.aggregate.Snapshot} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.server.aggregate.Snapshot.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getState();
if (f != null) {
writer.writeMessage(
1,
f,
google_protobuf_any_pb.Any.serializeBinaryToWriter
);
}
f = message.getVersion();
if (f != null) {
writer.writeMessage(
2,
f,
spine_core_version_pb.Version.serializeBinaryToWriter
);
}
f = message.getTimestamp();
if (f != null) {
writer.writeMessage(
3,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
};
/**
* optional google.protobuf.Any state = 1;
* @return {?proto.google.protobuf.Any}
*/
proto.spine.server.aggregate.Snapshot.prototype.getState = 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.server.aggregate.Snapshot} returns this
*/
proto.spine.server.aggregate.Snapshot.prototype.setState = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.server.aggregate.Snapshot} returns this
*/
proto.spine.server.aggregate.Snapshot.prototype.clearState = function() {
return this.setState(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.server.aggregate.Snapshot.prototype.hasState = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional spine.core.Version version = 2;
* @return {?proto.spine.core.Version}
*/
proto.spine.server.aggregate.Snapshot.prototype.getVersion = function() {
return /** @type{?proto.spine.core.Version} */ (
jspb.Message.getWrapperField(this, spine_core_version_pb.Version, 2));
};
/**
* @param {?proto.spine.core.Version|undefined} value
* @return {!proto.spine.server.aggregate.Snapshot} returns this
*/
proto.spine.server.aggregate.Snapshot.prototype.setVersion = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.server.aggregate.Snapshot} returns this
*/
proto.spine.server.aggregate.Snapshot.prototype.clearVersion = function() {
return this.setVersion(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.server.aggregate.Snapshot.prototype.hasVersion = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional google.protobuf.Timestamp timestamp = 3;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.spine.server.aggregate.Snapshot.prototype.getTimestamp = function() {
return /** @type{?proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
};
/**
* @param {?proto.google.protobuf.Timestamp|undefined} value
* @return {!proto.spine.server.aggregate.Snapshot} returns this
*/
proto.spine.server.aggregate.Snapshot.prototype.setTimestamp = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.server.aggregate.Snapshot} returns this
*/
proto.spine.server.aggregate.Snapshot.prototype.clearTimestamp = function() {
return this.setTimestamp(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.server.aggregate.Snapshot.prototype.hasTimestamp = 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.server.aggregate.AggregateEventRecord.oneofGroups_ = [[2,3]];
/**
* @enum {number}
*/
proto.spine.server.aggregate.AggregateEventRecord.KindCase = {
KIND_NOT_SET: 0,
EVENT: 2,
SNAPSHOT: 3
};
/**
* @return {proto.spine.server.aggregate.AggregateEventRecord.KindCase}
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.getKindCase = function() {
return /** @type {proto.spine.server.aggregate.AggregateEventRecord.KindCase} */(jspb.Message.computeOneofCase(this, proto.spine.server.aggregate.AggregateEventRecord.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.aggregate.AggregateEventRecord.prototype.toObject = function(opt_includeInstance) {
return proto.spine.server.aggregate.AggregateEventRecord.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.aggregate.AggregateEventRecord} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.server.aggregate.AggregateEventRecord.toObject = function(includeInstance, msg) {
var f, obj = {
timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
event: (f = msg.getEvent()) && spine_core_event_pb.Event.toObject(includeInstance, f),
snapshot: (f = msg.getSnapshot()) && proto.spine.server.aggregate.Snapshot.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.aggregate.AggregateEventRecord}
*/
proto.spine.server.aggregate.AggregateEventRecord.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.server.aggregate.AggregateEventRecord;
return proto.spine.server.aggregate.AggregateEventRecord.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.server.aggregate.AggregateEventRecord} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.server.aggregate.AggregateEventRecord}
*/
proto.spine.server.aggregate.AggregateEventRecord.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_event_pb.Event;
reader.readMessage(value,spine_core_event_pb.Event.deserializeBinaryFromReader);
msg.setEvent(value);
break;
case 3:
var value = new proto.spine.server.aggregate.Snapshot;
reader.readMessage(value,proto.spine.server.aggregate.Snapshot.deserializeBinaryFromReader);
msg.setSnapshot(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.server.aggregate.AggregateEventRecord.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.aggregate.AggregateEventRecord} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.server.aggregate.AggregateEventRecord.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.getEvent();
if (f != null) {
writer.writeMessage(
2,
f,
spine_core_event_pb.Event.serializeBinaryToWriter
);
}
f = message.getSnapshot();
if (f != null) {
writer.writeMessage(
3,
f,
proto.spine.server.aggregate.Snapshot.serializeBinaryToWriter
);
}
};
/**
* optional google.protobuf.Timestamp timestamp = 1;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.spine.server.aggregate.AggregateEventRecord.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.server.aggregate.AggregateEventRecord} returns this
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.setTimestamp = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.server.aggregate.AggregateEventRecord} returns this
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.clearTimestamp = function() {
return this.setTimestamp(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.hasTimestamp = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional spine.core.Event event = 2;
* @return {?proto.spine.core.Event}
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.getEvent = function() {
return /** @type{?proto.spine.core.Event} */ (
jspb.Message.getWrapperField(this, spine_core_event_pb.Event, 2));
};
/**
* @param {?proto.spine.core.Event|undefined} value
* @return {!proto.spine.server.aggregate.AggregateEventRecord} returns this
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.setEvent = function(value) {
return jspb.Message.setOneofWrapperField(this, 2, proto.spine.server.aggregate.AggregateEventRecord.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.server.aggregate.AggregateEventRecord} returns this
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.clearEvent = function() {
return this.setEvent(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.hasEvent = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional Snapshot snapshot = 3;
* @return {?proto.spine.server.aggregate.Snapshot}
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.getSnapshot = function() {
return /** @type{?proto.spine.server.aggregate.Snapshot} */ (
jspb.Message.getWrapperField(this, proto.spine.server.aggregate.Snapshot, 3));
};
/**
* @param {?proto.spine.server.aggregate.Snapshot|undefined} value
* @return {!proto.spine.server.aggregate.AggregateEventRecord} returns this
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.setSnapshot = function(value) {
return jspb.Message.setOneofWrapperField(this, 3, proto.spine.server.aggregate.AggregateEventRecord.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.server.aggregate.AggregateEventRecord} returns this
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.clearSnapshot = function() {
return this.setSnapshot(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.server.aggregate.AggregateEventRecord.prototype.hasSnapshot = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.spine.server.aggregate.AggregateHistory.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.server.aggregate.AggregateHistory.prototype.toObject = function(opt_includeInstance) {
return proto.spine.server.aggregate.AggregateHistory.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.aggregate.AggregateHistory} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.server.aggregate.AggregateHistory.toObject = function(includeInstance, msg) {
var f, obj = {
snapshot: (f = msg.getSnapshot()) && proto.spine.server.aggregate.Snapshot.toObject(includeInstance, f),
eventList: jspb.Message.toObjectList(msg.getEventList(),
spine_core_event_pb.Event.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.server.aggregate.AggregateHistory}
*/
proto.spine.server.aggregate.AggregateHistory.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.server.aggregate.AggregateHistory;
return proto.spine.server.aggregate.AggregateHistory.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.server.aggregate.AggregateHistory} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.server.aggregate.AggregateHistory}
*/
proto.spine.server.aggregate.AggregateHistory.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.aggregate.Snapshot;
reader.readMessage(value,proto.spine.server.aggregate.Snapshot.deserializeBinaryFromReader);
msg.setSnapshot(value);
break;
case 2:
var value = new spine_core_event_pb.Event;
reader.readMessage(value,spine_core_event_pb.Event.deserializeBinaryFromReader);
msg.addEvent(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.server.aggregate.AggregateHistory.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.server.aggregate.AggregateHistory.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.aggregate.AggregateHistory} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.server.aggregate.AggregateHistory.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getSnapshot();
if (f != null) {
writer.writeMessage(
1,
f,
proto.spine.server.aggregate.Snapshot.serializeBinaryToWriter
);
}
f = message.getEventList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
spine_core_event_pb.Event.serializeBinaryToWriter
);
}
};
/**
* optional Snapshot snapshot = 1;
* @return {?proto.spine.server.aggregate.Snapshot}
*/
proto.spine.server.aggregate.AggregateHistory.prototype.getSnapshot = function() {
return /** @type{?proto.spine.server.aggregate.Snapshot} */ (
jspb.Message.getWrapperField(this, proto.spine.server.aggregate.Snapshot, 1));
};
/**
* @param {?proto.spine.server.aggregate.Snapshot|undefined} value
* @return {!proto.spine.server.aggregate.AggregateHistory} returns this
*/
proto.spine.server.aggregate.AggregateHistory.prototype.setSnapshot = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.server.aggregate.AggregateHistory} returns this
*/
proto.spine.server.aggregate.AggregateHistory.prototype.clearSnapshot = function() {
return this.setSnapshot(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.server.aggregate.AggregateHistory.prototype.hasSnapshot = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* repeated spine.core.Event event = 2;
* @return {!Array<!proto.spine.core.Event>}
*/
proto.spine.server.aggregate.AggregateHistory.prototype.getEventList = function() {
return /** @type{!Array<!proto.spine.core.Event>} */ (
jspb.Message.getRepeatedWrapperField(this, spine_core_event_pb.Event, 2));
};
/**
* @param {!Array<!proto.spine.core.Event>} value
* @return {!proto.spine.server.aggregate.AggregateHistory} returns this
*/
proto.spine.server.aggregate.AggregateHistory.prototype.setEventList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.spine.core.Event=} opt_value
* @param {number=} opt_index
* @return {!proto.spine.core.Event}
*/
proto.spine.server.aggregate.AggregateHistory.prototype.addEvent = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.spine.core.Event, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.spine.server.aggregate.AggregateHistory} returns this
*/
proto.spine.server.aggregate.AggregateHistory.prototype.clearEventList = function() {
return this.setEventList([]);
};
goog.object.extend(exports, proto.spine.server.aggregate);
// 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.aggregate.AggregateEventRecord.Parser = function() {
ObjectParser.call(this);
};
proto.spine.server.aggregate.AggregateEventRecord.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.aggregate.AggregateEventRecord.Parser.prototype.constructor = proto.spine.server.aggregate.AggregateEventRecord.Parser;
proto.spine.server.aggregate.AggregateEventRecord.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.server.aggregate.AggregateEventRecord();
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.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.snapshot !== undefined) {
if (obj.snapshot === null) {
msg.setSnapshot(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.server.aggregate.Snapshot').fromObject(obj.snapshot);
msg.setSnapshot(value);
}
}
return msg;
};
proto.spine.server.aggregate.AggregateHistory.Parser = function() {
ObjectParser.call(this);
};
proto.spine.server.aggregate.AggregateHistory.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.aggregate.AggregateHistory.Parser.prototype.constructor = proto.spine.server.aggregate.AggregateHistory.Parser;
proto.spine.server.aggregate.AggregateHistory.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.server.aggregate.AggregateHistory();
if (obj.snapshot !== undefined) {
if (obj.snapshot === null) {
msg.setSnapshot(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.server.aggregate.Snapshot').fromObject(obj.snapshot);
msg.setSnapshot(value);
}
}
if (obj.event !== undefined && obj.event !== null) {
obj.event.forEach(
(listItem, index, array) => {
if (listItem === null) {
msg.addEvent(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.core.Event').fromObject(listItem);
msg.addEvent(value);
}
}
);
}
return msg;
};
proto.spine.server.aggregate.Snapshot.Parser = function() {
ObjectParser.call(this);
};
proto.spine.server.aggregate.Snapshot.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.aggregate.Snapshot.Parser.prototype.constructor = proto.spine.server.aggregate.Snapshot.Parser;
proto.spine.server.aggregate.Snapshot.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.server.aggregate.Snapshot();
if (obj.state !== undefined) {
if (obj.state === null) {
msg.setState(null);
} else {
let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.state);
msg.setState(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.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);
}
}
return msg;
};
// Generated by Spine ProtoJs Plugin
proto.spine.server.aggregate.AggregateEventRecord.typeUrl = function() {
return 'type.spine.io/spine.server.aggregate.AggregateEventRecord';
};
// Generated by Spine ProtoJs Plugin
proto.spine.server.aggregate.AggregateHistory.typeUrl = function() {
return 'type.spine.io/spine.server.aggregate.AggregateHistory';
};
// Generated by Spine ProtoJs Plugin
proto.spine.server.aggregate.Snapshot.typeUrl = function() {
return 'type.spine.io/spine.server.aggregate.Snapshot';
};