Class: Twilio::REST::Api::V2010::AccountContext::CallContext::StreamInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::CallContext::StreamInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/call/stream.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created this Stream resource.
-
#call_sid ⇒ String
The SID of the [Call](www.twilio.com/docs/voice/api/call-resource) the Stream resource is associated with.
-
#context ⇒ StreamContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_updated ⇒ Time
The date and time in GMT that this resource was last updated, specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil) ⇒ StreamInstance
constructor
Initialize the StreamInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#name ⇒ String
The user-specified name of this Stream, if one was given when the Stream was created.
-
#sid ⇒ String
The SID of the Stream resource.
- #status ⇒ Status
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: nil) ⇒ StreamInstance
Update the StreamInstance.
-
#uri ⇒ String
The URI of the resource, relative to ‘api.twilio.com`.
Constructor Details
#initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil) ⇒ StreamInstance
Initialize the StreamInstance
778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 778 def initialize(version, payload , account_sid: nil, call_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'call_sid' => payload['call_sid'], 'name' => payload['name'], 'status' => payload['status'], 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'uri' => payload['uri'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid ,'call_sid' => call_sid || @properties['call_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created this Stream resource.
816 817 818 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 816 def account_sid @properties['account_sid'] end |
#call_sid ⇒ String
Returns The SID of the [Call](www.twilio.com/docs/voice/api/call-resource) the Stream resource is associated with.
822 823 824 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 822 def call_sid @properties['call_sid'] end |
#context ⇒ StreamContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
801 802 803 804 805 806 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 801 def context unless @instance_context @instance_context = StreamContext.new(@version , @params['account_sid'], @params['call_sid'], @params['sid']) end @instance_context end |
#date_updated ⇒ Time
Returns The date and time in GMT that this resource was last updated, specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
840 841 842 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 840 def date_updated @properties['date_updated'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
872 873 874 875 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 872 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.StreamInstance #{values}>" end |
#name ⇒ String
Returns The user-specified name of this Stream, if one was given when the Stream was created. This can be used to stop the Stream.
828 829 830 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 828 def name @properties['name'] end |
#sid ⇒ String
Returns The SID of the Stream resource.
810 811 812 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 810 def sid @properties['sid'] end |
#status ⇒ Status
834 835 836 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 834 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
865 866 867 868 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 865 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.StreamInstance #{values}>" end |
#update(status: nil) ⇒ StreamInstance
Update the StreamInstance
854 855 856 857 858 859 860 861 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 854 def update( status: nil ) context.update( status: status, ) end |
#uri ⇒ String
Returns The URI of the resource, relative to ‘api.twilio.com`.
846 847 848 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 846 def uri @properties['uri'] end |