ai-course/app/h5/public/js/SoftwareCommunicationMessage_pb.js
2025-11-18 13:32:46 +08:00

5765 lines
318 KiB
JavaScript

// Common aliases
var $Reader = protobuf.Reader, $Writer = protobuf.Writer, $util = protobuf.util;
// Exported root namespace
var $root = protobuf.roots["default"] || (protobuf.roots["default"] = {});
$root.xyz = (function() {
/**
* Namespace xyz.
* @exports xyz
* @namespace
*/
var xyz = {};
xyz.playedu = (function() {
/**
* Namespace playedu.
* @memberof xyz
* @namespace
*/
var playedu = {};
playedu.common = (function() {
/**
* Namespace common.
* @memberof xyz.playedu
* @namespace
*/
var common = {};
common.Message = (function() {
/**
* Namespace Message.
* @memberof xyz.playedu.common
* @namespace
*/
var Message = {};
/**
* MessageType enum.
* @name xyz.playedu.common.Message.MessageType
* @enum {number}
* @property {number} EmptyType=0 EmptyType value
* @property {number} EquipmentRegisterType=1 EquipmentRegisterType value
* @property {number} EquipmentAssignType=2 EquipmentAssignType value
* @property {number} StartExperimentType=3 StartExperimentType value
* @property {number} ExperimentDataType=4 ExperimentDataType value
* @property {number} EndExperimentType=5 EndExperimentType value
* @property {number} RequestAllValueType=6 RequestAllValueType value
* @property {number} PublishDeviceValueType=7 PublishDeviceValueType value
* @property {number} EquipmentHeartbeatType=8 EquipmentHeartbeatType value
* @property {number} EquipmentWarnType=9 EquipmentWarnType value
* @property {number} ServerStartViewType=10 ServerStartViewType value
* @property {number} ClientAllDataType=11 ClientAllDataType value
* @property {number} UserChangeType=12 UserChangeType value
* @property {number} MonitoringWarnType=13 MonitoringWarnType value
*/
Message.MessageType = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "EmptyType"] = 0;
values[valuesById[1] = "EquipmentRegisterType"] = 1;
values[valuesById[2] = "EquipmentAssignType"] = 2;
values[valuesById[3] = "StartExperimentType"] = 3;
values[valuesById[4] = "ExperimentDataType"] = 4;
values[valuesById[5] = "EndExperimentType"] = 5;
values[valuesById[6] = "RequestAllValueType"] = 6;
values[valuesById[7] = "PublishDeviceValueType"] = 7;
values[valuesById[8] = "EquipmentHeartbeatType"] = 8;
values[valuesById[9] = "EquipmentWarnType"] = 9;
values[valuesById[10] = "ServerStartViewType"] = 10;
values[valuesById[11] = "ClientAllDataType"] = 11;
values[valuesById[12] = "UserChangeType"] = 12;
values[valuesById[13] = "MonitoringWarnType"] = 13;
return values;
})();
Message.EquipmentRegister = (function() {
/**
* Properties of an EquipmentRegister.
* @memberof xyz.playedu.common.Message
* @interface IEquipmentRegister
* @property {string|null} [equId] EquipmentRegister equId
* @property {string|null} [equType] EquipmentRegister equType
*/
/**
* Constructs a new EquipmentRegister.
* @memberof xyz.playedu.common.Message
* @classdesc Represents an EquipmentRegister.
* @implements IEquipmentRegister
* @constructor
* @param {xyz.playedu.common.Message.IEquipmentRegister=} [properties] Properties to set
*/
function EquipmentRegister(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* EquipmentRegister equId.
* @member {string} equId
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @instance
*/
EquipmentRegister.prototype.equId = "";
/**
* EquipmentRegister equType.
* @member {string} equType
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @instance
*/
EquipmentRegister.prototype.equType = "";
/**
* Creates a new EquipmentRegister instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @static
* @param {xyz.playedu.common.Message.IEquipmentRegister=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.EquipmentRegister} EquipmentRegister instance
*/
EquipmentRegister.create = function create(properties) {
return new EquipmentRegister(properties);
};
/**
* Encodes the specified EquipmentRegister message. Does not implicitly {@link xyz.playedu.common.Message.EquipmentRegister.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @static
* @param {xyz.playedu.common.Message.IEquipmentRegister} message EquipmentRegister message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
EquipmentRegister.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.equId != null && Object.hasOwnProperty.call(message, "equId"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.equId);
if (message.equType != null && Object.hasOwnProperty.call(message, "equType"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.equType);
return writer;
};
/**
* Encodes the specified EquipmentRegister message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.EquipmentRegister.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @static
* @param {xyz.playedu.common.Message.IEquipmentRegister} message EquipmentRegister message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
EquipmentRegister.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an EquipmentRegister message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.EquipmentRegister} EquipmentRegister
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
EquipmentRegister.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.EquipmentRegister();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.equId = reader.string();
break;
}
case 2: {
message.equType = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an EquipmentRegister message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.EquipmentRegister} EquipmentRegister
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
EquipmentRegister.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an EquipmentRegister message.
* @function verify
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
EquipmentRegister.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.equId != null && message.hasOwnProperty("equId"))
if (!$util.isString(message.equId))
return "equId: string expected";
if (message.equType != null && message.hasOwnProperty("equType"))
if (!$util.isString(message.equType))
return "equType: string expected";
return null;
};
/**
* Creates an EquipmentRegister message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.EquipmentRegister} EquipmentRegister
*/
EquipmentRegister.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.EquipmentRegister)
return object;
var message = new $root.xyz.playedu.common.Message.EquipmentRegister();
if (object.equId != null)
message.equId = String(object.equId);
if (object.equType != null)
message.equType = String(object.equType);
return message;
};
/**
* Creates a plain object from an EquipmentRegister message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @static
* @param {xyz.playedu.common.Message.EquipmentRegister} message EquipmentRegister
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
EquipmentRegister.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.equId = "";
object.equType = "";
}
if (message.equId != null && message.hasOwnProperty("equId"))
object.equId = message.equId;
if (message.equType != null && message.hasOwnProperty("equType"))
object.equType = message.equType;
return object;
};
/**
* Converts this EquipmentRegister to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @instance
* @returns {Object.<string,*>} JSON object
*/
EquipmentRegister.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for EquipmentRegister
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.EquipmentRegister
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
EquipmentRegister.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.EquipmentRegister";
};
return EquipmentRegister;
})();
Message.EquipmentAssign = (function() {
/**
* Properties of an EquipmentAssign.
* @memberof xyz.playedu.common.Message
* @interface IEquipmentAssign
* @property {string|null} [equId] EquipmentAssign equId
* @property {string|null} [tenantId] EquipmentAssign tenantId
* @property {number|null} [courseId] EquipmentAssign courseId
* @property {string|null} [loginUrl] EquipmentAssign loginUrl
* @property {boolean|null} [isAssign] EquipmentAssign isAssign
* @property {string|null} [isExam] EquipmentAssign isExam
* @property {string|null} [videoAnalysisIp] EquipmentAssign videoAnalysisIp
*/
/**
* Constructs a new EquipmentAssign.
* @memberof xyz.playedu.common.Message
* @classdesc Represents an EquipmentAssign.
* @implements IEquipmentAssign
* @constructor
* @param {xyz.playedu.common.Message.IEquipmentAssign=} [properties] Properties to set
*/
function EquipmentAssign(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* EquipmentAssign equId.
* @member {string} equId
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @instance
*/
EquipmentAssign.prototype.equId = "";
/**
* EquipmentAssign tenantId.
* @member {string} tenantId
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @instance
*/
EquipmentAssign.prototype.tenantId = "";
/**
* EquipmentAssign courseId.
* @member {number} courseId
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @instance
*/
EquipmentAssign.prototype.courseId = 0;
/**
* EquipmentAssign loginUrl.
* @member {string} loginUrl
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @instance
*/
EquipmentAssign.prototype.loginUrl = "";
/**
* EquipmentAssign isAssign.
* @member {boolean} isAssign
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @instance
*/
EquipmentAssign.prototype.isAssign = false;
/**
* EquipmentAssign isExam.
* @member {string} isExam
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @instance
*/
EquipmentAssign.prototype.isExam = "";
/**
* EquipmentAssign videoAnalysisIp.
* @member {string} videoAnalysisIp
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @instance
*/
EquipmentAssign.prototype.videoAnalysisIp = "";
/**
* Creates a new EquipmentAssign instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @static
* @param {xyz.playedu.common.Message.IEquipmentAssign=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.EquipmentAssign} EquipmentAssign instance
*/
EquipmentAssign.create = function create(properties) {
return new EquipmentAssign(properties);
};
/**
* Encodes the specified EquipmentAssign message. Does not implicitly {@link xyz.playedu.common.Message.EquipmentAssign.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @static
* @param {xyz.playedu.common.Message.IEquipmentAssign} message EquipmentAssign message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
EquipmentAssign.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.equId != null && Object.hasOwnProperty.call(message, "equId"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.equId);
if (message.tenantId != null && Object.hasOwnProperty.call(message, "tenantId"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.tenantId);
if (message.courseId != null && Object.hasOwnProperty.call(message, "courseId"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.courseId);
if (message.loginUrl != null && Object.hasOwnProperty.call(message, "loginUrl"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.loginUrl);
if (message.isAssign != null && Object.hasOwnProperty.call(message, "isAssign"))
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isAssign);
if (message.isExam != null && Object.hasOwnProperty.call(message, "isExam"))
writer.uint32(/* id 6, wireType 2 =*/50).string(message.isExam);
if (message.videoAnalysisIp != null && Object.hasOwnProperty.call(message, "videoAnalysisIp"))
writer.uint32(/* id 7, wireType 2 =*/58).string(message.videoAnalysisIp);
return writer;
};
/**
* Encodes the specified EquipmentAssign message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.EquipmentAssign.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @static
* @param {xyz.playedu.common.Message.IEquipmentAssign} message EquipmentAssign message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
EquipmentAssign.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an EquipmentAssign message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.EquipmentAssign} EquipmentAssign
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
EquipmentAssign.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.EquipmentAssign();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.equId = reader.string();
break;
}
case 2: {
message.tenantId = reader.string();
break;
}
case 3: {
message.courseId = reader.int32();
break;
}
case 4: {
message.loginUrl = reader.string();
break;
}
case 5: {
message.isAssign = reader.bool();
break;
}
case 6: {
message.isExam = reader.string();
break;
}
case 7: {
message.videoAnalysisIp = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an EquipmentAssign message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.EquipmentAssign} EquipmentAssign
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
EquipmentAssign.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an EquipmentAssign message.
* @function verify
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
EquipmentAssign.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.equId != null && message.hasOwnProperty("equId"))
if (!$util.isString(message.equId))
return "equId: string expected";
if (message.tenantId != null && message.hasOwnProperty("tenantId"))
if (!$util.isString(message.tenantId))
return "tenantId: string expected";
if (message.courseId != null && message.hasOwnProperty("courseId"))
if (!$util.isInteger(message.courseId))
return "courseId: integer expected";
if (message.loginUrl != null && message.hasOwnProperty("loginUrl"))
if (!$util.isString(message.loginUrl))
return "loginUrl: string expected";
if (message.isAssign != null && message.hasOwnProperty("isAssign"))
if (typeof message.isAssign !== "boolean")
return "isAssign: boolean expected";
if (message.isExam != null && message.hasOwnProperty("isExam"))
if (!$util.isString(message.isExam))
return "isExam: string expected";
if (message.videoAnalysisIp != null && message.hasOwnProperty("videoAnalysisIp"))
if (!$util.isString(message.videoAnalysisIp))
return "videoAnalysisIp: string expected";
return null;
};
/**
* Creates an EquipmentAssign message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.EquipmentAssign} EquipmentAssign
*/
EquipmentAssign.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.EquipmentAssign)
return object;
var message = new $root.xyz.playedu.common.Message.EquipmentAssign();
if (object.equId != null)
message.equId = String(object.equId);
if (object.tenantId != null)
message.tenantId = String(object.tenantId);
if (object.courseId != null)
message.courseId = object.courseId | 0;
if (object.loginUrl != null)
message.loginUrl = String(object.loginUrl);
if (object.isAssign != null)
message.isAssign = Boolean(object.isAssign);
if (object.isExam != null)
message.isExam = String(object.isExam);
if (object.videoAnalysisIp != null)
message.videoAnalysisIp = String(object.videoAnalysisIp);
return message;
};
/**
* Creates a plain object from an EquipmentAssign message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @static
* @param {xyz.playedu.common.Message.EquipmentAssign} message EquipmentAssign
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
EquipmentAssign.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.equId = "";
object.tenantId = "";
object.courseId = 0;
object.loginUrl = "";
object.isAssign = false;
object.isExam = "";
object.videoAnalysisIp = "";
}
if (message.equId != null && message.hasOwnProperty("equId"))
object.equId = message.equId;
if (message.tenantId != null && message.hasOwnProperty("tenantId"))
object.tenantId = message.tenantId;
if (message.courseId != null && message.hasOwnProperty("courseId"))
object.courseId = message.courseId;
if (message.loginUrl != null && message.hasOwnProperty("loginUrl"))
object.loginUrl = message.loginUrl;
if (message.isAssign != null && message.hasOwnProperty("isAssign"))
object.isAssign = message.isAssign;
if (message.isExam != null && message.hasOwnProperty("isExam"))
object.isExam = message.isExam;
if (message.videoAnalysisIp != null && message.hasOwnProperty("videoAnalysisIp"))
object.videoAnalysisIp = message.videoAnalysisIp;
return object;
};
/**
* Converts this EquipmentAssign to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @instance
* @returns {Object.<string,*>} JSON object
*/
EquipmentAssign.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for EquipmentAssign
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.EquipmentAssign
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
EquipmentAssign.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.EquipmentAssign";
};
return EquipmentAssign;
})();
Message.StartExperiment = (function() {
/**
* Properties of a StartExperiment.
* @memberof xyz.playedu.common.Message
* @interface IStartExperiment
* @property {string|null} [equId] StartExperiment equId
* @property {string|null} [recordCode] StartExperiment recordCode
* @property {string|null} [userIds] StartExperiment userIds
*/
/**
* Constructs a new StartExperiment.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a StartExperiment.
* @implements IStartExperiment
* @constructor
* @param {xyz.playedu.common.Message.IStartExperiment=} [properties] Properties to set
*/
function StartExperiment(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* StartExperiment equId.
* @member {string} equId
* @memberof xyz.playedu.common.Message.StartExperiment
* @instance
*/
StartExperiment.prototype.equId = "";
/**
* StartExperiment recordCode.
* @member {string} recordCode
* @memberof xyz.playedu.common.Message.StartExperiment
* @instance
*/
StartExperiment.prototype.recordCode = "";
/**
* StartExperiment userIds.
* @member {string} userIds
* @memberof xyz.playedu.common.Message.StartExperiment
* @instance
*/
StartExperiment.prototype.userIds = "";
/**
* Creates a new StartExperiment instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.StartExperiment
* @static
* @param {xyz.playedu.common.Message.IStartExperiment=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.StartExperiment} StartExperiment instance
*/
StartExperiment.create = function create(properties) {
return new StartExperiment(properties);
};
/**
* Encodes the specified StartExperiment message. Does not implicitly {@link xyz.playedu.common.Message.StartExperiment.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.StartExperiment
* @static
* @param {xyz.playedu.common.Message.IStartExperiment} message StartExperiment message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
StartExperiment.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.equId != null && Object.hasOwnProperty.call(message, "equId"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.equId);
if (message.recordCode != null && Object.hasOwnProperty.call(message, "recordCode"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordCode);
if (message.userIds != null && Object.hasOwnProperty.call(message, "userIds"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.userIds);
return writer;
};
/**
* Encodes the specified StartExperiment message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.StartExperiment.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.StartExperiment
* @static
* @param {xyz.playedu.common.Message.IStartExperiment} message StartExperiment message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
StartExperiment.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a StartExperiment message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.StartExperiment
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.StartExperiment} StartExperiment
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
StartExperiment.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.StartExperiment();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.equId = reader.string();
break;
}
case 2: {
message.recordCode = reader.string();
break;
}
case 3: {
message.userIds = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a StartExperiment message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.StartExperiment
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.StartExperiment} StartExperiment
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
StartExperiment.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a StartExperiment message.
* @function verify
* @memberof xyz.playedu.common.Message.StartExperiment
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
StartExperiment.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.equId != null && message.hasOwnProperty("equId"))
if (!$util.isString(message.equId))
return "equId: string expected";
if (message.recordCode != null && message.hasOwnProperty("recordCode"))
if (!$util.isString(message.recordCode))
return "recordCode: string expected";
if (message.userIds != null && message.hasOwnProperty("userIds"))
if (!$util.isString(message.userIds))
return "userIds: string expected";
return null;
};
/**
* Creates a StartExperiment message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.StartExperiment
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.StartExperiment} StartExperiment
*/
StartExperiment.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.StartExperiment)
return object;
var message = new $root.xyz.playedu.common.Message.StartExperiment();
if (object.equId != null)
message.equId = String(object.equId);
if (object.recordCode != null)
message.recordCode = String(object.recordCode);
if (object.userIds != null)
message.userIds = String(object.userIds);
return message;
};
/**
* Creates a plain object from a StartExperiment message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.StartExperiment
* @static
* @param {xyz.playedu.common.Message.StartExperiment} message StartExperiment
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
StartExperiment.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.equId = "";
object.recordCode = "";
object.userIds = "";
}
if (message.equId != null && message.hasOwnProperty("equId"))
object.equId = message.equId;
if (message.recordCode != null && message.hasOwnProperty("recordCode"))
object.recordCode = message.recordCode;
if (message.userIds != null && message.hasOwnProperty("userIds"))
object.userIds = message.userIds;
return object;
};
/**
* Converts this StartExperiment to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.StartExperiment
* @instance
* @returns {Object.<string,*>} JSON object
*/
StartExperiment.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for StartExperiment
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.StartExperiment
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
StartExperiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.StartExperiment";
};
return StartExperiment;
})();
Message.ExperimentDataList = (function() {
/**
* Properties of an ExperimentDataList.
* @memberof xyz.playedu.common.Message
* @interface IExperimentDataList
* @property {number|null} [commonOperationScore] ExperimentDataList commonOperationScore
* @property {number|null} [qualityOperationScore] ExperimentDataList qualityOperationScore
* @property {number|null} [operationScore] ExperimentDataList operationScore
* @property {number|null} [kScore] ExperimentDataList kScore
* @property {number|null} [kAllScore] ExperimentDataList kAllScore
* @property {number|null} [commonOperationAllScore] ExperimentDataList commonOperationAllScore
* @property {number|null} [qualityOperationAllScore] ExperimentDataList qualityOperationAllScore
* @property {number|null} [operationAllScore] ExperimentDataList operationAllScore
* @property {string|null} [recordCode] ExperimentDataList recordCode
* @property {Array.<xyz.playedu.common.Message.IExperimentData>|null} [experimentData] ExperimentDataList experimentData
*/
/**
* Constructs a new ExperimentDataList.
* @memberof xyz.playedu.common.Message
* @classdesc Represents an ExperimentDataList.
* @implements IExperimentDataList
* @constructor
* @param {xyz.playedu.common.Message.IExperimentDataList=} [properties] Properties to set
*/
function ExperimentDataList(properties) {
this.experimentData = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ExperimentDataList commonOperationScore.
* @member {number} commonOperationScore
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @instance
*/
ExperimentDataList.prototype.commonOperationScore = 0;
/**
* ExperimentDataList qualityOperationScore.
* @member {number} qualityOperationScore
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @instance
*/
ExperimentDataList.prototype.qualityOperationScore = 0;
/**
* ExperimentDataList operationScore.
* @member {number} operationScore
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @instance
*/
ExperimentDataList.prototype.operationScore = 0;
/**
* ExperimentDataList kScore.
* @member {number} kScore
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @instance
*/
ExperimentDataList.prototype.kScore = 0;
/**
* ExperimentDataList kAllScore.
* @member {number} kAllScore
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @instance
*/
ExperimentDataList.prototype.kAllScore = 0;
/**
* ExperimentDataList commonOperationAllScore.
* @member {number} commonOperationAllScore
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @instance
*/
ExperimentDataList.prototype.commonOperationAllScore = 0;
/**
* ExperimentDataList qualityOperationAllScore.
* @member {number} qualityOperationAllScore
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @instance
*/
ExperimentDataList.prototype.qualityOperationAllScore = 0;
/**
* ExperimentDataList operationAllScore.
* @member {number} operationAllScore
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @instance
*/
ExperimentDataList.prototype.operationAllScore = 0;
/**
* ExperimentDataList recordCode.
* @member {string} recordCode
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @instance
*/
ExperimentDataList.prototype.recordCode = "";
/**
* ExperimentDataList experimentData.
* @member {Array.<xyz.playedu.common.Message.IExperimentData>} experimentData
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @instance
*/
ExperimentDataList.prototype.experimentData = $util.emptyArray;
/**
* Creates a new ExperimentDataList instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @static
* @param {xyz.playedu.common.Message.IExperimentDataList=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.ExperimentDataList} ExperimentDataList instance
*/
ExperimentDataList.create = function create(properties) {
return new ExperimentDataList(properties);
};
/**
* Encodes the specified ExperimentDataList message. Does not implicitly {@link xyz.playedu.common.Message.ExperimentDataList.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @static
* @param {xyz.playedu.common.Message.IExperimentDataList} message ExperimentDataList message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ExperimentDataList.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.commonOperationScore != null && Object.hasOwnProperty.call(message, "commonOperationScore"))
writer.uint32(/* id 1, wireType 1 =*/9).double(message.commonOperationScore);
if (message.qualityOperationScore != null && Object.hasOwnProperty.call(message, "qualityOperationScore"))
writer.uint32(/* id 2, wireType 1 =*/17).double(message.qualityOperationScore);
if (message.operationScore != null && Object.hasOwnProperty.call(message, "operationScore"))
writer.uint32(/* id 3, wireType 1 =*/25).double(message.operationScore);
if (message.kScore != null && Object.hasOwnProperty.call(message, "kScore"))
writer.uint32(/* id 4, wireType 1 =*/33).double(message.kScore);
if (message.kAllScore != null && Object.hasOwnProperty.call(message, "kAllScore"))
writer.uint32(/* id 5, wireType 1 =*/41).double(message.kAllScore);
if (message.commonOperationAllScore != null && Object.hasOwnProperty.call(message, "commonOperationAllScore"))
writer.uint32(/* id 6, wireType 1 =*/49).double(message.commonOperationAllScore);
if (message.qualityOperationAllScore != null && Object.hasOwnProperty.call(message, "qualityOperationAllScore"))
writer.uint32(/* id 7, wireType 1 =*/57).double(message.qualityOperationAllScore);
if (message.operationAllScore != null && Object.hasOwnProperty.call(message, "operationAllScore"))
writer.uint32(/* id 8, wireType 1 =*/65).double(message.operationAllScore);
if (message.recordCode != null && Object.hasOwnProperty.call(message, "recordCode"))
writer.uint32(/* id 9, wireType 2 =*/74).string(message.recordCode);
if (message.experimentData != null && message.experimentData.length)
for (var i = 0; i < message.experimentData.length; ++i)
$root.xyz.playedu.common.Message.ExperimentData.encode(message.experimentData[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ExperimentDataList message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.ExperimentDataList.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @static
* @param {xyz.playedu.common.Message.IExperimentDataList} message ExperimentDataList message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ExperimentDataList.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an ExperimentDataList message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.ExperimentDataList} ExperimentDataList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ExperimentDataList.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.ExperimentDataList();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.commonOperationScore = reader.double();
break;
}
case 2: {
message.qualityOperationScore = reader.double();
break;
}
case 3: {
message.operationScore = reader.double();
break;
}
case 4: {
message.kScore = reader.double();
break;
}
case 5: {
message.kAllScore = reader.double();
break;
}
case 6: {
message.commonOperationAllScore = reader.double();
break;
}
case 7: {
message.qualityOperationAllScore = reader.double();
break;
}
case 8: {
message.operationAllScore = reader.double();
break;
}
case 9: {
message.recordCode = reader.string();
break;
}
case 10: {
if (!(message.experimentData && message.experimentData.length))
message.experimentData = [];
message.experimentData.push($root.xyz.playedu.common.Message.ExperimentData.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an ExperimentDataList message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.ExperimentDataList} ExperimentDataList
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ExperimentDataList.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an ExperimentDataList message.
* @function verify
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ExperimentDataList.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.commonOperationScore != null && message.hasOwnProperty("commonOperationScore"))
if (typeof message.commonOperationScore !== "number")
return "commonOperationScore: number expected";
if (message.qualityOperationScore != null && message.hasOwnProperty("qualityOperationScore"))
if (typeof message.qualityOperationScore !== "number")
return "qualityOperationScore: number expected";
if (message.operationScore != null && message.hasOwnProperty("operationScore"))
if (typeof message.operationScore !== "number")
return "operationScore: number expected";
if (message.kScore != null && message.hasOwnProperty("kScore"))
if (typeof message.kScore !== "number")
return "kScore: number expected";
if (message.kAllScore != null && message.hasOwnProperty("kAllScore"))
if (typeof message.kAllScore !== "number")
return "kAllScore: number expected";
if (message.commonOperationAllScore != null && message.hasOwnProperty("commonOperationAllScore"))
if (typeof message.commonOperationAllScore !== "number")
return "commonOperationAllScore: number expected";
if (message.qualityOperationAllScore != null && message.hasOwnProperty("qualityOperationAllScore"))
if (typeof message.qualityOperationAllScore !== "number")
return "qualityOperationAllScore: number expected";
if (message.operationAllScore != null && message.hasOwnProperty("operationAllScore"))
if (typeof message.operationAllScore !== "number")
return "operationAllScore: number expected";
if (message.recordCode != null && message.hasOwnProperty("recordCode"))
if (!$util.isString(message.recordCode))
return "recordCode: string expected";
if (message.experimentData != null && message.hasOwnProperty("experimentData")) {
if (!Array.isArray(message.experimentData))
return "experimentData: array expected";
for (var i = 0; i < message.experimentData.length; ++i) {
var error = $root.xyz.playedu.common.Message.ExperimentData.verify(message.experimentData[i]);
if (error)
return "experimentData." + error;
}
}
return null;
};
/**
* Creates an ExperimentDataList message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.ExperimentDataList} ExperimentDataList
*/
ExperimentDataList.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.ExperimentDataList)
return object;
var message = new $root.xyz.playedu.common.Message.ExperimentDataList();
if (object.commonOperationScore != null)
message.commonOperationScore = Number(object.commonOperationScore);
if (object.qualityOperationScore != null)
message.qualityOperationScore = Number(object.qualityOperationScore);
if (object.operationScore != null)
message.operationScore = Number(object.operationScore);
if (object.kScore != null)
message.kScore = Number(object.kScore);
if (object.kAllScore != null)
message.kAllScore = Number(object.kAllScore);
if (object.commonOperationAllScore != null)
message.commonOperationAllScore = Number(object.commonOperationAllScore);
if (object.qualityOperationAllScore != null)
message.qualityOperationAllScore = Number(object.qualityOperationAllScore);
if (object.operationAllScore != null)
message.operationAllScore = Number(object.operationAllScore);
if (object.recordCode != null)
message.recordCode = String(object.recordCode);
if (object.experimentData) {
if (!Array.isArray(object.experimentData))
throw TypeError(".xyz.playedu.common.Message.ExperimentDataList.experimentData: array expected");
message.experimentData = [];
for (var i = 0; i < object.experimentData.length; ++i) {
if (typeof object.experimentData[i] !== "object")
throw TypeError(".xyz.playedu.common.Message.ExperimentDataList.experimentData: object expected");
message.experimentData[i] = $root.xyz.playedu.common.Message.ExperimentData.fromObject(object.experimentData[i]);
}
}
return message;
};
/**
* Creates a plain object from an ExperimentDataList message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @static
* @param {xyz.playedu.common.Message.ExperimentDataList} message ExperimentDataList
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ExperimentDataList.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.experimentData = [];
if (options.defaults) {
object.commonOperationScore = 0;
object.qualityOperationScore = 0;
object.operationScore = 0;
object.kScore = 0;
object.kAllScore = 0;
object.commonOperationAllScore = 0;
object.qualityOperationAllScore = 0;
object.operationAllScore = 0;
object.recordCode = "";
}
if (message.commonOperationScore != null && message.hasOwnProperty("commonOperationScore"))
object.commonOperationScore = options.json && !isFinite(message.commonOperationScore) ? String(message.commonOperationScore) : message.commonOperationScore;
if (message.qualityOperationScore != null && message.hasOwnProperty("qualityOperationScore"))
object.qualityOperationScore = options.json && !isFinite(message.qualityOperationScore) ? String(message.qualityOperationScore) : message.qualityOperationScore;
if (message.operationScore != null && message.hasOwnProperty("operationScore"))
object.operationScore = options.json && !isFinite(message.operationScore) ? String(message.operationScore) : message.operationScore;
if (message.kScore != null && message.hasOwnProperty("kScore"))
object.kScore = options.json && !isFinite(message.kScore) ? String(message.kScore) : message.kScore;
if (message.kAllScore != null && message.hasOwnProperty("kAllScore"))
object.kAllScore = options.json && !isFinite(message.kAllScore) ? String(message.kAllScore) : message.kAllScore;
if (message.commonOperationAllScore != null && message.hasOwnProperty("commonOperationAllScore"))
object.commonOperationAllScore = options.json && !isFinite(message.commonOperationAllScore) ? String(message.commonOperationAllScore) : message.commonOperationAllScore;
if (message.qualityOperationAllScore != null && message.hasOwnProperty("qualityOperationAllScore"))
object.qualityOperationAllScore = options.json && !isFinite(message.qualityOperationAllScore) ? String(message.qualityOperationAllScore) : message.qualityOperationAllScore;
if (message.operationAllScore != null && message.hasOwnProperty("operationAllScore"))
object.operationAllScore = options.json && !isFinite(message.operationAllScore) ? String(message.operationAllScore) : message.operationAllScore;
if (message.recordCode != null && message.hasOwnProperty("recordCode"))
object.recordCode = message.recordCode;
if (message.experimentData && message.experimentData.length) {
object.experimentData = [];
for (var j = 0; j < message.experimentData.length; ++j)
object.experimentData[j] = $root.xyz.playedu.common.Message.ExperimentData.toObject(message.experimentData[j], options);
}
return object;
};
/**
* Converts this ExperimentDataList to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @instance
* @returns {Object.<string,*>} JSON object
*/
ExperimentDataList.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ExperimentDataList
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.ExperimentDataList
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ExperimentDataList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.ExperimentDataList";
};
return ExperimentDataList;
})();
Message.ExperimentData = (function() {
/**
* Properties of an ExperimentData.
* @memberof xyz.playedu.common.Message
* @interface IExperimentData
* @property {string|null} [stepName] ExperimentData stepName
* @property {number|null} [commonOperationScore] ExperimentData commonOperationScore
* @property {number|null} [qualityOperationScore] ExperimentData qualityOperationScore
* @property {number|null} [kScore] ExperimentData kScore
* @property {Array.<xyz.playedu.common.Message.IStepDetail>|null} [stepDetail] ExperimentData stepDetail
*/
/**
* Constructs a new ExperimentData.
* @memberof xyz.playedu.common.Message
* @classdesc Represents an ExperimentData.
* @implements IExperimentData
* @constructor
* @param {xyz.playedu.common.Message.IExperimentData=} [properties] Properties to set
*/
function ExperimentData(properties) {
this.stepDetail = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ExperimentData stepName.
* @member {string} stepName
* @memberof xyz.playedu.common.Message.ExperimentData
* @instance
*/
ExperimentData.prototype.stepName = "";
/**
* ExperimentData commonOperationScore.
* @member {number} commonOperationScore
* @memberof xyz.playedu.common.Message.ExperimentData
* @instance
*/
ExperimentData.prototype.commonOperationScore = 0;
/**
* ExperimentData qualityOperationScore.
* @member {number} qualityOperationScore
* @memberof xyz.playedu.common.Message.ExperimentData
* @instance
*/
ExperimentData.prototype.qualityOperationScore = 0;
/**
* ExperimentData kScore.
* @member {number} kScore
* @memberof xyz.playedu.common.Message.ExperimentData
* @instance
*/
ExperimentData.prototype.kScore = 0;
/**
* ExperimentData stepDetail.
* @member {Array.<xyz.playedu.common.Message.IStepDetail>} stepDetail
* @memberof xyz.playedu.common.Message.ExperimentData
* @instance
*/
ExperimentData.prototype.stepDetail = $util.emptyArray;
/**
* Creates a new ExperimentData instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.ExperimentData
* @static
* @param {xyz.playedu.common.Message.IExperimentData=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.ExperimentData} ExperimentData instance
*/
ExperimentData.create = function create(properties) {
return new ExperimentData(properties);
};
/**
* Encodes the specified ExperimentData message. Does not implicitly {@link xyz.playedu.common.Message.ExperimentData.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.ExperimentData
* @static
* @param {xyz.playedu.common.Message.IExperimentData} message ExperimentData message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ExperimentData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.stepName != null && Object.hasOwnProperty.call(message, "stepName"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.stepName);
if (message.commonOperationScore != null && Object.hasOwnProperty.call(message, "commonOperationScore"))
writer.uint32(/* id 2, wireType 1 =*/17).double(message.commonOperationScore);
if (message.qualityOperationScore != null && Object.hasOwnProperty.call(message, "qualityOperationScore"))
writer.uint32(/* id 3, wireType 1 =*/25).double(message.qualityOperationScore);
if (message.kScore != null && Object.hasOwnProperty.call(message, "kScore"))
writer.uint32(/* id 4, wireType 1 =*/33).double(message.kScore);
if (message.stepDetail != null && message.stepDetail.length)
for (var i = 0; i < message.stepDetail.length; ++i)
$root.xyz.playedu.common.Message.StepDetail.encode(message.stepDetail[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ExperimentData message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.ExperimentData.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.ExperimentData
* @static
* @param {xyz.playedu.common.Message.IExperimentData} message ExperimentData message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ExperimentData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an ExperimentData message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.ExperimentData
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.ExperimentData} ExperimentData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ExperimentData.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.ExperimentData();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.stepName = reader.string();
break;
}
case 2: {
message.commonOperationScore = reader.double();
break;
}
case 3: {
message.qualityOperationScore = reader.double();
break;
}
case 4: {
message.kScore = reader.double();
break;
}
case 5: {
if (!(message.stepDetail && message.stepDetail.length))
message.stepDetail = [];
message.stepDetail.push($root.xyz.playedu.common.Message.StepDetail.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an ExperimentData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.ExperimentData
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.ExperimentData} ExperimentData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ExperimentData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an ExperimentData message.
* @function verify
* @memberof xyz.playedu.common.Message.ExperimentData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ExperimentData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.stepName != null && message.hasOwnProperty("stepName"))
if (!$util.isString(message.stepName))
return "stepName: string expected";
if (message.commonOperationScore != null && message.hasOwnProperty("commonOperationScore"))
if (typeof message.commonOperationScore !== "number")
return "commonOperationScore: number expected";
if (message.qualityOperationScore != null && message.hasOwnProperty("qualityOperationScore"))
if (typeof message.qualityOperationScore !== "number")
return "qualityOperationScore: number expected";
if (message.kScore != null && message.hasOwnProperty("kScore"))
if (typeof message.kScore !== "number")
return "kScore: number expected";
if (message.stepDetail != null && message.hasOwnProperty("stepDetail")) {
if (!Array.isArray(message.stepDetail))
return "stepDetail: array expected";
for (var i = 0; i < message.stepDetail.length; ++i) {
var error = $root.xyz.playedu.common.Message.StepDetail.verify(message.stepDetail[i]);
if (error)
return "stepDetail." + error;
}
}
return null;
};
/**
* Creates an ExperimentData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.ExperimentData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.ExperimentData} ExperimentData
*/
ExperimentData.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.ExperimentData)
return object;
var message = new $root.xyz.playedu.common.Message.ExperimentData();
if (object.stepName != null)
message.stepName = String(object.stepName);
if (object.commonOperationScore != null)
message.commonOperationScore = Number(object.commonOperationScore);
if (object.qualityOperationScore != null)
message.qualityOperationScore = Number(object.qualityOperationScore);
if (object.kScore != null)
message.kScore = Number(object.kScore);
if (object.stepDetail) {
if (!Array.isArray(object.stepDetail))
throw TypeError(".xyz.playedu.common.Message.ExperimentData.stepDetail: array expected");
message.stepDetail = [];
for (var i = 0; i < object.stepDetail.length; ++i) {
if (typeof object.stepDetail[i] !== "object")
throw TypeError(".xyz.playedu.common.Message.ExperimentData.stepDetail: object expected");
message.stepDetail[i] = $root.xyz.playedu.common.Message.StepDetail.fromObject(object.stepDetail[i]);
}
}
return message;
};
/**
* Creates a plain object from an ExperimentData message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.ExperimentData
* @static
* @param {xyz.playedu.common.Message.ExperimentData} message ExperimentData
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ExperimentData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.stepDetail = [];
if (options.defaults) {
object.stepName = "";
object.commonOperationScore = 0;
object.qualityOperationScore = 0;
object.kScore = 0;
}
if (message.stepName != null && message.hasOwnProperty("stepName"))
object.stepName = message.stepName;
if (message.commonOperationScore != null && message.hasOwnProperty("commonOperationScore"))
object.commonOperationScore = options.json && !isFinite(message.commonOperationScore) ? String(message.commonOperationScore) : message.commonOperationScore;
if (message.qualityOperationScore != null && message.hasOwnProperty("qualityOperationScore"))
object.qualityOperationScore = options.json && !isFinite(message.qualityOperationScore) ? String(message.qualityOperationScore) : message.qualityOperationScore;
if (message.kScore != null && message.hasOwnProperty("kScore"))
object.kScore = options.json && !isFinite(message.kScore) ? String(message.kScore) : message.kScore;
if (message.stepDetail && message.stepDetail.length) {
object.stepDetail = [];
for (var j = 0; j < message.stepDetail.length; ++j)
object.stepDetail[j] = $root.xyz.playedu.common.Message.StepDetail.toObject(message.stepDetail[j], options);
}
return object;
};
/**
* Converts this ExperimentData to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.ExperimentData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ExperimentData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ExperimentData
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.ExperimentData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ExperimentData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.ExperimentData";
};
return ExperimentData;
})();
Message.StepDetail = (function() {
/**
* Properties of a StepDetail.
* @memberof xyz.playedu.common.Message
* @interface IStepDetail
* @property {string|null} [stepInfo] StepDetail stepInfo
* @property {string|null} [stepType] StepDetail stepType
* @property {number|null} [stepScore] StepDetail stepScore
* @property {number|null} [realScore] StepDetail realScore
*/
/**
* Constructs a new StepDetail.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a StepDetail.
* @implements IStepDetail
* @constructor
* @param {xyz.playedu.common.Message.IStepDetail=} [properties] Properties to set
*/
function StepDetail(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* StepDetail stepInfo.
* @member {string} stepInfo
* @memberof xyz.playedu.common.Message.StepDetail
* @instance
*/
StepDetail.prototype.stepInfo = "";
/**
* StepDetail stepType.
* @member {string} stepType
* @memberof xyz.playedu.common.Message.StepDetail
* @instance
*/
StepDetail.prototype.stepType = "";
/**
* StepDetail stepScore.
* @member {number} stepScore
* @memberof xyz.playedu.common.Message.StepDetail
* @instance
*/
StepDetail.prototype.stepScore = 0;
/**
* StepDetail realScore.
* @member {number} realScore
* @memberof xyz.playedu.common.Message.StepDetail
* @instance
*/
StepDetail.prototype.realScore = 0;
/**
* Creates a new StepDetail instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.StepDetail
* @static
* @param {xyz.playedu.common.Message.IStepDetail=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.StepDetail} StepDetail instance
*/
StepDetail.create = function create(properties) {
return new StepDetail(properties);
};
/**
* Encodes the specified StepDetail message. Does not implicitly {@link xyz.playedu.common.Message.StepDetail.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.StepDetail
* @static
* @param {xyz.playedu.common.Message.IStepDetail} message StepDetail message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
StepDetail.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.stepInfo != null && Object.hasOwnProperty.call(message, "stepInfo"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.stepInfo);
if (message.stepType != null && Object.hasOwnProperty.call(message, "stepType"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.stepType);
if (message.stepScore != null && Object.hasOwnProperty.call(message, "stepScore"))
writer.uint32(/* id 3, wireType 1 =*/25).double(message.stepScore);
if (message.realScore != null && Object.hasOwnProperty.call(message, "realScore"))
writer.uint32(/* id 4, wireType 1 =*/33).double(message.realScore);
return writer;
};
/**
* Encodes the specified StepDetail message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.StepDetail.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.StepDetail
* @static
* @param {xyz.playedu.common.Message.IStepDetail} message StepDetail message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
StepDetail.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a StepDetail message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.StepDetail
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.StepDetail} StepDetail
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
StepDetail.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.StepDetail();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.stepInfo = reader.string();
break;
}
case 2: {
message.stepType = reader.string();
break;
}
case 3: {
message.stepScore = reader.double();
break;
}
case 4: {
message.realScore = reader.double();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a StepDetail message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.StepDetail
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.StepDetail} StepDetail
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
StepDetail.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a StepDetail message.
* @function verify
* @memberof xyz.playedu.common.Message.StepDetail
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
StepDetail.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.stepInfo != null && message.hasOwnProperty("stepInfo"))
if (!$util.isString(message.stepInfo))
return "stepInfo: string expected";
if (message.stepType != null && message.hasOwnProperty("stepType"))
if (!$util.isString(message.stepType))
return "stepType: string expected";
if (message.stepScore != null && message.hasOwnProperty("stepScore"))
if (typeof message.stepScore !== "number")
return "stepScore: number expected";
if (message.realScore != null && message.hasOwnProperty("realScore"))
if (typeof message.realScore !== "number")
return "realScore: number expected";
return null;
};
/**
* Creates a StepDetail message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.StepDetail
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.StepDetail} StepDetail
*/
StepDetail.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.StepDetail)
return object;
var message = new $root.xyz.playedu.common.Message.StepDetail();
if (object.stepInfo != null)
message.stepInfo = String(object.stepInfo);
if (object.stepType != null)
message.stepType = String(object.stepType);
if (object.stepScore != null)
message.stepScore = Number(object.stepScore);
if (object.realScore != null)
message.realScore = Number(object.realScore);
return message;
};
/**
* Creates a plain object from a StepDetail message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.StepDetail
* @static
* @param {xyz.playedu.common.Message.StepDetail} message StepDetail
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
StepDetail.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.stepInfo = "";
object.stepType = "";
object.stepScore = 0;
object.realScore = 0;
}
if (message.stepInfo != null && message.hasOwnProperty("stepInfo"))
object.stepInfo = message.stepInfo;
if (message.stepType != null && message.hasOwnProperty("stepType"))
object.stepType = message.stepType;
if (message.stepScore != null && message.hasOwnProperty("stepScore"))
object.stepScore = options.json && !isFinite(message.stepScore) ? String(message.stepScore) : message.stepScore;
if (message.realScore != null && message.hasOwnProperty("realScore"))
object.realScore = options.json && !isFinite(message.realScore) ? String(message.realScore) : message.realScore;
return object;
};
/**
* Converts this StepDetail to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.StepDetail
* @instance
* @returns {Object.<string,*>} JSON object
*/
StepDetail.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for StepDetail
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.StepDetail
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
StepDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.StepDetail";
};
return StepDetail;
})();
Message.EndExperiment = (function() {
/**
* Properties of an EndExperiment.
* @memberof xyz.playedu.common.Message
* @interface IEndExperiment
* @property {string|null} [recordCode] EndExperiment recordCode
*/
/**
* Constructs a new EndExperiment.
* @memberof xyz.playedu.common.Message
* @classdesc Represents an EndExperiment.
* @implements IEndExperiment
* @constructor
* @param {xyz.playedu.common.Message.IEndExperiment=} [properties] Properties to set
*/
function EndExperiment(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* EndExperiment recordCode.
* @member {string} recordCode
* @memberof xyz.playedu.common.Message.EndExperiment
* @instance
*/
EndExperiment.prototype.recordCode = "";
/**
* Creates a new EndExperiment instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.EndExperiment
* @static
* @param {xyz.playedu.common.Message.IEndExperiment=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.EndExperiment} EndExperiment instance
*/
EndExperiment.create = function create(properties) {
return new EndExperiment(properties);
};
/**
* Encodes the specified EndExperiment message. Does not implicitly {@link xyz.playedu.common.Message.EndExperiment.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.EndExperiment
* @static
* @param {xyz.playedu.common.Message.IEndExperiment} message EndExperiment message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
EndExperiment.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.recordCode != null && Object.hasOwnProperty.call(message, "recordCode"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.recordCode);
return writer;
};
/**
* Encodes the specified EndExperiment message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.EndExperiment.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.EndExperiment
* @static
* @param {xyz.playedu.common.Message.IEndExperiment} message EndExperiment message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
EndExperiment.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an EndExperiment message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.EndExperiment
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.EndExperiment} EndExperiment
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
EndExperiment.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.EndExperiment();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.recordCode = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an EndExperiment message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.EndExperiment
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.EndExperiment} EndExperiment
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
EndExperiment.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an EndExperiment message.
* @function verify
* @memberof xyz.playedu.common.Message.EndExperiment
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
EndExperiment.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.recordCode != null && message.hasOwnProperty("recordCode"))
if (!$util.isString(message.recordCode))
return "recordCode: string expected";
return null;
};
/**
* Creates an EndExperiment message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.EndExperiment
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.EndExperiment} EndExperiment
*/
EndExperiment.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.EndExperiment)
return object;
var message = new $root.xyz.playedu.common.Message.EndExperiment();
if (object.recordCode != null)
message.recordCode = String(object.recordCode);
return message;
};
/**
* Creates a plain object from an EndExperiment message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.EndExperiment
* @static
* @param {xyz.playedu.common.Message.EndExperiment} message EndExperiment
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
EndExperiment.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.recordCode = "";
if (message.recordCode != null && message.hasOwnProperty("recordCode"))
object.recordCode = message.recordCode;
return object;
};
/**
* Converts this EndExperiment to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.EndExperiment
* @instance
* @returns {Object.<string,*>} JSON object
*/
EndExperiment.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for EndExperiment
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.EndExperiment
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
EndExperiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.EndExperiment";
};
return EndExperiment;
})();
Message.RequestAllValue = (function() {
/**
* Properties of a RequestAllValue.
* @memberof xyz.playedu.common.Message
* @interface IRequestAllValue
* @property {string|null} [equId] RequestAllValue equId
*/
/**
* Constructs a new RequestAllValue.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a RequestAllValue.
* @implements IRequestAllValue
* @constructor
* @param {xyz.playedu.common.Message.IRequestAllValue=} [properties] Properties to set
*/
function RequestAllValue(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* RequestAllValue equId.
* @member {string} equId
* @memberof xyz.playedu.common.Message.RequestAllValue
* @instance
*/
RequestAllValue.prototype.equId = "";
/**
* Creates a new RequestAllValue instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.RequestAllValue
* @static
* @param {xyz.playedu.common.Message.IRequestAllValue=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.RequestAllValue} RequestAllValue instance
*/
RequestAllValue.create = function create(properties) {
return new RequestAllValue(properties);
};
/**
* Encodes the specified RequestAllValue message. Does not implicitly {@link xyz.playedu.common.Message.RequestAllValue.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.RequestAllValue
* @static
* @param {xyz.playedu.common.Message.IRequestAllValue} message RequestAllValue message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
RequestAllValue.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.equId != null && Object.hasOwnProperty.call(message, "equId"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.equId);
return writer;
};
/**
* Encodes the specified RequestAllValue message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.RequestAllValue.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.RequestAllValue
* @static
* @param {xyz.playedu.common.Message.IRequestAllValue} message RequestAllValue message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
RequestAllValue.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a RequestAllValue message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.RequestAllValue
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.RequestAllValue} RequestAllValue
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
RequestAllValue.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.RequestAllValue();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.equId = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a RequestAllValue message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.RequestAllValue
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.RequestAllValue} RequestAllValue
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
RequestAllValue.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a RequestAllValue message.
* @function verify
* @memberof xyz.playedu.common.Message.RequestAllValue
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
RequestAllValue.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.equId != null && message.hasOwnProperty("equId"))
if (!$util.isString(message.equId))
return "equId: string expected";
return null;
};
/**
* Creates a RequestAllValue message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.RequestAllValue
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.RequestAllValue} RequestAllValue
*/
RequestAllValue.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.RequestAllValue)
return object;
var message = new $root.xyz.playedu.common.Message.RequestAllValue();
if (object.equId != null)
message.equId = String(object.equId);
return message;
};
/**
* Creates a plain object from a RequestAllValue message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.RequestAllValue
* @static
* @param {xyz.playedu.common.Message.RequestAllValue} message RequestAllValue
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
RequestAllValue.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.equId = "";
if (message.equId != null && message.hasOwnProperty("equId"))
object.equId = message.equId;
return object;
};
/**
* Converts this RequestAllValue to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.RequestAllValue
* @instance
* @returns {Object.<string,*>} JSON object
*/
RequestAllValue.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for RequestAllValue
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.RequestAllValue
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
RequestAllValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.RequestAllValue";
};
return RequestAllValue;
})();
Message.PublishDeviceValue = (function() {
/**
* Properties of a PublishDeviceValue.
* @memberof xyz.playedu.common.Message
* @interface IPublishDeviceValue
* @property {string|null} [equId] PublishDeviceValue equId
* @property {Object.<string,string>|null} [values] PublishDeviceValue values
* @property {number|null} [valueType] PublishDeviceValue valueType
*/
/**
* Constructs a new PublishDeviceValue.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a PublishDeviceValue.
* @implements IPublishDeviceValue
* @constructor
* @param {xyz.playedu.common.Message.IPublishDeviceValue=} [properties] Properties to set
*/
function PublishDeviceValue(properties) {
this.values = {};
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* PublishDeviceValue equId.
* @member {string} equId
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @instance
*/
PublishDeviceValue.prototype.equId = "";
/**
* PublishDeviceValue values.
* @member {Object.<string,string>} values
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @instance
*/
PublishDeviceValue.prototype.values = $util.emptyObject;
/**
* PublishDeviceValue valueType.
* @member {number} valueType
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @instance
*/
PublishDeviceValue.prototype.valueType = 0;
/**
* Creates a new PublishDeviceValue instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @static
* @param {xyz.playedu.common.Message.IPublishDeviceValue=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.PublishDeviceValue} PublishDeviceValue instance
*/
PublishDeviceValue.create = function create(properties) {
return new PublishDeviceValue(properties);
};
/**
* Encodes the specified PublishDeviceValue message. Does not implicitly {@link xyz.playedu.common.Message.PublishDeviceValue.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @static
* @param {xyz.playedu.common.Message.IPublishDeviceValue} message PublishDeviceValue message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
PublishDeviceValue.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.equId != null && Object.hasOwnProperty.call(message, "equId"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.equId);
if (message.values != null && Object.hasOwnProperty.call(message, "values"))
for (var keys = Object.keys(message.values), i = 0; i < keys.length; ++i)
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.values[keys[i]]).ldelim();
if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType);
return writer;
};
/**
* Encodes the specified PublishDeviceValue message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.PublishDeviceValue.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @static
* @param {xyz.playedu.common.Message.IPublishDeviceValue} message PublishDeviceValue message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
PublishDeviceValue.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a PublishDeviceValue message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.PublishDeviceValue} PublishDeviceValue
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
PublishDeviceValue.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.PublishDeviceValue(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.equId = reader.string();
break;
}
case 2: {
if (message.values === $util.emptyObject)
message.values = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = "";
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.string();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.values[key] = value;
break;
}
case 3: {
message.valueType = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a PublishDeviceValue message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.PublishDeviceValue} PublishDeviceValue
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
PublishDeviceValue.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a PublishDeviceValue message.
* @function verify
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
PublishDeviceValue.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.equId != null && message.hasOwnProperty("equId"))
if (!$util.isString(message.equId))
return "equId: string expected";
if (message.values != null && message.hasOwnProperty("values")) {
if (!$util.isObject(message.values))
return "values: object expected";
var key = Object.keys(message.values);
for (var i = 0; i < key.length; ++i)
if (!$util.isString(message.values[key[i]]))
return "values: string{k:string} expected";
}
if (message.valueType != null && message.hasOwnProperty("valueType"))
if (!$util.isInteger(message.valueType))
return "valueType: integer expected";
return null;
};
/**
* Creates a PublishDeviceValue message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.PublishDeviceValue} PublishDeviceValue
*/
PublishDeviceValue.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.PublishDeviceValue)
return object;
var message = new $root.xyz.playedu.common.Message.PublishDeviceValue();
if (object.equId != null)
message.equId = String(object.equId);
if (object.values) {
if (typeof object.values !== "object")
throw TypeError(".xyz.playedu.common.Message.PublishDeviceValue.values: object expected");
message.values = {};
for (var keys = Object.keys(object.values), i = 0; i < keys.length; ++i)
message.values[keys[i]] = String(object.values[keys[i]]);
}
if (object.valueType != null)
message.valueType = object.valueType | 0;
return message;
};
/**
* Creates a plain object from a PublishDeviceValue message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @static
* @param {xyz.playedu.common.Message.PublishDeviceValue} message PublishDeviceValue
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
PublishDeviceValue.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.values = {};
if (options.defaults) {
object.equId = "";
object.valueType = 0;
}
if (message.equId != null && message.hasOwnProperty("equId"))
object.equId = message.equId;
var keys2;
if (message.values && (keys2 = Object.keys(message.values)).length) {
object.values = {};
for (var j = 0; j < keys2.length; ++j)
object.values[keys2[j]] = message.values[keys2[j]];
}
if (message.valueType != null && message.hasOwnProperty("valueType"))
object.valueType = message.valueType;
return object;
};
/**
* Converts this PublishDeviceValue to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @instance
* @returns {Object.<string,*>} JSON object
*/
PublishDeviceValue.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for PublishDeviceValue
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.PublishDeviceValue
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
PublishDeviceValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.PublishDeviceValue";
};
return PublishDeviceValue;
})();
Message.EquipmentHeartbeat = (function() {
/**
* Properties of an EquipmentHeartbeat.
* @memberof xyz.playedu.common.Message
* @interface IEquipmentHeartbeat
* @property {string|null} [equId] EquipmentHeartbeat equId
* @property {string|null} [status] EquipmentHeartbeat status
*/
/**
* Constructs a new EquipmentHeartbeat.
* @memberof xyz.playedu.common.Message
* @classdesc Represents an EquipmentHeartbeat.
* @implements IEquipmentHeartbeat
* @constructor
* @param {xyz.playedu.common.Message.IEquipmentHeartbeat=} [properties] Properties to set
*/
function EquipmentHeartbeat(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* EquipmentHeartbeat equId.
* @member {string} equId
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @instance
*/
EquipmentHeartbeat.prototype.equId = "";
/**
* EquipmentHeartbeat status.
* @member {string} status
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @instance
*/
EquipmentHeartbeat.prototype.status = "";
/**
* Creates a new EquipmentHeartbeat instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @static
* @param {xyz.playedu.common.Message.IEquipmentHeartbeat=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.EquipmentHeartbeat} EquipmentHeartbeat instance
*/
EquipmentHeartbeat.create = function create(properties) {
return new EquipmentHeartbeat(properties);
};
/**
* Encodes the specified EquipmentHeartbeat message. Does not implicitly {@link xyz.playedu.common.Message.EquipmentHeartbeat.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @static
* @param {xyz.playedu.common.Message.IEquipmentHeartbeat} message EquipmentHeartbeat message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
EquipmentHeartbeat.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.equId != null && Object.hasOwnProperty.call(message, "equId"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.equId);
if (message.status != null && Object.hasOwnProperty.call(message, "status"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.status);
return writer;
};
/**
* Encodes the specified EquipmentHeartbeat message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.EquipmentHeartbeat.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @static
* @param {xyz.playedu.common.Message.IEquipmentHeartbeat} message EquipmentHeartbeat message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
EquipmentHeartbeat.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an EquipmentHeartbeat message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.EquipmentHeartbeat} EquipmentHeartbeat
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
EquipmentHeartbeat.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.EquipmentHeartbeat();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.equId = reader.string();
break;
}
case 2: {
message.status = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an EquipmentHeartbeat message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.EquipmentHeartbeat} EquipmentHeartbeat
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
EquipmentHeartbeat.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an EquipmentHeartbeat message.
* @function verify
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
EquipmentHeartbeat.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.equId != null && message.hasOwnProperty("equId"))
if (!$util.isString(message.equId))
return "equId: string expected";
if (message.status != null && message.hasOwnProperty("status"))
if (!$util.isString(message.status))
return "status: string expected";
return null;
};
/**
* Creates an EquipmentHeartbeat message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.EquipmentHeartbeat} EquipmentHeartbeat
*/
EquipmentHeartbeat.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.EquipmentHeartbeat)
return object;
var message = new $root.xyz.playedu.common.Message.EquipmentHeartbeat();
if (object.equId != null)
message.equId = String(object.equId);
if (object.status != null)
message.status = String(object.status);
return message;
};
/**
* Creates a plain object from an EquipmentHeartbeat message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @static
* @param {xyz.playedu.common.Message.EquipmentHeartbeat} message EquipmentHeartbeat
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
EquipmentHeartbeat.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.equId = "";
object.status = "";
}
if (message.equId != null && message.hasOwnProperty("equId"))
object.equId = message.equId;
if (message.status != null && message.hasOwnProperty("status"))
object.status = message.status;
return object;
};
/**
* Converts this EquipmentHeartbeat to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @instance
* @returns {Object.<string,*>} JSON object
*/
EquipmentHeartbeat.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for EquipmentHeartbeat
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.EquipmentHeartbeat
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
EquipmentHeartbeat.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.EquipmentHeartbeat";
};
return EquipmentHeartbeat;
})();
Message.EquipmentWarn = (function() {
/**
* Properties of an EquipmentWarn.
* @memberof xyz.playedu.common.Message
* @interface IEquipmentWarn
* @property {string|null} [equId] EquipmentWarn equId
* @property {string|null} [warnInfo] EquipmentWarn warnInfo
* @property {string|null} [warnId] EquipmentWarn warnId
* @property {string|null} [warnTime] EquipmentWarn warnTime
* @property {string|null} [dutyName] EquipmentWarn dutyName
* @property {string|null} [dealStatus] EquipmentWarn dealStatus
* @property {number|null} [thresholdInfoId] EquipmentWarn thresholdInfoId
* @property {string|null} [varName] EquipmentWarn varName
*/
/**
* Constructs a new EquipmentWarn.
* @memberof xyz.playedu.common.Message
* @classdesc Represents an EquipmentWarn.
* @implements IEquipmentWarn
* @constructor
* @param {xyz.playedu.common.Message.IEquipmentWarn=} [properties] Properties to set
*/
function EquipmentWarn(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* EquipmentWarn equId.
* @member {string} equId
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @instance
*/
EquipmentWarn.prototype.equId = "";
/**
* EquipmentWarn warnInfo.
* @member {string} warnInfo
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @instance
*/
EquipmentWarn.prototype.warnInfo = "";
/**
* EquipmentWarn warnId.
* @member {string} warnId
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @instance
*/
EquipmentWarn.prototype.warnId = "";
/**
* EquipmentWarn warnTime.
* @member {string} warnTime
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @instance
*/
EquipmentWarn.prototype.warnTime = "";
/**
* EquipmentWarn dutyName.
* @member {string} dutyName
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @instance
*/
EquipmentWarn.prototype.dutyName = "";
/**
* EquipmentWarn dealStatus.
* @member {string} dealStatus
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @instance
*/
EquipmentWarn.prototype.dealStatus = "";
/**
* EquipmentWarn thresholdInfoId.
* @member {number} thresholdInfoId
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @instance
*/
EquipmentWarn.prototype.thresholdInfoId = 0;
/**
* EquipmentWarn varName.
* @member {string} varName
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @instance
*/
EquipmentWarn.prototype.varName = "";
/**
* Creates a new EquipmentWarn instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @static
* @param {xyz.playedu.common.Message.IEquipmentWarn=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.EquipmentWarn} EquipmentWarn instance
*/
EquipmentWarn.create = function create(properties) {
return new EquipmentWarn(properties);
};
/**
* Encodes the specified EquipmentWarn message. Does not implicitly {@link xyz.playedu.common.Message.EquipmentWarn.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @static
* @param {xyz.playedu.common.Message.IEquipmentWarn} message EquipmentWarn message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
EquipmentWarn.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.equId != null && Object.hasOwnProperty.call(message, "equId"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.equId);
if (message.warnInfo != null && Object.hasOwnProperty.call(message, "warnInfo"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.warnInfo);
if (message.warnId != null && Object.hasOwnProperty.call(message, "warnId"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.warnId);
if (message.warnTime != null && Object.hasOwnProperty.call(message, "warnTime"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.warnTime);
if (message.dutyName != null && Object.hasOwnProperty.call(message, "dutyName"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.dutyName);
if (message.dealStatus != null && Object.hasOwnProperty.call(message, "dealStatus"))
writer.uint32(/* id 6, wireType 2 =*/50).string(message.dealStatus);
if (message.thresholdInfoId != null && Object.hasOwnProperty.call(message, "thresholdInfoId"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.thresholdInfoId);
if (message.varName != null && Object.hasOwnProperty.call(message, "varName"))
writer.uint32(/* id 8, wireType 2 =*/66).string(message.varName);
return writer;
};
/**
* Encodes the specified EquipmentWarn message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.EquipmentWarn.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @static
* @param {xyz.playedu.common.Message.IEquipmentWarn} message EquipmentWarn message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
EquipmentWarn.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an EquipmentWarn message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.EquipmentWarn} EquipmentWarn
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
EquipmentWarn.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.EquipmentWarn();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.equId = reader.string();
break;
}
case 2: {
message.warnInfo = reader.string();
break;
}
case 3: {
message.warnId = reader.string();
break;
}
case 4: {
message.warnTime = reader.string();
break;
}
case 5: {
message.dutyName = reader.string();
break;
}
case 6: {
message.dealStatus = reader.string();
break;
}
case 7: {
message.thresholdInfoId = reader.int32();
break;
}
case 8: {
message.varName = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an EquipmentWarn message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.EquipmentWarn} EquipmentWarn
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
EquipmentWarn.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an EquipmentWarn message.
* @function verify
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
EquipmentWarn.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.equId != null && message.hasOwnProperty("equId"))
if (!$util.isString(message.equId))
return "equId: string expected";
if (message.warnInfo != null && message.hasOwnProperty("warnInfo"))
if (!$util.isString(message.warnInfo))
return "warnInfo: string expected";
if (message.warnId != null && message.hasOwnProperty("warnId"))
if (!$util.isString(message.warnId))
return "warnId: string expected";
if (message.warnTime != null && message.hasOwnProperty("warnTime"))
if (!$util.isString(message.warnTime))
return "warnTime: string expected";
if (message.dutyName != null && message.hasOwnProperty("dutyName"))
if (!$util.isString(message.dutyName))
return "dutyName: string expected";
if (message.dealStatus != null && message.hasOwnProperty("dealStatus"))
if (!$util.isString(message.dealStatus))
return "dealStatus: string expected";
if (message.thresholdInfoId != null && message.hasOwnProperty("thresholdInfoId"))
if (!$util.isInteger(message.thresholdInfoId))
return "thresholdInfoId: integer expected";
if (message.varName != null && message.hasOwnProperty("varName"))
if (!$util.isString(message.varName))
return "varName: string expected";
return null;
};
/**
* Creates an EquipmentWarn message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.EquipmentWarn} EquipmentWarn
*/
EquipmentWarn.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.EquipmentWarn)
return object;
var message = new $root.xyz.playedu.common.Message.EquipmentWarn();
if (object.equId != null)
message.equId = String(object.equId);
if (object.warnInfo != null)
message.warnInfo = String(object.warnInfo);
if (object.warnId != null)
message.warnId = String(object.warnId);
if (object.warnTime != null)
message.warnTime = String(object.warnTime);
if (object.dutyName != null)
message.dutyName = String(object.dutyName);
if (object.dealStatus != null)
message.dealStatus = String(object.dealStatus);
if (object.thresholdInfoId != null)
message.thresholdInfoId = object.thresholdInfoId | 0;
if (object.varName != null)
message.varName = String(object.varName);
return message;
};
/**
* Creates a plain object from an EquipmentWarn message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @static
* @param {xyz.playedu.common.Message.EquipmentWarn} message EquipmentWarn
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
EquipmentWarn.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.equId = "";
object.warnInfo = "";
object.warnId = "";
object.warnTime = "";
object.dutyName = "";
object.dealStatus = "";
object.thresholdInfoId = 0;
object.varName = "";
}
if (message.equId != null && message.hasOwnProperty("equId"))
object.equId = message.equId;
if (message.warnInfo != null && message.hasOwnProperty("warnInfo"))
object.warnInfo = message.warnInfo;
if (message.warnId != null && message.hasOwnProperty("warnId"))
object.warnId = message.warnId;
if (message.warnTime != null && message.hasOwnProperty("warnTime"))
object.warnTime = message.warnTime;
if (message.dutyName != null && message.hasOwnProperty("dutyName"))
object.dutyName = message.dutyName;
if (message.dealStatus != null && message.hasOwnProperty("dealStatus"))
object.dealStatus = message.dealStatus;
if (message.thresholdInfoId != null && message.hasOwnProperty("thresholdInfoId"))
object.thresholdInfoId = message.thresholdInfoId;
if (message.varName != null && message.hasOwnProperty("varName"))
object.varName = message.varName;
return object;
};
/**
* Converts this EquipmentWarn to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @instance
* @returns {Object.<string,*>} JSON object
*/
EquipmentWarn.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for EquipmentWarn
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.EquipmentWarn
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
EquipmentWarn.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.EquipmentWarn";
};
return EquipmentWarn;
})();
Message.UserData = (function() {
/**
* Properties of a UserData.
* @memberof xyz.playedu.common.Message
* @interface IUserData
* @property {string|null} [userId] UserData userId
* @property {string|null} [realName] UserData realName
* @property {string|null} [avatar] UserData avatar
* @property {string|null} [Organization] UserData Organization
* @property {string|null} [UserNo] UserData UserNo
* @property {string|null} [userName] UserData userName
*/
/**
* Constructs a new UserData.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a UserData.
* @implements IUserData
* @constructor
* @param {xyz.playedu.common.Message.IUserData=} [properties] Properties to set
*/
function UserData(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* UserData userId.
* @member {string} userId
* @memberof xyz.playedu.common.Message.UserData
* @instance
*/
UserData.prototype.userId = "";
/**
* UserData realName.
* @member {string} realName
* @memberof xyz.playedu.common.Message.UserData
* @instance
*/
UserData.prototype.realName = "";
/**
* UserData avatar.
* @member {string} avatar
* @memberof xyz.playedu.common.Message.UserData
* @instance
*/
UserData.prototype.avatar = "";
/**
* UserData Organization.
* @member {string} Organization
* @memberof xyz.playedu.common.Message.UserData
* @instance
*/
UserData.prototype.Organization = "";
/**
* UserData UserNo.
* @member {string} UserNo
* @memberof xyz.playedu.common.Message.UserData
* @instance
*/
UserData.prototype.UserNo = "";
/**
* UserData userName.
* @member {string} userName
* @memberof xyz.playedu.common.Message.UserData
* @instance
*/
UserData.prototype.userName = "";
/**
* Creates a new UserData instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.UserData
* @static
* @param {xyz.playedu.common.Message.IUserData=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.UserData} UserData instance
*/
UserData.create = function create(properties) {
return new UserData(properties);
};
/**
* Encodes the specified UserData message. Does not implicitly {@link xyz.playedu.common.Message.UserData.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.UserData
* @static
* @param {xyz.playedu.common.Message.IUserData} message UserData message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
UserData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.userId != null && Object.hasOwnProperty.call(message, "userId"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId);
if (message.realName != null && Object.hasOwnProperty.call(message, "realName"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.realName);
if (message.avatar != null && Object.hasOwnProperty.call(message, "avatar"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.avatar);
if (message.Organization != null && Object.hasOwnProperty.call(message, "Organization"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.Organization);
if (message.UserNo != null && Object.hasOwnProperty.call(message, "UserNo"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.UserNo);
if (message.userName != null && Object.hasOwnProperty.call(message, "userName"))
writer.uint32(/* id 6, wireType 2 =*/50).string(message.userName);
return writer;
};
/**
* Encodes the specified UserData message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.UserData.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.UserData
* @static
* @param {xyz.playedu.common.Message.IUserData} message UserData message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
UserData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a UserData message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.UserData
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.UserData} UserData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
UserData.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.UserData();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.userId = reader.string();
break;
}
case 2: {
message.realName = reader.string();
break;
}
case 3: {
message.avatar = reader.string();
break;
}
case 4: {
message.Organization = reader.string();
break;
}
case 5: {
message.UserNo = reader.string();
break;
}
case 6: {
message.userName = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a UserData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.UserData
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.UserData} UserData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
UserData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a UserData message.
* @function verify
* @memberof xyz.playedu.common.Message.UserData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
UserData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.userId != null && message.hasOwnProperty("userId"))
if (!$util.isString(message.userId))
return "userId: string expected";
if (message.realName != null && message.hasOwnProperty("realName"))
if (!$util.isString(message.realName))
return "realName: string expected";
if (message.avatar != null && message.hasOwnProperty("avatar"))
if (!$util.isString(message.avatar))
return "avatar: string expected";
if (message.Organization != null && message.hasOwnProperty("Organization"))
if (!$util.isString(message.Organization))
return "Organization: string expected";
if (message.UserNo != null && message.hasOwnProperty("UserNo"))
if (!$util.isString(message.UserNo))
return "UserNo: string expected";
if (message.userName != null && message.hasOwnProperty("userName"))
if (!$util.isString(message.userName))
return "userName: string expected";
return null;
};
/**
* Creates a UserData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.UserData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.UserData} UserData
*/
UserData.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.UserData)
return object;
var message = new $root.xyz.playedu.common.Message.UserData();
if (object.userId != null)
message.userId = String(object.userId);
if (object.realName != null)
message.realName = String(object.realName);
if (object.avatar != null)
message.avatar = String(object.avatar);
if (object.Organization != null)
message.Organization = String(object.Organization);
if (object.UserNo != null)
message.UserNo = String(object.UserNo);
if (object.userName != null)
message.userName = String(object.userName);
return message;
};
/**
* Creates a plain object from a UserData message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.UserData
* @static
* @param {xyz.playedu.common.Message.UserData} message UserData
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
UserData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.userId = "";
object.realName = "";
object.avatar = "";
object.Organization = "";
object.UserNo = "";
object.userName = "";
}
if (message.userId != null && message.hasOwnProperty("userId"))
object.userId = message.userId;
if (message.realName != null && message.hasOwnProperty("realName"))
object.realName = message.realName;
if (message.avatar != null && message.hasOwnProperty("avatar"))
object.avatar = message.avatar;
if (message.Organization != null && message.hasOwnProperty("Organization"))
object.Organization = message.Organization;
if (message.UserNo != null && message.hasOwnProperty("UserNo"))
object.UserNo = message.UserNo;
if (message.userName != null && message.hasOwnProperty("userName"))
object.userName = message.userName;
return object;
};
/**
* Converts this UserData to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.UserData
* @instance
* @returns {Object.<string,*>} JSON object
*/
UserData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for UserData
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.UserData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
UserData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.UserData";
};
return UserData;
})();
Message.ServerStartView = (function() {
/**
* Properties of a ServerStartView.
* @memberof xyz.playedu.common.Message
* @interface IServerStartView
* @property {string|null} [serverID] ServerStartView serverID
*/
/**
* Constructs a new ServerStartView.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a ServerStartView.
* @implements IServerStartView
* @constructor
* @param {xyz.playedu.common.Message.IServerStartView=} [properties] Properties to set
*/
function ServerStartView(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ServerStartView serverID.
* @member {string} serverID
* @memberof xyz.playedu.common.Message.ServerStartView
* @instance
*/
ServerStartView.prototype.serverID = "";
/**
* Creates a new ServerStartView instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.ServerStartView
* @static
* @param {xyz.playedu.common.Message.IServerStartView=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.ServerStartView} ServerStartView instance
*/
ServerStartView.create = function create(properties) {
return new ServerStartView(properties);
};
/**
* Encodes the specified ServerStartView message. Does not implicitly {@link xyz.playedu.common.Message.ServerStartView.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.ServerStartView
* @static
* @param {xyz.playedu.common.Message.IServerStartView} message ServerStartView message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ServerStartView.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.serverID != null && Object.hasOwnProperty.call(message, "serverID"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.serverID);
return writer;
};
/**
* Encodes the specified ServerStartView message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.ServerStartView.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.ServerStartView
* @static
* @param {xyz.playedu.common.Message.IServerStartView} message ServerStartView message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ServerStartView.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ServerStartView message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.ServerStartView
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.ServerStartView} ServerStartView
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ServerStartView.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.ServerStartView();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.serverID = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ServerStartView message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.ServerStartView
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.ServerStartView} ServerStartView
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ServerStartView.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ServerStartView message.
* @function verify
* @memberof xyz.playedu.common.Message.ServerStartView
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ServerStartView.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.serverID != null && message.hasOwnProperty("serverID"))
if (!$util.isString(message.serverID))
return "serverID: string expected";
return null;
};
/**
* Creates a ServerStartView message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.ServerStartView
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.ServerStartView} ServerStartView
*/
ServerStartView.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.ServerStartView)
return object;
var message = new $root.xyz.playedu.common.Message.ServerStartView();
if (object.serverID != null)
message.serverID = String(object.serverID);
return message;
};
/**
* Creates a plain object from a ServerStartView message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.ServerStartView
* @static
* @param {xyz.playedu.common.Message.ServerStartView} message ServerStartView
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ServerStartView.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.serverID = "";
if (message.serverID != null && message.hasOwnProperty("serverID"))
object.serverID = message.serverID;
return object;
};
/**
* Converts this ServerStartView to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.ServerStartView
* @instance
* @returns {Object.<string,*>} JSON object
*/
ServerStartView.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ServerStartView
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.ServerStartView
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ServerStartView.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.ServerStartView";
};
return ServerStartView;
})();
Message.ClientAllData = (function() {
/**
* Properties of a ClientAllData.
* @memberof xyz.playedu.common.Message
* @interface IClientAllData
* @property {Array.<xyz.playedu.common.Message.IUserData>|null} [users] ClientAllData users
* @property {Object.<string,string>|null} [outterValues] ClientAllData outterValues
* @property {Object.<string,string>|null} [innerValues] ClientAllData innerValues
* @property {Array.<xyz.playedu.common.Message.IEquipmentWarn>|null} [equipmentWarns] ClientAllData equipmentWarns
* @property {string|null} [serverID] ClientAllData serverID
* @property {Array.<xyz.playedu.common.Message.IScoreItem>|null} [scoreData] ClientAllData scoreData
*/
/**
* Constructs a new ClientAllData.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a ClientAllData.
* @implements IClientAllData
* @constructor
* @param {xyz.playedu.common.Message.IClientAllData=} [properties] Properties to set
*/
function ClientAllData(properties) {
this.users = [];
this.outterValues = {};
this.innerValues = {};
this.equipmentWarns = [];
this.scoreData = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ClientAllData users.
* @member {Array.<xyz.playedu.common.Message.IUserData>} users
* @memberof xyz.playedu.common.Message.ClientAllData
* @instance
*/
ClientAllData.prototype.users = $util.emptyArray;
/**
* ClientAllData outterValues.
* @member {Object.<string,string>} outterValues
* @memberof xyz.playedu.common.Message.ClientAllData
* @instance
*/
ClientAllData.prototype.outterValues = $util.emptyObject;
/**
* ClientAllData innerValues.
* @member {Object.<string,string>} innerValues
* @memberof xyz.playedu.common.Message.ClientAllData
* @instance
*/
ClientAllData.prototype.innerValues = $util.emptyObject;
/**
* ClientAllData equipmentWarns.
* @member {Array.<xyz.playedu.common.Message.IEquipmentWarn>} equipmentWarns
* @memberof xyz.playedu.common.Message.ClientAllData
* @instance
*/
ClientAllData.prototype.equipmentWarns = $util.emptyArray;
/**
* ClientAllData serverID.
* @member {string} serverID
* @memberof xyz.playedu.common.Message.ClientAllData
* @instance
*/
ClientAllData.prototype.serverID = "";
/**
* ClientAllData scoreData.
* @member {Array.<xyz.playedu.common.Message.IScoreItem>} scoreData
* @memberof xyz.playedu.common.Message.ClientAllData
* @instance
*/
ClientAllData.prototype.scoreData = $util.emptyArray;
/**
* Creates a new ClientAllData instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.ClientAllData
* @static
* @param {xyz.playedu.common.Message.IClientAllData=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.ClientAllData} ClientAllData instance
*/
ClientAllData.create = function create(properties) {
return new ClientAllData(properties);
};
/**
* Encodes the specified ClientAllData message. Does not implicitly {@link xyz.playedu.common.Message.ClientAllData.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.ClientAllData
* @static
* @param {xyz.playedu.common.Message.IClientAllData} message ClientAllData message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ClientAllData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.users != null && message.users.length)
for (var i = 0; i < message.users.length; ++i)
$root.xyz.playedu.common.Message.UserData.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.outterValues != null && Object.hasOwnProperty.call(message, "outterValues"))
for (var keys = Object.keys(message.outterValues), i = 0; i < keys.length; ++i)
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.outterValues[keys[i]]).ldelim();
if (message.innerValues != null && Object.hasOwnProperty.call(message, "innerValues"))
for (var keys = Object.keys(message.innerValues), i = 0; i < keys.length; ++i)
writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.innerValues[keys[i]]).ldelim();
if (message.equipmentWarns != null && message.equipmentWarns.length)
for (var i = 0; i < message.equipmentWarns.length; ++i)
$root.xyz.playedu.common.Message.EquipmentWarn.encode(message.equipmentWarns[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.serverID != null && Object.hasOwnProperty.call(message, "serverID"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.serverID);
if (message.scoreData != null && message.scoreData.length)
for (var i = 0; i < message.scoreData.length; ++i)
$root.xyz.playedu.common.Message.ScoreItem.encode(message.scoreData[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ClientAllData message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.ClientAllData.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.ClientAllData
* @static
* @param {xyz.playedu.common.Message.IClientAllData} message ClientAllData message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ClientAllData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ClientAllData message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.ClientAllData
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.ClientAllData} ClientAllData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ClientAllData.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.ClientAllData(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
if (!(message.users && message.users.length))
message.users = [];
message.users.push($root.xyz.playedu.common.Message.UserData.decode(reader, reader.uint32()));
break;
}
case 2: {
if (message.outterValues === $util.emptyObject)
message.outterValues = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = "";
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.string();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.outterValues[key] = value;
break;
}
case 3: {
if (message.innerValues === $util.emptyObject)
message.innerValues = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = "";
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.string();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.innerValues[key] = value;
break;
}
case 4: {
if (!(message.equipmentWarns && message.equipmentWarns.length))
message.equipmentWarns = [];
message.equipmentWarns.push($root.xyz.playedu.common.Message.EquipmentWarn.decode(reader, reader.uint32()));
break;
}
case 5: {
message.serverID = reader.string();
break;
}
case 6: {
if (!(message.scoreData && message.scoreData.length))
message.scoreData = [];
message.scoreData.push($root.xyz.playedu.common.Message.ScoreItem.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ClientAllData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.ClientAllData
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.ClientAllData} ClientAllData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ClientAllData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ClientAllData message.
* @function verify
* @memberof xyz.playedu.common.Message.ClientAllData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ClientAllData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.users != null && message.hasOwnProperty("users")) {
if (!Array.isArray(message.users))
return "users: array expected";
for (var i = 0; i < message.users.length; ++i) {
var error = $root.xyz.playedu.common.Message.UserData.verify(message.users[i]);
if (error)
return "users." + error;
}
}
if (message.outterValues != null && message.hasOwnProperty("outterValues")) {
if (!$util.isObject(message.outterValues))
return "outterValues: object expected";
var key = Object.keys(message.outterValues);
for (var i = 0; i < key.length; ++i)
if (!$util.isString(message.outterValues[key[i]]))
return "outterValues: string{k:string} expected";
}
if (message.innerValues != null && message.hasOwnProperty("innerValues")) {
if (!$util.isObject(message.innerValues))
return "innerValues: object expected";
var key = Object.keys(message.innerValues);
for (var i = 0; i < key.length; ++i)
if (!$util.isString(message.innerValues[key[i]]))
return "innerValues: string{k:string} expected";
}
if (message.equipmentWarns != null && message.hasOwnProperty("equipmentWarns")) {
if (!Array.isArray(message.equipmentWarns))
return "equipmentWarns: array expected";
for (var i = 0; i < message.equipmentWarns.length; ++i) {
var error = $root.xyz.playedu.common.Message.EquipmentWarn.verify(message.equipmentWarns[i]);
if (error)
return "equipmentWarns." + error;
}
}
if (message.serverID != null && message.hasOwnProperty("serverID"))
if (!$util.isString(message.serverID))
return "serverID: string expected";
if (message.scoreData != null && message.hasOwnProperty("scoreData")) {
if (!Array.isArray(message.scoreData))
return "scoreData: array expected";
for (var i = 0; i < message.scoreData.length; ++i) {
var error = $root.xyz.playedu.common.Message.ScoreItem.verify(message.scoreData[i]);
if (error)
return "scoreData." + error;
}
}
return null;
};
/**
* Creates a ClientAllData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.ClientAllData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.ClientAllData} ClientAllData
*/
ClientAllData.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.ClientAllData)
return object;
var message = new $root.xyz.playedu.common.Message.ClientAllData();
if (object.users) {
if (!Array.isArray(object.users))
throw TypeError(".xyz.playedu.common.Message.ClientAllData.users: array expected");
message.users = [];
for (var i = 0; i < object.users.length; ++i) {
if (typeof object.users[i] !== "object")
throw TypeError(".xyz.playedu.common.Message.ClientAllData.users: object expected");
message.users[i] = $root.xyz.playedu.common.Message.UserData.fromObject(object.users[i]);
}
}
if (object.outterValues) {
if (typeof object.outterValues !== "object")
throw TypeError(".xyz.playedu.common.Message.ClientAllData.outterValues: object expected");
message.outterValues = {};
for (var keys = Object.keys(object.outterValues), i = 0; i < keys.length; ++i)
message.outterValues[keys[i]] = String(object.outterValues[keys[i]]);
}
if (object.innerValues) {
if (typeof object.innerValues !== "object")
throw TypeError(".xyz.playedu.common.Message.ClientAllData.innerValues: object expected");
message.innerValues = {};
for (var keys = Object.keys(object.innerValues), i = 0; i < keys.length; ++i)
message.innerValues[keys[i]] = String(object.innerValues[keys[i]]);
}
if (object.equipmentWarns) {
if (!Array.isArray(object.equipmentWarns))
throw TypeError(".xyz.playedu.common.Message.ClientAllData.equipmentWarns: array expected");
message.equipmentWarns = [];
for (var i = 0; i < object.equipmentWarns.length; ++i) {
if (typeof object.equipmentWarns[i] !== "object")
throw TypeError(".xyz.playedu.common.Message.ClientAllData.equipmentWarns: object expected");
message.equipmentWarns[i] = $root.xyz.playedu.common.Message.EquipmentWarn.fromObject(object.equipmentWarns[i]);
}
}
if (object.serverID != null)
message.serverID = String(object.serverID);
if (object.scoreData) {
if (!Array.isArray(object.scoreData))
throw TypeError(".xyz.playedu.common.Message.ClientAllData.scoreData: array expected");
message.scoreData = [];
for (var i = 0; i < object.scoreData.length; ++i) {
if (typeof object.scoreData[i] !== "object")
throw TypeError(".xyz.playedu.common.Message.ClientAllData.scoreData: object expected");
message.scoreData[i] = $root.xyz.playedu.common.Message.ScoreItem.fromObject(object.scoreData[i]);
}
}
return message;
};
/**
* Creates a plain object from a ClientAllData message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.ClientAllData
* @static
* @param {xyz.playedu.common.Message.ClientAllData} message ClientAllData
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ClientAllData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.users = [];
object.equipmentWarns = [];
object.scoreData = [];
}
if (options.objects || options.defaults) {
object.outterValues = {};
object.innerValues = {};
}
if (options.defaults)
object.serverID = "";
if (message.users && message.users.length) {
object.users = [];
for (var j = 0; j < message.users.length; ++j)
object.users[j] = $root.xyz.playedu.common.Message.UserData.toObject(message.users[j], options);
}
var keys2;
if (message.outterValues && (keys2 = Object.keys(message.outterValues)).length) {
object.outterValues = {};
for (var j = 0; j < keys2.length; ++j)
object.outterValues[keys2[j]] = message.outterValues[keys2[j]];
}
if (message.innerValues && (keys2 = Object.keys(message.innerValues)).length) {
object.innerValues = {};
for (var j = 0; j < keys2.length; ++j)
object.innerValues[keys2[j]] = message.innerValues[keys2[j]];
}
if (message.equipmentWarns && message.equipmentWarns.length) {
object.equipmentWarns = [];
for (var j = 0; j < message.equipmentWarns.length; ++j)
object.equipmentWarns[j] = $root.xyz.playedu.common.Message.EquipmentWarn.toObject(message.equipmentWarns[j], options);
}
if (message.serverID != null && message.hasOwnProperty("serverID"))
object.serverID = message.serverID;
if (message.scoreData && message.scoreData.length) {
object.scoreData = [];
for (var j = 0; j < message.scoreData.length; ++j)
object.scoreData[j] = $root.xyz.playedu.common.Message.ScoreItem.toObject(message.scoreData[j], options);
}
return object;
};
/**
* Converts this ClientAllData to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.ClientAllData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ClientAllData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ClientAllData
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.ClientAllData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ClientAllData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.ClientAllData";
};
return ClientAllData;
})();
/**
* UserStateType enum.
* @name xyz.playedu.common.Message.UserStateType
* @enum {number}
* @property {number} login=0 login value
* @property {number} logout=1 logout value
*/
Message.UserStateType = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "login"] = 0;
values[valuesById[1] = "logout"] = 1;
return values;
})();
Message.UserChange = (function() {
/**
* Properties of a UserChange.
* @memberof xyz.playedu.common.Message
* @interface IUserChange
* @property {xyz.playedu.common.Message.UserStateType|null} [userState] UserChange userState
* @property {string|null} [userId] UserChange userId
*/
/**
* Constructs a new UserChange.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a UserChange.
* @implements IUserChange
* @constructor
* @param {xyz.playedu.common.Message.IUserChange=} [properties] Properties to set
*/
function UserChange(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* UserChange userState.
* @member {xyz.playedu.common.Message.UserStateType} userState
* @memberof xyz.playedu.common.Message.UserChange
* @instance
*/
UserChange.prototype.userState = 0;
/**
* UserChange userId.
* @member {string} userId
* @memberof xyz.playedu.common.Message.UserChange
* @instance
*/
UserChange.prototype.userId = "";
/**
* Creates a new UserChange instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.UserChange
* @static
* @param {xyz.playedu.common.Message.IUserChange=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.UserChange} UserChange instance
*/
UserChange.create = function create(properties) {
return new UserChange(properties);
};
/**
* Encodes the specified UserChange message. Does not implicitly {@link xyz.playedu.common.Message.UserChange.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.UserChange
* @static
* @param {xyz.playedu.common.Message.IUserChange} message UserChange message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
UserChange.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.userState != null && Object.hasOwnProperty.call(message, "userState"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.userState);
if (message.userId != null && Object.hasOwnProperty.call(message, "userId"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId);
return writer;
};
/**
* Encodes the specified UserChange message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.UserChange.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.UserChange
* @static
* @param {xyz.playedu.common.Message.IUserChange} message UserChange message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
UserChange.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a UserChange message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.UserChange
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.UserChange} UserChange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
UserChange.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.UserChange();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.userState = reader.int32();
break;
}
case 2: {
message.userId = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a UserChange message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.UserChange
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.UserChange} UserChange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
UserChange.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a UserChange message.
* @function verify
* @memberof xyz.playedu.common.Message.UserChange
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
UserChange.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.userState != null && message.hasOwnProperty("userState"))
switch (message.userState) {
default:
return "userState: enum value expected";
case 0:
case 1:
break;
}
if (message.userId != null && message.hasOwnProperty("userId"))
if (!$util.isString(message.userId))
return "userId: string expected";
return null;
};
/**
* Creates a UserChange message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.UserChange
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.UserChange} UserChange
*/
UserChange.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.UserChange)
return object;
var message = new $root.xyz.playedu.common.Message.UserChange();
switch (object.userState) {
default:
if (typeof object.userState === "number") {
message.userState = object.userState;
break;
}
break;
case "login":
case 0:
message.userState = 0;
break;
case "logout":
case 1:
message.userState = 1;
break;
}
if (object.userId != null)
message.userId = String(object.userId);
return message;
};
/**
* Creates a plain object from a UserChange message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.UserChange
* @static
* @param {xyz.playedu.common.Message.UserChange} message UserChange
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
UserChange.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.userState = options.enums === String ? "login" : 0;
object.userId = "";
}
if (message.userState != null && message.hasOwnProperty("userState"))
object.userState = options.enums === String ? $root.xyz.playedu.common.Message.UserStateType[message.userState] === undefined ? message.userState : $root.xyz.playedu.common.Message.UserStateType[message.userState] : message.userState;
if (message.userId != null && message.hasOwnProperty("userId"))
object.userId = message.userId;
return object;
};
/**
* Converts this UserChange to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.UserChange
* @instance
* @returns {Object.<string,*>} JSON object
*/
UserChange.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for UserChange
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.UserChange
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
UserChange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.UserChange";
};
return UserChange;
})();
Message.MonitoringWarnInfo = (function() {
/**
* Properties of a MonitoringWarnInfo.
* @memberof xyz.playedu.common.Message
* @interface IMonitoringWarnInfo
* @property {string|null} [controlCode] MonitoringWarnInfo controlCode
* @property {number|null} [flowMode] MonitoringWarnInfo flowMode
* @property {string|null} [flowCode] MonitoringWarnInfo flowCode
* @property {string|null} [flowName] MonitoringWarnInfo flowName
* @property {number|null} [drawType] MonitoringWarnInfo drawType
* @property {string|null} [flag] MonitoringWarnInfo flag
* @property {string|null} [streamApp] MonitoringWarnInfo streamApp
* @property {string|null} [streamName] MonitoringWarnInfo streamName
* @property {string|null} [streamCode] MonitoringWarnInfo streamCode
* @property {string|null} [streamNickname] MonitoringWarnInfo streamNickname
* @property {string|null} [desc] MonitoringWarnInfo desc
* @property {number|null} [videoCount] MonitoringWarnInfo videoCount
* @property {Array.<xyz.playedu.common.Message.IMonitoringVideoItem>|null} [videoArray] MonitoringWarnInfo videoArray
*/
/**
* Constructs a new MonitoringWarnInfo.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a MonitoringWarnInfo.
* @implements IMonitoringWarnInfo
* @constructor
* @param {xyz.playedu.common.Message.IMonitoringWarnInfo=} [properties] Properties to set
*/
function MonitoringWarnInfo(properties) {
this.videoArray = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* MonitoringWarnInfo controlCode.
* @member {string} controlCode
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.controlCode = "";
/**
* MonitoringWarnInfo flowMode.
* @member {number} flowMode
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.flowMode = 0;
/**
* MonitoringWarnInfo flowCode.
* @member {string} flowCode
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.flowCode = "";
/**
* MonitoringWarnInfo flowName.
* @member {string} flowName
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.flowName = "";
/**
* MonitoringWarnInfo drawType.
* @member {number} drawType
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.drawType = 0;
/**
* MonitoringWarnInfo flag.
* @member {string} flag
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.flag = "";
/**
* MonitoringWarnInfo streamApp.
* @member {string} streamApp
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.streamApp = "";
/**
* MonitoringWarnInfo streamName.
* @member {string} streamName
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.streamName = "";
/**
* MonitoringWarnInfo streamCode.
* @member {string} streamCode
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.streamCode = "";
/**
* MonitoringWarnInfo streamNickname.
* @member {string} streamNickname
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.streamNickname = "";
/**
* MonitoringWarnInfo desc.
* @member {string} desc
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.desc = "";
/**
* MonitoringWarnInfo videoCount.
* @member {number} videoCount
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.videoCount = 0;
/**
* MonitoringWarnInfo videoArray.
* @member {Array.<xyz.playedu.common.Message.IMonitoringVideoItem>} videoArray
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
*/
MonitoringWarnInfo.prototype.videoArray = $util.emptyArray;
/**
* Creates a new MonitoringWarnInfo instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @static
* @param {xyz.playedu.common.Message.IMonitoringWarnInfo=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.MonitoringWarnInfo} MonitoringWarnInfo instance
*/
MonitoringWarnInfo.create = function create(properties) {
return new MonitoringWarnInfo(properties);
};
/**
* Encodes the specified MonitoringWarnInfo message. Does not implicitly {@link xyz.playedu.common.Message.MonitoringWarnInfo.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @static
* @param {xyz.playedu.common.Message.IMonitoringWarnInfo} message MonitoringWarnInfo message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
MonitoringWarnInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.controlCode != null && Object.hasOwnProperty.call(message, "controlCode"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.controlCode);
if (message.flowMode != null && Object.hasOwnProperty.call(message, "flowMode"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.flowMode);
if (message.flowCode != null && Object.hasOwnProperty.call(message, "flowCode"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.flowCode);
if (message.flowName != null && Object.hasOwnProperty.call(message, "flowName"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.flowName);
if (message.drawType != null && Object.hasOwnProperty.call(message, "drawType"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.drawType);
if (message.flag != null && Object.hasOwnProperty.call(message, "flag"))
writer.uint32(/* id 6, wireType 2 =*/50).string(message.flag);
if (message.streamApp != null && Object.hasOwnProperty.call(message, "streamApp"))
writer.uint32(/* id 7, wireType 2 =*/58).string(message.streamApp);
if (message.streamName != null && Object.hasOwnProperty.call(message, "streamName"))
writer.uint32(/* id 8, wireType 2 =*/66).string(message.streamName);
if (message.streamCode != null && Object.hasOwnProperty.call(message, "streamCode"))
writer.uint32(/* id 9, wireType 2 =*/74).string(message.streamCode);
if (message.streamNickname != null && Object.hasOwnProperty.call(message, "streamNickname"))
writer.uint32(/* id 10, wireType 2 =*/82).string(message.streamNickname);
if (message.desc != null && Object.hasOwnProperty.call(message, "desc"))
writer.uint32(/* id 11, wireType 2 =*/90).string(message.desc);
if (message.videoCount != null && Object.hasOwnProperty.call(message, "videoCount"))
writer.uint32(/* id 12, wireType 0 =*/96).int32(message.videoCount);
if (message.videoArray != null && message.videoArray.length)
for (var i = 0; i < message.videoArray.length; ++i)
$root.xyz.playedu.common.Message.MonitoringVideoItem.encode(message.videoArray[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
return writer;
};
/**
* Encodes the specified MonitoringWarnInfo message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.MonitoringWarnInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @static
* @param {xyz.playedu.common.Message.IMonitoringWarnInfo} message MonitoringWarnInfo message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
MonitoringWarnInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a MonitoringWarnInfo message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.MonitoringWarnInfo} MonitoringWarnInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
MonitoringWarnInfo.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.MonitoringWarnInfo();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.controlCode = reader.string();
break;
}
case 2: {
message.flowMode = reader.int32();
break;
}
case 3: {
message.flowCode = reader.string();
break;
}
case 4: {
message.flowName = reader.string();
break;
}
case 5: {
message.drawType = reader.int32();
break;
}
case 6: {
message.flag = reader.string();
break;
}
case 7: {
message.streamApp = reader.string();
break;
}
case 8: {
message.streamName = reader.string();
break;
}
case 9: {
message.streamCode = reader.string();
break;
}
case 10: {
message.streamNickname = reader.string();
break;
}
case 11: {
message.desc = reader.string();
break;
}
case 12: {
message.videoCount = reader.int32();
break;
}
case 13: {
if (!(message.videoArray && message.videoArray.length))
message.videoArray = [];
message.videoArray.push($root.xyz.playedu.common.Message.MonitoringVideoItem.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a MonitoringWarnInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.MonitoringWarnInfo} MonitoringWarnInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
MonitoringWarnInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a MonitoringWarnInfo message.
* @function verify
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
MonitoringWarnInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.controlCode != null && message.hasOwnProperty("controlCode"))
if (!$util.isString(message.controlCode))
return "controlCode: string expected";
if (message.flowMode != null && message.hasOwnProperty("flowMode"))
if (!$util.isInteger(message.flowMode))
return "flowMode: integer expected";
if (message.flowCode != null && message.hasOwnProperty("flowCode"))
if (!$util.isString(message.flowCode))
return "flowCode: string expected";
if (message.flowName != null && message.hasOwnProperty("flowName"))
if (!$util.isString(message.flowName))
return "flowName: string expected";
if (message.drawType != null && message.hasOwnProperty("drawType"))
if (!$util.isInteger(message.drawType))
return "drawType: integer expected";
if (message.flag != null && message.hasOwnProperty("flag"))
if (!$util.isString(message.flag))
return "flag: string expected";
if (message.streamApp != null && message.hasOwnProperty("streamApp"))
if (!$util.isString(message.streamApp))
return "streamApp: string expected";
if (message.streamName != null && message.hasOwnProperty("streamName"))
if (!$util.isString(message.streamName))
return "streamName: string expected";
if (message.streamCode != null && message.hasOwnProperty("streamCode"))
if (!$util.isString(message.streamCode))
return "streamCode: string expected";
if (message.streamNickname != null && message.hasOwnProperty("streamNickname"))
if (!$util.isString(message.streamNickname))
return "streamNickname: string expected";
if (message.desc != null && message.hasOwnProperty("desc"))
if (!$util.isString(message.desc))
return "desc: string expected";
if (message.videoCount != null && message.hasOwnProperty("videoCount"))
if (!$util.isInteger(message.videoCount))
return "videoCount: integer expected";
if (message.videoArray != null && message.hasOwnProperty("videoArray")) {
if (!Array.isArray(message.videoArray))
return "videoArray: array expected";
for (var i = 0; i < message.videoArray.length; ++i) {
var error = $root.xyz.playedu.common.Message.MonitoringVideoItem.verify(message.videoArray[i]);
if (error)
return "videoArray." + error;
}
}
return null;
};
/**
* Creates a MonitoringWarnInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.MonitoringWarnInfo} MonitoringWarnInfo
*/
MonitoringWarnInfo.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.MonitoringWarnInfo)
return object;
var message = new $root.xyz.playedu.common.Message.MonitoringWarnInfo();
if (object.controlCode != null)
message.controlCode = String(object.controlCode);
if (object.flowMode != null)
message.flowMode = object.flowMode | 0;
if (object.flowCode != null)
message.flowCode = String(object.flowCode);
if (object.flowName != null)
message.flowName = String(object.flowName);
if (object.drawType != null)
message.drawType = object.drawType | 0;
if (object.flag != null)
message.flag = String(object.flag);
if (object.streamApp != null)
message.streamApp = String(object.streamApp);
if (object.streamName != null)
message.streamName = String(object.streamName);
if (object.streamCode != null)
message.streamCode = String(object.streamCode);
if (object.streamNickname != null)
message.streamNickname = String(object.streamNickname);
if (object.desc != null)
message.desc = String(object.desc);
if (object.videoCount != null)
message.videoCount = object.videoCount | 0;
if (object.videoArray) {
if (!Array.isArray(object.videoArray))
throw TypeError(".xyz.playedu.common.Message.MonitoringWarnInfo.videoArray: array expected");
message.videoArray = [];
for (var i = 0; i < object.videoArray.length; ++i) {
if (typeof object.videoArray[i] !== "object")
throw TypeError(".xyz.playedu.common.Message.MonitoringWarnInfo.videoArray: object expected");
message.videoArray[i] = $root.xyz.playedu.common.Message.MonitoringVideoItem.fromObject(object.videoArray[i]);
}
}
return message;
};
/**
* Creates a plain object from a MonitoringWarnInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @static
* @param {xyz.playedu.common.Message.MonitoringWarnInfo} message MonitoringWarnInfo
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
MonitoringWarnInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.videoArray = [];
if (options.defaults) {
object.controlCode = "";
object.flowMode = 0;
object.flowCode = "";
object.flowName = "";
object.drawType = 0;
object.flag = "";
object.streamApp = "";
object.streamName = "";
object.streamCode = "";
object.streamNickname = "";
object.desc = "";
object.videoCount = 0;
}
if (message.controlCode != null && message.hasOwnProperty("controlCode"))
object.controlCode = message.controlCode;
if (message.flowMode != null && message.hasOwnProperty("flowMode"))
object.flowMode = message.flowMode;
if (message.flowCode != null && message.hasOwnProperty("flowCode"))
object.flowCode = message.flowCode;
if (message.flowName != null && message.hasOwnProperty("flowName"))
object.flowName = message.flowName;
if (message.drawType != null && message.hasOwnProperty("drawType"))
object.drawType = message.drawType;
if (message.flag != null && message.hasOwnProperty("flag"))
object.flag = message.flag;
if (message.streamApp != null && message.hasOwnProperty("streamApp"))
object.streamApp = message.streamApp;
if (message.streamName != null && message.hasOwnProperty("streamName"))
object.streamName = message.streamName;
if (message.streamCode != null && message.hasOwnProperty("streamCode"))
object.streamCode = message.streamCode;
if (message.streamNickname != null && message.hasOwnProperty("streamNickname"))
object.streamNickname = message.streamNickname;
if (message.desc != null && message.hasOwnProperty("desc"))
object.desc = message.desc;
if (message.videoCount != null && message.hasOwnProperty("videoCount"))
object.videoCount = message.videoCount;
if (message.videoArray && message.videoArray.length) {
object.videoArray = [];
for (var j = 0; j < message.videoArray.length; ++j)
object.videoArray[j] = $root.xyz.playedu.common.Message.MonitoringVideoItem.toObject(message.videoArray[j], options);
}
return object;
};
/**
* Converts this MonitoringWarnInfo to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
MonitoringWarnInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for MonitoringWarnInfo
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.MonitoringWarnInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
MonitoringWarnInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.MonitoringWarnInfo";
};
return MonitoringWarnInfo;
})();
Message.MonitoringVideoItem = (function() {
/**
* Properties of a MonitoringVideoItem.
* @memberof xyz.playedu.common.Message
* @interface IMonitoringVideoItem
* @property {number|null} [index] MonitoringVideoItem index
* @property {string|null} [videoPath] MonitoringVideoItem videoPath
* @property {string|null} [videoUrl] MonitoringVideoItem videoUrl
* @property {string|null} [base64Str] MonitoringVideoItem base64Str
*/
/**
* Constructs a new MonitoringVideoItem.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a MonitoringVideoItem.
* @implements IMonitoringVideoItem
* @constructor
* @param {xyz.playedu.common.Message.IMonitoringVideoItem=} [properties] Properties to set
*/
function MonitoringVideoItem(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* MonitoringVideoItem index.
* @member {number} index
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @instance
*/
MonitoringVideoItem.prototype.index = 0;
/**
* MonitoringVideoItem videoPath.
* @member {string} videoPath
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @instance
*/
MonitoringVideoItem.prototype.videoPath = "";
/**
* MonitoringVideoItem videoUrl.
* @member {string} videoUrl
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @instance
*/
MonitoringVideoItem.prototype.videoUrl = "";
/**
* MonitoringVideoItem base64Str.
* @member {string} base64Str
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @instance
*/
MonitoringVideoItem.prototype.base64Str = "";
/**
* Creates a new MonitoringVideoItem instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @static
* @param {xyz.playedu.common.Message.IMonitoringVideoItem=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.MonitoringVideoItem} MonitoringVideoItem instance
*/
MonitoringVideoItem.create = function create(properties) {
return new MonitoringVideoItem(properties);
};
/**
* Encodes the specified MonitoringVideoItem message. Does not implicitly {@link xyz.playedu.common.Message.MonitoringVideoItem.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @static
* @param {xyz.playedu.common.Message.IMonitoringVideoItem} message MonitoringVideoItem message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
MonitoringVideoItem.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.index != null && Object.hasOwnProperty.call(message, "index"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.index);
if (message.videoPath != null && Object.hasOwnProperty.call(message, "videoPath"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.videoPath);
if (message.videoUrl != null && Object.hasOwnProperty.call(message, "videoUrl"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.videoUrl);
if (message.base64Str != null && Object.hasOwnProperty.call(message, "base64Str"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.base64Str);
return writer;
};
/**
* Encodes the specified MonitoringVideoItem message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.MonitoringVideoItem.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @static
* @param {xyz.playedu.common.Message.IMonitoringVideoItem} message MonitoringVideoItem message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
MonitoringVideoItem.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a MonitoringVideoItem message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.MonitoringVideoItem} MonitoringVideoItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
MonitoringVideoItem.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.MonitoringVideoItem();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.index = reader.int32();
break;
}
case 2: {
message.videoPath = reader.string();
break;
}
case 3: {
message.videoUrl = reader.string();
break;
}
case 4: {
message.base64Str = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a MonitoringVideoItem message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.MonitoringVideoItem} MonitoringVideoItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
MonitoringVideoItem.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a MonitoringVideoItem message.
* @function verify
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
MonitoringVideoItem.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.index != null && message.hasOwnProperty("index"))
if (!$util.isInteger(message.index))
return "index: integer expected";
if (message.videoPath != null && message.hasOwnProperty("videoPath"))
if (!$util.isString(message.videoPath))
return "videoPath: string expected";
if (message.videoUrl != null && message.hasOwnProperty("videoUrl"))
if (!$util.isString(message.videoUrl))
return "videoUrl: string expected";
if (message.base64Str != null && message.hasOwnProperty("base64Str"))
if (!$util.isString(message.base64Str))
return "base64Str: string expected";
return null;
};
/**
* Creates a MonitoringVideoItem message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.MonitoringVideoItem} MonitoringVideoItem
*/
MonitoringVideoItem.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.MonitoringVideoItem)
return object;
var message = new $root.xyz.playedu.common.Message.MonitoringVideoItem();
if (object.index != null)
message.index = object.index | 0;
if (object.videoPath != null)
message.videoPath = String(object.videoPath);
if (object.videoUrl != null)
message.videoUrl = String(object.videoUrl);
if (object.base64Str != null)
message.base64Str = String(object.base64Str);
return message;
};
/**
* Creates a plain object from a MonitoringVideoItem message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @static
* @param {xyz.playedu.common.Message.MonitoringVideoItem} message MonitoringVideoItem
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
MonitoringVideoItem.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.index = 0;
object.videoPath = "";
object.videoUrl = "";
object.base64Str = "";
}
if (message.index != null && message.hasOwnProperty("index"))
object.index = message.index;
if (message.videoPath != null && message.hasOwnProperty("videoPath"))
object.videoPath = message.videoPath;
if (message.videoUrl != null && message.hasOwnProperty("videoUrl"))
object.videoUrl = message.videoUrl;
if (message.base64Str != null && message.hasOwnProperty("base64Str"))
object.base64Str = message.base64Str;
return object;
};
/**
* Converts this MonitoringVideoItem to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @instance
* @returns {Object.<string,*>} JSON object
*/
MonitoringVideoItem.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for MonitoringVideoItem
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.MonitoringVideoItem
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
MonitoringVideoItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.MonitoringVideoItem";
};
return MonitoringVideoItem;
})();
Message.ScoreItem = (function() {
/**
* Properties of a ScoreItem.
* @memberof xyz.playedu.common.Message
* @interface IScoreItem
* @property {number|null} [id] ScoreItem id
* @property {Array.<xyz.playedu.common.Message.IScoreStep>|null} [steps] ScoreItem steps
*/
/**
* Constructs a new ScoreItem.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a ScoreItem.
* @implements IScoreItem
* @constructor
* @param {xyz.playedu.common.Message.IScoreItem=} [properties] Properties to set
*/
function ScoreItem(properties) {
this.steps = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ScoreItem id.
* @member {number} id
* @memberof xyz.playedu.common.Message.ScoreItem
* @instance
*/
ScoreItem.prototype.id = 0;
/**
* ScoreItem steps.
* @member {Array.<xyz.playedu.common.Message.IScoreStep>} steps
* @memberof xyz.playedu.common.Message.ScoreItem
* @instance
*/
ScoreItem.prototype.steps = $util.emptyArray;
/**
* Creates a new ScoreItem instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.ScoreItem
* @static
* @param {xyz.playedu.common.Message.IScoreItem=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.ScoreItem} ScoreItem instance
*/
ScoreItem.create = function create(properties) {
return new ScoreItem(properties);
};
/**
* Encodes the specified ScoreItem message. Does not implicitly {@link xyz.playedu.common.Message.ScoreItem.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.ScoreItem
* @static
* @param {xyz.playedu.common.Message.IScoreItem} message ScoreItem message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ScoreItem.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
if (message.steps != null && message.steps.length)
for (var i = 0; i < message.steps.length; ++i)
$root.xyz.playedu.common.Message.ScoreStep.encode(message.steps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
return writer;
};
/**
* Encodes the specified ScoreItem message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.ScoreItem.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.ScoreItem
* @static
* @param {xyz.playedu.common.Message.IScoreItem} message ScoreItem message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ScoreItem.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ScoreItem message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.ScoreItem
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.ScoreItem} ScoreItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ScoreItem.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.ScoreItem();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.id = reader.int32();
break;
}
case 2: {
if (!(message.steps && message.steps.length))
message.steps = [];
message.steps.push($root.xyz.playedu.common.Message.ScoreStep.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ScoreItem message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.ScoreItem
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.ScoreItem} ScoreItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ScoreItem.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ScoreItem message.
* @function verify
* @memberof xyz.playedu.common.Message.ScoreItem
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ScoreItem.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.id != null && message.hasOwnProperty("id"))
if (!$util.isInteger(message.id))
return "id: integer expected";
if (message.steps != null && message.hasOwnProperty("steps")) {
if (!Array.isArray(message.steps))
return "steps: array expected";
for (var i = 0; i < message.steps.length; ++i) {
var error = $root.xyz.playedu.common.Message.ScoreStep.verify(message.steps[i]);
if (error)
return "steps." + error;
}
}
return null;
};
/**
* Creates a ScoreItem message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.ScoreItem
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.ScoreItem} ScoreItem
*/
ScoreItem.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.ScoreItem)
return object;
var message = new $root.xyz.playedu.common.Message.ScoreItem();
if (object.id != null)
message.id = object.id | 0;
if (object.steps) {
if (!Array.isArray(object.steps))
throw TypeError(".xyz.playedu.common.Message.ScoreItem.steps: array expected");
message.steps = [];
for (var i = 0; i < object.steps.length; ++i) {
if (typeof object.steps[i] !== "object")
throw TypeError(".xyz.playedu.common.Message.ScoreItem.steps: object expected");
message.steps[i] = $root.xyz.playedu.common.Message.ScoreStep.fromObject(object.steps[i]);
}
}
return message;
};
/**
* Creates a plain object from a ScoreItem message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.ScoreItem
* @static
* @param {xyz.playedu.common.Message.ScoreItem} message ScoreItem
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ScoreItem.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.steps = [];
if (options.defaults)
object.id = 0;
if (message.id != null && message.hasOwnProperty("id"))
object.id = message.id;
if (message.steps && message.steps.length) {
object.steps = [];
for (var j = 0; j < message.steps.length; ++j)
object.steps[j] = $root.xyz.playedu.common.Message.ScoreStep.toObject(message.steps[j], options);
}
return object;
};
/**
* Converts this ScoreItem to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.ScoreItem
* @instance
* @returns {Object.<string,*>} JSON object
*/
ScoreItem.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ScoreItem
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.ScoreItem
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ScoreItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.ScoreItem";
};
return ScoreItem;
})();
Message.ScoreStep = (function() {
/**
* Properties of a ScoreStep.
* @memberof xyz.playedu.common.Message
* @interface IScoreStep
* @property {number|null} [id] ScoreStep id
* @property {boolean|null} [finished] ScoreStep finished
* @property {number|null} [scoreStatus] ScoreStep scoreStatus
*/
/**
* Constructs a new ScoreStep.
* @memberof xyz.playedu.common.Message
* @classdesc Represents a ScoreStep.
* @implements IScoreStep
* @constructor
* @param {xyz.playedu.common.Message.IScoreStep=} [properties] Properties to set
*/
function ScoreStep(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ScoreStep id.
* @member {number} id
* @memberof xyz.playedu.common.Message.ScoreStep
* @instance
*/
ScoreStep.prototype.id = 0;
/**
* ScoreStep finished.
* @member {boolean} finished
* @memberof xyz.playedu.common.Message.ScoreStep
* @instance
*/
ScoreStep.prototype.finished = false;
/**
* ScoreStep scoreStatus.
* @member {number} scoreStatus
* @memberof xyz.playedu.common.Message.ScoreStep
* @instance
*/
ScoreStep.prototype.scoreStatus = 0;
/**
* Creates a new ScoreStep instance using the specified properties.
* @function create
* @memberof xyz.playedu.common.Message.ScoreStep
* @static
* @param {xyz.playedu.common.Message.IScoreStep=} [properties] Properties to set
* @returns {xyz.playedu.common.Message.ScoreStep} ScoreStep instance
*/
ScoreStep.create = function create(properties) {
return new ScoreStep(properties);
};
/**
* Encodes the specified ScoreStep message. Does not implicitly {@link xyz.playedu.common.Message.ScoreStep.verify|verify} messages.
* @function encode
* @memberof xyz.playedu.common.Message.ScoreStep
* @static
* @param {xyz.playedu.common.Message.IScoreStep} message ScoreStep message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ScoreStep.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
if (message.finished != null && Object.hasOwnProperty.call(message, "finished"))
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finished);
if (message.scoreStatus != null && Object.hasOwnProperty.call(message, "scoreStatus"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.scoreStatus);
return writer;
};
/**
* Encodes the specified ScoreStep message, length delimited. Does not implicitly {@link xyz.playedu.common.Message.ScoreStep.verify|verify} messages.
* @function encodeDelimited
* @memberof xyz.playedu.common.Message.ScoreStep
* @static
* @param {xyz.playedu.common.Message.IScoreStep} message ScoreStep message or plain object to encode
* @param {protobuf.Writer} [writer] Writer to encode to
* @returns {protobuf.Writer} Writer
*/
ScoreStep.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ScoreStep message from the specified reader or buffer.
* @function decode
* @memberof xyz.playedu.common.Message.ScoreStep
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {xyz.playedu.common.Message.ScoreStep} ScoreStep
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ScoreStep.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.xyz.playedu.common.Message.ScoreStep();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.id = reader.int32();
break;
}
case 2: {
message.finished = reader.bool();
break;
}
case 3: {
message.scoreStatus = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ScoreStep message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof xyz.playedu.common.Message.ScoreStep
* @static
* @param {protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {xyz.playedu.common.Message.ScoreStep} ScoreStep
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {protobuf.util.ProtocolError} If required fields are missing
*/
ScoreStep.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ScoreStep message.
* @function verify
* @memberof xyz.playedu.common.Message.ScoreStep
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ScoreStep.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.id != null && message.hasOwnProperty("id"))
if (!$util.isInteger(message.id))
return "id: integer expected";
if (message.finished != null && message.hasOwnProperty("finished"))
if (typeof message.finished !== "boolean")
return "finished: boolean expected";
if (message.scoreStatus != null && message.hasOwnProperty("scoreStatus"))
if (!$util.isInteger(message.scoreStatus))
return "scoreStatus: integer expected";
return null;
};
/**
* Creates a ScoreStep message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof xyz.playedu.common.Message.ScoreStep
* @static
* @param {Object.<string,*>} object Plain object
* @returns {xyz.playedu.common.Message.ScoreStep} ScoreStep
*/
ScoreStep.fromObject = function fromObject(object) {
if (object instanceof $root.xyz.playedu.common.Message.ScoreStep)
return object;
var message = new $root.xyz.playedu.common.Message.ScoreStep();
if (object.id != null)
message.id = object.id | 0;
if (object.finished != null)
message.finished = Boolean(object.finished);
if (object.scoreStatus != null)
message.scoreStatus = object.scoreStatus | 0;
return message;
};
/**
* Creates a plain object from a ScoreStep message. Also converts values to other types if specified.
* @function toObject
* @memberof xyz.playedu.common.Message.ScoreStep
* @static
* @param {xyz.playedu.common.Message.ScoreStep} message ScoreStep
* @param {protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ScoreStep.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.id = 0;
object.finished = false;
object.scoreStatus = 0;
}
if (message.id != null && message.hasOwnProperty("id"))
object.id = message.id;
if (message.finished != null && message.hasOwnProperty("finished"))
object.finished = message.finished;
if (message.scoreStatus != null && message.hasOwnProperty("scoreStatus"))
object.scoreStatus = message.scoreStatus;
return object;
};
/**
* Converts this ScoreStep to JSON.
* @function toJSON
* @memberof xyz.playedu.common.Message.ScoreStep
* @instance
* @returns {Object.<string,*>} JSON object
*/
ScoreStep.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ScoreStep
* @function getTypeUrl
* @memberof xyz.playedu.common.Message.ScoreStep
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ScoreStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/xyz.playedu.common.Message.ScoreStep";
};
return ScoreStep;
})();
return Message;
})();
return common;
})();
return playedu;
})();
return xyz;
})();