You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					45 lines
				
				1.5 KiB
			
		
		
			
		
	
	
					45 lines
				
				1.5 KiB
			| 
								 
											3 years ago
										 
									 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 @module resources/Conferences
							 | 
						||
| 
								 | 
							
								 The Twilio "Conferences" Resource.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								var generate = require('./generate');
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								module.exports = function (client, accountSid) {
							 | 
						||
| 
								 | 
							
								    var baseResourceUrl = '/Accounts/' + accountSid + '/Conferences';
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    //Instance requests
							 | 
						||
| 
								 | 
							
								    function Conferences(sid) {
							 | 
						||
| 
								 | 
							
								        var resourceApi = {
							 | 
						||
| 
								 | 
							
								            get:generate(client, 'GET', baseResourceUrl + '/' + sid)
							 | 
						||
| 
								 | 
							
								        };
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        //Add in subresources
							 | 
						||
| 
								 | 
							
								        resourceApi.participants = function(participantSid) {
							 | 
						||
| 
								 | 
							
								            var participantResourceApi = {
							 | 
						||
| 
								 | 
							
								                get:generate(client, 'GET', baseResourceUrl + '/' + sid + '/Participants/' + participantSid),
							 | 
						||
| 
								 | 
							
								                post:generate(client, 'POST', baseResourceUrl + '/' + sid + '/Participants/' + participantSid),
							 | 
						||
| 
								 | 
							
								                delete:generate(client, 'DELETE', baseResourceUrl + '/' + sid + '/Participants/' + participantSid)
							 | 
						||
| 
								 | 
							
								            };
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            //Aliases
							 | 
						||
| 
								 | 
							
								            participantResourceApi.update = participantResourceApi.post;
							 | 
						||
| 
								 | 
							
								            participantResourceApi.kick = participantResourceApi.delete;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            return participantResourceApi;
							 | 
						||
| 
								 | 
							
								        };
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        resourceApi.participants.get = generate(client, 'GET', baseResourceUrl + '/' + sid + '/Participants');
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        //Aliases
							 | 
						||
| 
								 | 
							
								        resourceApi.participants.list = resourceApi.participants.get;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        return resourceApi;
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    //List requests
							 | 
						||
| 
								 | 
							
								    Conferences.get = generate(client, 'GET', baseResourceUrl);
							 | 
						||
| 
								 | 
							
								    Conferences.list = Conferences.get;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    return Conferences;
							 | 
						||
| 
								 | 
							
								};
							 |