Class: Twilio::REST::Video::V1::CompositionHookContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Video::V1::CompositionHookContext
- Defined in:
- lib/twilio-ruby/rest/video/v1/composition_hook.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the CompositionHookInstance.
-
#fetch ⇒ CompositionHookInstance
Fetch the CompositionHookInstance.
-
#initialize(version, sid) ⇒ CompositionHookContext
constructor
Initialize the CompositionHookContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#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.
Constructor Details
#initialize(version, sid) ⇒ CompositionHookContext
Initialize the CompositionHookContext
212 213 214 215 216 217 218 219 220 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 212 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/CompositionHooks/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the CompositionHookInstance
224 225 226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 224 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ CompositionHookInstance
Fetch the CompositionHookInstance
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 236 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) CompositionHookInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
315 316 317 318 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 315 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Video.V1.CompositionHookContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
308 309 310 311 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 308 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Video.V1.CompositionHookContext #{context}>" 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
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/twilio-ruby/rest/video/v1/composition_hook.rb', line 265 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 ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'Enabled' => enabled, 'VideoLayout' => Twilio.serialize_object(video_layout), 'AudioSources' => Twilio.serialize_list(audio_sources) { |e| e }, 'AudioSourcesExcluded' => Twilio.serialize_list(audio_sources_excluded) { |e| e }, 'Trim' => trim, 'Format' => format, 'Resolution' => resolution, 'StatusCallback' => status_callback, 'StatusCallbackMethod' => status_callback_method, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) CompositionHookInstance.new( @version, payload, sid: @solution[:sid], ) end |