class Twilio::REST::Autopilot::V1::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
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 SID of the
{Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the parent of the FieldType associated with the resource.
@param [String] field_type_sid
The SID of the Field Type associated with the
Field Value.
@param [String] sid The Twilio-provided string that uniquely identifies the
FieldValue resource to fetch.
@return [FieldValueInstance] FieldValueInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 264 def initialize(version, payload, assistant_sid: nil, field_type_sid: nil, sid: nil) 265 super(version) 266 267 # Marshaled Properties 268 @properties = { 269 'account_sid' => payload['account_sid'], 270 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 271 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 272 'field_type_sid' => payload['field_type_sid'], 273 'language' => payload['language'], 274 'assistant_sid' => payload['assistant_sid'], 275 'sid' => payload['sid'], 276 'value' => payload['value'], 277 'url' => payload['url'], 278 'synonym_of' => payload['synonym_of'], 279 } 280 281 # Context 282 @instance_context = nil 283 @params = { 284 'assistant_sid' => assistant_sid, 285 'field_type_sid' => field_type_sid, 286 'sid' => sid || @properties['sid'], 287 } 288 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 308 def account_sid 309 @properties['account_sid'] 310 end
@return [String] The SID of the Assistant that is the parent of the FieldType associated with the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 338 def assistant_sid 339 @properties['assistant_sid'] 340 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 [FieldValueContext] FieldValueContext
for this FieldValueInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 294 def context 295 unless @instance_context 296 @instance_context = FieldValueContext.new( 297 @version, 298 @params['assistant_sid'], 299 @params['field_type_sid'], 300 @params['sid'], 301 ) 302 end 303 @instance_context 304 end
@return [Time] The RFC 2822 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 314 def date_created 315 @properties['date_created'] 316 end
@return [Time] The RFC 2822 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 320 def date_updated 321 @properties['date_updated'] 322 end
Delete the FieldValueInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 376 def delete 377 context.delete 378 end
Fetch the FieldValueInstance
@return [FieldValueInstance] Fetched FieldValueInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 369 def fetch 370 context.fetch 371 end
@return [String] The SID of the Field Type associated with the Field Value
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 326 def field_type_sid 327 @properties['field_type_sid'] 328 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 389 def inspect 390 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 391 "<Twilio.Autopilot.V1.FieldValueInstance #{values}>" 392 end
@return [String] The ISO language-country tag that identifies the language of the value
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 332 def language 333 @properties['language'] 334 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 344 def sid 345 @properties['sid'] 346 end
@return [String] The word for which the field value is a synonym of
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 362 def synonym_of 363 @properties['synonym_of'] 364 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 382 def to_s 383 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 384 "<Twilio.Autopilot.V1.FieldValueInstance #{values}>" 385 end
@return [String] The absolute URL of the FieldValue resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 356 def url 357 @properties['url'] 358 end
@return [String] The Field Value data
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb 350 def value 351 @properties['value'] 352 end