Class: Twilio::REST::Preview::Understand::AssistantContext::QueryInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::Understand::AssistantContext::QueryInstance
- 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
-
#account_sid ⇒ String
The account_sid.
-
#assistant_sid ⇒ String
The assistant_sid.
-
#context ⇒ QueryContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date_created.
-
#date_updated ⇒ Time
The date_updated.
-
#delete ⇒ Boolean
Deletes the QueryInstance.
-
#fetch ⇒ QueryInstance
Fetch a QueryInstance.
-
#initialize(version, payload, assistant_sid: nil, sid: nil) ⇒ QueryInstance
constructor
Initialize the QueryInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#language ⇒ String
The language.
-
#model_build_sid ⇒ String
The model_build_sid.
-
#query ⇒ String
The query.
-
#results ⇒ Hash
The results.
-
#sample_sid ⇒ String
The sample_sid.
-
#sid ⇒ String
The sid.
-
#source_channel ⇒ String
The source_channel.
-
#status ⇒ String
The status.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(sample_sid: :unset, status: :unset) ⇒ QueryInstance
Update the QueryInstance.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, assistant_sid: nil, sid: nil) ⇒ QueryInstance
Initialize the QueryInstance
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 272 def initialize(version, payload, assistant_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'results' => payload['results'], 'language' => payload['language'], 'model_build_sid' => payload['model_build_sid'], 'query' => payload['query'], 'sample_sid' => payload['sample_sid'], 'assistant_sid' => payload['assistant_sid'], 'sid' => payload['sid'], 'status' => payload['status'], 'url' => payload['url'], 'source_channel' => payload['source_channel'], } # Context @instance_context = nil @params = {'assistant_sid' => assistant_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The account_sid.
310 311 312 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 310 def account_sid @properties['account_sid'] end |
#assistant_sid ⇒ String
Returns The assistant_sid.
358 359 360 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 358 def assistant_sid @properties['assistant_sid'] end |
#context ⇒ QueryContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
301 302 303 304 305 306 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 301 def context unless @instance_context @instance_context = QueryContext.new(@version, @params['assistant_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date_created.
316 317 318 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 316 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
322 323 324 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 322 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the QueryInstance
405 406 407 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 405 def delete context.delete end |
#fetch ⇒ QueryInstance
Fetch a QueryInstance
389 390 391 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 389 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
418 419 420 421 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 418 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Understand.QueryInstance #{values}>" end |
#language ⇒ String
Returns The language.
334 335 336 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 334 def language @properties['language'] end |
#model_build_sid ⇒ String
Returns The model_build_sid.
340 341 342 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 340 def model_build_sid @properties['model_build_sid'] end |
#query ⇒ String
Returns The query.
346 347 348 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 346 def query @properties['query'] end |
#results ⇒ Hash
Returns The results.
328 329 330 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 328 def results @properties['results'] end |
#sample_sid ⇒ String
Returns The sample_sid.
352 353 354 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 352 def sample_sid @properties['sample_sid'] end |
#sid ⇒ String
Returns The sid.
364 365 366 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 364 def sid @properties['sid'] end |
#source_channel ⇒ String
Returns The source_channel.
382 383 384 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 382 def source_channel @properties['source_channel'] end |
#status ⇒ String
Returns The status.
370 371 372 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 370 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
411 412 413 414 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 411 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Understand.QueryInstance #{values}>" end |
#update(sample_sid: :unset, status: :unset) ⇒ QueryInstance
Update the QueryInstance
398 399 400 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 398 def update(sample_sid: :unset, status: :unset) context.update(sample_sid: sample_sid, status: status, ) end |
#url ⇒ String
Returns The url.
376 377 378 |
# File 'lib/twilio-ruby/rest/preview/understand/assistant/query.rb', line 376 def url @properties['url'] end |