Class: Twilio::REST::Preview::Understand::AssistantInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::Understand::AssistantInstance
- Defined in:
- lib/twilio-ruby/rest/preview/understand/assistant.rb
Overview
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 [email protected].
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the Account that created this Assistant.
-
#callback_events ⇒ String
The callback_events.
-
#callback_url ⇒ String
The callback_url.
-
#context ⇒ AssistantContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this resource was created.
-
#date_updated ⇒ Time
The date that this resource was last updated.
-
#delete ⇒ Boolean
Deletes the AssistantInstance.
-
#fetch ⇒ AssistantInstance
Fetch a AssistantInstance.
-
#field_types ⇒ field_types
Access the field_types.
-
#friendly_name ⇒ String
A text description for the Assistant.
-
#initialize(version, payload, sid: nil) ⇒ AssistantInstance
constructor
Initialize the AssistantInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#intents ⇒ intents
Access the intents.
-
#latest_model_build_sid ⇒ String
The unique ID (Sid) of the latest model build.
-
#links ⇒ String
The links.
-
#log_queries ⇒ Boolean
A boolean that specifies whether queries should be logged for 30 days further training.
-
#model_builds ⇒ model_builds
Access the model_builds.
-
#queries ⇒ queries
Access the queries.
-
#response_url ⇒ String
The webhook URL called to fetch the response to an incoming communication expressed in Assistant TwiML.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#ttl ⇒ String
The ttl.
-
#unique_name ⇒ String
A user-provided string that uniquely identifies this resource as an alternative to the sid.
-
#update(friendly_name: :unset, log_queries: :unset, ttl: :unset, unique_name: :unset, response_url: :unset, callback_url: :unset, callback_events: :unset) ⇒ AssistantInstance
Update the AssistantInstance.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ AssistantInstance
Initialize the AssistantInstance
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 354 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'friendly_name' => payload['friendly_name'], 'latest_model_build_sid' => payload['latest_model_build_sid'], 'links' => payload['links'], 'log_queries' => payload['log_queries'], 'sid' => payload['sid'], 'ttl' => payload['ttl'].to_i, 'unique_name' => payload['unique_name'], 'url' => payload['url'], 'response_url' => payload['response_url'], 'callback_url' => payload['callback_url'], 'callback_events' => payload['callback_events'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the Account that created this Assistant.
393 394 395 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 393 def account_sid @properties['account_sid'] end |
#callback_events ⇒ String
Returns The callback_events.
471 472 473 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 471 def callback_events @properties['callback_events'] end |
#callback_url ⇒ String
Returns The callback_url.
465 466 467 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 465 def callback_url @properties['callback_url'] end |
#context ⇒ AssistantContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
384 385 386 387 388 389 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 384 def context unless @instance_context @instance_context = AssistantContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date that this resource was created.
399 400 401 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 399 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
405 406 407 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 405 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the AssistantInstance
513 514 515 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 513 def delete context.delete end |
#fetch ⇒ AssistantInstance
Fetch a AssistantInstance
478 479 480 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 478 def fetch context.fetch end |
#field_types ⇒ field_types
Access the field_types
520 521 522 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 520 def field_types context.field_types end |
#friendly_name ⇒ String
Returns A text description for the Assistant. It is non-unique and can up to 255 characters long.
411 412 413 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 411 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
554 555 556 557 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 554 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Understand.AssistantInstance #{values}>" end |
#intents ⇒ intents
Access the intents
527 528 529 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 527 def intents context.intents end |
#latest_model_build_sid ⇒ String
Returns The unique ID (Sid) of the latest model build. Null if no model has been built.
417 418 419 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 417 def latest_model_build_sid @properties['latest_model_build_sid'] end |
#links ⇒ String
Returns The links.
423 424 425 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 423 def links @properties['links'] end |
#log_queries ⇒ Boolean
Returns 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.
429 430 431 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 429 def log_queries @properties['log_queries'] end |
#model_builds ⇒ model_builds
Access the model_builds
534 535 536 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 534 def model_builds context.model_builds end |
#queries ⇒ queries
Access the queries
541 542 543 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 541 def queries context.queries end |
#response_url ⇒ String
Returns The webhook URL called to fetch the response to an incoming communication expressed in Assistant TwiML.
459 460 461 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 459 def response_url @properties['response_url'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
435 436 437 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 435 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
547 548 549 550 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 547 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Understand.AssistantInstance #{values}>" end |
#ttl ⇒ String
Returns The ttl.
441 442 443 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 441 def ttl @properties['ttl'] end |
#unique_name ⇒ String
Returns 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.
447 448 449 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 447 def unique_name @properties['unique_name'] end |
#update(friendly_name: :unset, log_queries: :unset, ttl: :unset, unique_name: :unset, response_url: :unset, callback_url: :unset, callback_events: :unset) ⇒ AssistantInstance
Update the AssistantInstance
498 499 500 501 502 503 504 505 506 507 508 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 498 def update(friendly_name: :unset, log_queries: :unset, ttl: :unset, unique_name: :unset, response_url: :unset, callback_url: :unset, callback_events: :unset) context.update( friendly_name: friendly_name, log_queries: log_queries, ttl: ttl, unique_name: unique_name, response_url: response_url, callback_url: callback_url, callback_events: callback_events, ) end |
#url ⇒ String
Returns The url.
453 454 455 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 453 def url @properties['url'] end |