Class: Twilio::REST::Preview::Understand::AssistantContext::QueryContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::Understand::AssistantContext::QueryContext
- Defined in:
- lib/twilio-ruby/rest/preview/understand/assistant/query.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
-
#delete ⇒ Boolean
Delete the QueryInstance.
-
#fetch ⇒ QueryInstance
Fetch the QueryInstance.
-
#initialize(version, assistant_sid, sid) ⇒ QueryContext
constructor
Initialize the QueryContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(sample_sid: :unset, status: :unset) ⇒ QueryInstance
Update the QueryInstance.
Constructor Details
#initialize(version, assistant_sid, sid) ⇒ QueryContext
Initialize the QueryContext
215 216 217 218 219 220 221 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 215 def initialize(version, assistant_sid, sid) super(version) # Path Solution @solution = {assistant_sid: assistant_sid, sid: sid, } @uri = "/Assistants/#{@solution[:assistant_sid]}/Queries/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the QueryInstance
250 251 252 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 250 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ QueryInstance
Fetch the QueryInstance
226 227 228 229 230 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 226 def fetch payload = @version.fetch('GET', @uri) QueryInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
263 264 265 266 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 263 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Understand.QueryContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
256 257 258 259 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 256 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Understand.QueryContext #{context}>" end |
#update(sample_sid: :unset, status: :unset) ⇒ QueryInstance
Update the QueryInstance
239 240 241 242 243 244 245 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 239 def update(sample_sid: :unset, status: :unset) data = Twilio::Values.of({'SampleSid' => sample_sid, 'Status' => status, }) payload = @version.update('POST', @uri, data: data) QueryInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], sid: @solution[:sid], ) end |