class Twilio::REST::Autopilot::V1::AssistantInstance

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, sid: nil) click to toggle source

Initialize the AssistantInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The Twilio-provided string that uniquely identifies the

Assistant resource to fetch.

@return [AssistantInstance] AssistantInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
409 def initialize(version, payload, sid: nil)
410   super(version)
411 
412   # Marshaled Properties
413   @properties = {
414       'account_sid' => payload['account_sid'],
415       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
416       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
417       'friendly_name' => payload['friendly_name'],
418       'latest_model_build_sid' => payload['latest_model_build_sid'],
419       'links' => payload['links'],
420       'log_queries' => payload['log_queries'],
421       'development_stage' => payload['development_stage'],
422       'needs_model_build' => payload['needs_model_build'],
423       'sid' => payload['sid'],
424       'unique_name' => payload['unique_name'],
425       'url' => payload['url'],
426       'callback_url' => payload['callback_url'],
427       'callback_events' => payload['callback_events'],
428   }
429 
430   # Context
431   @instance_context = nil
432   @params = {'sid' => sid || @properties['sid'], }
433 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.rb
448 def account_sid
449   @properties['account_sid']
450 end
callback_events() click to toggle source

@return [String] Reserved

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
526 def callback_events
527   @properties['callback_events']
528 end
callback_url() click to toggle source

@return [String] Reserved

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
520 def callback_url
521   @properties['callback_url']
522 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 [AssistantContext] AssistantContext for this AssistantInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
439 def context
440   unless @instance_context
441     @instance_context = AssistantContext.new(@version, @params['sid'], )
442   end
443   @instance_context
444 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.rb
454 def date_created
455   @properties['date_created']
456 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.rb
460 def date_updated
461   @properties['date_updated']
462 end
defaults() click to toggle source

Access the defaults @return [defaults] defaults

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
615 def defaults
616   context.defaults
617 end
delete() click to toggle source

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

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
573 def delete
574   context.delete
575 end
development_stage() click to toggle source

@return [String] A string describing the state of the assistant.

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
490 def development_stage
491   @properties['development_stage']
492 end
dialogues() click to toggle source

Access the dialogues @return [dialogues] dialogues

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
622 def dialogues
623   context.dialogues
624 end
fetch() click to toggle source

Fetch the AssistantInstance @return [AssistantInstance] Fetched AssistantInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
533 def fetch
534   context.fetch
535 end
field_types() click to toggle source

Access the field_types @return [field_types] field_types

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
580 def field_types
581   context.field_types
582 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
466 def friendly_name
467   @properties['friendly_name']
468 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
642 def inspect
643   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
644   "<Twilio.Autopilot.V1.AssistantInstance #{values}>"
645 end
latest_model_build_sid() click to toggle source

@return [String] Reserved

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
472 def latest_model_build_sid
473   @properties['latest_model_build_sid']
474 end
log_queries() click to toggle source

@return [Boolean] Whether queries should be logged and kept after training

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
484 def log_queries
485   @properties['log_queries']
486 end
model_builds() click to toggle source

Access the model_builds @return [model_builds] model_builds

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
594 def model_builds
595   context.model_builds
596 end
needs_model_build() click to toggle source

@return [Boolean] Whether model needs to be rebuilt

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
496 def needs_model_build
497   @properties['needs_model_build']
498 end
queries() click to toggle source

Access the queries @return [queries] queries

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
601 def queries
602   context.queries
603 end
sid() click to toggle source

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

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
502 def sid
503   @properties['sid']
504 end
style_sheet() click to toggle source

Access the style_sheet @return [style_sheet] style_sheet

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
608 def style_sheet
609   context.style_sheet
610 end
tasks() click to toggle source

Access the tasks @return [tasks] tasks

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
587 def tasks
588   context.tasks
589 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
635 def to_s
636   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
637   "<Twilio.Autopilot.V1.AssistantInstance #{values}>"
638 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.rb
508 def unique_name
509   @properties['unique_name']
510 end
update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, style_sheet: :unset, defaults: :unset, development_stage: :unset) click to toggle source

Update the AssistantInstance @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 [Boolean] log_queries Whether queries should be logged and kept after

training. Can be: `true` or `false` and defaults to `true`. If `true`, queries
are stored for 30 days, and then deleted. If `false`, no queries are stored.

@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.

@param [String] callback_url Reserved. @param [String] callback_events Reserved. @param [Hash] style_sheet The JSON string that defines the Assistant's {style

sheet}[https://www.twilio.com/docs/autopilot/api/assistant/stylesheet]

@param [Hash] defaults A JSON object that defines the Assistant's {default

tasks}[https://www.twilio.com/docs/autopilot/api/assistant/defaults] for various
scenarios, including initiation actions and fallback tasks.

@param [String] development_stage A string describing the state of the

assistant.

@return [AssistantInstance] Updated AssistantInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
557 def update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, style_sheet: :unset, defaults: :unset, development_stage: :unset)
558   context.update(
559       friendly_name: friendly_name,
560       log_queries: log_queries,
561       unique_name: unique_name,
562       callback_url: callback_url,
563       callback_events: callback_events,
564       style_sheet: style_sheet,
565       defaults: defaults,
566       development_stage: development_stage,
567   )
568 end
url() click to toggle source

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

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
514 def url
515   @properties['url']
516 end
webhooks() click to toggle source

Access the webhooks @return [webhooks] webhooks

    # File lib/twilio-ruby/rest/autopilot/v1/assistant.rb
629 def webhooks
630   context.webhooks
631 end