Class: Twilio::REST::Api::V2010::AccountContext::ConferenceContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::ConferenceContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/conference.rb,
lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb,
lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb
Defined Under Namespace
Classes: ParticipantContext, ParticipantInstance, ParticipantList, ParticipantPage, RecordingContext, RecordingInstance, RecordingList, RecordingPage
Instance Method Summary collapse
-
#fetch ⇒ ConferenceInstance
Fetch the ConferenceInstance.
-
#initialize(version, account_sid, sid) ⇒ ConferenceContext
constructor
Initialize the ConferenceContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#participants(call_sid = :unset) ⇒ ParticipantList, ParticipantContext
Access the participants.
-
#recordings(sid = :unset) ⇒ RecordingList, RecordingContext
Access the recordings.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: :unset, announce_url: :unset, announce_method: :unset) ⇒ ConferenceInstance
Update the ConferenceInstance.
Constructor Details
#initialize(version, account_sid, sid) ⇒ ConferenceContext
Initialize the ConferenceContext
187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 187 def initialize(version, account_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/Conferences/#{@solution[:sid]}.json" # Dependents @recordings = nil @participants = nil end |
Instance Method Details
#fetch ⇒ ConferenceInstance
Fetch the ConferenceInstance
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 201 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ConferenceInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
299 300 301 302 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 299 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.ConferenceContext #{context}>" end |
#participants(call_sid = :unset) ⇒ ParticipantList, ParticipantContext
Access the participants
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 274 def participants(call_sid=:unset) raise ArgumentError, 'call_sid cannot be nil' if call_sid.nil? if call_sid != :unset return ParticipantContext.new(@version, @solution[:account_sid], @solution[:sid],call_sid ) end unless @participants @participants = ParticipantList.new( @version, account_sid: @solution[:account_sid], conference_sid: @solution[:sid], ) end @participants end |
#recordings(sid = :unset) ⇒ RecordingList, RecordingContext
Access the recordings
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 255 def recordings(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return RecordingContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @recordings @recordings = RecordingList.new( @version, account_sid: @solution[:account_sid], conference_sid: @solution[:sid], ) end @recordings end |
#to_s ⇒ Object
Provide a user friendly representation
292 293 294 295 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 292 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.ConferenceContext #{context}>" end |
#update(status: :unset, announce_url: :unset, announce_method: :unset) ⇒ ConferenceInstance
Update the ConferenceInstance
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 224 def update( status: :unset, announce_url: :unset, announce_method: :unset ) data = Twilio::Values.of({ 'Status' => status, 'AnnounceUrl' => announce_url, 'AnnounceMethod' => announce_method, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ConferenceInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |