lib/twilio-ruby/rest/preview/understand/assistant.rb in twilio-ruby-5.12.1 vs lib/twilio-ruby/rest/preview/understand/assistant.rb in twilio-ruby-5.12.2
- old
+ new
@@ -116,23 +116,24 @@
# 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
# true if no value is provided.
# @param [String] unique_name A user-provided string that uniquely identifies this
# resource as an alternative to the sid. Unique up to 64 characters long.
- # @param [String] response_url The webhook URL called to fetch the response to an
- # incoming communication expressed in Assistant TwiML.
# @param [String] callback_url The callback_url
# @param [String] callback_events The callback_events
+ # @param [Hash] fallback_actions The fallback_actions
+ # @param [Hash] initiation_actions The initiation_actions
# @return [AssistantInstance] Newly created AssistantInstance
- def create(friendly_name: :unset, log_queries: :unset, unique_name: :unset, response_url: :unset, callback_url: :unset, callback_events: :unset)
+ def create(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, fallback_actions: :unset, initiation_actions: :unset)
data = Twilio::Values.of({
'FriendlyName' => friendly_name,
'LogQueries' => log_queries,
'UniqueName' => unique_name,
- 'ResponseUrl' => response_url,
'CallbackUrl' => callback_url,
'CallbackEvents' => callback_events,
+ 'FallbackActions' => Twilio.serialize_object(fallback_actions),
+ 'InitiationActions' => Twilio.serialize_object(initiation_actions),
})
payload = @version.create(
'POST',
@uri,
@@ -198,10 +199,12 @@
# Dependents
@field_types = nil
@intents = nil
@model_builds = nil
@queries = nil
+ @assistant_fallback_actions = nil
+ @assistant_initiation_actions = nil
end
##
# Fetch a AssistantInstance
# @return [AssistantInstance] Fetched AssistantInstance
@@ -225,23 +228,24 @@
# 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
# true if no value is provided.
# @param [String] unique_name A user-provided string that uniquely identifies this
# resource as an alternative to the sid. Unique up to 64 characters long.
- # @param [String] response_url The webhook URL called to fetch the response to an
- # incoming communication expressed in Assistant TwiML.
# @param [String] callback_url The callback_url
# @param [String] callback_events The callback_events
+ # @param [Hash] fallback_actions The fallback_actions
+ # @param [Hash] initiation_actions The initiation_actions
# @return [AssistantInstance] Updated AssistantInstance
- def update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, response_url: :unset, callback_url: :unset, callback_events: :unset)
+ def update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, fallback_actions: :unset, initiation_actions: :unset)
data = Twilio::Values.of({
'FriendlyName' => friendly_name,
'LogQueries' => log_queries,
'UniqueName' => unique_name,
- 'ResponseUrl' => response_url,
'CallbackUrl' => callback_url,
'CallbackEvents' => callback_events,
+ 'FallbackActions' => Twilio.serialize_object(fallback_actions),
+ 'InitiationActions' => Twilio.serialize_object(initiation_actions),
})
payload = @version.update(
'POST',
@uri,
@@ -329,10 +333,26 @@
@queries
end
##
+ # Access the assistant_fallback_actions
+ # @return [AssistantFallbackActionsList]
+ # @return [AssistantFallbackActionsContext]
+ def assistant_fallback_actions
+ AssistantFallbackActionsContext.new(@version, @solution[:sid], )
+ end
+
+ ##
+ # Access the assistant_initiation_actions
+ # @return [AssistantInitiationActionsList]
+ # @return [AssistantInitiationActionsContext]
+ def assistant_initiation_actions
+ AssistantInitiationActionsContext.new(@version, @solution[:sid], )
+ end
+
+ ##
# Provide a user friendly representation
def to_s
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
"#<Twilio.Preview.Understand.AssistantContext #{context}>"
end
@@ -360,11 +380,10 @@
'links' => payload['links'],
'log_queries' => payload['log_queries'],
'sid' => payload['sid'],
'unique_name' => payload['unique_name'],
'url' => payload['url'],
- 'response_url' => payload['response_url'],
'callback_url' => payload['callback_url'],
'callback_events' => payload['callback_events'],
}
# Context
@@ -442,16 +461,10 @@
def url
@properties['url']
end
##
- # @return [String] The webhook URL called to fetch the response to an incoming communication expressed in Assistant TwiML.
- def response_url
- @properties['response_url']
- end
-
- ##
# @return [String] The callback_url
def callback_url
@properties['callback_url']
end
@@ -476,23 +489,24 @@
# 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
# true if no value is provided.
# @param [String] unique_name A user-provided string that uniquely identifies this
# resource as an alternative to the sid. Unique up to 64 characters long.
- # @param [String] response_url The webhook URL called to fetch the response to an
- # incoming communication expressed in Assistant TwiML.
# @param [String] callback_url The callback_url
# @param [String] callback_events The callback_events
+ # @param [Hash] fallback_actions The fallback_actions
+ # @param [Hash] initiation_actions The initiation_actions
# @return [AssistantInstance] Updated AssistantInstance
- def update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, response_url: :unset, callback_url: :unset, callback_events: :unset)
+ def update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, fallback_actions: :unset, initiation_actions: :unset)
context.update(
friendly_name: friendly_name,
log_queries: log_queries,
unique_name: unique_name,
- response_url: response_url,
callback_url: callback_url,
callback_events: callback_events,
+ fallback_actions: fallback_actions,
+ initiation_actions: initiation_actions,
)
end
##
# Deletes the AssistantInstance
@@ -525,9 +539,23 @@
##
# Access the queries
# @return [queries] queries
def queries
context.queries
+ end
+
+ ##
+ # Access the assistant_fallback_actions
+ # @return [assistant_fallback_actions] assistant_fallback_actions
+ def assistant_fallback_actions
+ context.assistant_fallback_actions
+ end
+
+ ##
+ # Access the assistant_initiation_actions
+ # @return [assistant_initiation_actions] assistant_initiation_actions
+ def assistant_initiation_actions
+ context.assistant_initiation_actions
end
##
# Provide a user friendly representation
def to_s
\ No newline at end of file