class Bfwd::SearchApi
Attributes
Public Class Methods
# File lib/bf_ruby2/api/search_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Returns the results of the global search specified by the query-string. {"nickname":"Search an organizations data","response":"getSearchByID.html"} @param query_string The query string used to search. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Array<String>] :types A list of entities which will be checked when searching @option opts [Integer] :offset The starting index of the search results. (default to 0) @option opts [Integer] :records The number of search results to return. (default to 10) @option opts [BOOLEAN] :wildcard Toggle if we search for full words or whether a wildcard is used. (default to false) @option opts [BOOLEAN] :entity Is an entity returned with the search results. (default to false) @return [SearchResultPagedMetadata]
# File lib/bf_ruby2/api/search_api.rb, line 34 def perform_search(query_string, opts = {}) data, _status_code, _headers = perform_search_with_http_info(query_string, opts) return data end
Returns the results of the global search specified by the query-string. {"nickname":"Search an organizations data","response":"getSearchByID.html"} @param query_string The query string used to search. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Array<String>] :types A list of entities which will be checked when searching @option opts [Integer] :offset The starting index of the search results. @option opts [Integer] :records The number of search results to return. @option opts [BOOLEAN] :wildcard Toggle if we search for full words or whether a wildcard is used. @option opts [BOOLEAN] :entity Is an entity returned with the search results. @return [Array<(SearchResultPagedMetadata
, Fixnum, Hash)>] SearchResultPagedMetadata
data, response status code and response headers
# File lib/bf_ruby2/api/search_api.rb, line 50 def perform_search_with_http_info(query_string, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SearchApi.perform_search ..." end # verify the required parameter 'query_string' is set if @api_client.config.client_side_validation && query_string.nil? fail ArgumentError, "Missing the required parameter 'query_string' when calling SearchApi.perform_search" end # resource path local_var_path = "/search/{query-string}".sub('{' + 'query-string' + '}', query_string.to_s) # query parameters query_params = {} query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil? query_params[:'types'] = @api_client.build_collection_param(opts[:'types'], :multi) if !opts[:'types'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil? query_params[:'wildcard'] = opts[:'wildcard'] if !opts[:'wildcard'].nil? query_params[:'entity'] = opts[:'entity'] if !opts[:'entity'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SearchResultPagedMetadata') if @api_client.config.debugging @api_client.config.logger.debug "API called: SearchApi#perform_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end