Class: Twilio::REST::Video::V1::CompositionHookInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Video::V1::CompositionHookInstance
- Defined in:
- lib/twilio-ruby/rest/video/v1/composition_hook.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the CompositionHook resource.
-
#audio_sources ⇒ Array<String>
The array of track names to include in the compositions created by the composition hook.
-
#audio_sources_excluded ⇒ Array<String>
The array of track names to exclude from the compositions created by the composition hook.
-
#context ⇒ CompositionHookContext
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.
-
#delete ⇒ Boolean
Delete the CompositionHookInstance.
-
#enabled ⇒ Boolean
Whether the CompositionHook is active.
-
#fetch ⇒ CompositionHookInstance
Fetch the CompositionHookInstance.
- #format ⇒ Format
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#initialize(version, payload, sid: nil) ⇒ CompositionHookInstance
constructor
Initialize the CompositionHookInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#resolution ⇒ String
The dimensions of the video image in pixels expressed as columns (width) and rows (height).
-
#sid ⇒ String
The unique string that we created to identify the CompositionHook resource.
-
#status_callback ⇒ String
The URL we call using the ‘status_callback_method` to send status information to your application.
-
#status_callback_method ⇒ String
The HTTP method we should use to call ‘status_callback`.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#trim ⇒ Boolean
Whether intervals with no media are clipped, as specified in the POST request that created the CompositionHook resource.
-
#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.
-
#url ⇒ String
The absolute URL of the resource.
-
#video_layout ⇒ Hash
A JSON object that describes the video layout of the composition in terms of regions as specified in the HTTP POST request that created the CompositionHook resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CompositionHookInstance
Initialize the CompositionHookInstance
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 669 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_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the CompositionHook resource.
710 711 712 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 710 def account_sid @properties['account_sid'] end |
#audio_sources ⇒ Array<String>
Returns The array of track names to include in the compositions created by the composition hook. A composition triggered by the composition hook includes all audio sources specified in ‘audio_sources` except those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request.
746 747 748 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 746 def audio_sources @properties['audio_sources'] end |
#audio_sources_excluded ⇒ Array<String>
Returns The array of track names to exclude from the compositions created by the composition hook. A composition triggered by the composition hook includes all audio sources specified in ‘audio_sources` except for those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty.
752 753 754 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 752 def audio_sources_excluded @properties['audio_sources_excluded'] end |
#context ⇒ CompositionHookContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
701 702 703 704 705 706 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 701 def context unless @instance_context @instance_context = CompositionHookContext.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.
728 729 730 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 728 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.
734 735 736 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 734 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the CompositionHookInstance
801 802 803 804 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 801 def delete context.delete end |
#enabled ⇒ Boolean
Returns Whether the CompositionHook is active. When ‘true`, the CompositionHook is triggered for every completed Group Room on the account. When `false`, the CompositionHook is never triggered.
722 723 724 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 722 def enabled @properties['enabled'] end |
#fetch ⇒ CompositionHookInstance
Fetch the CompositionHookInstance
809 810 811 812 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 809 def fetch context.fetch end |
#format ⇒ Format
776 777 778 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 776 def format @properties['format'] end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource. Can be up to 100 characters long and must be unique within the account.
716 717 718 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 716 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
863 864 865 866 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 863 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.CompositionHookInstance #{values}>" end |
#resolution ⇒ String
Returns The dimensions of the video image in pixels expressed as columns (width) and rows (height). The string’s format is ‘widthxheight`, such as `640x480`.
764 765 766 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 764 def resolution @properties['resolution'] end |
#sid ⇒ String
Returns The unique string that we created to identify the CompositionHook resource.
740 741 742 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 740 def sid @properties['sid'] end |
#status_callback ⇒ String
Returns The URL we call using the ‘status_callback_method` to send status information to your application.
782 783 784 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 782 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method we should use to call ‘status_callback`. Can be `POST` or `GET` and defaults to `POST`.
788 789 790 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 788 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
856 857 858 859 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 856 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.CompositionHookInstance #{values}>" end |
#trim ⇒ Boolean
Returns Whether intervals with no media are clipped, as specified in the POST request that created the CompositionHook resource. Compositions with ‘trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
770 771 772 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 770 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
827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 827 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 |
#url ⇒ String
Returns The absolute URL of the resource.
794 795 796 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 794 def url @properties['url'] end |
#video_layout ⇒ Hash
Returns A JSON object that describes the video layout of the composition in terms of regions as specified in the HTTP POST request that created the CompositionHook resource. See [POST Parameters](www.twilio.com/docs/video/api/compositions-resource#http-post-parameters) for more information. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request.
758 759 760 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 758 def video_layout @properties['video_layout'] end |