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](www.twilio.com/docs/iam/api/account) that created the PlayerStreamer resource.
-
#context ⇒ PlayerStreamerContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
- #ended_reason ⇒ EndedReason
-
#fetch ⇒ PlayerStreamerInstance
Fetch the PlayerStreamerInstance.
-
#initialize(version, payload, sid: nil) ⇒ PlayerStreamerInstance
constructor
Initialize the PlayerStreamerInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of related resources.
-
#max_duration ⇒ String
The maximum time, in seconds, that the PlayerStreamer is active (‘created` or `started`) before automatically ends.
-
#playback_grant ⇒ playback_grant
Access the playback_grant.
-
#sid ⇒ String
The unique string generated to identify the PlayerStreamer resource.
- #status ⇒ Status
-
#status_callback ⇒ String
The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event.
-
#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
Specifies whether the PlayerStreamer is configured to stream video.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ PlayerStreamerInstance
Initialize the PlayerStreamerInstance
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 279 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'] == nil ? payload['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](www.twilio.com/docs/iam/api/account) that created the PlayerStreamer resource.
316 317 318 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 316 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
307 308 309 310 311 312 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 307 def context unless @instance_context @instance_context = PlayerStreamerContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
322 323 324 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 322 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
328 329 330 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 328 def date_updated @properties['date_updated'] end |
#ended_reason ⇒ EndedReason
376 377 378 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 376 def ended_reason @properties['ended_reason'] end |
#fetch ⇒ PlayerStreamerInstance
Fetch the PlayerStreamerInstance
389 390 391 392 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 389 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
423 424 425 426 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 423 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.PlayerStreamerInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of related resources.
340 341 342 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 340 def links @properties['links'] end |
#max_duration ⇒ String
Returns The maximum time, in seconds, that the PlayerStreamer is active (‘created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming.
382 383 384 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 382 def max_duration @properties['max_duration'] end |
#playback_grant ⇒ playback_grant
Access the playback_grant
410 411 412 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 410 def playback_grant context.playback_grant end |
#sid ⇒ String
Returns The unique string generated to identify the PlayerStreamer resource.
346 347 348 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 346 def sid @properties['sid'] end |
#status ⇒ Status
352 353 354 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 352 def status @properties['status'] end |
#status_callback ⇒ String
Returns The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details.
364 365 366 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 364 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method Twilio should use to call the ‘status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
370 371 372 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 370 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
416 417 418 419 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 416 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.PlayerStreamerInstance #{values}>" end |
#update(status: nil) ⇒ PlayerStreamerInstance
Update the PlayerStreamerInstance
398 399 400 401 402 403 404 405 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 398 def update( status: nil ) context.update( status: status, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
358 359 360 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 358 def url @properties['url'] end |
#video ⇒ Boolean
Returns Specifies whether the PlayerStreamer is configured to stream video. Defaults to ‘true`.
334 335 336 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer.rb', line 334 def video @properties['video'] end |