Class: Twilio::REST::Autopilot::V1::AssistantContext::QueryContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Autopilot::V1::AssistantContext::QueryContext
- Defined in:
- lib/twilio-ruby/rest/autopilot/v1/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
Deletes the QueryInstance.
-
#fetch ⇒ QueryInstance
Fetch a 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
236 237 238 239 240 241 242 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb', line 236 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
Deletes the QueryInstance
282 283 284 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb', line 282 def delete @version.delete('delete', @uri) end |
#fetch ⇒ QueryInstance
Fetch a QueryInstance
247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb', line 247 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) QueryInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
295 296 297 298 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb', line 295 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Autopilot.V1.QueryContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
288 289 290 291 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb', line 288 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Autopilot.V1.QueryContext #{context}>" end |
#update(sample_sid: :unset, status: :unset) ⇒ QueryInstance
Update the QueryInstance
267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb', line 267 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 |