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
172 173 174 175 176 177 178 179 180 181 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 172 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
185 186 187 188 189 190 191 192 193 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 185 def fetch payload = @version.fetch('GET', @uri) PlayerStreamerInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
235 236 237 238 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 235 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Media.V1.PlayerStreamerContext #{context}>" end |
#playback_grant ⇒ PlaybackGrantList, PlaybackGrantContext
Access the playback_grant
219 220 221 222 223 224 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 219 def playback_grant PlaybackGrantContext.new( @version, @solution[:sid] ) end |
#to_s ⇒ Object
Provide a user friendly representation
228 229 230 231 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 228 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Media.V1.PlayerStreamerContext #{context}>" end |
#update(status: nil) ⇒ PlayerStreamerInstance
Update the PlayerStreamerInstance
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 199 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 |