Class: Twilio::REST::Preview::Understand::AssistantContext::AssistantFallbackActionsContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, assistant_sid) ⇒ AssistantFallbackActionsContext

Initialize the AssistantFallbackActionsContext

Parameters:

  • version (Version)

    Version that contains the resource

  • assistant_sid (String)


52
53
54
55
56
57
58
59
60
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 52

def initialize(version, assistant_sid)
    super(version)

    # Path Solution
    @solution = { assistant_sid: assistant_sid,  }
    @uri = "/Assistants/#{@solution[:assistant_sid]}/FallbackActions"

    
end

Instance Method Details

#fetchAssistantFallbackActionsInstance

Fetch the AssistantFallbackActionsInstance

Returns:



64
65
66
67
68
69
70
71
72
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 64

def fetch

    payload = @version.fetch('GET', @uri)
    AssistantFallbackActionsInstance.new(
        @version,
        payload,
        assistant_sid: @solution[:assistant_sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



104
105
106
107
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 104

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Preview.Understand.AssistantFallbackActionsContext #{context}>"
end

#to_sObject

Provide a user friendly representation



97
98
99
100
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 97

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Preview.Understand.AssistantFallbackActionsContext #{context}>"
end

#update(fallback_actions: :unset) ⇒ AssistantFallbackActionsInstance

Update the AssistantFallbackActionsInstance

Parameters:

  • fallback_actions (Object) (defaults to: :unset)

Returns:



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 78

def update(
    fallback_actions: :unset
)

    data = Twilio::Values.of({
        'FallbackActions' => Twilio.serialize_object(fallback_actions),
    })

    payload = @version.update('POST', @uri, data: data)
    AssistantFallbackActionsInstance.new(
        @version,
        payload,
        assistant_sid: @solution[:assistant_sid],
    )
end