Class: Twilio::REST::Knowledge::V2::SearchInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Knowledge::V2::SearchInstance
- Defined in:
- lib/twilio-ruby/rest/knowledge/v2/search.rb
Instance Method Summary collapse
- #chunks ⇒ Array<KnowledgeChunkResult>
-
#context ⇒ SearchContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#create(knowledge_search: :unset) ⇒ SearchInstance
Create the SearchInstance.
-
#initialize(version, payload, kb_id: nil) ⇒ SearchInstance
constructor
Initialize the SearchInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, payload, kb_id: nil) ⇒ SearchInstance
Initialize the SearchInstance
293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 293 def initialize(version, payload , kb_id: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Marshaled Properties @properties = { 'chunks' => payload['chunks'], } # Context @instance_context = nil @params = { 'kb_id' => kb_id || @properties['kb_id'] , } end |
Instance Method Details
#chunks ⇒ Array<KnowledgeChunkResult>
321 322 323 |
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 321 def chunks @properties['chunks'] end |
#context ⇒ SearchContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
312 313 314 315 316 317 |
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 312 def context unless @instance_context @instance_context = SearchContext.new(@version , @params['kb_id']) end @instance_context end |
#create(knowledge_search: :unset) ⇒ SearchInstance
Create the SearchInstance
329 330 331 332 333 334 335 |
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 329 def create(knowledge_search: :unset ) context.create( knowledge_search: knowledge_search, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
346 347 348 349 |
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 346 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Knowledge.V2.SearchInstance #{values}>" end |
#to_s ⇒ Object
Provide a user friendly representation
339 340 341 342 |
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 339 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Knowledge.V2.SearchInstance #{values}>" end |