/* 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');
/**
* Used to customize the offer created by
* <code>SdpEndpoint.generateOffer</code>.
*
* @constructor module:core/complexTypes.OfferOptions
*
* @property {external:Boolean} offerToReceiveAudio
* Whether or not to offer to the remote peer the opportunity to send audio.
* @property {external:Boolean} offerToReceiveVideo
* Whether or not to offer to the remote peer the opportunity to send video.
*/
function OfferOptions(offerOptionsDict){
if(!(this instanceof OfferOptions))
return new OfferOptions(offerOptionsDict)
offerOptionsDict = offerOptionsDict || {}
// Check offerOptionsDict has the required fields
//
// checkType('boolean', 'offerOptionsDict.offerToReceiveAudio', offerOptionsDict.offerToReceiveAudio);
//
// checkType('boolean', 'offerOptionsDict.offerToReceiveVideo', offerOptionsDict.offerToReceiveVideo);
//
// Init parent class
OfferOptions.super_.call(this, offerOptionsDict)
// Set object properties
Object.defineProperties(this, {
offerToReceiveAudio: {
writable: true,
enumerable: true,
value: offerOptionsDict.offerToReceiveAudio
},
offerToReceiveVideo: {
writable: true,
enumerable: true,
value: offerOptionsDict.offerToReceiveVideo
}
})
}
inherits(OfferOptions, 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(OfferOptions.prototype, {
__module__: {
enumerable: true,
value: "kurento"
},
__type__: {
enumerable: true,
value: "OfferOptions"
}
})
/**
* Checker for {@link module:core/complexTypes.OfferOptions}
*
* @memberof module:core/complexTypes
*
* @param {external:String} key
* @param {module:core/complexTypes.OfferOptions} value
*/
function checkOfferOptions(key, value)
{
if(!(value instanceof OfferOptions))
throw ChecktypeError(key, OfferOptions, value);
};
module.exports = OfferOptions;
OfferOptions.check = checkOfferOptions;