class OrderCloud::CostCenterApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/order_cloud/api/cost_center_api.rb, line 30
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create(buyer_id, cost_center, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center @param [Hash] opts the optional parameters @return [CostCenter]

# File lib/order_cloud/api/cost_center_api.rb, line 40
def create(buyer_id, cost_center, opts = {})
  data, _status_code, _headers = create_with_http_info(buyer_id, cost_center, opts)
  return data
end
create_with_http_info(buyer_id, cost_center, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center @param [Hash] opts the optional parameters @return [Array<(CostCenter, Fixnum, Hash)>] CostCenter data, response status code and response headers

# File lib/order_cloud/api/cost_center_api.rb, line 51
def create_with_http_info(buyer_id, cost_center, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CostCenterApi.create ..."
  end
  # verify the required parameter 'buyer_id' is set
  fail ArgumentError, "Missing the required parameter 'buyer_id' when calling CostCenterApi.create" if buyer_id.nil?
  # verify the required parameter 'cost_center' is set
  fail ArgumentError, "Missing the required parameter 'cost_center' when calling CostCenterApi.create" if cost_center.nil?
  # resource path
  local_var_path = "/buyers/{buyerID}/costcenters".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s)

  # 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(cost_center)
  auth_names = ['oauth2']
  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 => 'CostCenter')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CostCenterApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete(buyer_id, cost_center_id, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center_id ID of the cost center. @param [Hash] opts the optional parameters @return [nil]

# File lib/order_cloud/api/cost_center_api.rb, line 101
def delete(buyer_id, cost_center_id, opts = {})
  delete_with_http_info(buyer_id, cost_center_id, opts)
  return nil
end
delete_assignment(buyer_id, cost_center_id, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center_id ID of the cost center. @param [Hash] opts the optional parameters @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @return [nil]

# File lib/order_cloud/api/cost_center_api.rb, line 163
def delete_assignment(buyer_id, cost_center_id, opts = {})
  delete_assignment_with_http_info(buyer_id, cost_center_id, opts)
  return nil
end
delete_assignment_with_http_info(buyer_id, cost_center_id, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center_id ID of the cost center. @param [Hash] opts the optional parameters @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/order_cloud/api/cost_center_api.rb, line 176
def delete_assignment_with_http_info(buyer_id, cost_center_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CostCenterApi.delete_assignment ..."
  end
  # verify the required parameter 'buyer_id' is set
  fail ArgumentError, "Missing the required parameter 'buyer_id' when calling CostCenterApi.delete_assignment" if buyer_id.nil?
  # verify the required parameter 'cost_center_id' is set
  fail ArgumentError, "Missing the required parameter 'cost_center_id' when calling CostCenterApi.delete_assignment" if cost_center_id.nil?
  # resource path
  local_var_path = "/buyers/{buyerID}/costcenters/{costCenterID}/assignments".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'costCenterID' + '}', cost_center_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'userID'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'userGroupID'] = opts[:'user_group_id'] if !opts[:'user_group_id'].nil?

  # 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 = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CostCenterApi#delete_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_with_http_info(buyer_id, cost_center_id, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center_id ID of the cost center. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/order_cloud/api/cost_center_api.rb, line 112
def delete_with_http_info(buyer_id, cost_center_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CostCenterApi.delete ..."
  end
  # verify the required parameter 'buyer_id' is set
  fail ArgumentError, "Missing the required parameter 'buyer_id' when calling CostCenterApi.delete" if buyer_id.nil?
  # verify the required parameter 'cost_center_id' is set
  fail ArgumentError, "Missing the required parameter 'cost_center_id' when calling CostCenterApi.delete" if cost_center_id.nil?
  # resource path
  local_var_path = "/buyers/{buyerID}/costcenters/{costCenterID}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'costCenterID' + '}', cost_center_id.to_s)

  # 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 = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CostCenterApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get(buyer_id, cost_center_id, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center_id ID of the cost center. @param [Hash] opts the optional parameters @return [CostCenter]

# File lib/order_cloud/api/cost_center_api.rb, line 227
def get(buyer_id, cost_center_id, opts = {})
  data, _status_code, _headers = get_with_http_info(buyer_id, cost_center_id, opts)
  return data
end
get_with_http_info(buyer_id, cost_center_id, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center_id ID of the cost center. @param [Hash] opts the optional parameters @return [Array<(CostCenter, Fixnum, Hash)>] CostCenter data, response status code and response headers

# File lib/order_cloud/api/cost_center_api.rb, line 238
def get_with_http_info(buyer_id, cost_center_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CostCenterApi.get ..."
  end
  # verify the required parameter 'buyer_id' is set
  fail ArgumentError, "Missing the required parameter 'buyer_id' when calling CostCenterApi.get" if buyer_id.nil?
  # verify the required parameter 'cost_center_id' is set
  fail ArgumentError, "Missing the required parameter 'cost_center_id' when calling CostCenterApi.get" if cost_center_id.nil?
  # resource path
  local_var_path = "/buyers/{buyerID}/costcenters/{costCenterID}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'costCenterID' + '}', cost_center_id.to_s)

  # 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 = nil
  auth_names = ['oauth2']
  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 => 'CostCenter')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CostCenterApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list(buyer_id, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param [Hash] opts the optional parameters @option opts [String] :search Search of the cost center. @option opts [Array<String>] :search_on Search on of the cost center. @option opts [Array<String>] :sort_by Sort by of the cost center. @option opts [Integer] :page Page of the cost center. @option opts [Integer] :page_size Page size of the cost center. @option opts [Hash<String, String>] :filters Filters of the cost center. @return [ListCostCenter]

# File lib/order_cloud/api/cost_center_api.rb, line 293
def list(buyer_id, opts = {})
  data, _status_code, _headers = list_with_http_info(buyer_id, opts)
  return data
end
list_assignments(buyer_id, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param [Hash] opts the optional parameters @option opts [String] :cost_center_id ID of the cost center. @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @option opts [String] :level Level of the cost center. @option opts [Integer] :page Page of the cost center. @option opts [Integer] :page_size Page size of the cost center. @return [ListCostCenterAssignment]

# File lib/order_cloud/api/cost_center_api.rb, line 368
def list_assignments(buyer_id, opts = {})
  data, _status_code, _headers = list_assignments_with_http_info(buyer_id, opts)
  return data
end
list_assignments_with_http_info(buyer_id, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param [Hash] opts the optional parameters @option opts [String] :cost_center_id ID of the cost center. @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @option opts [String] :level Level of the cost center. @option opts [Integer] :page Page of the cost center. @option opts [Integer] :page_size Page size of the cost center. @return [Array<(ListCostCenterAssignment, Fixnum, Hash)>] ListCostCenterAssignment data, response status code and response headers

# File lib/order_cloud/api/cost_center_api.rb, line 384
def list_assignments_with_http_info(buyer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CostCenterApi.list_assignments ..."
  end
  # verify the required parameter 'buyer_id' is set
  fail ArgumentError, "Missing the required parameter 'buyer_id' when calling CostCenterApi.list_assignments" if buyer_id.nil?
  # resource path
  local_var_path = "/buyers/{buyerID}/costcenters/assignments".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'costCenterID'] = opts[:'cost_center_id'] if !opts[:'cost_center_id'].nil?
  query_params[:'userID'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'userGroupID'] = opts[:'user_group_id'] if !opts[:'user_group_id'].nil?
  query_params[:'level'] = opts[:'level'] if !opts[:'level'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # 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 = nil
  auth_names = ['oauth2']
  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 => 'ListCostCenterAssignment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CostCenterApi#list_assignments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_with_http_info(buyer_id, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param [Hash] opts the optional parameters @option opts [String] :search Search of the cost center. @option opts [Array<String>] :search_on Search on of the cost center. @option opts [Array<String>] :sort_by Sort by of the cost center. @option opts [Integer] :page Page of the cost center. @option opts [Integer] :page_size Page size of the cost center. @option opts [Hash<String, String>] :filters Filters of the cost center. @return [Array<(ListCostCenter, Fixnum, Hash)>] ListCostCenter data, response status code and response headers

# File lib/order_cloud/api/cost_center_api.rb, line 309
def list_with_http_info(buyer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CostCenterApi.list ..."
  end
  # verify the required parameter 'buyer_id' is set
  fail ArgumentError, "Missing the required parameter 'buyer_id' when calling CostCenterApi.list" if buyer_id.nil?
  # resource path
  local_var_path = "/buyers/{buyerID}/costcenters".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'searchOn'] = @api_client.build_collection_param(opts[:'search_on'], :csv) if !opts[:'search_on'].nil?
  query_params[:'sortBy'] = @api_client.build_collection_param(opts[:'sort_by'], :csv) if !opts[:'sort_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil?

  # 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 = nil
  auth_names = ['oauth2']
  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 => 'ListCostCenter')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CostCenterApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch(buyer_id, cost_center_id, cost_center, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center_id ID of the cost center. @param cost_center @param [Hash] opts the optional parameters @return [CostCenter]

# File lib/order_cloud/api/cost_center_api.rb, line 439
def patch(buyer_id, cost_center_id, cost_center, opts = {})
  data, _status_code, _headers = patch_with_http_info(buyer_id, cost_center_id, cost_center, opts)
  return data
end
patch_with_http_info(buyer_id, cost_center_id, cost_center, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center_id ID of the cost center. @param cost_center @param [Hash] opts the optional parameters @return [Array<(CostCenter, Fixnum, Hash)>] CostCenter data, response status code and response headers

# File lib/order_cloud/api/cost_center_api.rb, line 451
def patch_with_http_info(buyer_id, cost_center_id, cost_center, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CostCenterApi.patch ..."
  end
  # verify the required parameter 'buyer_id' is set
  fail ArgumentError, "Missing the required parameter 'buyer_id' when calling CostCenterApi.patch" if buyer_id.nil?
  # verify the required parameter 'cost_center_id' is set
  fail ArgumentError, "Missing the required parameter 'cost_center_id' when calling CostCenterApi.patch" if cost_center_id.nil?
  # verify the required parameter 'cost_center' is set
  fail ArgumentError, "Missing the required parameter 'cost_center' when calling CostCenterApi.patch" if cost_center.nil?
  # resource path
  local_var_path = "/buyers/{buyerID}/costcenters/{costCenterID}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'costCenterID' + '}', cost_center_id.to_s)

  # 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(cost_center)
  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 => 'CostCenter')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CostCenterApi#patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
save_assignment(buyer_id, assignment, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param assignment @param [Hash] opts the optional parameters @return [nil]

# File lib/order_cloud/api/cost_center_api.rb, line 503
def save_assignment(buyer_id, assignment, opts = {})
  save_assignment_with_http_info(buyer_id, assignment, opts)
  return nil
end
save_assignment_with_http_info(buyer_id, assignment, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param assignment @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/order_cloud/api/cost_center_api.rb, line 514
def save_assignment_with_http_info(buyer_id, assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CostCenterApi.save_assignment ..."
  end
  # verify the required parameter 'buyer_id' is set
  fail ArgumentError, "Missing the required parameter 'buyer_id' when calling CostCenterApi.save_assignment" if buyer_id.nil?
  # verify the required parameter 'assignment' is set
  fail ArgumentError, "Missing the required parameter 'assignment' when calling CostCenterApi.save_assignment" if assignment.nil?
  # resource path
  local_var_path = "/buyers/{buyerID}/costcenters/assignments".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s)

  # 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(assignment)
  auth_names = ['oauth2']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CostCenterApi#save_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update(buyer_id, cost_center_id, cost_center, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center_id ID of the cost center. @param cost_center @param [Hash] opts the optional parameters @return [CostCenter]

# File lib/order_cloud/api/cost_center_api.rb, line 564
def update(buyer_id, cost_center_id, cost_center, opts = {})
  data, _status_code, _headers = update_with_http_info(buyer_id, cost_center_id, cost_center, opts)
  return data
end
update_with_http_info(buyer_id, cost_center_id, cost_center, opts = {}) click to toggle source

@param buyer_id ID of the buyer. @param cost_center_id ID of the cost center. @param cost_center @param [Hash] opts the optional parameters @return [Array<(CostCenter, Fixnum, Hash)>] CostCenter data, response status code and response headers

# File lib/order_cloud/api/cost_center_api.rb, line 576
def update_with_http_info(buyer_id, cost_center_id, cost_center, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CostCenterApi.update ..."
  end
  # verify the required parameter 'buyer_id' is set
  fail ArgumentError, "Missing the required parameter 'buyer_id' when calling CostCenterApi.update" if buyer_id.nil?
  # verify the required parameter 'cost_center_id' is set
  fail ArgumentError, "Missing the required parameter 'cost_center_id' when calling CostCenterApi.update" if cost_center_id.nil?
  # verify the required parameter 'cost_center' is set
  fail ArgumentError, "Missing the required parameter 'cost_center' when calling CostCenterApi.update" if cost_center.nil?
  # resource path
  local_var_path = "/buyers/{buyerID}/costcenters/{costCenterID}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'costCenterID' + '}', cost_center_id.to_s)

  # 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(cost_center)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CostCenter')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CostCenterApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end