Class: Twilio::REST::Knowledge::V2::SearchList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Knowledge::V2::SearchList
- Defined in:
- lib/twilio-ruby/rest/knowledge/v2/search.rb
Defined Under Namespace
Classes: KnowledgeSearch
Instance Method Summary collapse
-
#create(knowledge_search: :unset) ⇒ SearchInstance
Create the SearchInstance.
-
#create_with_metadata(knowledge_search: :unset) ⇒ SearchInstance
Create the SearchInstanceMetadata.
-
#initialize(version, kb_id: nil) ⇒ SearchList
constructor
Initialize the SearchList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, kb_id: nil) ⇒ SearchList
Initialize the SearchList
46 47 48 49 50 51 52 53 54 |
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 46 def initialize(version, kb_id: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Path Solution @solution = { kb_id: kb_id } @uri = "/KnowledgeBases/#{@solution[:kb_id]}/Search" end |
Instance Method Details
#create(knowledge_search: :unset) ⇒ SearchInstance
Create the SearchInstance
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 59 def create(knowledge_search: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.create('POST', @uri, headers: headers, data: knowledge_search.to_json) SearchInstance.new( @version, payload, kb_id: @solution[:kb_id], ) end |
#create_with_metadata(knowledge_search: :unset) ⇒ SearchInstance
Create the SearchInstanceMetadata
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 80 def (knowledge_search: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' response = @version.('POST', @uri, headers: headers, data: knowledge_search.to_json) search_instance = SearchInstance.new( @version, response.body, kb_id: @solution[:kb_id], ) SearchInstanceMetadata.new( @version, search_instance, response.headers, response.status_code ) end |
#to_s ⇒ Object
Provide a user friendly representation
107 108 109 |
# File 'lib/twilio-ruby/rest/knowledge/v2/search.rb', line 107 def to_s '#<Twilio.Knowledge.V2.SearchList>' end |