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
226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 226 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
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 241 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
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 261 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
404 405 406 407 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 404 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
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 379 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
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 360 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
397 398 399 400 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 397 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
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 290 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
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/twilio-ruby/rest/api/v2010/account/conference.rb', line 323 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 |