Method: OrderCloud::MeApi#patch_with_http_info

Defined in:
lib/order_cloud/api/me_api.rb

#patch_with_http_info(user, opts = {}) ⇒ Array<(User, Fixnum, Hash)>

Returns User data, response status code and response headers.

Parameters:

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

    the optional parameters

Returns:

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

    User data, response status code and response headers



1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
# File 'lib/order_cloud/api/me_api.rb', line 1406

def patch_with_http_info(user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MeApi.patch ..."
  end
  # verify the required parameter 'user' is set
  fail ArgumentError, "Missing the required parameter 'user' when calling MeApi.patch" if user.nil?
  # resource path
  local_var_path = "/me".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(user)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'User')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MeApi#patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end