Class: Twilio::REST::Autopilot::V1::AssistantContext::TaskContext::TaskActionsInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_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, task_sid: nil) ⇒ TaskActionsInstance

Initialize the TaskActionsInstance

Parameters:



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb', line 171

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

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

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

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



201
202
203
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb', line 201

def 
  @properties['account_sid']
end

#assistant_sidString

Returns The SID of the Assistant that is the parent of the Task associated with the resource.

Returns:

  • (String)

    The SID of the Assistant that is the parent of the Task associated with the resource



207
208
209
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb', line 207

def assistant_sid
  @properties['assistant_sid']
end

#contextTaskActionsContext

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

Returns:



192
193
194
195
196
197
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb', line 192

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

#dataHash

Returns The JSON string that specifies the actions that instruct the Assistant on how to perform the task.

Returns:

  • (Hash)

    The JSON string that specifies the actions that instruct the Assistant on how to perform the task



225
226
227
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb', line 225

def data
  @properties['data']
end

#fetchTaskActionsInstance

Fetch a TaskActionsInstance

Returns:



232
233
234
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb', line 232

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



255
256
257
258
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb', line 255

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

#task_sidString

Returns The SID of the Task associated with the resource.

Returns:

  • (String)

    The SID of the Task associated with the resource



213
214
215
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb', line 213

def task_sid
  @properties['task_sid']
end

#to_sObject

Provide a user friendly representation



248
249
250
251
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb', line 248

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

#update(actions: :unset) ⇒ TaskActionsInstance

Update the TaskActionsInstance

Parameters:

Returns:



242
243
244
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb', line 242

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

#urlString

Returns The absolute URL of the TaskActions resource.

Returns:

  • (String)

    The absolute URL of the TaskActions resource



219
220
221
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb', line 219

def url
  @properties['url']
end