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.
-
#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
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 250 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'], } # 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.
286 287 288 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 286 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
277 278 279 280 281 282 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 277 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.
292 293 294 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 292 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.
298 299 300 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 298 def date_updated @properties['date_updated'] end |
#ended_reason ⇒ player_streamer.EndedReason
Returns The reason why a PlayerStreamer ended.
346 347 348 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 346 def ended_reason @properties['ended_reason'] end |
#fetch ⇒ PlayerStreamerInstance
Fetch the PlayerStreamerInstance
353 354 355 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 353 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
382 383 384 385 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 382 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.PlayerStreamerInstance #{values}>" end |
#links ⇒ String
Returns The URLs of related resources.
310 311 312 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 310 def links @properties['links'] end |
#playback_grant ⇒ playback_grant
Access the playback_grant
369 370 371 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 369 def playback_grant context.playback_grant end |
#sid ⇒ String
Returns The unique string that identifies the resource.
316 317 318 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 316 def sid @properties['sid'] end |
#status ⇒ player_streamer.Status
Returns The status of the PlayerStreamer.
322 323 324 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 322 def status @properties['status'] end |
#status_callback ⇒ String
Returns The URL to which Twilio will send PlayerStreamer event updates.
334 335 336 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 334 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method Twilio should use to call the ‘status_callback` URL.
340 341 342 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 340 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
375 376 377 378 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 375 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.PlayerStreamerInstance #{values}>" end |
#update(status: nil) ⇒ PlayerStreamerInstance
Update the PlayerStreamerInstance
362 363 364 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 362 def update(status: nil) context.update(status: status, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
328 329 330 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 328 def url @properties['url'] end |
#video ⇒ Boolean
Returns Whether the PlayerStreamer is configured to stream video.
304 305 306 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 304 def video @properties['video'] end |