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

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/preview/understand/assistant.rb

Instance Method Summary collapse

Constructor Details

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

Initialize the AssistantInstance



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 433

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



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

def 
    @properties['account_sid']
end

#assistant_fallback_actionsassistant_fallback_actions

Access the assistant_fallback_actions



600
601
602
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 600

def assistant_fallback_actions
    context.assistant_fallback_actions
end

#assistant_initiation_actionsassistant_initiation_actions

Access the assistant_initiation_actions



621
622
623
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 621

def assistant_initiation_actions
    context.assistant_initiation_actions
end

#callback_eventsString



536
537
538
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 536

def callback_events
    @properties['callback_events']
end

#callback_urlString



530
531
532
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 530

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



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

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

#date_createdTime



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

def date_created
    @properties['date_created']
end

#date_updatedTime



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

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the AssistantInstance



543
544
545
546
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 543

def delete

    context.delete
end

#dialoguesdialogues

Access the dialogues



614
615
616
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 614

def dialogues
    context.dialogues
end

#fetchAssistantInstance

Fetch the AssistantInstance



551
552
553
554
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 551

def fetch

    context.fetch
end

#field_typesfield_types

Access the field_types



593
594
595
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 593

def field_types
    context.field_types
end

#friendly_nameString



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

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



655
656
657
658
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 655

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

#latest_model_build_sidString



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

def latest_model_build_sid
    @properties['latest_model_build_sid']
end


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

def links
    @properties['links']
end

#log_queriesBoolean



506
507
508
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 506

def log_queries
    @properties['log_queries']
end

#model_buildsmodel_builds

Access the model_builds



628
629
630
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 628

def model_builds
    context.model_builds
end

#queriesqueries

Access the queries



642
643
644
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 642

def queries
    context.queries
end

#sidString



512
513
514
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 512

def sid
    @properties['sid']
end

#style_sheetstyle_sheet

Access the style_sheet



635
636
637
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 635

def style_sheet
    context.style_sheet
end

#taskstasks

Access the tasks



607
608
609
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 607

def tasks
    context.tasks
end

#to_sObject

Provide a user friendly representation



648
649
650
651
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 648

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

#unique_nameString



518
519
520
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 518

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, style_sheet: :unset) ⇒ AssistantInstance

Update the AssistantInstance



567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 567

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
)

    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, 
        style_sheet: style_sheet, 
    )
end

#urlString



524
525
526
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 524

def url
    @properties['url']
end