lib/twilio-ruby/rest/video/v1/composition_hook.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/video/v1/composition_hook.rb in twilio-ruby-5.39.0

- old
+ new

@@ -134,15 +134,13 @@ 'FriendlyName' => friendly_name, 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, }) - response = @version.page( - 'GET', - @uri, - params - ) + + response = @version.page('GET', @uri, params) + CompositionHookPage.new(@version, response, @solution) end ## # Retrieve a single page of CompositionHookInstance records from the API. @@ -156,12 +154,11 @@ ) CompositionHookPage.new(@version, response, @solution) end ## - # Retrieve a single page of CompositionHookInstance records from the API. - # Request is executed immediately. + # Create the CompositionHookInstance # @param [String] friendly_name A descriptive string that you create to describe # the resource. It can be up to 100 characters long and it must be unique within # the account. # @param [Boolean] enabled Whether the composition hook is active. When `true`, # the composition hook will be triggered for every completed Group Room in the @@ -219,11 +216,11 @@ # `true`. 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](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. - # @return [CompositionHookInstance] Newly created CompositionHookInstance + # @return [CompositionHookInstance] Created CompositionHookInstance def create(friendly_name: nil, enabled: :unset, video_layout: :unset, audio_sources: :unset, audio_sources_excluded: :unset, resolution: :unset, format: :unset, status_callback: :unset, status_callback_method: :unset, trim: :unset) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'Enabled' => enabled, 'VideoLayout' => Twilio.serialize_object(video_layout), @@ -234,15 +231,11 @@ 'StatusCallback' => status_callback, 'StatusCallbackMethod' => status_callback_method, 'Trim' => trim, }) - payload = @version.create( - 'POST', - @uri, - data: data - ) + payload = @version.create('POST', @uri, data: data) CompositionHookInstance.new(@version, payload, ) end ## @@ -298,29 +291,23 @@ @solution = {sid: sid, } @uri = "/CompositionHooks/#{@solution[:sid]}" end ## - # Fetch a CompositionHookInstance + # Fetch the CompositionHookInstance # @return [CompositionHookInstance] Fetched CompositionHookInstance def fetch - params = Twilio::Values.of({}) + payload = @version.fetch('GET', @uri) - payload = @version.fetch( - 'GET', - @uri, - params, - ) - CompositionHookInstance.new(@version, payload, sid: @solution[:sid], ) end ## - # Deletes the CompositionHookInstance + # Delete the CompositionHookInstance # @return [Boolean] true if delete succeeds, false otherwise def delete - @version.delete('delete', @uri) + @version.delete('DELETE', @uri) end ## # Update the CompositionHookInstance # @param [String] friendly_name A descriptive string that you create to describe @@ -397,15 +384,11 @@ 'Resolution' => resolution, 'StatusCallback' => status_callback, 'StatusCallbackMethod' => status_callback_method, }) - payload = @version.update( - 'POST', - @uri, - data: data, - ) + payload = @version.update('POST', @uri, data: data) CompositionHookInstance.new(@version, payload, sid: @solution[:sid], ) end ## @@ -559,17 +542,17 @@ def url @properties['url'] end ## - # Fetch a CompositionHookInstance + # Fetch the CompositionHookInstance # @return [CompositionHookInstance] Fetched CompositionHookInstance def fetch context.fetch end ## - # Deletes the CompositionHookInstance + # Delete the CompositionHookInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end \ No newline at end of file