Class: Twilio::REST::Api::V2010::AccountContext::CallContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::CallContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/call.rb,
lib/twilio-ruby/rest/api/v2010/account/call/event.rb,
lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb,
lib/twilio-ruby/rest/api/v2010/account/call/stream.rb,
lib/twilio-ruby/rest/api/v2010/account/call/payment.rb,
lib/twilio-ruby/rest/api/v2010/account/call/recording.rb,
lib/twilio-ruby/rest/api/v2010/account/call/notification.rb,
lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb,
lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb,
lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message_subscription.rb
Defined Under Namespace
Classes: EventInstance, EventList, EventPage, NotificationContext, NotificationInstance, NotificationList, NotificationPage, PaymentContext, PaymentInstance, PaymentList, PaymentPage, RecordingContext, RecordingInstance, RecordingList, RecordingPage, SiprecContext, SiprecInstance, SiprecList, SiprecPage, StreamContext, StreamInstance, StreamList, StreamPage, TranscriptionContext, TranscriptionInstance, TranscriptionList, TranscriptionPage, UserDefinedMessageInstance, UserDefinedMessageList, UserDefinedMessagePage, UserDefinedMessageSubscriptionContext, UserDefinedMessageSubscriptionInstance, UserDefinedMessageSubscriptionList, UserDefinedMessageSubscriptionPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the CallInstance.
-
#events ⇒ EventList, EventContext
Access the events.
-
#fetch ⇒ CallInstance
Fetch the CallInstance.
-
#initialize(version, account_sid, sid) ⇒ CallContext
constructor
Initialize the CallContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#notifications(sid = :unset) ⇒ NotificationList, NotificationContext
Access the notifications.
-
#payments(sid = :unset) ⇒ PaymentList, PaymentContext
Access the payments.
-
#recordings(sid = :unset) ⇒ RecordingList, RecordingContext
Access the recordings.
-
#siprec(sid = :unset) ⇒ SiprecList, SiprecContext
Access the siprec.
-
#streams(sid = :unset) ⇒ StreamList, StreamContext
Access the streams.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#transcriptions(sid = :unset) ⇒ TranscriptionList, TranscriptionContext
Access the transcriptions.
-
#update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset) ⇒ CallInstance
Update the CallInstance.
-
#user_defined_message_subscriptions(sid = :unset) ⇒ UserDefinedMessageSubscriptionList, UserDefinedMessageSubscriptionContext
Access the user_defined_message_subscriptions.
-
#user_defined_messages ⇒ UserDefinedMessageList, UserDefinedMessageContext
Access the user_defined_messages.
Constructor Details
#initialize(version, account_sid, sid) ⇒ CallContext
Initialize the CallContext
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 320 def initialize(version, account_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:sid]}.json" # Dependents @events = nil @user_defined_messages = nil @transcriptions = nil @siprec = nil @user_defined_message_subscriptions = nil @payments = nil @recordings = nil @notifications = nil @streams = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the CallInstance
341 342 343 344 345 346 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 341 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#events ⇒ EventList, EventContext
Access the events
415 416 417 418 419 420 421 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 415 def events unless @events @events = EventList.new( @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], ) end @events end |
#fetch ⇒ CallInstance
Fetch the CallInstance
351 352 353 354 355 356 357 358 359 360 361 362 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 351 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) CallInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
576 577 578 579 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 576 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.CallContext #{context}>" end |
#notifications(sid = :unset) ⇒ NotificationList, NotificationContext
Access the notifications
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 532 def notifications(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return NotificationContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @notifications @notifications = NotificationList.new( @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], ) end @notifications end |
#payments(sid = :unset) ⇒ PaymentList, PaymentContext
Access the payments
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 494 def payments(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return PaymentContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @payments @payments = PaymentList.new( @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], ) end @payments end |
#recordings(sid = :unset) ⇒ RecordingList, RecordingContext
Access the recordings
513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 513 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], call_sid: @solution[:sid], ) end @recordings end |
#siprec(sid = :unset) ⇒ SiprecList, SiprecContext
Access the siprec
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 456 def siprec(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return SiprecContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @siprec @siprec = SiprecList.new( @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], ) end @siprec end |
#streams(sid = :unset) ⇒ StreamList, StreamContext
Access the streams
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 551 def streams(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return StreamContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @streams @streams = StreamList.new( @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], ) end @streams end |
#to_s ⇒ Object
Provide a user friendly representation
569 570 571 572 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 569 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.CallContext #{context}>" end |
#transcriptions(sid = :unset) ⇒ TranscriptionList, TranscriptionContext
Access the transcriptions
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 437 def transcriptions(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return TranscriptionContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @transcriptions @transcriptions = TranscriptionList.new( @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], ) end @transcriptions end |
#update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset) ⇒ CallInstance
Update the CallInstance
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 376 def update( url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset ) data = Twilio::Values.of({ 'Url' => url, 'Method' => method, 'Status' => status, 'FallbackUrl' => fallback_url, 'FallbackMethod' => fallback_method, 'StatusCallback' => status_callback, 'StatusCallbackMethod' => status_callback_method, 'Twiml' => twiml, 'TimeLimit' => time_limit, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) CallInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#user_defined_message_subscriptions(sid = :unset) ⇒ UserDefinedMessageSubscriptionList, UserDefinedMessageSubscriptionContext
Access the user_defined_message_subscriptions
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 475 def (sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return UserDefinedMessageSubscriptionContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @user_defined_message_subscriptions @user_defined_message_subscriptions = UserDefinedMessageSubscriptionList.new( @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], ) end @user_defined_message_subscriptions end |
#user_defined_messages ⇒ UserDefinedMessageList, UserDefinedMessageContext
Access the user_defined_messages
426 427 428 429 430 431 432 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 426 def unless @user_defined_messages @user_defined_messages = UserDefinedMessageList.new( @version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], ) end @user_defined_messages end |