Class: Twilio::REST::Media::V1::PlayerStreamerContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Media::V1::PlayerStreamerContext
- Defined in:
- lib/twilio-ruby/rest/media/v1/player_streamer.rb,
lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb
Defined Under Namespace
Classes: PlaybackGrantContext, PlaybackGrantInstance, PlaybackGrantList, PlaybackGrantPage
Instance Method Summary collapse
-
#fetch ⇒ PlayerStreamerInstance
Fetch the PlayerStreamerInstance.
-
#initialize(version, sid) ⇒ PlayerStreamerContext
constructor
Initialize the PlayerStreamerContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#playback_grant ⇒ PlaybackGrantList, PlaybackGrantContext
Access the playback_grant.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: nil) ⇒ PlayerStreamerInstance
Update the PlayerStreamerInstance.
Constructor Details
#initialize(version, sid) ⇒ PlayerStreamerContext
Initialize the PlayerStreamerContext
193 194 195 196 197 198 199 200 201 202 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 193 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/PlayerStreamers/#{@solution[:sid]}" # Dependents @playback_grant = nil end |
Instance Method Details
#fetch ⇒ PlayerStreamerInstance
Fetch the PlayerStreamerInstance
207 208 209 210 211 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 207 def fetch payload = @version.fetch('GET', @uri) PlayerStreamerInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
243 244 245 246 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 243 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Media.V1.PlayerStreamerContext #{context}>" end |
#playback_grant ⇒ PlaybackGrantList, PlaybackGrantContext
Access the playback_grant
230 231 232 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 230 def playback_grant PlaybackGrantContext.new(@version, @solution[:sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
236 237 238 239 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 236 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Media.V1.PlayerStreamerContext #{context}>" end |
#update(status: nil) ⇒ PlayerStreamerInstance
Update the PlayerStreamerInstance
218 219 220 221 222 223 224 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 218 def update(status: nil) data = Twilio::Values.of({'Status' => status, }) payload = @version.update('POST', @uri, data: data) PlayerStreamerInstance.new(@version, payload, sid: @solution[:sid], ) end |