lib/twilio-ruby/rest/preview/understand/assistant.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/preview/understand/assistant.rb in twilio-ruby-5.39.0

- old
+ new

@@ -84,15 +84,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) + AssistantPage.new(@version, response, @solution) end ## # Retrieve a single page of AssistantInstance records from the API. @@ -106,12 +104,11 @@ ) AssistantPage.new(@version, response, @solution) end ## - # Retrieve a single page of AssistantInstance records from the API. - # Request is executed immediately. + # Create the AssistantInstance # @param [String] friendly_name A text description for the Assistant. It is # non-unique and can up to 255 characters long. # @param [Boolean] log_queries A boolean that specifies whether queries should be # logged for 30 days further training. If false, no queries will be stored, if # true, queries will be stored for 30 days and deleted thereafter. Defaults to @@ -125,11 +122,11 @@ # input is not recognized as matching any Task. # @param [Hash] initiation_actions The JSON actions to be executed on inbound # phone calls when the Assistant has to say something first. # @param [Hash] style_sheet The JSON object that holds the style sheet for the # assistant - # @return [AssistantInstance] Newly created AssistantInstance + # @return [AssistantInstance] Created AssistantInstance def create(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, fallback_actions: :unset, initiation_actions: :unset, style_sheet: :unset) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'LogQueries' => log_queries, 'UniqueName' => unique_name, @@ -138,15 +135,11 @@ 'FallbackActions' => Twilio.serialize_object(fallback_actions), 'InitiationActions' => Twilio.serialize_object(initiation_actions), 'StyleSheet' => Twilio.serialize_object(style_sheet), }) - payload = @version.create( - 'POST', - @uri, - data: data - ) + payload = @version.create('POST', @uri, data: data) AssistantInstance.new(@version, payload, ) end ## @@ -213,21 +206,15 @@ @dialogues = nil @style_sheet = nil end ## - # Fetch a AssistantInstance + # Fetch the AssistantInstance # @return [AssistantInstance] Fetched AssistantInstance def fetch - params = Twilio::Values.of({}) + payload = @version.fetch('GET', @uri) - payload = @version.fetch( - 'GET', - @uri, - params, - ) - AssistantInstance.new(@version, payload, sid: @solution[:sid], ) end ## # Update the AssistantInstance @@ -259,24 +246,20 @@ 'FallbackActions' => Twilio.serialize_object(fallback_actions), 'InitiationActions' => Twilio.serialize_object(initiation_actions), 'StyleSheet' => Twilio.serialize_object(style_sheet), }) - payload = @version.update( - 'POST', - @uri, - data: data, - ) + payload = @version.update('POST', @uri, data: data) AssistantInstance.new(@version, payload, sid: @solution[:sid], ) end ## - # Deletes the AssistantInstance + # Delete the AssistantInstance # @return [Boolean] true if delete succeeds, false otherwise def delete - @version.delete('delete', @uri) + @version.delete('DELETE', @uri) end ## # Access the field_types # @return [FieldTypeList] @@ -522,11 +505,11 @@ def callback_events @properties['callback_events'] end ## - # Fetch a AssistantInstance + # Fetch the AssistantInstance # @return [AssistantInstance] Fetched AssistantInstance def fetch context.fetch end @@ -562,10 +545,10 @@ style_sheet: style_sheet, ) end ## - # Deletes the AssistantInstance + # Delete the AssistantInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end \ No newline at end of file