// source: spine/core/actor_context.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_timestamp_pb = require('../../google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var spine_core_user_id_pb = require('../../spine/core/user_id_pb.js');
goog.object.extend(proto, spine_core_user_id_pb);
var spine_core_tenant_id_pb = require('../../spine/core/tenant_id_pb.js');
goog.object.extend(proto, spine_core_tenant_id_pb);
var spine_time_time_pb = require('../../spine/time/time_pb.js');
goog.object.extend(proto, spine_time_time_pb);
var spine_ui_language_pb = require('../../spine/ui/language_pb.js');
goog.object.extend(proto, spine_ui_language_pb);
goog.exportSymbol('proto.spine.core.ActorContext', 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.ActorContext = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.core.ActorContext, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.core.ActorContext.displayName = 'proto.spine.core.ActorContext';
}
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.ActorContext.prototype.toObject = function(opt_includeInstance) {
return proto.spine.core.ActorContext.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.ActorContext} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.core.ActorContext.toObject = function(includeInstance, msg) {
var f, obj = {
tenantId: (f = msg.getTenantId()) && spine_core_tenant_id_pb.TenantId.toObject(includeInstance, f),
actor: (f = msg.getActor()) && spine_core_user_id_pb.UserId.toObject(includeInstance, f),
timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
zoneOffset: (f = msg.getZoneOffset()) && spine_time_time_pb.ZoneOffset.toObject(includeInstance, f),
zoneId: (f = msg.getZoneId()) && spine_time_time_pb.ZoneId.toObject(includeInstance, f),
language: jspb.Message.getFieldWithDefault(msg, 5, 0)
};
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.ActorContext}
*/
proto.spine.core.ActorContext.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.core.ActorContext;
return proto.spine.core.ActorContext.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.core.ActorContext} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.core.ActorContext}
*/
proto.spine.core.ActorContext.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new spine_core_tenant_id_pb.TenantId;
reader.readMessage(value,spine_core_tenant_id_pb.TenantId.deserializeBinaryFromReader);
msg.setTenantId(value);
break;
case 2:
var value = new spine_core_user_id_pb.UserId;
reader.readMessage(value,spine_core_user_id_pb.UserId.deserializeBinaryFromReader);
msg.setActor(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;
case 4:
var value = new spine_time_time_pb.ZoneOffset;
reader.readMessage(value,spine_time_time_pb.ZoneOffset.deserializeBinaryFromReader);
msg.setZoneOffset(value);
break;
case 6:
var value = new spine_time_time_pb.ZoneId;
reader.readMessage(value,spine_time_time_pb.ZoneId.deserializeBinaryFromReader);
msg.setZoneId(value);
break;
case 5:
var value = /** @type {!proto.spine.ui.Language} */ (reader.readEnum());
msg.setLanguage(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.core.ActorContext.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.core.ActorContext.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.ActorContext} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.core.ActorContext.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getTenantId();
if (f != null) {
writer.writeMessage(
1,
f,
spine_core_tenant_id_pb.TenantId.serializeBinaryToWriter
);
}
f = message.getActor();
if (f != null) {
writer.writeMessage(
2,
f,
spine_core_user_id_pb.UserId.serializeBinaryToWriter
);
}
f = message.getTimestamp();
if (f != null) {
writer.writeMessage(
3,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = message.getZoneOffset();
if (f != null) {
writer.writeMessage(
4,
f,
spine_time_time_pb.ZoneOffset.serializeBinaryToWriter
);
}
f = message.getZoneId();
if (f != null) {
writer.writeMessage(
6,
f,
spine_time_time_pb.ZoneId.serializeBinaryToWriter
);
}
f = message.getLanguage();
if (f !== 0.0) {
writer.writeEnum(
5,
f
);
}
};
/**
* optional TenantId tenant_id = 1;
* @return {?proto.spine.core.TenantId}
*/
proto.spine.core.ActorContext.prototype.getTenantId = function() {
return /** @type{?proto.spine.core.TenantId} */ (
jspb.Message.getWrapperField(this, spine_core_tenant_id_pb.TenantId, 1));
};
/**
* @param {?proto.spine.core.TenantId|undefined} value
* @return {!proto.spine.core.ActorContext} returns this
*/
proto.spine.core.ActorContext.prototype.setTenantId = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.core.ActorContext} returns this
*/
proto.spine.core.ActorContext.prototype.clearTenantId = function() {
return this.setTenantId(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.core.ActorContext.prototype.hasTenantId = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional UserId actor = 2;
* @return {?proto.spine.core.UserId}
*/
proto.spine.core.ActorContext.prototype.getActor = function() {
return /** @type{?proto.spine.core.UserId} */ (
jspb.Message.getWrapperField(this, spine_core_user_id_pb.UserId, 2));
};
/**
* @param {?proto.spine.core.UserId|undefined} value
* @return {!proto.spine.core.ActorContext} returns this
*/
proto.spine.core.ActorContext.prototype.setActor = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.core.ActorContext} returns this
*/
proto.spine.core.ActorContext.prototype.clearActor = function() {
return this.setActor(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.core.ActorContext.prototype.hasActor = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional google.protobuf.Timestamp timestamp = 3;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.spine.core.ActorContext.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.core.ActorContext} returns this
*/
proto.spine.core.ActorContext.prototype.setTimestamp = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.core.ActorContext} returns this
*/
proto.spine.core.ActorContext.prototype.clearTimestamp = function() {
return this.setTimestamp(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.core.ActorContext.prototype.hasTimestamp = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional spine.time.ZoneOffset zone_offset = 4;
* @return {?proto.spine.time.ZoneOffset}
*/
proto.spine.core.ActorContext.prototype.getZoneOffset = function() {
return /** @type{?proto.spine.time.ZoneOffset} */ (
jspb.Message.getWrapperField(this, spine_time_time_pb.ZoneOffset, 4));
};
/**
* @param {?proto.spine.time.ZoneOffset|undefined} value
* @return {!proto.spine.core.ActorContext} returns this
*/
proto.spine.core.ActorContext.prototype.setZoneOffset = function(value) {
return jspb.Message.setWrapperField(this, 4, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.core.ActorContext} returns this
*/
proto.spine.core.ActorContext.prototype.clearZoneOffset = function() {
return this.setZoneOffset(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.core.ActorContext.prototype.hasZoneOffset = function() {
return jspb.Message.getField(this, 4) != null;
};
/**
* optional spine.time.ZoneId zone_id = 6;
* @return {?proto.spine.time.ZoneId}
*/
proto.spine.core.ActorContext.prototype.getZoneId = function() {
return /** @type{?proto.spine.time.ZoneId} */ (
jspb.Message.getWrapperField(this, spine_time_time_pb.ZoneId, 6));
};
/**
* @param {?proto.spine.time.ZoneId|undefined} value
* @return {!proto.spine.core.ActorContext} returns this
*/
proto.spine.core.ActorContext.prototype.setZoneId = function(value) {
return jspb.Message.setWrapperField(this, 6, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.core.ActorContext} returns this
*/
proto.spine.core.ActorContext.prototype.clearZoneId = function() {
return this.setZoneId(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.core.ActorContext.prototype.hasZoneId = function() {
return jspb.Message.getField(this, 6) != null;
};
/**
* optional spine.ui.Language language = 5;
* @return {!proto.spine.ui.Language}
*/
proto.spine.core.ActorContext.prototype.getLanguage = function() {
return /** @type {!proto.spine.ui.Language} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {!proto.spine.ui.Language} value
* @return {!proto.spine.core.ActorContext} returns this
*/
proto.spine.core.ActorContext.prototype.setLanguage = function(value) {
return jspb.Message.setProto3EnumField(this, 5, value);
};
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.ActorContext.Parser = function() {
ObjectParser.call(this);
};
proto.spine.core.ActorContext.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.core.ActorContext.Parser.prototype.constructor = proto.spine.core.ActorContext.Parser;
proto.spine.core.ActorContext.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.core.ActorContext();
if (obj.tenantId !== undefined) {
if (obj.tenantId === null) {
msg.setTenantId(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.core.TenantId').fromObject(obj.tenantId);
msg.setTenantId(value);
}
}
if (obj.actor !== undefined) {
if (obj.actor === null) {
msg.setActor(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.core.UserId').fromObject(obj.actor);
msg.setActor(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);
}
}
if (obj.zoneOffset !== undefined) {
if (obj.zoneOffset === null) {
msg.setZoneOffset(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.time.ZoneOffset').fromObject(obj.zoneOffset);
msg.setZoneOffset(value);
}
}
if (obj.zoneId !== undefined) {
if (obj.zoneId === null) {
msg.setZoneId(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.time.ZoneId').fromObject(obj.zoneId);
msg.setZoneId(value);
}
}
if (obj.language !== undefined) {
if (obj.language !== null) {
let value = proto.spine.ui.Language[obj.language];
msg.setLanguage(value);
}
}
return msg;
};
// Generated by Spine ProtoJs Plugin
proto.spine.core.ActorContext.typeUrl = function() {
return 'type.spine.io/spine.core.ActorContext';
};