class Twilio::REST::Autopilot::V1::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

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

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 SID of the

{Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the
parent of the Task associated with the resource.

@param [String] task_sid The SID of the

{Task}[https://www.twilio.com/docs/autopilot/api/task] resource associated with
this Field.

@param [String] sid The Twilio-provided string that uniquely identifies the

Field resource to fetch.

@return [FieldInstance] FieldInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
258 def initialize(version, payload, assistant_sid: nil, task_sid: nil, sid: nil)
259   super(version)
260 
261   # Marshaled Properties
262   @properties = {
263       'account_sid' => payload['account_sid'],
264       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
265       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
266       'field_type' => payload['field_type'],
267       'task_sid' => payload['task_sid'],
268       'assistant_sid' => payload['assistant_sid'],
269       'sid' => payload['sid'],
270       'unique_name' => payload['unique_name'],
271       'url' => payload['url'],
272   }
273 
274   # Context
275   @instance_context = nil
276   @params = {
277       'assistant_sid' => assistant_sid,
278       'task_sid' => task_sid,
279       'sid' => sid || @properties['sid'],
280   }
281 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
301 def account_sid
302   @properties['account_sid']
303 end
assistant_sid() click to toggle source

@return [String] The SID of the Assistant that is the parent of the Task associated with the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
331 def assistant_sid
332   @properties['assistant_sid']
333 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 [FieldContext] FieldContext for this FieldInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
287 def context
288   unless @instance_context
289     @instance_context = FieldContext.new(
290         @version,
291         @params['assistant_sid'],
292         @params['task_sid'],
293         @params['sid'],
294     )
295   end
296   @instance_context
297 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
307 def date_created
308   @properties['date_created']
309 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
313 def date_updated
314   @properties['date_updated']
315 end
delete() click to toggle source

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

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
363 def delete
364   context.delete
365 end
fetch() click to toggle source

Fetch the FieldInstance @return [FieldInstance] Fetched FieldInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
356 def fetch
357   context.fetch
358 end
field_type() click to toggle source

@return [String] The Field Type of the field

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
319 def field_type
320   @properties['field_type']
321 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
376 def inspect
377   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
378   "<Twilio.Autopilot.V1.FieldInstance #{values}>"
379 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
337 def sid
338   @properties['sid']
339 end
task_sid() click to toggle source

@return [String] The SID of the Task resource associated with this Field

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
325 def task_sid
326   @properties['task_sid']
327 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
369 def to_s
370   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
371   "<Twilio.Autopilot.V1.FieldInstance #{values}>"
372 end
unique_name() click to toggle source

@return [String] An application-defined string that uniquely identifies the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
343 def unique_name
344   @properties['unique_name']
345 end
url() click to toggle source

@return [String] The absolute URL of the Field resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb
349 def url
350   @properties['url']
351 end