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



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 412

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



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

def 
  @properties['account_sid']
end

#assistant_fallback_actionsassistant_fallback_actions

Access the assistant_fallback_actions



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

def assistant_fallback_actions
  context.assistant_fallback_actions
end

#assistant_initiation_actionsassistant_initiation_actions

Access the assistant_initiation_actions



604
605
606
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 604

def assistant_initiation_actions
  context.assistant_initiation_actions
end

#callback_eventsString



515
516
517
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 515

def callback_events
  @properties['callback_events']
end

#callback_urlString



509
510
511
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 509

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



440
441
442
443
444
445
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 440

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

#date_createdTime



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

def date_created
  @properties['date_created']
end

#date_updatedTime



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

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the AssistantInstance



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

def delete
  context.delete
end

#dialoguesdialogues

Access the dialogues



611
612
613
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 611

def dialogues
  context.dialogues
end

#fetchAssistantInstance

Fetch a AssistantInstance



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

def fetch
  context.fetch
end

#field_typesfield_types

Access the field_types



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

def field_types
  context.field_types
end

#friendly_nameString



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

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



631
632
633
634
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 631

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

#latest_model_build_sidString



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

def latest_model_build_sid
  @properties['latest_model_build_sid']
end


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

def links
  @properties['links']
end

#log_queriesBoolean



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

def log_queries
  @properties['log_queries']
end

#model_buildsmodel_builds

Access the model_builds



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

def model_builds
  context.model_builds
end

#queriesqueries

Access the queries



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

def queries
  context.queries
end

#sidString



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

def sid
  @properties['sid']
end

#style_sheetstyle_sheet

Access the style_sheet



618
619
620
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 618

def style_sheet
  context.style_sheet
end

#taskstasks

Access the tasks



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

def tasks
  context.tasks
end

#to_sObject

Provide a user friendly representation



624
625
626
627
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 624

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

#unique_nameString



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

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



546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 546

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



503
504
505
# File 'lib/twilio-ruby/rest/preview/understand/assistant.rb', line 503

def url
  @properties['url']
end