class Twilio::REST::Preview::Understand::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 unique ID of the Assistant. @param [String] sid A 34 character string that uniquely identifies this

resource.

@return [QueryContext] QueryContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/preview/understand/assistant/query.rb
215 def initialize(version, assistant_sid, sid)
216   super(version)
217 
218   # Path Solution
219   @solution = {assistant_sid: assistant_sid, sid: sid, }
220   @uri = "/Assistants/#{@solution[:assistant_sid]}/Queries/#{@solution[:sid]}"
221 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/preview/understand/assistant/query.rb
250 def delete
251    @version.delete('DELETE', @uri)
252 end
fetch() click to toggle source

Fetch the QueryInstance @return [QueryInstance] Fetched QueryInstance

    # File lib/twilio-ruby/rest/preview/understand/assistant/query.rb
226 def fetch
227   payload = @version.fetch('GET', @uri)
228 
229   QueryInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], sid: @solution[:sid], )
230 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/understand/assistant/query.rb
263 def inspect
264   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
265   "#<Twilio.Preview.Understand.QueryContext #{context}>"
266 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/understand/assistant/query.rb
256 def to_s
257   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
258   "#<Twilio.Preview.Understand.QueryContext #{context}>"
259 end
update(sample_sid: :unset, status: :unset) click to toggle source

Update the QueryInstance @param [String] sample_sid An optional reference to the Sample created from this

query.

@param [String] status A string that described the query status. The values can

be: pending_review, reviewed, discarded

@return [QueryInstance] Updated QueryInstance

    # File lib/twilio-ruby/rest/preview/understand/assistant/query.rb
239 def update(sample_sid: :unset, status: :unset)
240   data = Twilio::Values.of({'SampleSid' => sample_sid, 'Status' => status, })
241 
242   payload = @version.update('POST', @uri, data: data)
243 
244   QueryInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], sid: @solution[:sid], )
245 end