Class: Twilio::REST::Preview::Understand::AssistantContext::DialogueContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/understand/assistant/dialogue.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, assistant_sid, sid) ⇒ DialogueContext

Initialize the DialogueContext

Parameters:

  • version (Version)

    Version that contains the resource

  • assistant_sid (String)

    The assistant_sid

  • sid (String)

    The sid


76
77
78
79
80
81
82
# File 'lib/twilio-ruby/rest/preview/understand/assistant/dialogue.rb', line 76

def initialize(version, assistant_sid, sid)
  super(version)

  # Path Solution
  @solution = {assistant_sid: assistant_sid, sid: sid, }
  @uri = "/Assistants/#{@solution[:assistant_sid]}/Dialogues/#{@solution[:sid]}"
end

Instance Method Details

#fetchDialogueInstance

Fetch the DialogueInstance

Returns:


87
88
89
90
91
92
93
94
95
96
# File 'lib/twilio-ruby/rest/preview/understand/assistant/dialogue.rb', line 87

def fetch
  payload = @version.fetch('GET', @uri)

  DialogueInstance.new(
      @version,
      payload,
      assistant_sid: @solution[:assistant_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


107
108
109
110
# File 'lib/twilio-ruby/rest/preview/understand/assistant/dialogue.rb', line 107

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.Understand.DialogueContext #{context}>"
end

#to_sObject

Provide a user friendly representation


100
101
102
103
# File 'lib/twilio-ruby/rest/preview/understand/assistant/dialogue.rb', line 100

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.Understand.DialogueContext #{context}>"
end