Class: Twilio::REST::Autopilot::V1::AssistantContext::DialogueInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Autopilot::V1::AssistantContext::DialogueInstance
- Defined in:
- lib/twilio-ruby/rest/autopilot/v1/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
-
#account_sid ⇒ String
The unique ID of the Account that created this Field.
-
#assistant_sid ⇒ String
The unique ID of the parent Assistant.
-
#context ⇒ DialogueContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#data ⇒ Hash
The dialogue session object as json.
-
#fetch ⇒ DialogueInstance
Fetch a DialogueInstance.
-
#initialize(version, payload, assistant_sid: nil, sid: nil) ⇒ DialogueInstance
constructor
Initialize the DialogueInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
The unique ID of the Dialogue.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, assistant_sid: nil, sid: nil) ⇒ DialogueInstance
Initialize the DialogueInstance
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 122 def initialize(version, payload, assistant_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'assistant_sid' => payload['assistant_sid'], 'sid' => payload['sid'], 'data' => payload['data'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'assistant_sid' => assistant_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the Account that created this Field.
152 153 154 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 152 def account_sid @properties['account_sid'] end |
#assistant_sid ⇒ String
Returns The unique ID of the parent Assistant.
158 159 160 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 158 def assistant_sid @properties['assistant_sid'] end |
#context ⇒ DialogueContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
143 144 145 146 147 148 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 143 def context unless @instance_context @instance_context = DialogueContext.new(@version, @params['assistant_sid'], @params['sid'], ) end @instance_context end |
#data ⇒ Hash
Returns The dialogue session object as json.
170 171 172 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 170 def data @properties['data'] end |
#fetch ⇒ DialogueInstance
Fetch a DialogueInstance
183 184 185 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 183 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
196 197 198 199 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 196 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Autopilot.V1.DialogueInstance #{values}>" end |
#sid ⇒ String
Returns The unique ID of the Dialogue.
164 165 166 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 164 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
189 190 191 192 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 189 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Autopilot.V1.DialogueInstance #{values}>" end |
#url ⇒ String
Returns The url.
176 177 178 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 176 def url @properties['url'] end |