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 that created this resource.
-
#call_sid ⇒ String
The SID of the Call the 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 RFC 2822 date and time in GMT that this resource was last updated.
-
#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 name of this resource.
-
#sid ⇒ String
The SID of the Stream resource.
-
#status ⇒ stream.Status
The status - one of `stopped`, `in-progress`.
-
#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
570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 570 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, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created this resource.
613 614 615 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 613 def account_sid @properties['account_sid'] end |
#call_sid ⇒ String
Returns The SID of the Call the resource is associated with.
619 620 621 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 619 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
593 594 595 596 597 598 599 600 601 602 603 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 593 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 RFC 2822 date and time in GMT that this resource was last updated.
637 638 639 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 637 def date_updated @properties['date_updated'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
664 665 666 667 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 664 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.StreamInstance #{values}>" end |
#name ⇒ String
Returns The name of this resource.
625 626 627 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 625 def name @properties['name'] end |
#sid ⇒ String
Returns The SID of the Stream resource.
607 608 609 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 607 def sid @properties['sid'] end |
#status ⇒ stream.Status
Returns The status - one of `stopped`, `in-progress`.
631 632 633 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 631 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
657 658 659 660 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 657 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.StreamInstance #{values}>" end |
#update(status: nil) ⇒ StreamInstance
Update the StreamInstance
651 652 653 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 651 def update(status: nil) context.update(status: status, ) end |
#uri ⇒ String
Returns The URI of the resource, relative to `api.twilio.com`.
643 644 645 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/stream.rb', line 643 def uri @properties['uri'] end |