Class: Twilio::REST::Knowledge::V2::SearchList::KnowledgeSearch

Inherits:
Object
  • Object
show all
Defined in:
lib/twilio-ruby/rest/knowledge/v2/search.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ KnowledgeSearch

Returns a new instance of KnowledgeSearch.



27
28
29
30
31
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 27

def initialize(payload)
        @query = payload["query"]
        @top = payload["top"]
        @knowledge_ids = payload["knowledge_ids"]
end

Instance Attribute Details

#knowledge_idsObject

Parameters:

  • : (query)
    String

    The query to search the knowledge source.

  • : (top)
    String

    The top K results to return.

  • : (knowledge_ids)
    Array<String>

    The list of knowledge IDs to search.



26
27
28
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 26

def knowledge_ids
  @knowledge_ids
end

#queryObject

Parameters:

  • : (query)
    String

    The query to search the knowledge source.

  • : (top)
    String

    The top K results to return.

  • : (knowledge_ids)
    Array<String>

    The list of knowledge IDs to search.



26
27
28
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 26

def query
  @query
end

#topObject

Parameters:

  • : (query)
    String

    The query to search the knowledge source.

  • : (top)
    String

    The top K results to return.

  • : (knowledge_ids)
    Array<String>

    The list of knowledge IDs to search.



26
27
28
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 26

def top
  @top
end

Instance Method Details

#to_json(options = {}) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 32

def to_json(options = {})
{
        "query": @query,
        "top": @top,
        "knowledgeIds": @knowledge_ids,
}.to_json(options)
end