class OrderCloud::ShipmentApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

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

@param shipment @param [Hash] opts the optional parameters @return [Shipment]

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

@param shipment @param [Hash] opts the optional parameters @return [Array<(Shipment, Fixnum, Hash)>] Shipment data, response status code and response headers

# File lib/order_cloud/api/shipment_api.rb, line 49
def create_with_http_info(shipment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ShipmentApi.create ..."
  end
  # verify the required parameter 'shipment' is set
  fail ArgumentError, "Missing the required parameter 'shipment' when calling ShipmentApi.create" if shipment.nil?
  # resource path
  local_var_path = "/shipments".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(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 => 'Shipment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ShipmentApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete(shipment_id, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param [Hash] opts the optional parameters @return [nil]

# File lib/order_cloud/api/shipment_api.rb, line 96
def delete(shipment_id, opts = {})
  delete_with_http_info(shipment_id, opts)
  return nil
end
delete_item(shipment_id, order_id, line_item_id, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param order_id ID of the order. @param line_item_id ID of the line item. @param [Hash] opts the optional parameters @return [nil]

# File lib/order_cloud/api/shipment_api.rb, line 154
def delete_item(shipment_id, order_id, line_item_id, opts = {})
  delete_item_with_http_info(shipment_id, order_id, line_item_id, opts)
  return nil
end
delete_item_with_http_info(shipment_id, order_id, line_item_id, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param order_id ID of the order. @param line_item_id ID of the line item. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/order_cloud/api/shipment_api.rb, line 166
def delete_item_with_http_info(shipment_id, order_id, line_item_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ShipmentApi.delete_item ..."
  end
  # verify the required parameter 'shipment_id' is set
  fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentApi.delete_item" if shipment_id.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling ShipmentApi.delete_item" if order_id.nil?
  # verify the required parameter 'line_item_id' is set
  fail ArgumentError, "Missing the required parameter 'line_item_id' when calling ShipmentApi.delete_item" if line_item_id.nil?
  # resource path
  local_var_path = "/shipments/{shipmentID}/items/{orderID}/{lineItemID}".sub('{format}','json').sub('{' + 'shipmentID' + '}', shipment_id.to_s).sub('{' + 'orderID' + '}', order_id.to_s).sub('{' + 'lineItemID' + '}', line_item_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: ShipmentApi#delete_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_with_http_info(shipment_id, opts = {}) click to toggle source

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

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

@param shipment_id ID of the shipment. @param [Hash] opts the optional parameters @return [Shipment]

# File lib/order_cloud/api/shipment_api.rb, line 216
def get(shipment_id, opts = {})
  data, _status_code, _headers = get_with_http_info(shipment_id, opts)
  return data
end
get_item(shipment_id, order_id, line_item_id, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param order_id ID of the order. @param line_item_id ID of the line item. @param [Hash] opts the optional parameters @return [ShipmentItem]

# File lib/order_cloud/api/shipment_api.rb, line 275
def get_item(shipment_id, order_id, line_item_id, opts = {})
  data, _status_code, _headers = get_item_with_http_info(shipment_id, order_id, line_item_id, opts)
  return data
end
get_item_with_http_info(shipment_id, order_id, line_item_id, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param order_id ID of the order. @param line_item_id ID of the line item. @param [Hash] opts the optional parameters @return [Array<(ShipmentItem, Fixnum, Hash)>] ShipmentItem data, response status code and response headers

# File lib/order_cloud/api/shipment_api.rb, line 287
def get_item_with_http_info(shipment_id, order_id, line_item_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ShipmentApi.get_item ..."
  end
  # verify the required parameter 'shipment_id' is set
  fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentApi.get_item" if shipment_id.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling ShipmentApi.get_item" if order_id.nil?
  # verify the required parameter 'line_item_id' is set
  fail ArgumentError, "Missing the required parameter 'line_item_id' when calling ShipmentApi.get_item" if line_item_id.nil?
  # resource path
  local_var_path = "/shipments/{shipmentID}/items/{orderID}/{lineItemID}".sub('{format}','json').sub('{' + 'shipmentID' + '}', shipment_id.to_s).sub('{' + 'orderID' + '}', order_id.to_s).sub('{' + 'lineItemID' + '}', line_item_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 => 'ShipmentItem')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ShipmentApi#get_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_with_http_info(shipment_id, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param [Hash] opts the optional parameters @return [Array<(Shipment, Fixnum, Hash)>] Shipment data, response status code and response headers

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

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

# File lib/order_cloud/api/shipment_api.rb, line 344
def list(opts = {})
  data, _status_code, _headers = list_with_http_info(opts)
  return data
end
list_items(shipment_id, opts = {}) click to toggle source

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

# File lib/order_cloud/api/shipment_api.rb, line 418
def list_items(shipment_id, opts = {})
  data, _status_code, _headers = list_items_with_http_info(shipment_id, opts)
  return data
end
list_items_with_http_info(shipment_id, opts = {}) click to toggle source

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

# File lib/order_cloud/api/shipment_api.rb, line 434
def list_items_with_http_info(shipment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ShipmentApi.list_items ..."
  end
  # verify the required parameter 'shipment_id' is set
  fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentApi.list_items" if shipment_id.nil?
  # resource path
  local_var_path = "/shipments/{shipmentID}/items".sub('{format}','json').sub('{' + 'shipmentID' + '}', shipment_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 => 'ListShipmentItem')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ShipmentApi#list_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_with_http_info(opts = {}) click to toggle source

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

# File lib/order_cloud/api/shipment_api.rb, line 360
def list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ShipmentApi.list ..."
  end
  # resource path
  local_var_path = "/shipments".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'orderID'] = opts[:'order_id'] if !opts[:'order_id'].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 => 'ListShipment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ShipmentApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch(shipment_id, shipment, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param shipment @param [Hash] opts the optional parameters @return [Shipment]

# File lib/order_cloud/api/shipment_api.rb, line 488
def patch(shipment_id, shipment, opts = {})
  data, _status_code, _headers = patch_with_http_info(shipment_id, shipment, opts)
  return data
end
patch_with_http_info(shipment_id, shipment, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param shipment @param [Hash] opts the optional parameters @return [Array<(Shipment, Fixnum, Hash)>] Shipment data, response status code and response headers

# File lib/order_cloud/api/shipment_api.rb, line 499
def patch_with_http_info(shipment_id, shipment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ShipmentApi.patch ..."
  end
  # verify the required parameter 'shipment_id' is set
  fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentApi.patch" if shipment_id.nil?
  # verify the required parameter 'shipment' is set
  fail ArgumentError, "Missing the required parameter 'shipment' when calling ShipmentApi.patch" if shipment.nil?
  # resource path
  local_var_path = "/shipments/{shipmentID}".sub('{format}','json').sub('{' + 'shipmentID' + '}', shipment_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(: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 => 'Shipment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ShipmentApi#patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
save_item(shipment_id, item, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param item @param [Hash] opts the optional parameters @return [ShipmentItem]

# File lib/order_cloud/api/shipment_api.rb, line 549
def save_item(shipment_id, item, opts = {})
  data, _status_code, _headers = save_item_with_http_info(shipment_id, item, opts)
  return data
end
save_item_with_http_info(shipment_id, item, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param item @param [Hash] opts the optional parameters @return [Array<(ShipmentItem, Fixnum, Hash)>] ShipmentItem data, response status code and response headers

# File lib/order_cloud/api/shipment_api.rb, line 560
def save_item_with_http_info(shipment_id, item, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ShipmentApi.save_item ..."
  end
  # verify the required parameter 'shipment_id' is set
  fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentApi.save_item" if shipment_id.nil?
  # verify the required parameter 'item' is set
  fail ArgumentError, "Missing the required parameter 'item' when calling ShipmentApi.save_item" if item.nil?
  # resource path
  local_var_path = "/shipments/{shipmentID}/items".sub('{format}','json').sub('{' + 'shipmentID' + '}', shipment_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(item)
  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 => 'ShipmentItem')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ShipmentApi#save_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update(shipment_id, shipment, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param shipment @param [Hash] opts the optional parameters @return [Shipment]

# File lib/order_cloud/api/shipment_api.rb, line 610
def update(shipment_id, shipment, opts = {})
  data, _status_code, _headers = update_with_http_info(shipment_id, shipment, opts)
  return data
end
update_with_http_info(shipment_id, shipment, opts = {}) click to toggle source

@param shipment_id ID of the shipment. @param shipment @param [Hash] opts the optional parameters @return [Array<(Shipment, Fixnum, Hash)>] Shipment data, response status code and response headers

# File lib/order_cloud/api/shipment_api.rb, line 621
def update_with_http_info(shipment_id, shipment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ShipmentApi.update ..."
  end
  # verify the required parameter 'shipment_id' is set
  fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentApi.update" if shipment_id.nil?
  # verify the required parameter 'shipment' is set
  fail ArgumentError, "Missing the required parameter 'shipment' when calling ShipmentApi.update" if shipment.nil?
  # resource path
  local_var_path = "/shipments/{shipmentID}".sub('{format}','json').sub('{' + 'shipmentID' + '}', shipment_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(: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 => 'Shipment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ShipmentApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end