class Twilio::REST::Preview::Understand::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
Initialize the AssistantInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid A 34 character string that uniquely identifies this
resource.
@return [AssistantInstance] AssistantInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 402 def initialize(version, payload, sid: nil) 403 super(version) 404 405 # Marshaled Properties 406 @properties = { 407 'account_sid' => payload['account_sid'], 408 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 409 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 410 'friendly_name' => payload['friendly_name'], 411 'latest_model_build_sid' => payload['latest_model_build_sid'], 412 'links' => payload['links'], 413 'log_queries' => payload['log_queries'], 414 'sid' => payload['sid'], 415 'unique_name' => payload['unique_name'], 416 'url' => payload['url'], 417 'callback_url' => payload['callback_url'], 418 'callback_events' => payload['callback_events'], 419 } 420 421 # Context 422 @instance_context = nil 423 @params = {'sid' => sid || @properties['sid'], } 424 end
Public Instance Methods
@return [String] The unique ID of the Account that created this Assistant.
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 439 def account_sid 440 @properties['account_sid'] 441 end
Access the assistant_fallback_actions
@return [assistant_fallback_actions] assistant_fallback_actions
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 587 def assistant_fallback_actions 588 context.assistant_fallback_actions 589 end
Access the assistant_initiation_actions
@return [assistant_initiation_actions] assistant_initiation_actions
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 594 def assistant_initiation_actions 595 context.assistant_initiation_actions 596 end
@return [String] Space-separated list of callback events that will trigger callbacks.
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 505 def callback_events 506 @properties['callback_events'] 507 end
@return [String] A user-provided URL to send event callbacks to.
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 499 def callback_url 500 @properties['callback_url'] 501 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 [AssistantContext] AssistantContext
for this AssistantInstance
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 430 def context 431 unless @instance_context 432 @instance_context = AssistantContext.new(@version, @params['sid'], ) 433 end 434 @instance_context 435 end
@return [Time] The date that this resource was created
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 445 def date_created 446 @properties['date_created'] 447 end
@return [Time] The date that this resource was last updated
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 451 def date_updated 452 @properties['date_updated'] 453 end
Delete the AssistantInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 552 def delete 553 context.delete 554 end
Access the dialogues @return [dialogues] dialogues
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 601 def dialogues 602 context.dialogues 603 end
Fetch the AssistantInstance
@return [AssistantInstance] Fetched AssistantInstance
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 512 def fetch 513 context.fetch 514 end
Access the field_types
@return [field_types] field_types
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 559 def field_types 560 context.field_types 561 end
@return [String] A text description for the Assistant. It is non-unique and can up to 255 characters long.
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 457 def friendly_name 458 @properties['friendly_name'] 459 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 621 def inspect 622 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 623 "<Twilio.Preview.Understand.AssistantInstance #{values}>" 624 end
@return [String] The unique ID (Sid) of the latest model build. Null if no model has been built.
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 463 def latest_model_build_sid 464 @properties['latest_model_build_sid'] 465 end
@return [String] The links
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 469 def links 470 @properties['links'] 471 end
@return [Boolean] A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter.
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 475 def log_queries 476 @properties['log_queries'] 477 end
Access the model_builds
@return [model_builds] model_builds
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 573 def model_builds 574 context.model_builds 575 end
Access the queries @return [queries] queries
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 580 def queries 581 context.queries 582 end
@return [String] A 34 character string that uniquely identifies this resource.
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 481 def sid 482 @properties['sid'] 483 end
Access the style_sheet
@return [style_sheet] style_sheet
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 608 def style_sheet 609 context.style_sheet 610 end
Access the tasks @return [tasks] tasks
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 566 def tasks 567 context.tasks 568 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 614 def to_s 615 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 616 "<Twilio.Preview.Understand.AssistantInstance #{values}>" 617 end
@return [String] A user-provided string that uniquely identifies this resource as an alternative to the sid. You can use the unique name in the URL path. Unique up to 64 characters long.
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 487 def unique_name 488 @properties['unique_name'] 489 end
Update the AssistantInstance
@param [String] friendly_name
A text description for the Assistant. It is
non-unique and can up to 255 characters long.
@param [Boolean] log_queries
A boolean that specifies whether queries should be
logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided.
@param [String] unique_name
A user-provided string that uniquely identifies this
resource as an alternative to the sid. Unique up to 64 characters long.
@param [String] callback_url
A user-provided URL to send event callbacks to. @param [String] callback_events
Space-separated list of callback events that
will trigger callbacks.
@param [Hash] fallback_actions The JSON actions to be executed when the user's
input is not recognized as matching any Task.
@param [Hash] initiation_actions The JSON actions to be executed on inbound
phone calls when the Assistant has to say something first.
@param [Hash] style_sheet
The JSON object that holds the style sheet for the
assistant
@return [AssistantInstance] Updated AssistantInstance
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 536 def update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, fallback_actions: :unset, initiation_actions: :unset, style_sheet: :unset) 537 context.update( 538 friendly_name: friendly_name, 539 log_queries: log_queries, 540 unique_name: unique_name, 541 callback_url: callback_url, 542 callback_events: callback_events, 543 fallback_actions: fallback_actions, 544 initiation_actions: initiation_actions, 545 style_sheet: style_sheet, 546 ) 547 end
@return [String] The url
# File lib/twilio-ruby/rest/preview/understand/assistant.rb 493 def url 494 @properties['url'] 495 end