Class: Twilio::REST::Preview::Understand::AssistantContext::FieldTypeContext::FieldValueContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.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, field_type_sid, sid) ⇒ FieldValueContext

Initialize the FieldValueContext

Parameters:

  • version (Version)

    Version that contains the resource

  • assistant_sid (String)

    The assistant_sid

  • field_type_sid (String)

    The field_type_sid

  • sid (String)

    The sid


194
195
196
197
198
199
200
# File 'lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb', line 194

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

  # Path Solution
  @solution = {assistant_sid: assistant_sid, field_type_sid: field_type_sid, sid: sid, }
  @uri = "/Assistants/#{@solution[:assistant_sid]}/FieldTypes/#{@solution[:field_type_sid]}/FieldValues/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Delete the FieldValueInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


220
221
222
# File 'lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb', line 220

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

#fetchFieldValueInstance

Fetch the FieldValueInstance

Returns:


205
206
207
208
209
210
211
212
213
214
215
# File 'lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb', line 205

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

  FieldValueInstance.new(
      @version,
      payload,
      assistant_sid: @solution[:assistant_sid],
      field_type_sid: @solution[:field_type_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


233
234
235
236
# File 'lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb', line 233

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

#to_sObject

Provide a user friendly representation


226
227
228
229
# File 'lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb', line 226

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