class OrderCloud::OrderApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

add_promotion(direction, order_id, promo_code, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param promo_code Promo code of the order. @param [Hash] opts the optional parameters @return [Promotion]

# File lib/order_cloud/api/order_api.rb, line 41
def add_promotion(direction, order_id, promo_code, opts = {})
  data, _status_code, _headers = add_promotion_with_http_info(direction, order_id, promo_code, opts)
  return data
end
add_promotion_with_http_info(direction, order_id, promo_code, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param promo_code Promo code of the order. @param [Hash] opts the optional parameters @return [Array<(Promotion, Fixnum, Hash)>] Promotion data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 53
def add_promotion_with_http_info(direction, order_id, promo_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.add_promotion ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.add_promotion" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.add_promotion" if order_id.nil?
  # verify the required parameter 'promo_code' is set
  fail ArgumentError, "Missing the required parameter 'promo_code' when calling OrderApi.add_promotion" if promo_code.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/promotions/{promoCode}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s).sub('{' + 'promoCode' + '}', promo_code.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(: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 => 'Promotion')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#add_promotion\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
approve(direction, order_id, info, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param info @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 106
def approve(direction, order_id, info, opts = {})
  data, _status_code, _headers = approve_with_http_info(direction, order_id, info, opts)
  return data
end
approve_with_http_info(direction, order_id, info, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param info @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 118
def approve_with_http_info(direction, order_id, info, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.approve ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.approve" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.approve" if order_id.nil?
  # verify the required parameter 'info' is set
  fail ArgumentError, "Missing the required parameter 'info' when calling OrderApi.approve" if info.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/approve".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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(info)
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#approve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
cancel(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 170
def cancel(direction, order_id, opts = {})
  data, _status_code, _headers = cancel_with_http_info(direction, order_id, opts)
  return data
end
cancel_with_http_info(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 181
def cancel_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.cancel ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.cancel" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.cancel" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/cancel".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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(: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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create(direction, order, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 231
def create(direction, order, opts = {})
  data, _status_code, _headers = create_with_http_info(direction, order, opts)
  return data
end
create_with_http_info(direction, order, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 242
def create_with_http_info(direction, order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.create ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.create" if direction.nil?
  # verify the required parameter 'order' is set
  fail ArgumentError, "Missing the required parameter 'order' when calling OrderApi.create" if order.nil?
  # resource path
  local_var_path = "/orders/{direction}".sub('{format}','json').sub('{' + 'direction' + '}', direction.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(order)
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
decline(direction, order_id, info, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param info @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 293
def decline(direction, order_id, info, opts = {})
  data, _status_code, _headers = decline_with_http_info(direction, order_id, info, opts)
  return data
end
decline_with_http_info(direction, order_id, info, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param info @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 305
def decline_with_http_info(direction, order_id, info, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.decline ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.decline" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.decline" if order_id.nil?
  # verify the required parameter 'info' is set
  fail ArgumentError, "Missing the required parameter 'info' when calling OrderApi.decline" if info.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/decline".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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(info)
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#decline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @return [nil]

# File lib/order_cloud/api/order_api.rb, line 357
def delete(direction, order_id, opts = {})
  delete_with_http_info(direction, order_id, opts)
  return nil
end
delete_with_http_info(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 368
def delete_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.delete ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.delete" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.delete" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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: OrderApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 417
def get(direction, order_id, opts = {})
  data, _status_code, _headers = get_with_http_info(direction, order_id, opts)
  return data
end
get_with_http_info(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 428
def get_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.get ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.get" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.get" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list(direction, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param [Hash] opts the optional parameters @option opts [String] :buyer_id ID of the buyer. @option opts [String] :supplier_id ID of the supplier. @option opts [String] :from Lower bound of date range that the order was created. @option opts [String] :to Upper bound of date range that the order was created. @option opts [String] :search Search of the order. @option opts [Array<String>] :search_on Search on of the order. @option opts [Array<String>] :sort_by Sort by of the order. @option opts [Integer] :page Page of the order. @option opts [Integer] :page_size Page size of the order. @option opts [Hash<String, String>] :filters Filters of the order. @return [ListOrder]

# File lib/order_cloud/api/order_api.rb, line 487
def list(direction, opts = {})
  data, _status_code, _headers = list_with_http_info(direction, opts)
  return data
end
list_approvals(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @option opts [String] :search Search of the order. @option opts [Array<String>] :search_on Search on of the order. @option opts [Array<String>] :sort_by Sort by of the order. @option opts [Integer] :page Page of the order. @option opts [Integer] :page_size Page size of the order. @option opts [Hash<String, String>] :filters Filters of the order. @return [ListOrderApproval]

# File lib/order_cloud/api/order_api.rb, line 571
def list_approvals(direction, order_id, opts = {})
  data, _status_code, _headers = list_approvals_with_http_info(direction, order_id, opts)
  return data
end
list_approvals_with_http_info(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @option opts [String] :search Search of the order. @option opts [Array<String>] :search_on Search on of the order. @option opts [Array<String>] :sort_by Sort by of the order. @option opts [Integer] :page Page of the order. @option opts [Integer] :page_size Page size of the order. @option opts [Hash<String, String>] :filters Filters of the order. @return [Array<(ListOrderApproval, Fixnum, Hash)>] ListOrderApproval data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 588
def list_approvals_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.list_approvals ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.list_approvals" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.list_approvals" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/approvals".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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 => 'ListOrderApproval')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#list_approvals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_eligible_approvers(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @option opts [String] :search Search of the order. @option opts [Array<String>] :search_on Search on of the order. @option opts [Array<String>] :sort_by Sort by of the order. @option opts [Integer] :page Page of the order. @option opts [Integer] :page_size Page size of the order. @option opts [Hash<String, String>] :filters Filters of the order. @return [ListUser]

# File lib/order_cloud/api/order_api.rb, line 650
def list_eligible_approvers(direction, order_id, opts = {})
  data, _status_code, _headers = list_eligible_approvers_with_http_info(direction, order_id, opts)
  return data
end
list_eligible_approvers_with_http_info(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @option opts [String] :search Search of the order. @option opts [Array<String>] :search_on Search on of the order. @option opts [Array<String>] :sort_by Sort by of the order. @option opts [Integer] :page Page of the order. @option opts [Integer] :page_size Page size of the order. @option opts [Hash<String, String>] :filters Filters of the order. @return [Array<(ListUser, Fixnum, Hash)>] ListUser data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 667
def list_eligible_approvers_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.list_eligible_approvers ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.list_eligible_approvers" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.list_eligible_approvers" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/eligibleapprovers".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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 => 'ListUser')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#list_eligible_approvers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_promotions(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @option opts [String] :search Search of the order. @option opts [Array<String>] :search_on Search on of the order. @option opts [Array<String>] :sort_by Sort by of the order. @option opts [Integer] :page Page of the order. @option opts [Integer] :page_size Page size of the order. @option opts [Hash<String, String>] :filters Filters of the order. @return [ListOrderPromotion]

# File lib/order_cloud/api/order_api.rb, line 729
def list_promotions(direction, order_id, opts = {})
  data, _status_code, _headers = list_promotions_with_http_info(direction, order_id, opts)
  return data
end
list_promotions_with_http_info(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @option opts [String] :search Search of the order. @option opts [Array<String>] :search_on Search on of the order. @option opts [Array<String>] :sort_by Sort by of the order. @option opts [Integer] :page Page of the order. @option opts [Integer] :page_size Page size of the order. @option opts [Hash<String, String>] :filters Filters of the order. @return [Array<(ListOrderPromotion, Fixnum, Hash)>] ListOrderPromotion data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 746
def list_promotions_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.list_promotions ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.list_promotions" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.list_promotions" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/promotions".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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 => 'ListOrderPromotion')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#list_promotions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_with_http_info(direction, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param [Hash] opts the optional parameters @option opts [String] :buyer_id ID of the buyer. @option opts [String] :supplier_id ID of the supplier. @option opts [String] :from Lower bound of date range that the order was created. @option opts [String] :to Upper bound of date range that the order was created. @option opts [String] :search Search of the order. @option opts [Array<String>] :search_on Search on of the order. @option opts [Array<String>] :sort_by Sort by of the order. @option opts [Integer] :page Page of the order. @option opts [Integer] :page_size Page size of the order. @option opts [Hash<String, String>] :filters Filters of the order. @return [Array<(ListOrder, Fixnum, Hash)>] ListOrder data, response status code and response headers

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

  # query parameters
  query_params = {}
  query_params[:'buyerID'] = opts[:'buyer_id'] if !opts[:'buyer_id'].nil?
  query_params[:'supplierID'] = opts[:'supplier_id'] if !opts[:'supplier_id'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
  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 => 'ListOrder')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch(direction, order_id, partial_order, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param partial_order @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 803
def patch(direction, order_id, partial_order, opts = {})
  data, _status_code, _headers = patch_with_http_info(direction, order_id, partial_order, opts)
  return data
end
patch_billing_address(direction, order_id, address, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param address @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 868
def patch_billing_address(direction, order_id, address, opts = {})
  data, _status_code, _headers = patch_billing_address_with_http_info(direction, order_id, address, opts)
  return data
end
patch_billing_address_with_http_info(direction, order_id, address, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param address @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 880
def patch_billing_address_with_http_info(direction, order_id, address, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.patch_billing_address ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.patch_billing_address" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.patch_billing_address" if order_id.nil?
  # verify the required parameter 'address' is set
  fail ArgumentError, "Missing the required parameter 'address' when calling OrderApi.patch_billing_address" if address.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/billto".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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(address)
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#patch_billing_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch_shipping_address(direction, order_id, address, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param address @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 933
def patch_shipping_address(direction, order_id, address, opts = {})
  data, _status_code, _headers = patch_shipping_address_with_http_info(direction, order_id, address, opts)
  return data
end
patch_shipping_address_with_http_info(direction, order_id, address, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param address @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 945
def patch_shipping_address_with_http_info(direction, order_id, address, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.patch_shipping_address ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.patch_shipping_address" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.patch_shipping_address" if order_id.nil?
  # verify the required parameter 'address' is set
  fail ArgumentError, "Missing the required parameter 'address' when calling OrderApi.patch_shipping_address" if address.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/shipto".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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(address)
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#patch_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch_with_http_info(direction, order_id, partial_order, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param partial_order @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 815
def patch_with_http_info(direction, order_id, partial_order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.patch ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.patch" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.patch" if order_id.nil?
  # verify the required parameter 'partial_order' is set
  fail ArgumentError, "Missing the required parameter 'partial_order' when calling OrderApi.patch" if partial_order.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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(partial_order)
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
remove_promotion(direction, order_id, promo_code, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param promo_code Promo code of the order. @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 998
def remove_promotion(direction, order_id, promo_code, opts = {})
  data, _status_code, _headers = remove_promotion_with_http_info(direction, order_id, promo_code, opts)
  return data
end
remove_promotion_with_http_info(direction, order_id, promo_code, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param promo_code Promo code of the order. @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 1010
def remove_promotion_with_http_info(direction, order_id, promo_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.remove_promotion ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.remove_promotion" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.remove_promotion" if order_id.nil?
  # verify the required parameter 'promo_code' is set
  fail ArgumentError, "Missing the required parameter 'promo_code' when calling OrderApi.remove_promotion" if promo_code.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/promotions/{promoCode}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s).sub('{' + 'promoCode' + '}', promo_code.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,
    :return_type => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#remove_promotion\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
set_billing_address(direction, order_id, address, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param address @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 1063
def set_billing_address(direction, order_id, address, opts = {})
  data, _status_code, _headers = set_billing_address_with_http_info(direction, order_id, address, opts)
  return data
end
set_billing_address_with_http_info(direction, order_id, address, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param address @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 1075
def set_billing_address_with_http_info(direction, order_id, address, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.set_billing_address ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.set_billing_address" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.set_billing_address" if order_id.nil?
  # verify the required parameter 'address' is set
  fail ArgumentError, "Missing the required parameter 'address' when calling OrderApi.set_billing_address" if address.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/billto".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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(address)
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#set_billing_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
set_shipping_address(direction, order_id, address, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param address @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 1128
def set_shipping_address(direction, order_id, address, opts = {})
  data, _status_code, _headers = set_shipping_address_with_http_info(direction, order_id, address, opts)
  return data
end
set_shipping_address_with_http_info(direction, order_id, address, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param address @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 1140
def set_shipping_address_with_http_info(direction, order_id, address, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.set_shipping_address ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.set_shipping_address" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.set_shipping_address" if order_id.nil?
  # verify the required parameter 'address' is set
  fail ArgumentError, "Missing the required parameter 'address' when calling OrderApi.set_shipping_address" if address.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/shipto".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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(address)
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#set_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
ship(direction, order_id, shipment, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param shipment @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 1193
def ship(direction, order_id, shipment, opts = {})
  data, _status_code, _headers = ship_with_http_info(direction, order_id, shipment, opts)
  return data
end
ship_with_http_info(direction, order_id, shipment, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param shipment @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 1205
def ship_with_http_info(direction, order_id, shipment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.ship ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.ship" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.ship" if order_id.nil?
  # verify the required parameter 'shipment' is set
  fail ArgumentError, "Missing the required parameter 'shipment' when calling OrderApi.ship" if shipment.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/ship".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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(shipment)
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#ship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
submit(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 1257
def submit(direction, order_id, opts = {})
  data, _status_code, _headers = submit_with_http_info(direction, order_id, opts)
  return data
end
submit_with_http_info(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 1268
def submit_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.submit ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.submit" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.submit" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/submit".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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(: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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#submit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update(direction, order_id, order, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param order @param [Hash] opts the optional parameters @return [Order]

# File lib/order_cloud/api/order_api.rb, line 1319
def update(direction, order_id, order, opts = {})
  data, _status_code, _headers = update_with_http_info(direction, order_id, order, opts)
  return data
end
update_with_http_info(direction, order_id, order, opts = {}) click to toggle source

@param direction Direction of the order. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param order @param [Hash] opts the optional parameters @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers

# File lib/order_cloud/api/order_api.rb, line 1331
def update_with_http_info(direction, order_id, order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OrderApi.update ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling OrderApi.update" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.update" if order_id.nil?
  # verify the required parameter 'order' is set
  fail ArgumentError, "Missing the required parameter 'order' when calling OrderApi.update" if order.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_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(order)
  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 => 'Order')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end