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 SID of the Account that created the resource.
-
#assistant_sid ⇒ String
The SID of the Assistant that is the parent of the resource.
-
#context ⇒ DialogueContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#data ⇒ Hash
The JSON string that describes the dialogue session object.
-
#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 string that identifies the resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the Dialogue resource.
Constructor Details
#initialize(version, payload, assistant_sid: nil, sid: nil) ⇒ DialogueInstance
Initialize the DialogueInstance
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 137 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 SID of the Account that created the resource.
167 168 169 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 167 def account_sid @properties['account_sid'] end |
#assistant_sid ⇒ String
Returns The SID of the Assistant that is the parent of the resource.
173 174 175 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 173 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
158 159 160 161 162 163 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 158 def context unless @instance_context @instance_context = DialogueContext.new(@version, @params['assistant_sid'], @params['sid'], ) end @instance_context end |
#data ⇒ Hash
Returns The JSON string that describes the dialogue session object.
185 186 187 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 185 def data @properties['data'] end |
#fetch ⇒ DialogueInstance
Fetch a DialogueInstance
198 199 200 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 198 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
211 212 213 214 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 211 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Autopilot.V1.DialogueInstance #{values}>" end |
#sid ⇒ String
Returns The unique string that identifies the resource.
179 180 181 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 179 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
204 205 206 207 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 204 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Autopilot.V1.DialogueInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the Dialogue resource.
191 192 193 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb', line 191 def url @properties['url'] end |