lio-tdi-client
Version:
A client for LIO Traveller Data Interface (TDI) endpoints with caching support.
735 lines (678 loc) • 809 kB
JavaScript
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";
var $protobuf = require("protobufjs/minimal");
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
$root.mhcc = (function() {
/**
* Namespace mhcc.
* @exports mhcc
* @namespace
*/
var mhcc = {};
mhcc.app = (function() {
/**
* Namespace app.
* @memberof mhcc
* @namespace
*/
var app = {};
app.dataprovider = (function() {
/**
* Namespace dataprovider.
* @memberof mhcc.app
* @namespace
*/
var dataprovider = {};
dataprovider.model = (function() {
/**
* Namespace model.
* @memberof mhcc.app.dataprovider
* @namespace
*/
var model = {};
model.tdiinterface = (function() {
/**
* Namespace tdiinterface.
* @memberof mhcc.app.dataprovider.model
* @namespace
*/
var tdiinterface = {};
tdiinterface.dstructs = (function() {
/**
* Namespace dstructs.
* @memberof mhcc.app.dataprovider.model.tdiinterface
* @namespace
*/
var dstructs = {};
dstructs.VersionTdiArray = (function() {
/**
* Properties of a VersionTdiArray.
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs
* @interface IVersionTdiArray
* @property {Array.<mhcc.app.dataprovider.model.tdiinterface.dstructs.IVersionTdi>|null} [versionTdiArray] VersionTdiArray versionTdiArray
*/
/**
* Constructs a new VersionTdiArray.
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs
* @classdesc Represents a VersionTdiArray.
* @implements IVersionTdiArray
* @constructor
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IVersionTdiArray=} [properties] Properties to set
*/
function VersionTdiArray(properties) {
this.versionTdiArray = [];
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]];
}
/**
* VersionTdiArray versionTdiArray.
* @member {Array.<mhcc.app.dataprovider.model.tdiinterface.dstructs.IVersionTdi>} versionTdiArray
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray
* @instance
*/
VersionTdiArray.prototype.versionTdiArray = $util.emptyArray;
/**
* Creates a new VersionTdiArray instance using the specified properties.
* @function create
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray
* @static
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IVersionTdiArray=} [properties] Properties to set
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray} VersionTdiArray instance
*/
VersionTdiArray.create = function create(properties) {
return new VersionTdiArray(properties);
};
/**
* Encodes the specified VersionTdiArray message. Does not implicitly {@link mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray.verify|verify} messages.
* @function encode
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray
* @static
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IVersionTdiArray} message VersionTdiArray message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
VersionTdiArray.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.versionTdiArray != null && message.versionTdiArray.length)
for (var i = 0; i < message.versionTdiArray.length; ++i)
$root.mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi.encode(message.versionTdiArray[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified VersionTdiArray message, length delimited. Does not implicitly {@link mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray.verify|verify} messages.
* @function encodeDelimited
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray
* @static
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IVersionTdiArray} message VersionTdiArray message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
VersionTdiArray.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a VersionTdiArray message from the specified reader or buffer.
* @function decode
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray} VersionTdiArray
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
VersionTdiArray.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (!(message.versionTdiArray && message.versionTdiArray.length))
message.versionTdiArray = [];
message.versionTdiArray.push($root.mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a VersionTdiArray message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray} VersionTdiArray
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
VersionTdiArray.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a VersionTdiArray message.
* @function verify
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
VersionTdiArray.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.versionTdiArray != null && message.hasOwnProperty("versionTdiArray")) {
if (!Array.isArray(message.versionTdiArray))
return "versionTdiArray: array expected";
for (var i = 0; i < message.versionTdiArray.length; ++i) {
var error = $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi.verify(message.versionTdiArray[i]);
if (error)
return "versionTdiArray." + error;
}
}
return null;
};
/**
* Creates a VersionTdiArray message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray
* @static
* @param {Object.<string,*>} object Plain object
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray} VersionTdiArray
*/
VersionTdiArray.fromObject = function fromObject(object) {
if (object instanceof $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray)
return object;
var message = new $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray();
if (object.versionTdiArray) {
if (!Array.isArray(object.versionTdiArray))
throw TypeError(".mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray.versionTdiArray: array expected");
message.versionTdiArray = [];
for (var i = 0; i < object.versionTdiArray.length; ++i) {
if (typeof object.versionTdiArray[i] !== "object")
throw TypeError(".mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray.versionTdiArray: object expected");
message.versionTdiArray[i] = $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi.fromObject(object.versionTdiArray[i]);
}
}
return message;
};
/**
* Creates a plain object from a VersionTdiArray message. Also converts values to other types if specified.
* @function toObject
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray
* @static
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray} message VersionTdiArray
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
VersionTdiArray.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.versionTdiArray = [];
if (message.versionTdiArray && message.versionTdiArray.length) {
object.versionTdiArray = [];
for (var j = 0; j < message.versionTdiArray.length; ++j)
object.versionTdiArray[j] = $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi.toObject(message.versionTdiArray[j], options);
}
return object;
};
/**
* Converts this VersionTdiArray to JSON.
* @function toJSON
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdiArray
* @instance
* @returns {Object.<string,*>} JSON object
*/
VersionTdiArray.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return VersionTdiArray;
})();
dstructs.VersionTdi = (function() {
/**
* Properties of a VersionTdi.
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs
* @interface IVersionTdi
* @property {number|Long} duid VersionTdi duid
* @property {number|Long} lastModificationTimestamp VersionTdi lastModificationTimestamp
* @property {boolean} isDeleted Determines whether this object is marked as 'deleted' in a logical sense.
* @property {number|Long|null} [baseVersion] VersionTdi baseVersion
*/
/**
* Constructs a new VersionTdi.
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs
* @classdesc structTag=0xc52a
* @implements IVersionTdi
* @constructor
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IVersionTdi=} [properties] Properties to set
*/
function VersionTdi(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]];
}
/**
* VersionTdi duid.
* @member {number|Long} duid
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @instance
*/
VersionTdi.prototype.duid = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* VersionTdi lastModificationTimestamp.
* @member {number|Long} lastModificationTimestamp
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @instance
*/
VersionTdi.prototype.lastModificationTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* Determines whether this object is marked as 'deleted' in a logical sense.
* @member {boolean} isDeleted
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @instance
*/
VersionTdi.prototype.isDeleted = false;
/**
* VersionTdi baseVersion.
* @member {number|Long} baseVersion
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @instance
*/
VersionTdi.prototype.baseVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* Creates a new VersionTdi instance using the specified properties.
* @function create
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @static
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IVersionTdi=} [properties] Properties to set
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi} VersionTdi instance
*/
VersionTdi.create = function create(properties) {
return new VersionTdi(properties);
};
/**
* Encodes the specified VersionTdi message. Does not implicitly {@link mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi.verify|verify} messages.
* @function encode
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @static
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IVersionTdi} message VersionTdi message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
VersionTdi.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
writer.uint32(/* id 1, wireType 0 =*/8).sint64(message.duid);
writer.uint32(/* id 2, wireType 0 =*/16).sint64(message.lastModificationTimestamp);
writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isDeleted);
if (message.baseVersion != null && Object.hasOwnProperty.call(message, "baseVersion"))
writer.uint32(/* id 32, wireType 0 =*/256).uint64(message.baseVersion);
return writer;
};
/**
* Encodes the specified VersionTdi message, length delimited. Does not implicitly {@link mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi.verify|verify} messages.
* @function encodeDelimited
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @static
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IVersionTdi} message VersionTdi message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
VersionTdi.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a VersionTdi message from the specified reader or buffer.
* @function decode
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi} VersionTdi
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
VersionTdi.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.duid = reader.sint64();
break;
case 2:
message.lastModificationTimestamp = reader.sint64();
break;
case 3:
message.isDeleted = reader.bool();
break;
case 32:
message.baseVersion = reader.uint64();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("duid"))
throw $util.ProtocolError("missing required 'duid'", { instance: message });
if (!message.hasOwnProperty("lastModificationTimestamp"))
throw $util.ProtocolError("missing required 'lastModificationTimestamp'", { instance: message });
if (!message.hasOwnProperty("isDeleted"))
throw $util.ProtocolError("missing required 'isDeleted'", { instance: message });
return message;
};
/**
* Decodes a VersionTdi message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi} VersionTdi
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
VersionTdi.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a VersionTdi message.
* @function verify
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
VersionTdi.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (!$util.isInteger(message.duid) && !(message.duid && $util.isInteger(message.duid.low) && $util.isInteger(message.duid.high)))
return "duid: integer|Long expected";
if (!$util.isInteger(message.lastModificationTimestamp) && !(message.lastModificationTimestamp && $util.isInteger(message.lastModificationTimestamp.low) && $util.isInteger(message.lastModificationTimestamp.high)))
return "lastModificationTimestamp: integer|Long expected";
if (typeof message.isDeleted !== "boolean")
return "isDeleted: boolean expected";
if (message.baseVersion != null && message.hasOwnProperty("baseVersion"))
if (!$util.isInteger(message.baseVersion) && !(message.baseVersion && $util.isInteger(message.baseVersion.low) && $util.isInteger(message.baseVersion.high)))
return "baseVersion: integer|Long expected";
return null;
};
/**
* Creates a VersionTdi message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @static
* @param {Object.<string,*>} object Plain object
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi} VersionTdi
*/
VersionTdi.fromObject = function fromObject(object) {
if (object instanceof $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi)
return object;
var message = new $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi();
if (object.duid != null)
if ($util.Long)
(message.duid = $util.Long.fromValue(object.duid)).unsigned = false;
else if (typeof object.duid === "string")
message.duid = parseInt(object.duid, 10);
else if (typeof object.duid === "number")
message.duid = object.duid;
else if (typeof object.duid === "object")
message.duid = new $util.LongBits(object.duid.low >>> 0, object.duid.high >>> 0).toNumber();
if (object.lastModificationTimestamp != null)
if ($util.Long)
(message.lastModificationTimestamp = $util.Long.fromValue(object.lastModificationTimestamp)).unsigned = false;
else if (typeof object.lastModificationTimestamp === "string")
message.lastModificationTimestamp = parseInt(object.lastModificationTimestamp, 10);
else if (typeof object.lastModificationTimestamp === "number")
message.lastModificationTimestamp = object.lastModificationTimestamp;
else if (typeof object.lastModificationTimestamp === "object")
message.lastModificationTimestamp = new $util.LongBits(object.lastModificationTimestamp.low >>> 0, object.lastModificationTimestamp.high >>> 0).toNumber();
if (object.isDeleted != null)
message.isDeleted = Boolean(object.isDeleted);
if (object.baseVersion != null)
if ($util.Long)
(message.baseVersion = $util.Long.fromValue(object.baseVersion)).unsigned = true;
else if (typeof object.baseVersion === "string")
message.baseVersion = parseInt(object.baseVersion, 10);
else if (typeof object.baseVersion === "number")
message.baseVersion = object.baseVersion;
else if (typeof object.baseVersion === "object")
message.baseVersion = new $util.LongBits(object.baseVersion.low >>> 0, object.baseVersion.high >>> 0).toNumber(true);
return message;
};
/**
* Creates a plain object from a VersionTdi message. Also converts values to other types if specified.
* @function toObject
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @static
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi} message VersionTdi
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
VersionTdi.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.duid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.duid = options.longs === String ? "0" : 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.lastModificationTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.lastModificationTimestamp = options.longs === String ? "0" : 0;
object.isDeleted = false;
if ($util.Long) {
var long = new $util.Long(0, 0, true);
object.baseVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.baseVersion = options.longs === String ? "0" : 0;
}
if (message.duid != null && message.hasOwnProperty("duid"))
if (typeof message.duid === "number")
object.duid = options.longs === String ? String(message.duid) : message.duid;
else
object.duid = options.longs === String ? $util.Long.prototype.toString.call(message.duid) : options.longs === Number ? new $util.LongBits(message.duid.low >>> 0, message.duid.high >>> 0).toNumber() : message.duid;
if (message.lastModificationTimestamp != null && message.hasOwnProperty("lastModificationTimestamp"))
if (typeof message.lastModificationTimestamp === "number")
object.lastModificationTimestamp = options.longs === String ? String(message.lastModificationTimestamp) : message.lastModificationTimestamp;
else
object.lastModificationTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.lastModificationTimestamp) : options.longs === Number ? new $util.LongBits(message.lastModificationTimestamp.low >>> 0, message.lastModificationTimestamp.high >>> 0).toNumber() : message.lastModificationTimestamp;
if (message.isDeleted != null && message.hasOwnProperty("isDeleted"))
object.isDeleted = message.isDeleted;
if (message.baseVersion != null && message.hasOwnProperty("baseVersion"))
if (typeof message.baseVersion === "number")
object.baseVersion = options.longs === String ? String(message.baseVersion) : message.baseVersion;
else
object.baseVersion = options.longs === String ? $util.Long.prototype.toString.call(message.baseVersion) : options.longs === Number ? new $util.LongBits(message.baseVersion.low >>> 0, message.baseVersion.high >>> 0).toNumber(true) : message.baseVersion;
return object;
};
/**
* Converts this VersionTdi to JSON.
* @function toJSON
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.VersionTdi
* @instance
* @returns {Object.<string,*>} JSON object
*/
VersionTdi.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return VersionTdi;
})();
dstructs.StopTdiArray = (function() {
/**
* Properties of a StopTdiArray.
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs
* @interface IStopTdiArray
* @property {Array.<mhcc.app.dataprovider.model.tdiinterface.dstructs.IStopTdi>|null} [stopTdiArray] StopTdiArray stopTdiArray
*/
/**
* Constructs a new StopTdiArray.
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs
* @classdesc Represents a StopTdiArray.
* @implements IStopTdiArray
* @constructor
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IStopTdiArray=} [properties] Properties to set
*/
function StopTdiArray(properties) {
this.stopTdiArray = [];
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]];
}
/**
* StopTdiArray stopTdiArray.
* @member {Array.<mhcc.app.dataprovider.model.tdiinterface.dstructs.IStopTdi>} stopTdiArray
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray
* @instance
*/
StopTdiArray.prototype.stopTdiArray = $util.emptyArray;
/**
* Creates a new StopTdiArray instance using the specified properties.
* @function create
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray
* @static
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IStopTdiArray=} [properties] Properties to set
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray} StopTdiArray instance
*/
StopTdiArray.create = function create(properties) {
return new StopTdiArray(properties);
};
/**
* Encodes the specified StopTdiArray message. Does not implicitly {@link mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray.verify|verify} messages.
* @function encode
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray
* @static
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IStopTdiArray} message StopTdiArray message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
StopTdiArray.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.stopTdiArray != null && message.stopTdiArray.length)
for (var i = 0; i < message.stopTdiArray.length; ++i)
$root.mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdi.encode(message.stopTdiArray[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified StopTdiArray message, length delimited. Does not implicitly {@link mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray.verify|verify} messages.
* @function encodeDelimited
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray
* @static
* @param {mhcc.app.dataprovider.model.tdiinterface.dstructs.IStopTdiArray} message StopTdiArray message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
StopTdiArray.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a StopTdiArray message from the specified reader or buffer.
* @function decode
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray} StopTdiArray
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
StopTdiArray.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (!(message.stopTdiArray && message.stopTdiArray.length))
message.stopTdiArray = [];
message.stopTdiArray.push($root.mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdi.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a StopTdiArray message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray} StopTdiArray
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
StopTdiArray.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a StopTdiArray message.
* @function verify
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
StopTdiArray.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.stopTdiArray != null && message.hasOwnProperty("stopTdiArray")) {
if (!Array.isArray(message.stopTdiArray))
return "stopTdiArray: array expected";
for (var i = 0; i < message.stopTdiArray.length; ++i) {
var error = $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdi.verify(message.stopTdiArray[i]);
if (error)
return "stopTdiArray." + error;
}
}
return null;
};
/**
* Creates a StopTdiArray message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray
* @static
* @param {Object.<string,*>} object Plain object
* @returns {mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray} StopTdiArray
*/
StopTdiArray.fromObject = function fromObject(object) {
if (object instanceof $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray)
return object;
var message = new $root.mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray();
if (object.stopTdiArray) {
if (!Array.isArray(object.stopTdiArray))
throw TypeError(".mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray.stopTdiArray: array expected");
message.stopTdiArray = [];
for (var i = 0; i < object.stopTdiArray.length; ++i) {
if (typeof object.stopTdiArray[i] !== "object")
throw TypeError(".mhcc.app.dataprovider.model.tdiinterface.dstructs.StopTdiArray.stopTdiArray: object expected");
message.stopTdiArray[i] = $r