Class: Twilio::REST::Media::V1::PlayerStreamerInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Media::V1::PlayerStreamerInstance
- Defined in:
- lib/twilio-ruby/rest/media/v1/player_streamer.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#context ⇒ PlayerStreamerContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the resource was last updated.
-
#ended_reason ⇒ player_streamer.EndedReason
The reason why a PlayerStreamer ended.
-
#fetch ⇒ PlayerStreamerInstance
Fetch the PlayerStreamerInstance.
-
#initialize(version, payload, sid: nil) ⇒ PlayerStreamerInstance
constructor
Initialize the PlayerStreamerInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The URLs of related resources.
-
#max_duration ⇒ String
Maximum PlayerStreamer duration in seconds.
-
#playback_grant ⇒ playback_grant
Access the playback_grant.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#status ⇒ player_streamer.Status
The status of the PlayerStreamer.
-
#status_callback ⇒ String
The URL to which Twilio will send PlayerStreamer event updates.
-
#status_callback_method ⇒ String
The HTTP method Twilio should use to call the ‘status_callback` URL.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: nil) ⇒ PlayerStreamerInstance
Update the PlayerStreamerInstance.
-
#url ⇒ String
The absolute URL of the resource.
-
#video ⇒ Boolean
Whether the PlayerStreamer is configured to stream video.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ PlayerStreamerInstance
Initialize the PlayerStreamerInstance
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 256 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'video' => payload['video'], 'links' => payload['links'], 'sid' => payload['sid'], 'status' => payload['status'], 'url' => payload['url'], 'status_callback' => payload['status_callback'], 'status_callback_method' => payload['status_callback_method'], 'ended_reason' => payload['ended_reason'], 'max_duration' => payload['max_duration'].to_i, } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the resource.
293 294 295 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 293 def account_sid @properties['account_sid'] end |
#context ⇒ PlayerStreamerContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
284 285 286 287 288 289 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 284 def context unless @instance_context @instance_context = PlayerStreamerContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was created.
299 300 301 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 299 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was last updated.
305 306 307 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 305 def date_updated @properties['date_updated'] end |
#ended_reason ⇒ player_streamer.EndedReason
Returns The reason why a PlayerStreamer ended.
353 354 355 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 353 def ended_reason @properties['ended_reason'] end |
#fetch ⇒ PlayerStreamerInstance
Fetch the PlayerStreamerInstance
366 367 368 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 366 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
395 396 397 398 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 395 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.PlayerStreamerInstance #{values}>" end |
#links ⇒ String
Returns The URLs of related resources.
317 318 319 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 317 def links @properties['links'] end |
#max_duration ⇒ String
Returns Maximum PlayerStreamer duration in seconds.
359 360 361 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 359 def max_duration @properties['max_duration'] end |
#playback_grant ⇒ playback_grant
Access the playback_grant
382 383 384 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 382 def playback_grant context.playback_grant end |
#sid ⇒ String
Returns The unique string that identifies the resource.
323 324 325 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 323 def sid @properties['sid'] end |
#status ⇒ player_streamer.Status
Returns The status of the PlayerStreamer.
329 330 331 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 329 def status @properties['status'] end |
#status_callback ⇒ String
Returns The URL to which Twilio will send PlayerStreamer event updates.
341 342 343 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 341 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method Twilio should use to call the ‘status_callback` URL.
347 348 349 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 347 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
388 389 390 391 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 388 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.PlayerStreamerInstance #{values}>" end |
#update(status: nil) ⇒ PlayerStreamerInstance
Update the PlayerStreamerInstance
375 376 377 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 375 def update(status: nil) context.update(status: status, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
335 336 337 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 335 def url @properties['url'] end |
#video ⇒ Boolean
Returns Whether the PlayerStreamer is configured to stream video.
311 312 313 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 311 def video @properties['video'] end |