Class: Telapi::Conference

Inherits:
Resource
  • Object
show all
Defined in:
lib/telapi/conference.rb

Overview

Wraps TelAPI Conference functionality

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#attributes, #initialize

Methods included from Network

api_uri, default_options, delete, post, response_format

Constructor Details

This class inherits a constructor from Telapi::Resource

Class Method Details

.get(conference_sid) ⇒ Object

Returns a Telapi::Conference object given its name See www.telapi.com/docs/api/rest/conferences/view/

Required params:

conference_sid

conference identifier



26
27
28
29
# File 'lib/telapi/conference.rb', line 26

def get(conference_sid)
  response = Network.get(['Conferences', conference_sid])
  Conference.new(response)
end

.list(optional_params = {}) ⇒ Object

Returns a resource collection containing Telapi::Conference objects See www.telapi.com/docs/api/rest/conferences/list/

Optional params is a hash containing:

FriendlyName

string

Status

init, in-progress, or completed

DateCreate

date in the following format: YYYY-MM-DD

DateUpdated

date in the following format: YYYY-MM-DD

Page

integer greater than 0

PageSize

integer greater than 0



16
17
18
19
# File 'lib/telapi/conference.rb', line 16

def list(optional_params = {})
  response = Network.get(['Conferences'], optional_params)
  ResourceCollection.new(response, 'conferences', self)
end

.participant(conference_sid, call_sid) ⇒ Object

Returns a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/view-participant/ Required params:

conference_sid

conference identifier

call_sid

call identifier



51
52
53
54
# File 'lib/telapi/conference.rb', line 51

def participant(conference_sid, call_sid)
  response = Network.get(['Conferences', conference_sid, 'Participants', call_sid])
  Participant.new(response)
end

.participants(conference_sid, optional_params = {}) ⇒ Object

Returns a resource collection containing Telapi::Participant objects See www.telapi.com/docs/api/rest/conferences/list-participants/ Required params:

conference_sid

conference identifier

Optional params:

Muted

true or (false)

Deaf

true or (false)

Page

integer greater than 0

PageSize

integer greater than 0



41
42
43
44
# File 'lib/telapi/conference.rb', line 41

def participants(conference_sid, optional_params = {})
  response = Network.get(['Conferences', conference_sid, 'Participants'], optional_params)
  ResourceCollection.new(response, 'participants', Participant)
end

Instance Method Details

#participant(call_sid) ⇒ Object

See ::participant Required params:

call_sid

call (participant) identifier



66
67
68
# File 'lib/telapi/conference.rb', line 66

def participant(call_sid)
  self.class.participant(self.sid, call_sid)
end

#participants(optional_params = {}) ⇒ Object

See ::participants



59
60
61
# File 'lib/telapi/conference.rb', line 59

def participants(optional_params = {})
  self.class.participants(self.sid, optional_params)
end