class Twilio::REST::Autopilot::V1::AssistantContext::QueryContext

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 help@twilio.com.

Public Class Methods

new(version, assistant_sid, sid) click to toggle source

Initialize the QueryContext @param [Version] version Version that contains the resource @param [String] assistant_sid The SID of the

{Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the
parent of the resource to fetch.

@param [String] sid The Twilio-provided string that uniquely identifies the

Query resource to fetch.

@return [QueryContext] QueryContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb
236 def initialize(version, assistant_sid, sid)
237   super(version)
238 
239   # Path Solution
240   @solution = {assistant_sid: assistant_sid, sid: sid, }
241   @uri = "/Assistants/#{@solution[:assistant_sid]}/Queries/#{@solution[:sid]}"
242 end

Public Instance Methods

delete() click to toggle source

Delete the QueryInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb
272 def delete
273    @version.delete('DELETE', @uri)
274 end
fetch() click to toggle source

Fetch the QueryInstance @return [QueryInstance] Fetched QueryInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb
247 def fetch
248   payload = @version.fetch('GET', @uri)
249 
250   QueryInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], sid: @solution[:sid], )
251 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb
285 def inspect
286   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
287   "#<Twilio.Autopilot.V1.QueryContext #{context}>"
288 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb
278 def to_s
279   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
280   "#<Twilio.Autopilot.V1.QueryContext #{context}>"
281 end
update(sample_sid: :unset, status: :unset) click to toggle source

Update the QueryInstance @param [String] sample_sid The SID of an optional reference to the

{Sample}[https://www.twilio.com/docs/autopilot/api/task-sample] created from the
query.

@param [String] status The new status of the resource. Can be: `pending-review`,

`reviewed`, or `discarded`

@return [QueryInstance] Updated QueryInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb
261 def update(sample_sid: :unset, status: :unset)
262   data = Twilio::Values.of({'SampleSid' => sample_sid, 'Status' => status, })
263 
264   payload = @version.update('POST', @uri, data: data)
265 
266   QueryInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], sid: @solution[:sid], )
267 end