Class: Twilio::REST::Preview::Understand::AssistantContext::TaskContext::FieldContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/understand/assistant/task/field.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, task_sid, sid) ⇒ FieldContext

Initialize the FieldContext

Parameters:

  • version (Version)

    Version that contains the resource

  • assistant_sid (String)

    The unique ID of the Assistant.

  • task_sid (String)

    The unique ID of the Task associated with this Field.

  • sid (String)

    A 34 character string that uniquely identifies this resource.


188
189
190
191
192
193
194
# File 'lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb', line 188

def initialize(version, assistant_sid, task_sid, sid)
  super(version)

  # Path Solution
  @solution = {assistant_sid: assistant_sid, task_sid: task_sid, sid: sid, }
  @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Fields/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Delete the FieldInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


214
215
216
# File 'lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb', line 214

def delete
   @version.delete('DELETE', @uri)
end

#fetchFieldInstance

Fetch the FieldInstance

Returns:


199
200
201
202
203
204
205
206
207
208
209
# File 'lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb', line 199

def fetch
  payload = @version.fetch('GET', @uri)

  FieldInstance.new(
      @version,
      payload,
      assistant_sid: @solution[:assistant_sid],
      task_sid: @solution[:task_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


227
228
229
230
# File 'lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb', line 227

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

#to_sObject

Provide a user friendly representation


220
221
222
223
# File 'lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb', line 220

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