UNPKG

kurento-client-core

Version:

JavaScript Client API for Kurento Media Server

120 lines (103 loc) 3.33 kB
/* 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'); /** * Description of the media server * * @constructor module:core/complexTypes.ServerInfo * * @property {external:String} version * MediaServer version * @property {module:core/complexTypes.ModuleInfo} modules * Descriptor of all modules loaded by the server * @property {module:core/complexTypes.ServerType} type * Describes the type of media server * @property {external:String} capabilities * Describes the capabilities that this server supports */ function ServerInfo(serverInfoDict){ if(!(this instanceof ServerInfo)) return new ServerInfo(serverInfoDict) serverInfoDict = serverInfoDict || {} // Check serverInfoDict has the required fields // // checkType('String', 'serverInfoDict.version', serverInfoDict.version, {required: true}); // // checkType('ModuleInfo', 'serverInfoDict.modules', serverInfoDict.modules, {isArray: true, required: true}); // // checkType('ServerType', 'serverInfoDict.type', serverInfoDict.type, {required: true}); // // checkType('String', 'serverInfoDict.capabilities', serverInfoDict.capabilities, {isArray: true, required: true}); // // Init parent class ServerInfo.super_.call(this, serverInfoDict) // Set object properties Object.defineProperties(this, { version: { writable: true, enumerable: true, value: serverInfoDict.version }, modules: { writable: true, enumerable: true, value: serverInfoDict.modules }, type: { writable: true, enumerable: true, value: serverInfoDict.type }, capabilities: { writable: true, enumerable: true, value: serverInfoDict.capabilities } }) } inherits(ServerInfo, 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(ServerInfo.prototype, { __module__: { enumerable: true, value: "kurento" }, __type__: { enumerable: true, value: "ServerInfo" } }) /** * Checker for {@link module:core/complexTypes.ServerInfo} * * @memberof module:core/complexTypes * * @param {external:String} key * @param {module:core/complexTypes.ServerInfo} value */ function checkServerInfo(key, value) { if(!(value instanceof ServerInfo)) throw ChecktypeError(key, ServerInfo, value); }; module.exports = ServerInfo; ServerInfo.check = checkServerInfo;