Skip to content

Commit

Permalink
feat(DiscoveryV1): make prefix mandatory in get_autocompletion
Browse files Browse the repository at this point in the history
  • Loading branch information
mamoonraja committed Oct 4, 2019
1 parent 1b61518 commit bbbc537
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/ibm_watson/discovery_v1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1729,33 +1729,35 @@ def federated_query_notices(environment_id:, collection_ids:, filter: nil, query
end

##
# @!method get_autocompletion(environment_id:, collection_id:, field: nil, prefix: nil, count: nil)
# @!method get_autocompletion(environment_id:, collection_id:, prefix:, field: nil, count: nil)
# Get Autocomplete Suggestions.
# Returns completion query suggestions for the specified prefix. /n/n
# **Important:** this method is only valid when using the Cloud Pak version of
# Discovery.
# @param environment_id [String] The ID of the environment.
# @param collection_id [String] The ID of the collection.
# @param field [String] The field in the result documents that autocompletion suggestions are identified
# from.
# @param prefix [String] The prefix to use for autocompletion. For example, the prefix `Ho` could
# autocomplete to `Hot`, `Housing`, or `How do I upgrade`. Possible completions are.
# @param field [String] The field in the result documents that autocompletion suggestions are identified
# from.
# @param count [Fixnum] The number of autocompletion suggestions to return.
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
def get_autocompletion(environment_id:, collection_id:, field: nil, prefix: nil, count: nil)
def get_autocompletion(environment_id:, collection_id:, prefix:, field: nil, count: nil)
raise ArgumentError.new("environment_id must be provided") if environment_id.nil?

raise ArgumentError.new("collection_id must be provided") if collection_id.nil?

raise ArgumentError.new("prefix must be provided") if prefix.nil?

headers = {
}
sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_autocompletion")
headers.merge!(sdk_headers)

params = {
"version" => @version,
"field" => field,
"prefix" => prefix,
"field" => field,
"count" => count
}

Expand Down

0 comments on commit bbbc537

Please sign in to comment.