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
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#audio_sources ⇒ Array[String]
The array of track names to include in the composition.
-
#audio_sources_excluded ⇒ Array[String]
The array of track names to exclude from the composition.
-
#bitrate ⇒ String
The average bit rate of the composition's media.
-
#context ⇒ CompositionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_completed ⇒ Time
Date when the media processing task finished.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the resource was created.
-
#date_deleted ⇒ Time
The ISO 8601 date and time in GMT when the composition generated media was deleted.
-
#delete ⇒ Boolean
Delete the CompositionInstance.
-
#duration ⇒ String
The duration of the composition's media file in seconds.
-
#fetch ⇒ CompositionInstance
Fetch the CompositionInstance.
-
#format ⇒ composition.Format
The container format of the composition's media files as specified in the POST request that created the Composition resource.
-
#initialize(version, payload, sid: nil) ⇒ CompositionInstance
constructor
Initialize the CompositionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The URL of the media file associated with the composition.
-
#media_external_location ⇒ String
The URL of the media file associated with the composition when stored externally.
-
#resolution ⇒ String
The dimensions of the video image in pixels expressed as columns (width) and rows (height).
-
#room_sid ⇒ String
The SID of the Group Room that generated the audio and video tracks used in the composition.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#size ⇒ String
The size of the composed media file in bytes.
-
#status ⇒ composition.Status
The status of the composition.
-
#status_callback ⇒ String
The URL called to send status information on every composition event.
-
#status_callback_method ⇒ String
The HTTP method used to call `status_callback`.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#trim ⇒ Boolean
Whether to remove intervals with no media.
-
#url ⇒ String
The absolute URL of the resource.
-
#video_layout ⇒ Hash
An object that describes the video layout of the composition.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CompositionInstance
Initialize the CompositionInstance
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 316 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' => Twilio.deserialize_iso8601_datetime(payload['date_completed']), 'date_deleted' => Twilio.deserialize_iso8601_datetime(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, 'media_external_location' => payload['media_external_location'], 'status_callback' => payload['status_callback'], 'status_callback_method' => payload['status_callback_method'], 'url' => payload['url'], 'links' => payload['links'], } # 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.
362 363 364 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 362 def account_sid @properties['account_sid'] end |
#audio_sources ⇒ Array[String]
Returns The array of track names to include in the composition.
404 405 406 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 404 def audio_sources @properties['audio_sources'] end |
#audio_sources_excluded ⇒ Array[String]
Returns The array of track names to exclude from the composition.
410 411 412 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 410 def audio_sources_excluded @properties['audio_sources_excluded'] end |
#bitrate ⇒ String
Returns The average bit rate of the composition's media.
440 441 442 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 440 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
353 354 355 356 357 358 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 353 def context unless @instance_context @instance_context = CompositionContext.new(@version, @params['sid'], ) end @instance_context end |
#date_completed ⇒ Time
Returns Date when the media processing task finished.
380 381 382 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 380 def date_completed @properties['date_completed'] end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was created.
374 375 376 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 374 def date_created @properties['date_created'] end |
#date_deleted ⇒ Time
Returns The ISO 8601 date and time in GMT when the composition generated media was deleted.
386 387 388 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 386 def date_deleted @properties['date_deleted'] end |
#delete ⇒ Boolean
Delete the CompositionInstance
496 497 498 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 496 def delete context.delete end |
#duration ⇒ String
Returns The duration of the composition's media file in seconds.
452 453 454 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 452 def duration @properties['duration'] end |
#fetch ⇒ CompositionInstance
Fetch the CompositionInstance
489 490 491 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 489 def fetch context.fetch end |
#format ⇒ composition.Format
Returns The container format of the composition's media files as specified in the POST request that created the Composition resource.
434 435 436 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 434 def format @properties['format'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
509 510 511 512 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 509 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.CompositionInstance #{values}>" end |
#links ⇒ String
Returns The URL of the media file associated with the composition.
482 483 484 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 482 def links @properties['links'] end |
#media_external_location ⇒ String
Returns The URL of the media file associated with the composition when stored externally.
458 459 460 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 458 def media_external_location @properties['media_external_location'] end |
#resolution ⇒ String
Returns The dimensions of the video image in pixels expressed as columns (width) and rows (height).
422 423 424 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 422 def resolution @properties['resolution'] end |
#room_sid ⇒ String
Returns The SID of the Group Room that generated the audio and video tracks used in the composition.
398 399 400 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 398 def room_sid @properties['room_sid'] end |
#sid ⇒ String
Returns The unique string that identifies the resource.
392 393 394 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 392 def sid @properties['sid'] end |
#size ⇒ String
Returns The size of the composed media file in bytes.
446 447 448 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 446 def size @properties['size'] end |
#status ⇒ composition.Status
Returns The status of the composition.
368 369 370 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 368 def status @properties['status'] end |
#status_callback ⇒ String
Returns The URL called to send status information on every composition event.
464 465 466 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 464 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method used to call `status_callback`.
470 471 472 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 470 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
502 503 504 505 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 502 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.CompositionInstance #{values}>" end |
#trim ⇒ Boolean
Returns Whether to remove intervals with no media.
428 429 430 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 428 def trim @properties['trim'] end |
#url ⇒ String
Returns The absolute URL of the resource.
476 477 478 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 476 def url @properties['url'] end |
#video_layout ⇒ Hash
Returns An object that describes the video layout of the composition.
416 417 418 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 416 def video_layout @properties['video_layout'] end |