class Twilio::REST::Preview::Understand::AssistantContext::TaskContext::FieldInstance
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
Initialize the FieldInstance
@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 parent Assistant. @param [String] task_sid
The unique ID of the Task associated with this Field. @param [String] sid A 34 character string that uniquely identifies this
resource.
@return [FieldInstance] FieldInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 245 def initialize(version, payload, assistant_sid: nil, task_sid: nil, sid: nil) 246 super(version) 247 248 # Marshaled Properties 249 @properties = { 250 'account_sid' => payload['account_sid'], 251 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 252 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 253 'field_type' => payload['field_type'], 254 'task_sid' => payload['task_sid'], 255 'assistant_sid' => payload['assistant_sid'], 256 'sid' => payload['sid'], 257 'unique_name' => payload['unique_name'], 258 'url' => payload['url'], 259 } 260 261 # Context 262 @instance_context = nil 263 @params = { 264 'assistant_sid' => assistant_sid, 265 'task_sid' => task_sid, 266 'sid' => sid || @properties['sid'], 267 } 268 end
Public Instance Methods
@return [String] The unique ID of the Account that created this Field.
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 288 def account_sid 289 @properties['account_sid'] 290 end
@return [String] The unique ID of the parent Assistant.
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 318 def assistant_sid 319 @properties['assistant_sid'] 320 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [FieldContext] FieldContext
for this FieldInstance
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 274 def context 275 unless @instance_context 276 @instance_context = FieldContext.new( 277 @version, 278 @params['assistant_sid'], 279 @params['task_sid'], 280 @params['sid'], 281 ) 282 end 283 @instance_context 284 end
@return [Time] The date that this resource was created
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 294 def date_created 295 @properties['date_created'] 296 end
@return [Time] The date that this resource was last updated
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 300 def date_updated 301 @properties['date_updated'] 302 end
Delete the FieldInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 350 def delete 351 context.delete 352 end
Fetch the FieldInstance
@return [FieldInstance] Fetched FieldInstance
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 343 def fetch 344 context.fetch 345 end
@return [String] The Field Type of this field. It can be any Built-in Field Type or unique_name
or the Field Type sid of a custom Field Type.
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 306 def field_type 307 @properties['field_type'] 308 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 363 def inspect 364 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 365 "<Twilio.Preview.Understand.FieldInstance #{values}>" 366 end
@return [String] A 34 character string that uniquely identifies this resource.
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 324 def sid 325 @properties['sid'] 326 end
@return [String] The unique ID of the Task associated with this Field.
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 312 def task_sid 313 @properties['task_sid'] 314 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 356 def to_s 357 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 358 "<Twilio.Preview.Understand.FieldInstance #{values}>" 359 end
@return [String] A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 330 def unique_name 331 @properties['unique_name'] 332 end
@return [String] The url
# File lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb 336 def url 337 @properties['url'] 338 end