class Twilio::REST::Autopilot::V1::AssistantContext::FieldTypeInstance
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 FieldTypeInstance
@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 resource.
@param [String] sid The Twilio-provided string that uniquely identifies the
FieldType resource to fetch.
@return [FieldTypeInstance] FieldTypeInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 281 def initialize(version, payload, assistant_sid: nil, sid: nil) 282 super(version) 283 284 # Marshaled Properties 285 @properties = { 286 'account_sid' => payload['account_sid'], 287 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 288 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 289 'friendly_name' => payload['friendly_name'], 290 'links' => payload['links'], 291 'assistant_sid' => payload['assistant_sid'], 292 'sid' => payload['sid'], 293 'unique_name' => payload['unique_name'], 294 'url' => payload['url'], 295 } 296 297 # Context 298 @instance_context = nil 299 @params = {'assistant_sid' => assistant_sid, 'sid' => sid || @properties['sid'], } 300 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.rb 315 def account_sid 316 @properties['account_sid'] 317 end
@return [String] The SID of the Assistant that is the parent of the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 345 def assistant_sid 346 @properties['assistant_sid'] 347 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 [FieldTypeContext] FieldTypeContext
for this FieldTypeInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 306 def context 307 unless @instance_context 308 @instance_context = FieldTypeContext.new(@version, @params['assistant_sid'], @params['sid'], ) 309 end 310 @instance_context 311 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.rb 321 def date_created 322 @properties['date_created'] 323 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.rb 327 def date_updated 328 @properties['date_updated'] 329 end
Delete the FieldTypeInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 389 def delete 390 context.delete 391 end
Fetch the FieldTypeInstance
@return [FieldTypeInstance] Fetched FieldTypeInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 370 def fetch 371 context.fetch 372 end
Access the field_values
@return [field_values] field_values
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 396 def field_values 397 context.field_values 398 end
@return [String] The string that you assigned to describe the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 333 def friendly_name 334 @properties['friendly_name'] 335 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 409 def inspect 410 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 411 "<Twilio.Autopilot.V1.FieldTypeInstance #{values}>" 412 end
@return [String] A list of the URLs of related resources
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 339 def links 340 @properties['links'] 341 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 351 def sid 352 @properties['sid'] 353 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 402 def to_s 403 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 404 "<Twilio.Autopilot.V1.FieldTypeInstance #{values}>" 405 end
@return [String] An application-defined string that uniquely identifies the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 357 def unique_name 358 @properties['unique_name'] 359 end
Update the FieldTypeInstance
@param [String] friendly_name
A descriptive string that you create to describe
the resource. It is not unique and can be up to 255 characters long.
@param [String] unique_name
An application-defined string that uniquely
identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique.
@return [FieldTypeInstance] Updated FieldTypeInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 382 def update(friendly_name: :unset, unique_name: :unset) 383 context.update(friendly_name: friendly_name, unique_name: unique_name, ) 384 end
@return [String] The absolute URL of the FieldType resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb 363 def url 364 @properties['url'] 365 end