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/feedback.rb,
lib/twilio-ruby/rest/api/v2010/account/call/recording.rb,
lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
Defined Under Namespace
Classes: EventInstance, EventList, EventPage, FeedbackContext, FeedbackInstance, FeedbackList, FeedbackPage, NotificationContext, NotificationInstance, NotificationList, NotificationPage, PaymentContext, PaymentInstance, PaymentList, PaymentPage, RecordingContext, RecordingInstance, RecordingList, RecordingPage, SiprecContext, SiprecInstance, SiprecList, SiprecPage, StreamContext, StreamInstance, StreamList, StreamPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the CallInstance.
-
#events ⇒ EventList, EventContext
Access the events.
-
#feedback ⇒ FeedbackList, FeedbackContext
Access the feedback.
-
#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.
-
#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.
Constructor Details
#initialize(version, account_sid, sid) ⇒ CallContext
Initialize the CallContext
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 432 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 @recordings = nil @notifications = nil @feedback = nil @events = nil @payments = nil @siprec = nil @streams = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the CallInstance
452 453 454 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 452 def delete @version.delete('DELETE', @uri) end |
#events ⇒ EventList, EventContext
Access the events
573 574 575 576 577 578 579 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 573 def events unless @events @events = EventList.new(@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], ) end @events end |
#feedback ⇒ FeedbackList, FeedbackContext
Access the feedback
565 566 567 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 565 def feedback FeedbackContext.new(@version, @solution[:account_sid], @solution[:sid], ) end |
#fetch ⇒ CallInstance
Fetch the CallInstance
459 460 461 462 463 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 459 def fetch payload = @version.fetch('GET', @uri) CallInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
648 649 650 651 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 648 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.CallContext #{context}>" end |
#notifications(sid = :unset) ⇒ NotificationList, NotificationContext
Access the notifications
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 543 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
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 585 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
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 521 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
607 608 609 610 611 612 613 614 615 616 617 618 619 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 607 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
625 626 627 628 629 630 631 632 633 634 635 636 637 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 625 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
641 642 643 644 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 641 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.CallContext #{context}>" 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
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 499 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, }) payload = @version.update('POST', @uri, data: data) CallInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |