Class: Twilio::REST::Preview::Understand::AssistantContext::AssistantFallbackActionsInstance

Inherits:
InstanceResource
  • 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, payload, assistant_sid: nil) ⇒ AssistantFallbackActionsInstance

Initialize the AssistantFallbackActionsInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • assistant_sid (String) (defaults to: nil)

    The assistant_sid


128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 128

def initialize(version, payload, assistant_sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'assistant_sid' => payload['assistant_sid'],
      'url' => payload['url'],
      'data' => payload['data'],
  }

  # Context
  @instance_context = nil
  @params = {'assistant_sid' => assistant_sid, }
end

Instance Method Details

#account_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid


157
158
159
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 157

def 
  @properties['account_sid']
end

#assistant_sidString

Returns The assistant_sid.

Returns:

  • (String)

    The assistant_sid


163
164
165
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 163

def assistant_sid
  @properties['assistant_sid']
end

#contextAssistantFallbackActionsContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:


148
149
150
151
152
153
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 148

def context
  unless @instance_context
    @instance_context = AssistantFallbackActionsContext.new(@version, @params['assistant_sid'], )
  end
  @instance_context
end

#dataHash

Returns The data.

Returns:

  • (Hash)

    The data


175
176
177
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 175

def data
  @properties['data']
end

#fetchAssistantFallbackActionsInstance

Fetch the AssistantFallbackActionsInstance

Returns:


182
183
184
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 182

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


203
204
205
206
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 203

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.Understand.AssistantFallbackActionsInstance #{values}>"
end

#to_sObject

Provide a user friendly representation


196
197
198
199
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 196

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.Understand.AssistantFallbackActionsInstance #{values}>"
end

#update(fallback_actions: :unset) ⇒ AssistantFallbackActionsInstance

Update the AssistantFallbackActionsInstance

Parameters:

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

    The fallback_actions

Returns:


190
191
192
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 190

def update(fallback_actions: :unset)
  context.update(fallback_actions: fallback_actions, )
end

#urlString

Returns The url.

Returns:

  • (String)

    The url


169
170
171
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb', line 169

def url
  @properties['url']
end