Class: Twilio::REST::Video::V1::CompositionHookInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/video/v1/composition_hook.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

Constructor Details

#initialize(version, payload, sid: nil) ⇒ CompositionHookInstance

Initialize the CompositionHookInstance



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 424

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'friendly_name' => payload['friendly_name'],
      'enabled' => payload['enabled'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'sid' => payload['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'],
      'status_callback' => payload['status_callback'],
      'status_callback_method' => payload['status_callback_method'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'sid' => sid || @properties['sid'], }
end

Instance Method Details

#account_sidString



464
465
466
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 464

def 
  @properties['account_sid']
end

#audio_sourcesArray[String]



500
501
502
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 500

def audio_sources
  @properties['audio_sources']
end

#audio_sources_excludedArray[String]



506
507
508
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 506

def audio_sources_excluded
  @properties['audio_sources_excluded']
end

#contextCompositionHookContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



455
456
457
458
459
460
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 455

def context
  unless @instance_context
    @instance_context = CompositionHookContext.new(@version, @params['sid'], )
  end
  @instance_context
end

#date_createdTime



482
483
484
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 482

def date_created
  @properties['date_created']
end

#date_updatedTime



488
489
490
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 488

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the CompositionHookInstance



562
563
564
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 562

def delete
  context.delete
end

#enabledBoolean



476
477
478
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 476

def enabled
  @properties['enabled']
end

#fetchCompositionHookInstance

Fetch the CompositionHookInstance



555
556
557
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 555

def fetch
  context.fetch
end

#formatcomposition_hook.Format



530
531
532
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 530

def format
  @properties['format']
end

#friendly_nameString



470
471
472
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 470

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



657
658
659
660
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 657

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Video.V1.CompositionHookInstance #{values}>"
end

#resolutionString



518
519
520
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 518

def resolution
  @properties['resolution']
end

#sidString



494
495
496
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 494

def sid
  @properties['sid']
end

#status_callbackString



536
537
538
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 536

def status_callback
  @properties['status_callback']
end

#status_callback_methodString



542
543
544
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 542

def status_callback_method
  @properties['status_callback_method']
end

#to_sObject

Provide a user friendly representation



650
651
652
653
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 650

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Video.V1.CompositionHookInstance #{values}>"
end

#trimBoolean



524
525
526
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 524

def trim
  @properties['trim']
end

#update(friendly_name: nil, enabled: :unset, video_layout: :unset, audio_sources: :unset, audio_sources_excluded: :unset, trim: :unset, format: :unset, resolution: :unset, status_callback: :unset, status_callback_method: :unset) ⇒ CompositionHookInstance

Update the CompositionHookInstance



633
634
635
636
637
638
639
640
641
642
643
644
645
646
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 633

def update(friendly_name: nil, enabled: :unset, video_layout: :unset, audio_sources: :unset, audio_sources_excluded: :unset, trim: :unset, format: :unset, resolution: :unset, status_callback: :unset, status_callback_method: :unset)
  context.update(
      friendly_name: friendly_name,
      enabled: enabled,
      video_layout: video_layout,
      audio_sources: audio_sources,
      audio_sources_excluded: audio_sources_excluded,
      trim: trim,
      format: format,
      resolution: resolution,
      status_callback: status_callback,
      status_callback_method: status_callback_method,
  )
end

#urlString



548
549
550
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 548

def url
  @properties['url']
end

#video_layoutHash



512
513
514
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 512

def video_layout
  @properties['video_layout']
end