Class: Twilio::REST::Api::V2010::AccountContext::CallContext::StreamContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::CallContext::StreamContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/call/stream.rb
Instance Method Summary collapse
-
#initialize(version, account_sid, call_sid, sid) ⇒ StreamContext
constructor
Initialize the StreamContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: nil) ⇒ StreamInstance
Update the StreamInstance.
Constructor Details
#initialize(version, account_sid, call_sid, sid) ⇒ StreamContext
Initialize the StreamContext
687 688 689 690 691 692 693 694 695 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 687 def initialize(version, account_sid, call_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, call_sid: call_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:call_sid]}/Streams/#{@solution[:sid]}.json" end |
Instance Method Details
#inspect ⇒ Object
Provide a detailed, user friendly representation
734 735 736 737 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 734 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.StreamContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
727 728 729 730 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 727 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.StreamContext #{context}>" end |
#update(status: nil) ⇒ StreamInstance
Update the StreamInstance
700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 700 def update( status: nil ) data = Twilio::Values.of({ 'Status' => status, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) StreamInstance.new( @version, payload, account_sid: @solution[:account_sid], call_sid: @solution[:call_sid], sid: @solution[:sid], ) end |