Class: Twilio::REST::Autopilot::V1::AssistantInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/autopilot/v1/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



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

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'],
      'development_stage' => payload['development_stage'],
      'needs_model_build' => payload['needs_model_build'],
      '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



448
449
450
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 448

def 
  @properties['account_sid']
end

#callback_eventsString



526
527
528
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 526

def callback_events
  @properties['callback_events']
end

#callback_urlString



520
521
522
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 520

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



439
440
441
442
443
444
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 439

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

#date_createdTime



454
455
456
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 454

def date_created
  @properties['date_created']
end

#date_updatedTime



460
461
462
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 460

def date_updated
  @properties['date_updated']
end

#defaultsdefaults

Access the defaults



615
616
617
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 615

def defaults
  context.defaults
end

#deleteBoolean

Delete the AssistantInstance



573
574
575
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 573

def delete
  context.delete
end

#development_stageString



490
491
492
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 490

def development_stage
  @properties['development_stage']
end

#dialoguesdialogues

Access the dialogues



622
623
624
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 622

def dialogues
  context.dialogues
end

#fetchAssistantInstance

Fetch the AssistantInstance



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

def fetch
  context.fetch
end

#field_typesfield_types

Access the field_types



580
581
582
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 580

def field_types
  context.field_types
end

#friendly_nameString



466
467
468
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 466

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



642
643
644
645
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 642

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

#latest_model_build_sidString



472
473
474
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 472

def latest_model_build_sid
  @properties['latest_model_build_sid']
end


478
479
480
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 478

def links
  @properties['links']
end

#log_queriesBoolean



484
485
486
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 484

def log_queries
  @properties['log_queries']
end

#model_buildsmodel_builds

Access the model_builds



594
595
596
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 594

def model_builds
  context.model_builds
end

#needs_model_buildBoolean



496
497
498
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 496

def needs_model_build
  @properties['needs_model_build']
end

#queriesqueries

Access the queries



601
602
603
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 601

def queries
  context.queries
end

#sidString



502
503
504
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 502

def sid
  @properties['sid']
end

#style_sheetstyle_sheet

Access the style_sheet



608
609
610
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 608

def style_sheet
  context.style_sheet
end

#taskstasks

Access the tasks



587
588
589
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 587

def tasks
  context.tasks
end

#to_sObject

Provide a user friendly representation



635
636
637
638
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 635

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

#unique_nameString



508
509
510
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 508

def unique_name
  @properties['unique_name']
end

#update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, style_sheet: :unset, defaults: :unset, development_stage: :unset) ⇒ AssistantInstance

Update the AssistantInstance



557
558
559
560
561
562
563
564
565
566
567
568
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 557

def update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, style_sheet: :unset, defaults: :unset, development_stage: :unset)
  context.update(
      friendly_name: friendly_name,
      log_queries: log_queries,
      unique_name: unique_name,
      callback_url: callback_url,
      callback_events: callback_events,
      style_sheet: style_sheet,
      defaults: defaults,
      development_stage: development_stage,
  )
end

#urlString



514
515
516
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 514

def url
  @properties['url']
end

#webhookswebhooks

Access the webhooks



629
630
631
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 629

def webhooks
  context.webhooks
end