class Twilio::REST::Preview::Understand::AssistantContext::FieldTypeContext::FieldValueInstance

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 help@twilio.com.

Public Class Methods

new(version, payload, assistant_sid: nil, field_type_sid: nil, sid: nil) click to toggle source

Initialize the FieldValueInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] assistant_sid The unique ID of the Assistant. @param [String] field_type_sid The unique ID of the Field Type associated with

this Field Value.

@param [String] sid The sid @return [FieldValueInstance] FieldValueInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
251 def initialize(version, payload, assistant_sid: nil, field_type_sid: nil, sid: nil)
252   super(version)
253 
254   # Marshaled Properties
255   @properties = {
256       'account_sid' => payload['account_sid'],
257       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
258       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
259       'field_type_sid' => payload['field_type_sid'],
260       'language' => payload['language'],
261       'assistant_sid' => payload['assistant_sid'],
262       'sid' => payload['sid'],
263       'value' => payload['value'],
264       'url' => payload['url'],
265       'synonym_of' => payload['synonym_of'],
266   }
267 
268   # Context
269   @instance_context = nil
270   @params = {
271       'assistant_sid' => assistant_sid,
272       'field_type_sid' => field_type_sid,
273       'sid' => sid || @properties['sid'],
274   }
275 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The unique ID of the Account that created this Field Value.

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
295 def account_sid
296   @properties['account_sid']
297 end
assistant_sid() click to toggle source

@return [String] The unique ID of the Assistant.

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
325 def assistant_sid
326   @properties['assistant_sid']
327 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [FieldValueContext] FieldValueContext for this FieldValueInstance

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
281 def context
282   unless @instance_context
283     @instance_context = FieldValueContext.new(
284         @version,
285         @params['assistant_sid'],
286         @params['field_type_sid'],
287         @params['sid'],
288     )
289   end
290   @instance_context
291 end
date_created() click to toggle source

@return [Time] The date that this resource was created

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
301 def date_created
302   @properties['date_created']
303 end
date_updated() click to toggle source

@return [Time] The date that this resource was last updated

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
307 def date_updated
308   @properties['date_updated']
309 end
delete() click to toggle source

Delete the FieldValueInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
363 def delete
364   context.delete
365 end
fetch() click to toggle source

Fetch the FieldValueInstance @return [FieldValueInstance] Fetched FieldValueInstance

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
356 def fetch
357   context.fetch
358 end
field_type_sid() click to toggle source

@return [String] The unique ID of the Field Type associated with this Field Value.

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
313 def field_type_sid
314   @properties['field_type_sid']
315 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
376 def inspect
377   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
378   "<Twilio.Preview.Understand.FieldValueInstance #{values}>"
379 end
language() click to toggle source

@return [String] An ISO language-country string of the value.

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
319 def language
320   @properties['language']
321 end
sid() click to toggle source

@return [String] A 34 character string that uniquely identifies this resource.

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
331 def sid
332   @properties['sid']
333 end
synonym_of() click to toggle source

@return [String] A value that indicates this field value is a synonym of. Empty if the value is not a synonym.

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
349 def synonym_of
350   @properties['synonym_of']
351 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
369 def to_s
370   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
371   "<Twilio.Preview.Understand.FieldValueInstance #{values}>"
372 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
343 def url
344   @properties['url']
345 end
value() click to toggle source

@return [String] The Field Value itself.

    # File lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb
337 def value
338   @properties['value']
339 end