// source: spine/core/enrichment.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);
goog.exportSymbol('proto.spine.core.Enrichment', null, global);
goog.exportSymbol('proto.spine.core.Enrichment.Container', null, global);
goog.exportSymbol('proto.spine.core.Enrichment.ModeCase', 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.Enrichment = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.spine.core.Enrichment.oneofGroups_);
};
goog.inherits(proto.spine.core.Enrichment, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.core.Enrichment.displayName = 'proto.spine.core.Enrichment';
}
/**
* 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.Enrichment.Container = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.core.Enrichment.Container, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.core.Enrichment.Container.displayName = 'proto.spine.core.Enrichment.Container';
}
/**
* 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.Enrichment.oneofGroups_ = [[1,2]];
/**
* @enum {number}
*/
proto.spine.core.Enrichment.ModeCase = {
MODE_NOT_SET: 0,
DO_NOT_ENRICH: 1,
CONTAINER: 2
};
/**
* @return {proto.spine.core.Enrichment.ModeCase}
*/
proto.spine.core.Enrichment.prototype.getModeCase = function() {
return /** @type {proto.spine.core.Enrichment.ModeCase} */(jspb.Message.computeOneofCase(this, proto.spine.core.Enrichment.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.core.Enrichment.prototype.toObject = function(opt_includeInstance) {
return proto.spine.core.Enrichment.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.Enrichment} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.core.Enrichment.toObject = function(includeInstance, msg) {
var f, obj = {
doNotEnrich: jspb.Message.getBooleanFieldWithDefault(msg, 1, false),
container: (f = msg.getContainer()) && proto.spine.core.Enrichment.Container.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.Enrichment}
*/
proto.spine.core.Enrichment.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.core.Enrichment;
return proto.spine.core.Enrichment.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.core.Enrichment} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.core.Enrichment}
*/
proto.spine.core.Enrichment.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {boolean} */ (reader.readBool());
msg.setDoNotEnrich(value);
break;
case 2:
var value = new proto.spine.core.Enrichment.Container;
reader.readMessage(value,proto.spine.core.Enrichment.Container.deserializeBinaryFromReader);
msg.setContainer(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.core.Enrichment.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.core.Enrichment.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.Enrichment} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.core.Enrichment.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = /** @type {boolean} */ (jspb.Message.getField(message, 1));
if (f != null) {
writer.writeBool(
1,
f
);
}
f = message.getContainer();
if (f != null) {
writer.writeMessage(
2,
f,
proto.spine.core.Enrichment.Container.serializeBinaryToWriter
);
}
};
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.Enrichment.Container.prototype.toObject = function(opt_includeInstance) {
return proto.spine.core.Enrichment.Container.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.Enrichment.Container} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.core.Enrichment.Container.toObject = function(includeInstance, msg) {
var f, obj = {
itemsMap: (f = msg.getItemsMap()) ? f.toObject(includeInstance, proto.google.protobuf.Any.toObject) : []
};
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.Enrichment.Container}
*/
proto.spine.core.Enrichment.Container.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.core.Enrichment.Container;
return proto.spine.core.Enrichment.Container.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.core.Enrichment.Container} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.core.Enrichment.Container}
*/
proto.spine.core.Enrichment.Container.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = msg.getItemsMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Any.deserializeBinaryFromReader, "", new proto.google.protobuf.Any());
});
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.core.Enrichment.Container.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.core.Enrichment.Container.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.Enrichment.Container} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.core.Enrichment.Container.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getItemsMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.google.protobuf.Any.serializeBinaryToWriter);
}
};
/**
* map<string, google.protobuf.Any> items = 1;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,!proto.google.protobuf.Any>}
*/
proto.spine.core.Enrichment.Container.prototype.getItemsMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,!proto.google.protobuf.Any>} */ (
jspb.Message.getMapField(this, 1, opt_noLazyCreate,
proto.google.protobuf.Any));
};
/**
* Clears values from the map. The map will be non-null.
* @return {!proto.spine.core.Enrichment.Container} returns this
*/
proto.spine.core.Enrichment.Container.prototype.clearItemsMap = function() {
this.getItemsMap().clear();
return this;};
/**
* optional bool do_not_enrich = 1;
* @return {boolean}
*/
proto.spine.core.Enrichment.prototype.getDoNotEnrich = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false));
};
/**
* @param {boolean} value
* @return {!proto.spine.core.Enrichment} returns this
*/
proto.spine.core.Enrichment.prototype.setDoNotEnrich = function(value) {
return jspb.Message.setOneofField(this, 1, proto.spine.core.Enrichment.oneofGroups_[0], value);
};
/**
* Clears the field making it undefined.
* @return {!proto.spine.core.Enrichment} returns this
*/
proto.spine.core.Enrichment.prototype.clearDoNotEnrich = function() {
return jspb.Message.setOneofField(this, 1, proto.spine.core.Enrichment.oneofGroups_[0], undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.core.Enrichment.prototype.hasDoNotEnrich = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional Container container = 2;
* @return {?proto.spine.core.Enrichment.Container}
*/
proto.spine.core.Enrichment.prototype.getContainer = function() {
return /** @type{?proto.spine.core.Enrichment.Container} */ (
jspb.Message.getWrapperField(this, proto.spine.core.Enrichment.Container, 2));
};
/**
* @param {?proto.spine.core.Enrichment.Container|undefined} value
* @return {!proto.spine.core.Enrichment} returns this
*/
proto.spine.core.Enrichment.prototype.setContainer = function(value) {
return jspb.Message.setOneofWrapperField(this, 2, proto.spine.core.Enrichment.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.core.Enrichment} returns this
*/
proto.spine.core.Enrichment.prototype.clearContainer = function() {
return this.setContainer(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.core.Enrichment.prototype.hasContainer = function() {
return jspb.Message.getField(this, 2) != 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.Enrichment.Container.Parser = function() {
ObjectParser.call(this);
};
proto.spine.core.Enrichment.Container.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.core.Enrichment.Container.Parser.prototype.constructor = proto.spine.core.Enrichment.Container.Parser;
proto.spine.core.Enrichment.Container.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.core.Enrichment.Container();
if (obj.items !== undefined && obj.items !== null) {
for (let attribute in obj.items) {
if (obj.items.hasOwnProperty(attribute)) {
let mapKey = attribute;
if (obj.items[attribute] === null) {
msg.getItemsMap().set(mapKey, null);
} else {
let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.items[attribute]);
msg.getItemsMap().set(mapKey, value);
}
}
}
}
return msg;
};
proto.spine.core.Enrichment.Parser = function() {
ObjectParser.call(this);
};
proto.spine.core.Enrichment.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.core.Enrichment.Parser.prototype.constructor = proto.spine.core.Enrichment.Parser;
proto.spine.core.Enrichment.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.core.Enrichment();
if (obj.doNotEnrich !== undefined) {
if (obj.doNotEnrich !== null) {
let value = obj.doNotEnrich;
msg.setDoNotEnrich(value);
}
}
if (obj.container !== undefined) {
if (obj.container === null) {
msg.setContainer(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.core.Enrichment.Container').fromObject(obj.container);
msg.setContainer(value);
}
}
return msg;
};
// Generated by Spine ProtoJs Plugin
proto.spine.core.Enrichment.Container.typeUrl = function() {
return 'type.spine.io/spine.core.Enrichment.Container';
};
// Generated by Spine ProtoJs Plugin
proto.spine.core.Enrichment.typeUrl = function() {
return 'type.spine.io/spine.core.Enrichment';
};