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, ParticipantInstanceMetadata, ParticipantList, ParticipantListResponse, ParticipantPage, ParticipantPageMetadata, RecordingContext, RecordingInstance, RecordingInstanceMetadata, RecordingList, RecordingListResponse, RecordingPage, RecordingPageMetadata
Instance Method Summary collapse
-
#fetch ⇒ ConferenceInstance
Fetch the ConferenceInstance.
-
#fetch_with_metadata ⇒ ConferenceInstance
Fetch the ConferenceInstanceMetadata.
-
#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.
-
#update_with_metadata(status: :unset, announce_url: :unset, announce_method: :unset) ⇒ ConferenceInstance
Update the ConferenceInstanceMetadata.
Constructor Details
#initialize(version, account_sid, sid) ⇒ ConferenceContext
Initialize the ConferenceContext
234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 234 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
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 249 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 |
#fetch_with_metadata ⇒ ConferenceInstance
Fetch the ConferenceInstanceMetadata
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 269 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) conference_instance = ConferenceInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) ConferenceInstanceMetadata.new( @version, conference_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
412 413 414 415 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 412 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
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 387 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
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 368 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
405 406 407 408 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 405 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
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 298 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 |
#update_with_metadata(status: :unset, announce_url: :unset, announce_method: :unset) ⇒ ConferenceInstance
Update the ConferenceInstanceMetadata
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 331 def ( 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', }) response = @version.('POST', @uri, data: data, headers: headers) conference_instance = ConferenceInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) ConferenceInstanceMetadata.new( @version, conference_instance, response.headers, response.status_code ) end |