Class: Twilio::REST::Video::V1::CompositionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Video::V1::CompositionInstance
- Defined in:
- lib/twilio-ruby/rest/video/v1/composition.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#account_sid ⇒ String
Twilio Account SID.
-
#audio_sources ⇒ String
A list of audio sources related to this Composition.
-
#audio_sources_excluded ⇒ String
A list of audio sources excluded related to this Composition.
-
#bitrate ⇒ String
The bitrate.
-
#context ⇒ CompositionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_completed ⇒ String
Date when the media processing task finished.
-
#date_created ⇒ Time
Date when the Composition Resource was created.
-
#date_deleted ⇒ String
Date when the Composition Resource generated media was deleted.
-
#delete ⇒ Boolean
Deletes the CompositionInstance.
-
#duration ⇒ String
Duration of the Composed media in seconds.
-
#fetch ⇒ CompositionInstance
Fetch a CompositionInstance.
-
#format ⇒ composition.Format
The file format for this Composition.
-
#initialize(version, payload, sid: nil) ⇒ CompositionInstance
constructor
Initialize the CompositionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
JSON object with the URL where the media file can be fetched.
-
#resolution ⇒ String
Pixel resolution of the composed video.
-
#room_sid ⇒ String
A 34-character string that uniquely identifies the source of this Composition.
-
#sid ⇒ String
A 34-character string that uniquely identifies this Composition.
-
#size ⇒ String
Size of the Composed media file expressed in bytes.
-
#status ⇒ composition.Status
The status of the Composition.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#trim ⇒ Boolean
Boolean flag for clipping intervals that have no media.
-
#url ⇒ String
The absolute URL for this resource.
-
#video_layout ⇒ Hash
The JSON video layout description.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CompositionInstance
Initialize the CompositionInstance
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 340 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'status' => payload['status'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_completed' => payload['date_completed'], 'date_deleted' => payload['date_deleted'], 'sid' => payload['sid'], 'room_sid' => payload['room_sid'], 'audio_sources' => payload['audio_sources'], 'audio_sources_excluded' => payload['audio_sources_excluded'], 'video_layout' => payload['video_layout'], 'resolution' => payload['resolution'], 'trim' => payload['trim'], 'format' => payload['format'], 'bitrate' => payload['bitrate'].to_i, 'size' => payload['size'].to_i, 'duration' => payload['duration'].to_i, 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Twilio Account SID.
383 384 385 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 383 def account_sid @properties['account_sid'] end |
#audio_sources ⇒ String
Returns A list of audio sources related to this Composition.
425 426 427 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 425 def audio_sources @properties['audio_sources'] end |
#audio_sources_excluded ⇒ String
Returns A list of audio sources excluded related to this Composition.
431 432 433 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 431 def audio_sources_excluded @properties['audio_sources_excluded'] end |
#bitrate ⇒ String
Returns The bitrate.
461 462 463 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 461 def bitrate @properties['bitrate'] end |
#context ⇒ CompositionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
374 375 376 377 378 379 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 374 def context unless @instance_context @instance_context = CompositionContext.new(@version, @params['sid'], ) end @instance_context end |
#date_completed ⇒ String
Returns Date when the media processing task finished.
401 402 403 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 401 def date_completed @properties['date_completed'] end |
#date_created ⇒ Time
Returns Date when the Composition Resource was created.
395 396 397 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 395 def date_created @properties['date_created'] end |
#date_deleted ⇒ String
Returns Date when the Composition Resource generated media was deleted.
407 408 409 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 407 def date_deleted @properties['date_deleted'] end |
#delete ⇒ Boolean
Deletes the CompositionInstance
499 500 501 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 499 def delete context.delete end |
#duration ⇒ String
Returns Duration of the Composed media in seconds.
473 474 475 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 473 def duration @properties['duration'] end |
#fetch ⇒ CompositionInstance
Fetch a CompositionInstance
492 493 494 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 492 def fetch context.fetch end |
#format ⇒ composition.Format
Returns The file format for this Composition.
455 456 457 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 455 def format @properties['format'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
512 513 514 515 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 512 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.CompositionInstance #{values}>" end |
#links ⇒ String
Returns JSON object with the URL where the media file can be fetched.
485 486 487 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 485 def links @properties['links'] end |
#resolution ⇒ String
Returns Pixel resolution of the composed video.
443 444 445 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 443 def resolution @properties['resolution'] end |
#room_sid ⇒ String
Returns A 34-character string that uniquely identifies the source of this Composition.
419 420 421 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 419 def room_sid @properties['room_sid'] end |
#sid ⇒ String
Returns A 34-character string that uniquely identifies this Composition.
413 414 415 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 413 def sid @properties['sid'] end |
#size ⇒ String
Returns Size of the Composed media file expressed in bytes.
467 468 469 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 467 def size @properties['size'] end |
#status ⇒ composition.Status
Returns The status of the Composition.
389 390 391 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 389 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
505 506 507 508 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 505 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.CompositionInstance #{values}>" end |
#trim ⇒ Boolean
Returns Boolean flag for clipping intervals that have no media.
449 450 451 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 449 def trim @properties['trim'] end |
#url ⇒ String
Returns The absolute URL for this resource.
479 480 481 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 479 def url @properties['url'] end |
#video_layout ⇒ Hash
Returns The JSON video layout description.
437 438 439 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 437 def video_layout @properties['video_layout'] end |