lib/twilio-ruby/rest/flex_api/v1/channel.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/flex_api/v1/channel.rb in twilio-ruby-5.39.0

- old
+ new

@@ -82,15 +82,13 @@ params = Twilio::Values.of({ 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, }) - response = @version.page( - 'GET', - @uri, - params - ) + + response = @version.page('GET', @uri, params) + ChannelPage.new(@version, response, @solution) end ## # Retrieve a single page of ChannelInstance records from the API. @@ -104,12 +102,11 @@ ) ChannelPage.new(@version, response, @solution) end ## - # Retrieve a single page of ChannelInstance records from the API. - # Request is executed immediately. + # Create the ChannelInstance # @param [String] flex_flow_sid The SID of the FlexFlow. # @param [String] identity The `identity` value that uniquely identifies the new # resource's chat User. # @param [String] chat_user_friendly_name The chat participant's friendly name. # @param [String] chat_friendly_name The chat channel's friendly name. @@ -120,11 +117,11 @@ # @param [String] task_sid The SID of the TaskRouter task. Only valid when # integration type is `task`. `null` for integration types `studio` & `external` # @param [String] task_attributes The task attributes to be added for the # TaskRouter Task. # @param [Boolean] long_lived Whether to create the channel as long-lived. - # @return [ChannelInstance] Newly created ChannelInstance + # @return [ChannelInstance] Created ChannelInstance def create(flex_flow_sid: nil, identity: nil, chat_user_friendly_name: nil, chat_friendly_name: nil, target: :unset, chat_unique_name: :unset, pre_engagement_data: :unset, task_sid: :unset, task_attributes: :unset, long_lived: :unset) data = Twilio::Values.of({ 'FlexFlowSid' => flex_flow_sid, 'Identity' => identity, 'ChatUserFriendlyName' => chat_user_friendly_name, @@ -135,15 +132,11 @@ 'TaskSid' => task_sid, 'TaskAttributes' => task_attributes, 'LongLived' => long_lived, }) - payload = @version.create( - 'POST', - @uri, - data: data - ) + payload = @version.create('POST', @uri, data: data) ChannelInstance.new(@version, payload, ) end ## @@ -195,29 +188,23 @@ @solution = {sid: sid, } @uri = "/Channels/#{@solution[:sid]}" end ## - # Fetch a ChannelInstance + # Fetch the ChannelInstance # @return [ChannelInstance] Fetched ChannelInstance def fetch - params = Twilio::Values.of({}) + payload = @version.fetch('GET', @uri) - payload = @version.fetch( - 'GET', - @uri, - params, - ) - ChannelInstance.new(@version, payload, sid: @solution[:sid], ) end ## - # Deletes the ChannelInstance + # Delete the ChannelInstance # @return [Boolean] true if delete succeeds, false otherwise def delete - @version.delete('delete', @uri) + @version.delete('DELETE', @uri) end ## # Provide a user friendly representation def to_s @@ -318,17 +305,17 @@ def date_updated @properties['date_updated'] end ## - # Fetch a ChannelInstance + # Fetch the ChannelInstance # @return [ChannelInstance] Fetched ChannelInstance def fetch context.fetch end ## - # Deletes the ChannelInstance + # Delete the ChannelInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end \ No newline at end of file