Method: PureCloud::SuggestApi#post_suggest_with_http_info

Defined in:
lib/purecloud/api/suggest_api.rb

#post_suggest_with_http_info(body, opts = {}) ⇒ Array<(JsonNodeSearchResponse, Fixnum, Hash)>

Suggest resources.

Parameters:

  • body

    Search request options

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :profile (BOOLEAN)

    profile

Returns:

  • (Array<(JsonNodeSearchResponse, Fixnum, Hash)>)

    JsonNodeSearchResponse data, response status code and response headers



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/purecloud/api/suggest_api.rb', line 241

def post_suggest_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SuggestApi#post_suggest ..."
  end
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_suggest" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/search/suggest".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'profile'] = opts[:'profile'] if opts[:'profile']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'JsonNodeSearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SuggestApi#post_suggest\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end