Class: Twilio::REST::Preview::Understand::AssistantContext::IntentContext::IntentActionsInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_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, intent_sid: nil) ⇒ IntentActionsInstance

Initialize the IntentActionsInstance

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

  • intent_sid (String) (defaults to: nil)

    The intent_sid



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_actions.rb', line 150

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

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

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

Instance Method Details

#account_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid



184
185
186
# File 'lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_actions.rb', line 184

def 
  @properties['account_sid']
end

#assistant_sidString

Returns The assistant_sid.

Returns:

  • (String)

    The assistant_sid



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

def assistant_sid
  @properties['assistant_sid']
end

#contextIntentActionsContext

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

Returns:



171
172
173
174
175
176
177
178
179
180
# File 'lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_actions.rb', line 171

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

#dataHash

Returns The data.

Returns:

  • (Hash)

    The data



208
209
210
# File 'lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_actions.rb', line 208

def data
  @properties['data']
end

#fetchIntentActionsInstance

Fetch a IntentActionsInstance

Returns:



215
216
217
# File 'lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_actions.rb', line 215

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



236
237
238
239
# File 'lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_actions.rb', line 236

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

#intent_sidString

Returns The intent_sid.

Returns:

  • (String)

    The intent_sid



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

def intent_sid
  @properties['intent_sid']
end

#to_sObject

Provide a user friendly representation



229
230
231
232
# File 'lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_actions.rb', line 229

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

#update(actions: :unset) ⇒ IntentActionsInstance

Update the IntentActionsInstance

Parameters:

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

    The actions

Returns:



223
224
225
# File 'lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_actions.rb', line 223

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

#urlString

Returns The url.

Returns:

  • (String)

    The url



202
203
204
# File 'lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_actions.rb', line 202

def url
  @properties['url']
end