Class: Twilio::REST::Preview::Understand::AssistantInstance

Inherits:
InstanceResource show all
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

Constructor Details

#initialize(version, payload, sid: nil) ⇒ AssistantInstance

Initialize the AssistantInstance



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 389

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'],
      'unique_name' => payload['unique_name'],
      'url' => payload['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_sidString



426
427
428
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 426

def 
  @properties['account_sid']
end

#assistant_fallback_actionsassistant_fallback_actions

Access the assistant_fallback_actions



568
569
570
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 568

def assistant_fallback_actions
  context.assistant_fallback_actions
end

#assistant_initiation_actionsassistant_initiation_actions

Access the assistant_initiation_actions



575
576
577
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 575

def assistant_initiation_actions
  context.assistant_initiation_actions
end

#callback_eventsString



492
493
494
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 492

def callback_events
  @properties['callback_events']
end

#callback_urlString



486
487
488
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 486

def callback_url
  @properties['callback_url']
end

#contextAssistantContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



417
418
419
420
421
422
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 417

def context
  unless @instance_context
    @instance_context = AssistantContext.new(@version, @params['sid'], )
  end
  @instance_context
end

#date_createdTime



432
433
434
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 432

def date_created
  @properties['date_created']
end

#date_updatedTime



438
439
440
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 438

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the AssistantInstance



533
534
535
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 533

def delete
  context.delete
end

#dialoguesdialogues

Access the dialogues



582
583
584
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 582

def dialogues
  context.dialogues
end

#fetchAssistantInstance

Fetch a AssistantInstance



499
500
501
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 499

def fetch
  context.fetch
end

#field_typesfield_types

Access the field_types



540
541
542
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 540

def field_types
  context.field_types
end

#friendly_nameString



444
445
446
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 444

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



595
596
597
598
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 595

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.Understand.AssistantInstance #{values}>"
end

#intentsintents

Access the intents



547
548
549
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 547

def intents
  context.intents
end

#latest_model_build_sidString



450
451
452
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 450

def latest_model_build_sid
  @properties['latest_model_build_sid']
end


456
457
458
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 456

def links
  @properties['links']
end

#log_queriesBoolean



462
463
464
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 462

def log_queries
  @properties['log_queries']
end

#model_buildsmodel_builds

Access the model_builds



554
555
556
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 554

def model_builds
  context.model_builds
end

#queriesqueries

Access the queries



561
562
563
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 561

def queries
  context.queries
end

#sidString



468
469
470
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 468

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



588
589
590
591
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 588

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.Understand.AssistantInstance #{values}>"
end

#unique_nameString



474
475
476
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 474

def unique_name
  @properties['unique_name']
end

#update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, fallback_actions: :unset, initiation_actions: :unset) ⇒ AssistantInstance

Update the AssistantInstance



518
519
520
521
522
523
524
525
526
527
528
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 518

def update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, fallback_actions: :unset, initiation_actions: :unset)
  context.update(
      friendly_name: friendly_name,
      log_queries: log_queries,
      unique_name: unique_name,
      callback_url: callback_url,
      callback_events: callback_events,
      fallback_actions: fallback_actions,
      initiation_actions: initiation_actions,
  )
end

#urlString



480
481
482
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 480

def url
  @properties['url']
end