/* Autogenerated with Kurento Idl */
/*
* (C) Copyright 2013-2015 Kurento (https://kurento.openvidu.io/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var inherits = require('inherits');
var kurentoClient = require('kurento-client');
var checkType = kurentoClient.checkType;
var ChecktypeError = checkType.ChecktypeError;
var ComplexType = require('./ComplexType');
/**
* A dictionary that represents the stats gathered.
*
* @constructor module:core/complexTypes.MediaLatencyStat
*
* @property {external:String} name
* The identifier of the media stream
* @property {module:core/complexTypes.MediaType} type
* Type of media stream
* @property {external:double} avg
* The average time that buffers take to get on the input pad of this element
*/
function MediaLatencyStat(mediaLatencyStatDict){
if(!(this instanceof MediaLatencyStat))
return new MediaLatencyStat(mediaLatencyStatDict)
mediaLatencyStatDict = mediaLatencyStatDict || {}
// Check mediaLatencyStatDict has the required fields
//
// checkType('String', 'mediaLatencyStatDict.name', mediaLatencyStatDict.name, {required: true});
//
// checkType('MediaType', 'mediaLatencyStatDict.type', mediaLatencyStatDict.type, {required: true});
//
// checkType('double', 'mediaLatencyStatDict.avg', mediaLatencyStatDict.avg, {required: true});
//
// Init parent class
MediaLatencyStat.super_.call(this, mediaLatencyStatDict)
// Set object properties
Object.defineProperties(this, {
name: {
writable: true,
enumerable: true,
value: mediaLatencyStatDict.name
},
type: {
writable: true,
enumerable: true,
value: mediaLatencyStatDict.type
},
avg: {
writable: true,
enumerable: true,
value: mediaLatencyStatDict.avg
}
})
}
inherits(MediaLatencyStat, ComplexType)
// Private identifiers to allow re-construction of the complexType on the server
// They need to be enumerable so JSON.stringify() can access to them
Object.defineProperties(MediaLatencyStat.prototype, {
__module__: {
enumerable: true,
value: "kurento"
},
__type__: {
enumerable: true,
value: "MediaLatencyStat"
}
})
/**
* Checker for {@link module:core/complexTypes.MediaLatencyStat}
*
* @memberof module:core/complexTypes
*
* @param {external:String} key
* @param {module:core/complexTypes.MediaLatencyStat} value
*/
function checkMediaLatencyStat(key, value)
{
if(!(value instanceof MediaLatencyStat))
throw ChecktypeError(key, MediaLatencyStat, value);
};
module.exports = MediaLatencyStat;
MediaLatencyStat.check = checkMediaLatencyStat;